summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
Diffstat (limited to 'svtools')
-rw-r--r--svtools/bmpmaker/bmp.cxx903
-rw-r--r--svtools/bmpmaker/bmp.hrc78
-rw-r--r--svtools/bmpmaker/bmp.src150
-rw-r--r--svtools/bmpmaker/makefile.mk135
-rw-r--r--svtools/inc/adrparse.hxx144
-rw-r--r--svtools/inc/calendar.hxx521
-rw-r--r--svtools/inc/cntnrsrt.hxx210
-rw-r--r--svtools/inc/cntwids.hrc549
-rw-r--r--svtools/inc/ctrlbox.hxx524
-rw-r--r--svtools/inc/ctrltool.hxx257
-rw-r--r--svtools/inc/expander.hxx131
-rw-r--r--svtools/inc/filectrl.hrc68
-rw-r--r--svtools/inc/filectrl.hxx155
-rw-r--r--svtools/inc/filedlg.hxx142
-rw-r--r--svtools/inc/flbytes.hxx209
-rw-r--r--svtools/inc/fltdefs.hxx196
-rw-r--r--svtools/inc/gifread.hxx269
-rw-r--r--svtools/inc/gradwrap.hxx111
-rw-r--r--svtools/inc/htmlkywd.hxx716
-rw-r--r--svtools/inc/htmltokn.h749
-rw-r--r--svtools/inc/inetdef.hxx65
-rw-r--r--svtools/inc/inetmsg.hxx65
-rw-r--r--svtools/inc/inetstrm.hxx65
-rw-r--r--svtools/inc/iniadrtk.hxx94
-rw-r--r--svtools/inc/inidef.hxx177
-rw-r--r--svtools/inc/iniprop.hxx98
-rw-r--r--svtools/inc/instrm.hxx117
-rw-r--r--svtools/inc/itemdel.hxx72
-rw-r--r--svtools/inc/jpeg.hxx209
-rw-r--r--svtools/inc/memberid.hrc77
-rw-r--r--svtools/inc/msgrd.hxx71
-rw-r--r--svtools/inc/msgwr.hxx72
-rw-r--r--svtools/inc/numuno.hxx132
-rw-r--r--svtools/inc/outstrm.hxx103
-rw-r--r--svtools/inc/poolcach.hxx91
-rw-r--r--svtools/inc/prgsbar.hxx134
-rw-r--r--svtools/inc/privsplt.hxx119
-rw-r--r--svtools/inc/propctrl.hxx154
-rw-r--r--svtools/inc/property.hxx639
-rw-r--r--svtools/inc/reginfo.hxx98
-rw-r--r--svtools/inc/reqitem.hxx104
-rw-r--r--svtools/inc/ruler.hxx928
-rw-r--r--svtools/inc/scrwin.hxx145
-rw-r--r--svtools/inc/sectctr.hxx187
-rw-r--r--svtools/inc/sfxecode.hxx143
-rw-r--r--svtools/inc/sgfbram.hxx201
-rw-r--r--svtools/inc/sgffilt.hxx82
-rw-r--r--svtools/inc/sgvmain.hxx391
-rw-r--r--svtools/inc/sgvspln.hxx107
-rw-r--r--svtools/inc/stdmenu.hxx278
-rw-r--r--svtools/inc/strmadpt.hxx180
-rw-r--r--svtools/inc/svimpbox.hxx362
-rw-r--r--svtools/inc/svimpicn.hxx354
-rw-r--r--svtools/inc/svipcdef.h102
-rw-r--r--svtools/inc/svtool.h71
-rw-r--r--svtools/inc/sychconv.hxx85
-rw-r--r--svtools/inc/tabbar.hxx565
-rw-r--r--svtools/inc/taskbar.hxx537
-rw-r--r--svtools/inc/testtool.hxx112
-rw-r--r--svtools/inc/twain.hxx132
-rw-r--r--svtools/inc/txtattr.hxx241
-rw-r--r--svtools/inc/txtcmp.hxx236
-rw-r--r--svtools/inc/urihelper.hxx228
-rw-r--r--svtools/inc/urlbmk.hxx133
-rw-r--r--svtools/inc/wallitem.hxx230
-rw-r--r--svtools/inc/whiter.hxx91
-rw-r--r--svtools/inc/whmap.hxx92
-rw-r--r--svtools/inc/xbmread.hxx181
-rw-r--r--svtools/inc/xmlcnimp.hxx179
-rw-r--r--svtools/inc/xmlement.hxx77
-rw-r--r--svtools/inc/xpmread.hxx165
-rw-r--r--svtools/inc/zforfind.hxx261
-rw-r--r--svtools/prj/d.lst267
-rw-r--r--svtools/source/brwbox/brwbox1.cxx2396
-rw-r--r--svtools/source/brwbox/brwbox2.cxx2021
-rw-r--r--svtools/source/brwbox/brwhead.cxx144
-rw-r--r--svtools/source/brwbox/datwin.cxx694
-rw-r--r--svtools/source/brwbox/datwin.hxx269
-rw-r--r--svtools/source/brwbox/makefile.mk99
-rw-r--r--svtools/source/config/makefile.mk82
-rw-r--r--svtools/source/config/pathoptions.cxx409
-rw-r--r--svtools/source/config/useroptions.cxx325
-rw-r--r--svtools/source/contnr/cont_pch.cxx73
-rw-r--r--svtools/source/contnr/ctrdll.cxx113
-rw-r--r--svtools/source/contnr/makefile.mk134
-rw-r--r--svtools/source/contnr/svicnvw.cxx855
-rw-r--r--svtools/source/contnr/svimpbox.cxx3171
-rw-r--r--svtools/source/contnr/svimpicn.cxx4222
-rw-r--r--svtools/source/contnr/svlbitm.cxx449
-rw-r--r--svtools/source/contnr/svlbox.cxx1691
-rw-r--r--svtools/source/contnr/svtabbx.cxx639
-rw-r--r--svtools/source/contnr/svtreebx.cxx2355
-rw-r--r--svtools/source/contnr/treelist.cxx2146
-rw-r--r--svtools/source/control/calendar.cxx2963
-rw-r--r--svtools/source/control/calendar.src166
-rw-r--r--svtools/source/control/ctrlbox.cxx1227
-rw-r--r--svtools/source/control/ctrlbox.src85
-rw-r--r--svtools/source/control/ctrldll.cxx112
-rw-r--r--svtools/source/control/ctrltool.cxx865
-rw-r--r--svtools/source/control/ctrltool.src425
-rw-r--r--svtools/source/control/filectrl.cxx307
-rw-r--r--svtools/source/control/filectrl.src85
-rw-r--r--svtools/source/control/fmtfield.cxx1017
-rw-r--r--svtools/source/control/headbar.cxx1673
-rw-r--r--svtools/source/control/makefile.mk141
-rw-r--r--svtools/source/control/prgsbar.cxx270
-rw-r--r--svtools/source/control/reginfo.cxx785
-rw-r--r--svtools/source/control/ruler.cxx3064
-rw-r--r--svtools/source/control/scrwin.cxx603
-rw-r--r--svtools/source/control/stdctrl.cxx77
-rw-r--r--svtools/source/control/stdmenu.cxx446
-rw-r--r--svtools/source/control/tabbar.cxx2588
-rw-r--r--svtools/source/control/taskbar.cxx645
-rw-r--r--svtools/source/control/taskbox.cxx406
-rw-r--r--svtools/source/control/taskmisc.cxx416
-rw-r--r--svtools/source/control/taskstat.cxx769
-rw-r--r--svtools/source/control/valueset.cxx2461
-rw-r--r--svtools/source/dialogs/colctrl.cxx814
-rw-r--r--svtools/source/dialogs/colrdlg.cxx358
-rw-r--r--svtools/source/dialogs/colrdlg.hrc101
-rw-r--r--svtools/source/dialogs/colrdlg.src576
-rw-r--r--svtools/source/dialogs/filedlg.cxx185
-rw-r--r--svtools/source/dialogs/filedlg2.cxx1377
-rw-r--r--svtools/source/dialogs/filedlg2.hrc75
-rw-r--r--svtools/source/dialogs/filedlg2.hxx255
-rw-r--r--svtools/source/dialogs/filedlg2.src422
-rw-r--r--svtools/source/dialogs/makefile.mk93
-rw-r--r--svtools/source/dialogs/mcvmath.cxx336
-rw-r--r--svtools/source/dialogs/mcvmath.hxx264
-rw-r--r--svtools/source/dialogs/printdlg.cxx527
-rw-r--r--svtools/source/dialogs/printdlg.hrc95
-rw-r--r--svtools/source/dialogs/printdlg.src616
-rw-r--r--svtools/source/dialogs/prnsetup.cxx444
-rw-r--r--svtools/source/dialogs/prnsetup.hrc78
-rw-r--r--svtools/source/dialogs/prnsetup.src966
-rw-r--r--svtools/source/dialogs/propctrl.cxx534
-rw-r--r--svtools/source/dialogs/property.cxx1582
-rw-r--r--svtools/source/dialogs/wizdlg.cxx678
-rw-r--r--svtools/source/edit/makefile.mk135
-rw-r--r--svtools/source/edit/svmedit.cxx1396
-rw-r--r--svtools/source/edit/sychconv.cxx139
-rw-r--r--svtools/source/edit/textdat2.hxx338
-rw-r--r--svtools/source/edit/textdata.cxx329
-rw-r--r--svtools/source/edit/textdoc.cxx1073
-rw-r--r--svtools/source/edit/textdoc.hxx202
-rw-r--r--svtools/source/edit/texteng.cxx2691
-rw-r--r--svtools/source/edit/textund2.hxx182
-rw-r--r--svtools/source/edit/textundo.cxx374
-rw-r--r--svtools/source/edit/textundo.hxx118
-rw-r--r--svtools/source/edit/textview.cxx1760
-rw-r--r--svtools/source/edit/txtattr.cxx157
-rw-r--r--svtools/source/edit/xtextedt.cxx444
-rw-r--r--svtools/source/filerec/filerec.cxx1039
-rw-r--r--svtools/source/filerec/makefile.mk85
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.cxx129
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.hrc73
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.hxx105
-rw-r--r--svtools/source/filter.vcl/filter/dlgejpg.src266
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.cxx517
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.hrc92
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.hxx152
-rw-r--r--svtools/source/filter.vcl/filter/dlgexpor.src809
-rw-r--r--svtools/source/filter.vcl/filter/filter.cxx2735
-rw-r--r--svtools/source/filter.vcl/filter/filter2.cxx1427
-rw-r--r--svtools/source/filter.vcl/filter/fldll.cxx110
-rw-r--r--svtools/source/filter.vcl/filter/gradwrap.cxx619
-rw-r--r--svtools/source/filter.vcl/filter/makefile.mk137
-rw-r--r--svtools/source/filter.vcl/filter/sgf.ini118
-rw-r--r--svtools/source/filter.vcl/filter/sgfbram.cxx696
-rw-r--r--svtools/source/filter.vcl/filter/sgvmain.cxx1220
-rw-r--r--svtools/source/filter.vcl/filter/sgvspln.cxx1115
-rw-r--r--svtools/source/filter.vcl/filter/sgvtext.cxx1370
-rw-r--r--svtools/source/filter.vcl/filter/strings.hrc61
-rw-r--r--svtools/source/filter.vcl/filter/strings.src117
-rw-r--r--svtools/source/filter.vcl/igif/decode.cxx245
-rw-r--r--svtools/source/filter.vcl/igif/decode.hxx102
-rw-r--r--svtools/source/filter.vcl/igif/gifread.cxx890
-rw-r--r--svtools/source/filter.vcl/igif/makefile.mk96
-rw-r--r--svtools/source/filter.vcl/ixbm/makefile.mk95
-rw-r--r--svtools/source/filter.vcl/ixbm/xbmread.cxx429
-rw-r--r--svtools/source/filter.vcl/ixpm/makefile.mk95
-rw-r--r--svtools/source/filter.vcl/ixpm/rgbtable.hxx729
-rw-r--r--svtools/source/filter.vcl/ixpm/xpmread.cxx714
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.cxx565
-rw-r--r--svtools/source/filter.vcl/jpeg/makefile.mk96
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.cxx1207
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.hxx129
-rw-r--r--svtools/source/filter.vcl/wmf/enhwmf.cxx1077
-rw-r--r--svtools/source/filter.vcl/wmf/makefile.mk97
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx1262
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.hxx687
-rw-r--r--svtools/source/filter.vcl/wmf/winwmf.cxx886
-rw-r--r--svtools/source/filter.vcl/wmf/wmf.cxx147
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.cxx1787
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.hxx245
-rw-r--r--svtools/source/items/aeitem.cxx296
-rw-r--r--svtools/source/items/eitem.cxx81
-rw-r--r--svtools/source/items/flagitem.cxx205
-rw-r--r--svtools/source/items/intitem.cxx306
-rw-r--r--svtools/source/items/itemdel.cxx175
-rw-r--r--svtools/source/items/macitem.cxx395
-rw-r--r--svtools/source/items/makefile.mk176
-rw-r--r--svtools/source/items/poolcach.cxx186
-rw-r--r--svtools/source/items/ptitem.cxx204
-rw-r--r--svtools/source/items/rectitem.cxx211
-rw-r--r--svtools/source/items/rngitem.cxx383
-rw-r--r--svtools/source/items/stritem.cxx106
-rw-r--r--svtools/source/items/style.cxx1201
-rw-r--r--svtools/source/items/szitem.cxx214
-rw-r--r--svtools/source/items/wallitem.cxx694
-rw-r--r--svtools/source/memtools/makefile.mk118
-rw-r--r--svtools/source/memtools/svarray.cxx415
-rw-r--r--svtools/source/misc/config.src1005
-rw-r--r--svtools/source/misc/errtxt.src2778
-rw-r--r--svtools/source/misc/makefile.mk160
-rw-r--r--svtools/source/misc/urihelper.cxx683
-rw-r--r--svtools/source/misc/vcldata.cxx84
-rw-r--r--svtools/source/notify/brdcst.cxx281
-rw-r--r--svtools/source/notify/cancel.cxx221
-rw-r--r--svtools/source/notify/hint.cxx79
-rw-r--r--svtools/source/notify/isethint.cxx117
-rw-r--r--svtools/source/notify/lstner.cxx223
-rw-r--r--svtools/source/notify/makefile.mk123
-rw-r--r--svtools/source/notify/smplhint.cxx79
-rw-r--r--svtools/source/numbers/makefile.mk122
-rw-r--r--svtools/source/numbers/nbdll.cxx113
-rw-r--r--svtools/source/numbers/numfmuno.cxx1137
-rw-r--r--svtools/source/numbers/numfmuno.hxx364
-rw-r--r--svtools/source/numbers/numhead.cxx323
-rw-r--r--svtools/source/numbers/numhead.hxx142
-rw-r--r--svtools/source/numbers/numuno.cxx193
-rw-r--r--svtools/source/numbers/supservs.cxx264
-rw-r--r--svtools/source/numbers/supservs.hxx142
-rw-r--r--svtools/source/numbers/zforfind.cxx2316
-rw-r--r--svtools/source/numbers/zforlist.cxx3657
-rw-r--r--svtools/source/numbers/zformat.cxx3469
-rw-r--r--svtools/source/numbers/zforscan.cxx2406
-rw-r--r--svtools/source/numbers/zforscan.hxx254
-rw-r--r--svtools/source/plugapp/commtest.cxx303
-rw-r--r--svtools/source/plugapp/commtest.hrc68
-rw-r--r--svtools/source/plugapp/commtest.src94
-rw-r--r--svtools/source/plugapp/makefile.mk111
-rw-r--r--svtools/source/plugapp/testtool.hrc89
-rw-r--r--svtools/source/plugapp/testtool.src622
-rw-r--r--svtools/source/plugapp/ttprops.cxx119
-rw-r--r--svtools/source/svdde/ddecli.cxx509
-rw-r--r--svtools/source/svdde/ddedata.cxx253
-rw-r--r--svtools/source/svdde/ddedll.cxx96
-rw-r--r--svtools/source/svdde/ddeimp.hxx215
-rw-r--r--svtools/source/svdde/ddeinf.cxx212
-rw-r--r--svtools/source/svdde/ddeml1.cxx2689
-rw-r--r--svtools/source/svdde/ddeml2.cxx1157
-rw-r--r--svtools/source/svdde/ddemldeb.cxx311
-rw-r--r--svtools/source/svdde/ddemldeb.hxx100
-rw-r--r--svtools/source/svdde/ddemlimp.hxx467
-rw-r--r--svtools/source/svdde/ddemlos2.h411
-rw-r--r--svtools/source/svdde/ddestrg.cxx109
-rw-r--r--svtools/source/svdde/ddesvr.cxx1136
-rw-r--r--svtools/source/svdde/makefile.mk123
-rw-r--r--svtools/source/svhtml/htmlkey2.cxx700
-rw-r--r--svtools/source/svhtml/htmlkywd.cxx1099
-rw-r--r--svtools/source/svhtml/htmlout.cxx708
-rw-r--r--svtools/source/svhtml/htmlsupp.cxx205
-rw-r--r--svtools/source/svhtml/makefile.mk112
-rw-r--r--svtools/source/svhtml/parhtml.cxx2043
-rw-r--r--svtools/source/svrtf/makefile.mk105
-rw-r--r--svtools/source/svrtf/parrtf.cxx591
-rw-r--r--svtools/source/svrtf/rtfkey2.cxx1112
-rw-r--r--svtools/source/svrtf/rtfkeywd.cxx1198
-rw-r--r--svtools/source/svrtf/rtfkeywd.hxx1197
-rw-r--r--svtools/source/svrtf/rtfout.cxx224
-rw-r--r--svtools/source/svrtf/rtfout.hxx93
-rw-r--r--svtools/source/svrtf/rtftoken.h1304
-rw-r--r--svtools/source/svrtf/svparser.cxx692
-rw-r--r--svtools/source/svsql/converter.cxx75
-rw-r--r--svtools/source/svsql/converter.hxx76
-rw-r--r--svtools/source/svsql/makefile.mk124
-rw-r--r--svtools/source/undo/makefile.mk88
-rw-r--r--svtools/source/undo/undo.cxx988
-rw-r--r--svtools/source/uno/makefile.mk253
-rw-r--r--svtools/source/uno/registerservices.cxx187
-rw-r--r--svtools/source/uno/unoifac2.hrc86
-rw-r--r--svtools/source/uno/unoifac2.src223
-rw-r--r--svtools/source/uno/unoiface.cxx1756
-rw-r--r--svtools/source/urlobj/inetimg.cxx236
-rw-r--r--svtools/source/urlobj/makefile.mk89
-rw-r--r--svtools/unx/inc/convert.hxx97
-rw-r--r--svtools/unx/source/svdde/ddedummy.cxx367
-rw-r--r--svtools/unx/source/svdde/makefile.mk85
-rw-r--r--svtools/util/makefile.mk472
-rw-r--r--svtools/win/res/makefile.mk61
-rw-r--r--svtools/workben/browser.cxx882
-rw-r--r--svtools/workben/cui/loadlib.cxx121
-rw-r--r--svtools/workben/cui/makefile.mk106
-rw-r--r--svtools/workben/makefile.mk180
-rw-r--r--svtools/workben/stest.cxx239
-rw-r--r--svtools/workben/svdem.cxx1176
-rw-r--r--svtools/workben/urange.cxx251
298 files changed, 159381 insertions, 0 deletions
diff --git a/svtools/bmpmaker/bmp.cxx b/svtools/bmpmaker/bmp.cxx
new file mode 100644
index 000000000000..bd2fc1cf65bc
--- /dev/null
+++ b/svtools/bmpmaker/bmp.cxx
@@ -0,0 +1,903 @@
+/*************************************************************************
+ *
+ * $RCSfile: bmp.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <string.h>
+#include <tools/stream.hxx>
+#include <tools/fsys.hxx>
+#include <tools/new.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/window.hxx>
+#include <vcl/wrkwin.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/menu.hxx>
+#include <vcl/config.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/edit.hxx>
+#include <vcl/group.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/bmpacc.hxx>
+#include <solar.hrc>
+#include <filedlg.hxx>
+#include "bmp.hrc"
+
+// -----------
+// - Defines -
+// -----------
+
+#define SOLAR_PATH "s:\\solenv\\res"
+#define LANG_ALL "Alle Sprachen"
+#define FILETEST(FileEntry) ((FileEntry).Exists())
+
+// --------------
+// - Exit codes -
+// --------------
+
+#define EXIT_NOERROR 0
+#define EXIT_MISSING_BITMAP 1
+#define EXIT_NOSRSFILE 2
+#define EXIT_NOIMGLIST 3
+#define EXIT_DIMENSIONERROR 4
+#define EXIT_IOERROR 5
+#define EXIT_COMMONERROR 6
+#define EXIT_MISSING_RESOURCE 7
+#define EXIT_COLORDEPTHERROR 8
+
+// -----------
+// - Globals -
+// -----------
+
+char LangDir[][ 9 ] = { "deut", "enus", "fren", "ital", "dtch", "span", "dan", "swed", "port", "japn", "chinsim", "chintrad", "russ", "pol", "arab", "greek", "korean" , "turk" };
+USHORT LangNum[] = { 49, 1, 33, 39, 31, 34, 45, 46, 03, 81, 86, 88, 07, 48, 96, 30, 82, 90};
+
+// ------------
+// - LangInfo -
+// ------------
+
+struct LangInfo
+{
+ String maLangDir;
+ USHORT mnLangNum;
+
+ LangInfo( const String& rLangDir, USHORT nLangNum ) : maLangDir( rLangDir ), mnLangNum( nLangNum ) {}
+};
+
+// ----------
+// - BmpApp -
+// ----------
+
+class BmpWin;
+
+class BmpApp : public Application
+{
+private:
+
+ BmpWin* pBmpWin;
+ String aOutputFileName;
+ BYTE cExitCode;
+
+ DECL_LINK( Select, Menu* pMenu );
+
+ BOOL GetCommandOption( const String& rSwitch, String& rSwitchParam );
+
+public:
+
+ void Main( );
+ void SetExitCode( BYTE cExit )
+ {
+ if( ( EXIT_NOERROR == cExitCode ) || ( cExit != EXIT_NOERROR ) )
+ cExitCode = cExit;
+ }
+};
+
+// -----------------------------------------------------------------------
+
+BmpApp aBmpApp;
+
+// ----------
+// - Pathes -
+// ----------
+
+class Pathes : public ModalDialog
+{
+ OKButton aBtnOk;
+ CancelButton aBtnCancel;
+ GroupBox aGrpPath;
+ FixedText aFtSrs;
+ FixedText aFtRes;
+ FixedText aFtOut;
+ Edit aEdtSrs;
+ PushButton aBtnSrs;
+ Edit aEdtRes;
+ PushButton aBtnRes;
+ Edit aEdtOut;
+ PushButton aBtnOut;
+ GroupBox aGrpLang;
+ ListBox aLbLang;
+
+ DECL_LINK( ClickSrsHdl, void* );
+ DECL_LINK( ClickResHdl, void* );
+ DECL_LINK( ClickOutHdl, void* );
+
+
+public:
+
+ Pathes( Window* pParent,
+ const String& rSrsPath,
+ const String& rResPath,
+ const String& rOutPath,
+ const USHORT nLang );
+
+ String GetSrsPath() const { return aEdtSrs.GetText(); }
+ String GetResPath() const { return aEdtRes.GetText(); }
+ String GetOutPath() const { return aEdtOut.GetText(); }
+
+ USHORT GetLangNum() const { return aLbLang.GetSelectEntryPos(); }
+};
+
+// ----------
+// - BmpWin -
+// ----------
+
+class BmpWin : public WorkWindow
+{
+ VirtualDevice aDev;
+ ListBox aLB;
+ Bitmap aOutBmp;
+ Size aOneSize;
+ Size aTotSize;
+ Point aPos;
+ SvFileStream* pSRS;
+ ULONG nTotCount;
+ USHORT nPos;
+
+ void DoIt( SvStream& rStm, DirEntry&, DirEntry&, String&, String&, const LangInfo& rLang );
+
+public:
+
+ BmpWin( Window* pParent, WinBits nWinStyle );
+
+ void Resize();
+ void StartCreation( const String& rSRSName, const String& rInName,
+ const String& rOutName, const LangInfo& rLang );
+
+ void SetMode( BOOL bMode ) { aLB.SetUpdateMode( bMode ); }
+ void ClearInfo();
+ void WriteInfo( const String& rText, BYTE cExitCode = EXIT_NOERROR );
+};
+
+// ----------
+// - BmpApp -
+// ----------
+
+BOOL BmpApp::GetCommandOption( const String& rSwitch, String& rFollowingParam )
+{
+ BOOL bRet = FALSE;
+
+ for( long i = 0, nCount = GetCommandLineParamCount(); ( i < nCount ) && !bRet; i++ )
+ {
+ String aTestStr( '-' );
+
+ for( long n = 0; ( n < 2 ) && !bRet; n++ )
+ {
+ aTestStr += rSwitch;
+
+ if( aTestStr.CompareIgnoreCaseToAscii( GetCommandLineParam( i ) ) == COMPARE_EQUAL )
+ {
+ bRet = TRUE;
+
+ if( i < ( nCount - 1 ) )
+ rFollowingParam = GetCommandLineParam( i + 1 );
+ else
+ rFollowingParam = String();
+ }
+
+ if( 0 == n )
+ aTestStr = '/';
+ }
+ }
+
+ return bRet;
+}
+
+// -----------------------------------------------------------------------------
+
+void BmpApp::Main( )
+{
+ ResMgr* pAppResMgr = NULL;
+ String aLangDir;
+ String aOutName;
+ int nCmdCount = GetCommandLineParamCount();
+ USHORT nCurCmd = 0;
+
+ cExitCode = EXIT_NOERROR;
+
+ // Param1: filename of *.srs input file with image lists
+ // Param2: path to local bitmaps
+ // Param3: output directory
+ // Param4: Langugage dependent directory
+
+ if( nCmdCount >= 3 )
+ {
+ const String aSrsName( GetCommandLineParam( nCurCmd++ ) );
+ const String aInName( GetCommandLineParam( nCurCmd++ ) );
+ aOutName = GetCommandLineParam( nCurCmd++ );
+
+ pBmpWin = new BmpWin( NULL, WB_APP | WB_STDWORK );
+ pBmpWin->ClearInfo();
+
+ if( nCurCmd < nCmdCount )
+ {
+#if 0
+ GetCommandOption( 'l', aLangDir );
+#else
+ aLangDir = GetCommandLineParam( nCurCmd++ );
+#endif
+ GetCommandOption( 'f', aOutputFileName );
+
+ if( aLangDir.Len() && ( aLangDir.CompareIgnoreCaseToAscii( "all" ) == COMPARE_EQUAL ) )
+ {
+ for ( USHORT i = 0, nCount = ( sizeof( LangNum ) / sizeof( LangNum[ 0 ] ) ); i < nCount; i++ )
+ pBmpWin->StartCreation( aSrsName, aInName, aOutName, LangInfo( String( LangDir[ i ], RTL_TEXTENCODING_UTF8 ), LangNum[ i ] ) );
+ }
+ else
+ {
+ pBmpWin->StartCreation( aSrsName, aInName, aOutName, LangInfo( aLangDir, DirEntry( aOutName ).GetName().ToInt32() ) );
+ }
+ }
+ else
+ pBmpWin->StartCreation( aSrsName, aInName, aOutName, LangInfo( String( LangDir[ 0 ], RTL_TEXTENCODING_UTF8 ), LangNum[ 0 ] ) );
+ }
+ else
+ {
+ ResMgr* pAppResMgr = new ResMgr( String( RTL_CONSTASCII_USTRINGPARAM( "bmp.res" ) ), NULL, NULL );
+ MenuBar aMB;
+ PopupMenu aPB;
+
+ Resource::SetResManager( pAppResMgr );
+
+ aMB.InsertItem( 1, String( RTL_CONSTASCII_USTRINGPARAM( "~ImageList" ) ) );
+ aPB.InsertItem( 1, String( RTL_CONSTASCII_USTRINGPARAM( "~Erstellen..." ) ) );
+ aPB.InsertSeparator();
+ aPB.InsertItem( 2, String( RTL_CONSTASCII_USTRINGPARAM( "~Beenden" ) ) );
+
+ aMB.SetPopupMenu( 1, &aPB );
+ aMB.SetSelectHdl( LINK( this, BmpApp, Select ) );
+
+ pBmpWin = new BmpWin( NULL, WB_APP | WB_STDWORK );
+ pBmpWin->SetMenuBar( &aMB );
+ pBmpWin->Show();
+
+ Execute();
+ delete pBmpWin;
+ }
+
+ Resource::SetResManager( NULL );
+ delete pAppResMgr;
+
+ if( ( EXIT_NOERROR == cExitCode ) && aOutputFileName.Len() && aOutName.Len() )
+ {
+ SvFileStream aOStm( aOutputFileName, STREAM_WRITE | STREAM_TRUNC );
+ ByteString aStr( "Successfully generated ImageList(s) in: " );
+
+ aOStm.WriteLine( aStr.Append( ByteString( aOutName, RTL_TEXTENCODING_UTF8 ) ) );
+ aOStm.Close();
+ }
+
+ if ( EXIT_NOERROR != cExitCode )
+ raise( SIGABRT );
+ return;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( BmpApp, Select, Menu*, pMenu )
+{
+ if ( pMenu->GetCurItemId() == 1 )
+ {
+ Config aCfg;
+ aCfg.SetGroup( "Path-Entries" );
+
+ String aSrsPath( String::CreateFromAscii( aCfg.ReadKey( "SRS", ByteString() ).GetBuffer() ) );
+ String aResPath( String::CreateFromAscii( aCfg.ReadKey( "RES", ByteString() ).GetBuffer() ) );
+ String aOutPath( String::CreateFromAscii( aCfg.ReadKey( "OUT", ByteString() ).GetBuffer() ) );
+ USHORT nLanguage = (USHORT) aCfg.ReadKey( "LNG", '1' ).ToInt32();
+ Pathes aPathDlg( pBmpWin, aSrsPath, aResPath, aOutPath, nLanguage );
+
+ if ( aPathDlg.Execute() == RET_OK )
+ {
+ aCfg.WriteKey( "SRS", ByteString( aSrsPath = String( aPathDlg.GetSrsPath() ), RTL_TEXTENCODING_UTF8 ) );
+ aCfg.WriteKey( "RES", ByteString( aResPath = String( aPathDlg.GetResPath() ), RTL_TEXTENCODING_UTF8 ) );
+ aCfg.WriteKey( "OUT", ByteString( aOutPath = String( aPathDlg.GetOutPath() ), RTL_TEXTENCODING_UTF8 ) );
+ aCfg.WriteKey( "LNG", ByteString::CreateFromInt32( nLanguage = aPathDlg.GetLangNum() ) );
+
+ pBmpWin->ClearInfo();
+
+ if ( !nLanguage )
+ {
+ for ( USHORT i = 0, nCount = ( sizeof( LangNum ) / sizeof( LangNum[ 0 ] ) ); i < nCount; i++ )
+ pBmpWin->StartCreation( aSrsPath, aResPath, aOutPath, LangInfo( String( RTL_CONSTASCII_USTRINGPARAM( "deut" ) ), 49 ) );
+ }
+ else
+ pBmpWin->StartCreation( aSrsPath, aResPath, aOutPath, LangInfo( String( RTL_CONSTASCII_USTRINGPARAM( LangDir[ nLanguage - 1 ] ) ), LangNum[ nLanguage - 1 ] ) );
+
+ pBmpWin->WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "DONE!" ) ) );
+ }
+ }
+ else if( pMenu->GetCurItemId() == 2 )
+ Quit();
+
+ return 0;
+}
+
+// ----------
+// - Pathes -
+// ----------
+
+Pathes::Pathes( Window* pParent,
+ const String& rSrsPath,
+ const String& rResPath,
+ const String& rOutPath,
+ const USHORT nLang ) :
+ ModalDialog ( pParent, ResId( DLG_PATH ) ),
+ aGrpPath ( this, ResId( GRP_PATH ) ),
+ aFtSrs ( this, ResId( FT_SRS ) ),
+ aFtRes ( this, ResId( FT_RES ) ),
+ aFtOut ( this, ResId( FT_OUT ) ),
+ aEdtSrs ( this, ResId( EDT_SRS ) ),
+ aBtnSrs ( this, ResId( BTN_SRS ) ),
+ aEdtRes ( this, ResId( EDT_RES ) ),
+ aBtnRes ( this, ResId( BTN_RES ) ),
+ aEdtOut ( this, ResId( EDT_OUT ) ),
+ aBtnOut ( this, ResId( BTN_OUT ) ),
+ aGrpLang ( this, ResId( GRP_LANG ) ),
+ aLbLang ( this, ResId( LB_LANG ) ),
+ aBtnOk ( this, ResId( BTN_OK ) ),
+ aBtnCancel ( this, ResId( BTN_CANCEL ) )
+{
+ FreeResource();
+
+ aBtnSrs.SetClickHdl( LINK( this, Pathes, ClickSrsHdl ) );
+ aBtnRes.SetClickHdl( LINK( this, Pathes, ClickResHdl ) );
+ aBtnOut.SetClickHdl( LINK( this, Pathes, ClickOutHdl ) );
+
+ aEdtSrs.SetText( rSrsPath );
+ aEdtRes.SetText( rResPath );
+ aEdtOut.SetText( rOutPath );
+ aEdtSrs.GrabFocus();
+
+ aLbLang.InsertEntry( String( RTL_CONSTASCII_USTRINGPARAM( LANG_ALL ) ), 0 );
+ for( USHORT i = 1, nCount = ( sizeof( LangNum ) / sizeof( LangNum[ 0 ] ) ); i <= nCount; i++ )
+ aLbLang.InsertEntry( String::CreateFromInt32( LangNum[ i - 1 ] ), i );
+
+ aLbLang.SelectEntryPos( nLang );
+}
+
+// -----------------------------------------------------------------------------
+
+IMPL_LINK( Pathes, ClickSrsHdl, void*, p )
+{
+ FileDialog aFileDlg( this, WB_OPEN | WB_3DLOOK );
+ DirEntry aPath( aEdtSrs.GetText() );
+
+ aFileDlg.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "SRS-Datei mit Imagelisten laden" ) ) );
+ aPath += DirEntry( String( RTL_CONSTASCII_USTRINGPARAM( "*.srs" ) ) );
+ aFileDlg.SetPath( aPath.GetFull() );
+ if ( aFileDlg.Execute() == RET_OK )
+ aEdtSrs.SetText( aFileDlg.GetPath() );
+
+ return 0L;
+}
+
+// -----------------------------------------------------------------------------
+
+IMPL_LINK( Pathes, ClickResHdl, void*, p )
+{
+ PathDialog aPathDlg( this, WB_OPEN | WB_3DLOOK );
+
+ aPathDlg.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Quellpfad BMP-Dateien" ) ) );
+ if ( aPathDlg.Execute() == RET_OK )
+ aEdtRes.SetText( aPathDlg.GetPath() );
+
+ return 0L;
+}
+
+// -----------------------------------------------------------------------------
+
+IMPL_LINK( Pathes, ClickOutHdl, void*, p )
+{
+ PathDialog aPathDlg( this, WB_OPEN | WB_3DLOOK );
+
+ aPathDlg.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "Zielpfad BMP-Dateien" ) ) );
+ if ( aPathDlg.Execute() == RET_OK )
+ aEdtOut.SetText( aPathDlg.GetPath() );
+
+ return 0L;
+}
+
+// ----------
+// - BmpWin -
+// ----------
+
+BmpWin::BmpWin(Window* pParent, WinBits aWinStyle) :
+ WorkWindow ( pParent, aWinStyle ),
+ aLB ( this, WB_HSCROLL | WB_VSCROLL ),
+ nPos ( 0 )
+{
+ SetText( String( RTL_CONSTASCII_USTRINGPARAM( "SVX - BmpMaker" ) ) );
+ aLB.SetUpdateMode( TRUE );
+ aLB.Show();
+}
+
+// -----------------------------------------------------------------------
+
+void BmpWin::StartCreation( const String& rSRSName, const String& rInName,
+ const String& rOutName, const LangInfo& rLang )
+{
+ DirEntry aFileName( rSRSName );
+ DirEntry aInDir( rInName );
+ DirEntry aOutDir( rOutName );
+ BOOL bDone = FALSE;
+
+ aFileName.ToAbs();
+ aInDir.ToAbs();
+ aOutDir.ToAbs();
+
+ pSRS = new SvFileStream ( aFileName.GetFull(), STREAM_STD_READ );
+
+ if( pSRS->GetError() )
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Kein SRS file!" ) ), EXIT_NOSRSFILE );
+ else
+ {
+ String aText;
+ ByteString aByteText;
+ BOOL bLangDep = FALSE;
+
+ do
+ {
+ do
+ {
+ if (!pSRS->ReadLine(aByteText))
+ break;
+ }
+ while ( aByteText.Search( "ImageList" ) == STRING_NOTFOUND );
+
+ do
+ {
+ if (!pSRS->ReadLine( aByteText ) )
+ break;
+ }
+ while ( aByteText.Search( "File" ) == STRING_NOTFOUND );
+ aText = String::CreateFromAscii( aByteText.GetBuffer() );
+
+ USHORT nStart = aText.Search('"') + 1;
+ USHORT nEnd = aText.Search( '"', nStart+1 );
+ String aName( aText, nStart, nEnd-nStart );
+ String aPrefix( aName, 0, 2 );
+
+ do
+ {
+ if( !bLangDep &&
+ aByteText.Search( "File" ) != STRING_NOTFOUND &&
+ aByteText.Search( '[' ) != STRING_NOTFOUND &&
+ aByteText.Search( ']' ) != STRING_NOTFOUND )
+ {
+ bLangDep = TRUE;
+ }
+
+ if (!pSRS->ReadLine(aByteText))
+ break;
+ }
+ while (aByteText.Search( "IdList" ) == STRING_NOTFOUND );
+ aText = String::CreateFromAscii( aByteText.GetBuffer() );
+
+ // if image list is not language dependent,
+ // don't do anything for languages except german
+ if( aText.Len() )
+ {
+ bDone = TRUE;
+ DoIt( *pSRS, aInDir, aOutDir, aPrefix, aName, rLang );
+ }
+ else if( ( rLang.mnLangNum != 49 ) && !bLangDep )
+ {
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "INFO: ImageList is not language dependent! Nothing to do for this language." ) ) );
+ bDone = TRUE;
+ }
+ }
+ while ( aText.Len() );
+ }
+
+ if( !bDone )
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: No ImageList found in SRS file!" ) ), EXIT_NOIMGLIST );
+
+ delete pSRS;
+}
+
+// -----------------------------------------------------------------------
+
+void BmpWin::DoIt( SvStream& rStm, DirEntry& rIn, DirEntry& rOut, String& rPrefix,
+ String& rName, const LangInfo& rLang )
+{
+ String aResPath;
+ const char* pResPath = getenv( "SOLARSRC" );
+
+ if( pResPath )
+ {
+ String aString( String::CreateFromAscii( ByteString( pResPath ).GetBuffer() ) );
+ aResPath = ( DirEntry( aString ) += DirEntry( String( RTL_CONSTASCII_USTRINGPARAM( "res" ) ) ) ).GetFull();
+ }
+ else
+ {
+ aResPath.Assign( String( RTL_CONSTASCII_USTRINGPARAM( "o:\\" ) ) );
+ aResPath.Append( String::CreateFromInt32( SOLARUPD ) );
+ aResPath.Append( String( RTL_CONSTASCII_USTRINGPARAM( "\\res" ) ) );
+ }
+
+ SvFileStream aOutStream;
+ Bitmap aTotalBmp;
+ Bitmap aBmp;
+ Size aSize;
+ String aText;
+ String aString;
+ String aName( rName );
+ String aFileName;
+ ULONG nSRSPos;
+ long nBmpPos = 0L;
+ USHORT nId;
+ USHORT nN = 1;
+ DirEntry aInPath( rIn + DirEntry( String( RTL_CONSTASCII_USTRINGPARAM( "x.bmp" ) ) ) );
+ DirEntry aOutFile( rOut );
+ DirEntry SolarPath1( aResPath );
+ DirEntry SolarPath2( aResPath );
+ String aDefaultName( rPrefix ); aDefaultName.Append( String( RTL_CONSTASCII_USTRINGPARAM( "00000.bmp" ) ) );
+ BOOL bInserted = FALSE;
+ BOOL bFirst = TRUE;
+
+ // Falls nicht deutsch, noch die Vorwahlnummer hintenran
+ if( rLang.mnLangNum != 49 )
+ {
+ String aNumStr( String::CreateFromInt32( rLang.mnLangNum ) );
+
+ if( aNumStr.Len() == 1 )
+ aNumStr.Insert( '0', 0 );
+
+ aName = DirEntry( aName ).GetBase();
+ aName += aNumStr;
+ aName += String( RTL_CONSTASCII_USTRINGPARAM( ".bmp" ) );
+ SolarPath1 += rLang.maLangDir;
+ }
+
+ aOutFile += DirEntry( aName );
+
+ // Die Namen werden spaeter ersetzt
+ SolarPath1 += DirEntry( String( RTL_CONSTASCII_USTRINGPARAM( "x.bmp" ) ) );
+ SolarPath2 += DirEntry( String( RTL_CONSTASCII_USTRINGPARAM( "x.bmp" ) ) );
+
+ // Anzahl der Bitmaps bestimmen
+ for ( nTotCount = 0UL, nSRSPos = pSRS->Tell(); aText.Search( '}' ) == STRING_NOTFOUND; )
+ {
+ ByteString aTmp;
+
+ if ( !pSRS->ReadLine( aTmp ) )
+ break;
+
+ aText.Assign( String::CreateFromAscii( aTmp.GetBuffer() ) );
+ aText.EraseLeadingChars( ' ' );
+ aText.EraseLeadingChars( '\t' );
+ aText.EraseAllChars( ';' );
+
+ if ( ByteString( aText, RTL_TEXTENCODING_UTF8 ).IsNumericAscii() )
+ nTotCount++;
+ }
+
+ if( !nTotCount )
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "WARNING: No imagelist resource found: " ) ).Append( aString ), EXIT_MISSING_RESOURCE );
+
+ // Wieder an Anfang und los gehts
+ aText = String();
+ pSRS->Seek( nSRSPos );
+
+ // write info
+ String aInfo( RTL_CONSTASCII_USTRINGPARAM( "CREATING ImageList for language: " ) );
+ aInfo += rLang.maLangDir;
+ aInfo += String( RTL_CONSTASCII_USTRINGPARAM( " [ " ) );
+ aInfo += aInPath.GetPath().GetFull();
+ aInfo += String( RTL_CONSTASCII_USTRINGPARAM( "; " ) );
+ aInfo += SolarPath1.GetPath().GetFull();
+ if( SolarPath2 != SolarPath1 )
+ {
+ aInfo += String( RTL_CONSTASCII_USTRINGPARAM( "; " ) );
+ aInfo += SolarPath2.GetPath().GetFull();
+ }
+ aInfo += String( RTL_CONSTASCII_USTRINGPARAM( " ]" ) );
+ WriteInfo( aInfo );
+
+ for ( ; aText.Search( '}' ) == STRING_NOTFOUND; )
+ {
+ ByteString aTmp;
+
+ if ( !pSRS->ReadLine( aTmp ) )
+ break;
+
+ aText.Assign( String::CreateFromAscii( aTmp.GetBuffer() ) );
+ aText.EraseLeadingChars( ' ' );
+ aText.EraseLeadingChars( '\t' );
+ aText.EraseAllChars( ';' );
+
+ aTmp = ByteString( aText, RTL_TEXTENCODING_UTF8 );
+
+ if( aTmp.IsNumericAscii() )
+ {
+ nId = atoi( aTmp.GetBuffer() );
+
+ if ( nId < 10000 )
+ {
+ const String aTmp( aText );
+
+ aText.Assign( String::CreateFromInt32( 0 ) );
+ aText.Append( aTmp );
+ }
+
+ aString.Assign( rPrefix );
+ aString.Append( aText );
+ aString.Append( String( RTL_CONSTASCII_USTRINGPARAM( ".bmp" ) ) );
+ aInPath.SetName( aString );
+ }
+ else
+ continue;
+
+ if( !FILETEST( aInPath ) )
+ {
+ // Falls nicht deutsch, suchen wir zuerst im jeweiligen Sprach-Unterverz.
+ if( rLang.mnLangNum != 49 )
+ {
+ SolarPath1.SetName( aString );
+
+ if ( !FILETEST( SolarPath1 ) )
+ {
+ SolarPath2.SetName( aString );
+
+ if( !FILETEST( SolarPath2 ) )
+ aBmp = Bitmap();
+ else
+ {
+ SvFileStream aIStm( aFileName = SolarPath2.GetFull(), STREAM_READ );
+ aIStm >> aBmp;
+ }
+ }
+ else
+ {
+ SvFileStream aIStm( aFileName = SolarPath1.GetFull(), STREAM_READ );
+ aIStm >> aBmp;
+ }
+ }
+ else
+ {
+ SolarPath2.SetName( aString );
+
+ if( !FILETEST( SolarPath2 ) )
+ aBmp = Bitmap();
+ else
+ {
+ SvFileStream aIStm( aFileName = SolarPath2.GetFull(), STREAM_READ );
+ aIStm >> aBmp;
+ }
+ }
+ }
+ else
+ {
+ SvFileStream aIStm( aFileName = aInPath.GetFull(), STREAM_READ );
+ aIStm >> aBmp;
+ }
+
+ aSize = aBmp.GetSizePixel();
+
+ // falls Bitmap defekt ist, malen wir ein rotes Kreuz
+ if( !aSize.Width() || !aSize.Height() )
+ {
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "WARNING: Bitmap is missing: " ) ).Append( aString ), EXIT_MISSING_BITMAP );
+
+ aSize = aOneSize;
+
+ if( aSize.Width() && aSize.Height() )
+ {
+ aBmp = Bitmap( aSize, !!aTotalBmp ? aTotalBmp.GetBitCount() : 4 );
+ aBmp.Erase( COL_WHITE );
+
+ BitmapWriteAccess* pAcc = aBmp.AcquireWriteAccess();
+
+ if( pAcc )
+ {
+ Point aPoint;
+ const Rectangle aRect( aPoint, aOneSize );
+
+ pAcc->SetLineColor( Color( COL_LIGHTRED ) );
+ pAcc->DrawRect( aRect );
+ pAcc->DrawLine( aRect.TopLeft(), aRect.BottomRight() );
+ pAcc->DrawLine( aRect.TopRight(), aRect.BottomLeft() );
+ aBmp.ReleaseAccess( pAcc );
+ }
+ }
+ }
+
+ // Beim ersten Mal Zugriffs-Bitmap mit der
+ // richtigen Groesse, 4Bit und der Standardpalette anlegen
+ if( bFirst && aSize.Width() && aSize.Height() )
+ {
+ aTotSize = aOneSize = aSize;
+ aTotSize.Width() *= nTotCount;
+ aTotalBmp = Bitmap( aTotSize, 4 );
+ bFirst = FALSE;
+ }
+
+ if( ( aSize.Width() > aOneSize.Width() ) || ( aSize.Height() > aOneSize.Height() ) )
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Different dimensions in file: " ) ).Append( aString ), EXIT_DIMENSIONERROR );
+ else if( aBmp.GetBitCount() != aTotalBmp.GetBitCount() )
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Different color depth in file: ") ).Append( aString ), EXIT_COLORDEPTHERROR );
+ else
+ {
+ const Rectangle aDst( Point( nBmpPos * aOneSize.Width(), 0L ), aSize );
+ Point aPoint;
+ const Rectangle aSrc( aPoint, aSize );
+
+ if( !!aTotalBmp && !!aBmp && !aDst.IsEmpty() && !aSrc.IsEmpty() )
+ aTotalBmp.CopyPixel( aDst, aSrc, &aBmp );
+ }
+
+ nBmpPos++;
+
+ GetpApp()->Reschedule();
+ }
+
+ if ( !!aTotalBmp && aTotSize.Width() && aTotSize.Height() )
+ {
+ const String aFile( aOutFile.GetFull() );
+
+ aOutStream.Open( aFile, STREAM_WRITE | STREAM_TRUNC );
+
+ if( !aOutStream.IsOpen() )
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Could not open output file: " ) ).Append( aFile ), EXIT_IOERROR );
+ else
+ {
+ aOutStream << aTotalBmp;
+
+ if( aOutStream.GetError() )
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Could not write to output file: " ) ).Append( aFile ), EXIT_IOERROR );
+ else
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "Successfully generated ImageList " ) ).Append( aFile ) );
+
+ aOutStream.Close();
+ }
+ }
+ else
+ WriteInfo( String( RTL_CONSTASCII_USTRINGPARAM( "ERROR: Could not generate " ) ).Append( aOutFile.GetFull() ), EXIT_COMMONERROR );
+
+ WriteInfo( ' ' );
+}
+
+// -----------------------------------------------------------------------
+
+void BmpWin::Resize()
+{
+ aLB.SetPosSizePixel( Point(), GetOutputSizePixel() );
+}
+
+// -----------------------------------------------------------------------
+
+void BmpWin::WriteInfo( const String& rText, BYTE cExitCode )
+{
+ aLB.InsertEntry( rText, nPos );
+ aLB.SelectEntryPos( nPos++ );
+
+ if( EXIT_NOERROR != cExitCode )
+ aBmpApp.SetExitCode( cExitCode );
+
+#ifdef UNX
+ ByteString aText( rText, RTL_TEXTENCODING_UTF8 );
+ aText.Append( "\r\n" );
+ fprintf( stderr, aText.GetBuffer() );
+#else
+ FILE* fp = fopen( "bmp.err", "a+" );
+
+ if( fp )
+ {
+ ByteString aText( rText, RTL_TEXTENCODING_UTF8 );
+ aText.Append( "\n" );
+ fprintf( fp, aText.GetBuffer() );
+ fclose(fp);
+ }
+#endif
+
+/*
+#ifdef WNT
+ if( AllocConsole() )
+ {
+ HANDLE hHdl = GetStdHandle( STD_OUTPUT_HANDLE );
+
+ if( hHdl )
+ {
+ CONSOLE_SCREEN_BUFFER_INFO aInfo;
+
+ if( GetConsoleScreenBufferInfo( hHdl, &aInfo ) )
+ {
+ long nTest = 0;
+ }
+ }
+ }
+#endif
+*/
+}
+
+// -----------------------------------------------------------------------
+
+void BmpWin::ClearInfo()
+{
+ aLB.Clear();
+ Invalidate();
+ nPos = 0;
+}
+
+
diff --git a/svtools/bmpmaker/bmp.hrc b/svtools/bmpmaker/bmp.hrc
new file mode 100644
index 000000000000..55dd3c35b43f
--- /dev/null
+++ b/svtools/bmpmaker/bmp.hrc
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: bmp.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define DLG_PATH 256
+
+#define GRP_PATH 1
+#define FT_SRS 1
+#define FT_RES 2
+#define FT_OUT 3
+#define EDT_SRS 1
+#define EDT_RES 2
+#define EDT_OUT 3
+#define BTN_SRS 1
+#define BTN_RES 2
+#define BTN_OUT 3
+#define BTN_OK 1
+#define BTN_CANCEL 1
+
+#define GRP_LANG 2
+#define LB_LANG 1
diff --git a/svtools/bmpmaker/bmp.src b/svtools/bmpmaker/bmp.src
new file mode 100644
index 000000000000..4763c3c6fe91
--- /dev/null
+++ b/svtools/bmpmaker/bmp.src
@@ -0,0 +1,150 @@
+/*************************************************************************
+ *
+ * $RCSfile: bmp.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "bmp.hrc"
+ModalDialog DLG_PATH {
+ OutputSize = TRUE;
+ SVLook = TRUE;
+ Size = MAP_APPFONT( 301, 104 );
+ Text = "Pfad-Einstellungen";
+ Moveable = TRUE;
+ Closeable = TRUE;
+ GroupBox GRP_PATH {
+ Pos = MAP_APPFONT( 6, 3 );
+ Size = MAP_APPFONT( 243, 59 );
+ Text = "Pfade";
+ };
+ FixedText FT_SRS {
+ Pos = MAP_APPFONT( 12, 16 );
+ Size = MAP_APPFONT( 50, 10 );
+ Text = "SRS-Datei (inkl.Pfad):";
+ };
+ FixedText FT_OUT {
+ Pos = MAP_APPFONT( 12, 46 );
+ Size = MAP_APPFONT( 50, 10 );
+ Text = "Ausgabe-Pfad:";
+ };
+ FixedText FT_RES {
+ Pos = MAP_APPFONT( 12, 31 );
+ Size = MAP_APPFONT( 50, 10 );
+ Text = "Bitmap-Pfad:";
+ };
+ Edit EDT_SRS {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 65, 14 );
+ Size = MAP_APPFONT( 160, 12 );
+ TabStop = TRUE;
+ };
+ Edit EDT_RES {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 65, 29 );
+ Size = MAP_APPFONT( 160, 12 );
+ TabStop = TRUE;
+ };
+ Edit EDT_OUT {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 65, 44 );
+ Size = MAP_APPFONT( 160, 12 );
+ TabStop = TRUE;
+ };
+ PushButton BTN_SRS {
+ Pos = MAP_APPFONT( 228, 14 );
+ Size = MAP_APPFONT( 15, 12 );
+ Text = "...";
+ TabStop = TRUE;
+ };
+ PushButton BTN_RES {
+ Pos = MAP_APPFONT( 228, 29 );
+ Size = MAP_APPFONT( 15, 12 );
+ Text = "...";
+ TabStop = TRUE;
+ };
+ PushButton BTN_OUT {
+ Pos = MAP_APPFONT( 228, 44 );
+ Size = MAP_APPFONT( 15, 12 );
+ Text = "...";
+ TabStop = TRUE;
+ };
+ OKButton BTN_OK {
+ Pos = MAP_APPFONT( 255, 6 );
+ Size = MAP_APPFONT( 40, 12 );
+ TabStop = TRUE;
+ DefButton = TRUE;
+ };
+ CancelButton BTN_CANCEL {
+ Pos = MAP_APPFONT( 255, 21 );
+ Size = MAP_APPFONT( 40, 12 );
+ TabStop = TRUE;
+ };
+ GroupBox GRP_LANG {
+ Pos = MAP_APPFONT( 6, 65 );
+ Size = MAP_APPFONT( 243, 33 );
+ Text = "Sprache";
+ };
+ ListBox LB_LANG {
+ Border = TRUE;
+ Pos = MAP_APPFONT( 12, 76 );
+ Size = MAP_APPFONT( 231, 70 );
+ TabStop = TRUE;
+ DropDown = TRUE;
+ VScroll = TRUE;
+ };
+};
diff --git a/svtools/bmpmaker/makefile.mk b/svtools/bmpmaker/makefile.mk
new file mode 100644
index 000000000000..68db191f561b
--- /dev/null
+++ b/svtools/bmpmaker/makefile.mk
@@ -0,0 +1,135 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:49 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..
+
+PRJNAME=bmpmaker
+TARGET=bmp
+LIBTARGET=NO
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+OBJFILES= $(OBJ)$/bmp.obj
+
+SRC1FILES= bmp.src
+SRS1NAME=bmp
+RES1TARGET=bmp
+SRS1FILES=$(SRS)$/bmp.srs
+
+APP1TARGET= $(TARGET)
+
+.IF "$(GUI)" == "MAC"
+MACRES= $(SV_RES)MPWToolCfrg.r -d SVTOOLNAME="¶"SV TOOL¶""
+.ENDIF
+
+APP1STDLIBS = \
+ $(SVLIB) \
+ $(TOOLSLIB) \
+ $(VOSLIB) \
+ $(SALLIB)
+
+.IF "$(COM)"=="GCC" || "$(GUI)"=="WNT"
+APP1STDLIBS+=$(CPPULIB)
+.ENDIF
+
+APP1DEPN= $(L)$/itools.lib $(SVLIBDEPEND)
+APP1OBJS= $(OBJFILES)
+
+APP1BASE=0x10000000
+
+.IF "$(GUI)"!="UNX"
+APP1STDLIBS+= svtool.lib
+.ELSE
+APP1STDLIBS+= -lsvt$(UPD)$(DLLSUFFIX)
+APP1STDLIBS+= -lsvl$(UPD)$(DLLSUFFIX)
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
+# ------------------------------------------------------------------
+# OS2
+# ------------------------------------------------------------------
+
+.IF "$(GUI)" == "OS2"
+
+$(MISC)$/$(TARGET).def:
+ echo NAME $(TARGET) WINDOWAPI >$@
+ echo DESCRIPTION 'BMP' >>$@
+.IF "$(COM)" != "BLC"
+ echo STUB 'os2STUB.EXE' >>$@
+.ENDIF
+ echo EXETYPE OS2 >>$@
+ echo PROTMODE >>$@
+ echo CODE PRELOAD >>$@
+ echo DATA PRELOAD MULTIPLE >>$@
+ echo HEAPSIZE 8192 >>$@
+ echo STACKSIZE 32768 >>$@
+
+.ENDIF
diff --git a/svtools/inc/adrparse.hxx b/svtools/inc/adrparse.hxx
new file mode 100644
index 000000000000..8417009b08c7
--- /dev/null
+++ b/svtools/inc/adrparse.hxx
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: adrparse.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _ADRPARSE_HXX
+#define _ADRPARSE_HXX
+
+#ifndef _LIST_HXX
+#include <tools/list.hxx>
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+
+//============================================================================
+struct SvAddressEntry_Impl
+{
+ UniString m_aAddrSpec;
+ UniString m_aRealName;
+
+ SvAddressEntry_Impl() {};
+ SvAddressEntry_Impl(UniString const & rTheAddrSpec,
+ UniString const & rTheRealName):
+ m_aAddrSpec(rTheAddrSpec), m_aRealName(rTheRealName) {}
+};
+
+//============================================================================
+DECLARE_LIST(SvAddressList_Impl, SvAddressEntry_Impl *);
+
+//============================================================================
+class SvAddressParser
+{
+ friend class SvAddressParser_Impl;
+
+ SvAddressEntry_Impl m_aFirst;
+ SvAddressList_Impl m_aRest;
+ bool m_bHasFirst;
+
+public:
+ SvAddressParser(UniString const & rInput);
+
+ ~SvAddressParser();
+
+ sal_Int32 Count() const { return m_bHasFirst ? m_aRest.Count() + 1 : 0; }
+
+ inline UniString const & GetEmailAddress(sal_Int32 nIndex) const;
+
+ inline UniString const &GetRealName(sal_Int32 nIndex) const;
+
+ /** Create an RFC 822 <mailbox> (i.e., 'e-mail address').
+
+ @param rPhrase Either an empty string (the <mailbox> will have no
+ <phrase> an will be of the form <addr-spec>), or some text that will
+ become the <phrase> part of a <phrase route-addr> form <mailbox>. Non
+ US-ASCII characters within the text are put into a <qouted-string>
+ verbatim, so the result may actually not be a valid RFC 822 <mailbox>,
+ but a more human-readable representation.
+
+ @param rAddrSpec A valid RFC 822 <addr-spec>. (An RFC 822 <mailbox>
+ including a <route> cannot be created by this method.)
+
+ @param rMailbox If this method returns true, this parameter returns
+ the created RFC 822 <mailbox> (rather, a more human-readable
+ representation thereof). Otherwise, this parameter is not modified.
+
+ @return True, if rAddrSpec is a valid RFC 822 <addr-spec>.
+ */
+ static bool createRFC822Mailbox(String const & rPhrase,
+ String const & rAddrSpec,
+ String & rMailbox);
+};
+
+inline UniString const & SvAddressParser::GetEmailAddress(sal_Int32 nIndex)
+ const
+{
+ return nIndex == 0 ? m_aFirst.m_aAddrSpec :
+ m_aRest.GetObject(nIndex - 1)->m_aAddrSpec;
+}
+
+inline UniString const & SvAddressParser::GetRealName(sal_Int32 nIndex) const
+{
+ return nIndex == 0 ? m_aFirst.m_aRealName :
+ m_aRest.GetObject(nIndex - 1)->m_aRealName;
+}
+
+#endif // _ADRPARSE_HXX
+
diff --git a/svtools/inc/calendar.hxx b/svtools/inc/calendar.hxx
new file mode 100644
index 000000000000..08fce282b501
--- /dev/null
+++ b/svtools/inc/calendar.hxx
@@ -0,0 +1,521 @@
+/*************************************************************************
+ *
+ * $RCSfile: calendar.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _CALENDAR_HXX
+#define _CALENDAR_HXX
+
+#ifndef _INTN_HXX
+#include <tools/intn.hxx>
+#endif
+#ifndef _CTRL_HXX
+#include <vcl/ctrl.hxx>
+#endif
+#ifndef _TIMER_HXX
+#include <vcl/timer.hxx>
+#endif
+#ifndef _FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+
+class Table;
+class MouseEvent;
+class TrackingEvent;
+class KeyEvent;
+class HelpEvent;
+class DataChangedEvent;
+class FloatingWindow;
+class PushButton;
+struct ImplDateInfo;
+class ImplDateTable;
+class ImplCFieldFloatWin;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class Calendar
+
+Diese Klasse erlaubt die Auswahl eines Datum. Der Datumsbereich der
+angezeigt wird, ist der, der durch die Klasse Date vorgegeben ist.
+Es werden soviele Monate angezeigt, wie die Ausgabeflaeche des
+Controls vorgibt. Der Anwender kann zwischen den Monaten ueber ein
+ContextMenu (Bei Click auf den Monatstitel) oder durch 2 ScrollButtons
+zwischen den Monaten wechseln.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_BORDER Um das Fenster wird ein Border gezeichnet.
+WB_TABSTOP Tastatursteuerung ist moeglich. Der Focus wird
+ sich geholt, wenn mit der Maus in das
+ Control geklickt wird.
+WB_QUICKHELPSHOWSDATEINFO DateInfo auch bei QuickInfo als BalloonHelp zeigen
+WB_BOLDTEXT Formatiert wird nach fetten Texten und
+ DIB_BOLD wird bei AddDateInfo() ausgewertet
+WB_FRAMEINFO Formatiert wird so, das Frame-Info angezeigt
+ werden kann und die FrameColor bei AddDateInfo()
+ ausgewertet wird
+WB_RANGESELECT Es koennen mehrere Tage selektiert werden, die
+ jedoch alle zusammenhaengend sein muessen
+WB_MULTISELECT Es koennen mehrere Tage selektiert werden
+WB_WEEKNUMBER Es werden die Wochentage mit angezeigt
+
+--------------------------------------------------------------------------
+
+Mit SetCurDate() / GetCurDate() wird das ausgewaehlte Datum gesetzt und
+abgefragt. Wenn der Anwnder ein Datum selektiert hat, wird Select()
+gerufen. Bei einem Doppelklick auf ein Datum wird DoubleClick() gerufen.
+
+--------------------------------------------------------------------------
+
+Mit CalcWindowSizePixel() kann die Groesse des Fensters in Pixel fuer
+die Darstellung einer bestimmte Anzahl von Monaten berechnet werden.
+
+--------------------------------------------------------------------------
+
+Mit SetSaturdayColor() kann eine spezielle Farbe fuer Sonnabende gesetzt
+werden und mit SetSundayColor() eine fuer Sonntage. Mit AddDateInfo()
+koennen Tage speziell gekennzeichnet werden. Dabei kann man einem
+einzelnen Datum eine andere Farbe geben (zum Beispiel fuer Feiertage)
+oder diese Umranden (zum Beispiel fuer Termine). Wenn beim Datum
+kein Jahr angegeben wird, wird der Tag in jedem Jahr benutzt. Mit
+AddDateInfo() kann auch jedem Datum ein Text mitgegeben werden, der
+dann angezeigt wird, wenn Balloon-Hilfe an ist. Um nicht alle Jahre
+mit entsprechenden Daten zu versorgen, wird der RequestDateInfo()-
+Handler gerufen, wenn ein neues Jahr angezeigt wird. Es kann dann
+im Handler mit GetRequestYear() das Jahr abgefragt werden.
+
+--------------------------------------------------------------------------
+
+Um ein ContextMenu zu einem Datum anzuzeigen, muss man den Command-Handler
+ueberlagern. Mit GetDate() kann zur Mouse-Position das Datum ermittelt
+werden. Bei Tastaturausloesung sollte das aktuelle Datum genommen werden.
+Wenn ein ContextMenu angezeigt wird, darf der Handler der Basisklasse nicht
+gerufen werden.
+
+--------------------------------------------------------------------------
+
+Bei Mehrfachselektion WB_RANGESELECT oder WB_MULTISELECT kann mit
+SelectDate()/SelectDateRange() Datumsbereiche selektiert/deselektiert
+werden. SelectDateRange() gilt inkl. EndDatum. Mit SetNoSelection() kann
+alles deselektiert werden. SetCurDate() selektiert bei Mehrfachselektion
+jedoch nicht das Datum mit, sondern gibt nur das Focus-Rechteck vor.
+
+Den selektierten Bereich kann man mit GetSelectDateCount()/GetSelectDate()
+abgefragt werden oder der Status von einem Datum kann mit IsDateSelected()
+abgefragt werden.
+
+Waehrend der Anwender am selektieren ist, wird der SelectionChanging()-
+Handler gerufen. In diesem kann der selektierte Bereich angepasst werden,
+wenn man beispielsweise den Bereich eingrenzen oder erweitern will. Der
+Bereich wird mit SelectDate()/SelectDateRange() umgesetzt und mit
+GetSelectDateCount()/GetSelectDate() abgefragt. Wenn man wissen moechte,
+in welche Richtung selektiert wird, kann dies ueber IsSelectLeft()
+abgefragt werden. TRUE bedeutet eine Selektion nach links oder oben,
+FALSE eine Selektion nach rechts oder unten.
+
+--------------------------------------------------------------------------
+
+Wenn sich der Date-Range-Bereich anpasst und man dort die Selektion
+uebernehmen will, sollte dies nur gemacht werden, wenn
+IsScrollDateRangeChanged() TRUE zurueckliefert. Denn diese Methode liefert
+TRUE zurueck, wenn der Bereich durch Betaetigung von den Scroll-Buttons
+ausgeloest wurde. Bei FALSE wurde dies durch Resize(), Methoden-Aufrufen
+oder durch Beendigung einer Selektion ausgeloest.
+
+*************************************************************************/
+
+// ------------------
+// - Calendar-Types -
+// ------------------
+
+#define WB_QUICKHELPSHOWSDATEINFO ((WinBits)0x00004000)
+#define WB_BOLDTEXT ((WinBits)0x00008000)
+#define WB_FRAMEINFO ((WinBits)0x00010000)
+#define WB_WEEKNUMBER ((WinBits)0x00020000)
+// Muss mit den WinBits beim TabBar uebereinstimmen oder mal
+// nach \vcl\inc\wintypes.hxx verlagert werden
+#ifndef WB_RANGESELECT
+#define WB_RANGESELECT ((WinBits)0x00200000)
+#endif
+#ifndef WB_MULTISELECT
+#define WB_MULTISELECT ((WinBits)0x00400000)
+#endif
+
+#define DIB_BOLD ((USHORT)0x0001)
+
+// ------------
+// - Calendar -
+// ------------
+
+class Calendar : public Control
+{
+private:
+ ImplDateTable* mpDateTable;
+ Table* mpSelectTable;
+ Table* mpOldSelectTable;
+ Table* mpRestoreSelectTable;
+ XubString* mpDayText[31];
+ XubString maDayText;
+ XubString maWeekText;
+ International maIntn;
+ Rectangle maPrevRect;
+ Rectangle maNextRect;
+ String maDayOfWeekText;
+ long mnDayOfWeekAry[7];
+ Date maOldFormatFirstDate;
+ Date maOldFormatLastDate;
+ Date maFirstDate;
+ Date maOldFirstDate;
+ Date maCurDate;
+ Date maOldCurDate;
+ Date maAnchorDate;
+ Date maDropDate;
+ Color maSelColor;
+ Color maOtherColor;
+ Color* mpStandardColor;
+ Color* mpSaturdayColor;
+ Color* mpSundayColor;
+ ULONG mnDayCount;
+ long mnDaysOffX;
+ long mnWeekDayOffY;
+ long mnDaysOffY;
+ long mnMonthHeight;
+ long mnMonthWidth;
+ long mnMonthPerLine;
+ long mnLines;
+ long mnDayWidth;
+ long mnDayHeight;
+ long mnWeekWidth;
+ long mnDummy2;
+ long mnDummy3;
+ long mnDummy4;
+ WinBits mnWinStyle;
+ USHORT mnFirstYear;
+ USHORT mnLastYear;
+ USHORT mnRequestYear;
+ BOOL mbCalc:1,
+ mbFormat:1,
+ mbDrag:1,
+ mbSelection:1,
+ mbMultiSelection:1,
+ mbWeekSel:1,
+ mbUnSel:1,
+ mbMenuDown:1,
+ mbSpinDown:1,
+ mbPrevIn:1,
+ mbNextIn:1,
+ mbDirect:1,
+ mbInSelChange:1,
+ mbTravelSelect:1,
+ mbScrollDateRange:1,
+ mbSelLeft:1,
+ mbAllSel:1,
+ mbDropPos:1;
+ Link maSelectionChangingHdl;
+ Link maDateRangeChangedHdl;
+ Link maRequestDateInfoHdl;
+ Link maDoubleClickHdl;
+ Link maSelectHdl;
+ Timer maDragScrollTimer;
+ USHORT mnDragScrollHitTest;
+
+#ifdef _SV_CALENDAR_CXX
+ void ImplInit( WinBits nWinStyle );
+ void ImplInitSettings();
+ void ImplGetWeekFont( Font& rFont ) const;
+ void ImplFormat();
+ USHORT ImplHitTest( const Point& rPos, Date& rDate ) const;
+ void ImplDrawSpin( BOOL bDrawPrev = TRUE, BOOL bDrawNext = TRUE );
+ void ImplDrawDate( long nX, long nY,
+ USHORT nDay, USHORT nMonth, USHORT nYear,
+ DayOfWeek eDayOfWeek,
+ BOOL bBack = TRUE, BOOL bOther = FALSE,
+ ULONG nToday = 0 );
+ void ImplDraw( BOOL bPaint = FALSE );
+ void ImplUpdateDate( const Date& rDate );
+ void ImplUpdateSelection( Table* pOld );
+ void ImplMouseSelect( const Date& rDate, USHORT nHitTest,
+ BOOL bMove, BOOL bExpand, BOOL bExtended );
+ void ImplUpdate( BOOL bCalcNew = FALSE );
+ void ImplScroll( BOOL bPrev );
+ void ImplInvertDropPos();
+ void ImplShowMenu( const Point& rPos, const Date& rDate );
+ void ImplTracking( const Point& rPos, BOOL bRepeat );
+ void ImplEndTracking( const Point& rPos, BOOL bCancel );
+#endif
+
+protected:
+ BOOL ShowDropPos( const Point& rPos, Date& rDate );
+ void HideDropPos();
+
+ DECL_STATIC_LINK( Calendar, ScrollHdl, Timer *);
+
+public:
+ Calendar( Window* pParent, WinBits nWinStyle = 0 );
+ Calendar( Window* pParent, const ResId& rResId );
+ ~Calendar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void GetFocus();
+ virtual void LoseFocus();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void SelectionChanging();
+ virtual void DateRangeChanged();
+ virtual void RequestDateInfo();
+ virtual void DoubleClick();
+ virtual void Select();
+
+ void SetInternational( const International& rIntn );
+ const International& GetInternational() const { return maIntn; }
+
+ void SelectDate( const Date& rDate, BOOL bSelect = TRUE );
+ void SelectDateRange( const Date& rStartDate, const Date& rEndDate,
+ BOOL bSelect = TRUE );
+ void SetNoSelection();
+ BOOL IsDateSelected( const Date& rDate ) const;
+ ULONG GetSelectDateCount() const;
+ Date GetSelectDate( ULONG nIndex = 0 ) const;
+ void EnableCallEverySelect( BOOL bEvery = TRUE ) { mbAllSel = bEvery; }
+ BOOL IsCallEverySelectEnabled() const { return mbAllSel; }
+
+ USHORT GetRequestYear() const { return mnRequestYear; }
+ void SetCurDate( const Date& rNewDate );
+ Date GetCurDate() const { return maCurDate; }
+ void SetFirstDate( const Date& rNewFirstDate );
+ Date GetFirstDate() const { return maFirstDate; }
+ Date GetLastDate() const { return maFirstDate+mnDayCount; }
+ ULONG GetDayCount() const { return mnDayCount; }
+ Date GetFirstMonth() const;
+ Date GetLastMonth() const;
+ USHORT GetMonthCount() const;
+ BOOL GetDate( const Point& rPos, Date& rDate ) const;
+ Rectangle GetDateRect( const Date& rDate ) const;
+ BOOL GetDropDate( Date& rDate ) const;
+
+ long GetCurMonthPerLine() const { return mnMonthPerLine; }
+ long GetCurLines() const { return mnLines; }
+
+ void SetStandardColor( const Color& rColor );
+ const Color& GetStandardColor() const;
+ void SetSaturdayColor( const Color& rColor );
+ const Color& GetSaturdayColor() const;
+ void SetSundayColor( const Color& rColor );
+ const Color& GetSundayColor() const;
+
+ void AddDateInfo( const Date& rDate, const XubString& rText,
+ const Color* pTextColor = NULL,
+ const Color* pFrameColor = NULL,
+ USHORT nFlags = 0 );
+ void RemoveDateInfo( const Date& rDate );
+ void ClearDateInfo();
+ XubString GetDateInfoText( const Date& rDate );
+
+ void StartSelection();
+ void EndSelection();
+
+ BOOL IsTravelSelect() const { return mbTravelSelect; }
+ BOOL IsScrollDateRangeChanged() const { return mbScrollDateRange; }
+ BOOL IsSelectLeft() const { return mbSelLeft; }
+
+ Size CalcWindowSizePixel( long nCalcMonthPerLine = 1,
+ long nCalcLines = 1 ) const;
+
+ void SetSelectionChangingHdl( const Link& rLink ) { maSelectionChangingHdl = rLink; }
+ const Link& GetSelectionChangingHdl() const { return maSelectionChangingHdl; }
+ void SetDateRangeChangedHdl( const Link& rLink ) { maDateRangeChangedHdl = rLink; }
+ const Link& GetDateRangeChangedHdl() const { return maDateRangeChangedHdl; }
+ void SetRequestDateInfoHdl( const Link& rLink ) { maRequestDateInfoHdl = rLink; }
+ const Link& GetRequestDateInfoHdl() const { return maRequestDateInfoHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+};
+
+inline const Color& Calendar::GetStandardColor() const
+{
+ if ( mpStandardColor )
+ return *mpStandardColor;
+ else
+ return GetFont().GetColor();
+}
+
+inline const Color& Calendar::GetSaturdayColor() const
+{
+ if ( mpSaturdayColor )
+ return *mpSaturdayColor;
+ else
+ return GetFont().GetColor();
+}
+
+inline const Color& Calendar::GetSundayColor() const
+{
+ if ( mpSundayColor )
+ return *mpSundayColor;
+ else
+ return GetFont().GetColor();
+}
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class CalendarField
+
+Bei dieser Klasse handelt es sich um ein DateField, wo ueber einen
+DropDown-Button ueber das Calendar-Control ein Datum ausgewaehlt werden
+kann.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+Siehe DateField
+
+Die Vorgaben fuer das CalendarControl koennen ueber SetCalendarStyle()
+gesetzt werden.
+
+--------------------------------------------------------------------------
+
+Mit EnableToday()/EnableNone() kann ein Today-Button und ein None-Button
+enabled werden.
+
+--------------------------------------------------------------------------
+
+Wenn mit SetCalendarStyle() WB_RANGESELECT gesetzt wird, koennen im
+Calendar auch mehrere Tage selektiert werden. Da immer nur das Start-Datum
+in das Feld uebernommen wird, sollte dann im Select-Handler mit
+GetCalendar() der Calendar abgefragt werden und an dem mit
+GetSelectDateCount()/GetSelectDate() der selektierte Bereich abgefragt
+werden, um beispielsweise diese dann in ein weiteres Feld zu uebernehmen.
+
+--------------------------------------------------------------------------
+
+Wenn ein abgeleiteter Calendar verwendet werden soll, kann am
+CalendarField die Methode CreateCalendar() ueberlagert werden und
+dort ein eigener Calendar erzeugt werden.
+
+*************************************************************************/
+
+// -----------------
+// - CalendarField -
+// -----------------
+
+class CalendarField : public DateField
+{
+private:
+ ImplCFieldFloatWin* mpFloatWin;
+ Calendar* mpCalendar;
+ WinBits mnCalendarStyle;
+ PushButton* mpTodayBtn;
+ PushButton* mpNoneBtn;
+ Date maDefaultDate;
+ BOOL mbToday;
+ BOOL mbNone;
+ Link maSelectHdl;
+
+#ifdef _SV_CALENDAR_CXX
+ DECL_LINK( ImplSelectHdl, Calendar* );
+ DECL_LINK( ImplClickHdl, PushButton* );
+ DECL_LINK( ImplPopupModeEndHdl, FloatingWindow* );
+#endif
+
+public:
+ CalendarField( Window* pParent, WinBits nWinStyle );
+ CalendarField( Window* pParent, const ResId& rResId );
+ ~CalendarField();
+
+ virtual void Select();
+
+ virtual BOOL ShowDropDown( BOOL bShow );
+ virtual Calendar* CreateCalendar( Window* pParent );
+ Calendar* GetCalendar();
+
+ void SetDefaultDate( const Date& rDate ) { maDefaultDate = rDate; }
+ Date GetDefaultDate() const { return maDefaultDate; }
+
+ void EnableToday( BOOL bToday = TRUE ) { mbToday = bToday; }
+ BOOL IsTodayEnabled() const { return mbToday; }
+ void EnableNone( BOOL bNone = TRUE ) { mbNone = bNone; }
+ BOOL IsNoneEnabled() const { return mbNone; }
+
+ void SetCalendarStyle( WinBits nStyle ) { mnCalendarStyle = nStyle; }
+ WinBits GetCalendarStyle() const { return mnCalendarStyle; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+};
+
+#endif // _CALENDAR_HXX
diff --git a/svtools/inc/cntnrsrt.hxx b/svtools/inc/cntnrsrt.hxx
new file mode 100644
index 000000000000..d3cc20bc18dd
--- /dev/null
+++ b/svtools/inc/cntnrsrt.hxx
@@ -0,0 +1,210 @@
+/*************************************************************************
+ *
+ * $RCSfile: cntnrsrt.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:49 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _CNTRSRT_HXX
+#define _CNTRSRT_HXX
+
+#if 0
+***********************************************************************
+*
+* Hier folgt die Beschreibung fuer die exportierten Makros:
+*
+* DECLARE_CONTAINER_SORT( ClassName, Type )
+* IMPL_CONTAINER_SORT( ClassName, Type, SortFunc )
+*
+* Definiert eine von Container abgeleitete Klasse "ClassName",
+* in der die Elemente des Typs "Type" sortiert enthalten sind.
+* Dazu muss einer Funktion "SortFunc" definiert sein, die als
+* Paramter zwei "const Type&" erwartet und 0 zurueckgibt, wenn
+* beide gleich sind, -1 wenn der erste Paramter kleiner ist als
+* der zweite und +1 wenn der erste Paramter groesser ist als
+* der zweite.
+*
+* Die Zugriffs-Methoden entsprechen in etwa denen der Container-
+* Klasse, mit Ausnahme von Insert, DeleteAndDestroy und Seek_Entry,
+* der den SV-Pointer-Arrays entsprechen.
+*
+* DECLARE_CONTAINER_SORT_DEL( ClassName, Type )
+* IMPL_CONTAINER_SORT( ClassName, Type, SortFunc )
+*
+* Wie DECLARE_CONTAINER_SORT, nur dass beim Aufruf des Destruktors
+* alle im Conatiner vorhandenen Objekte geloescht werden.
+*
+#endif
+
+#ifndef _CONTNR_HXX //autogen
+#include <tools/contnr.hxx>
+#endif
+
+#define DECLARE_CONTAINER_SORT_COMMON( ClassName, Type ) \
+ ClassName( const ClassName& ); \
+ ClassName& operator =( const ClassName& ); \
+public: \
+ Container::Count; \
+ \
+ ClassName( USHORT nInitSize, USHORT nReSize ) : \
+ Container( CONTAINER_MAXBLOCKSIZE, nInitSize, nReSize ) {} \
+ \
+ BOOL Insert( Type* pObj ); \
+ \
+ Type *Remove( ULONG nPos ) \
+ { return (Type *)Container::Remove( nPos ); } \
+ \
+ Type *Remove( Type* pObj ); \
+ \
+ void DeleteAndDestroy( ULONG nPos ) \
+ { \
+ Type *pObj = Remove( nPos ); \
+ if( pObj ) \
+ delete pObj; \
+ } \
+ \
+ void DeleteAndDestroy() \
+ { while( Count() ) DeleteAndDestroy( 0 ); } \
+ \
+ Type* GetObject( ULONG nPos ) const \
+ { return (Type *)Container::GetObject( nPos ); } \
+ \
+ Type* operator[]( ULONG nPos ) const \
+ { return GetObject(nPos); } \
+ \
+ BOOL Seek_Entry( const Type *pObj, ULONG* pPos ) const; \
+ \
+ ULONG GetPos( const Type* pObj ) const; \
+
+
+#define DECLARE_CONTAINER_SORT( ClassName, Type ) \
+class ClassName : private Container \
+{ \
+ DECLARE_CONTAINER_SORT_COMMON( ClassName, Type ) \
+ ~ClassName() {} \
+}; \
+
+
+#define DECLARE_CONTAINER_SORT_DEL( ClassName, Type ) \
+class ClassName : private Container \
+{ \
+ DECLARE_CONTAINER_SORT_COMMON( ClassName, Type ) \
+ ~ClassName() { DeleteAndDestroy(); } \
+}; \
+
+
+#define IMPL_CONTAINER_SORT( ClassName, Type, SortFunc ) \
+BOOL ClassName::Insert( Type *pObj ) \
+{ \
+ ULONG nPos; \
+ BOOL bExist; \
+ if( ! ( bExist = Seek_Entry( pObj, &nPos ) ) ) \
+ Container::Insert( pObj, nPos ); \
+ return !bExist; \
+} \
+ \
+Type *ClassName::Remove( Type* pObj ) \
+{ \
+ ULONG nPos; \
+ if( Seek_Entry( pObj, &nPos ) ) \
+ return Remove( nPos ); \
+ else \
+ return 0; \
+} \
+ \
+ULONG ClassName::GetPos( const Type* pObj ) const \
+{ \
+ ULONG nPos; \
+ if( Seek_Entry( pObj, &nPos ) ) \
+ return nPos; \
+ else \
+ return CONTAINER_ENTRY_NOTFOUND; \
+} \
+ \
+BOOL ClassName::Seek_Entry( const Type* pObj, ULONG* pPos ) const \
+{ \
+ register ULONG nO = Count(), \
+ nM, \
+ nU = 0; \
+ if( nO > 0 ) \
+ { \
+ nO--; \
+ while( nU <= nO ) \
+ { \
+ nM = nU + ( nO - nU ) / 2; \
+ int nCmp = SortFunc( *GetObject(nM), *pObj ); \
+ \
+ if( 0 == nCmp ) \
+ { \
+ if( pPos ) *pPos = nM; \
+ return TRUE; \
+ } \
+ else if( nCmp < 0 ) \
+ nU = nM + 1; \
+ else if( nM == 0 ) \
+ { \
+ if( pPos ) *pPos = nU; \
+ return FALSE; \
+ } \
+ else \
+ nO = nM - 1; \
+ } \
+ } \
+ if( pPos ) *pPos = nU; \
+ return FALSE; \
+} \
+
+#endif
diff --git a/svtools/inc/cntwids.hrc b/svtools/inc/cntwids.hrc
new file mode 100644
index 000000000000..652cc9304367
--- /dev/null
+++ b/svtools/inc/cntwids.hrc
@@ -0,0 +1,549 @@
+/*************************************************************************
+ *
+ * $RCSfile: cntwids.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+//=========================================================================
+//
+// WID-definitions for CHAOS
+//
+// (C) 1997 StarDivision GmbH, Hamburg, Germany
+// $Author: hr $ $Date: 2000-09-18 16:58:50 $ $Revision: 1.1.1.1 $
+// $Logfile: T:/svtools/inc/cntwids.hrv $ $Workfile: CNTWIDS.HRC $
+//
+//=========================================================================
+
+#ifndef _CNTWIDS_HRC
+#define _CNTWIDS_HRC
+
+#ifndef OLD_CHAOS
+#define TF_NEW_TABPAGES
+#define CNT_COOL_ABO
+#endif
+
+//=========================================================================
+// ARGS, MSG, ALL, FOLDER, BOXALL, BOXEXT
+//=========================================================================
+
+#define WID_CHAOS_START 500
+
+//FUNC MSG
+#define WID_MARK_THREAD_MARKED (499)
+#define WID_MARK_THREAD_UNMARKED (498)
+
+// ARGS
+#define WID_DUMMY_ARG1 (WID_CHAOS_START + 0)
+#define WID_FACTORY_NO (WID_CHAOS_START + 1)
+#define WID_FACTORY_NAME (WID_CHAOS_START + 2)
+#define WID_NEWS_XREF (WID_CHAOS_START + 3)
+#define WID_CREATION_FLAGS (WID_CHAOS_START + 4)
+#define WID_FACTORY_HELP_ID (WID_CHAOS_START + 5)
+
+//FUNC MSG
+#define WID_MSG_START (WID_CHAOS_START + 6)
+#define WID_MAIL_REPLY (WID_CHAOS_START + 6)
+#define WID_POST_REPLY (WID_CHAOS_START + 7)
+#define WID_FORWARD (WID_CHAOS_START + 8)
+#define WID_MARK_THREAD_READ (WID_CHAOS_START + 9)
+#define WID_HIDE_THREAD (WID_CHAOS_START + 10)
+#define WID_HIDE_AUTHOR (WID_CHAOS_START + 11)
+#define WID_HIDE_SUBJECT (WID_CHAOS_START + 12)
+#define WID_RESEND_MSG (WID_CHAOS_START + 13)
+#define WID_MARK_THREAD_UNREAD (WID_CHAOS_START + 14)
+
+//PROP MSG
+#define WID_PRIORITY (WID_CHAOS_START + 15)
+#define WID_RULE_APPLIED (WID_CHAOS_START + 16)
+#define WID_MSG_LOCK (WID_CHAOS_START + 17)
+#define WID_SEEN_STATUS (WID_CHAOS_START + 18)
+#define WID_REPLY_TO (WID_CHAOS_START + 19)
+#define WID_IN_REPLY_TO (WID_CHAOS_START + 20)
+
+#define WID_MESSAGE_ID (WID_CHAOS_START + 21)
+#define WID_BCC (WID_CHAOS_START + 22)
+#define WID_CC (WID_CHAOS_START + 23)
+#define WID_TO (WID_CHAOS_START + 24)
+#define WID_FROM (WID_CHAOS_START + 25)
+#define WID_TITLE (WID_CHAOS_START + 26)
+#define WID_SUBJECT WID_TITLE // only here to prevent panic, should be removed
+#define WID_MESSAGEBODY (WID_CHAOS_START + 27)
+
+#define WID_REFERENCES (WID_CHAOS_START + 28)
+#define WID_NEWSGROUPS (WID_CHAOS_START + 29)
+#define WID_NEWS_XREFLIST (WID_CHAOS_START + 30)
+
+#define WID_OUTMSGINTERNALSTATE (WID_CHAOS_START + 31)
+#define WID_RECIPIENTLIST (WID_CHAOS_START + 32)
+#define WID_MSG_END (WID_CHAOS_START + 32)
+
+//FUNC ALL
+#define WID_ALL_START (WID_CHAOS_START + 33)
+#define WID_DEFAULT (WID_CHAOS_START + 33)
+#define WID_OPEN (WID_CHAOS_START + 34)
+#define WID_DELETE (WID_CHAOS_START + 35)
+#define WID_CUT (WID_CHAOS_START + 36)
+#define WID_COPY (WID_CHAOS_START + 37)
+#define WID_PASTE (WID_CHAOS_START + 38)
+#define WID_RENAME (WID_CHAOS_START + 39)
+
+#define WID_HAS_DATA (WID_CHAOS_START + 40)
+#define WID_GETDATA (WID_CHAOS_START + 41)
+#define WID_PUTDATA (WID_CHAOS_START + 42)
+
+//PROP ALL
+#define WID_INTERIM_URL (WID_CHAOS_START + 43)
+#define WID_CONTENT_TYPE (WID_CHAOS_START + 44)
+
+#define WID_OWN_URL (WID_CHAOS_START + 45)
+#define WID_REAL_URL (WID_CHAOS_START + 46)
+#define WID_OBSOLETE_TITLE (WID_CHAOS_START + 47)
+#define WID_FLAG_READONLY (WID_CHAOS_START + 48)
+
+#define WID_REFERED_URL (WID_CHAOS_START + 49)
+#define WID_REFERER_COUNT (WID_CHAOS_START + 50)
+#define WID_FLAG_IS_FOLDER (WID_CHAOS_START + 51)
+#define WID_FLAG_HAS_FOLDER (WID_CHAOS_START + 52)
+#define WID_FLAG_IS_MESSAGE (WID_CHAOS_START + 53)
+#define WID_FLAG_IS_DOCUMENT (WID_FLAG_IS_MESSAGE)
+#define WID_FLAG_HAS_MESSAGES (WID_CHAOS_START + 54)
+
+#define WID_DATE_CREATED (WID_CHAOS_START + 55)
+#define WID_DATE_MODIFIED (WID_CHAOS_START + 56)
+#define WID_VIEW_DESCRIPTION (WID_CHAOS_START + 57)
+#define WID_IS_READ (WID_CHAOS_START + 58)
+#define WID_IS_MARKED (WID_CHAOS_START + 59)
+#define WID_ALL_END (WID_CHAOS_START + 59)
+
+//FUNC FOLDER
+#define WID_FOLDER_START (WID_CHAOS_START + 60)
+#define WID_SYNCHRONIZE (WID_CHAOS_START + 60)
+#define WID_CREATE_NEW (WID_CHAOS_START + 61)
+#define WID_INSERT (WID_CHAOS_START + 62)
+#define WID_UPDATE (WID_CHAOS_START + 63)
+#define WID_IMPORT (WID_CHAOS_START + 64)
+
+//PROP FOLDER VIEW
+#define WID_DUMMY_PROPFOLDERVIEW1 (WID_CHAOS_START + 65)
+#define WID_THREADING (WID_CHAOS_START + 66)
+#define WID_MSG_COLUMN_INFO /* obsolete */ (WID_CHAOS_START + 67)
+#define WID_FLD_COLUMN_INFO /* obsolete */ (WID_CHAOS_START + 68)
+#define WID_FOLDERVIEW_MODE (WID_CHAOS_START + 69)
+#define WID_MESSAGEVIEW_MODE (WID_CHAOS_START + 70)
+#define WID_SENTMESSAGEVIEW_MODE (WID_CHAOS_START + 71)
+#define WID_SORTING (WID_CHAOS_START + 72)
+#define WID_THREADED (WID_CHAOS_START + 73)
+#define WID_FILTERED (WID_CHAOS_START + 74)
+#define WID_RULES (WID_CHAOS_START + 75)
+#define WID_SUBSCRNEWSGROUPCOUNT (WID_CHAOS_START + 76)
+#define WID_FLAG_SUBSCRIBED (WID_CHAOS_START + 77)
+#define WID_FLAG_SUPPORTMODE (WID_CHAOS_START + 78)
+
+//PROP FOLDER DIR
+#define WID_DUMMY_FOLDERDIR1 (WID_CHAOS_START + 79)
+#define WID_TOTALCONTENTCOUNT (WID_CHAOS_START + 80)
+#define WID_NEWSGROUPCOUNT /* ??? */ (WID_CHAOS_START + 81)
+#define WID_ARTICLECOUNT /* ??? */ (WID_CHAOS_START + 82)
+#define WID_KNOWN_RANGES (WID_CHAOS_START + 83)
+#define WID_IMAPFOLDERINFO (WID_CHAOS_START + 84)
+
+//PROP FOLDER USER
+#define WID_DUMMY_FOLDERUSER1 (WID_CHAOS_START + 85)
+#define WID_SEENCONTENTCOUNT (WID_CHAOS_START + 86)
+#define WID_UNREAD_ARTICLECOUNT (WID_SEENCONTENTCOUNT)
+#define WID_SENTCONTENTCOUNT (WID_SEENCONTENTCOUNT)
+#define WID_READ_RANGES (WID_CHAOS_START + 87)
+#define WID_MARK_RANGES (WID_CHAOS_START + 88)
+#define WID_FOLDER_END (WID_CHAOS_START + 88)
+
+//PROP BOXALL
+#define WID_BOXALL_START (WID_CHAOS_START + 89)
+// Used for d&d of View Storages...
+#define WID_PREPARE_MOVE (WID_CHAOS_START + 89)
+#define WID_OUTTRAY_WANTED (WID_CHAOS_START + 90)
+#define WID_USERNAME (WID_CHAOS_START + 91)
+#define WID_PASSWORD (WID_CHAOS_START + 92)
+#define WID_SERVERNAME (WID_CHAOS_START + 93)
+#define WID_SERVERPORT (WID_CHAOS_START + 94)
+// obsolete
+#define WID_MAILSEND_USERNAME (WID_CHAOS_START + 95)
+#define WID_MAILSEND_PASSWORD (WID_CHAOS_START + 96)
+#define WID_MAILSEND_SERVERNAME (WID_CHAOS_START + 97)
+#define WID_NEWSSEND_USERNAME (WID_CHAOS_START + 98)
+#define WID_NEWSSEND_PASSWORD (WID_CHAOS_START + 99)
+#define WID_NEWSSEND_SERVERNAME (WID_CHAOS_START + 100)
+// end obsolete
+#define WID_SERVERBASE (WID_CHAOS_START + 101)
+// not used
+#define WID_SMTP_GATEWAY (WID_CHAOS_START + 102)
+
+// -> ..._DEFAULT
+// obsolete
+#define WID_FROM_DEFAULT (WID_CHAOS_START + 103)
+// obsolete
+#define WID_REPLY_TO_DEFAULT (WID_CHAOS_START + 104)
+
+#define WID_AUTOUPDATE_INTERVAL (WID_CHAOS_START + 105)
+#define WID_UPDATE_ENABLED (WID_CHAOS_START + 106)
+#define WID_BOXALL_END (WID_CHAOS_START + 106)
+
+//PROP BOX RNMGR
+#define WID_BOXEXT_START (WID_CHAOS_START + 107)
+#define WID_CONNECTION_MODE (WID_CHAOS_START + 107)
+#define WID_NEWS_GROUPLIST (WID_CHAOS_START + 108)
+#ifdef OLD_CHAOS
+#define WID_BOX_CONNECTION_PROP (WID_CHAOS_START + 109)
+#else
+#define WID_MESSAGE_STOREMODE (WID_CHAOS_START + 109)
+#endif
+#define WID_DELETE_ON_SERVER (WID_CHAOS_START + 110)
+
+//PROP BOX USER
+
+//PROP BOX OUT DIR
+#define WID_OUTMSGEXTERNALSTATE (WID_CHAOS_START + 111)
+
+//PROP RNM
+#define WID_RNM_UPDATETIMER_LIST (WID_CHAOS_START + 112)
+#define WID_BOXEXT_END (WID_CHAOS_START + 112)
+
+//////////////////////////////////////////////////////////////////////////
+// MISC - Added after initial pool version
+//////////////////////////////////////////////////////////////////////////
+
+// PROP BOX
+#define WID_SERVER_RANGES (WID_CHAOS_START + 113)
+#define WID_LAST_UPDATE (WID_CHAOS_START + 114)
+#define WID_LAST_MSGID (WID_CHAOS_START + 115)
+#define WID_LAST_UID (WID_CHAOS_START + 116)
+
+// FUNC ALL
+#define WID_UNDELETE (WID_CHAOS_START + 117)
+#define WID_CLOSE (WID_CHAOS_START + 118)
+#define WID_REOPEN (WID_CHAOS_START + 119)
+
+// PROP RNM
+#define WID_RNM_FILECONVERSION_LIST (WID_CHAOS_START + 120)
+
+// PROP FOLDER
+#define WID_SHOW_MSGS_HAS_TIMELIMIT (WID_CHAOS_START + 121)
+#define WID_SHOW_MSGS_TIMELIMIT (WID_CHAOS_START + 122)
+#define WID_STORE_MSGS_HAS_TIMELIMIT (WID_CHAOS_START + 123)
+#define WID_STORE_MSGS_TIMELIMIT (WID_CHAOS_START + 124)
+
+// PROP BOX
+#define WID_MSG_COLUMN_WIDTHS /* obsolete */(WID_CHAOS_START + 125)
+
+#ifdef OLD_CHAOS
+
+#define WID_CHAOS_END (WID_CHAOS_START + 125)
+
+#else
+
+//////////////////////////////////////////////////////////////////////////
+// WID's added after SO 4.0 release ( SUPD > 364 )
+//////////////////////////////////////////////////////////////////////////
+
+// PROP ALL
+#define WID_PROPERTYLIST (WID_CHAOS_START + 126)
+
+// PROP BOXALL
+#define WID_BOXALL_START2 (WID_CHAOS_START + 127)
+#define WID_SEND_PUBLIC_PROT_ID (WID_CHAOS_START + 127)
+#define WID_SEND_PRIVATE_PROT_ID (WID_CHAOS_START + 128)
+#define WID_SEND_PUBLIC_OUTBOXPROPS (WID_CHAOS_START + 129)
+#define WID_SEND_PRIVATE_OUTBOXPROPS (WID_CHAOS_START + 130)
+#define WID_SEND_SERVERNAME (WID_CHAOS_START + 131)
+#define WID_SEND_USERNAME (WID_CHAOS_START + 132)
+#define WID_SEND_PASSWORD (WID_CHAOS_START + 133)
+#define WID_SEND_REPLY_TO_DEFAULT (WID_CHAOS_START + 134)
+#define WID_SEND_FROM_DEFAULT (WID_CHAOS_START + 135)
+#define WID_VIM_POPATH (WID_CHAOS_START + 136)
+#define WID_SEND_VIM_POPATH (WID_CHAOS_START + 137)
+#define WID_PURGE (WID_CHAOS_START + 138)
+#define WID_CLEAN_CACHE (WID_CHAOS_START + 139)
+#define WID_SEARCH (WID_CHAOS_START + 140)
+#define WID_JOURNAL (WID_CHAOS_START + 141)
+#define WID_LOCALBASE (WID_CHAOS_START + 142)
+#define WID_BOXALL_END2 (WID_CHAOS_START + 142)
+
+// PROP DOCUMENT
+#define WID_DOCUMENT_HEADER (WID_CHAOS_START + 143)
+#define WID_DOCUMENT_BODY (WID_CHAOS_START + 144)
+#define WID_DOCUMENT_SIZE (WID_CHAOS_START + 145)
+
+// PROP ALL
+#define WID_SIZE WID_DOCUMENT_SIZE
+
+// PROP PROJECT
+#define WID_PRJ_MEDIUM (WID_CHAOS_START + 146)
+#define WID_PRJ_FILENAMECONVENTION (WID_CHAOS_START + 147)
+
+// PROP FSYS
+#define WID_FSYS_DISKSPACE_LEFT (WID_CHAOS_START + 148)
+#define WID_TRANSFER (WID_CHAOS_START + 149)
+
+// PROP ALL
+#define WID_KEYWORDS (WID_CHAOS_START + 150)
+#define WID_IS_PROTECTED (WID_CHAOS_START + 151)
+
+// PROP SEARCH
+#define WID_SEARCH_CRITERIA (WID_CHAOS_START + 152)
+#define WID_SEARCH_LOCATIONS (WID_CHAOS_START + 153)
+#define WID_SEARCH_RECURSIVE (WID_CHAOS_START + 154)
+#define WID_SEARCH_FOLDER_VIEW (WID_CHAOS_START + 155)
+#define WID_SEARCH_DOCUMENT_VIEW (WID_CHAOS_START + 156)
+
+// PROP Channel
+#define WID_SCHEDULE_RANGE (WID_CHAOS_START + 157)
+#define WID_ALLOWED_SCHEDULE_RANGE (WID_CHAOS_START + 158)
+#define WID_TARGET_URL (WID_CHAOS_START + 159)
+#define WID_FREQUENCY (WID_CHAOS_START + 160)
+
+// PROP HTTP
+#define WID_HTTP_CONNECTION_LIMIT (WID_CHAOS_START + 161)
+#define WID_HTTP_COOKIE_MANAGER (WID_CHAOS_START + 162)
+
+// PROP Channel
+#define WID_COLUMN_NEXT_UPD (WID_CHAOS_START + 163)
+#define WID_CRAWL_STATUS (WID_CHAOS_START + 164)
+#define WID_CRAWL_LEVEL (WID_CHAOS_START + 165)
+#define WID_CRAWL_MODE (WID_CHAOS_START + 166)
+// WID_CRAWL_MAX_VOLUME shall be removed in the future!
+// --> WID_SIZE_LIMIT
+#define WID_CRAWL_MAX_VOLUME (WID_CHAOS_START + 167)
+#define WID_CRAWL_IMAGE (WID_CHAOS_START + 168)
+#define WID_CRAWL_LINK_OUT (WID_CHAOS_START + 169)
+#define WID_NOTIFICATION_MODE (WID_CHAOS_START + 170)
+#define WID_NOTIFICATION_ADDRESS (WID_CHAOS_START + 171)
+
+// PROP BOXALL
+#define WID_ACCOUNT (WID_CHAOS_START + 172)
+
+// PROP FSYS
+#define WID_FSYS_KIND (WID_CHAOS_START + 173)
+#define WID_FSYS_FLAGS (WID_CHAOS_START + 174)
+
+// PROP FOLDER
+#define WID_VIEWDATA /* obsolete */ (WID_CHAOS_START + 175)
+
+// PROP FSYS
+#define WID_WHO_IS_MASTER (WID_CHAOS_START + 176)
+
+// FUNC HTTP
+#define WID_HTTP_POST (WID_CHAOS_START + 177)
+
+// PROP ALL
+#define WID_SUPPORTED_FUNCS (WID_CHAOS_START + 178)
+#define WID_SIZE_LIMIT (WID_CHAOS_START + 179)
+
+// PROP FOLDER
+#define WID_MARKED_DOCUMENT_COUNT (WID_CHAOS_START + 180)
+#define WID_FOLDER_COUNT (WID_CHAOS_START + 181)
+
+// PROP FSYS
+#define WID_FSYS_SHOW_HIDDEN (WID_CHAOS_START + 182)
+
+// TRASHCAN
+#define WID_TRASHCAN_START (WID_CHAOS_START + 183)
+#define WID_TRASHCAN_EMPTY_TRASH (WID_CHAOS_START + 183)
+#define WID_TRASHCAN_FLAG_AUTODELETE (WID_CHAOS_START + 184)
+#define WID_TRASHCAN_FLAG_CONFIRMEMPTY (WID_CHAOS_START + 185)
+#define WID_TRASHCAN_DUMMY1 (WID_CHAOS_START + 186)
+#define WID_TRASHCAN_DUMMY2 (WID_CHAOS_START + 187)
+#define WID_TRASHCAN_END (WID_CHAOS_START + 187)
+
+// TRASH
+#define WID_TRASH_START (WID_CHAOS_START + 188)
+#define WID_TRASH_RESTORE (WID_CHAOS_START + 188)
+#define WID_TRASH_ORIGIN (WID_CHAOS_START + 189)
+#define WID_TRASH_DUMMY2 (WID_CHAOS_START + 190)
+#define WID_TRASH_END (WID_CHAOS_START + 190)
+
+// PROP ALL
+#define WID_TARGET_FRAMES (WID_CHAOS_START + 191)
+
+// FUNC FOLDER
+#define WID_EXPORT (WID_CHAOS_START + 192)
+
+// COMPONENT
+#define WID_COMPONENT_COMMAND (WID_CHAOS_START + 193)
+#define WID_COMPONENT_MENU (WID_CHAOS_START + 194)
+
+// PROP Channel
+#define WID_HREF (WID_CHAOS_START + 195)
+
+// PROP FOLDER (VIEW)
+#define WID_VIEW_START (WID_CHAOS_START + 196)
+#define WID_VIEW_COLS_BEAMER (WID_CHAOS_START + 196)
+#define WID_VIEW_COLS_FILEDLG (WID_CHAOS_START + 197)
+#define WID_VIEW_COLS_FLDWIN (WID_CHAOS_START + 198)
+#define WID_VIEW_MODE_FLDWIN (WID_CHAOS_START + 199)
+#define WID_VIEW_LAYOUT_FLDWIN (WID_CHAOS_START + 200)
+#define WID_VIEW_ICON_POS_FLDWIN (WID_CHAOS_START + 201)
+#define WID_VIEW_SORT_BEAMER (WID_CHAOS_START + 202)
+#define WID_VIEW_SORT_FILEDLG (WID_CHAOS_START + 203)
+#define WID_VIEW_SORT_FLDWIN_DETAILS (WID_CHAOS_START + 204)
+#define WID_VIEW_SORT_FLDWIN_ICON (WID_CHAOS_START + 205)
+#define WID_VIEW_WINDOW_POS_FLDWIN (WID_CHAOS_START + 206)
+#define WID_VIEW_END (WID_CHAOS_START + 206)
+
+// PROP ALL
+#define WID_IS_INVALID (WID_CHAOS_START + 207)
+
+// PROP Channel
+#define WID_VIEW_TIPHELP (WID_CHAOS_START + 208)
+#define WID_PUBLISHER_SCHEDULE (WID_CHAOS_START + 209)
+#define WID_GETMODE (WID_CHAOS_START + 210)
+#define WID_READ_OFFLINE (WID_CHAOS_START + 211)
+
+// PROP ALL
+#define WID_ALL_START2 (WID_CHAOS_START + 212)
+#define WID_REAL_NAME (WID_CHAOS_START + 212)
+#define WID_FLAG_UPDATE_ON_OPEN (WID_CHAOS_START + 213)
+#define WID_ACTION_LIST (WID_CHAOS_START + 214)
+#define WID_EDIT_STRING (WID_CHAOS_START + 215)
+#define WID_SET_AS_DEFAULT (WID_CHAOS_START + 216)
+#define WID_ALL_END2 (WID_CHAOS_START + 216)
+
+// PROP FOLDER (VIEW)
+#define WID_VIEW2_START (WID_CHAOS_START + 217)
+#define WID_VIEW2_FLD_PIC (WID_CHAOS_START + 217)
+#define WID_FLAG_EXPANDED (WID_CHAOS_START + 218)
+#define WID_CHILD_DEFAULTS (WID_CHAOS_START + 219)
+#define WID_VIEW2_END (WID_CHAOS_START + 219)
+
+// PROP HTTP
+#define WID_HTTP_KEEP_EXPIRED (WID_CHAOS_START + 220)
+#define WID_HTTP_VERIFY_MODE (WID_CHAOS_START + 221)
+#define WID_HTTP_NOCACHE_LIST (WID_CHAOS_START + 222)
+#define WID_HTTP_REFERER (WID_CHAOS_START + 223)
+
+// PROP FSYS
+#define WID_FSYS_START (WID_CHAOS_START + 224)
+#define WID_FSYS_VALUE_FOLDER (WID_CHAOS_START + 224)
+#define WID_FSYS_SHOW_EXTENSION (WID_CHAOS_START + 225)
+#define WID_VALUE_ADDED_MODE (WID_CHAOS_START + 226)
+#define WID_FSYS_DUMMY3 (WID_CHAOS_START + 227)
+#define WID_FSYS_DUMMY4 (WID_CHAOS_START + 228)
+#define WID_FSYS_END (WID_CHAOS_START + 228)
+
+// FUNC HTTP
+#define WID_HTTP_GET_COOKIE (WID_CHAOS_START + 229)
+#define WID_HTTP_SET_COOKIE (WID_CHAOS_START + 230)
+
+// PROP HTTP
+#define WID_HTTP_COOKIE (WID_CHAOS_START + 231)
+#define WID_HTTP_DUMMY_1 (WID_CHAOS_START + 232)
+
+//////////////////////////////////////////////////////////////////////////
+// WID's added after SO 5.0 release ( SUPD > 505 )
+//////////////////////////////////////////////////////////////////////////
+
+// PROP FOLDER
+#define WID_FOLDER_START2 (WID_CHAOS_START + 233)
+#define WID_USER_SORT_CRITERIUM (WID_CHAOS_START + 233)
+#define WID_HEADER_CONFIG (WID_CHAOS_START + 234)
+#define WID_GROUPVIEW_CONFIG (WID_CHAOS_START + 235)
+#define WID_FLD_WEBVIEW_TEMPLATE (WID_CHAOS_START + 236)
+// eigene Iconpositionen fuer den Explorer, da er noch
+// keinen eigenen View-Storage hat
+#define WID_VIEW_ICON_POS_GRPWIN (WID_CHAOS_START + 237)
+#define WID_FOLDER_END2 (WID_CHAOS_START + 237)
+
+// PROP ALL
+#define WID_SHOW_IN_EXPLORER (WID_CHAOS_START + 238)
+
+// PROP FOLDER (VIEW)
+#define WID_VIEW3_START (WID_CHAOS_START + 239)
+#define WID_FLD_FONT (WID_CHAOS_START + 239)
+#define WID_FLD_WEBVIEW_USE_GLOBAL (WID_CHAOS_START + 240)
+#define WID_VIEW3_DUMMY2 (WID_CHAOS_START + 241)
+#define WID_VIEW3_DUMMY3 (WID_CHAOS_START + 242)
+#define WID_VIEW3_END (WID_CHAOS_START + 242)
+
+// PROP FTP
+#define WID_FTP_ACCOUNT (WID_CHAOS_START + 243)
+
+// PROP FOLDER
+#define WID_STORE_MARKED (WID_CHAOS_START + 244)
+
+// REPLICATION ( Currently only here to have file compatibility between
+// SO51 Client and SO51 Server, for which the functionality
+// first shall be implemented ).
+#define WID_REPLICATION_1 (WID_CHAOS_START + 245)
+#define WID_REPLICATION_2 (WID_CHAOS_START + 246)
+#define WID_REPLICATION_3 (WID_CHAOS_START + 247)
+#define WID_REPLICATION_4 (WID_CHAOS_START + 248)
+#define WID_REPLICATION_5 (WID_CHAOS_START + 249)
+
+// PROP SEARCH
+#define WID_SEARCH_INDIRECTIONS (WID_CHAOS_START + 250)
+
+// PROP ALL
+#define WID_SEND_FORMATS (WID_CHAOS_START + 251)
+#define WID_SEND_COPY_TARGET (WID_CHAOS_START + 252)
+
+// FUNC ALL
+#define WID_TRANSFER_RESULT (WID_CHAOS_START + 253)
+
+// END
+#define WID_CHAOS_END (WID_CHAOS_START + 253)
+
+#endif /* OLD_CHAOS */
+
+#endif /* !_CNTWIDS_HRC */
diff --git a/svtools/inc/ctrlbox.hxx b/svtools/inc/ctrlbox.hxx
new file mode 100644
index 000000000000..81f469abd27c
--- /dev/null
+++ b/svtools/inc/ctrlbox.hxx
@@ -0,0 +1,524 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrlbox.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _CTRLBOX_HXX
+#define _CTRLBOX_HXX
+
+#ifndef _INTN_HXX
+#include <tools/intn.hxx>
+#endif
+#ifndef _LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef _COMBOBOX_HXX
+#include <vcl/combobox.hxx>
+#endif
+#ifndef _IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+#ifndef _VIRDEV_HXX
+#include <vcl/virdev.hxx>
+#endif
+#ifndef _METRIC_HXX
+#include <vcl/metric.hxx>
+#endif
+#ifndef _FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+
+class ImplFontList;
+class ImpColorList;
+class ImpLineList;
+class FontList;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class ColorListBox
+
+Beschreibung
+
+Erlaubt die Auswahl von Farben.
+
+--------------------------------------------------------------------------
+
+class LineListBox
+
+Beschreibung
+
+Erlaubt die Auswahl von Linien-Styles und Groessen. Es ist darauf zu achten,
+das vor dem ersten Insert die Units und die Fesntergroesse gesetzt sein
+muessen. An Unit wird Point und mm unterstuetzt und als SourceUnit Point,
+mm und Twips. Alle Angaben muessen in 100teln der jeweiligen Einheit
+vorliegen.
+
+Line1 ist aeussere, Line2 die innere und Distance die Distanz zwischen
+den beiden Linien. Wenn Line2 = 0 ist, wird nur Line1 angezeigt. Als
+Default sind sowohl Source als auch Ziel-Unit FUNIT_POINT.
+
+Mit SetColor() kann die Linienfarbe eingestellt werden.
+
+Anmerkungen und Ausnahmen
+
+Gegenueber einer normalen ListBox, koennen keine User-Daten gesetzt
+werden. Ausserdem sollte wenn der UpdateMode ausgeschaltet ist, keine
+Daten abgefragt oder die Selektion gesetzt werden, da in diesem Zustand
+die Daten nicht definiert sind. Wenn der UpdateMode ausgeschaltet ist,
+sollte der Rueckgabewert bei Insert nicht ausgewertet werden, da er keine
+Bedeutung hat. Ausserdem darf nicht das WinBit WB_SORT gesetzt sein.
+
+--------------------------------------------------------------------------
+
+class FontNameBox
+
+Beschreibung
+
+Erlaubt die Auswahl von Fonts. Die ListBox wird mit Fill gefuellt, wo
+ein Pointer auf eine FontList uebergeben werden muss.
+
+Mit EnableWYSIWYG() kann man einstellen, das die Fontnamen in Ihrer Schrift
+angezeigt werden und mit EnableSymbols() kann eingestellt werden, das
+vor dem Namen ueber ein Symbol angezeigt wird, ob es sich um eine
+Drucker oder Bildschirmschrift handelt.
+
+Querverweise
+
+FontList; FontStyleBox; FontSizeBox; FontNameMenu
+
+--------------------------------------------------------------------------
+
+class FontStyleBox
+
+Beschreibung
+
+Erlaubt die Auswahl eines FontStyles. Mit Fill wird die ListBox mit
+den Styles zum uebergebenen Font gefuellt. Nachgebildete Styles werden
+immer mit eingefuegt (kann sich aber noch aendern, da vielleicht
+nicht alle Applikationen [StarDraw,Formel,FontWork] mit Syntetic-Fonts
+umgehen koennen). Bei Fill bleibt vorherige Name soweit wie moeglich
+erhalten.
+
+Fuer DontKnow sollte die FontStyleBox mit String() gefuellt werden.
+Dann enthaellt die Liste die Standardattribute. Der Style, der gerade
+angezeigt wird, muss gegebenenfalls noch vom Programm zurueckgesetzt werden.
+
+Querverweise
+
+FontList; FontNameBox; FontSizeBox; FontStyleMenu
+
+--------------------------------------------------------------------------
+
+class FontSizeBox
+
+Beschreibung
+
+Erlaubt die Auswahl von Fontgroessen. Werte werden ueber GetValue()
+abgefragt und ueber SetValue() gesetzt. Fill fuellt die ListBox mit den
+Groessen zum uebergebenen Font. Alle Groessen werden in 10tel Point
+angegeben. Die FontListe, die bei Fill uebergeben wird, muss bis zum
+naechsten Fill-Aufruf erhalten bleiben.
+
+Zusaetzlich erlaubt die FontSizeBox noch einen Relative-Mode. Dieser
+dient dazu, Prozent-Werte eingeben zu koennen. Dies kann zum Beispiel
+nuetzlich sein, wenn man die Box in einem Vorlagen-Dialog anbietet.
+Dieser Modus ist nur anschaltbar, jedoch nicht wieder abschaltbar.
+
+Fuer DontKnow sollte die FontSizeBox mit FontInfo() gefuellt werden.
+Dann enthaellt die Liste die Standardgroessen. Die Groesse, die gerade
+angezeigt wird, muss gegebenenfalls noch vom Programm zurueckgesetzt werden.
+
+Querverweise
+
+FontList; FontNameBox; FontStyleBox; FontSizeMenu
+
+*************************************************************************/
+
+// ----------------
+// - ColorListBox -
+// ----------------
+
+class ColorListBox : public ListBox
+{
+ ImpColorList* pColorList; // Separate Liste, falls UserDaten von aussen verwendet werden.
+ Size aImageSize;
+
+#ifdef _CTRLBOX_CXX
+ void ImplInit();
+ void ImplDestroyColorEntries();
+#endif
+
+public:
+ ColorListBox( Window* pParent,
+ WinBits nWinStyle = WB_BORDER );
+ ColorListBox( Window* pParent, const ResId& rResId );
+ virtual ~ColorListBox();
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ USHORT InsertEntry( const XubString& rStr,
+ USHORT nPos = LISTBOX_APPEND );
+ USHORT InsertEntry( const Color& rColor, const XubString& rStr,
+ USHORT nPos = LISTBOX_APPEND );
+ void RemoveEntry( USHORT nPos );
+ void Clear();
+ void CopyEntries( const ColorListBox& rBox );
+
+ USHORT GetEntryPos( const XubString& rStr ) const
+ { return ListBox::GetEntryPos( rStr ); }
+
+ USHORT GetEntryPos( const Color& rColor ) const;
+ Color GetEntryColor( USHORT nPos ) const;
+ Size GetImageSize() const { return aImageSize; }
+
+ void SelectEntry( const XubString& rStr, BOOL bSelect = TRUE )
+ { ListBox::SelectEntry( rStr, bSelect ); }
+ void SelectEntry( const Color& rColor, BOOL bSelect = TRUE );
+ XubString GetSelectEntry( USHORT nSelIndex = 0 ) const
+ { return ListBox::GetSelectEntry( nSelIndex ); }
+ Color GetSelectEntryColor( USHORT nSelIndex = 0 ) const;
+ BOOL IsEntrySelected( const XubString& rStr ) const
+ { return ListBox::IsEntrySelected( rStr ); }
+
+ BOOL IsEntrySelected( const Color& rColor ) const;
+
+private:
+ // Wegen einigen Compilern hier nocheinmal private deklariert, da
+ // ansonsten die Compiler diese als Default-Funktionen implementieren
+ ColorListBox( const ColorListBox& );
+ ColorListBox& operator =( const ColorListBox& );
+ USHORT GetEntryPos( const void* pData ) const;
+ void SetEntryData( USHORT nPos, void* pNewData );
+ void* GetEntryData( USHORT nPos ) const;
+};
+
+inline void ColorListBox::SelectEntry( const Color& rColor, BOOL bSelect )
+{
+ USHORT nPos = GetEntryPos( rColor );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ ListBox::SelectEntryPos( nPos, bSelect );
+}
+
+inline BOOL ColorListBox::IsEntrySelected( const Color& rColor ) const
+{
+ USHORT nPos = GetEntryPos( rColor );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return IsEntryPosSelected( nPos );
+ else
+ return FALSE;
+}
+
+inline Color ColorListBox::GetSelectEntryColor( USHORT nSelIndex ) const
+{
+ USHORT nPos = GetSelectEntryPos( nSelIndex );
+ Color aColor;
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ aColor = GetEntryColor( nPos );
+ return aColor;
+}
+
+// ---------------
+// - LineListBox -
+// ---------------
+
+class LineListBox : public ListBox
+{
+ ImpLineList* pLineList;
+ VirtualDevice aVirDev;
+ International aIntn;
+ Size aTxtSize;
+ Color aColor;
+ FieldUnit eUnit;
+ FieldUnit eSourceUnit;
+
+#ifdef _CTRLBOX_CXX
+ void ImpGetLine( long nLine1, long nLine2, long nDistance,
+ Bitmap& rBmp, XubString& rStr );
+ void ImplInit();
+#endif
+
+public:
+ LineListBox( Window* pParent,
+ WinBits nWinStyle = WB_BORDER );
+ LineListBox( Window* pParent, const ResId& rResId );
+ virtual ~LineListBox();
+
+ USHORT InsertEntry( const XubString& rStr,
+ USHORT nPos = LISTBOX_APPEND );
+ USHORT InsertEntry( long nLine1, long nLine2 = 0,
+ long nDistance = 0,
+ USHORT nPos = LISTBOX_APPEND );
+ void RemoveEntry( USHORT nPos );
+ void Clear();
+
+ USHORT GetEntryPos( const XubString& rStr ) const
+ { return ListBox::GetEntryPos( rStr ); }
+ USHORT GetEntryPos( long nLine1, long nLine2 = 0,
+ long nDistance = 0 ) const;
+ long GetEntryLine1( USHORT nPos ) const;
+ long GetEntryLine2( USHORT nPos ) const;
+ long GetEntryDistance( USHORT nPos ) const;
+
+ void SelectEntry( const XubString& rStr, BOOL bSelect = TRUE )
+ { ListBox::SelectEntry( rStr, bSelect ); }
+ void SelectEntry( long nLine1, long nLine2 = 0,
+ long nDistance = 0, BOOL bSelect = TRUE );
+ long GetSelectEntryLine1( USHORT nSelIndex = 0 ) const;
+ long GetSelectEntryLine2( USHORT nSelIndex = 0 ) const;
+ long GetSelectEntryDistance( USHORT nSelIndex = 0 ) const;
+ BOOL IsEntrySelected( const XubString& rStr ) const
+ { return ListBox::IsEntrySelected( rStr ); }
+ BOOL IsEntrySelected( long nLine1, long nLine2 = 0,
+ long nDistance = 0 ) const;
+
+ void SetUnit( FieldUnit eNewUnit ) { eUnit = eNewUnit; }
+ FieldUnit GetUnit() const { return eUnit; }
+ void SetSourceUnit( FieldUnit eNewUnit ) { eSourceUnit = eNewUnit; }
+ FieldUnit GetSourceUnit() const { return eSourceUnit; }
+
+ void SetColor( const Color& rColor );
+ Color GetColor() const { return aColor; }
+
+private:
+ // Wegen einigen Compilern hier nocheinmal private deklariert, da
+ // ansonsten die Compiler diese als Default-Funktionen implementieren
+ LineListBox( const LineListBox& );
+ LineListBox& operator =( const LineListBox& );
+ USHORT GetEntryPos( const void* pData ) const;
+ void SetEntryData( USHORT nPos, void* pNewData );
+ void* GetEntryData( USHORT nPos ) const;
+};
+
+inline void LineListBox::SelectEntry( long nLine1, long nLine2,
+ long nDistance, BOOL bSelect )
+{
+ USHORT nPos = GetEntryPos( nLine1, nLine2, nDistance );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ ListBox::SelectEntryPos( nPos, bSelect );
+}
+
+inline long LineListBox::GetSelectEntryLine1( USHORT nSelIndex ) const
+{
+ USHORT nPos = GetSelectEntryPos( nSelIndex );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return GetEntryLine1( nPos );
+ else
+ return 0;
+}
+
+inline long LineListBox::GetSelectEntryLine2( USHORT nSelIndex ) const
+{
+ USHORT nPos = GetSelectEntryPos( nSelIndex );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return GetEntryLine2( nPos );
+ else
+ return 0;
+}
+
+inline long LineListBox::GetSelectEntryDistance( USHORT nSelIndex ) const
+{
+ USHORT nPos = GetSelectEntryPos( nSelIndex );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return GetEntryDistance( nPos );
+ else
+ return 0;
+}
+
+inline BOOL LineListBox::IsEntrySelected( long nLine1, long nLine2,
+ long nDistance ) const
+{
+ USHORT nPos = GetEntryPos( nLine1, nLine2, nDistance );
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ return IsEntryPosSelected( nPos );
+ else
+ return FALSE;
+}
+
+// ---------------
+// - FontNameBox -
+// ---------------
+
+class FontNameBox : public ComboBox
+{
+private:
+ ImplFontList* mpFontList;
+ Image maImagePrinterFont;
+ Image maImageBitmapFont;
+ Image maImageScalableFont;
+ BOOL mbWYSIWYG;
+ BOOL mbSymbols;
+
+#ifdef _CTRLBOX_CXX
+ void ImplCalcUserItemSize();
+ void ImplDestroyFontList();
+#endif
+
+public:
+ FontNameBox( Window* pParent,
+ WinBits nWinStyle = WB_SORT );
+ FontNameBox( Window* pParent, const ResId& rResId );
+ virtual ~FontNameBox();
+
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void Fill( const FontList* pList );
+
+ void EnableWYSIWYG( BOOL bEnable = TRUE );
+ BOOL IsWYSIWYGEnabled() const { return mbWYSIWYG; }
+
+ void EnableSymbols( BOOL bEnable = TRUE );
+ BOOL IsSymbolsEnabled() const { return mbSymbols; }
+
+private:
+ // Wegen einigen Compilern hier nocheinmal private deklariert, da
+ // ansonsten die Compiler diese als Default-Funktionen implementieren
+ FontNameBox( const FontNameBox& );
+ FontNameBox& operator =( const FontNameBox& );
+};
+
+// ----------------
+// - FontStyleBox -
+// ----------------
+
+class FontStyleBox : public ComboBox
+{
+ XubString aLastStyle;
+
+public:
+ FontStyleBox( Window* pParent, WinBits nWinStyle = 0 );
+ FontStyleBox( Window* pParent, const ResId& rResId );
+ virtual ~FontStyleBox();
+
+ virtual void Select();
+ virtual void LoseFocus();
+ virtual void Modify();
+
+ void SetText( const XubString& rText );
+ void Fill( const XubString& rName, const FontList* pList );
+
+private:
+ // Wegen einigen Compilern hier nocheinmal private deklariert, da
+ // ansonsten die Compiler diese als Default-Funktionen implementieren
+ FontStyleBox( const FontStyleBox& );
+ FontStyleBox& operator =( const FontStyleBox& );
+};
+
+inline void FontStyleBox::SetText( const XubString& rText )
+{
+ aLastStyle = rText;
+ ComboBox::SetText( rText );
+}
+
+// ---------------
+// - FontSizeBox -
+// ---------------
+
+class FontSizeBox : public MetricBox
+{
+ FontInfo aFontInfo;
+ const FontList* pFontList;
+ USHORT nRelMin;
+ USHORT nRelMax;
+ USHORT nRelStep;
+ short nPtRelMin;
+ short nPtRelMax;
+ short nPtRelStep;
+ BOOL bRelativeMode:1,
+ bRelative:1,
+ bPtRelative:1,
+ bStdSize:1;
+
+#ifdef _CTRLBOX_CXX
+ void ImplInit();
+#endif
+
+protected:
+ virtual XubString CreateFieldText( long nValue ) const;
+
+public:
+ FontSizeBox( Window* pParent, WinBits nWinStyle = 0 );
+ FontSizeBox( Window* pParent, const ResId& rResId );
+ virtual ~FontSizeBox();
+
+ void Modify();
+
+ void Fill( const FontInfo& rInfo, const FontList* pList );
+
+ void EnableRelativeMode( USHORT nMin = 50, USHORT nMax = 150,
+ USHORT nStep = 5 );
+ void EnablePtRelativeMode( short nMin = -200, short nMax = 200,
+ short nStep = 10 );
+ BOOL IsRelativeMode() const { return bRelativeMode; }
+ void SetRelative( BOOL bRelative = FALSE );
+ BOOL IsRelative() const { return bRelative; }
+ BOOL IsPtRelative() const { return bPtRelative; }
+ void SetPtRelative( BOOL bPtRel = TRUE )
+ { bPtRelative = bPtRel; SetRelative( TRUE ); }
+
+private:
+ // Wegen einigen Compilern hier nocheinmal private deklariert, da
+ // ansonsten die Compiler diese als Default-Funktionen implementieren
+ FontSizeBox( const FontSizeBox& );
+ FontSizeBox& operator =( const FontSizeBox& );
+};
+
+#endif // _CTRLBOX_HXX
diff --git a/svtools/inc/ctrltool.hxx b/svtools/inc/ctrltool.hxx
new file mode 100644
index 000000000000..dbb6f1831577
--- /dev/null
+++ b/svtools/inc/ctrltool.hxx
@@ -0,0 +1,257 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrltool.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _CTRLTOOL_HXX
+#define _CTRLTOOL_HXX
+
+#ifndef _SAL_TYPES_H
+#include <sal/types.h>
+#endif
+#ifndef _LIST_HXX
+#include <tools/list.hxx>
+#endif
+#ifndef _METRIC_HXX
+#include <vcl/metric.hxx>
+#endif
+
+class ImplFontListNameInfo;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class FontList
+
+Diese Klasse verwaltet alle Fonts, die auf einem oder zwei Ausgabegeraeten
+dargestellt werden koennen. Zusaetzlich bietet die Klasse Methoden an, um
+aus Fett und Kursiv den StyleName zu generieren oder aus einem Stylename
+die fehlenden Attribute. Zusaetzlich kann diese Klasse syntetisch nachgebildete
+Fonts verarbeiten. Diese Klasse kann mit verschiedenen Standard-Controls und
+Standard-Menus zusammenarbeiten.
+
+Querverweise
+
+class FontNameBox, class FontStyleBox, class FontSizeBox,
+class FontNameMenu, class FontStyleMenu, class FontSizeMenu
+
+--------------------------------------------------------------------------
+
+FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2 = NULL,
+ BOOL bAll = TRUE );
+
+Konstruktor der Klasse FontList. Vom uebergebenen OutputDevice werden die
+entsprechenden Fonts abgefragt. Das OutputDevice muss solange existieren,
+wie auch die Klasse FontList existiert. Optional kann noch ein 2tes
+Ausgabedevice uebergeben werden, damit man zum Beispiel die Fonts von
+einem Drucker und dem Bildschirm zusammen in einer FontListe verwalten kann
+und somit auch den FontListen und FontMenus die Fonts von beiden OutputDevices
+zu uebergeben. Auch das pDevice2 muss solange existieren, wie die Klasse
+FontList existiert.
+
+Das OutputDevice, welches als erstes uebergeben wird, sollte das bevorzugte
+sein. Dies sollte im normalfall der Drucker sein. Denn wenn 2 verschiede
+Device-Schriften (eine fuer Drucker und eine fuer den Bildschirm) vorhanden
+sind, wird die vom uebergebenen Device "pDevice" bevorzugt.
+
+Mit dem dritten Parameter kann man angeben, ob nur skalierbare Schriften
+abgefragt werden sollen oder alle. Wenn TRUE uebergeben wird, werden auch
+Bitmap-Schriften mit abgefragt. Bei FALSE werden Vector-Schriften und
+scalierbare Schriften abgefragt.
+
+--------------------------------------------------------------------------
+
+String FontList::GetStyleName( const FontInfo& rInfo ) const;
+
+Diese Methode gibt den StyleName von einer FontInfo zurueck. Falls kein
+StyleName gesetzt ist, wird aus den gesetzten Attributen ein entsprechender
+Name generiert, der dem Anwender praesentiert werden kann.
+
+--------------------------------------------------------------------------
+
+XubString FontList::GetFontMapText( const FontInfo& rInfo ) const;
+
+Diese Methode gibt einen Matchstring zurueck, der dem Anwender
+anzeigen soll, welche Probleme es mit diesem Font geben kann.
+
+--------------------------------------------------------------------------
+
+FontInfo FontList::Get( const String& rName, const String& rStyleName ) const;
+
+Diese Methode sucht aus dem uebergebenen Namen und dem uebergebenen StyleName
+die entsprechende FontInfo-Struktur raus. Der Stylename kann in dieser
+Methode auch ein syntetischer sein. In diesem Fall werden die entsprechenden
+Werte in der FontInfo-Struktur entsprechend gesetzt. Wenn ein StyleName
+uebergeben wird, kann jedoch eine FontInfo-Struktur ohne Stylename
+zurueckgegeben werden. Um den StyleName dem Anwender zu repraesentieren,
+muss GetStyleName() mit dieser FontInfo-Struktur aufgerufen werden.
+
+Querverweise
+
+FontList::GetStyleName()
+
+--------------------------------------------------------------------------
+
+FontInfo FontList::Get( const String& rName, FontWeight eWeight,
+ FontItalic eItalic ) const;
+
+Diese Methode sucht aus dem uebergebenen Namen und den uebergebenen Styles
+die entsprechende FontInfo-Struktur raus. Diese Methode kann auch eine
+FontInfo-Struktur ohne Stylename zurueckgegeben. Um den StyleName dem
+Anwender zu repraesentieren, muss GetStyleName() mit dieser FontInfo-Struktur
+aufgerufen werden.
+
+Querverweise
+
+FontList::GetStyleName()
+
+--------------------------------------------------------------------------
+
+const long* FontList::GetSizeAry( const FontInfo& rInfo ) const;
+
+Diese Methode liefert zum uebergebenen Font die vorhandenen Groessen.
+Falls es sich dabei um einen skalierbaren Font handelt, werden Standard-
+Groessen zurueckgegeben. Das Array enthaelt die Hoehen des Fonts in 10tel
+Point. Der letzte Wert des Array ist 0. Das Array, was zurueckgegeben wird,
+wird von der FontList wieder zerstoert. Nach dem Aufruf der naechsten Methode
+von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
+
+*************************************************************************/
+
+// ------------
+// - FontList -
+// ------------
+
+#define FONTLIST_FONTINFO_NOTFOUND ((USHORT)0xFFFF)
+
+#define FONTLIST_FONTNAMETYPE_PRINTER ((USHORT)0x0001)
+#define FONTLIST_FONTNAMETYPE_SCREEN ((USHORT)0x0002)
+#define FONTLIST_FONTNAMETYPE_SCALABLE ((USHORT)0x0004)
+
+class FontList : private List
+{
+private:
+ XubString maMapBoth;
+ XubString maMapPrinterOnly;
+ XubString maMapScreenOnly;
+ XubString maMapSizeNotAvailable;
+ XubString maMapStyleNotAvailable;
+ XubString maMapNotAvailable;
+ XubString maLight;
+ XubString maLightItalic;
+ XubString maNormal;
+ XubString maNormalItalic;
+ XubString maBold;
+ XubString maBoldItalic;
+ XubString maBlack;
+ XubString maBlackItalic;
+ long* mpSizeAry;
+ OutputDevice* mpDev;
+ OutputDevice* mpDev2;
+
+#ifdef CTRLTOOL_CXX
+ ImplFontListNameInfo* ImplFind( const XubString& rSearchName, ULONG* pIndex ) const;
+ ImplFontListNameInfo* ImplFindByName( const XubString& rStr ) const;
+ void ImplInsertFonts( OutputDevice* pDev, BOOL bAll,
+ BOOL bInsertData );
+#endif
+
+public:
+ FontList( OutputDevice* pDevice,
+ OutputDevice* pDevice2 = NULL,
+ BOOL bAll = TRUE );
+ ~FontList();
+
+ OutputDevice* GetDevice() const { return mpDev; }
+ OutputDevice* GetDevice2() const { return mpDev2; }
+ XubString GetFontMapText( const FontInfo& rInfo ) const;
+ USHORT GetFontNameType( const XubString& rFontName ) const;
+
+ const XubString& GetNormalStr() const { return maNormal; }
+ const XubString& GetItalicStr() const { return maNormalItalic; }
+ const XubString& GetBoldStr() const { return maBold; }
+ const XubString& GetBoldItalicStr() const { return maBoldItalic; }
+ XubString GetStyleName( const FontInfo& rInfo ) const;
+
+ FontInfo Get( const XubString& rName,
+ const XubString& rStyleName ) const;
+ FontInfo Get( const XubString& rName,
+ FontWeight eWeight,
+ FontItalic eItalic ) const;
+
+ BOOL IsAvailable( const XubString& rName ) const;
+ USHORT GetFontNameCount() const
+ { return (USHORT)List::Count(); }
+ const FontInfo& GetFontName( USHORT nFont ) const;
+ USHORT GetFontNameType( USHORT nFont ) const;
+ sal_Handle GetFirstFontInfo( const XubString& rName ) const;
+ sal_Handle GetNextFontInfo( sal_Handle hFontInfo ) const;
+ const FontInfo& GetFontInfo( sal_Handle hFontInfo ) const;
+
+ const long* GetSizeAry( const FontInfo& rInfo ) const;
+ static const long* GetStdSizeAry();
+
+private:
+ FontList( const FontList& );
+ FontList& operator =( const FontList& );
+};
+
+#endif // _CTRLTOOL_HXX
diff --git a/svtools/inc/expander.hxx b/svtools/inc/expander.hxx
new file mode 100644
index 000000000000..2b2ab15a320f
--- /dev/null
+++ b/svtools/inc/expander.hxx
@@ -0,0 +1,131 @@
+/*************************************************************************
+ *
+ * $RCSfile: expander.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_EXPANDER_HXX
+#define _SV_EXPANDER_HXX
+
+#ifndef _SV_CTRL_HXX
+#include <vcl/ctrl.hxx>
+#endif
+
+#ifndef _SV_IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+
+enum SvExpanderStateType
+{
+ EST_MIN=1,
+ EST_PLUS=2,
+ EST_MIN_DOWN=3,
+ EST_PLUS_DOWN=4,
+ EST_NONE=5,
+ EST_MIN_DIS=6,
+ EST_PLUS_DIS=7,
+ EST_MIN_DOWN_DIS=8,
+ EST_PLUS_DOWN_DIS=9
+};
+
+class SvExpander: public Control
+{
+private:
+ Point aImagePos;
+ Point aTextPos;
+ Image aActiveImage;
+ Rectangle maFocusRect;
+ ImageList maExpanderImages;
+ BOOL mbIsExpanded;
+ BOOL mbHasFocusRect;
+ BOOL mbIsInMouseDown;
+ Link maToggleHdl;
+ SvExpanderStateType eType;
+
+protected:
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void KeyUp( const KeyEvent& rKEvt );
+
+ virtual void Click();
+ virtual void Resize();
+
+public:
+ SvExpander( Window* pParent, WinBits nStyle = 0 );
+ SvExpander( Window* pParent, const ResId& rResId );
+
+ BOOL IsExpanded() {return mbIsExpanded;}
+
+ void SetToExpanded(BOOL bFlag=TRUE);
+
+ void SetExpanderImage( SvExpanderStateType eType);
+ Image GetExpanderImage(SvExpanderStateType eType);
+ Size GetMinSize() const;
+
+ void SetToggleHdl( const Link& rLink ) { maToggleHdl = rLink; }
+ const Link& GetToggleHdl() const { return maToggleHdl; }
+};
+
+
+
+#endif
diff --git a/svtools/inc/filectrl.hrc b/svtools/inc/filectrl.hrc
new file mode 100644
index 000000000000..4b50d373bada
--- /dev/null
+++ b/svtools/inc/filectrl.hrc
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * $RCSfile: filectrl.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_FILECTRL_HRC
+#define _SV_FILECTRL_HRC
+
+#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?!
+
+#endif
+
diff --git a/svtools/inc/filectrl.hxx b/svtools/inc/filectrl.hxx
new file mode 100644
index 000000000000..396d7d30b665
--- /dev/null
+++ b/svtools/inc/filectrl.hxx
@@ -0,0 +1,155 @@
+/*************************************************************************
+ *
+ * $RCSfile: filectrl.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_FILECTRL_HXX
+#define _SV_FILECTRL_HXX
+
+#ifndef _SV_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef _SV_EDIT_HXX
+#include <vcl/edit.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+
+
+#define STR_FILECTRL_BUTTONTEXT 333 // ID-Range?!
+
+// Flags for FileControl
+typedef USHORT FileControlMode;
+#define FILECTRL_RESIZEBUTTONBYPATHLEN ((USHORT)0x0001)//if this is set, the button will become small as soon as the Text in the Edit Field is to long to be shown completely
+
+
+// Flags for internal use of FileControl
+typedef USHORT FileControlMode_Internal;
+#define FILECTRL_INRESIZE ((USHORT)0x0001)
+#define FILECTRL_ORIGINALBUTTONTEXT ((USHORT)0x0002)
+
+
+class VclFileDialog;
+class FileDialog;
+class FileControl : public Window
+{
+private:
+ Edit maEdit;
+ PushButton maButton;
+
+ String maButtonText;
+ BOOL mbOpenDlg;
+
+ VclFileDialog* mpVclDlg;
+ FileDialog* mpFDlg;
+
+ Link maDialogCreatedHdl;
+
+ FileControlMode mnFlags;
+ FileControlMode_Internal mnInternalFlags;
+
+protected:
+ void Resize();
+ void GetFocus();
+ void StateChanged( StateChangedType nType );
+ WinBits ImplInitStyle( WinBits nStyle );
+ DECL_LINK( ButtonHdl, PushButton* );
+
+public:
+ FileControl( Window* pParent, WinBits nStyle, FileControlMode = 0 );
+ ~FileControl();
+
+ Edit& GetEdit() { return maEdit; }
+ PushButton& GetButton() { return maButton; }
+
+ void Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags );
+
+ void SetOpenDialog( BOOL bOpen ) { mbOpenDlg = bOpen; }
+ BOOL IsOpenDialog() const { return mbOpenDlg; }
+
+ void SetText( const XubString& rStr );
+ XubString GetText() const;
+ UniString GetSelectedText() const { return maEdit.GetSelected(); }
+
+ void SetSelection( const Selection& rSelection ) { maEdit.SetSelection( rSelection ); }
+ Selection GetSelection() const { return maEdit.GetSelection(); }
+
+ void SetReadOnly( BOOL bReadOnly = TRUE ) { maEdit.SetReadOnly( bReadOnly ); }
+ BOOL IsReadOnly() const { return maEdit.IsReadOnly(); }
+
+ //------
+ //manipulate the Button-Text:
+ XubString GetButtonText() const { return maButtonText; }
+ void SetButtonText( const XubString& rStr );
+ void ResetButtonText();
+
+ //------
+ //use this to manipulate the dialog bevore executing it:
+ void SetDialogCreatedHdl( const Link& rLink ) { maDialogCreatedHdl = rLink; }
+ const Link& GetDialogCreatedHdl() const { return maDialogCreatedHdl; }
+
+ //only use the next two methods in 'DialogCreatedHdl' and don't store the dialog-pointer
+ VclFileDialog* GetVclFileDialog() const { return mpVclDlg; }
+ FileDialog* GetFileDialog() const { return mpFDlg; }
+ //------
+};
+
+#endif
+
diff --git a/svtools/inc/filedlg.hxx b/svtools/inc/filedlg.hxx
new file mode 100644
index 000000000000..7e4fcbe758b8
--- /dev/null
+++ b/svtools/inc/filedlg.hxx
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: filedlg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVT_FILEDLG_HXX
+#define _SVT_FILEDLG_HXX
+
+#ifndef _DIALOG_HXX
+#include <vcl/dialog.hxx>
+#endif
+
+class Edit;
+class ImpSvFileDlg;
+
+// --------------
+// - SvPathDialog -
+// --------------
+
+class PathDialog : public ModalDialog
+{
+private:
+ friend class FileDialog; // Imp...
+
+ ImpSvFileDlg* pImpFileDlg; // Implementation
+ Link aOKHdlLink; // Link zum OK-Handler
+
+protected:
+ UniString aDfltExt; // Default - Extension
+
+public:
+ PathDialog( Window* pParent, WinBits nWinStyle = 0, BOOL bCreateDir = TRUE );
+ ~PathDialog();
+
+ virtual long OK();
+
+ void SetPath( const UniString& rNewPath );
+ void SetPath( const Edit& rEdit );
+ UniString GetPath() const;
+
+ void SetOKHdl( const Link& rLink ) { aOKHdlLink = rLink; }
+ const Link& GetOKHdl() const { return aOKHdlLink; }
+
+ virtual short Execute();
+};
+
+// --------------
+// - SvFileDialog -
+// --------------
+
+class FileDialog : public PathDialog
+{
+private:
+ Link aFileHdlLink; // Link zum FileSelect-Handler
+ Link aFilterHdlLink; // Link zum FilterSelect-Handler
+
+public:
+ FileDialog( Window* pParent, WinBits nWinStyle );
+ ~FileDialog();
+
+ virtual void FileSelect();
+ virtual void FilterSelect();
+
+ void SetDefaultExt( const UniString& rExt ) { aDfltExt = rExt; }
+ const UniString& GetDefaultExt() const { return aDfltExt; }
+ void AddFilter( const UniString& rFilter, const UniString& rType );
+ void AddFilter( const UniString& rFilter, const UniString& rType,
+ const UniString& rSysType );
+ void RemoveFilter( const UniString& rFilter );
+ void RemoveAllFilter();
+ void SetCurFilter( const UniString& rFilter );
+ UniString GetCurFilter() const;
+ USHORT GetFilterCount() const;
+ UniString GetFilterName( USHORT nPos ) const;
+ UniString GetFilterType( USHORT nPos ) const;
+
+ void SetFileSelectHdl( const Link& rLink ) { aFileHdlLink = rLink; }
+ const Link& GetFileSelectHdl() const { return aFileHdlLink; }
+ void SetFilterSelectHdl( const Link& rLink ) { aFilterHdlLink = rLink; }
+ const Link& GetFilterSelectHdl() const { return aFilterHdlLink; }
+
+ void SetOkButtonText( const UniString& rText );
+ void SetCancelButtonText( const UniString& rText );
+};
+
+#endif // _FILEDLG_HXX
diff --git a/svtools/inc/flbytes.hxx b/svtools/inc/flbytes.hxx
new file mode 100644
index 000000000000..001965c4a051
--- /dev/null
+++ b/svtools/inc/flbytes.hxx
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * $RCSfile: flbytes.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FLBYTES_HXX
+#define _FLBYTES_HXX
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+
+//============================================================================
+class SvFillLockBytes : public SvLockBytes
+{
+ SvLockBytesRef xLockBytes;
+ ULONG nFilledSize;
+ BOOL bTerminated;
+ BOOL bSync;
+public:
+ TYPEINFO();
+
+ SvFillLockBytes( SvLockBytes* pLockBytes );
+ virtual ErrCode ReadAt(
+ ULONG nPos, void* pBuffer, ULONG nCount, ULONG* pRead ) const;
+ virtual ErrCode WriteAt(
+ ULONG nPos, const void* pBuffer, ULONG nCount, ULONG* pWritten );
+ virtual ErrCode Flush() const;
+ virtual ErrCode SetSize( ULONG nSize );
+ virtual ErrCode LockRegion( ULONG nPos, ULONG nCount, LockType );
+ virtual ErrCode UnlockRegion( ULONG nPos, ULONG nCount, LockType );
+ virtual ErrCode Stat( SvLockBytesStat*, SvLockBytesStatFlag ) const;
+ ErrCode FillAppend( const void* pBuffer, ULONG nCount, ULONG *pWritten );
+ ULONG Tell() const { return nFilledSize; }
+ void Seek( ULONG nPos ) { nFilledSize = nPos; }
+
+ void Terminate();
+};
+
+SV_DECL_IMPL_REF( SvFillLockBytes )
+
+//============================================================================
+class SvSyncLockBytes: public SvOpenLockBytes
+{
+ SvAsyncLockBytesRef m_xAsyncLockBytes;
+
+public:
+ TYPEINFO();
+
+ /// Create a synchronous wrapper around existing asynchronous lock bytes.
+ ///
+ /// @param pTheAsyncLockBytes Must not be null.
+ inline SvSyncLockBytes(SvAsyncLockBytes * pTheAsyncLockBytes);
+
+ /// Create a synchronous wrapper around an existing stream.
+ ///
+ /// @descr This is like first creating asynchronous lock bytes around the
+ /// stream and than creating a synchronous wrapper around the asynchronous
+ /// lock bytes.
+ ///
+ /// @param pStream Must not be null.
+ ///
+ /// @param bOwner True if these lock bytes own the stream (delete it on
+ /// destruction).
+ SvSyncLockBytes(SvStream * pStream, BOOL bOwner):
+ m_xAsyncLockBytes(new SvAsyncLockBytes(pStream, bOwner)) {}
+
+ virtual const SvStream * GetStream() const
+ { return m_xAsyncLockBytes->GetStream(); }
+
+ virtual void SetSynchronMode(BOOL bSync = TRUE)
+ { m_xAsyncLockBytes->SetSynchronMode(bSync); }
+
+ virtual BOOL IsSynchronMode() const
+ { return m_xAsyncLockBytes->IsSynchronMode(); }
+
+ virtual ErrCode ReadAt(ULONG nPos, void * pBuffer, ULONG nCount,
+ ULONG * pRead) const;
+
+ virtual ErrCode WriteAt(ULONG nPos, const void * pBuffer, ULONG nCount,
+ ULONG * pWritten);
+
+ virtual ErrCode Flush() const { return m_xAsyncLockBytes->Flush(); }
+
+ virtual ErrCode SetSize(ULONG nSize)
+ { return m_xAsyncLockBytes->SetSize(nSize); }
+
+ virtual ErrCode LockRegion(ULONG nPos, ULONG nCount, LockType eType)
+ { return m_xAsyncLockBytes->LockRegion(nPos, nCount, eType); }
+
+ virtual ErrCode UnlockRegion(ULONG nPos, ULONG nCount, LockType eType)
+ { return m_xAsyncLockBytes->UnlockRegion(nPos, nCount, eType); }
+
+ virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag eFlag)
+ const
+ { return m_xAsyncLockBytes->Stat(pStat, eFlag); }
+
+ virtual ErrCode FillAppend(const void * pBuffer, ULONG nCount,
+ ULONG * pWritten)
+ { return m_xAsyncLockBytes->FillAppend(pBuffer, nCount, pWritten); }
+
+ virtual ULONG Tell() const { return m_xAsyncLockBytes->Tell(); }
+
+ virtual ULONG Seek(ULONG nPos)
+ { return m_xAsyncLockBytes->Seek(nPos); }
+
+ virtual void Terminate() { m_xAsyncLockBytes->Terminate(); }
+};
+
+inline SvSyncLockBytes::SvSyncLockBytes(SvAsyncLockBytes *
+ pTheAsyncLockBytes):
+ m_xAsyncLockBytes(pTheAsyncLockBytes)
+{
+ DBG_ASSERT(m_xAsyncLockBytes.Is(),
+ "SvSyncLockBytes::SvSyncLockBytes(): Null");
+}
+
+SV_DECL_IMPL_REF(SvSyncLockBytes);
+
+//============================================================================
+struct SvCompositeLockBytes_Impl;
+class SvCompositeLockBytes : public SvLockBytes
+{
+ SvCompositeLockBytes_Impl* pImpl;
+public:
+ TYPEINFO();
+
+ SvCompositeLockBytes( );
+ ~SvCompositeLockBytes();
+
+ void Append( SvLockBytes* pLockBytes, ULONG nPos, ULONG nOffset );
+ ULONG RelativeOffset( ULONG nPos ) const;
+ void SetIsPending( BOOL bSet );
+ SvLockBytes* GetLastLockBytes() const;
+
+ virtual ErrCode ReadAt(
+ ULONG nPos, void* pBuffer, ULONG nCount, ULONG* pRead ) const;
+ virtual ErrCode WriteAt(
+ ULONG nPos, const void* pBuffer, ULONG nCount, ULONG* pWritten );
+ virtual ErrCode Flush() const;
+ virtual ErrCode SetSize( ULONG nSize );
+ virtual ErrCode LockRegion( ULONG nPos, ULONG nCount, LockType );
+ virtual ErrCode UnlockRegion( ULONG nPos, ULONG nCount, LockType );
+ virtual ErrCode Stat( SvLockBytesStat*, SvLockBytesStatFlag ) const;
+};
+
+SV_DECL_IMPL_REF( SvCompositeLockBytes )
+
+
+#endif
diff --git a/svtools/inc/fltdefs.hxx b/svtools/inc/fltdefs.hxx
new file mode 100644
index 000000000000..4cdf1b8f11f9
--- /dev/null
+++ b/svtools/inc/fltdefs.hxx
@@ -0,0 +1,196 @@
+/*************************************************************************
+ *
+ * $RCSfile: fltdefs.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:50 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+#include <vcl/bitmap.hxx>
+
+#include <string.h>
+
+#ifndef _FLTDEFS_HXX
+#define _FLTDEFS_HXX
+
+
+#if defined ( WIN ) || defined ( WNT )
+
+#define RGBQUAD RGBQUADWIN
+
+typedef struct RGBQUAD
+{
+ BYTE rgbBlue;
+ BYTE rgbGreen;
+ BYTE rgbRed;
+ BYTE rgbReserved;
+
+ RGBQUAD( const BYTE cRed = 0, const BYTE cGreen = 0, const BYTE cBlue = 0 ) :
+ rgbBlue ( cBlue ),
+ rgbGreen ( cGreen ),
+ rgbRed ( cRed ),
+ rgbReserved ( 0 ) {};
+} RGBQUAD;
+
+
+#ifdef WIN
+typedef BYTE huge* PDIBBYTE;
+#define MEMCPY hmemcpy
+#define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalLock(GlobalAlloc(GHND,(nSize))))
+#define GLOBALHANDLE(pPointer) ((HGLOBAL)GlobalHandle((*((size_t*)&(pPointer)+1))))
+#define GLOBALFREE(pPointer) (GlobalUnlock(GLOBALHANDLE((pPointer))))
+#define MEMSET( pDst, cByte, nCount ) \
+{ \
+ PDIBBYTE pTmp = (PDIBBYTE) pDst; \
+ for ( ULONG i = 0; i < nCount; i++ )\
+ *pTmp++ = cByte; \
+}
+
+#else
+
+typedef BYTE* PDIBBYTE;
+#define MEMCPY memcpy
+#define MEMSET memset
+#define GLOBALALLOC(nSize) ((PDIBBYTE)GlobalAlloc(GMEM_FIXED,(nSize)))
+#define GLOBALFREE(pPointer) (GlobalFree((HGLOBAL)pPointer))
+#define GLOBALHANDLE(pPointer) ((HGLOBAL)(pPointer))
+
+#endif
+#else
+
+typedef BYTE* PDIBBYTE;
+#define MEMCPY memcpy
+#define MEMSET memset
+#define GLOBALALLOC(nSize) ((PDIBBYTE)new BYTE[(nSize)])
+#define GLOBALFREE(pPointer) (delete[] (pPointer))
+
+#endif
+
+
+#if defined ( OS2 ) || defined ( UNX ) || defined ( MAC )
+void ReadBitmap( SvStream& rIStream, Bitmap& rBmp, USHORT nDefaultHeight = 0, ULONG nOffBits = 0 );
+void ReplaceInfoHeader( SvStream& rStm, BYTE* pBuffer );
+
+#ifdef OS2
+#define RGBQUAD RGBQUADOS2
+#define BITMAPFILEHEADER BITMAPFILEHEADEROS2
+#define PBITMAPFILEHEADER PBITMAPFILEHEADEROS2
+#define BITMAPINFOHEADER BITMAPINFOHEADEROS2
+#define PBITMAPINFOHEADER PBITMAPINFOHEADEROS2
+#define BITMAPINFO BITMAPINFOOS2
+#define PBITMAPINFO PBITMAPINFOOS2
+#endif
+
+#if defined(MAC) && (defined(powerc) || defined (__powerc))
+#pragma options align=mac68k
+#endif
+
+typedef struct RGBQUAD
+{
+ BYTE rgbBlue;
+ BYTE rgbGreen;
+ BYTE rgbRed;
+ BYTE rgbReserved;
+
+ RGBQUAD( const BYTE cRed = 0, const BYTE cGreen = 0, const BYTE cBlue = 0 ) :
+ rgbBlue ( cBlue ),
+ rgbGreen ( cGreen ),
+ rgbRed ( cRed ),
+ rgbReserved ( 0 ) {};
+} RGBQUAD;
+
+typedef struct BITMAPFILEHEADER
+{
+ UINT16 bfType;
+ UINT32 bfSize;
+ UINT16 bfReserved1;
+ UINT16 bfReserved2;
+ UINT32 bfOffBits;
+} BITMAPFILEHEADER;
+typedef BITMAPFILEHEADER* PBITMAPFILEHEADER;
+
+typedef struct BITMAPINFOHEADER
+{
+ UINT32 biSize;
+ UINT32 biWidth;
+ UINT32 biHeight;
+ UINT16 biPlanes;
+ UINT16 biBitCount;
+ UINT32 biCompression;
+ UINT32 biSizeImage;
+ UINT32 biXPelsPerMeter;
+ UINT32 biYPelsPerMeter;
+ UINT32 biClrUsed;
+ UINT32 biClrImportant;
+} BITMAPINFOHEADER;
+typedef BITMAPINFOHEADER* PBITMAPINFOHEADER;
+
+typedef struct BITMAPINFO
+{
+ BITMAPINFOHEADER bmiHeader;
+ RGBQUAD bmiColors[1];
+} BITMAPINFO;
+typedef BITMAPINFO* PBITMAPINFO;
+
+#if defined(MAC) && (defined(powerc) || defined (__powerc))
+#pragma options align=reset
+#endif
+
+#endif
+#endif
diff --git a/svtools/inc/gifread.hxx b/svtools/inc/gifread.hxx
new file mode 100644
index 000000000000..7ec231f890d1
--- /dev/null
+++ b/svtools/inc/gifread.hxx
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * $RCSfile: gifread.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _GIFREAD_HXX
+#define _GIFREAD_HXX
+
+#ifdef VCL
+
+#ifndef _GRAPH_HXX
+#include <vcl/graph.hxx>
+#endif
+#ifndef _BMPACC_HXX
+#include <vcl/bmpacc.hxx>
+#endif
+
+#else // VCL
+
+#ifndef _GEN_HXX
+#include <tools/gen.hxx>
+#endif
+#ifndef _FLTDEFS_HXX
+#include "fltdefs.hxx"
+#endif
+
+#endif // VCL
+
+#ifdef _GIFPRIVATE
+
+// ---------
+// - Enums -
+// ---------
+
+enum GIFAction
+{
+ GLOBAL_HEADER_READING,
+ MARKER_READING,
+ EXTENSION_READING,
+ LOCAL_HEADER_READING,
+ FIRST_BLOCK_READING,
+ NEXT_BLOCK_READING,
+ ABORT_READING,
+ END_READING
+};
+
+// ------------------------------------------------------------------------
+
+enum ReadState
+{
+ GIFREAD_OK,
+ GIFREAD_ERROR,
+ GIFREAD_NEED_MORE
+};
+
+// -------------
+// - GIFReader -
+// -------------
+
+class GIFLZWDecompressor;
+
+#ifdef VCL
+
+class SvStream;
+
+class GIFReader : public GraphicReader
+{
+ Graphic aImGraphic;
+ Animation aAnimation;
+ Bitmap aBmp8;
+ Bitmap aBmp1;
+ BitmapPalette aGPalette;
+ BitmapPalette aLPalette;
+ SvStream& rIStm;
+ void* pCallerData;
+ HPBYTE pSrcBuf;
+ GIFLZWDecompressor* pDecomp;
+ BitmapWriteAccess* pAcc8;
+ BitmapWriteAccess* pAcc1;
+ long nYAcc;
+ long nLastPos;
+ ULONG nLogWidth100;
+ ULONG nLogHeight100;
+ USHORT nTimer;
+ USHORT nGlobalWidth; // maximale Bildbreite aus Header
+ USHORT nGlobalHeight; // maximale Bildhoehe aus Header
+ USHORT nImageWidth; // maximale Bildbreite aus Header
+ USHORT nImageHeight; // maximale Bildhoehe aus Header
+ USHORT nImagePosX;
+ USHORT nImagePosY;
+ USHORT nImageX; // maximale Bildbreite aus Header
+ USHORT nImageY; // maximale Bildhoehe aus Header
+ USHORT nLastImageY;
+ USHORT nLastInterCount;
+ USHORT nLoops;
+ GIFAction eActAction;
+ BOOL bStatus;
+ BOOL bGCTransparent; // Ob das Bild Transparent ist, wenn ja:
+ BOOL bInterlaced;
+ BOOL bOverreadBlock;
+ BOOL bImGraphicReady;
+ BOOL bGlobalPalette;
+ BYTE nBackgroundColor; // Hintergrundfarbe
+ BYTE nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig
+ BYTE nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku)
+ BYTE cTransIndex1;
+ BYTE cNonTransIndex1;
+
+ void ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount );
+ void ClearImageExtensions();
+ BOOL CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal, BOOL bWatchForBackgroundColor );
+ BOOL ReadGlobalHeader();
+ BOOL ReadExtension();
+ BOOL ReadLocalHeader();
+ ULONG ReadNextBlock();
+ void FillImages( HPBYTE pBytes, ULONG nCount );
+ void CreateNewBitmaps();
+ BOOL ProcessGIF();
+
+public:
+
+ ReadState ReadGIF( Graphic& rGraphic );
+ const Graphic& GetIntermediateGraphic();
+
+ GIFReader( SvStream& rStm, void* pCallData );
+ virtual ~GIFReader();
+};
+
+#else // VCL
+
+class GIFReader : public GraphicReader
+{
+ Graphic aImGraphic;
+ Animation aAnimation;
+ SvStream& rIStm;
+ void* pCallerData;
+ ULONG* pGPalette; // Format: 0x00RRGGBB, Groesse des Feldes: immer 256
+ BYTE* pPalEntryFlag;
+ PDIBBYTE pDIB;
+ PDIBBYTE pDIBBytes;
+ PDIBBYTE pMonoDIB;
+ PDIBBYTE pMonoDIBBytes;
+ PDIBBYTE pSrcBuf;
+ PDIBBYTE pRow8;
+ PDIBBYTE pRow1;
+ PDIBBYTE pFile;
+ PDIBBYTE pMonoFile;
+ GIFLZWDecompressor* pDecomp;
+ long nLastPos;
+ long nWidthAl8;
+ long nWidthAl1;
+ long nTotal;
+ long nMonoTotal;
+ USHORT nTimer;
+ USHORT nGlobalWidth; // maximale Bildbreite aus Header
+ USHORT nGlobalHeight; // maximale Bildhoehe aus Header
+ USHORT nImageWidth; // maximale Bildbreite aus Header
+ USHORT nImageHeight; // maximale Bildhoehe aus Header
+ USHORT nImagePosX;
+ USHORT nImagePosY;
+ USHORT nImageX; // maximale Bildbreite aus Header
+ USHORT nImageY; // maximale Bildhoehe aus Header
+ USHORT nLastImageY;
+ USHORT nGPaletteSize; // Anzahl der belegten Eintraege in pPalette
+ USHORT nBlackIndex;
+ USHORT nLastInterCount;
+ USHORT nLoops;
+ GIFAction eActAction;
+ BOOL bStatic; // zeigt an, ob die GIF-Grafik animiert oder statisch ist
+ BOOL bStatus;
+ BOOL bDestTransparent;
+ BOOL bLocalDestTransparent;
+ BOOL bGCTransparent; // Ob das Bild Transparent ist, wenn ja:
+ BOOL bInterlaced;
+ BOOL bOverreadBlock;
+ BOOL bImGraphicReady;
+ BOOL bGlobalPalette;
+ BOOL bGIF89;
+ BYTE nBackgroundColor; // Hintergrundfarbe
+ BYTE nGCTransparentIndex; // Pixel von diesem Index sind durchsichtig
+ BYTE nGCDisposalMethod; // 'Disposal Method' (siehe GIF-Doku)
+
+ USHORT ReadPaletteEntries( ULONG* pPal, USHORT nNumEntries );
+ void ClearImageExtensions();
+ BOOL CreateBitmaps( long nWidth, long nHeight, ULONG* pDIBPal,
+ USHORT nPalCount, BOOL bWatchForBackgroundColor );
+ BOOL ReadGlobalHeader();
+ BOOL ReadExtension();
+ BOOL ReadLocalHeader();
+ USHORT ReadNextBlock();
+ void FillImages( PDIBBYTE pBytes, ULONG nCount );
+ void CreateNewBitmaps();
+ BOOL ProcessGIF();
+
+public:
+
+ ReadState ReadGIF( Graphic& rGraphic );
+ const Graphic& GetIntermediateGraphic();
+
+ GIFReader( SvStream& rStm, void* pCallData );
+ virtual ~GIFReader();
+};
+
+#endif // VCL
+#endif // _GIFPRIVATE
+
+// -------------
+// - ImportGIF -
+// -------------
+
+ BOOL ImportGIF( SvStream& rStream, Graphic& rGraphic, void* pCallerData );
+
+#endif // _GIFREAD_HXX
diff --git a/svtools/inc/gradwrap.hxx b/svtools/inc/gradwrap.hxx
new file mode 100644
index 000000000000..de8918c3afbb
--- /dev/null
+++ b/svtools/inc/gradwrap.hxx
@@ -0,0 +1,111 @@
+/*************************************************************************
+ *
+ * $RCSfile: gradwrap.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _SVGEN_HXX
+#include <svgen.hxx>
+#endif
+
+
+/******************************************************************************
+|*
+|* class GradientWrapper
+|*
+|* Ersterstellung: KA 24.11.95
+|* letzte Aenderung: KA 24.11.95
+|*
+|* Zeck: dient beim MetaFile-Export dazu, die eigentliche Berechungs-
+|* funktionalitaet zu kapseln. Das Schreiben der Records fuer
+|* die unterschiedlichen File-Formate geschieht ueber LinkHandler.
+|*
+|* Klassen, die diesen Wrapper benutzen, muessen drei Linkhandler
+|* zur Verfuegung stellen, die im Ctor uebergeben werden:
+|*
+|* 1. Linkhandler zum Schreiben eines Records fuer Polygonausgabe
+|* 2. Linkhandler zum Schreiben eines Records fuer PolyPolygonausgabe
+|* 3. Linkhandler zum Schreiben eines Records fuer Setzen der Brush
+|*
+\******************************************************************************/
+
+
+class GradientWrapper
+{
+ Link aDrawPolyRecordHdl;
+ Link aDrawPolyPolyRecordHdl;
+ Link aSetFillInBrushRecordHdl;
+
+ GradientWrapper() {};
+
+
+public:
+ GradientWrapper(const Link& rDrawPolyRecordHdl,
+ const Link& rDrawPolyPolyRecordHdl,
+ const Link& rSetFillInBrushHdl);
+ ~GradientWrapper();
+
+
+ void WriteLinearGradient(const Rectangle& rRect,
+ const Gradient& rGradient);
+ void WriteRadialGradient(const Rectangle& rRect,
+ const Gradient& rGradient);
+ void WriteRectGradient(const Rectangle& rRect,
+ const Gradient& rGradient);
+};
diff --git a/svtools/inc/htmlkywd.hxx b/svtools/inc/htmlkywd.hxx
new file mode 100644
index 000000000000..c94a1978d584
--- /dev/null
+++ b/svtools/inc/htmlkywd.hxx
@@ -0,0 +1,716 @@
+/*************************************************************************
+ *
+ * $RCSfile: htmlkywd.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _HTMLKYWD_HXX
+#define _HTMLKYWD_HXX
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+#ifndef SVTOOLS_CONSTASCII_DECL
+#define SVTOOLS_CONSTASCII_DECL( n, s ) n[sizeof(s)]
+#endif
+#ifndef SVTOOLS_CONSTASCII_DEF
+#define SVTOOLS_CONSTASCII_DEF( n, s ) n[sizeof(s)] = s
+#endif
+
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_doctype32,
+ "HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\"" );
+
+
+// diese werden nur eingeschaltet
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_area, "AREA" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_base, "BASE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_comment, "!--" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_doctype, "!DOCTYPE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_embed, "EMBED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_figureoverlay, "OVERLAY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_horzrule, "HR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_horztab, "TAB" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_image, "IMG" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_image2, "IMAGE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_input, "INPUT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_isindex, "ISINDEX" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_linebreak, "BR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_li, "LI" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_link, "LINK" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_meta, "META" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_nextid, "NEXTID" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_nobr, "NOBR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_of, "OF" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_option, "OPTION" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_param, "PARAM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_range, "RANGE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_spacer, "SPACER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_wbr, "WBR" );
+
+// diese werden wieder abgeschaltet
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_abbreviation, "ABBREV" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_above, "ABOVE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_acronym, "ACRONYM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_address, "ADDRESS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_anchor, "A" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_applet, "APPLET" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_array, "ARRAY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_author, "AU" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_banner, "BANNER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_bar, "BAR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_basefont, "BASEFONT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_below, "BELOW" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_bigprint, "BIG" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_blink, "BLINK" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_blockquote, "BLOCKQUOTE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_blockquote30, "BQ" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_body, "BODY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_bold, "B" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_boldtext, "BT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_box, "BOX" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_caption, "CAPTION" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_center, "CENTER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_citiation, "CITE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_code, "CODE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_col, "COL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_colgroup, "COLGROUP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_credit, "CREDIT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_dd, "DD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_deflist, "DL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_deletedtext, "DEL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_dirlist, "DIR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_division, "DIV" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_dot, "DOT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_doubledot, "DDOT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_dt, "DT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_emphasis, "EM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_figure, "FIG" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_font, "FONT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_footnote, "FN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_form, "FORM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_frame, "FRAME" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_frameset, "FRAMESET" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_hat, "HAT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_head1, "H1" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_head2, "H2" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_head3, "H3" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_head4, "H4" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_head5, "H5" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_head6, "H6" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_head, "HEAD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_html, "HTML" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_iframe, "IFRAME" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_ilayer, "ILAYER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_insertedtext, "INS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_italic, "I" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_item, "ITEM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_keyboard, "KBD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_language, "LANG" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_layer, "LAYER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_listheader, "LH" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_map, "MAP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_math, "MATH" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_menulist, "MENU" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_multicol, "MULTICOL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_noembed, "NOEMBED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_noframe, "NOFRAME" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_noframes, "NOFRAMES" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_noscript, "NOSCRIPT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_note, "NOTE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_orderlist, "OL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_parabreak, "P" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_person, "PERSON" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_plaintext, "T" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_preformtxt, "PRE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_root, "ROOT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_row, "ROW" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_sample, "SAMP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_script, "SCRIPT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_select, "SELECT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_shortquote, "Q" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_smallprint, "SMALL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_span, "SPAN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_squareroot, "AQRT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_strikethrough, "S" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_strong, "STRONG" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_style, "STYLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_subscript, "SUB" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_superscript, "SUP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_table, "TABLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_tablerow, "TR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_tabledata, "TD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_tableheader, "TH" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_tbody, "TBODY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_teletype, "TT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_text, "TEXT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_textarea, "TEXTAREA" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_textflow, "TEXTFLOW" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_tfoot, "TFOOT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_thead, "THEAD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_tilde, "TILDE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_title, "TITLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_underline, "U" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_unorderlist, "UL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_variable, "VAR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_vector, "VEC" );
+
+// obsolete features
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_xmp, "XMP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_listing, "LISTING" );
+
+// proposed features
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_definstance, "DFN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_strike, "STRIKE" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_bgsound, "BGSOUND" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_comment2, "COMMENT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_marquee, "MARQUEE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_plaintext2, "PLAINTEXT" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_sdfield, "SDFIELD" );
+
+// die Namen fuer alle Zeichen
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_lt, "lt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_gt, "gt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_amp, "amp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_quot, "quot" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Aacute, "Aacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Agrave, "Agrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Acirc, "Acirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Atilde, "Atilde" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Aring, "Aring" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Auml, "Auml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_AElig, "AElig" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Ccedil, "Ccedil" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Eacute, "Eacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Egrave, "Egrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Ecirc, "Ecirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Euml, "Euml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Iacute, "Iacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Igrave, "Igrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Icirc, "Icirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Iuml, "Iuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_ETH, "ETH" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Ntilde, "Ntilde" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Oacute, "Oacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Ograve, "Ograve" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Ocirc, "Ocirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Otilde, "Otilde" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Ouml, "Ouml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Oslash, "Oslash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Uacute, "Uacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Ugrave, "Ugrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Ucirc, "Ucirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Uuml, "Uuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_Yacute, "Yacute" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_THORN, "THORN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_szlig, "szlig" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_aacute, "aacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_agrave, "agrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_acirc, "acirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_atilde, "atilde" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_aring, "aring" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_auml, "auml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_aelig, "aelig" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ccedil, "ccedil" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_eacute, "eacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_egrave, "egrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ecirc, "ecirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_euml, "euml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_iacute, "iacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_igrave, "igrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_icirc, "icirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_iuml, "iuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_eth, "eth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ntilde, "ntilde" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_oacute, "oacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ograve, "ograve" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ocirc, "ocirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_otilde, "otilde" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ouml, "ouml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_oslash, "oslash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_uacute, "uacute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ugrave, "ugrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ucirc, "ucirc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_uuml, "uuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_yacute, "yacute" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_thorn, "thorn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_yuml, "yuml" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_acute, "acute" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_brvbar, "brvbar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_cedil, "cedil" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_cent, "cent" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_copy, "copy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_curren, "curren" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_deg, "deg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_divide, "divide" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_frac12, "frac12" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_frac14, "frac14" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_frac34, "frac34" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_iexcl, "iexcl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_iquest, "iquest" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_laquo, "laquo" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_macr, "macr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_micro, "micro" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_middot, "middot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_nbsp, "nbsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_not, "not" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ordf, "ordf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_ordm, "ordm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_para, "para" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_plusmn, "plusmn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_pound, "pound" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_raquo, "raquo" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_reg, "reg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_sect, "sect" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_shy, "shy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_sup1, "sup1" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_sup2, "sup2" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_sup3, "sup3" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_times, "times" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_uml, "uml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_yen, "yen" );
+
+// Netscape kennt noch ein paar in Grossbuchstaben ...
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_LT, "LT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_GT, "GT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_AMP, "AMP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_C_QUOT, "QUOT" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_COPY, "COPY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_S_REG, "REG" );
+
+// HTML Attribut-Token (=Optionen)
+
+// Attribute ohne Wert
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_box, "BOX" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_checked, "CHECKED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_compact, "COMPACT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_continue, "CONTINUE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_controls, "CONTROLS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_declare, "DECLARE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_disabled, "DISABLED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_folded, "FOLDED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_ismap, "ISMAP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_mayscript, "MAYSCRIPT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_multiple, "MULTIPLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_noflow, "NOFLOW" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_nohref, "NOHREF" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_noresize, "NORESIZE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_noshade, "NOSHADE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_nowrap, "NOWRAP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_plain, "PLAIN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_sdfixed, "SDFIXED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_selected, "SELECTED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_shapes, "SHAPES" );
+
+// Attribute mit einem String als Wert
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_above, "ABOVE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_accesskey, "ACCESSKEY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_accept, "ACCEPT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_add_date, "ADD_DATE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_alt, "ALT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_axes, "AXES" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_axis, "AXIS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_below, "BELOW" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_char, "CHAR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_class, "CLASS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_clip, "CLIP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_code, "CODE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_codetype, "CODETYPE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_colspec, "COLSPEC" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_content, "CONTENT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_coords, "COORDS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_dp, "DP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_enctype, "ENCTYPE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_error, "ERROR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_face, "FACE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_frameborder, "FRAMEBORDER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_httpequiv, "HTTP-EQUIV" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_language, "LANGUAGE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_last_modified, "LAST_MODIFIED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_last_visit, "LAST_VISIT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_md, "MD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_n, "N" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_name, "NAME" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_notation, "NOTATION" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_prompt, "PROMPT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_shape, "SHAPE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_standby, "STANDBY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_style, "STYLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_title, "TITLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_value, "VALUE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDval, "SDVAL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDnum, "SDNUM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_sdlibrary, "SDLIBRARY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_sdmodule, "SDMODULE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_sdevent, "SDEVENT-" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_sdaddparam, "SDADDPARAM-" );
+
+// Attribute mit einem SGML-Identifier als Wert
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_from, "FROM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_id, "ID" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_target, "TARGET" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_to, "TO" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_until, "UNTIL" );
+
+// Attribute mit einem URI als Wert
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_action, "ACTION" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_background, "BACKGROUND" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_classid, "CLASSID" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_codebase, "CODEBASE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_data, "DATA" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_dynsrc, "DYNSRC" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_dynsync, "DYNSYNC" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_imagemap, "IMAGEMAP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_href, "HREF" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_lowsrc, "LOWSRC" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_script, "SCRIPT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_src, "SRC" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_usemap, "USEMAP" );
+
+// Attribute mit Entity-Namen als Wert
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_dingbat, "DINGBAT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_sym, "SYM" );
+
+// Attribute mit einer Farbe als Wert (alle Netscape)
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_alink, "ALINK" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_bgcolor, "BGCOLOR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_bordercolor, "BORDERCOLOR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_bordercolorlight, "BORDERCOLORLIGHT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_bordercolordark, "BORDERCOLORDARK" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_color, "COLOR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_link, "LINK" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_text, "TEXT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_vlink, "VLINK" );
+
+// Attribute mit einem numerischen Wert
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_border, "BORDER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_cellspacing, "CELLSPACING" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_cellpadding, "CELLPADDING" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_charoff, "CHAROFF" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_colspan, "COLSPAN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_framespacing, "FRAMESPACING" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_gutter, "GUTTER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_indent, "INDENT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_height, "HEIGHT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_hspace, "HSPACE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_left, "LEFT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_leftmargin, "LEFTMARGIN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_loop, "LOOP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_marginheight, "MARGINHEIGHT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_marginwidth, "MARGINWIDTH" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_max, "MAX" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_maxlength, "MAXLENGTH" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_min, "MIN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_pagex, "PAGEX" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_pagey, "PAGEY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_pointsize, "POINT-SIZE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_rowspan, "ROWSPAN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_scrollamount, "SCROLLAMOUNT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_scrolldelay, "SCROLLDELAY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_seqnum, "SEQNUM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_skip, "SKIP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_span, "SPAN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_tabindex, "TABINDEX" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_top, "TOP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_topmargin, "TOPMARGIN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_vspace, "VSPACE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_weight, "WEIGHT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_width, "WIDTH" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_x, "X" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_y, "Y" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_zindex, "Z-INDEX" );
+
+// Attribute mit Enum-Werten
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_behavior, "BEHAVIOR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_bgproperties, "BGPROPERTIES" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_clear, "CLEAR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_dir, "DIR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_direction, "DIRECTION" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_format, "FORMAT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_frame, "FRAME" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_lang, "LANG" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_method, "METHOD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_palette, "PALETTE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_rel, "REL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_rev, "REV" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_rules, "RULES" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_scrolling, "SCROLLING" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_sdreadonly, "READONLY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_subtype, "SUBTYPE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_type, "TYPE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_valign, "VALIGN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_valuetype, "VALUETYPE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_visibility, "VISIBILITY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_wrap, "WRAP" );
+
+// Attribute mit Script-Code als Wert
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onblur, "ONBLUR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onchange, "ONCHANGE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onclick, "ONCLICK" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onfocus, "ONFOCUS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onload, "ONLOAD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onmouseover, "ONMOUSEOVER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onreset, "ONRESET" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onselect, "ONSELECT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onsubmit, "ONSUBMIT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onunload, "ONUNLOAD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onabort, "ONABORT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onerror, "ONERROR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_onmouseout, "ONMOUSEOUT" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonblur, "SDONBLUR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonchange, "SDONCHANGE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonclick, "SDONCLICK" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonfocus, "SDONFOCUS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonload, "SDONLOAD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonmouseover, "SDONMOUSEOVER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonreset, "SDONRESET" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonselect, "SDONSELECT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonsubmit, "SDONSUBMIT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonunload, "SDONUNLOAD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonabort, "SDONABORT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonerror, "SDONERROR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_SDonmouseout, "SDONMOUSEOUT" );
+
+// Attribute mit Kontext-abhaengigen Werten
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_align, "ALIGN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_cols, "COLS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_rows, "ROWS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_start, "START" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_size, "SIZE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_O_units, "UNITS" );
+
+
+// Werte von <INPUT TYPE=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_text, "TEXT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_password, "PASSWORD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_checkbox, "CHECKBOX" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_radio, "RADIO" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_range, "RANGE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_scribble, "SCRIBBLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_file, "FILE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_hidden, "HIDDEN" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_submit, "SUBMIT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_image, "IMAGE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_reset, "RESET" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_IT_button, "BUTTON" );
+
+// Werte von <TABLE FRAME=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_void, "VOID" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_above, "ABOVE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_below, "BELOW" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_hsides, "HSIDES" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_lhs, "LHS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_rhs, "RHS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_vsides, "VSIDES" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_box, "BOX" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TF_border, "BORDER" );
+
+// Werte von <TABLE RULES=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TR_none, "NONE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TR_groups, "GROUPS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TR_rows, "ROWS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TR_cols, "COLS" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_TR_all, "ALL" );
+
+// Werte von <P, H?, TR, TH, TD ALIGN=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_AL_left, "LEFT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_AL_center, "CENTER" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_AL_middle, "MIDDLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_AL_right, "RIGHT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_AL_justify, "JUSTIFY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_AL_char, "CHAR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_AL_all, "ALL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_AL_none, "NONE" );
+
+// Werte von <TR VALIGN=...>, <IMG ALIGN=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_VA_top, "TOP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_VA_middle, "MIDDLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_VA_bottom, "BOTTOM" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_VA_baseline, "BASELINE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_VA_texttop, "TEXTTOP" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_VA_absmiddle, "ABSMIDDLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_VA_absbottom, "ABSBOTTOM" );
+
+// Werte von <AREA SHAPE=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SH_rect, "RECT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SH_rectangle, "RECTANGLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SH_circ, "CIRC" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SH_circle, "CIRCLE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SH_poly, "POLY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SH_polygon, "POLYGON" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SH_default, "DEFAULT" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_LG_starbasic, "STARBASIC" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_LG_javascript, "JAVASCRIPT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_LG_javascript11, "JAVASCRIPT1.1" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_LG_livescript, "LIVESCRIPT" );
+//extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_LG_vbscript, "VBSCRIPT" );
+//extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_LG_unused_javascript, "UNUSED JAVASCRIPT" );
+//extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_LG_starone, "StarScript" );
+
+// ein par Werte fuer unser StarBASIC-Support
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SB_library, "$LIBRARY:" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SB_module, "$MODULE:" );
+
+
+// Werte von <FORM METHOD=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_METHOD_get, "GET" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_METHOD_post, "POST" );
+
+// Werte von <META CONTENT/HTTP-EQUIV=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_refresh, "REFRESH" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_generator, "GENERATOR" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_author, "AUTHOR" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_classification, "CLASSIFICATION" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_description, "DESCRIPTION" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_keywords, "KEYWORDS" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_changed, "CHANGED" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_changedby, "CHANGEDBY" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_created, "CREATED" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_content_type, "CONTENT-TYPE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_content_script_type, "CONTENT-SCRIPT-TYPE" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_sdendnote, "SDENDNOTE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_META_sdfootnote, "SDFOOTNOTE" );
+
+// Werte von <UL TYPE=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_ULTYPE_disc, "DISC" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_ULTYPE_square, "SQUARE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_ULTYPE_circle, "CIRCLE" );
+
+// Werte von <FRAMESET SCROLLING=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SCROLL_yes, "YES" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SCROLL_no, "NO" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SCROLL_auto, "AUTO" );
+
+// Werte von <MULTICOL TYPE=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_MCTYPE_horizontal, "HORIZONTAL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_MCTYPE_vertical, "VERTICAL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_MCTYPE_box, "BOX" );
+
+// Werte von <MARQUEE BEHAVIOUR=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_BEHAV_scroll, "SCROLL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_BEHAV_slide, "SLIDE" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_BEHAV_alternate, "ALTERNATE" );
+
+// Werte von <MARQUEE LOOP=...>
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_LOOP_infinite, "INFINITE" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SPTYPE_block, "BLOCK" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SPTYPE_horizontal, "HORIZONTAL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_SPTYPE_vertical, "VERTICAL" );
+
+
+// interne Grafik-Namen
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_private_image, "private:image/" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_internal_gopher, "internal-gopher-" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_internal_icon, "internal-icon-" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_binary, "binary" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_image, "image" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_index, "index" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_menu, "menu" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_movie, "movie" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_sound, "sound" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_telnet, "telnet" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_text, "text" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_GOPHER_unknown, "unknown" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_ICON_baddata, "baddata" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_ICON_delayed, "delayed" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_ICON_embed, "embed" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_ICON_insecure, "insecure" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_INT_ICON_notfound, "notfound" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_sdendnote, "sdendnote" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_sdendnote_anc, "sdendnoteanc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_sdendnote_sym, "sdendnotesym" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_sdfootnote, "sdfootnote" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_sdfootnote_anc, "sdfootnoteanc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_sdfootnote_sym, "sdfootnotesym" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_FTN_anchor, "anc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_FTN_symbol, "sym" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_WW_off, "OFF" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_WW_hard, "HARD" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_WW_soft, "SOFT" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_WW_virtual, "VIRTUAL" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_WW_physical, "PHYSICAL" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_on, "on" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_ET_url, "application/x-www-form-urlencoded" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_ET_multipart, "multipart/form-data" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sHTML_ET_text, "text/plain" );
+
+
+#endif
diff --git a/svtools/inc/htmltokn.h b/svtools/inc/htmltokn.h
new file mode 100644
index 000000000000..9a46d8761989
--- /dev/null
+++ b/svtools/inc/htmltokn.h
@@ -0,0 +1,749 @@
+/*************************************************************************
+ *
+ * $RCSfile: htmltokn.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _HTMLTOKN_H
+#define _HTMLTOKN_H
+
+#ifndef _SAL_TYPES_H_
+#include <sal/types.h>
+#endif
+#ifndef _SOLAR_h
+#include <tools/solar.h>
+#endif
+
+class String;
+
+// suche das Char zu dem CharNamen
+sal_Unicode GetHTMLCharName( const String& rName );
+
+// suche die TokenID zu dem Token
+int GetHTMLToken( const String& rName );
+
+// suche die TokenId zu einemm Attribut-Token
+int GetHTMLOption( const String& rName );
+
+// suche die 24-bit-Farbe zu einem Farbnamen (nicht gefunden = ULONG_MAX)
+ULONG GetHTMLColor( const String& rName );
+
+// beginnen immer ab 256, groesser als ein char
+const int HTML_TOKEN_START = 0x100;
+const int HTML_TOKEN_ONOFF = 0x200;
+const int HTML_TOKEN_MICROSOFT = 0x1000;
+
+enum HTML_TOKEN_IDS
+{
+ HTML_TEXTTOKEN = HTML_TOKEN_START,
+ HTML_SINGLECHAR,
+ HTML_NEWPARA,
+ HTML_TABCHAR,
+ HTML_RAWDATA,
+ HTML_LINEFEEDCHAR,
+
+ // diese werden nur eingeschaltet
+ HTML_AREA, // Netscape 2.0
+ HTML_BASE, // HTML 3.0
+ HTML_COMMENT,
+ HTML_DOCTYPE,
+ HTML_EMBED, // Netscape 2.0 </EMBED> ignorieren
+ HTML_FIGUREOVERLAY, // HTML 3.0
+ HTML_HORZRULE, // </HR> ignorieren
+ HTML_HORZTAB, // HTML 3.0
+ HTML_IMAGE, // </IMG> ignorieren
+ HTML_INPUT, // </INPUT> ignorieren
+ HTML_ISINDEX, // HTML 3.0
+ HTML_LINEBREAK, // </BR> -> <BR>
+ HTML_LINK, // HTML 3.0
+ HTML_META, // HTML 3.0 </META> ignorieren
+ HTML_NEXTID, // HTML 3.0
+ HTML_OF, // HTML 3.0
+ HTML_OPTION, // </OPTION> ignorieren
+ HTML_PARAM, // HotJava
+ HTML_RANGE, // HTML 3.0
+ HTML_SPACER, // Netscape 3.0b5 // </SPACER> ignorieren
+ HTML_WBR, // Netscape
+
+ // Tokens, die ueber HTML-Charakter erkannt werden
+ HTML_NONBREAKSPACE,
+ HTML_SOFTHYPH,
+
+ // diese werden wieder abgeschaltet,
+ // der off-Wert liegt immer dahinter (+1) !!
+ HTML_ABBREVIATION_ON = HTML_TOKEN_ONOFF, // HTML 3.0
+ HTML_ABBREVIATION_OFF, // HTML 3.0
+ HTML_ABOVE_ON, // HTML 3.0
+ HTML_ABOVE_OFF, // HTML 3.0
+ HTML_ACRONYM_ON, // HTML 3.0
+ HTML_ACRONYM_OFF, // HTML 3.0
+ HTML_ADDRESS_ON,
+ HTML_ADDRESS_OFF,
+ HTML_ANCHOR_ON,
+ HTML_ANCHOR_OFF,
+ HTML_APPLET_ON, // HotJava
+ HTML_APPLET_OFF, // HotJava
+ HTML_ARRAY_ON, // HTML 3.0
+ HTML_ARRAY_OFF, // HTML 3.0
+ HTML_AUTHOR_ON, // HTML 3.0
+ HTML_AUTHOR_OFF, // HTML 3.0
+ HTML_BANNER_ON, // HTML 3.0
+ HTML_BANNER_OFF, // HTML 3.0
+ HTML_BAR_ON, // HTML 3.0
+ HTML_BAR_OFF, // HTML 3.0
+ HTML_BASEFONT_ON, // Netscape
+ HTML_BASEFONT_OFF, // Netscape
+ HTML_BELOW_ON, // HTML 3.0
+ HTML_BELOW_OFF, // HTML 3.0
+ HTML_BIGPRINT_ON, // HTML 3.0
+ HTML_BIGPRINT_OFF, // HTML 3.0
+ HTML_BLINK_ON, // Netscape
+ HTML_BLINK_OFF, // Netscape
+ HTML_BLOCKQUOTE30_ON, // HTML 3.0
+ HTML_BLOCKQUOTE30_OFF, // HTML 3.0
+ HTML_BLOCKQUOTE_ON,
+ HTML_BLOCKQUOTE_OFF,
+ HTML_BODY_ON,
+ HTML_BODY_OFF,
+ HTML_BOLDTEXT_ON, // HTML 3.0
+ HTML_BOLDTEXT_OFF, // HTML 3.0
+ HTML_BOLD_ON,
+ HTML_BOLD_OFF,
+ HTML_BOX_ON, // HTML 3.0
+ HTML_BOX_OFF, // HTML 3.0
+ HTML_CAPTION_ON, // HTML 3.0
+ HTML_CAPTION_OFF, // HTML 3.0
+ HTML_CENTER_ON, // Netscape
+ HTML_CENTER_OFF, // Netscape
+ HTML_CITIATION_ON,
+ HTML_CITIATION_OFF,
+ HTML_CODE_ON,
+ HTML_CODE_OFF,
+ HTML_COL_ON, // HTML3 Table Model Draft
+ HTML_COL_OFF, // HTML3 Table Model Draft
+ HTML_COLGROUP_ON, // HTML3 Table Model Draft
+ HTML_COLGROUP_OFF, // HTML3 Table Model Draft
+ HTML_CREDIT_ON, // HTML 3.0
+ HTML_CREDIT_OFF, // HTML 3.0
+ HTML_DD_ON,
+ HTML_DD_OFF,
+ HTML_DEFLIST_ON,
+ HTML_DEFLIST_OFF,
+ HTML_DELETEDTEXT_ON, // HTML 3.0
+ HTML_DELETEDTEXT_OFF, // HTML 3.0
+ HTML_DIRLIST_ON,
+ HTML_DIRLIST_OFF,
+ HTML_DIVISION_ON, // HTML 3.0
+ HTML_DIVISION_OFF, // HTML 3.0
+ HTML_DOT_ON, // HTML 3.0
+ HTML_DOT_OFF, // HTML 3.0
+ HTML_DOUBLEDOT_ON, // HTML 3.0
+ HTML_DOUBLEDOT_OFF, // HTML 3.0
+ HTML_DT_ON,
+ HTML_DT_OFF,
+ HTML_EMPHASIS_ON,
+ HTML_EMPHASIS_OFF,
+ HTML_FIGURE_ON, // HTML 3.0
+ HTML_FIGURE_OFF, // HTML 3.0
+ HTML_FONT_ON, // Netscape
+ HTML_FONT_OFF, // Netscape
+ HTML_FOOTNOTE_ON, // HTML 3.0
+ HTML_FOOTNOTE_OFF, // HTML 3.0
+ HTML_FORM_ON,
+ HTML_FORM_OFF,
+ HTML_FRAME_ON, // Netscape 2.0
+ HTML_FRAME_OFF, // Netscape 2.0
+ HTML_FRAMESET_ON, // Netscape 2.0
+ HTML_FRAMESET_OFF, // Netscape 2.0
+ HTML_HAT_ON, // HTML 3.0
+ HTML_HAT_OFF, // HTML 3.0
+ HTML_HEAD1_ON,
+ HTML_HEAD1_OFF,
+ HTML_HEAD2_ON,
+ HTML_HEAD2_OFF,
+ HTML_HEAD3_ON,
+ HTML_HEAD3_OFF,
+ HTML_HEAD4_ON,
+ HTML_HEAD4_OFF,
+ HTML_HEAD5_ON,
+ HTML_HEAD5_OFF,
+ HTML_HEAD6_ON,
+ HTML_HEAD6_OFF,
+ HTML_HEAD_ON,
+ HTML_HEAD_OFF,
+ HTML_HTML_ON,
+ HTML_HTML_OFF,
+ HTML_IFRAME_ON, // IE 3.0b2
+ HTML_IFRAME_OFF, // IE 3.0b2
+ HTML_ILAYER_ON,
+ HTML_ILAYER_OFF,
+ HTML_INSERTEDTEXT_ON, // HTML 3.0
+ HTML_INSERTEDTEXT_OFF, // HTML 3.0
+ HTML_ITALIC_ON,
+ HTML_ITALIC_OFF,
+ HTML_ITEM_ON, // HTML 3.0
+ HTML_ITEM_OFF, // HTML 3.0
+ HTML_KEYBOARD_ON,
+ HTML_KEYBOARD_OFF,
+ HTML_LAYER_ON,
+ HTML_LAYER_OFF,
+ HTML_LANGUAGE_ON, // HTML 3.0
+ HTML_LANGUAGE_OFF, // HTML 3.0
+ HTML_LISTHEADER_ON, // HTML 3.0
+ HTML_LISTHEADER_OFF, // HTML 3.0
+ HTML_LI_ON,
+ HTML_LI_OFF,
+ HTML_MAP_ON, // Netscape 2.0
+ HTML_MAP_OFF, // Netscape 2.0
+ HTML_MATH_ON, // HTML 3.0
+ HTML_MATH_OFF, // HTML 3.0
+ HTML_MENULIST_ON,
+ HTML_MENULIST_OFF,
+ HTML_MULTICOL_ON, // Netscape 3.0b5
+ HTML_MULTICOL_OFF, // Netscape 3.0b5
+ HTML_NOBR_ON, // Netscape
+ HTML_NOBR_OFF, // Netscape
+ HTML_NOEMBED_ON, // Netscape 2.0
+ HTML_NOEMBED_OFF, // Netscape 2.0
+ HTML_NOFRAMES_ON, // Netscape 2.0
+ HTML_NOFRAMES_OFF, // Netscape 2.0
+ HTML_NOSCRIPT_ON, // Netscape 2.0
+ HTML_NOSCRIPT_OFF, // Netscape 3.0
+ HTML_NOTE_ON, // HTML 3.0
+ HTML_NOTE_OFF, // HTML 3.0
+ HTML_ORDERLIST_ON,
+ HTML_ORDERLIST_OFF,
+ HTML_PARABREAK_ON,
+ HTML_PARABREAK_OFF,
+ HTML_PERSON_ON, // HTML 3.0
+ HTML_PERSON_OFF, // HTML 3.0
+ HTML_PLAINTEXT_ON, // HTML 3.0
+ HTML_PLAINTEXT_OFF, // HTML 3.0
+ HTML_PREFORMTXT_ON,
+ HTML_PREFORMTXT_OFF,
+ HTML_ROOT_ON, // HTML 3.0
+ HTML_ROOT_OFF, // HTML 3.0
+ HTML_ROW_ON, // HTML 3.0
+ HTML_ROW_OFF, // HTML 3.0
+ HTML_SAMPLE_ON,
+ HTML_SAMPLE_OFF,
+ HTML_SCRIPT_ON, // HTML 3.2
+ HTML_SCRIPT_OFF, // HTML 3.2
+ HTML_SELECT_ON,
+ HTML_SELECT_OFF,
+ HTML_SHORTQUOTE_ON, // HTML 3.0
+ HTML_SHORTQUOTE_OFF, // HTML 3.0
+ HTML_SMALLPRINT_ON, // HTML 3.0
+ HTML_SMALLPRINT_OFF, // HTML 3.0
+ HTML_SPAN_ON, // Style Sheets
+ HTML_SPAN_OFF, // Style Sheets
+ HTML_SQUAREROOT_ON, // HTML 3.0
+ HTML_SQUAREROOT_OFF, // HTML 3.0
+ HTML_STRIKETHROUGH_ON, // HTML 3.0
+ HTML_STRIKETHROUGH_OFF, // HTML 3.0
+ HTML_STRONG_ON,
+ HTML_STRONG_OFF,
+ HTML_STYLE_ON, // HTML 3.0
+ HTML_STYLE_OFF, // HTML 3.0
+ HTML_SUBSCRIPT_ON, // HTML 3.0
+ HTML_SUBSCRIPT_OFF, // HTML 3.0
+ HTML_SUPERSCRIPT_ON, // HTML 3.0
+ HTML_SUPERSCRIPT_OFF, // HTML 3.0
+ HTML_TABLE_ON, // HTML 3.0
+ HTML_TABLE_OFF, // HTML 3.0
+ HTML_TABLEDATA_ON, // HTML 3.0
+ HTML_TABLEDATA_OFF, // HTML 3.0
+ HTML_TABLEHEADER_ON, // HTML 3.0
+ HTML_TABLEHEADER_OFF, // HTML 3.0
+ HTML_TABLEROW_ON, // HTML 3.0
+ HTML_TABLEROW_OFF, // HTML 3.0
+ HTML_TBODY_ON, // HTML3 Table Model Draft
+ HTML_TBODY_OFF, // HTML3 Table Model Draft
+ HTML_TELETYPE_ON,
+ HTML_TELETYPE_OFF,
+ HTML_TEXTAREA_ON,
+ HTML_TEXTAREA_OFF,
+ HTML_TEXTFLOW_ON, // HTML 3.2
+ HTML_TEXTFLOW_OFF, // HTML 3.2
+ HTML_TEXT_ON, // HTML 3.0
+ HTML_TEXT_OFF, // HTML 3.0
+ HTML_TFOOT_ON, // HTML3 Table Model Draft
+ HTML_TFOOT_OFF, // HTML3 Table Model Draft
+ HTML_THEAD_ON, // HTML3 Table Model Draft
+ HTML_THEAD_OFF, // HTML3 Table Model Draft
+ HTML_TILDE_ON, // HTML 3.0
+ HTML_TILDE_OFF, // HTML 3.0
+ HTML_TITLE_ON,
+ HTML_TITLE_OFF,
+ HTML_UNDERLINE_ON,
+ HTML_UNDERLINE_OFF,
+ HTML_UNORDERLIST_ON,
+ HTML_UNORDERLIST_OFF,
+ HTML_VARIABLE_ON,
+ HTML_VARIABLE_OFF,
+ HTML_VECTOR_ON, // HTML 3.0
+ HTML_VECTOR_OFF, // HTML 3.0
+
+ // obsolete features
+ HTML_XMP_ON,
+ HTML_XMP_OFF,
+ HTML_LISTING_ON,
+ HTML_LISTING_OFF,
+
+ // proposed features
+ HTML_DEFINSTANCE_ON,
+ HTML_DEFINSTANCE_OFF,
+ HTML_STRIKE_ON,
+ HTML_STRIKE_OFF,
+
+ HTML_UNKNOWNCONTROL_ON,
+ HTML_UNKNOWNCONTROL_OFF,
+
+ HTML_BGSOUND = HTML_TOKEN_MICROSOFT|HTML_TOKEN_START,
+
+ HTML_COMMENT2_ON = HTML_TOKEN_MICROSOFT|HTML_TOKEN_ONOFF, // HTML 2.0 ?
+ HTML_COMMENT2_OFF, // HTML 2.0 ?
+ HTML_MARQUEE_ON,
+ HTML_MARQUEE_OFF,
+ HTML_PLAINTEXT2_ON, // HTML 2.0 ?
+ HTML_PLAINTEXT2_OFF, // HTML 2.0 ?
+
+ HTML_SDFIELD_ON,
+ HTML_SDFIELD_OFF
+};
+
+// HTML Attribut-Token (=Optionen)
+
+// beginnen immer ab 256, groesser als ein char
+const int HTML_OPTION_START = 0x100;
+
+enum HTML_OPTION_IDS
+{
+HTML_OPTION_BOOL_START = HTML_OPTION_START,
+
+// Attribute ohne Wert
+ HTML_O_BOX = HTML_OPTION_BOOL_START,
+ HTML_O_CHECKED,
+ HTML_O_COMPACT,
+ HTML_O_CONTINUE,
+ HTML_O_CONTROLS, // IExplorer 2.0
+ HTML_O_DECLARE, // IExplorer 3.0b5
+ HTML_O_DISABLED,
+ HTML_O_FOLDED, // Netscape internal
+ HTML_O_ISMAP,
+ HTML_O_MAYSCRIPT, // Netcape 3.0
+ HTML_O_MULTIPLE,
+ HTML_O_NOFLOW,
+ HTML_O_NOHREF, // Netscape
+ HTML_O_NORESIZE, // Netscape 2.0
+ HTML_O_NOSHADE, // Netscape
+ HTML_O_NOWRAP,
+ HTML_O_PLAIN,
+ HTML_O_SDFIXED,
+ HTML_O_SELECTED,
+ HTML_O_SHAPES, // IExplorer 3.0b5
+HTML_OPTION_BOOL_END,
+
+// Attribute mit einem String als Wert
+HTML_OPTION_STRING_START = HTML_OPTION_BOOL_END,
+ HTML_O_ABOVE = HTML_OPTION_STRING_START,
+ HTML_O_ACCEPT,
+ HTML_O_ACCESSKEY,
+ HTML_O_ADD_DATE, // Netscape internal
+ HTML_O_ALT,
+ HTML_O_AXES,
+ HTML_O_AXIS,
+ HTML_O_BELOW,
+ HTML_O_CHAR, // HTML3 Table Model Draft
+ HTML_O_CLASS,
+ HTML_O_CLIP,
+ HTML_O_CODE, // HotJava
+ HTML_O_CODETYPE,
+ HTML_O_COLSPEC,
+ HTML_O_CONTENT,
+ HTML_O_COORDS, // Netscape 2.0
+ HTML_O_DP,
+ HTML_O_ENCTYPE,
+ HTML_O_ERROR,
+ HTML_O_FACE, // IExplorer 2.0
+ HTML_O_FRAMEBORDER, // IExplorer 3.0
+ HTML_O_HTTPEQUIV,
+ HTML_O_LANGUAGE, // JavaScript
+ HTML_O_LAST_MODIFIED, // Netscape internal
+ HTML_O_LAST_VISIT, // Netscape internal
+ HTML_O_MD,
+ HTML_O_N,
+ HTML_O_NAME,
+ HTML_O_NOTATION,
+ HTML_O_PROMPT,
+ HTML_O_SHAPE,
+ HTML_O_STANDBY,
+ HTML_O_STYLE, // Style Sheets
+ HTML_O_TITLE,
+ HTML_O_VALUE,
+ HTML_O_SDVAL, // StarDiv NumberValue
+ HTML_O_SDNUM, // StarDiv NumberFormat
+ HTML_O_SDLIBRARY,
+ HTML_O_SDMODULE,
+HTML_OPTION_STRING_END,
+
+// Attribute mit einem SGML-Identifier als Wert
+HTML_OPTION_SGMLID_START = HTML_OPTION_STRING_END,
+ HTML_O_FROM = HTML_OPTION_SGMLID_START,
+ HTML_O_ID,
+ HTML_O_TARGET, // Netscape 2.0
+ HTML_O_TO,
+ HTML_O_UNTIL,
+HTML_OPTION_SGMLID_END,
+
+// Attribute mit einem URI als Wert
+HTML_OPTION_URI_START = HTML_OPTION_SGMLID_END,
+ HTML_O_ACTION = HTML_OPTION_URI_START,
+ HTML_O_BACKGROUND,
+ HTML_O_CLASSID,
+ HTML_O_CODEBASE, // HotJava
+ HTML_O_DATA,
+ HTML_O_DYNSRC, // IExplorer 3.0
+ HTML_O_DYNSYNC, // IExplorer 2.0
+ HTML_O_IMAGEMAP,
+ HTML_O_HREF,
+ HTML_O_LOWSRC, // Netscape 3.0
+ HTML_O_SCRIPT,
+ HTML_O_SRC,
+ HTML_O_USEMAP, // Netscape 2.0
+HTML_OPTION_URI_END,
+
+// Attribute mit Entity-Namen als Wert
+HTML_OPTION_ENTITY_START = HTML_OPTION_URI_END,
+ HTML_O_DINGBAT = HTML_OPTION_ENTITY_START,
+ HTML_O_SYM,
+HTML_OPTION_ENTITY_END,
+
+// Attribute mit einer Farbe als Wert (alle Netscape)
+HTML_OPTION_COLOR_START = HTML_OPTION_ENTITY_END,
+ HTML_O_ALINK = HTML_OPTION_COLOR_START,
+ HTML_O_BGCOLOR,
+ HTML_O_BORDERCOLOR, // IExplorer 2.0
+ HTML_O_BORDERCOLORLIGHT, // IExplorer 2.0
+ HTML_O_BORDERCOLORDARK, // IExplorer 2.0
+ HTML_O_COLOR,
+ HTML_O_LINK,
+ HTML_O_TEXT,
+ HTML_O_VLINK,
+HTML_OPTION_COLOR_END,
+
+// Attribute mit einem numerischen Wert
+HTML_OPTION_NUMBER_START = HTML_OPTION_COLOR_END,
+ HTML_O_BORDER = HTML_OPTION_NUMBER_START,
+ HTML_O_CELLSPACING, // HTML3 Table Model Draft
+ HTML_O_CELLPADDING, // HTML3 Table Model Draft
+ HTML_O_CHAROFF, // HTML3 Table Model Draft
+ HTML_O_COLSPAN,
+ HTML_O_FRAMESPACING, // IExplorer 3.0
+ HTML_O_GUTTER, // Netscape 3.0b5
+ HTML_O_INDENT,
+ HTML_O_HEIGHT,
+ HTML_O_HSPACE, // Netscape
+ HTML_O_LEFT,
+ HTML_O_LEFTMARGIN, // IExplorer 2.0
+ HTML_O_LOOP, // IExplorer 2.0
+ HTML_O_MARGINWIDTH, // Netscape 2.0
+ HTML_O_MARGINHEIGHT, // Netscape 2.0
+ HTML_O_MAX,
+ HTML_O_MAXLENGTH,
+ HTML_O_MIN,
+ HTML_O_PAGEX,
+ HTML_O_PAGEY,
+ HTML_O_POINTSIZE,
+ HTML_O_ROWSPAN,
+ HTML_O_SCROLLAMOUNT, // IExplorer 2.0
+ HTML_O_SCROLLDELAY, // IExplorer 2.0
+ HTML_O_SEQNUM,
+ HTML_O_SKIP,
+ HTML_O_SPAN, // HTML3 Table Model Draft
+ HTML_O_TABINDEX,
+ HTML_O_TOP,
+ HTML_O_TOPMARGIN, // IExplorer 2.0
+ HTML_O_VSPACE, // Netscape
+ HTML_O_WEIGHT,
+ HTML_O_WIDTH,
+ HTML_O_X,
+ HTML_O_Y,
+ HTML_O_ZINDEX,
+HTML_OPTION_NUMBER_END,
+
+// Attribute mit Enum-Werten
+HTML_OPTION_ENUM_START = HTML_OPTION_NUMBER_END,
+ HTML_O_BEHAVIOR = HTML_OPTION_ENUM_START, // IExplorer 2.0
+ HTML_O_BGPROPERTIES, // IExplorer 2.0
+ HTML_O_CLEAR,
+ HTML_O_DIR,
+ HTML_O_DIRECTION, // IExplorer 2.0
+ HTML_O_FORMAT,
+ HTML_O_FRAME, // HTML3 Table Model Draft
+ HTML_O_LANG,
+ HTML_O_METHOD,
+ HTML_O_PALETTE,
+ HTML_O_REL,
+ HTML_O_REV,
+ HTML_O_RULES, // HTML3 Table Model Draft
+ HTML_O_SCROLLING, // Netscape 2.0
+ HTML_O_SDREADONLY,
+ HTML_O_SUBTYPE,
+ HTML_O_TYPE,
+ HTML_O_VALIGN,
+ HTML_O_VALUETYPE,
+ HTML_O_VISIBILITY,
+ HTML_O_WRAP,
+HTML_OPTION_ENUM_END,
+
+// Attribute mit Script-Code als Wert
+HTML_OPTION_SCRIPT_START = HTML_OPTION_ENUM_END,
+ HTML_O_ONABORT = HTML_OPTION_SCRIPT_START, // JavaScaript
+ HTML_O_ONBLUR, // JavaScript
+ HTML_O_ONCHANGE, // JavaScript
+ HTML_O_ONCLICK, // JavaScript
+ HTML_O_ONERROR, // JavaScript
+ HTML_O_ONFOCUS, // JavaScript
+ HTML_O_ONLOAD, // JavaScript
+ HTML_O_ONMOUSEOUT, // JavaScript
+ HTML_O_ONMOUSEOVER, // JavaScript
+ HTML_O_ONRESET, // JavaScript
+ HTML_O_ONSELECT, // JavaScript
+ HTML_O_ONSUBMIT, // JavaScript
+ HTML_O_ONUNLOAD, // JavaScript
+
+ HTML_O_SDONABORT, // StarBasic
+ HTML_O_SDONBLUR, // StarBasic
+ HTML_O_SDONCHANGE, // StarBasic
+ HTML_O_SDONCLICK, // StarBasic
+ HTML_O_SDONERROR, // StarBasic
+ HTML_O_SDONFOCUS, // StarBasic
+ HTML_O_SDONLOAD, // StarBasic
+ HTML_O_SDONMOUSEOUT, // StarBasic
+ HTML_O_SDONMOUSEOVER, // StarBasic
+ HTML_O_SDONRESET, // StarBasic
+ HTML_O_SDONSELECT, // StarBasic
+ HTML_O_SDONSUBMIT, // StarBasic
+ HTML_O_SDONUNLOAD, // StarBasic
+HTML_OPTION_SCRIPT_END,
+
+// Attribute mit Kontext-abhaengigen Werten
+HTML_OPTION_CONTEXT_START = HTML_OPTION_SCRIPT_END,
+ HTML_O_ALIGN = HTML_OPTION_CONTEXT_START,
+ HTML_O_COLS, // Netscape 2.0 vs HTML 2.0
+ HTML_O_ROWS, // Netscape 2.0 vs HTML 2.0
+ HTML_O_SIZE,
+ HTML_O_START,
+ HTML_O_UNITS,
+HTML_OPTION_CONTEXT_END,
+
+// eine unbekannte Option
+HTML_O_UNKNOWN = HTML_OPTION_CONTEXT_END,
+HTML_OPTION_END
+};
+
+/*************************************************************************
+
+ Source Code Control System - Header
+
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/svtools/inc/htmltokn.h,v 1.1.1.1 2000-09-18 16:58:51 hr Exp $
+
+ Source Code Control System - Update
+
+ $Log: not supported by cvs2svn $
+ Revision 1.44 2000/09/18 14:13:11 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.43 2000/08/31 13:41:09 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.42 2000/03/20 14:19:38 mib
+ unicode
+
+ Revision 1.41 1999/09/24 07:36:05 mib
+ SUPD < 550 => SUPD < 552
+
+ Revision 1.40 1999/09/17 12:37:47 mib
+ support of multiple and non system text encodings
+
+ Revision 1.39 1998/12/17 10:23:12 MIB
+ #60137#: UTF-8-/UCS-2-Unterstuetzung fuer HTML
+
+
+ Rev 1.38 17 Dec 1998 11:23:12 MIB
+ #60137#: UTF-8-/UCS-2-Unterstuetzung fuer HTML
+
+ Rev 1.37 08 Jul 1998 16:05:40 MIB
+ StarScript
+
+ Rev 1.36 26 May 1998 18:05:52 MIB
+ TABINDEX/ACCESSKEY
+
+ Rev 1.35 02 Mar 1998 08:48:20 MIB
+ SDFIXED-Option
+
+ Rev 1.34 03 Jun 1997 15:33:40 MIB
+ NOEMBED
+
+ Rev 1.33 30 May 1997 14:19:30 MIB
+ <NOBR> nun On/Off-Token
+
+ Rev 1.32 21 May 1997 10:41:16 MIB
+ Netscape 4.0-Token
+
+ Rev 1.31 10 Apr 1997 12:34:26 TRI
+ Kommar bei letzten Enumelement entfernt
+
+ Rev 1.30 02 Apr 1997 12:34:30 MIB
+ MAYSCRIPT
+
+ Rev 1.29 10 Feb 1997 18:38:52 ER
+ TableData Options SDVAL= und SDNUM=
+
+ Rev 1.28 05 Feb 1997 12:59:40 MIB
+ Erweiterungen fuer SW-Felder
+
+ Rev 1.27 29 Jan 1997 12:47:00 MIB
+ SDONRESET
+
+ Rev 1.26 23 Jan 1997 09:11:56 MIB
+ nur Kommentare (zu fix #35163#)
+
+ Rev 1.25 22 Jan 1997 09:16:22 MIB
+ onReset-Option
+
+ Rev 1.24 15 Jan 1997 11:38:08 MIB
+ NOSCRIPT-Tag
+
+ Rev 1.23 28 Nov 1996 11:10:32 JP
+ Tokens StarBasicEvents
+
+ Rev 1.22 18 Nov 1996 12:42:42 JP
+ neue Events am Image/Link
+
+ Rev 1.21 06 Nov 1996 10:32:14 MIB
+ BEHAVIOUR -> BEHAVIOR
+
+ Rev 1.20 14 Oct 1996 16:04:30 RG
+ Kein letztes Komma in enums
+
+ Rev 1.19 17 Jul 1996 12:56:36 MIB
+ neue Tags und Optionen
+
+ Rev 1.18 12 Jun 1996 11:37:36 MIB
+ ein par neue Token und Optionen
+
+ Rev 1.17 05 Jun 1996 12:37:40 MIB
+ ein par neue Strings, <TEXTFLOW>
+
+ Rev 1.16 22 May 1996 10:01:28 MIB
+ Unterstuetzung von SCRIPT
+
+ Rev 1.15 10 May 1996 12:50:24 MIB
+ FRAMESPACING und FRAMEBORDER
+
+ Rev 1.14 25 Apr 1996 09:56:10 MIB
+ neue MS-IExplorer 2.0 Schluesselwoerter und Token
+
+ Rev 1.13 18 Apr 1996 13:27:54 MIB
+ eine par neue Schluesselwoerter (BLINK, Netscape internal, erste des Explorer
+
+ Rev 1.12 27 Mar 1996 10:08:40 MIB
+ zweiten Paramter von GetHTMLCharName() entfernt
+
+ Rev 1.11 21 Mar 1996 10:43:30 MIB
+ Netscape 2.0 Elemente, Font-Farben, Verbesserungen bei PRE
+
+ Rev 1.10 06 Mar 1996 12:45:16 MIB
+ End-Tags fuer DD und DT
+
+ Rev 1.9 29 Feb 1996 12:51:24 MIB
+ Unterstuetzung von Farb-Optionen und anderes
+
+ Rev 1.8 05 Feb 1996 13:55:52 MIB
+ neue Token des HTML3 Table Model Drafts vom 23.1.96
+
+ Rev 1.7 29 Jan 1996 18:58:32 MIB
+ TR, TH und TD sind nun ON/OFF-Token
+
+ Rev 1.6 19 Jan 1996 18:39:12 MIB
+ Optionen werden im HTMLParser geparst
+
+ Rev 1.5 17 Jan 1996 18:18:22 MIB
+ HTML 3.0 Element-Tokens
+
+ Rev 1.4 06 Jul 1995 20:55:24 JP
+ neue Tags: HR, ADDRESS, SoftHyp, HardBlank
+
+ Rev 1.3 05 May 1995 19:40:58 JP
+ neue Token fuer Netscape Unterstuetzung
+
+ Rev 1.2 07 Apr 1995 00:31:18 JP
+ neue Funktionalitaet
+
+ Rev 1.1 03 Apr 1995 12:43:12 JP
+ weitere Funktionalietaet implementiert
+
+ Rev 1.0 31 Mar 1995 16:33:32 JP
+ Initial revision.
+
+*************************************************************************/
+
+#endif
+ // _HTMLTOKN_H
diff --git a/svtools/inc/inetdef.hxx b/svtools/inc/inetdef.hxx
new file mode 100644
index 000000000000..cba42a0e5001
--- /dev/null
+++ b/svtools/inc/inetdef.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * $RCSfile: inetdef.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_INETDEF_HXX
+#include <tools/inetdef.hxx>
+#endif
+
diff --git a/svtools/inc/inetmsg.hxx b/svtools/inc/inetmsg.hxx
new file mode 100644
index 000000000000..3cd17c06f090
--- /dev/null
+++ b/svtools/inc/inetmsg.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * $RCSfile: inetmsg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_INETMSG_HXX
+#include <tools/inetmsg.hxx>
+#endif
+
diff --git a/svtools/inc/inetstrm.hxx b/svtools/inc/inetstrm.hxx
new file mode 100644
index 000000000000..92a76aba6e21
--- /dev/null
+++ b/svtools/inc/inetstrm.hxx
@@ -0,0 +1,65 @@
+/*************************************************************************
+ *
+ * $RCSfile: inetstrm.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_INETSTRM_HXX
+#include <tools/inetstrm.hxx>
+#endif
+
diff --git a/svtools/inc/iniadrtk.hxx b/svtools/inc/iniadrtk.hxx
new file mode 100644
index 000000000000..8e4752502c03
--- /dev/null
+++ b/svtools/inc/iniadrtk.hxx
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * $RCSfile: iniadrtk.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_INIADRTK_HXX
+#define SVTOOLS_INIADRTK_HXX
+
+class String;
+
+//============================================================================
+enum AddressToken
+{
+ ADDRESS_COMPANY,
+ ADDRESS_STREET,
+ ADDRESS_COUNTRY,
+ ADDRESS_PLZ,
+ ADDRESS_CITY,
+ ADDRESS_TITLE,
+ ADDRESS_POSITION,
+ ADDRESS_TEL_PRIVATE,
+ ADDRESS_TEL_COMPANY,
+ ADDRESS_FAX,
+ ADDRESS_EMAIL,
+ ADDRESS_STATE,
+ ADDRESS_FATHERSNAME,
+ ADDRESS_APARTMENT
+};
+
+//============================================================================
+class SfxIniManagerAddressEntry
+{
+public:
+ static String get(const String & rAddress, AddressToken eToken);
+};
+
+#endif // SVTOOLS_INIADRTK_HXX
+
diff --git a/svtools/inc/inidef.hxx b/svtools/inc/inidef.hxx
new file mode 100644
index 000000000000..a06bca91c126
--- /dev/null
+++ b/svtools/inc/inidef.hxx
@@ -0,0 +1,177 @@
+/*************************************************************************
+ *
+ * $RCSfile: inidef.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXINIDEF_HXX
+#define _SFXINIDEF_HXX
+
+#ifndef _INIMGR_HXX
+#include <iniman.hxx>
+#endif
+
+class SfxIniEntry;
+class SfxIniDefaulterList;
+class SfxIniDefaultManager;
+
+#if __PRIVATE
+#include "svarray.hxx"
+
+class SfxIniDefaulter;
+SV_DECL_PTRARR( SfxIniDefaulterList, SfxIniDefaulter*, 0, 2 );
+#endif
+
+//========================================================================
+
+class SfxIniDefaulter
+
+/* [Beschreibung]
+
+ Instanzen dieser Klasse k"onnen (f"ur die Laufzeit eines Moduls, z.B.
+ einer DLL-Nutzung oder einer Applikation) angelegt werden, um Defaults
+ f"ur eine Anzahl von ini-Eintr"agen zu liefern. Diese Defaults werden
+ erfragt, wenn ein <SfxIniManager> einen Eintrag nicht in den ini-Files
+ finden kann.
+
+ Defaults verschiedener <SfxIniDefaulter>-Instanzen d"urfen sich nicht
+ unterscheiden, da die Reihenfolge der Abarbeitung nicht definiert ist.
+
+ Die Instanzen brauchen nicht zerst"ort zu werden, au\ser wenn der
+ dazugeh"orige Code entladen wird (load-on-demand DLLs). Sonst geschieht
+ dies automatisch beim Zerst"oren des <SfxIniDefaultManager>.
+*/
+
+{
+ SfxIniDefaultManager* _pManager;
+
+public:
+ SfxIniDefaulter( SfxIniDefaultManager *pManager );
+ ~SfxIniDefaulter();
+
+ virtual BOOL QueryDefault( String &aValue,
+ const SfxIniEntry &rEntry ) = 0;
+};
+
+//========================================================================
+
+class SfxIniDefaultManager
+
+/* [Beschreibung]
+
+ Genau eine Instanz dieser Klasse mu\s in jeder Application-Subklasse,
+ die diesen Mechanismus nutzen m"ochte, in deren Ctor angelegt werden
+ und sollte in deren Dtor zerst"ort werden.
+*/
+
+{
+ SfxIniDefaulterList* _pList;
+
+public:
+ SfxIniDefaultManager();
+ ~SfxIniDefaultManager();
+
+#if __PRIVATE
+ void Insert( SfxIniDefaulter *pDefaulter )
+ { _pList->C40_INSERT( SfxIniDefaulter, pDefaulter, _pList->Count() ); }
+ void Remove( SfxIniDefaulter *pDefaulter )
+ { _pList->Remove( _pList->C40_GETPOS( SfxIniDefaulter, pDefaulter ) ); }
+ BOOL QueryDefault( String &aValue,
+ const SfxIniEntry &rEntry );
+#endif
+};
+
+//========================================================================
+
+class SfxIniEntry
+
+/* [Beschreibung]
+
+ Instanzen dieser Klasse beschreiben einen Eintrag eines Ini-Files,
+ um mit der Klasse <SfxIniDefaulter> erfragt werden zu k"onnen, falls
+ der <SfxIniManager> einen Eintrag nicht in den Ini-Files auffindet.
+*/
+
+{
+friend class SfxIniManager;
+
+ const String& _aGroup;
+ const String& _aKey;
+ SfxIniGroup _eGroup;
+ SfxIniKey _eKey;
+ USHORT _nIndex;
+
+private:
+ SfxIniEntry( const String& aGroup,
+ const String& aKey,
+ SfxIniGroup eGroup,
+ SfxIniKey eKey,
+ USHORT nIndex );
+ SfxIniEntry( const SfxIniEntry & ); // n.i.
+ SfxIniEntry& operator=( const SfxIniEntry & ); // n.i.
+
+public:
+ const String& GetGroupName() const { return _aGroup; }
+ SfxIniGroup GetGroup() const { return _eGroup; }
+ const String& GetKeyName() const { return _aKey; }
+ SfxIniKey GetKey() const { return _eKey; }
+ USHORT GetIndex() const { return _nIndex; }
+};
+
+#endif
+
diff --git a/svtools/inc/iniprop.hxx b/svtools/inc/iniprop.hxx
new file mode 100644
index 000000000000..1b5ed8ccde46
--- /dev/null
+++ b/svtools/inc/iniprop.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * $RCSfile: iniprop.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXINIPROP_HXX
+#define _SFXINIPROP_HXX
+
+#include <limits.h>
+
+#ifndef _RTTI_HXX //autogen
+#include <tools/rtti.hxx>
+#endif
+#ifndef _APP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
+class SfxIniManager;
+
+//------------------------------------------------------------------------
+
+class SfxAppIniManagerProperty: public ApplicationProperty
+
+// fuer Application::Property(), um von ueberall an den AppIniManger zu kommen
+
+{
+ SfxIniManager* _pIniManager;
+
+public:
+ TYPEINFO();
+ SfxAppIniManagerProperty()
+ : _pIniManager(0)
+ {}
+ ~SfxAppIniManagerProperty();
+
+ SfxIniManager* GetIniManager() const { return _pIniManager; }
+ void SetIniManager( SfxIniManager *pIniManager )
+ { _pIniManager = pIniManager; }
+};
+
+
+#endif
+
diff --git a/svtools/inc/instrm.hxx b/svtools/inc/instrm.hxx
new file mode 100644
index 000000000000..ca07dcec0559
--- /dev/null
+++ b/svtools/inc/instrm.hxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * $RCSfile: instrm.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_INSTRM_HXX
+#define SVTOOLS_INSTRM_HXX
+
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+
+namespace com { namespace sun { namespace star { namespace io {
+ class XInputStream;
+ class XSeekable;
+} } } }
+
+class SvDataPipe_Impl;
+
+//============================================================================
+class SvInputStream: public SvStream
+{
+ com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
+ m_xStream;
+ com::sun::star::uno::Reference< com::sun::star::io::XSeekable >
+ m_xSeekable;
+ SvDataPipe_Impl * m_pPipe;
+ ULONG m_nSeekedFrom;
+
+ bool open();
+
+ virtual ULONG GetData(void * pData, ULONG nSize);
+
+ virtual ULONG PutData(void const *, ULONG);
+
+ virtual ULONG SeekPos(ULONG nPos);
+
+ virtual void FlushData();
+
+ virtual void SetSize(ULONG);
+
+public:
+ SvInputStream(
+ com::sun::star::uno::Reference< com::sun::star::io::XInputStream >
+ const &
+ rTheStream);
+
+ virtual ~SvInputStream();
+
+ virtual USHORT IsA() const;
+
+ virtual void AddMark(ULONG nPos);
+
+ virtual void RemoveMark(ULONG nPos);
+};
+
+#endif // SVTOOLS_INSTRM_HXX
+
diff --git a/svtools/inc/itemdel.hxx b/svtools/inc/itemdel.hxx
new file mode 100644
index 000000000000..30da849c60fa
--- /dev/null
+++ b/svtools/inc/itemdel.hxx
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * $RCSfile: itemdel.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SVTOOLS_ITEMDEL_HXX
+#define _SVTOOLS_ITEMDEL_HXX
+
+class SfxPoolItem;
+
+SfxPoolItem* DeleteItemOnIdle( SfxPoolItem* pItem );
+void DeleteOnIdleItems();
+
+
+
+#endif
+
diff --git a/svtools/inc/jpeg.hxx b/svtools/inc/jpeg.hxx
new file mode 100644
index 000000000000..de89fdc3ccb6
--- /dev/null
+++ b/svtools/inc/jpeg.hxx
@@ -0,0 +1,209 @@
+/*************************************************************************
+ *
+ * $RCSfile: jpeg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:51 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _JPEG_HXX
+#define _JPEG_HXX
+
+#ifdef VCL
+
+#ifndef _GRAPH_HXX
+#include <vcl/graph.hxx>
+#endif
+#ifndef _FLTCALL_HXX
+#include "fltcall.hxx"
+#endif
+
+class Config;
+
+#else // VCL
+
+#ifndef _GEN_HXX
+#include <tools/gen.hxx>
+#endif
+#ifndef _FLTCALL_HXX
+#include "fltcall.hxx"
+#endif
+#ifndef _FLTDEFS_HXX
+#include "fltdefs.hxx"
+#endif
+
+#endif // VCL
+
+#ifdef _JPEGPRIVATE
+
+// --------
+// - Enum -
+// --------
+
+enum ReadState
+{
+ JPEGREAD_OK,
+ JPEGREAD_ERROR,
+ JPEGREAD_NEED_MORE
+};
+
+// --------------
+// - JPEGReader -
+// --------------
+
+#ifdef VCL
+
+class JPEGReader : public GraphicReader
+{
+ SvStream& rIStm;
+ Bitmap aBmp;
+ Bitmap aBmp1;
+ BitmapWriteAccess* pAcc;
+ BitmapWriteAccess* pAcc1;
+ void* pBuffer;
+ long nLastPos;
+ long nFormerPos;
+ long nLastLines;
+
+ Graphic CreateIntermediateGraphic( const Bitmap& rBitmap, long nLines );
+ void FillBitmap();
+
+public:
+
+ void* CreateBitmap( const Size& rSize, BOOL bGray, long& rAlignedWidth, long& rTopDown );
+
+public:
+
+
+
+ JPEGReader( SvStream& rStm, void* pCallData );
+ virtual ~JPEGReader();
+
+
+ ReadState Read( Graphic& rGraphic );
+};
+
+// --------------
+// - JPEGWriter -
+// --------------
+
+class JPEGWriter
+{
+ SvStream& rOStm;
+ Bitmap aBmp;
+ BitmapReadAccess* pAcc;
+ BYTE* pBuffer;
+ PFilterCallback pCallback;
+ void* pCallerData;
+ Config* pConfig;
+ BOOL bNative;
+
+public:
+
+ void* GetScanline( long nY );
+
+public:
+
+ JPEGWriter( SvStream& rOStm, PFilterCallback pCallback,
+ void* pCallData, Config* pOptionsConfig );
+ ~JPEGWriter() {};
+
+ BOOL Write( const Graphic& rGraphic );
+};
+
+#else // VCL
+
+class JPEGReader : public GraphicReader
+{
+ Graphic aImGraphic;
+ SvStream& rIStm;
+ PDIBBYTE pMonoDIB;
+ PDIBBYTE pRow1;
+ PDIBBYTE pMonoFile;
+ long nLastPos;
+ long nFormerPos;
+ long nLastLines;
+ long nWidthAl1;
+ long nTotal;
+ long nMonoTotal;
+
+ void CreateMonoDIB( const Size& rSize );
+ void CreateIntermediateGraphic( const Bitmap& rBitmap, long nLines );
+
+
+public:
+
+ JPEGReader( SvStream& rStm, void* pCallData );
+ virtual ~JPEGReader();
+
+
+ ReadState ReadJpeg( Graphic& rGraphic );
+};
+
+#endif // VCL
+#endif // _JPEGPRIVATE
+
+// ---------------------
+// - Import/ExportJPEG -
+// ---------------------
+
+BOOL ImportJPEG( SvStream& rStream, Graphic& rGraphic, void* pCallerData );
+
+BOOL ExportJPEG( SvStream& rStream, const Graphic& rGraphic,
+ PFilterCallback pCallback, void* pCallerData,
+ Config* pOptionsConfig );
+
+#endif // _JPEG_HXX
diff --git a/svtools/inc/memberid.hrc b/svtools/inc/memberid.hrc
new file mode 100644
index 000000000000..7d5fca7b51ab
--- /dev/null
+++ b/svtools/inc/memberid.hrc
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * $RCSfile: memberid.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MEMBERID_HRC
+#define _MEMBERID_HRC
+
+#define SFX_MEMBERID(nUserData) ( ( (nUserData) >> 20 ) & 0xFF )
+#define SFX_SLOTID(nUserData) ( (nUserData) & 0xFFFF )
+
+#define MID_X 1
+#define MID_Y 2
+#define MID_LEFT 3
+#define MID_TOP 4
+#define MID_WIDTH 5
+#define MID_HEIGHT 6
+
+
+#endif
+
diff --git a/svtools/inc/msgrd.hxx b/svtools/inc/msgrd.hxx
new file mode 100644
index 000000000000..51733ecd0816
--- /dev/null
+++ b/svtools/inc/msgrd.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * $RCSfile: msgrd.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MSGRD_HXX
+#define _MSGRD_HXX
+
+
+BOOL ConvertMSGToGDIMetaFile( SvStream & rMSG, GDIMetaFile & rGDIMetaFile,
+ BOOL(*pCallback)(void *, USHORT), void * pCallerData,
+ ULONG nMinPercent, ULONG nMaxPercent);
+
+
+#endif // _MSGRD_HXX
diff --git a/svtools/inc/msgwr.hxx b/svtools/inc/msgwr.hxx
new file mode 100644
index 000000000000..021044946ae0
--- /dev/null
+++ b/svtools/inc/msgwr.hxx
@@ -0,0 +1,72 @@
+/*************************************************************************
+ *
+ * $RCSfile: msgwr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MSGWR_HXX
+#define _MSGWR_HXX
+
+
+BOOL ConvertGraphicToMSG(const Graphic & rGraphic, SvStream & rTargetStream,
+ BOOL(*pCallback)(void *, USHORT), void * pCallerData,
+ ULONG nMinPercent, ULONG nMaxPercent);
+
+
+#endif // _MSGWR_HXX
+
diff --git a/svtools/inc/numuno.hxx b/svtools/inc/numuno.hxx
new file mode 100644
index 000000000000..4600e248280b
--- /dev/null
+++ b/svtools/inc/numuno.hxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: numuno.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _NUMUNO_HXX
+#define _NUMUNO_HXX
+
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATSSUPPLIER_HPP_
+#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+
+class SvNumberFormatter;
+class SvNumFmtSuppl_Impl;
+
+//------------------------------------------------------------------
+
+// SvNumberFormatterServiceObj must be registered as service somewhere
+
+com::sun::star::uno::Reference<com::sun::star::uno::XInterface> SAL_CALL
+ SvNumberFormatterServiceObj_NewInstance(
+ const com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory>& rSMgr );
+
+//------------------------------------------------------------------
+
+// SvNumberFormatsSupplierObj: aggregate to document,
+// construct with SvNumberFormatter
+
+class SvNumberFormatsSupplierObj : public cppu::WeakAggImplHelper2<
+ com::sun::star::util::XNumberFormatsSupplier,
+ com::sun::star::lang::XUnoTunnel>
+{
+private:
+ SvNumFmtSuppl_Impl* pImpl;
+
+public:
+ SvNumberFormatsSupplierObj();
+ SvNumberFormatsSupplierObj(SvNumberFormatter* pForm);
+ virtual ~SvNumberFormatsSupplierObj();
+
+ void SetNumberFormatter(SvNumberFormatter* pNew);
+ SvNumberFormatter* GetNumberFormatter() const;
+
+ // ueberladen, um Attribute im Dokument anzupassen
+ virtual void NumberFormatDeleted(sal_uInt32 nKey);
+ // ueberladen, um evtl. neu zu formatieren
+ virtual void SettingsChanged();
+
+ // XNumberFormatsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
+ getNumberFormatSettings()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL
+ getNumberFormats()
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence<
+ sal_Int8 >& aIdentifier )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
+ static SvNumberFormatsSupplierObj* getImplementation( const com::sun::star::uno::Reference<
+ com::sun::star::util::XNumberFormatsSupplier> xObj );
+};
+
+#endif // #ifndef _NUMUNO_HXX
+
+
diff --git a/svtools/inc/outstrm.hxx b/svtools/inc/outstrm.hxx
new file mode 100644
index 000000000000..85d0e25c5f13
--- /dev/null
+++ b/svtools/inc/outstrm.hxx
@@ -0,0 +1,103 @@
+/*************************************************************************
+ *
+ * $RCSfile: outstrm.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_OUTSTRM_HXX
+#define SVTOOLS_OUTSTRM_HXX
+
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+
+namespace com { namespace sun { namespace star { namespace io {
+ class XOutputStream;
+} } } }
+
+//============================================================================
+class SvOutputStream: public SvStream
+{
+ com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >
+ m_xStream;
+
+ virtual ULONG GetData(void *, ULONG);
+
+ virtual ULONG PutData(void const * pData, ULONG nSize);
+
+ virtual ULONG SeekPos(ULONG);
+
+ virtual void FlushData();
+
+ virtual void SetSize(ULONG);
+
+public:
+ SvOutputStream(com::sun::star::uno::Reference<
+ com::sun::star::io::XOutputStream > const &
+ rTheStream);
+
+ virtual ~SvOutputStream();
+
+ virtual USHORT IsA() const;
+};
+
+#endif // SVTOOLS_OUTSTRM_HXX
+
diff --git a/svtools/inc/poolcach.hxx b/svtools/inc/poolcach.hxx
new file mode 100644
index 000000000000..fb73ee0745c9
--- /dev/null
+++ b/svtools/inc/poolcach.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: poolcach.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXPOOLCACH_HXX
+#define _SFXPOOLCACH_HXX
+
+#include <tools/solar.h>
+
+class SfxItemModifyArr_Impl;
+class SfxItemPool;
+class SfxItemSet;
+class SfxPoolItem;
+class SfxSetItem;
+
+class SfxItemPoolCache
+{
+ SfxItemPool *pPool;
+ SfxItemModifyArr_Impl *pCache;
+ const SfxItemSet *pSetToPut;
+ const SfxPoolItem *pItemToPut;
+
+public:
+ SfxItemPoolCache( SfxItemPool *pPool,
+ const SfxPoolItem *pPutItem );
+ SfxItemPoolCache( SfxItemPool *pPool,
+ const SfxItemSet *pPutSet );
+ ~SfxItemPoolCache();
+
+ const SfxSetItem& ApplyTo( const SfxSetItem& rSetItem, BOOL bNew = FALSE );
+};
+
+
+#endif
+
diff --git a/svtools/inc/prgsbar.hxx b/svtools/inc/prgsbar.hxx
new file mode 100644
index 000000000000..f3de05087c2a
--- /dev/null
+++ b/svtools/inc/prgsbar.hxx
@@ -0,0 +1,134 @@
+/*************************************************************************
+ *
+ * $RCSfile: prgsbar.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _PRGSBAR_HXX
+#define _PRGSBAR_HXX
+
+#ifndef _WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class ProgressBar
+
+Diese Klasse dient zur Anzeige einer Progress-Anzeige.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_BORDER Border um das Fenster
+WB_SVLOOK 3D-Darstellung
+
+--------------------------------------------------------------------------
+
+Methoden
+
+Mit SetValue() setzt man einen Prozent-Wert zwischen 0 und 100. Wenn Werte
+groesser 100 gesetzt werden, faengt das letzte Rechteck an zu blinken.
+
+*************************************************************************/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_STDPROGRESSBAR WB_BORDER
+
+// ---------------
+// - ProgressBar -
+// ---------------
+
+class ProgressBar : public Window
+{
+private:
+ Point maPos;
+ long mnPrgsWidth;
+ long mnPrgsHeight;
+ USHORT mnPercent;
+ USHORT mnPercentCount;
+ BOOL mbCalcNew;
+
+#ifdef _SV_PRGSBAR_CXX
+ void ImplInit();
+ void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ void ImplDrawProgress( USHORT nOldPerc, USHORT nNewPerc );
+#endif
+
+public:
+ ProgressBar( Window* pParent, WinBits nWinBits = WB_STDPROGRESSBAR );
+ ProgressBar( Window* pParent, const ResId& rResId );
+ ~ProgressBar();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetValue( USHORT nNewPercent );
+ USHORT GetValue() const { return mnPercent; }
+};
+
+#endif // _PRGSBAR_HXX
diff --git a/svtools/inc/privsplt.hxx b/svtools/inc/privsplt.hxx
new file mode 100644
index 000000000000..f1f02c37e2a7
--- /dev/null
+++ b/svtools/inc/privsplt.hxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: privsplt.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_PRIVSPLT_HXX
+#define _SV_PRIVSPLT_HXX
+
+#ifndef _SV_FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+
+enum PRIVSPLIT_DIRECTION {PRIVSPLIT_HORZ,PRIVSPLIT_VERT };
+
+class SvPrivatSplit : public FixedLine
+{
+ private:
+
+ Link aCtrModifiedLink;
+ BOOL aMovingFlag;
+ Pointer aWinPointer;
+ PRIVSPLIT_DIRECTION eAdrSplit;
+ short nOldX;
+ short nOldY;
+ short nNewX;
+ short nNewY;
+ short nMinPos;
+ short nMaxPos;
+ Range aXMovingRange;
+ Range aYMovingRange;
+ short nDeltaX;
+ short nDeltaY;
+ void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+
+ protected:
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+
+ public:
+
+ SvPrivatSplit( Window* pWindow, const ResId& rResId,PRIVSPLIT_DIRECTION eAdrSplit);
+
+ SvPrivatSplit( Window* pParent,PRIVSPLIT_DIRECTION eAdrSplit, WinBits nStyle = 0);
+
+ virtual short GetDeltaX();
+ virtual short GetDeltaY();
+
+ virtual void CtrModified();
+
+ void SetXRange(Range cRgeX);
+ void SetYRange(Range cRgeY);
+
+ void MoveSplitTo(Point aPos);
+
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void SetCtrModifiedHdl( const Link& rLink ) { aCtrModifiedLink = rLink; }
+ const Link& GetCtrModifiedHdl() const { return aCtrModifiedLink; }
+};
+
+
+#endif
diff --git a/svtools/inc/propctrl.hxx b/svtools/inc/propctrl.hxx
new file mode 100644
index 000000000000..ed028fe2e965
--- /dev/null
+++ b/svtools/inc/propctrl.hxx
@@ -0,0 +1,154 @@
+/*************************************************************************
+ *
+ * $RCSfile: propctrl.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+/*
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+#include <vcl/sound.hxx>
+#include "sbx.hxx"
+#include "sbxbase.hxx"
+#include "sbxres.hxx"
+
+#ifndef _SFXBRDCST_HXX //autogen
+#include <brdcst.hxx>
+#endif
+ */
+
+
+#ifndef __PROPED_HXX__
+#include <svtools/proped.hxx>
+#endif
+#ifndef _UNO_HXX
+#include <usr/uno.hxx>
+#endif
+#ifndef _USR_SEQU_HXX
+#include <usr/sequ.hxx>
+#endif
+#ifndef __TOOLSIDL_HXX__
+#include <usr/toolsidl.hxx>
+#endif
+
+/*
+class XPropertyEditor
+ : public XInterface
+{
+public:
+
+ virtual void setObject(const UsrAny& aToInspectObj) = 0;
+
+ static Uik getSmartUik() { return(385); }
+};
+*/
+
+class PropertyEditorControler_Impl;
+class SvPropertyBox;
+class Window;
+
+class SimplePropertyEditor_Impl :
+ public XPropertyEditor,
+ public XPropertyEditorNavigation,
+ public UsrObject
+{
+ PropertyEditorControler_Impl* pActiveControler;
+ SvPropertyBox* mpPropBox;
+ UsrAny maStartUnoObj;
+ UsrAny maActiveUnoObj;
+
+ // History der Objekte speichern
+ AnySequence maHistorySeq;
+ WSStringSequence maHistoryNames;
+ UINT32 mnHistoryCount;
+ INT32 mnActualHistoryLevel;
+
+ // Einfache History via Dummy-Properties
+ BOOL bSimpleHistory;
+
+ // Methode zum Anlegen/Aktivieren der Controller
+ void showObject( const UsrAny& aToShowObj );
+ String getPath( void );
+
+public:
+ // Provisorischer Ctor mit Parent-Window
+ SimplePropertyEditor_Impl( Window *pParent );
+ ~SimplePropertyEditor_Impl();
+
+ // HACK fuer History-Test
+ void enableSimpleHistory( BOOL bHistory_ ) { bSimpleHistory = bHistory_; }
+
+ SMART_UNO_DECLARATION(ImplIntrospection,UsrObject);
+
+ // Methoden von XInterface
+ XInterface * queryInterface( Uik aUik );
+ XIdlClassRef getIdlClass();
+
+ // Methoden von XPropertyEditor
+ virtual void setObject(const UsrAny& aToInspectObj, const XubString& aObjName);
+
+ // Methoden von PropertyEditorNavigation
+ virtual void forward(void);
+ virtual void back(void);
+
+};
+
+
+
+
diff --git a/svtools/inc/property.hxx b/svtools/inc/property.hxx
new file mode 100644
index 000000000000..1ed05857b074
--- /dev/null
+++ b/svtools/inc/property.hxx
@@ -0,0 +1,639 @@
+/*************************************************************************
+ *
+ * $RCSfile: property.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SV_PROPERTY_HXX
+#define SV_PROPERTY_HXX
+
+#ifndef _VIRDEV_HXX //autogen
+#include <vcl/virdev.hxx>
+#endif
+#ifndef SV_FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+#ifndef SV_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif
+#ifndef SV_GROUP_HXX
+#include <vcl/group.hxx>
+#endif
+#ifndef SV_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef SV_MOREBTN_HXX
+#include <vcl/morebtn.hxx>
+#endif
+#ifndef _DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+#ifndef _SV_COMBOBOX_HXX //autogen
+#include <vcl/combobox.hxx>
+#endif
+#ifndef _SV_FIELD_HXX //autogen
+#include <vcl/field.hxx>
+#endif
+
+#ifndef _SVARRAY_HXX //autogen
+#include <svarray.hxx>
+#endif
+
+#define _SVSTDARR_USHORTS
+#include <svstdarr.hxx>
+
+#ifndef _SV_VIRDEV_HXX //autogen
+#include <vcl/virdev.hxx>
+#endif
+
+#ifndef _SV_SCRBAR_HXX //autogen
+#include <vcl/scrbar.hxx>
+#endif
+
+#ifndef _SVARRAY_HXX //autogen
+#include <svarray.hxx>
+#endif
+
+#ifndef _SVSTDARR_STRINGS
+#define _SVSTDARR_STRINGS
+#include <svstdarr.hxx>
+#endif
+
+#ifndef _SV_TABPAGE_HXX //autogen
+#include <vcl/tabpage.hxx>
+#endif
+
+#ifndef _SV_TABCTRL_HXX //autogen
+#include <vcl/tabctrl.hxx>
+#endif
+
+//------------------------------------------------------------------------
+
+//========================================================================
+enum eKindOfControl { KOC_UNDEFINED=0,KOC_LISTBOX=1, KOC_COMBOBOX=2,
+ KOC_EDIT=3,KOC_USERDEFINED=5};
+
+class SvXPropertyCtrListener;
+
+class SvXPropertyControl : public Control
+{
+public:
+ SvXPropertyControl( Window* pParent, WinBits nWinStyle = 0 );
+ SvXPropertyControl( Window* pParent, const ResId& rResId );
+
+ virtual void SetSvXPropertyCtrListener(SvXPropertyCtrListener*)=0;
+
+ virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener()=0;
+ virtual void SetProperty(const String &rString)=0;
+ virtual String GetProperty()const=0;
+ virtual BOOL HasList()=0;
+ virtual void ClearList()=0;
+ virtual void InsertEntry( const String& rString,
+ USHORT nPos = LISTBOX_APPEND )=0;
+
+ virtual void SetCtrSize(const Size& rSize)=0;
+ virtual void SetLocked(BOOL bLocked=TRUE)=0;
+
+ virtual void SetMyName(const String &rString)=0;
+ virtual String GetMyName()const=0;
+
+ virtual void SetMyData(void*)=0;
+ virtual void* GetMyData()=0;
+};
+
+class SvXPropertyCtrListener
+{
+
+public:
+ virtual void Modified (SvXPropertyControl *pSvXPCtr)=0;
+ virtual void GetFocus (SvXPropertyControl *pSvXPCtr)=0;
+ virtual void LoseFocus(SvXPropertyControl *pSvXPCtr)=0;
+ virtual void KeyInput (SvXPropertyControl *pSvXPCtr ,const KeyCode&)=0;
+};
+
+
+class SvXPropertyEdit : public SvXPropertyControl
+{
+private:
+
+ String aName;
+ SvXPropertyCtrListener* pListener;
+ Edit aEdit;
+ void* pData;
+
+ DECL_LINK(ModifiedHdl,Edit*);
+ DECL_LINK(GetFocusHdl,Edit*);
+ DECL_LINK(LoseFocusHdl,Edit*);
+
+public:
+ SvXPropertyEdit( Window* pParent, WinBits nWinStyle = 0 );
+ SvXPropertyEdit( Window* pParent, const ResId& rResId );
+
+ virtual void SetSvXPropertyCtrListener(SvXPropertyCtrListener*);
+
+ virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener();
+
+ virtual void SetProperty(const String &rString);
+ virtual String GetProperty()const;
+
+ virtual BOOL HasList();
+ virtual void ClearList();
+ virtual void InsertEntry( const String& rString,
+ USHORT nPos = LISTBOX_APPEND );
+
+ virtual void SetCtrSize(const Size& rSize);
+ virtual void SetLocked(BOOL bLocked=TRUE);
+
+ virtual void SetMyName(const String &rString);
+ virtual String GetMyName()const;
+
+ virtual void SetMyData(void*);
+ virtual void* GetMyData();
+};
+
+
+class SvXPropertyListBox : public SvXPropertyControl
+{
+private:
+
+ String aName;
+ SvXPropertyCtrListener* pListener;
+ ListBox aListBox;
+ void* pData;
+
+ DECL_LINK(ModifiedHdl,ListBox*);
+ DECL_LINK(GetFocusHdl,ListBox*);
+ DECL_LINK(LoseFocusHdl,ListBox*);
+
+
+public:
+ SvXPropertyListBox( Window* pParent, WinBits nWinStyle = 0 );
+ SvXPropertyListBox( Window* pParent, const ResId& rResId );
+
+ virtual void SetSvXPropertyCtrListener(SvXPropertyCtrListener*);
+
+ virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener();
+
+ ListBox* GetListBox();
+
+ virtual void SetProperty(const String &rString);
+ virtual String GetProperty()const;
+
+ virtual BOOL HasList();
+ virtual void ClearList();
+ virtual void InsertEntry( const String& rString,
+ USHORT nPos = LISTBOX_APPEND );
+
+ virtual void SetCtrSize(const Size& rSize);
+ virtual void SetLocked(BOOL bLocked=TRUE);
+
+ virtual void SetMyName(const String &rString);
+ virtual String GetMyName()const;
+
+ virtual void SetMyData(void*);
+ virtual void* GetMyData();
+};
+
+class SvXPropertyComboBox : public SvXPropertyControl
+{
+private:
+
+ String aName;
+ SvXPropertyCtrListener* pListener;
+ ComboBox aComboBox;
+ void* pData;
+
+ DECL_LINK(ModifiedHdl,ComboBox*);
+ DECL_LINK(GetFocusHdl,ComboBox*);
+ DECL_LINK(LoseFocusHdl,ComboBox*);
+
+
+public:
+ SvXPropertyComboBox( Window* pParent, WinBits nWinStyle = 0 );
+ SvXPropertyComboBox( Window* pParent, const ResId& rResId );
+
+ virtual void SetSvXPropertyCtrListener(SvXPropertyCtrListener*);
+
+ virtual SvXPropertyCtrListener* GetSvXPropertyCtrListener();
+
+ ComboBox* GetComboBox();
+
+ virtual void SetProperty(const String &rString);
+ virtual String GetProperty()const;
+
+ virtual BOOL HasList();
+ virtual void ClearList();
+ virtual void InsertEntry( const String& rString,
+ USHORT nPos = LISTBOX_APPEND );
+
+ virtual void SetCtrSize(const Size& rSize);
+ virtual void SetLocked(BOOL bLocked=TRUE);
+
+ virtual void SetMyName(const String &rString);
+ virtual String GetMyName()const;
+
+ virtual void SetMyData(void*);
+ virtual void* GetMyData();
+};
+
+
+
+class SvPropertyLine : public Control
+{
+private:
+ FixedText aName;
+ USHORT nNameWidth;
+ BOOL bNeedsRepaint;
+ SvXPropertyControl* pSvXPropertyControl;
+
+ PushButton aXButton;
+ BOOL bIsLocked;
+ BOOL bHasXButton;
+ BOOL bIsHyperlink;
+ eKindOfControl eKindOfCtr;
+
+protected:
+ virtual void Resize();
+
+public:
+ SvPropertyLine( Window* pParent,
+ WinBits nWinStyle = 0 );
+ SvPropertyLine( Window* pParent,
+ const ResId& rResId );
+
+ BOOL NeedsRepaint();
+ void SetNeedsRepaint(BOOL bFlag);
+ void SetSvXPropertyControl(SvXPropertyControl*);
+ SvXPropertyControl* GetSvXPropertyControl();
+
+ void SetKindOfControl(eKindOfControl);
+ eKindOfControl GetKindOfControl();
+
+ void SetName(const String& rString );
+ String GetName() const;
+ void SetNameWidth(USHORT);
+
+ void ShowXButton();
+ void HideXButton();
+ BOOL IsVisibleXButton();
+ void ShowAsHyperLink(BOOL nFlag=TRUE);
+ BOOL IsShownAsHyperlink();
+
+ void Locked(BOOL nFlag=TRUE);
+ BOOL IsLocked();
+
+ void SetClickHdl(const Link&);
+
+};
+
+
+class SvPropertyData
+{
+public:
+ eKindOfControl eKind;
+ String aName;
+ String aValue;
+ SvStrings theValues; // ???
+
+ BOOL bHasVisibleXButton;
+ BOOL bIsHyperLink;
+ BOOL bIsLocked;
+ void* pDataPtr;
+ SvXPropertyControl* pControl;
+};
+
+class SvPropertyDataObjectControl
+{
+};
+
+class SvPropertyDataControl
+{
+public:
+ virtual void Modified( const String& aName,
+ const String& aVal,
+ void* pData)=0;
+
+ virtual void Clicked( const String& aName,
+ const String& aVal,
+ void* pData)=0;
+
+ virtual void Commit( const String& aName,
+ const String& aVal,
+ void* pData)=0;
+
+ virtual void Select( const String& aName,
+ void* pData)=0;
+
+ virtual void LinkClicked(const String& aName,
+ void* pData)=0;
+};
+
+class SvXPropEvListener: public SvXPropertyCtrListener
+{
+ Link aModifyLink;
+ Link aGetFocusLink;
+ Link aLoseFocusLink;
+ Link aKeyInputLink;
+ String aModifiedResult;
+
+ SvXPropertyControl * pTheActiveControl;
+ KeyCode aKeyCode;
+
+public:
+ SvXPropEvListener();
+
+ virtual void Modified (SvXPropertyControl *pSvXPCtr);
+ virtual void GetFocus (SvXPropertyControl *pSvXPCtr);
+ virtual void LoseFocus(SvXPropertyControl *pSvXPCtr);
+ virtual void KeyInput(SvXPropertyControl *pSvXPCtr ,const KeyCode&);
+
+ SvXPropertyControl * GetPropertyControl();
+ KeyCode GetKeyCode() const;
+
+ void SetModifyHdl( const Link& rLink ) { aModifyLink = rLink; }
+ const Link& GetModifyHdl() const { return aModifyLink; }
+
+ void SetGetFocusHdl( const Link& rLink ) { aGetFocusLink = rLink; }
+ const Link& GetGetFocusHdl() const { return aGetFocusLink; }
+
+ void SetLoseFocusHdl( const Link& rLink ) { aLoseFocusLink = rLink; }
+ const Link& GetLoseFocusHdl() const { return aLoseFocusLink; }
+
+ void SetKeyInputHdl( const Link& rLink ) { aKeyInputLink = rLink; }
+ const Link& GetKeyInputHdl() const { return aKeyInputLink; }
+
+
+};
+
+typedef SvPropertyLine * SvPropertyLinePtr;
+
+SV_DECL_PTRARR(SvPropLineArray,SvPropertyLinePtr,1,1);
+
+class SvListBoxForProperties: public Control
+{
+private:
+
+ SvXPropEvListener aListener;
+ Window aPlayGround;
+ ScrollBar aVScroll;
+ SvPropLineArray PLineArray;
+ SvPropertyDataControl* pPropDataControl;
+ USHORT nRowHeight;
+ BOOL bUpdate;
+ USHORT nTheNameSize;
+ long nYOffset;
+
+ DECL_LINK( ScrollHdl,ScrollBar*);
+ DECL_LINK( ClickHdl ,PushButton*);
+
+ DECL_LINK( ModifyHdl,SvXPropEvListener*);
+ DECL_LINK( GetFocusHdl,SvXPropEvListener*);
+ DECL_LINK(LoseFocusHdl,SvXPropEvListener*);
+ DECL_LINK( KeyInputHdl,SvXPropEvListener*);
+
+protected:
+ void UpdateAll();
+ void UpdatePosNSize();
+ void UpdatePlayGround();
+ void UpdateVScroll();
+
+ void Resize();
+
+public:
+ SvListBoxForProperties( Window* pParent, WinBits nWinStyle = 0 );
+ SvListBoxForProperties( Window* pParent, const ResId& rResId );
+
+ ~SvListBoxForProperties();
+
+ virtual USHORT CalcVisibleLines();
+ virtual void EnableUpdate();
+ virtual void DisableUpdate();
+
+ virtual void SetController(SvPropertyDataControl *);
+
+ virtual void Clear();
+
+ virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND );
+
+ virtual void ChangeEntry( const SvPropertyData&, USHORT nPos);
+
+ virtual USHORT AppendEntry( const SvPropertyData&);
+
+ virtual void SetPropertyValue( const String & rEntryName, const String & rValue );
+
+ virtual void SetFirstVisibleEntry(USHORT nPos);
+ virtual USHORT GetFirstVisibleEntry();
+
+ virtual void SetSelectedEntry(USHORT nPos);
+ virtual USHORT GetSelectedEntry();
+};
+
+class SvTabPageForProperties: public TabPage
+{
+
+private:
+
+ SvListBoxForProperties aLbProp;
+
+protected:
+
+ virtual void Resize();
+
+public:
+ SvTabPageForProperties(Window* pParent,WinBits nWinStyle = 0 );
+
+ SvListBoxForProperties* GetTheListBox();
+};
+
+
+class SvBasicPropertyDataControl: public SvPropertyDataControl
+{
+private:
+
+ BOOL bCorrectness;
+ String aEntryName;
+ String aEntryProperty;
+ String aCorrectProperty;
+ void* pTheData;
+ Link aModifyLink;
+ Link aClickedLink;
+ Link aCommitLink;
+ Link aSelectLink;
+
+public:
+
+ virtual void Modified( const String& aName,
+ const String& aVal,
+ void* pData); //User has modified Property
+
+ virtual void Clicked( const String& aName,
+ const String& aVal,
+ void* pData); //Xtension-Button pressed
+
+ virtual void Commit( const String& aName,
+ const String& aVal,
+ void* pData); //User accept changes
+
+ virtual void Select( const String& aName,
+ void* pData); //User select new Row
+
+ virtual void LinkClicked(const String& aName,
+ void* pData);
+
+ virtual void SetIsCorrect(BOOL nFlag);
+
+ //virtual String GetTheCorrectProperty()const;
+ virtual void SetTheCorrectProperty(const String& aName);
+
+ String GetName() const; //Tell's the name of the Property
+ String GetProperty() const; //Tell's the content of the Property
+ void* GetData(); //Tell's the storage
+
+
+ void SetModifyHdl( const Link& rLink ) { aModifyLink = rLink; }
+ const Link& GetModifyHdl() const { return aModifyLink; }
+
+ void SetClickedHdl( const Link& rLink ) { aClickedLink = rLink; }
+ const Link& GetClickedHdl() const { return aClickedLink; }
+
+ void SetCommitHdl( const Link& rLink ) { aCommitLink = rLink; }
+ const Link& GetCommitHdl() const { return aCommitLink; }
+
+ void SetSelectHdl( const Link& rLink ) { aSelectLink = rLink; }
+ const Link& GetSelectHdl() const { return aSelectLink; }
+
+};
+
+
+class SvPropertyBox: public Control
+{
+private:
+ SvPropertyDataControl* pThePropDataCtr;
+ TabControl aTabControl;
+
+protected:
+ virtual void Resize();
+
+public:
+ SvPropertyBox ( Window* pParent, WinBits nWinStyle = 0 );
+ SvPropertyBox ( Window* pParent, const ResId& rResId );
+
+ ~SvPropertyBox();
+
+ virtual USHORT CalcVisibleLines();
+ virtual void EnableUpdate(); // auch IDL?
+ virtual void DisableUpdate(); // auch IDL?
+
+ // AB: Hier beginnt das 'offizielle' Interface, das in IDL uebernommen werden soll
+ virtual void SetController(SvPropertyDataControl *);
+
+ virtual USHORT AppendPage( const String & r );
+ virtual void SetPage( USHORT );
+ virtual USHORT GetCurPage();
+ virtual void ClearAll();
+ virtual void ClearTable();
+
+ virtual void SetPropertyValue( const String & rEntryName, const String & rValue );
+
+ virtual USHORT InsertEntry( const SvPropertyData&, USHORT nPos = LISTBOX_APPEND );
+ virtual void ChangeEntry( const SvPropertyData&, USHORT nPos);
+ virtual USHORT AppendEntry( const SvPropertyData&);
+
+ virtual void SetFirstVisibleEntry(USHORT nPos);
+ virtual USHORT GetFirstVisibleEntry();
+
+ virtual void SetSelectedEntry(USHORT nPos);
+ virtual USHORT GetSelectedEntry();
+};
+
+
+
+/*
+class ScPropertyDlg : public ModalDialog
+{
+private:
+ SvBasicPropertyDataControl aBaProDatCtr;
+ OKButton anOk;
+ CancelButton aCancel;
+ USHORT nCount;
+ USHORT nClickCount;
+
+ SvPropertyData aProperty;
+ SvPropertyBox aPropListBox;
+
+ ListBox aKindOfListBox;
+ FixedText aModAnswer;
+ FixedText aClickAnswer;
+ FixedText aCommitAnswer;
+ FixedText aSelectAnswer;
+
+ DECL_LINK( ModifiedHdl, ListBox*);
+
+ DECL_LINK( RowModifiedHdl, SvBasicPropertyDataControl*);
+ DECL_LINK( ClickHdl , SvBasicPropertyDataControl*);
+ DECL_LINK( SelectHdl , SvBasicPropertyDataControl*);
+ DECL_LINK( CommitHdl , SvBasicPropertyDataControl*);
+
+public:
+ ScPropertyDlg( Window* pParent);
+ ~ScPropertyDlg();
+};
+*/
+#endif // SC_AUTOFMT_HXX
+
+
diff --git a/svtools/inc/reginfo.hxx b/svtools/inc/reginfo.hxx
new file mode 100644
index 000000000000..342c151ef898
--- /dev/null
+++ b/svtools/inc/reginfo.hxx
@@ -0,0 +1,98 @@
+/*************************************************************************
+ *
+ * $RCSfile: reginfo.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _REGINFO_HXX
+#define _REGINFO_HXX
+
+struct RegInfo_Impl;
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+class RegInfo
+{
+
+ public:
+
+ RegInfo();
+ ~RegInfo();
+
+ const String& GetGroup() const { return aCurrentGroup; }
+ void SetAppGroup( const String& rGroup );
+ void DeleteAppGroup( const String& rGroup );
+
+ String ReadKey( const String& rKey ) const;
+ String ReadKey( const String& rKey, const String& rDefault ) const;
+ void WriteKey( const String& rKey, const String& rValue );
+ void DeleteKey( const String& rKey );
+ String GetKeyName( USHORT nKey ) const;
+ String ReadKey( USHORT nKey ) const;
+ USHORT GetKeyCount() const;
+
+ private:
+
+ String aCurrentGroup;
+ RegInfo_Impl* pImp;
+
+};
+
+
+#endif
diff --git a/svtools/inc/reqitem.hxx b/svtools/inc/reqitem.hxx
new file mode 100644
index 000000000000..46b963fa327c
--- /dev/null
+++ b/svtools/inc/reqitem.hxx
@@ -0,0 +1,104 @@
+/*************************************************************************
+ *
+ * $RCSfile: reqitem.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _REQITEM_HXX
+#define _REQITEM_HXX
+
+#ifndef _SOLAR_H
+#include <solar.h>
+#endif
+
+#ifndef _RTTI_HXX
+#include <rtti.hxx>
+#endif
+
+#if __PRIVATE
+#include "poolitem.hxx"
+#else
+#include <sfxipool.hxx>
+#endif
+
+// -----------------------------------------------------------------------
+
+class SfxRequestItem: public SfxSetItem
+
+/** [Description]
+
+ Represents a function call with optional arguments.
+*/
+
+{
+public:
+ TYPEINFO();
+ SfxRequestItem();
+ SfxRequestItem( USHORT nWhich, SvStream & );
+ SfxRequestItem( const SfxRequestItem& );
+ ~SfxRequestItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual
+ virtual SfxPoolItem* Clone( SfxItemPool *pPool = 0 ) const;
+ virtual SfxPoolItem* Create(SvStream &, USHORT nItemVersion) const;
+ virtual SvStream& Store(SvStream &, USHORT nItemVersion ) const;
+};
+
+
+#endif
+
diff --git a/svtools/inc/ruler.hxx b/svtools/inc/ruler.hxx
new file mode 100644
index 000000000000..bd83f7ec60d9
--- /dev/null
+++ b/svtools/inc/ruler.hxx
@@ -0,0 +1,928 @@
+/*************************************************************************
+ *
+ * $RCSfile: ruler.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _RULER_HXX
+#define _RULER_HXX
+
+#ifndef _LINK_HXX
+#include <tools/link.hxx>
+#endif
+
+#ifndef _WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef _VIRDEV_HXX
+#include <vcl/virdev.hxx>
+#endif
+#ifndef _SV_FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+
+class MouseEvent;
+class TrackingEvent;
+class DataChangedEvent;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class Ruler
+
+Diese Klasse dient zur Anzeige eines Lineals. Dabei kann diese Klasse nicht
+nur als Anzeige-Control verwendet werden, sondern auch als aktives Control
+zum Setzen/Verschieben von Tabulatoren und Raendern.
+
+--------------------------------------------------------------------------
+
+WinBits
+
+WB_HORZ Lineal wird horizontal dargestellt
+WB_VERT Lineal wird vertikal dargestellt
+WB_3DLOOK 3D-Darstellung
+WB_BORDER Border am unteren/rechten Rand
+WB_EXTRAFIELD Feld in der linken/oberen Ecke zur Anzeige und
+ Auswahl von Tabs, Null-Punkt, ...
+
+--------------------------------------------------------------------------
+
+Beim Lineal werden alle Werte als Pixel-Werte eingestellt. Dadurch werden
+doppelte Umrechnungen und Rundungsfehler vermieden und die Raender werden
+im Lineal auch an der Position angezeigt, den Sie auch im Dokument haben.
+Dadurch kann die Applikation zum Beispiel bei Tabellendarstellung auch
+eigene Rundungen vornehmen und die Positionen im Lineal passen trotzdem noch
+zu denen im Dokument. Damit aber das Lineal weiss, wie das Dokument auf dem
+Bildschirm dargestellt wird, muessen noch ein paar zusaetzliche Werte
+eingestellt werden.
+
+Mit SetWinPos() wird der Offset des Edit-Fenster zum Lineal eingestellt.
+Dabei kann auch die Breite des Fensters eingestellt werden. Wenn bei den
+Werten 0 uebergeben wird, wird die Position/Breite vom Fenster automatisch
+so breit gesetzt, wie das Lineal breit ist.
+
+Mit SetPagePos() wird der Offset der Seite zum Edit-Fenster eingestellt und
+die Breite der Seite eingestellt. Wenn bei den Werten 0 uebergeben wird,
+wird die Position/Breite automatisch so gesetzt, als ob die Seite das ganze
+Editfenster ausfuellen wuerde.
+
+Mit SetBorderPos() kann der Offset eingestellt werden, ab dem der
+Border ausgegeben wird. Die Position bezieht sich auf die linke bzw. obere
+Fensterkante. Dies wird gebraucht, wenn ein horizontales und vertikales
+Lineal gleichzeitig sichtbar sind. Beispiel:
+ aHRuler.SetBorderPos( aVRuler.GetSizePixel().Width()-1 );
+
+Mit SetNullOffset() wird der Null-Punkt bezogen auf die Seite gesetzt.
+
+Alle anderen Werte (Raender, Einzug, Tabs, ...) beziehen sich auf den 0 Punkt,
+der mit SetNullOffset() eingestellt wird.
+
+Die Werte werden zum Beispiel folgendermassen berechnet:
+
+- WinPos (wenn beide Fenster den gleichen Parent haben)
+
+ Point aHRulerPos = aHRuler.GetPosPixel();
+ Point aEditWinPos = aEditWin.GetPosPixel();
+ aHRuler.SetWinPos( aEditWinPos().X() - aHRulerPos.X() );
+
+- PagePos
+
+ Point aPagePos = aEditWin.LogicToPixel( aEditWin.GetPagePos() );
+ aHRuler.SetPagePos( aPagePos().X() );
+
+- Alle anderen Werte
+
+ Die logischen Werte zusammenaddieren, als Position umrechnen und
+ die vorher gemerkten Pixel-Positionen (von PagePos und NullOffset)
+ entsprechend abziehen.
+
+--------------------------------------------------------------------------
+
+Mit SetUnit() und SetZoom() wird eingestellt, in welcher Einheit das Lineal
+die Werte anzeigt. Folgende Einheiten werden akzeptiert:
+
+ FUNIT_MM
+ FUNIT_CM (Default)
+ FUNIT_M
+ FUNIT_KM
+ FUNIT_INCH
+ FUNIT_FOOT
+ FUNIT_MILE
+ FUNIT_POINT
+ FUNIT_PICA
+
+--------------------------------------------------------------------------
+
+Mit SetMargin1() kann der linke/obere Rand und mit SetMargin2() kann
+der rechte/untere Rand gesetzt werden. Falls diese Methoden ohne Parameter
+aufgerufen werden, werden keine Raender angezeigt. Wenn SetMargin1() bzw.
+SetMargin2() mit Parametern aufgerufen werden, kann bei diesen
+folgendes angegeben werden:
+
+ long nPos - Offset zum NullPunkt in Pixel
+ USHORT nStyle - Bit-Style:
+ RULER_MARGIN_SIZEABLE
+ Rand kann in der Groesse veraendert werden.
+
+ Zu diesen Style's koennen folgende Style-
+ Bits dazugeodert werden:
+ RULER_STYLE_INVISIBLE (fuer nicht sichtbar)
+
+
+Mit SetBorders() kann ein Array von Raendern gesetzt werden. Dabei muss
+ein Array vom Typ RulerBorder uebergeben werden, wobei folgende Werte
+initialisiert werden muessen:
+
+ long nPos - Offset zum NullPunkt in Pixel
+ long nWidth - Breite des Spaltenabstands in Pixel (kann zum
+ Beispiel fuer Tabellenspalten auch 0 sein)
+ USHORT nStyle - Bit-Style:
+ RULER_BORDER_SIZEABLE
+ Spaltenabstand kann in der Groesse veraendert
+ werden. Dieses Flag sollte nur gesetzt werden,
+ wenn ein Abstand in der Groesse geaendert wird
+ und nicht die Groesse einer Zelle.
+ RULER_BORDER_MOVEABLE
+ Spaltenabstand/Begrenzung kann verschoben
+ werden. Wenn Tabellenbegrenzungen verschoben
+ werden, sollte dieses Flag gesetzt werden und
+ nicht Sizeable. Denn Sizeable gibt an, das
+ ein Abstand vergroessert werden kann und nicht
+ eine einzelne Zelle in der Groesse geaendert
+ werden kann.
+ RULER_BORDER_VARIABLE
+ Nicht alle Spaltenabstande sind gleich
+ RULER_BORDER_TABLE
+ Tabellenrahmen. Wenn dieser Style gesetzt
+ wird, muss die Spaltenbreite 0 sein.
+ RULER_BORDER_SNAP
+ Hilfslinie / Fanglinie. Wenn dieser Style
+ gesetzt wird, muss die Spaltenbreite 0 sein.
+
+ Zu diesen Style's koennen folgende Style-
+ Bits dazugeodert werden:
+ RULER_STYLE_INVISIBLE (fuer nicht sichtbar)
+
+Mit SetIndents() kann ein Array von Indents gesetzt werden. Diese Methode darf
+nur angewendet werden, wenn es sich um ein horizontales Lineal handelt. Als
+Parameter muss ein Array vom Typ RulerIndent uebergeben werden, wobei folgende
+Werte initialisiert werden muessen:
+
+ long nPos - Offset zum NullPunkt in Pixel
+ USHORT nStyle - Bit-Style:
+ RULER_INDENT_TOP (Erstzeileneinzug)
+ RULER_INDENT_BOTTOM (Linker/Rechter Einzug)
+ Zu diesen Style's koennen folgende Style-
+ Bits dazugeodert werden:
+ RULER_STYLE_DONTKNOW (fuer alte Position oder
+ fuer Uneindeutigkeit)
+ RULER_STYLE_INVISIBLE (fuer nicht sichtbar)
+
+Mit SetTabs() kann ein Array von Tabs gesetzt werden. Diese Methode darf nur
+angewendet werden, wenn es sich um ein horizontales Lineal handelt. Als
+Parameter muss ein Array vom Typ RulerTab uebergeben werden, wobei folgende
+Werte initialisiert werden muessen:
+
+ long nPos - Offset zum NullPunkt in Pixel
+ USHORT nStyle - Bit-Style:
+ RULER_TAB_DEFAULT (kann nicht selektiert werden)
+ RULER_TAB_LEFT
+ RULER_TAB_CENTER
+ RULER_TAB_RIGHT
+ RULER_TAB_DECIMAL
+ Zu diesen Style's koennen folgende Style-
+ Bits dazugeodert werden:
+ RULER_STYLE_DONTKNOW (fuer alte Position oder
+ fuer Uneindeutigkeit)
+ RULER_STYLE_INVISIBLE (fuer nicht sichtbar)
+
+Mit SetLines() koennen Positionslinien im Lineal angezeigt werden. Dabei
+muss ein Array vom Typ RulerLine uebergeben werden, wobei folgende Werte
+initialisiert werden muessen:
+
+ long nPos - Offset zum NullPunkt in Pixel
+ USHORT nStyle - Bit-Style (muss zur Zeit immer 0 sein)
+
+Mit SetArrows() koennen Bemassungspfeile im Lineal angezeigt werden. Wenn
+Bemassungspfeile gesetzt werden, werden im Lineal auch keine Unterteilungen
+mehr angezeigt. Deshalb sollten die Bemassungspfeile immer ueber die ganze
+Linealbreite gesetzt werden. Dabei muss ein Array vom Typ RulerArrow
+uebergeben werden, wobei folgende Werte initialisiert werden muessen:
+
+ long nPos - Offset zum NullPunkt in Pixel
+ long nWidth - Breite des Pfeils
+ long nLogWidth - Breite des Pfeils in logischer Einheit
+ USHORT nStyle - Bit-Style (muss zur Zeit immer 0 sein)
+
+Mit SetSourceUnit() wird die Einheit eingestellt, in welcher die logischen
+Werte vorliegen, die bei SetArrows() uebergeben werden. Dabei werden nur die
+Einheiten MAP_TWIP und MAP_100TH_MM (default) akzeptiert.
+
+--------------------------------------------------------------------------
+
+Wenn auch vom Benutzer die Raender, Tabs, Border, ... ueber das Lineal
+geaendert werden koennen, muss etwas mehr Aufwand getrieben werden. Dazu
+muessen die Methoden StartDrag(), Drag() und EndDrag() ueberlagert werden.
+Bei der Methode StartDrag() besteht die Moeglichkeit durch das zurueckgeben
+von FALSE das Draggen zu verhindern. Im Drag-Handler muss die Drag-Position
+abgefragt werden und die Werte muessen an die neue Position verschoben werden.
+Dazu ruft man einfach die einzelnen Set-Methoden auf. Solange man sich
+im Drag-Handler befindet, werden sich die Werte nur gemerkt und erst
+danach das Lineal neu ausgegeben. Alle Handler koennen auch als Links ueber
+entsprechende Set..Hdl()-Methoden gesetzt werden.
+
+ - StartDrag()
+ Wird gerufen, wenn das Draggen gestartet wird. Wenn FALSE
+ zurueckgegeben wird, wird das Draggen nicht ausgefuehrt. Bei TRUE
+ wird das Draggen zugelassen. Wenn der Handler nicht ueberlagert
+ wird, wird FALSE zurueckgegeben.
+
+ - EndDrag()
+ Wird gerufen, wenn das Draggen beendet wird.
+
+ - Drag()
+ Wird gerufen, wenn gedragt wird.
+
+ - Click()
+ Dieser Handler wird gerufen, wenn kein Element angeklickt wurde.
+ Die Position kann mit GetClickPos() abgefragt werden. Dadurch
+ kann man zum Beispiel Tabs in das Lineal setzen. Nach Aufruf des
+ Click-Handlers wird gegebenenfalls das Drag sofort ausgeloest. Dadurch
+ ist es moeglich, einen neuen Tab im Click-Handler zu setzen und
+ danach gleich zu verschieben.
+
+ - DoubleClick()
+ Dieser Handler wird gerufen, wenn ein DoubleClick ausserhalb des
+ Extrafeldes gemacht wurde. Was angeklickt wurde, kann mit
+ GetClickType(), GetClickAryPos() und GetClickPos() abgefragt werden.
+ Somit kann man zum Beispiel den Tab-Dialog anzeigen, wenn ein
+ Tab mit einem DoubleClick betaetigt wurde.
+
+Im Drag-Handler kann man abfragen, was und wohin gedragt wurde. Dazu gibt
+es folgende Abfrage-Methoden.
+
+ - GetDragType()
+ Liefert zurueck, was gedragt wird:
+ RULER_TYPE_MARGIN1
+ RULER_TYPE_MARGIN2
+ RULER_TYPE_BORDER
+ RULER_TYPE_INDENT
+ RULER_TYPE_TAB
+
+ - GetDragPos()
+ Liefert die Pixel-Position bezogen auf den eingestellten Null-Offset
+ zurueck, wohin der Anwender die Maus bewegt hat.
+
+ - GetDragAryPos()
+ Liefert den Index im Array zurueck, wenn ein Border, Indent oder ein
+ Tab gedragt wird. Achtung: Es wird die Array-Position waehrend des
+ gesammten Drag-Vorgangs von dem Item im Array was vor dem Drag gesetzt
+ war zurueckgeben. Dadurch ist es zum Beispiel auch moeglich, einen
+ Tab nicht mehr anzuzeigen, wenn die Maus nach unten/rechts aus dem
+ Lineal gezogen wird.
+
+ - GetDragSize()
+ Wenn Borders gedragt werden, kann hierueber abgefragt werden, ob
+ die Groesse bzw. welche Seite oder die Position geaendert werden soll.
+ RULER_DRAGSIZE_MOVE oder 0 - Move
+ RULER_DRAGSIZE_1 - Linke/obere Kante
+ RULER_DRAGSIZE_2 - Rechte/untere Kante
+
+ - IsDragDelete()
+ Mit dieser Methode kann abgefragt werden, ob beim Draggen die
+ Maus unten/rechts aus dem Fenster gezogen wurde. Damit kann
+ zum Beispiel festgestellt werden, ob der Benutzer einen Tab
+ loeschen will.
+
+ - IsDragCanceled()
+ Mit dieser Methode kann im EndDrag-Handler abgefragt werden,
+ ob die Aktion abgebrochen wurde, indem der Anwender die
+ Maus oben/links vom Fenster losgelassen hat oder ESC gedrueckt
+ hat. In diesem Fall werden die Werte nicht uebernommen. Wird
+ waehrend des Draggings die Maus oben/links aus dem Fenster
+ gezogen, werden automatisch die alten Werte dargestellt, ohne das
+ der Drag-Handler gerufen wird.
+ Falls der Benutzer jedoch den Wert auf die alte Position
+ zurueckgeschoben hat, liefert die Methode trotzdem FALSE. Falls
+ dies vermieden werden soll, muss sich die Applikation im StartDrag-
+ Handler den alten Wert merken und im EndDrag-Handler den Wert
+ vergleichen.
+
+ - GetDragScroll()
+ Mit dieser Methode kann abgefragt werden, ob gescrollt werden
+ soll. Es wird einer der folgenden Werte zurueckgegeben:
+ RULER_SCROLL_NO - Drag-Position befindet sich
+ an keinem Rand und somit
+ muss nicht gescrollt werden.
+ RULER_SCROLL_1 - Drag-Position befindet sich
+ am linken/oberen Rand und
+ somit sollte das Programm evt.
+ ein Srcoll ausloesen.
+ RULER_SCROLL_2 - Drag-Position befindet sich
+ am rechten/unteren Rand und
+ somit sollte das Programm evt.
+ ein Srcoll ausloesen.
+
+ - GetDragModifier()
+ Liefert die Modifier-Tasten zurueck, die beim Starten des Drag-
+ Vorgangs gedrueckt waren. Siehe MouseEvent.
+
+ - GetClickPos()
+ Liefert die Pixel-Position bezogen auf den eingestellten Null-Offset
+ zurueck, wo der Anwender die Maus gedrueckt hat.
+
+ - GetClickType()
+ Liefert zurueck, was per DoubleClick betaetigt wird:
+ RULER_TYPE_DONTKNOW (kein Element im Linealbereich)
+ RULER_TYPE_OUTSIDE (ausserhalb des Linealbereichs)
+ RULER_TYPE_MARGIN1 (nur Margin1-Kante)
+ RULER_TYPE_MARGIN2 (nur Margin2-Kante)
+ RULER_TYPE_BORDER (Border: GetClickAryPos())
+ RULER_TYPE_INDENT (Einzug: GetClickAryPos())
+ RULER_TYPE_TAB (Tab: GetClickAryPos())
+
+ - GetClickAryPos()
+ Liefert den Index im Array zurueck, wenn ein Border, Indent oder ein
+ Tab per DoubleClick betaetigt wird.
+
+ - GetType()
+ Mit dieser Methode kann man einen HitTest durchfuehren, um
+ gegebenenfalls ueber das Abfangen des MouseButtonDown-Handlers
+ auch ueber die rechte Maustaste etwas auf ein Item anzuwenden. Als
+ Paramter ueber gibt man die Fensterposition und gegebenenfalls
+ einen Pointer auf einen USHORT, um die Array-Position eines
+ Tabs, Indent oder Borders mitzubekommen. Als Type werden folgende
+ Werte zurueckgegeben:
+ RULER_TYPE_DONTKNOW (kein Element im Linealbereich)
+ RULER_TYPE_OUTSIDE (ausserhalb des Linealbereichs)
+ RULER_TYPE_MARGIN1 (nur Margin1-Kante)
+ RULER_TYPE_MARGIN2 (nur Margin2-Kante)
+ RULER_TYPE_BORDER (Border: GetClickAryPos())
+ RULER_TYPE_INDENT (Einzug: GetClickAryPos())
+ RULER_TYPE_TAB (Tab: GetClickAryPos())
+
+Wenn der Drag-Vorgang abgebrochen werden soll, kann der Drag-Vorgang
+mit CancelDrag() abgebrochen werden. Folgende Methoden gibt es fuer die
+Drag-Steuerung:
+
+ - IsDrag()
+ Liefert TRUE zurueck, wenn sich das Lineal im Drag-Vorgang befindet.
+
+ - CancelDrag()
+ Bricht den Drag-Vorgang ab, falls einer durchgefuehrt wird. Dabei
+ werden die alten Werte wieder hergestellt und der Drag und der
+ EndDrag-Handler gerufen.
+
+Um vom Dokument ein Drag auszuloesen, gibt es folgende Methoden:
+
+ - StartDocDrag()
+ Dieser Methode werden der MouseEvent vom Dokumentfenster und
+ was gedragt werden soll uebergeben. Wenn als DragType
+ RULER_TYPE_DONTKNOW uebergeben wird, bestimmt das Lineal, was
+ verschoben werden soll. Bei den anderen, wird der Drag nur dann
+ gestartet, wenn auch an der uebergebenen Position ein entsprechendes
+ Element gefunden wurde. Dies ist zun Beispiel dann notwendig, wenn
+ zum Beispiel Einzuege und Spalten an der gleichen X-Position liegen.
+ Der Rueckgabewert gibt an, ob der Drag ausgeloest wurde. Wenn ein
+ Drag ausgeloest wird, uebernimmt das Lineal die normale Drag-Steuerung
+ und verhaelt sich dann so, wie als wenn direkt in das Lineal geklickt
+ wurde. So captured das Lineal die Mouse und uebernimmt auch die
+ Steuerung des Cancel (ueber Tastatur, oder wenn die Mouse ueber
+ oder links vom Lineal ruasgeschoben wird). Auch alle Handler werden
+ gerufen (inkl. des StartDrag-Handlers). Wenn ein MouseEvent mit
+ Click-Count 2 uebergeben wird auch der DoubleClick-Handler
+ entsprechend gerufen.
+
+ - GetDocType()
+ Dieser Methode wird die Position vom Dokumentfenster uebergeben und
+ testet, was sich unter der Position befindet. Dabei kann wie bei
+ StartDocDrag() der entsprechende Test auf ein bestimmtes Element
+ eingeschraenkt werden. Im Gegensatz zu GetType() liefert diese
+ Methode immer DontKnow zurueck, falls kein Element getroffen wurde.
+ Falls man den HitTest selber durchfuehren moechte, kann man
+ folgende Defines fuer die Toleranz benutzen (Werte gelten fuer
+ eine Richtung):
+ RULER_MOUSE_TABLEWIDTH - fuer Tabellenspalten
+ RULER_MOUSE_MARGINWIDTH - fuer Margins
+
+--------------------------------------------------------------------------
+
+Fuer das Extra-Feld kann der Inhalt bestimmt werden und es gibt Handler,
+womit man bestimmte Aktionen abfangen kann.
+
+ - ExtraDown()
+ Dieser Handler wird gerufen, wenn im Extra-Feld die Maus
+ gedrueckt wird.
+
+ - SetExtraType()
+ Mit dieser Methode kann festgelegt werden, was im ExtraFeld
+ dargestellt werden soll.
+ - ExtraType Was im Extrafeld dargestellt werden soll
+ RULER_EXTRA_DONTKNOW (Nichts)
+ RULER_EXTRA_NULLOFFSET (Koordinaaten-Kreuz)
+ RULER_EXTRA_TAB (Tab)
+ - USHORT nStyle Bitfeld als Style:
+ RULER_STYLE_HIGHLIGHT (selektiert)
+ RULER_TAB_... (ein Tab-Style)
+
+ - GetExtraClick()
+ Liefert die Anzahl der Mausclicks zurueck. Dadurch ist es zum
+ Beispiel auch moeglich, auch durch einen DoubleClick im Extrafeld
+ eine Aktion auszuloesen.
+
+ - GetExtraModifier()
+ Liefert die Modifier-Tasten zurueck, die beim Klicken in das Extra-
+ Feld gedrueckt waren. Siehe MouseEvent.
+
+--------------------------------------------------------------------------
+
+Weitere Hilfsfunktionen:
+
+- static Ruler::DrawTab()
+ Mit dieser Methode kann ein Tab auf einem OutputDevice ausgegeben
+ werden. Dadurch ist es moeglich, auch in Dialogen die Tabs so
+ anzuzeigen, wie Sie im Lineal gemalt werden.
+
+ Diese Methode gibt den Tab zentriert an der uebergebenen Position
+ aus. Die Groesse der Tabs kann ueber die Defines RULER_TAB_WIDTH und
+ RULER_TAB_HEIGHT bestimmt werden.
+
+--------------------------------------------------------------------------
+
+Tips zur Benutzung des Lineals:
+
+- Bei dem Lineal muss weder im Drag-Modus noch sonst das Setzen der Werte
+ in SetUpdateMode() geklammert werden. Denn das Lineal sorgt von sich
+ aus dafuer, das wenn mehrere Werte gesetzt werden, diese automatisch
+ zusammengefast werden und flackerfrei ausgegeben werden.
+
+- Initial sollten beim Lineal zuerst die Groessen, Positionen und Werte
+ gesetzt werden, bevor es angezeigt wird. Dies ist deshalb wichtig, da
+ ansonsten viele Werte unnoetig berechnet werden.
+
+- Wenn das Dokumentfenster, in dem sich das Lineal befindet aktiv bzw.
+ deaktiv wird, sollten die Methoden Activate() und Deactivate() vom
+ Lineal gerufen werden. Denn je nach Einstellungen und System wird die
+ Anzeige entsprechend umgeschaltet.
+
+- Zum Beispiel sollte beim Drag von Tabs und Einzuegen nach Moeglichkeit die
+ alten Positionen noch mit angezeigt werden. Dazu sollte zusaetzlich beim
+ Setzen der Tabs und Einzuege als erstes im Array die alten Positionen
+ eingetragen werden und mit dem Style RULER_STYLE_DONTKNOW verknuepft
+ werden. Danach sollte im Array die restlichen Werte eingetragen werden.
+
+- Bei mehreren markierten Absaetzen und Tabellen-Zellen, sollten die Tabs
+ und Einzuege in grau von der ersten Zelle, bzw. vom ersten Absatz
+ angezeigt werden. Dies kann man auch ueber den Style RULER_STYLE_DONTKNOW
+ erreichen.
+
+- Die Bemassungspfeile sollten immer dann angezeigt, wenn beim Drag die
+ Alt-Taste (WW-Like) gedrueckt wird. Vielleicht sollte diese Einstellung
+ auch immer vornehmbar sein und vielleicht beim Drag immer die
+ Bemassungspfeile dargestellt werden. Bei allen Einstellung sollten die
+ Werte immer auf ein vielfaches eines Wertes gerundet werden, da die
+ Bildschirmausloesung sehr ungenau ist.
+
+- DoppelKlicks sollten folgendermassen behandelt werden (GetClickType()):
+ - RULER_TYPE_DONTKNOW
+ RULER_TYPE_MARGIN1
+ RULER_TYPE_MARGIN2
+ Wenn die Bedingunden GetClickPos() <= GetMargin1() oder
+ GetClickPos() >= GetMargin2() oder der Type gleich
+ RULER_TYPE_MARGIN1 oder RULER_TYPE_MARGIN2 ist, sollte
+ ein SeitenDialog angezeigt werden, wo der Focus auf dem
+ entsprechenden Rand steht
+ - RULER_TYPE_BORDER
+ Es sollte ein Spalten- oder Tabellen-Dialog angezeigt werden,
+ wo der Focus auf der entsprechenden Spalte steht, die mit
+ GetClickAryPos() abgefragt werden kann.
+ - RULER_TYPE_INDENT
+ Es sollte der Dialog angezeigt werden, wo die Einzuege eingestellt
+ werden koennen. Dabei sollte der Focus auf dem Einzug stehen, der
+ mit GetClickAryPos() ermittelt werden kann.
+ - RULER_TYPE_TAB
+ Es sollte ein TabDialog angezeigt werden, wo der Tab selektiert
+ sein sollte, der ueber GetClickAryPos() abgefragt werden kann.
+
+*************************************************************************/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_EXTRAFIELD ((WinBits)0x00004000)
+#define WB_STDRULER WB_HORZ
+
+// ---------------
+// - Ruler-Types -
+// ---------------
+
+struct ImplRulerHitTest;
+
+// --------------
+// - Ruler-Type -
+// --------------
+
+enum RulerType { RULER_TYPE_DONTKNOW, RULER_TYPE_OUTSIDE,
+ RULER_TYPE_MARGIN1, RULER_TYPE_MARGIN2,
+ RULER_TYPE_BORDER, RULER_TYPE_INDENT, RULER_TYPE_TAB };
+
+enum RulerExtra { RULER_EXTRA_DONTKNOW,
+ RULER_EXTRA_NULLOFFSET, RULER_EXTRA_TAB };
+
+#define RULER_STYLE_HIGHLIGHT ((USHORT)0x8000)
+#define RULER_STYLE_DONTKNOW ((USHORT)0x4000)
+#define RULER_STYLE_INVISIBLE ((USHORT)0x2000)
+
+#define RULER_DRAGSIZE_MOVE 0
+#define RULER_DRAGSIZE_1 1
+#define RULER_DRAGSIZE_2 2
+
+#define RULER_MOUSE_BORDERMOVE 5
+#define RULER_MOUSE_BORDERWIDTH 5
+#define RULER_MOUSE_TABLEWIDTH 1
+#define RULER_MOUSE_MARGINWIDTH 3
+
+#define RULER_SCROLL_NO 0
+#define RULER_SCROLL_1 1
+#define RULER_SCROLL_2 2
+
+// ---------------
+// - RulerMargin -
+// ---------------
+
+#define RULER_MARGIN_SIZEABLE ((USHORT)0x0001)
+
+// ---------------
+// - RulerBorder -
+// ---------------
+
+#define RULER_BORDER_SIZEABLE ((USHORT)0x0001)
+#define RULER_BORDER_MOVEABLE ((USHORT)0x0002)
+#define RULER_BORDER_VARIABLE ((USHORT)0x0004)
+#define RULER_BORDER_TABLE ((USHORT)0x0008)
+#define RULER_BORDER_SNAP ((USHORT)0x0010)
+
+struct RulerBorder
+{
+ long nPos;
+ long nWidth;
+ USHORT nStyle;
+};
+
+// ---------------
+// - RulerIndent -
+// ---------------
+
+#define RULER_INDENT_TOP ((USHORT)0x0000)
+#define RULER_INDENT_BOTTOM ((USHORT)0x0001)
+#define RULER_INDENT_STYLE ((USHORT)0x000F)
+
+struct RulerIndent
+{
+ long nPos;
+ USHORT nStyle;
+};
+
+// ------------
+// - RulerTab -
+// ------------
+
+#define RULER_TAB_LEFT ((USHORT)0x0000)
+#define RULER_TAB_RIGHT ((USHORT)0x0001)
+#define RULER_TAB_DECIMAL ((USHORT)0x0002)
+#define RULER_TAB_CENTER ((USHORT)0x0003)
+#define RULER_TAB_DEFAULT ((USHORT)0x0004)
+#define RULER_TAB_STYLE ((USHORT)0x000F)
+
+struct RulerTab
+{
+ long nPos;
+ USHORT nStyle;
+};
+
+#define RULER_TAB_WIDTH 7
+#define RULER_TAB_HEIGHT 6
+
+// -------------
+// - RulerLine -
+// -------------
+
+struct RulerLine
+{
+ long nPos;
+ USHORT nStyle;
+};
+
+// --------------
+// - RulerArrow -
+// --------------
+
+struct RulerArrow
+{
+ long nPos;
+ long nWidth;
+ long nLogWidth;
+ USHORT nStyle;
+};
+
+// -----------------
+// - ImplRulerData -
+// -----------------
+
+class ImplRulerData
+{
+ friend class Ruler;
+
+private:
+ RulerLine* pLines;
+ RulerArrow* pArrows;
+ RulerBorder* pBorders;
+ RulerIndent* pIndents;
+ RulerTab* pTabs;
+ long nNullVirOff;
+ long nRulVirOff;
+ long nRulWidth;
+ long nPageOff;
+ long nPageWidth;
+ long nNullOff;
+ long nMargin1;
+ long nMargin2;
+ USHORT nLines;
+ USHORT nArrows;
+ USHORT nBorders;
+ USHORT nIndents;
+ USHORT nTabs;
+ USHORT nMargin1Style;
+ USHORT nMargin2Style;
+ BOOL bAutoPageWidth;
+ BOOL bDummyAlign;
+
+#ifdef _SV_RULER_CXX
+public:
+ ImplRulerData();
+ ~ImplRulerData();
+ ImplRulerData& operator=( const ImplRulerData& rData );
+#endif
+};
+
+// ---------
+// - Ruler -
+// ---------
+
+class Ruler : public Window
+{
+private:
+ VirtualDevice maVirDev;
+ MapMode maMapMode;
+ long mnBorderOff;
+ long mnWinOff;
+ long mnWinWidth;
+ long mnWidth;
+ long mnHeight;
+ long mnVirOff;
+ long mnVirWidth;
+ long mnVirHeight;
+ long mnBorderWidth;
+ long mnStartDragPos;
+ long mnDragPos;
+ ULONG mnUpdateEvtId;
+ ImplRulerData* mpData;
+ ImplRulerData maData;
+ ImplRulerData maDragData;
+ Rectangle maExtraRect;
+ WinBits mnWinStyle;
+ USHORT mnUnitIndex;
+ USHORT mnDragAryPos;
+ USHORT mnDragSize;
+ USHORT mnDragScroll;
+ USHORT mnDragModifier;
+ USHORT mnExtraStyle;
+ USHORT mnExtraClicks;
+ USHORT mnExtraModifier;
+ RulerExtra meExtraType;
+ RulerType meDragType;
+ MapUnit meSourceUnit;
+ FieldUnit meUnit;
+ Fraction maZoom;
+ BOOL mbCalc;
+ BOOL mbFormat;
+ BOOL mbDrag;
+ BOOL mbDragDelete;
+ BOOL mbDragCanceled;
+ BOOL mbAutoWinWidth;
+ BOOL mbActive;
+ BYTE mnUpdateFlags;
+ Link maStartDragHdl;
+ Link maDragHdl;
+ Link maEndDragHdl;
+ Link maClickHdl;
+ Link maDoubleClickHdl;
+ Link maExtraDownHdl;
+
+#ifdef _SV_RULER_CXX
+ void ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 );
+ void ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 );
+ void ImplVDrawText( long nX, long nY, const String& rText );
+
+ void ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter );
+ void ImplDrawArrows( long nCenter );
+ void ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom );
+ void ImplDrawIndent( const Polygon& rPoly, USHORT nStyle );
+ void ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom );
+ void ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle );
+ void ImplDrawTabs( long nMin, long nMax, long nVirBottom );
+ void ImplInit( WinBits nWinBits );
+ void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
+ void ImplCalc();
+ void ImplFormat();
+ void ImplInitExtraField( BOOL bUpdate );
+ void ImplInvertLines( BOOL bErase = FALSE );
+ void ImplDraw();
+ void ImplDrawExtra( BOOL bPaint = FALSE );
+ void ImplUpdate( BOOL bMustCalc = FALSE );
+ BOOL ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest ) const;
+ BOOL ImplDocHitTest( const Point& rPos, RulerType eDragType, ImplRulerHitTest* pHitTest ) const;
+ BOOL ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier );
+ void ImplDrag( const Point& rPos );
+ void ImplEndDrag();
+ DECL_LINK( ImplUpdateHdl, void* );
+#endif
+
+public:
+ Ruler( Window* pParent, WinBits nWinStyle = WB_STDRULER );
+ virtual ~Ruler();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual long StartDrag();
+ virtual void Drag();
+ virtual void EndDrag();
+ virtual void Click();
+ virtual void DoubleClick();
+ virtual void ExtraDown();
+
+ void Activate();
+ void Deactivate();
+ BOOL IsActive() const { return mbActive; }
+
+ void SetWinPos( long nOff = 0, long nWidth = 0 );
+ long GetWinOffset() const { return mnWinOff; }
+ long GetWinWidth() const { return mnWinWidth; }
+ void SetPagePos( long nOff = 0, long nWidth = 0 );
+ long GetPageOffset() const { return mpData->nPageOff; }
+ long GetPageWidth() const { return mpData->nPageWidth; }
+ void SetBorderPos( long nOff = 0 );
+ long GetBorderOffset() const { return mnBorderOff; }
+ Rectangle GetExtraRect() const { return maExtraRect; }
+
+ void SetUnit( FieldUnit eNewUnit );
+ FieldUnit GetUnit() const { return meUnit; }
+ void SetZoom( const Fraction& rNewZoom );
+ Fraction GetZoom() const { return maZoom; }
+
+ void SetSourceUnit( MapUnit eNewUnit ) { meSourceUnit = eNewUnit; }
+ MapUnit GetSourceUnit() const { return meSourceUnit; }
+
+ void SetExtraType( RulerExtra eNewExtraType, USHORT nStyle = 0 );
+ RulerExtra GetExtraType() const { return meExtraType; }
+ USHORT GetExtraStyle() const { return mnExtraStyle; }
+ USHORT GetExtraClicks() const { return mnExtraClicks; }
+ USHORT GetExtraModifier() const { return mnExtraModifier; }
+
+ BOOL StartDocDrag( const MouseEvent& rMEvt,
+ RulerType eDragType = RULER_TYPE_DONTKNOW );
+ RulerType GetDocType( const Point& rPos,
+ RulerType eDragType = RULER_TYPE_DONTKNOW,
+ USHORT* pAryPos = NULL ) const;
+ RulerType GetDragType() const { return meDragType; }
+ long GetDragPos() const { return mnDragPos; }
+ USHORT GetDragAryPos() const { return mnDragAryPos; }
+ USHORT GetDragSize() const { return mnDragSize; }
+ BOOL IsDragDelete() const { return mbDragDelete; }
+ BOOL IsDragCanceled() const { return mbDragCanceled; }
+ USHORT GetDragScroll() const { return mnDragScroll; }
+ USHORT GetDragModifier() const { return mnDragModifier; }
+ BOOL IsDrag() const { return mbDrag; }
+ void CancelDrag();
+ long GetClickPos() const { return mnDragPos; }
+ RulerType GetClickType() const { return meDragType; }
+ USHORT GetClickAryPos() const { return mnDragAryPos; }
+ RulerType GetType( const Point& rPos,
+ USHORT* pAryPos = NULL ) const;
+
+ void SetNullOffset( long nPos );
+ long GetNullOffset() const { return mpData->nNullOff; }
+ void SetMargin1() { SetMargin1( 0, RULER_STYLE_INVISIBLE ); }
+ void SetMargin1( long nPos, USHORT nMarginStyle = RULER_MARGIN_SIZEABLE );
+ long GetMargin1() const { return mpData->nMargin1; }
+ USHORT GetMargin1Style() const { return mpData->nMargin1Style; }
+ void SetMargin2() { SetMargin2( 0, RULER_STYLE_INVISIBLE ); }
+ void SetMargin2( long nPos, USHORT nMarginStyle = RULER_MARGIN_SIZEABLE );
+ long GetMargin2() const { return mpData->nMargin2; }
+ USHORT GetMargin2Style() const { return mpData->nMargin2Style; }
+
+ void SetLines( USHORT n = 0, const RulerLine* pLineAry = NULL );
+ USHORT GetLineCount() const { return mpData->nLines; }
+ const RulerLine* GetLines() const { return mpData->pLines; }
+
+ void SetArrows( USHORT n = 0, const RulerArrow* pArrowAry = NULL );
+ USHORT GetArrowCount() const { return mpData->nArrows; }
+ const RulerArrow* GetArrows() const { return mpData->pArrows; }
+
+ void SetBorders( USHORT n = 0, const RulerBorder* pBrdAry = NULL );
+ USHORT GetBorderCount() const { return mpData->nBorders; }
+ const RulerBorder* GetBorders() const { return mpData->pBorders; }
+
+ void SetIndents( USHORT n = 0, const RulerIndent* pIndentAry = NULL );
+ USHORT GetIndentCount() const { return mpData->nIndents; }
+ const RulerIndent* GetIndents() const { return mpData->pIndents; }
+
+ void SetTabs( USHORT n = 0, const RulerTab* pTabAry = NULL );
+ USHORT GetTabCount() const { return mpData->nTabs; }
+ const RulerTab* GetTabs() const { return mpData->pTabs; }
+
+ static void DrawTab( OutputDevice* pDevice,
+ const Point& rPos, USHORT nStyle );
+
+ void SetStyle( WinBits nStyle );
+ WinBits GetStyle() const { return mnWinStyle; }
+
+ void SetStartDragHdl( const Link& rLink ) { maStartDragHdl = rLink; }
+ const Link& GetStartDragHdl() const { return maStartDragHdl; }
+ void SetDragHdl( const Link& rLink ) { maDragHdl = rLink; }
+ const Link& GetDragHdl() const { return maDragHdl; }
+ void SetEndDragHdl( const Link& rLink ) { maEndDragHdl = rLink; }
+ const Link& GetEndDragHdl() const { return maEndDragHdl; }
+ void SetClickHdl( const Link& rLink ) { maClickHdl = rLink; }
+ const Link& GetClickHdl() const { return maClickHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetExtraDownHdl( const Link& rLink ) { maExtraDownHdl = rLink; }
+ const Link& GetExtraDownHdl() const { return maExtraDownHdl; }
+};
+
+#endif // _RULER_HXX
diff --git a/svtools/inc/scrwin.hxx b/svtools/inc/scrwin.hxx
new file mode 100644
index 000000000000..71d81477c58b
--- /dev/null
+++ b/svtools/inc/scrwin.hxx
@@ -0,0 +1,145 @@
+/*************************************************************************
+ *
+ * $RCSfile: scrwin.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:52 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SCRWIN_HXX
+#define _SCRWIN_HXX
+
+#ifndef _SCRBAR_HXX //autogen
+#include <vcl/scrbar.hxx>
+#endif
+
+class DataChangedEvent;
+
+// -------------------------
+// - ScrollableWindow-Type -
+// -------------------------
+
+typedef USHORT ScrollableWindowFlags;
+
+#define SCRWIN_THUMBDRAGGING 1
+#define SCRWIN_VCENTER 2
+#define SCRWIN_HCENTER 4
+#define SCRWIN_DEFAULT (SCRWIN_THUMBDRAGGING | SCRWIN_VCENTER | SCRWIN_HCENTER)
+
+// --------------------
+// - ScrollableWindow -
+// --------------------
+
+class ScrollableWindow: public Window
+{
+private:
+ Point aPixOffset; // offset to virtual window (pixel)
+ Size aTotPixSz; // total size of virtual window (pixel)
+ long nLinePixH; // size of a line/column (pixel)
+ long nColumnPixW;
+
+ ScrollBar aVScroll; // the scrollbars
+ ScrollBar aHScroll;
+ ScrollBarBox aCornerWin; // window in the bottom right corner
+ BOOL bScrolling:1, // user controlled scrolling
+ bHandleDragging:1, // scroll window while dragging
+ bHCenter:1,
+ bVCenter:1;
+
+#ifdef _SVT_SCRWIN_CXX
+ void ImpInitialize( ScrollableWindowFlags nFlags );
+ DECL_LINK( ScrollHdl, ScrollBar * );
+ DECL_LINK( EndScrollHdl, ScrollBar * );
+#endif
+
+public:
+ ScrollableWindow( Window* pParent, WinBits nBits = 0,
+ ScrollableWindowFlags = SCRWIN_DEFAULT );
+ ScrollableWindow( Window* pParent, const ResId& rId,
+ ScrollableWindowFlags = SCRWIN_DEFAULT );
+
+ virtual void Resize();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void DataChanged( const DataChangedEvent& rDEvt );
+
+ virtual void StartScroll();
+ virtual void EndScroll( long nDeltaX, long nDeltaY );
+
+ void SetMapMode( const MapMode& rNewMapMode );
+ MapMode GetMapMode() const;
+
+ void SetTotalSize( const Size& rNewSize );
+ Size GetTotalSize() { return PixelToLogic( aTotPixSz ); }
+
+ void SetVisibleSize( const Size& rNewSize );
+ BOOL MakeVisible( const Rectangle& rTarget, BOOL bSloppy = FALSE );
+ Rectangle GetVisibleArea() const;
+
+ void SetLineSize( ULONG nHorz, ULONG nVert );
+ void Scroll( long nDeltaX, long nDeltaY );
+ void Scroll( long nDeltaX, long nDeltaY,
+ const Rectangle& rRect );
+ void ScrollLines( long nLinesX, long nLinesY );
+ void ScrollPages( long nPagesX, ULONG nOverlapX,
+ long nPagesY, ULONG nOverlapY );
+
+private:
+ void SetOutputSizePixel( const Size& rSize );
+ Size GetOutputSizePixel() const;
+ Size GetOutputSize() const;
+};
+
+#endif
diff --git a/svtools/inc/sectctr.hxx b/svtools/inc/sectctr.hxx
new file mode 100644
index 000000000000..8fb4de3653c8
--- /dev/null
+++ b/svtools/inc/sectctr.hxx
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * $RCSfile: sectctr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SECTCTR_HXX
+#define _SV_SECTCTR_HXX
+
+#ifndef _SV_SV_H
+#include <vcl/sv.h>
+#endif
+#ifndef _SV_CTRL_HXX
+#include <vcl/ctrl.hxx>
+#endif
+
+class ImplSplitWindow;
+class ScrollBar;
+class ScrollBarBox;
+class SvSection;
+
+#define SECTION_APPEND ((USHORT)0xFFFF)
+#define SECTION_NOTFOUND ((USHORT)0xFFFF)
+
+#define WB_SECTION_STYLE WB_VSCROLL | WB_HSCROLL | WB_TABSTOP
+
+class SvSectionControl : public Control
+{
+private:
+
+ Window aSplitWinContainer;
+ ImplSplitWindow* pSplitWin;
+ ScrollBar* pVScrollBar;
+ ScrollBar* pHScrollBar;
+ ScrollBarBox* pScrollBarBox;
+ DockingWindow* pDummy;
+ long nRealHeight;
+ long nMaxHeight;
+ long nMinWidth;
+ Wallpaper aWallpaper;
+
+ DECL_LINK( ScrollHdl, ScrollBar* );
+ DECL_LINK( EndScrollHdl, ScrollBar* );
+
+
+protected:
+
+ virtual void Resize();
+ virtual void Paint( const Rectangle& rRect );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual long KeyEventNotify( const KeyEvent& rKEvt );
+ virtual void SetPosSizePixel( long nX, long nY,long nWidth, long nHeight,USHORT nFlags);
+
+
+
+ long CalcMaxHeight();
+ long CalcRealHeight();
+ long CalcSectionWidth();
+
+ void SetScrollBars(BOOL bVert,BOOL bHorz);
+ void ShowScrollBarBox();
+ void UpdateScrollBars();
+
+ BOOL VScrollResize(Size &aSize);
+ BOOL HScrollResize(Size &aSize);
+ void SetChildPos(long nPos, BOOL bScrolling = TRUE);
+
+public:
+ SvSectionControl( Window* pParent,WinBits nStyle = WB_SECTION_STYLE);
+ SvSectionControl( Window* pParent, const ResId& rResId );
+ ~SvSectionControl();
+
+
+ void InsertSection( USHORT nSectionId,SvSection* pSection,long nSize,USHORT nPos);
+ void InsertSection( USHORT nSectionId,SvSection* pSection,USHORT nPos);
+ void RemoveSection( USHORT nSectionId );
+ void Clear();
+
+ USHORT GetSectionCount() const;
+ USHORT GetSectionId( USHORT nPos ) const;
+ USHORT GetSectionPos( USHORT nSectionId ) const;
+ USHORT GetSectionId( const Point& rPos ) const;
+
+ void SetSectionSize( USHORT nId, long nNewSize );
+ long GetSectionSize( USHORT nId ) const;
+
+ /*
+ void SetCurSectionId( USHORT nSectionId );
+ USHORT GetCurSectionId() const;
+
+ void SetFirstSectionId( USHORT nSectionId );
+ USHORT GetFirstSectionId() const { return GetSectionId( mnFirstSectionPos ); }
+
+ void MakeVisible( USHORT nSectionId );
+ */
+
+ void SetSectionWidth( USHORT nSectionId, long nWidth);
+ long GetSectionWidth( USHORT nSectionId ) const;
+
+ void SetSection( USHORT nSectionId, SvSection* pPage );
+ SvSection* GetSection( USHORT nSectionId ) const;
+
+ void SetSectionText( USHORT nSectionId, const XubString& rText );
+ XubString GetSectionText( USHORT nSectionId ) const;
+
+ void SetHelpText( USHORT nSectionId, const XubString& rText );
+ const XubString& GetHelpText( USHORT nSectionId ) const;
+
+ void SetHelpId( USHORT nSectionId, ULONG nHelpId );
+ ULONG GetHelpId( USHORT nSectionId ) const;
+
+ void SetHelpText( const XubString& rText )
+ { Control::SetHelpText( rText ); }
+ const XubString& GetHelpText() const
+ { return Control::GetHelpText(); }
+
+ void SetHelpId( ULONG nId )
+ { Control::SetHelpId( nId ); }
+ ULONG GetHelpId() const
+ { return Control::GetHelpId(); }
+
+ void SetBackground( const Wallpaper& rBackground ){aWallpaper=rBackground; }
+ const Wallpaper& GetBackground() const { return aWallpaper; }
+
+};
+
+
+#endif
diff --git a/svtools/inc/sfxecode.hxx b/svtools/inc/sfxecode.hxx
new file mode 100644
index 000000000000..a5ce6d561ba4
--- /dev/null
+++ b/svtools/inc/sfxecode.hxx
@@ -0,0 +1,143 @@
+/*************************************************************************
+ *
+ * $RCSfile: sfxecode.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFXECODE_HXX
+#define _SFXECODE_HXX
+
+#include <tools/errcode.hxx>
+
+#define ERRCODE_SFX_NOSTDTEMPLATE (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|1)
+#define ERRCODE_SFX_NOTATEMPLATE (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|2)
+#define ERRCODE_SFX_GENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|3)
+#define ERRCODE_SFX_DOLOADFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|4)
+#define ERRCODE_SFX_DOSAVECOMPLETEDFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|5)
+#define ERRCODE_SFX_COMMITFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|6)
+#define ERRCODE_SFX_HANDSOFFFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|7)
+#define ERRCODE_SFX_DOINITNEWFAILED (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|8)
+#define ERRCODE_SFX_CANTREADDOCINFO (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|9)
+#define ERRCODE_SFX_ALREADYOPEN (ERRCODE_AREA_SFX|ERRCODE_CLASS_ALREADYEXISTS|10)
+#define ERRCODE_SFX_WRONGPASSWORD (ERRCODE_AREA_SFX|ERRCODE_CLASS_READ|11)
+#define ERRCODE_SFX_DOCUMENTREADONLY (ERRCODE_AREA_SFX|ERRCODE_CLASS_WRITE|12)
+#define ERRCODE_SFX_OLEGENERAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|14)
+#define ERRCODE_SFXMSG_STYLEREPLACE (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|13)
+#define ERRCODE_SFX_TEMPLATENOTFOUND (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|15)
+#define ERRCODE_SFX_ISRELATIVE (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|16)
+#define ERRCODE_SFX_FORCEDOCLOAD (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|17)
+
+#define ERRCODE_SFX_NOFILTER (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|45)
+#define ERRCODE_SFX_FORCEQUIET (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|47)
+#define ERRCODE_SFX_CONSULTUSER (ERRCODE_WARNING_MASK|ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|48)
+#define ERRCODE_SFX_NEVERCHECKCONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|49)
+
+#define ERRCODE_SFX_NODOCRELOAD (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|18)
+#define ERRCODE_SFX_CANTFINDORIGINAL (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|19)
+#define ERRCODE_SFX_RESTART (ERRCODE_AREA_SFX|ERRCODE_CLASS_GENERAL|20)
+#define ERRCODE_SFX_CANTCREATECONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|21)
+#define ERRCODE_SFX_CANTCREATELINK (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|22)
+#define ERRCODE_SFX_WRONGBMKFORMAT (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|23)
+#define ERRCODE_SFX_WRONGICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|24)
+#define ERRCODE_SFX_CANTDELICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|25)
+#define ERRCODE_SFX_CANTWRITEICONFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|26)
+#define ERRCODE_SFX_CANTRENAMECONTENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|27)
+#define ERRCODE_SFX_INVALIDBMKPATH (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|28)
+#define ERRCODE_SFX_CANTWRITEURLCFGFILE (ERRCODE_AREA_SFX|ERRCODE_CLASS_ACCESS|29)
+#define ERRCODE_SFX_WRONGURLCFGFORMAT (ERRCODE_AREA_SFX|ERRCODE_CLASS_FORMAT|30)
+#define ERRCODE_SFX_NODOCUMENT (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|31)
+#define ERRCODE_SFX_INVALIDLINK (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|32)
+#define ERRCODE_SFX_INVALIDTRASHPATH (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|33)
+#define ERRCODE_SFX_NOTRESTORABLE (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|34)
+#define ERRCODE_SFX_NOTRASH (ERRCODE_AREA_SFX|ERRCODE_CLASS_NOTEXISTS|35)
+#define ERRCODE_SFX_INVALIDSYNTAX (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|36)
+#define ERRCODE_SFX_CANTCREATEFOLDER (ERRCODE_AREA_SFX|ERRCODE_CLASS_CREATE|37)
+#define ERRCODE_SFX_CANTRENAMEFOLDER (ERRCODE_AREA_SFX|ERRCODE_CLASS_PATH|38)
+#define ERRCODE_SFX_WRONG_CDF_FORMAT (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 39)
+#define ERRCODE_SFX_EMPTY_SERVER (ERRCODE_AREA_SFX|ERRCODE_CLASS_NONE|40)
+#define ERRCODE_SFX_NO_ABOBOX (ERRCODE_AREA_SFX| ERRCODE_CLASS_READ | 41)
+
+//Dies und das
+#define ERRCTX_ERROR 21
+#define ERRCTX_WARNING 22
+
+//Documentkontexte
+#define ERRCTX_SFX_LOADTEMPLATE 1
+#define ERRCTX_SFX_SAVEDOC 2
+#define ERRCTX_SFX_SAVEASDOC 3
+#define ERRCTX_SFX_DOCINFO 4
+#define ERRCTX_SFX_DOCTEMPLATE 5
+#define ERRCTX_SFX_MOVEORCOPYCONTENTS 6
+
+//Appkontexte
+#define ERRCTX_SFX_DOCMANAGER 50
+#define ERRCTX_SFX_OPENDOC 51
+#define ERRCTX_SFX_NEWDOCDIRECT 52
+#define ERRCTX_SFX_NEWDOC 53
+
+//Organizerkontexte
+#define ERRCTX_SFX_CREATEOBJSH 70
+
+//BASIC-Kontexte
+#define ERRCTX_SFX_LOADBASIC 80
+
+//Addressbook contexts
+#define ERRCTX_SFX_SEARCHADDRESS 90
+
+#endif // #ifndef _SFXECODE_HXX
+
+
diff --git a/svtools/inc/sgfbram.hxx b/svtools/inc/sgfbram.hxx
new file mode 100644
index 000000000000..5738afad5657
--- /dev/null
+++ b/svtools/inc/sgfbram.hxx
@@ -0,0 +1,201 @@
+/*************************************************************************
+ *
+ * $RCSfile: sgfbram.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SGFBRAM_HXX
+#define _SGFBRAM_HXX
+
+// die folgenden Zeilen k”nnen raus, sobald das auch im WNT-Update verfgbar ist:
+#if defined(WNT)
+typedef void INT64;
+typedef void UINT64;
+typedef long INT32;
+typedef unsigned long UINT32;
+typedef short INT16;
+typedef unsigned short UINT16;
+typedef char INT8;
+typedef unsigned char UINT8;
+#endif
+
+#define SgfBitImag0 1 /* Bitmap */
+#define SgfBitImag1 4 /* Bitmap */
+#define SgfBitImag2 5 /* Bitmap */
+#define SgfBitImgMo 6 /* Monochrome Bitmap */
+#define SgfSimpVect 2 /* Einfaches Vectorformat */
+#define SgfPostScrp 3 /* Postscript file */
+#define SgfStarDraw 7 /* StarDraw SGV-Datei */
+#define SgfDontKnow 255 /* Unbekannt oder kein SGF/SGV */
+
+// Konstanten fr SgfHeader.SwGrCol
+#define SgfBlckWhit 1 /* Schwarz/Weiá Bild Ä¿ SimpVector, */
+#define SgfGrayscal 2 /* Bild mit Graustufen ³ StarDraw und */
+#define Sgf16Colors 3 /* Farbbild (16 Farben) ÄÙ Bit Image */
+#define SgfVectFarb 4 /* Farben fr Linien verwenden Ä¿ */
+#define SgfVectGray 5 /* Graustufen fr Linien verwenden ³ Nur fr */
+#define SgfVectWdth 6 /* Strichst„rken fr Linien verwenden ÄÙ SimpVector */
+
+
+#define SgfHeaderSize 42
+class SgfHeader
+{
+public:
+ UINT16 Magic;
+ UINT16 Version;
+ UINT16 Typ;
+ UINT16 Xsize;
+ UINT16 Ysize;
+ INT16 Xoffs;
+ INT16 Yoffs;
+ UINT16 Planes; // Layer
+ UINT16 SwGrCol;
+ char Autor[10];
+ char Programm[10];
+ UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (38 mod 4 =2) !
+
+ UINT32 GetOffset();
+ friend SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead);
+ BOOL ChkMagic();
+};
+
+#define SgfEntrySize 22
+class SgfEntry
+{
+public:
+ UINT16 Typ;
+ UINT16 iFrei;
+ UINT16 lFreiLo,lFreiHi;
+ char cFrei[10];
+ UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (18 mod 4 =2) !
+
+ UINT32 GetOffset();
+ friend SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr);
+};
+
+#define SgfVectorSize 10
+class SgfVector
+{
+public:
+ UINT16 Flag;
+ INT16 x;
+ INT16 y;
+ UINT16 OfsLo,OfsHi; // DWord-Allignment ist notwendig (6 mod 4 =2) !
+
+ friend SvStream& operator>>(SvStream& rIStream, SgfVector& rEntr);
+};
+
+extern long SgfVectXofs;
+extern long SgfVectYofs;
+extern long SgfVectXmul;
+extern long SgfVectYmul;
+extern long SgfVectXdiv;
+extern long SgfVectYdiv;
+extern BOOL SgfVectScal;
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Windows BMP /////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#define BmpFileHeaderSize 14
+class BmpFileHeader
+{
+public:
+ UINT16 Typ; // = "BM"
+ UINT16 SizeLo,SizeHi; // Filesize in Bytes
+ UINT16 Reserve1; // Reserviert
+ UINT16 Reserve2; // Reserviert
+ UINT16 OfsLo,OfsHi; // Offset?
+
+ void SetSize(UINT32 Size);
+ void SetOfs(UINT32 Size);
+ UINT32 GetOfs();
+ friend SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead);
+};
+
+#define BmpInfoHeaderSize 40
+class BmpInfoHeader
+{
+public:
+ UINT32 Size; // GrӇe des BmpInfoHeaders
+ INT32 Width; // Breite in Pixel
+ INT32 Hight; // H”he in Pixel
+ UINT16 Planes; // Anzahl der Planes (immer 1)
+ UINT16 PixBits; // Anzahl der Bit je Pixel (1,4,8,oder 24)
+ UINT32 Compress; // Datenkompression
+ UINT32 ImgSize; // GrӇe der Images in Bytes. Ohne Kompression ist auch 0 erlaubt.
+ INT32 xDpmm; // Dot per Meter (0 ist erlaubt)
+ INT32 yDpmm; // Dot per Meter (0 ist erlaubt)
+ UINT32 ColUsed; // Anzahl der verwendeten Farben (0=alle)
+ UINT32 ColMust; // Anzahl der wichtigen Farben (0=alle)
+
+ friend SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rHead);
+};
+
+#define RGBQuadSize 4
+class RGBQuad {
+private:
+ BYTE Red;
+ BYTE Grn;
+ BYTE Blu;
+ BYTE Fil;
+public:
+ RGBQuad(BYTE R, BYTE G, BYTE B) { Red=R; Grn=G; Blu=B; Fil=0; }
+};
+
+#endif //_SGFBRAM_HXX
diff --git a/svtools/inc/sgffilt.hxx b/svtools/inc/sgffilt.hxx
new file mode 100644
index 000000000000..d4bb173519d1
--- /dev/null
+++ b/svtools/inc/sgffilt.hxx
@@ -0,0 +1,82 @@
+/*************************************************************************
+ *
+ * $RCSfile: sgffilt.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SGFFILT_HXX
+#define _SGFFILT_HXX
+#ifndef _URLOBJ_HXX
+#include <tools/urlobj.hxx>
+#endif
+
+BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion);
+BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut);
+BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf);
+BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath, const INetURLObject& rFltPath, const INetURLObject& rCfgPath);
+
+// Konstanten fr CheckSgfTyp()
+#define SGF_BITIMAGE 1 /* Bitmap */
+#define SGF_SIMPVECT 2 /* Einfaches Vectorformat */
+#define SGF_POSTSCRP 3 /* Postscript file */
+#define SGF_STARDRAW 7 /* StarDraw SGV-Datei */
+#define SGF_DONTKNOW 255 /* Unbekannt oder kein SGF/SGV */
+
+#define SGV_VERSION 3 /* SGV mit anderer Version wird abgewiesen */
+ /* 3 entspricht StarDraw 2.00/2.01 M„rz'93 */
+#endif //_SGFFILT_HXX
diff --git a/svtools/inc/sgvmain.hxx b/svtools/inc/sgvmain.hxx
new file mode 100644
index 000000000000..d9451f4c46a2
--- /dev/null
+++ b/svtools/inc/sgvmain.hxx
@@ -0,0 +1,391 @@
+/*************************************************************************
+ *
+ * $RCSfile: sgvmain.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SGVMAIN_HXX
+#define _SGVMAIN_HXX
+
+#ifdef VCL
+#include <vcl/font.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/virdev.hxx>
+#else // VCL
+#include <svgen.hxx>
+#endif
+
+
+#define UCHAR unsigned char
+
+struct PointType {
+ INT16 x;
+ INT16 y;
+};
+
+#define SgfDpmm 40
+
+#define DtHdSize 256
+class DtHdType {
+public:
+ BYTE Reserved[256];
+ friend SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd);
+ friend void DtHdOverSeek(SvStream& rInp);
+};
+
+
+struct Seitenformat {
+ PointType Size; // 0.00mm...819.175mm (Papiergröße)
+ INT16 RandL; // links Rand auf
+ INT16 RandR; // rechts dem Papier
+ INT16 RandO; // oben Rand auf
+ INT16 RandU; // unten dem Papier
+ BYTE PColor; // Future Use
+ BYTE PIntens; // erst recht Future use
+// BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
+};
+
+
+#define PageSize 146
+class PageType {
+public:
+ UINT32 Next; // Nächste Seite
+ UINT32 nList; // Objektdaten, erster Record
+ UINT32 ListEnd; // Objektdaten, letzter Record
+ Seitenformat Paper; // Papierdaten
+ BOOL BorderClip; // Objekte am Rand abschneiden (Schummel wg. Allignment unter NT)
+ BYTE StdPg; // welche Standardseite einblenden ?
+ PointType U; // Nullpunkt
+ INT16 HlpLnH[20]; // Hilfslinien
+ INT16 HlpLnV[20];
+ BYTE LnAnzH;
+ BYTE LnAnzV;
+ UCHAR PgName[32]; // Seitenname
+ friend SvStream& operator>>(SvStream& rIStream, PageType& rPage);
+};
+
+
+enum ObjArtType {ObjStrk,ObjRect,ObjPoly,ObjCirc,ObjSpln,
+ ObjText,ObjGrup,ObjBmap,ObjVirt,ObjTxtX,ObjMaxi};
+
+struct ObjLineType {
+ BYTE LFarbe; // [Index]
+ BYTE LBFarbe; // [Index]
+ BYTE LIntens; // [%]
+ BYTE LMuster; // [Index] inkl. Transparenz
+ INT16 LMSize; // [Koeffizient/100]
+ INT16 LDicke; // Strichstärke
+};
+
+struct ObjAreaType {
+ BYTE FFarbe; // [Index]
+ BYTE FBFarbe; // [Index]
+ BYTE FIntens; // [%]
+ BYTE FDummy1; //
+ INT16 FDummy2; //
+ UINT16 FMuster; // [Index] inkl. Invers, Transparenz
+};
+
+#define ObjTextTypeSize 64
+class ObjTextType {
+public:
+ ObjLineType L; // Text-Outline (future)
+ ObjAreaType F; // Text innen
+ UINT16 FontLo,FontHi;// z.B. 92500 (CG Times), zweigeteilt wegen DWordAllign in TextType.
+ UINT16 Grad; // 0.5..32767.5 Pt - bei 1000 Pt sollte aber schluß sein
+ UINT16 Breite; // 1..65535% bitte nicht mehr als 500%
+ BYTE Justify; // 2 Bit Vert (Hi), 3 Bit Hor (Lo)
+ BYTE Kapit; // 1..255%
+ UINT16 Schnitt; // 8 Flags
+ UINT16 LnFeed; // 1..32767% vom max. Schriftgrad der Zeile
+ UINT16 Slant; // Kursivwinkel 0.00..89.99ø default 15.00ø doppelt Breit angesehen)
+ BYTE ZAbst; // Zeichenabstand 0..255% (0=auf der Stelle; 100=normal; 200=Zeichen wird als
+ INT8 ChrVPos; // Zeichen V-Position default 0= on Baseline, 10= 5Pt drunter (-64..63«)
+ ObjLineType ShdL; // Schatten-Outline (neu 2.0)
+ ObjAreaType ShdF; // Schatten-innen (neu 2.0)
+ PointType ShdVers; // Schattenversatz Max.300.00%
+ BOOL ShdAbs; // True-> Schattenversatz ist absolut statt relativ zum Schriftgrad
+ BOOL NoSpc; // True-> kein Zwischenraum (für BackArea)
+ ObjAreaType BackF; // Hintergrundfläche
+ UINT32 GetFont();
+ void SetFont(UINT32 FontID);
+};
+
+class Obj0Type { // SuperClass für Apple-VMT
+public:
+ virtual void Draw(OutputDevice& rOut);
+};
+
+#define ObjkSize 20 /* eigentlich 21. Wg. Allignment ist Flags jedoch verschoben worden*/
+class ObjkType: public Obj0Type { // Grundkomponenten aller Stardraw-Objekte
+public:
+ UINT32 Last;
+ UINT32 Next;
+ UINT16 MemSize; // in Bytes
+ PointType ObjMin; // XY-Minimum des Objekts
+ PointType ObjMax; // XY-Maximum des Objekts
+ BYTE Art;
+ BYTE Layer;
+// BYTE Flags; // (Schummel für Allignment unter NT)
+ friend SvStream& operator>>(SvStream& rIStream, ObjkType& rObjk);
+ friend BOOL ObjOverSeek(SvStream& rInp, ObjkType& rObjk);
+ virtual void Draw(OutputDevice& rOut);
+};
+
+
+#define StrkSize 38
+class StrkType: public ObjkType {
+public:
+ BYTE Flags; // (Schummel für Allignment unter NT)
+ BYTE LEnden; // Linienenden
+ ObjLineType L;
+ PointType Pos1; // Anfangspunkt
+ PointType Pos2; // Endpunkt
+ friend SvStream& operator>>(SvStream& rIStream, StrkType& rStrk);
+ virtual void Draw(OutputDevice& rOut);
+};
+
+
+#define RectSize 52
+class RectType: public ObjkType {
+public:
+ BYTE Flags; // (Schummel für Allignment unter NT)
+ BYTE Reserve;
+ ObjLineType L;
+ ObjAreaType F;
+ PointType Pos1; // LO-Ecke = Bezugspunkt
+ PointType Pos2; // R-Ecke
+ INT16 Radius; // Eckenradius
+ UINT16 DrehWink; // 315...<45
+ UINT16 Slant; // >270...<90
+ friend SvStream& operator>>(SvStream& rIStream, RectType& rRect);
+ virtual void Draw(OutputDevice& rOut);
+};
+
+
+#define PolySize 44
+class PolyType: public ObjkType { // identisch mit Spline !
+public:
+ BYTE Flags; // (Schummel für Allignment unter NT)
+ BYTE LEnden; // nur für Polyline
+ ObjLineType L;
+ ObjAreaType F; // nicht für Polyline
+ BYTE nPoints;
+ BYTE Reserve;
+ UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
+ PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!))
+ friend SvStream& operator>>(SvStream& rIStream, PolyType& rPoly);
+ virtual void Draw(OutputDevice& rOut);
+};
+#define PolyClosBit 0x01 // Unterarten von Poly: 0: PolyLine 1: Polygon
+
+
+#define SplnSize 44
+class SplnType: public ObjkType { // identisch mit Poly !
+public:
+ BYTE Flags; // (Schummel für Allignment unter NT)
+ BYTE LEnden; // nur für nSpline
+ ObjLineType L;
+ ObjAreaType F; // nicht für nSpline
+ BYTE nPoints;
+ BYTE Reserve;
+ UINT32 SD_EckP; // Zeiger auf die Eckpunkte (StarDraw)
+ PointType* EckP; // Zeiger auf die Eckpunkte (StarView (wird nicht von Disk gelesen!))
+ friend SvStream& operator>>(SvStream& rIStream, SplnType& rSpln);
+ virtual void Draw(OutputDevice& rOut);
+};
+// Unterarten von Spline: siehe Poly
+
+
+#define CircSize 52
+class CircType: public ObjkType {
+public:
+ BYTE Flags; // (Schummel für Allignment unter NT)
+ BYTE LEnden; // nur Bogen (Kr & El)
+ ObjLineType L;
+ ObjAreaType F; // nicht für Bogen (Kr & El)
+ PointType Center; // Mittelpunkt
+ PointType Radius; // Radius
+ UINT16 DrehWink; // nur Ellipse
+ UINT16 StartWink; // ¿ nicht für Vollkreis
+ UINT16 RelWink; // Ù und Vollellipse
+ friend SvStream& operator>>(SvStream& rIStream, CircType& rCirc);
+ virtual void Draw(OutputDevice& rOut);
+};
+#define CircFull 0x00 /* Unterarten von Kreis: 0: Kreis */
+#define CircSect 0x01 /* 1: Kreissektor */
+#define CircAbsn 0x02 /* 2: Kreisabschnitt */
+#define CircArc 0x03 /* 3: Kreisbogen */
+
+
+#define TextSize 116
+class TextType: public ObjkType {
+public:
+ BYTE Flags; // (Schummel für Allignment unter NT)
+ BYTE Reserve; // für Word Allign
+ ObjTextType T; // 64 Bytes << DWord-Allign bei FontID erforderlich
+ PointType Pos1; // Bezugspunkt (ObenLinks)
+ PointType Pos2; // (untenRechts)
+ INT16 TopOfs; // Von Oberkante bis Textbegin (future für vJustify)
+ UINT16 DrehWink; // 0...<360
+ UINT16 BoxSlant; // >270...<90 (nur Box)
+ UINT16 BufSize; // Größe von Buf für Load, Save, Copy und so
+ UINT16 BufLo,BufHi;// (UCHAR*) Zeiger auf den Textbuffer << ShortArr, weil sonst DWord-Allign erforderlich
+ UINT16 ExtLo,ExtHi;// (Ptr) Text über mehrere Rahmen << ShortArr, weil sonst DWord-Allign erforderlich
+ PointType FitSize; // Ursprungsgröße für Fit2Size
+ INT16 FitBreit; // Breite zum formatieren bei Fit2Size
+ UCHAR* Buffer; // Diese Variable wird nicht durch Lesen von Disk gefüllt, sondern explizit!
+ friend SvStream& operator>>(SvStream& rIStream, TextType& rText);
+ virtual void Draw(OutputDevice& rOut);
+};
+#define TextOutlBit 0x01 /* 1=Sourcecode für Outliner (wird von DrawObjekt() ignoriert) */
+#define TextFitSBit 0x02 /* Bit1: 1=Text-FitToSize, auch Outliner (2.0) */
+#define TextFitZBit 0x08 /* Bit3: 1=Fit2Size Zeilenweise (2.0) */
+#define TextDrftBit 0x04 /* Bit2: 1=DraftDraw (2.0) */
+#define TextFitBits (TextFitSBit | TextFitZBit)
+
+
+enum GrafStat {NoGraf,Pic,Pcx,Hpgl,Img,Msp,Tiff,Dxf,Lot,Usr,Sgf};
+
+#define BmapSize 132
+class BmapType: public ObjkType {
+public:
+ BYTE Flags; // (Schummel für Allignment unter NT)
+ BYTE Reserve;
+ ObjAreaType F; // Farbe und Muster der 1-Plane Bitmap
+ PointType Pos1;
+ PointType Pos2;
+ UINT16 DrehWink; // 315...<45 (Future)
+ UINT16 Slant; // >270...<90 (Future)
+ UCHAR Filename[80]; // Pfad
+ PointType PixSize; // Größe in Pixel (0 bei Vektor)
+ GrafStat Format; // siehe GpmDef.Pas
+ BYTE nPlanes; // Anzahl der Bitplanes (0 bei Vektor)
+ BOOL RawOut; // als Raw ausgeben ?
+ BOOL InvOut; // invertiert ausgeben ?
+ BOOL LightOut; // aufhellen? (SD20)
+ BYTE GrfFlg; // (SD20) 0=nSGF 1=Pcx 2=Hpgl 4=Raw $FF=Undef(für Fix in DrawBmp)
+
+ INetURLObject aFltPath; // Für GraphicFilter
+ INetURLObject aCfgPath; // Für GraphicFilter
+ friend SvStream& operator>>(SvStream& rIStream, BmapType& rBmap);
+ virtual void Draw(OutputDevice& rOut);
+ void SetPaths(const INetURLObject rFltPath, const INetURLObject rCfgPath);
+};
+
+
+#define GrupSize 48
+class GrupType: public ObjkType {
+public:
+ BYTE Flags; // (Schummel für Allignment unter NT)
+ UCHAR Name[13]; // Name der Gruppe
+ UINT16 SbLo,SbHi; // (Ptr) Gruppenliste << ShortArr, weil sonst DWord Allign erforderlich
+ UINT16 UpLo,UpHi; // (Ptr) Vaterliste << ShortArr, weil sonst DWord Allign erforderlich
+ UINT16 ChartSize; // Speicherbedarf der Diagrammstruktur Struktur
+ UINT32 ChartPtr; // Diagrammstruktur
+ UINT32 GetSubPtr(); // hier nur zum Checken, ob Sublist evtl. leer ist.
+ friend SvStream& operator>>(SvStream& rIStream, GrupType& rGrup);
+// virtual void Draw(OutputDevice& rOut);
+};
+
+
+void SetLine(ObjLineType& rLine, OutputDevice& rOut);
+void SetArea(ObjAreaType& rArea, OutputDevice& rOut);
+Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts);
+void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs);
+void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs);
+INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div);
+UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div);
+
+
+class SgfFontOne {
+public:
+ SgfFontOne* Next; // Zeiger für Listenverkettung
+ UINT32 IFID;
+ BOOL Bold;
+ BOOL Ital;
+ BOOL Sans;
+ BOOL Serf;
+ BOOL Fixd;
+ FontFamily SVFamil;
+ CharSet SVChSet;
+ String SVFName; // z.B. "Times New Roman" = 15 Chars
+ USHORT SVWidth; // Durchschnittliche Zeichenbreite in %
+ SgfFontOne();
+ void ReadOne( ByteString& ID, ByteString& Dsc);
+};
+
+class SgfFontLst {
+public:
+ String FNam; // vollständiger Filename des Inifiles
+ SgfFontOne* pList; // Listenanfang
+ SgfFontOne* Last; // Listenende
+ UINT32 LastID; // für schnelleren Zugriff bei Wiederholungen
+ SgfFontOne* LastLn; // für schnelleren Zugriff bei Wiederholungen
+ BOOL Tried;
+ SgfFontLst();
+ ~SgfFontLst();
+ void AssignFN(const String& rFName);
+ void ReadList();
+ void RausList();
+ SgfFontOne* GetFontDesc(UINT32 ID);
+};
+
+#endif //_SGVMAIN_HXX
+
+
diff --git a/svtools/inc/sgvspln.hxx b/svtools/inc/sgvspln.hxx
new file mode 100644
index 000000000000..81282c0b008c
--- /dev/null
+++ b/svtools/inc/sgvspln.hxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * $RCSfile: sgvspln.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SGVSPLN_HXX
+#define _SGVSPLN_HXX
+
+/*************************************************************************
+|*
+|* CalcSpline()
+|*
+|* Beschreibung Berechnet die Koeffizienten eines parametrischen
+|* natrlichen oder periodischen kubischen
+|* Polynomsplines. Die Eckpunkte des šbergebenen
+|* Polygons werden als Sttzstellen angenommen.
+|* n liefert die Anzahl der Teilpolynome.
+|* Ist die Berechnung fehlerfrei verlaufen, so
+|* liefert die Funktion TRUE. Nur in diesem Fall
+|* ist Speicher fr die Koeffizientenarrays
+|* allokiert, der dann sp„ter vom Aufrufer mittels
+|* delete freizugeben ist.
+|* Ersterstellung JOE 17-08.93
+|* Letzte Aenderung JOE 17-08.93
+|*
+*************************************************************************/
+
+BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
+ double*& ax, double*& ay, double*& bx, double*& by,
+ double*& cx, double*& cy, double*& dx, double*& dy, double*& T);
+
+/*************************************************************************
+|*
+|* Poly2Spline()
+|*
+|* Beschreibung Konvertiert einen parametrichen kubischen
+|* Polynomspline Spline (natrlich oder periodisch)
+|* in ein angen„hertes Polygon.
+|* Die Funktion liefert FALSE, wenn ein Fehler bei
+|* der Koeffizientenberechnung aufgetreten ist oder
+|* das Polygon zu groá wird (>PolyMax=16380). Im 1.
+|* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte.
+|* Um Koordinatenberl„ufe zu vermeiden werden diese
+|* auf +/-32000 begrenzt.
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly);
+
+#endif //_SGVSPLN_HXX
diff --git a/svtools/inc/stdmenu.hxx b/svtools/inc/stdmenu.hxx
new file mode 100644
index 000000000000..8ba0f7dd0669
--- /dev/null
+++ b/svtools/inc/stdmenu.hxx
@@ -0,0 +1,278 @@
+/*************************************************************************
+ *
+ * $RCSfile: stdmenu.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _STDMENU_HXX
+#define _STDMENU_HXX
+
+#ifndef _LINK_HXX
+#include <tools/link.hxx>
+#endif
+#ifndef _INTN_HXX
+#include <tools/intn.hxx>
+#endif
+#ifndef _MENU_HXX
+#include <vcl/menu.hxx>
+#endif
+
+class FontList;
+class FontInfo;
+
+/*************************************************************************
+
+Beschreibung
+============
+
+class FontNameMenu
+
+Beschreibung
+
+Erlaubt die Auswahl von Fonts. Das Menu wird ueber Fill mit den FontNamen
+gefuellt. Fill sortiert automatisch die FontNamen (inkl. aller Umlaute und
+sprachabhaengig). Mit SetCurName()/GetCurName() kann der aktuelle Fontname
+gesetzt/abgefragt werden. Wenn SetCurName() mit einem leeren String
+aufgerufen wird, wird kein Eintrag als aktueller angezeigt (fuer DontKnow).
+Vor dem Selectaufruf wird der ausgewaehlte Name automatisch als aktueller
+gesetzt und wuerde beim naechsten Aufruf auch als aktueller Name angezeigt
+werden. Deshalb sollte vor PopupMenu::Execute() gegebenenfalls mit
+SetCurName() der aktuelle Fontname gesetzt werden.
+
+Da die Id's und der interne Aufbau des Menus nicht bekannt ist, muss ein
+Select-Handler gesetzt werden, um die Auswahl eines Namens mitzubekommen.
+
+In dieses Menu koennen keine weiteren Items eingefuegt werden.
+
+Spaeter soll auch das Menu die gleichen Bitmaps anzeigen, wie die
+FontNameBox. Auf den Systemen, wo Menues nicht automatisch scrollen,
+wird spaeter wohl ein A-Z Menu ziwschengeschaltet. Da ein Menu bei vielen
+installierten Fonts bisher schon immer lange gebraucht hat, sollte dieses
+Menu schon jetzt nur einmal erzeugt werden (da sonst das Kontextmenu bis
+zu 10-Sekunden fuer die Erzeugung brauchen koennte).
+
+Querverweise
+
+FontList; FontStyleMenu; FontSizeMenu; FontNameBox
+
+--------------------------------------------------------------------------
+
+class FontStyleMenu
+
+Beschreibung
+
+Erlaubt die Auswahl eines FontStyles. Mit Fill wird das FontStyleMenu mit
+den Styles zum uebergebenen Font gefuellt. Nachgebildete Styles werden
+immer mit eingefuegt (kann sich aber noch aendern, da vielleicht
+nicht alle Applikationen [StarDraw,Formel,FontWork] mit Syntetic-Fonts
+umgehen koennen). Mit SetCurStyle()/GetCurStyle() kann der aktuelle Fontstyle
+gesetzt/abgefragt werden. Der Stylename muss mit FontList::GetStyleName()
+ermittelt werden. Wenn SetCurStyle() mit einem leeren String aufgerufen wird,
+wird kein Eintrag als aktueller angezeigt (fuer DontKnow). Vor dem Selectaufruf
+wird der ausgewaehlte Style automatisch als aktueller gesetzt und wuerde beim
+naechsten Aufruf auch als aktueller Style angezeigt werden. Deshalb sollte vor
+PopupMenu::Execute() gegebenenfalls mit SetCurStyle() der aktuelle Style
+gesetzt werden. Da die Styles vom ausgewaehlten Font abhaengen, sollte
+nach einer Aenderung des Fontnamen das Menu mit Fill mit den Styles des
+Fonts neu gefuellt werden.
+
+Mit GetCurStyle() kann der ausgewaehlte Style abgefragt
+werden. Mit Check wird der Style gecheckt/uncheckt, welcher aktiv
+ist. Der Stylename muss mit FontList::GetStyleName() ermittelt werden. Vor
+dem Selectaufruf wird der ausgewaehlte Style automatisch gecheckt. Mit
+UncheckAllStyles() koennen alle Fontstyles geuncheckt werden (zum Beispiel
+fuer DontKnow).
+
+Da die Id's und der interne Aufbau des Menus nicht bekannt ist, muss ein
+Select-Handler gesetzt werden, um die Auswahl eines Styles mitzubekommen.
+
+An dieses Menu kann ueber MENU_APPEND weitere Items eingefuegt werden.
+Bei Fill werden nur Items entfernt, die die Id zwischen FONTSTYLEMENU_FIRSTID
+und FONTSTYLEMENU_LASTID haben.
+
+Querverweise
+
+FontList; FontNameMenu; FontSizeMenu; FontStyleBox
+
+--------------------------------------------------------------------------
+
+class FontSizeMenu
+
+Beschreibung
+
+Erlaubt die Auswahl von Fontgroessen. Ueber Fill wird das FontSizeMenu
+gefuellt und ueber GetCurHeight() kann die ausgewaehlte Fontgroesse
+abgefragt werden. Mit SetCurHeight()/GetCurHeight() kann die aktuelle
+Fontgroesse gesetzt/abgefragt werden. Wenn SetCurHeight() mit 0 aufgerufen
+wird, wird kein Eintrag als aktueller angezeigt (fuer DontKnow). Vor dem
+Selectaufruf wird die ausgewaehlte Groesse automatisch als aktuelle gesetzt
+und wuerde beim naechsten Aufruf auch als aktuelle Groesse angezeigt werden.
+Deshalb sollte vor PopupMenu::Execute() gegebenenfalls mit SetCurHeight()
+die aktuelle Groesse gesetzt werden. Da die Groessen vom ausgewaehlten Font
+abhaengen, sollte nach einer Aenderung des Fontnamen das Menu mit Fill mit
+den Groessen des Fonts neu gefuellt werden.
+
+Da die Id's und der interne Aufbau des Menus nicht bekannt ist, muss ein
+Select-Handler gesetzt werden, um die Auswahl einer Groesse mitzubekommen.
+
+Alle Groessen werden in 10tel Point angegeben.
+
+In dieses Menu koennen keine weiteren Items eingefuegt werden.
+
+Spaeter soll das Menu je nach System die Groessen anders darstelllen. Zum
+Beispiel koennte der Mac spaeter vielleicht einmal die Groessen als Outline
+darstellen, die als Bitmap-Fonts vorhanden sind.
+
+Querverweise
+
+FontList; FontNameMenu; FontStyleMenu; FontSizeBox
+
+*************************************************************************/
+
+// ----------------
+// - FontNameMenu -
+// ----------------
+
+class FontNameMenu : public PopupMenu
+{
+private:
+ XubString maCurName;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+public:
+ FontNameMenu();
+ virtual ~FontNameMenu();
+
+ virtual void Select();
+ virtual void Highlight();
+
+ void Fill( const FontList* pList );
+
+ void SetCurName( const XubString& rName );
+ const XubString& GetCurName() const { return maCurName; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return maHighlightHdl; }
+};
+
+// -----------------
+// - FontStyleMenu -
+// -----------------
+
+#define FONTSTYLEMENU_FIRSTID 62000
+#define FONTSTYLEMENU_LASTID 62999
+
+class FontStyleMenu : public PopupMenu
+{
+private:
+ XubString maCurStyle;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+public:
+ FontStyleMenu();
+ virtual ~FontStyleMenu();
+
+ virtual void Select();
+ virtual void Highlight();
+
+ void Fill( const XubString& rName, const FontList* pList );
+ void SetCurStyle( const XubString& rStyle );
+ const XubString& GetCurStyle() const { return maCurStyle; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return maHighlightHdl; }
+};
+
+// ----------------
+// - FontSizeMenu -
+// ----------------
+
+class FontSizeMenu : public PopupMenu
+{
+private:
+ International maIntn;
+ long* mpHeightAry;
+ long mnCurHeight;
+ Link maSelectHdl;
+ Link maHighlightHdl;
+
+public:
+ FontSizeMenu();
+ ~FontSizeMenu();
+
+ virtual void Select();
+ virtual void Highlight();
+
+ void Fill( const FontInfo& rInfo, const FontList* pList );
+
+ void SetCurHeight( long nHeight );
+ long GetCurHeight() const { return mnCurHeight; }
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetHighlightHdl( const Link& rLink ) { maHighlightHdl = rLink; }
+ const Link& GetHighlightHdl() const { return maHighlightHdl; }
+};
+
+#endif // _STDMENU_HXX
diff --git a/svtools/inc/strmadpt.hxx b/svtools/inc/strmadpt.hxx
new file mode 100644
index 000000000000..3e62e569a9f2
--- /dev/null
+++ b/svtools/inc/strmadpt.hxx
@@ -0,0 +1,180 @@
+/*************************************************************************
+ *
+ * $RCSfile: strmadpt.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_STRMADPT_HXX
+#define SVTOOLS_STRMADPT_HXX
+
+#ifndef _COM_SUN_STAR_IO_XINPUTSTREAM_HPP_
+#include <com/sun/star/io/XInputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_
+#include <com/sun/star/io/XOutputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XSEEKABLE_HPP_
+#include <com/sun/star/io/XSeekable.hpp>
+#endif
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+
+//============================================================================
+class SvOutputStreamOpenLockBytes: public SvOpenLockBytes
+{
+ com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >
+ m_xOutputStream;
+ sal_uInt32 m_nPosition;
+
+public:
+ TYPEINFO();
+
+ SvOutputStreamOpenLockBytes(
+ const com::sun::star::uno::Reference<
+ com::sun::star::io::XOutputStream > &
+ rTheOutputStream):
+ m_xOutputStream(rTheOutputStream), m_nPosition(0) {}
+
+ virtual ErrCode ReadAt(ULONG, void *, ULONG, ULONG *) const;
+
+ virtual ErrCode WriteAt(ULONG nPos, const void * pBuffer, ULONG nCount,
+ ULONG * pWritten);
+
+ virtual ErrCode Flush() const;
+
+ virtual ErrCode SetSize(ULONG);
+
+ virtual ErrCode Stat(SvLockBytesStat * pStat, SvLockBytesStatFlag) const;
+
+ virtual ErrCode FillAppend(const void * pBuffer, ULONG nCount,
+ ULONG * pWritten);
+
+ virtual ULONG Tell() const;
+
+ virtual ULONG Seek(ULONG);
+
+ virtual void Terminate();
+};
+
+//============================================================================
+class SvLockBytesInputStream: public cppu::OWeakObject,
+ public com::sun::star::io::XInputStream,
+ public com::sun::star::io::XSeekable
+{
+ SvLockBytesRef m_xLockBytes;
+ sal_Int64 m_nPosition;
+ bool m_bDone;
+
+public:
+ SvLockBytesInputStream(SvLockBytes * pTheLockBytes):
+ m_xLockBytes(pTheLockBytes), m_nPosition(0), m_bDone(false) {}
+
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface(const com::sun::star::uno::Type & rType)
+ throw (com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL acquire()
+ throw(com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL release()
+ throw(com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL
+ readBytes(com::sun::star::uno::Sequence< sal_Int8 > & rData,
+ sal_Int32 nBytesToRead)
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL
+ readSomeBytes(com::sun::star::uno::Sequence< sal_Int8 > & rData,
+ sal_Int32 nMaxBytesToRead)
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip)
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int32 SAL_CALL available()
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL closeInput()
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual void SAL_CALL seek(sal_Int64 nLocation)
+ throw (com::sun::star::lang::IllegalArgumentException,
+ com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int64 SAL_CALL getPosition()
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+
+ virtual sal_Int64 SAL_CALL getLength()
+ throw (com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException);
+};
+
+#endif // SVTOOLS_STRMADPT_HXX
+
diff --git a/svtools/inc/svimpbox.hxx b/svtools/inc/svimpbox.hxx
new file mode 100644
index 000000000000..18fe97c07dc1
--- /dev/null
+++ b/svtools/inc/svimpbox.hxx
@@ -0,0 +1,362 @@
+/*************************************************************************
+ *
+ * $RCSfile: svimpbox.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVIMPLBOX_HXX
+#define _SVIMPLBOX_HXX
+
+#ifndef _SELENG_HXX
+#include <vcl/seleng.hxx>
+#endif
+
+#ifndef _SCRBAR_HXX
+#include <vcl/scrbar.hxx>
+#endif
+
+class SvTreeListBox;
+class Point;
+class DropEvent;
+class SvLBoxTreeList;
+class SvImpLBox;
+class SvLBoxEntry;
+class SvLBoxItem;
+class SvLBoxTab;
+class TabBar;
+
+class ImpLBSelEng : public FunctionSet
+{
+ SvImpLBox* pImp;
+ SelectionEngine* pSelEng;
+ SvTreeListBox* pView;
+
+public:
+ ImpLBSelEng( SvImpLBox* pImp, SelectionEngine* pSelEng,
+ SvTreeListBox* pView );
+ ~ImpLBSelEng();
+ void BeginDrag();
+ void CreateAnchor();
+ void DestroyAnchor();
+ BOOL SetCursorAtPoint( const Point& rPoint,
+ BOOL bDontSelectAtCursor=FALSE );
+ BOOL IsSelectionAtPoint( const Point& rPoint );
+ void DeselectAtPoint( const Point& rPoint );
+ void DeselectAll();
+};
+
+// Flags fuer nFlag
+#define F_VER_SBARSIZE_WITH_HBAR 0x0001
+#define F_HOR_SBARSIZE_WITH_VBAR 0x0002
+#define F_IGNORE_NEXT_MOUSEMOVE 0x0004 // OS/2 only
+#define F_IN_SCROLLING 0x0008
+#define F_DESEL_ALL 0x0010
+#define F_START_EDITTIMER 0x0020 // MAC only
+#define F_IGNORE_SELECT 0x0040
+#define F_IN_RESIZE 0x0080
+#define F_REMOVED_ENTRY_INVISIBLE 0x0100
+#define F_REMOVED_RECALC_MOST_RIGHT 0x0200
+#define F_IGNORE_CHANGED_TABS 0x0400
+#define F_PAINTED 0x0800
+#define F_IN_PAINT 0x1000
+#define F_ENDSCROLL_SET_VIS_SIZE 0x2000
+#define F_FILLING 0x4000
+
+
+class SvImpLBox
+{
+friend class ImpLBSelEng;
+friend class SvTreeListBox;
+private:
+ SvTreeListBox* pView;
+ SvLBoxTreeList* pTree;
+ SvLBoxEntry* pCursor;
+ SvLBoxEntry* pStartEntry;
+ SvLBoxEntry* pAnchor;
+ SvLBoxEntry* pMostRightEntry;
+ SvLBoxButton* pActiveButton;
+ SvLBoxEntry* pActiveEntry;
+ SvLBoxTab* pActiveTab;
+ TabBar* pTabBar;
+
+ ScrollBar aVerSBar;
+ ScrollBar aHorSBar;
+ ScrollBarBox aScrBarBox;
+
+ // wg. kompat. hier
+ Image aDontKnowNodeBmp;
+ Image aExpNodeBmp, aCollNodeBmp;
+ Size aOutputSize;
+ SelectionEngine aSelEng;
+ ImpLBSelEng aFctSet;
+ Timer aAsyncBeginDragTimer;
+ Point aAsyncBeginDragPos;
+
+ long nYoffsNodeBmp;
+ long nNodeBmpTabDistance; // typisch kleiner 0
+ long nNodeBmpWidth;
+ long nNextVerVisSize;
+ long nMostRight;
+ ULONG nVisibleCount; // Anzahl Zeilen im Control
+ ULONG nCurUserEvent; //-1 == kein Userevent amn Laufen
+ short nHorSBarHeight, nVerSBarWidth;
+ USHORT nFlags;
+
+ WinBits nWinBits;
+ FASTBOOL bSimpleTravel; // ist TRUE bei SINGLE_SELECTION
+ BOOL bUpdateMode;
+ BOOL bInVScrollHdl;
+ BOOL bAsyncBeginDrag;
+
+//#if defined (MAC) || defined(OV_DEBUG)
+ Timer aEditTimer;
+ DECL_LINK( EditTimerCall, Timer * );
+//#endif
+
+ DECL_LINK( BeginDragHdl, void* );
+ DECL_LINK( MyUserEvent,void*);
+ void StopUserEvent();
+
+ void InvalidateEntriesFrom( long nY ) const;
+ void InvalidateEntry( long nY ) const;
+ void ShowVerSBar();
+ // setzt Thumb auf FirstEntryToDraw
+ void SyncVerThumb();
+ BOOL IsLineVisible( long nY ) const;
+ long GetEntryLine( SvLBoxEntry* pEntry ) const;
+ void FillView();
+ void CursorDown();
+ void CursorUp();
+ void KeyLeftRight( long nDiff );
+ void PageDown( USHORT nDelta );
+ void PageUp( USHORT nDelta );
+
+ void SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect = FALSE );
+
+ void DrawNet();
+
+ // ScrollBar-Handler
+ DECL_LINK( ScrollUpDownHdl, ScrollBar * );
+ DECL_LINK( ScrollLeftRightHdl, ScrollBar * );
+ DECL_LINK( EndScrollHdl, ScrollBar * );
+
+ void SetNodeBmpYOffset( const Image& );
+ void SetNodeBmpTabDistance();
+
+ // Selection-Engine
+ SvLBoxEntry* MakePointVisible( const Point& rPoint,
+ BOOL bNotifyScroll=TRUE );
+
+ void SetAnchorSelection( SvLBoxEntry* pOld,
+ SvLBoxEntry* pNewCursor );
+ void BeginDrag();
+ BOOL ButtonDownCheckCtrl( const MouseEvent& rMEvt,
+ SvLBoxEntry* pEntry, long nY );
+ BOOL MouseMoveCheckCtrl( const MouseEvent& rMEvt,
+ SvLBoxEntry* pEntry );
+ BOOL ButtonUpCheckCtrl( const MouseEvent& rMEvt );
+ BOOL ButtonDownCheckExpand( const MouseEvent&,
+ SvLBoxEntry*,long nY );
+
+ void PositionScrollBars( Size& rOSize, USHORT nMask );
+ USHORT AdjustScrollBars( Size& rSize );
+
+ void BeginScroll();
+ void EndScroll();
+ BOOL InScroll() const { return (BOOL)(nFlags & F_IN_SCROLLING)!=0;}
+ Rectangle GetVisibleArea() const;
+ BOOL EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPos,long nLine);
+ void InitScrollBarBox();
+ SvLBoxTab* NextTab( SvLBoxTab* );
+
+ BOOL SetMostRight( SvLBoxEntry* pEntry );
+ void FindMostRight( SvLBoxEntry* EntryToIgnore );
+ void FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* EntryToIgnore );
+ void FindMostRight_Impl( SvLBoxEntry* pParent,SvLBoxEntry* EntryToIgnore );
+ void NotifyTabsChanged();
+
+public:
+ SvImpLBox( SvTreeListBox* pView, SvLBoxTreeList*, WinBits nWinStyle );
+ ~SvImpLBox();
+
+ void Clear();
+ void SetWindowBits( WinBits nWinStyle );
+ void SetModel( SvLBoxTreeList* pModel ) { pTree = pModel;}
+
+ void EntryInserted( SvLBoxEntry*);
+ void RemovingEntry( SvLBoxEntry* pEntry );
+ void EntryRemoved();
+ void MovingEntry( SvLBoxEntry* pEntry );
+ void EntryMoved( SvLBoxEntry* pEntry );
+ void TreeInserted( SvLBoxEntry* pEntry );
+
+ void IndentChanged( short nIndentPixel );
+ void EntryExpanded( SvLBoxEntry* pEntry );
+ void EntryCollapsed( SvLBoxEntry* pEntry );
+ void CollapsingEntry( SvLBoxEntry* pEntry );
+ void EntrySelected( SvLBoxEntry*, BOOL bSelect );
+
+ void Paint( const Rectangle& rRect );
+ void RepaintSelectionItems();
+ void MouseButtonDown( const MouseEvent& );
+ void MouseButtonUp( const MouseEvent& );
+ void MouseMove( const MouseEvent&);
+ BOOL KeyInput( const KeyEvent& );
+ void Resize();
+ void GetFocus();
+ void LoseFocus();
+ void UpdateAll(
+ BOOL bInvalidateCompleteView= TRUE,
+ BOOL bUpdateVerSBar = TRUE );
+ void SetEntryHeight( short nHeight );
+ void PaintEntry( SvLBoxEntry* pEntry );
+ void InvalidateEntry( SvLBoxEntry* );
+ void RecalcFocusRect();
+
+ inline void SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect );
+ void SetDragDropMode( DragDropMode eDDMode );
+ void SetSelectionMode( SelectionMode eSelMode );
+ void SetAddMode( BOOL bAdd ) { aSelEng.AddAlways(FALSE); }
+ BOOL IsAddMode() const { return aSelEng.IsAlwaysAdding(); }
+
+ SvLBoxEntry* GetCurrentEntry() const { return pCursor; }
+ BOOL IsEntryInView( SvLBoxEntry* ) const;
+ SvLBoxEntry* GetEntry( const Point& rPos ) const;
+ // gibt letzten Eintrag zurueck, falls Pos unter letztem Eintrag
+ SvLBoxEntry* GetClickedEntry( const Point& ) const;
+ SvLBoxEntry* GetCurEntry() const { return pCursor; }
+ void SetCurEntry( SvLBoxEntry* );
+ Point GetEntryPos( SvLBoxEntry* ) const;
+ void MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop=FALSE );
+
+ void PaintDDCursor( SvLBoxEntry* );
+
+ void SetExpandedNodeBmp( const Image& );
+ void SetCollapsedNodeBmp( const Image& );
+ void SetDontKnowNodeBmp( const Image& rImg ) { aDontKnowNodeBmp = rImg; }
+ const Image& GetExpandedNodeBmp() const { return aExpNodeBmp; }
+ const Image& GetCollapsedNodeBmp() const { return aCollNodeBmp; }
+ const Image& GetDontKnowNodeBmp() const { return aDontKnowNodeBmp; }
+
+ const Size& GetOutputSize() const { return aOutputSize;}
+ void KeyUp( BOOL bPageUp, BOOL bNotifyScroll = TRUE );
+ void KeyDown( BOOL bPageDown, BOOL bNotifyScroll = TRUE );
+ void Command( const CommandEvent& rCEvt );
+
+ void Invalidate();
+ void DestroyAnchor() { pAnchor=0; aSelEng.Reset(); }
+ void SelAllDestrAnch( BOOL bSelect,
+ BOOL bDestroyAnchor = TRUE,
+ BOOL bSingleSelToo = FALSE );
+ void ShowCursor( BOOL bShow );
+
+ BOOL RequestHelp( const HelpEvent& rHEvt );
+ void EndSelection();
+ BOOL IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const;
+ void RepaintScrollBars();
+ void EnableAsyncDrag( BOOL b) { bAsyncBeginDrag = b; }
+ void SetUpdateMode( BOOL );
+ void SetUpdateModeFast( BOOL );
+ BOOL GetUpdateMode() const { return bUpdateMode; }
+ Rectangle GetClipRegionRect() const;
+ BOOL HasHorScrollBar() const { return aHorSBar.IsVisible(); }
+ void ShowFocusRect( const SvLBoxEntry* pEntry );
+ void SetTabBar( TabBar* pTabBar );
+};
+
+inline void SvImpLBox::SetExpandedNodeBmp( const Image& rBmp )
+{
+ aExpNodeBmp = rBmp;
+ SetNodeBmpYOffset( rBmp );
+}
+
+inline void SvImpLBox::SetCollapsedNodeBmp( const Image& rBmp )
+{
+ aCollNodeBmp = rBmp;
+ SetNodeBmpYOffset( rBmp );
+}
+
+inline Point SvImpLBox::GetEntryPos( SvLBoxEntry* pEntry ) const
+{
+ return Point( 0, GetEntryLine( pEntry ) );
+}
+
+inline void SvImpLBox::PaintEntry( SvLBoxEntry* pEntry )
+{
+ long nY = GetEntryLine( pEntry );
+ pView->PaintEntry( pEntry, nY );
+}
+
+
+inline BOOL SvImpLBox::IsLineVisible( long nY ) const
+{
+ BOOL bRet = TRUE;
+ if ( nY < 0 || nY >= aOutputSize.Height() )
+ bRet = FALSE;
+ return bRet;
+}
+
+inline void SvImpLBox::TreeInserted( SvLBoxEntry* pTree )
+{
+ EntryInserted( pTree );
+}
+
+
+#endif
+
+
diff --git a/svtools/inc/svimpicn.hxx b/svtools/inc/svimpicn.hxx
new file mode 100644
index 000000000000..6d1ba72ecad8
--- /dev/null
+++ b/svtools/inc/svimpicn.hxx
@@ -0,0 +1,354 @@
+/*************************************************************************
+ *
+ * $RCSfile: svimpicn.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SVIMPICN_HXX
+#define _SVIMPICN_HXX
+
+#ifndef _VIRDEV_HXX
+#include <vcl/virdev.hxx>
+#endif
+
+#ifndef _SCRBAR_HXX
+#include <vcl/scrbar.hxx>
+#endif
+#include <limits.h>
+
+class SvLBoxEntry;
+class SvLBoxTreeList;
+class SvImpIconView;
+class ImpIcnCursor;
+class SvPtrarr;
+
+#define PAINTFLAG_HOR_CENTERED 0x0001
+#define PAINTFLAG_VER_CENTERED 0x0002
+
+#define SELRECT_BORDER_OFFS -7
+// Flags
+#define F_VER_SBARSIZE_WITH_HBAR 0x00000001
+#define F_HOR_SBARSIZE_WITH_VBAR 0x00000002
+#define F_IGNORE_NEXT_MOUSEMOVE 0x00000004 // OS/2 only
+#define F_ENTRY_REMOVED 0x00000008
+// ist gesetzt, wenn nach Clear oder Ctor mind. einmal gepaintet wurde
+#define F_PAINTED 0x00000010
+#define F_ADD_MODE 0x00000020
+#define F_MOVING_SIBLING 0x00000040
+#define F_SELRECT_VISIBLE 0x00000080
+#define F_CMD_ARRIVED 0x00000100
+#define F_DRAG_SOURCE 0x00000200
+#define F_GRIDMODE 0x00000400
+// beim Einfuegen eines Eintrags ergibt sich dessen Position
+// durch simples Addieren auf die Position des zuletzt eingefuegten Eintrags
+#define F_GRID_INSERT 0x00000800
+#define F_DOWN_CTRL 0x00001000
+#define F_DOWN_DESELECT 0x00002000
+// Hack fuer D&D: Hintergrund des Entries nicht painten
+#define F_NO_EMPHASIS 0x00004000
+// Selektion per Gummiband
+#define F_RUBBERING 0x00008000
+#define F_START_EDITTIMER_IN_MOUSEUP 0x00010000
+
+class SvImpIconView
+{
+ friend class ImpIcnCursor;
+ ScrollBar aVerSBar;
+ ScrollBar aHorSBar;
+ Rectangle aCurSelectionRect;
+ SvPtrarr aSelectedRectList;
+ MouseEvent aMouseMoveEvent;
+ Timer aEditTimer; // fuer Inplace-Editieren
+ Timer aMouseMoveTimer; // generiert MouseMoves bei Gummibandselektion
+ // Boundrect des zuletzt eingefuegten Entries
+ Rectangle aPrevBoundRect;
+ Size aOutputSize; // Pixel
+ Size aVirtOutputSize; // expandiert automatisch
+ Point aDDLastEntryPos;
+ Point aDDLastRectPos;
+
+ SvLBoxTreeList* pModel;
+ SvIconView* pView;
+ ImpIcnCursor* pImpCursor;
+ long nMaxVirtWidth; // max.breite aVirtOutputSize
+ SvPtrarr* pZOrderList;
+ long nGridDX,
+ nGridDY;
+ long nHorSBarHeight,
+ nVerSBarWidth;
+ WinBits nWinBits;
+ int nViewMode;
+ long nHorDist;
+ long nVerDist;
+ long nMaxBmpWidth;
+ long nMaxBmpHeight;
+ long nMaxTextWidth;
+ long nMaxBoundHeight; // Hoehe des hoechsten BoundRects
+ ULONG nFlags;
+ ULONG nCurUserEvent;
+ SvLBoxEntry* pCurParent;
+ SvLBoxEntry* pCursor;
+ SvLBoxEntry* pNextCursor; // wird in MovingEntry gesetzt und ist
+ // nur in EntryMoved gueltig!
+ SvLBoxEntry* pDDRefEntry;
+ VirtualDevice* pDDDev;
+ VirtualDevice* pDDBufDev;
+ VirtualDevice* pDDTempDev;
+
+ SvIconViewTextMode eTextMode;
+ BOOL bMustRecalcBoundingRects;
+
+ void CheckAllSizes();
+ void CheckSizes( SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData = 0 );
+ void ShowCursor( BOOL bShow );
+
+ void SetNextEntryPos(const Point& rPos);
+ Point FindNextEntryPos( const Size& rBoundSize );
+ void ImpArrange();
+ void AdjustVirtSize( const Rectangle& );
+ void ResetVirtSize();
+ void CheckScrollBars();
+
+ DECL_LINK( ScrollUpDownHdl, ScrollBar * );
+ DECL_LINK( ScrollLeftRightHdl, ScrollBar * );
+ DECL_LINK( MouseMoveTimeoutHdl, Timer* );
+ DECL_LINK( EditTimeoutHdl, Timer* );
+ DECL_LINK( UserEventHdl, void* );
+ void AdjustScrollBars( BOOL bVirtSizeGrowedOnly = FALSE);
+ void PositionScrollBars( long nRealWidth, long nRealHeight );
+ void CalcDocPos( Point& aMousePos );
+ BOOL GetResizeRect( Rectangle& );
+ void PaintResizeRect( const Rectangle& );
+ SvLBoxEntry* GetNewCursor();
+ void ToggleSelection( SvLBoxEntry* );
+ void DeselectAllBut( SvLBoxEntry* );
+ void Center( SvLBoxEntry* pEntry, SvIcnVwDataEntry* ) const;
+ void StopEditTimer() { aEditTimer.Stop(); }
+ void StartEditTimer() { aEditTimer.Start(); }
+ void ImpHideDDIcon();
+ void ImpDrawXORRect( const Rectangle& rRect );
+ void AddSelectedRect( const Rectangle&, short nOffset = SELRECT_BORDER_OFFS );
+ void ClearSelectedRectList();
+ Rectangle CalcMaxTextRect( const SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData ) const;
+
+ void ClipAtVirtOutRect( Rectangle& rRect ) const;
+ void AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart=0 );
+ Point AdjustAtGrid(
+ const Rectangle& rCenterRect, // "Schwerpunkt" des Objekts (typ. Bmp-Rect)
+ const Rectangle& rBoundRect ) const;
+ SvIconViewTextMode GetEntryTextModeSmart( const SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData ) const;
+
+ BOOL CheckVerScrollBar();
+ BOOL CheckHorScrollBar();
+ void CancelUserEvent();
+
+public:
+
+ SvImpIconView( SvIconView* pView, SvLBoxTreeList*, WinBits nWinStyle );
+ ~SvImpIconView();
+
+ void Clear( BOOL bInCtor = FALSE );
+ void SetWindowBits( WinBits nWinStyle );
+ void SetModel( SvLBoxTreeList* pTree, SvLBoxEntry* pParent )
+ { pModel = pTree; SetCurParent(pParent); }
+ void EntryInserted( SvLBoxEntry*);
+ void RemovingEntry( SvLBoxEntry* pEntry );
+ void EntryRemoved();
+ void MovingEntry( SvLBoxEntry* pEntry );
+ void EntryMoved( SvLBoxEntry* pEntry );
+ void TreeInserted( SvLBoxEntry* pEntry );
+ void ChangedFont();
+ void ModelHasEntryInvalidated( SvListEntry* );
+ void EntryExpanded( SvLBoxEntry* pEntry );
+ void EntryCollapsed( SvLBoxEntry* pEntry );
+ void CollapsingEntry( SvLBoxEntry* pEntry );
+ void EntrySelected( SvLBoxEntry*, BOOL bSelect );
+
+ void Paint( const Rectangle& rRect );
+ void RepaintSelectionItems();
+ void MouseButtonDown( const MouseEvent& );
+ void MouseButtonUp( const MouseEvent& );
+ void MouseMove( const MouseEvent&);
+ BOOL KeyInput( const KeyEvent& );
+ void Resize();
+ void GetFocus();
+ void LoseFocus();
+ void UpdateAll();
+ void PaintEntry( SvLBoxEntry* pEntry,
+ SvIcnVwDataEntry* pViewData = 0 );
+ void PaintEntry( SvLBoxEntry*, const Point&,
+ SvIcnVwDataEntry* pViewData = 0, OutputDevice* pOut = 0);
+ void SetEntryPos( SvLBoxEntry* pEntry, const Point& rPos,
+ BOOL bAdjustRow = FALSE,
+ BOOL bCheckScrollBars = FALSE );
+ void InvalidateEntry( SvLBoxEntry* );
+ void ViewDataInitialized( SvLBoxEntry* pEntry );
+ SvLBoxItem* GetItem( SvLBoxEntry*, const Point& rAbsPos );
+
+ void SetNoSelection();
+ void SetDragDropMode( DragDropMode eDDMode );
+ void SetSelectionMode( SelectionMode eSelMode );
+
+ SvLBoxEntry* GetCurEntry() const { return pCursor; }
+ void SetCursor( SvLBoxEntry* );
+
+ BOOL IsEntryInView( SvLBoxEntry* );
+ SvLBoxEntry* GetEntry( const Point& rDocPos );
+ SvLBoxEntry* GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry );
+ SvLBoxEntry* GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry );
+
+ Point GetEntryPos( SvLBoxEntry* );
+ void MakeVisible( SvLBoxEntry* pEntry );
+
+ void Arrange();
+
+ void SetSpaceBetweenEntries( long nHor, long Ver );
+ long GetHorSpaceBetweenEntries() const { return nHorDist; }
+ long GetVerSpaceBetweenEntries() const { return nVerDist; }
+
+ Rectangle CalcFocusRect( SvLBoxEntry* );
+
+ Rectangle CalcBmpRect( SvLBoxEntry*, const Point* pPos = 0,
+ SvIcnVwDataEntry* pViewData=0 );
+ Rectangle CalcTextRect( SvLBoxEntry*, SvLBoxString* pItem = 0,
+ const Point* pPos = 0,
+ BOOL bForInplaceEdit = FALSE,
+ SvIcnVwDataEntry* pViewData = 0 );
+
+ long CalcBoundingWidth( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData = 0) const;
+ long CalcBoundingHeight( SvLBoxEntry*, const SvIcnVwDataEntry* pViewData= 0 ) const;
+ Size CalcBoundingSize( SvLBoxEntry*,
+ SvIcnVwDataEntry* pViewData = 0 ) const;
+ void FindBoundingRect( SvLBoxEntry* pEntry,
+ SvIcnVwDataEntry* pViewData = 0 );
+ // berechnet alle BoundRects neu
+ void RecalcAllBoundingRects();
+ // berechnet alle ungueltigen BoundRects neu
+ void RecalcAllBoundingRectsSmart();
+ const Rectangle& GetBoundingRect( SvLBoxEntry*,
+ SvIcnVwDataEntry* pViewData=0);
+ void InvalidateBoundingRect( SvLBoxEntry* );
+ void InvalidateBoundingRect( Rectangle& rRect ) { rRect.Right() = LONG_MAX; }
+ BOOL IsBoundingRectValid( const Rectangle& rRect ) const { return (BOOL)( rRect.Right() != LONG_MAX ); }
+
+ void PaintEmphasis( const Rectangle&, BOOL bSelected,
+ BOOL bInUse, BOOL bCursored, OutputDevice* pOut = 0 );
+ void PaintItem( const Rectangle& rRect, SvLBoxItem* pItem,
+ SvLBoxEntry* pEntry, USHORT nPaintFlags, OutputDevice* pOut = 0 );
+ // berechnet alle BoundingRects neu, wenn bMustRecalcBoundingRects == TRUE
+ void CheckBoundingRects() { if (bMustRecalcBoundingRects) RecalcAllBoundingRects(); }
+ // berechnet alle invalidierten BoundingRects neu
+ void UpdateBoundingRects();
+ void ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow );
+ SvLBoxEntry* GetDropTarget( const Point& rPosPixel );
+ BOOL NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos );
+ BOOL NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos );
+
+ void WriteDragServerInfo( const Point&, SvLBoxDDInfo* );
+ void ReadDragServerInfo( const Point&, SvLBoxDDInfo* );
+ void Command( const CommandEvent& rCEvt );
+ void ToTop( SvLBoxEntry* );
+
+ void SetCurParent( SvLBoxEntry* pNewParent );
+ SvLBoxEntry* GetCurParent() const { return pCurParent; }
+ USHORT GetSelectionCount() const;
+ void SetGrid( long nDX, long nDY );
+ void Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar = FALSE );
+ const Size& GetItemSize( SvIconView* pView, SvLBoxEntry*, SvLBoxItem*,
+ const SvIcnVwDataEntry* pViewData = 0 ) const;
+ void PrepareCommandEvent( const CommandEvent& );
+
+ void HideDDIcon();
+ void ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos );
+ void HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos );
+
+ // HACK(damits kompatibel bleibt)
+ SvLBoxEntry* pViewData;
+
+ BOOL IsOver( SvPtrarr* pSelectedRectList, const Rectangle& rEntryBoundRect ) const;
+ void SelectRect( const Rectangle&, BOOL bAdd = TRUE,
+ SvPtrarr* pOtherRects = 0,
+ short nOffs = SELRECT_BORDER_OFFS );
+ void DrawSelectionRect( const Rectangle& );
+ void HideSelectionRect();
+ void CalcScrollOffsets( const Point& rRefPosPixel,
+ long& rX, long& rY, BOOL bDragDrop = FALSE,
+ USHORT nBorderWidth = 10 );
+ void EndTracking();
+ BOOL IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos );
+ void MakeVisible( const Rectangle& rDocPos,BOOL bInScrollBarEvent=FALSE);
+ void AdjustAtGrid( SvLBoxEntry* pStart = 0 );
+ void SetTextMode( SvIconViewTextMode, SvLBoxEntry* pEntry = 0 );
+ SvIconViewTextMode GetTextMode( const SvLBoxEntry* pEntry = 0,
+ const SvIcnVwDataEntry* pViewData = 0 ) const;
+ void ShowFocusRect( const SvLBoxEntry* pEntry );
+};
+
+inline void SvImpIconView::MakeVisible( SvLBoxEntry* pEntry )
+{
+ const Rectangle& rRect = GetBoundingRect( pEntry );
+ MakeVisible( rRect );
+}
+
+#endif // #ifndef _SVIMPICN_HXX
+
+
diff --git a/svtools/inc/svipcdef.h b/svtools/inc/svipcdef.h
new file mode 100644
index 000000000000..e12577598b6e
--- /dev/null
+++ b/svtools/inc/svipcdef.h
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * $RCSfile: svipcdef.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVIPCDEF_H
+#define _SVIPCDEF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined (WNT) || defined (WIN)
+#define CDECL __cdecl
+#elif defined CSET
+#define CDECL _System
+#else
+#define CDECL
+#endif
+
+#if defined WIN
+#define _EXTLIBCALL_ _pascal
+#else
+#define _EXTLIBCALL_ CDECL
+#endif
+
+typedef void (CDECL *IPCCallbackFunc)(void*);
+
+extern void _EXTLIBCALL_ IPCFreeMemory(void*);
+extern short _EXTLIBCALL_ IPCGetStatus(void*);
+extern short _EXTLIBCALL_ IPCInit(void);
+extern void _EXTLIBCALL_ IPCDeInit(void);
+extern void* _EXTLIBCALL_ IPCConnectServer(const char*, IPCCallbackFunc);
+extern void _EXTLIBCALL_ IPCDisconnectServer(void *);
+#ifdef WIN
+extern long CDECL IPCCALLFUNCTION(void *,unsigned long,void *,
+ short,const char *, char, ...);
+#else
+extern long CDECL IPCCallFunction(void *,unsigned long,void *,
+ short,const char *, char, ...);
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/svtools/inc/svtool.h b/svtools/inc/svtool.h
new file mode 100644
index 000000000000..30bf10b7bd0c
--- /dev/null
+++ b/svtools/inc/svtool.h
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * $RCSfile: svtool.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOL_H
+#define _SVTOOL_H
+
+#if defined( W30 ) && defined( _MSC_VER )
+#define SVEXPORT _export
+#else
+#define SVEXPORT
+#endif
+
+#endif // _SVTOOL_H
diff --git a/svtools/inc/sychconv.hxx b/svtools/inc/sychconv.hxx
new file mode 100644
index 000000000000..bb11426ed7ba
--- /dev/null
+++ b/svtools/inc/sychconv.hxx
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * $RCSfile: sychconv.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:53 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SYCHCONV_HXX
+#define _SYCHCONV_HXX
+
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+#ifndef _SV_FONT_HXX
+#include <vcl/font.hxx>
+#endif
+
+// ----------------------
+// - CharacterConverter -
+// ----------------------
+
+class OutputDevice;
+
+class SymCharConverter
+{
+public:
+
+ static const BOOL Convert( Font& rFont, UniString& rString, OutputDevice* pDev = NULL );
+};
+
+#endif // _CHARCONV_HXX
diff --git a/svtools/inc/tabbar.hxx b/svtools/inc/tabbar.hxx
new file mode 100644
index 000000000000..a15f597bedd9
--- /dev/null
+++ b/svtools/inc/tabbar.hxx
@@ -0,0 +1,565 @@
+/*************************************************************************
+ *
+ * $RCSfile: tabbar.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TABBAR_HXX
+#define _TABBAR_HXX
+
+#ifndef _LINK_HXX
+#include <tools/link.hxx>
+#endif
+#ifndef _WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+
+class MouseEvent;
+class TrackingEvent;
+class DataChangedEvent;
+class ImplTabBarList;
+class ImplTabButton;
+class ImplTabSizer;
+class TabBarEdit;
+
+// -----------------
+// - Dokumentation -
+// -----------------
+
+/*
+
+Erlaubte StyleBits
+------------------
+
+WB_SCROLL - Die Tabs koennen ueber ein Extra-Feld gescrollt werden
+WB_MINSCROLL - Die Tabs koennen ueber 2 zusaetzliche Buttons gescrollt werden
+WB_RANGESELECT - Zusammenhaengende Bereiche koennen selektiert werden
+WB_MULTISELECT - Einzelne Tabs koennen selektiert werden
+WB_BORDER - Oben und unten wird ein Strich gezeichnet
+WB_TOPBORDER - Oben wird ein Border gezeichnet
+WB_3DTAB - Die Tabs und der Border werden in 3D gezeichnet
+WB_DRAG - Vom TabBar wird ein StartDrag-Handler gerufen, wenn
+ Drag and Drop gestartet werden soll. Es wird ausserdem
+ im TabBar mit EnableDrop() Drag and Drop eingeschaltet.
+WB_SIZEABLE - Vom TabBar wird ein Split-Handler gerufen, wenn der Anwender
+ den TabBar in der Breite aendern will
+WB_STDTABBAR - WB_BORDER
+
+Wenn man den TabBar zum Beispiel als Property-Bar benutzen moechte, sollten
+die WinBits WB_TOPBORDER und WB_3DTAB anstatt WB_BORDER gesetzt werden.
+
+
+Erlaubte PageBits
+-----------------
+
+TPB_SPECIAL - Andere Darstellung des TabTextes, zum Beispiel fuer
+ Szenario-Seiten.
+
+
+Handler
+-------
+
+Select - Wird gerufen, wenn eine Tab selektiert oder
+ deselektiert wird
+DoubleClick - Wird gerufen, wenn ein DoubleClick im TabBar ausgeloest
+ wurde. Innerhalb des Handlers liefert GetCurPageId() die
+ angeklickte Tab zurueck oder 0, wenn keine Tab angeklickt
+ wurde
+ActivatePage - Wird gerufen, wenn eine andere Seite aktiviert wird.
+ GetCurPageId() gibt die aktivierte Seite zurueck.
+DeactivatePage - Wird gerufen, wenn eine Seite deaktiviert wird. Wenn
+ eine andere Seite aktiviert werden darf, muss TRUE
+ zurueckgegeben werden, wenn eine andere Seite von
+ der Aktivierung ausgeschlossen werden soll, muss
+ FALSE zurueckgegeben werden. GetCurPageId() gibt die
+ zu deaktivierende Seite zurueck.
+
+
+
+Drag and Drop
+-------------
+
+Fuer Drag and Drop muss das WinBit WB_DRAG gesetzt werden. Ausserdem
+muss der Command-, QueryDrop-Handler und der Drop-Handler ueberlagert
+werden. Dabei muss in den Handlern folgendes implementiert werden:
+
+Command - Wenn in diesem Handler das Dragging gestartet werden
+ soll, muss StartDrag() gerufen werden. Diese Methode
+ selektiert dann den entsprechenden Eintrag oder gibt
+ FALSE zurueck, wenn das Dragging nicht durchgefuhert
+ werden kann.
+
+QueryDrop - Dieser Handler wird von StarView immer dann gerufen, wenn
+ bei einem Drag-Vorgang die Maus ueber das Fenster gezogen
+ wird (siehe dazu auch SV-Doku). In diesem Handler muss
+ festgestellt werden, ob ein Drop moeglich ist. Die
+ Drop-Position kann im TabBar mit ShowDropPos() angezeigt
+ werden. Beim Aufruf muss die Position vom Event uebergeben
+ werden. Wenn sich die Position am linken oder rechten
+ Rand befindet, wird automatisch im TabBar gescrollt.
+ Diese Methode gibt auch die entsprechende Drop-Position
+ zurueck, die auch fuer ein Drop gebraucht wird. Wenn das
+ Fenster beim Drag verlassen wird, kann mit HideDropPos()
+ die DropPosition wieder weggenommen werden. Es ist dadurch
+ auch moeglich, ein von ausserhalb des TabBars ausgeloestes
+ Drag zu verarbeiten.
+
+Drop - Im Drop-Handler muessen dann die Pages verschoben werden,
+ oder die neuen Pages eingefuegt werden. Die entsprechende
+ Drop-Postion kann mit ShowDropPos() ermittelt werden.
+
+Folgende Methoden werden fuer Drag and Drop gebraucht und muessen von
+den Handlern gerufen werden:
+
+StartDrag - Muss aus dem Commnad-Handler gerufen werden. Als Parameter
+ muss der CommandEvent uebergeben werden und eine Referenz
+ auf eine Region. Diese Region muss dann bei ExecuteDrag()
+ uebergeben werden, wenn der Rueckgabewert sagt, das
+ ExecuteDrag durchgefuehrt werden soll. Falls der Eintrag
+ nicht selektiert ist, wird er vorher als aktueller
+ Eintrag gesetzt. Es ist daher darauf zu achten, das aus
+ dieser Methode heraus der Select-Handler gerufen werden
+ kann.
+
+ShowDropPos - Diese Methode muss vom QueryDrop-Handler gerufen werden,
+ damit der TabBar anzeigt, wo die Tabs eingefuegt werden.
+ Diese Methode kann auch im Drop-Handler benutzt werden,
+ um die Position zu ermitteln wo die Tabs eingefuegt werden
+ sollen. In der Methode muss die Position vom Event
+ uebergeben werden. Diese Methode gibt die Position zurueck,
+ wo die Tabs eingefuegt werden sollen.
+
+HideDropPos - Diese Methode nimmt die vorher mit ShowDropPos() angezeigte
+ DropPosition wieder zurueck. Diese Methode sollte dann
+ gerufen werden, wenn bei QueryDrop() das Fenster verlassen
+ wird oder der Dragvorgang beendet wurde.
+
+Folgende Methoden koennen eingesetzt werden, wenn bei D&D die Seiten
+umgeschaltet werden sollen:
+
+SwitchPage - Diese Methode muss vom QueryDrop-Handler gerufen werden,
+ wenn die Seite ueber der sich der Mousepointer befindet,
+ umgeschaltet werden soll. Diese Methode sollte jedesmal
+ gerufen werden, wenn der QueryDrop-Handler gerufen wird.
+ Das umschalten der Seite passiert zeitverzoegert (500 ms)
+ und wird automatisch von dieser Methode verwaltet.
+ In der Methode muss die Position vom Event uebergeben
+ werden. Diese Methode gibt TRUE zurueck, wenn die Page
+ umgeschaltet wurde.
+
+EndSwitchPage - Diese Methode setzt die Daten fuer das umschalten der
+ Seiten zurueck. Diese Methode sollte dann gerufen werden,
+ wenn bei QueryDrop() das Fenster verlassen wird oder
+ der Dragvorgang beendet wurde.
+
+IsInSwitching - Mit dieser Methode kann im ActivatePage()/DeactivatePage()
+ abgefragt werden, ob dies durch SwitchPage() veranlasst
+ wurde. So kann dann beispielsweise in DeactivatePage()
+ das Umschalten ohne eine Fehlerbox verhindert werden.
+
+
+Fenster-Resize
+--------------
+
+Wenn das Fenster vom Anwender in der Breite geaendert werden kann, dann
+muss das WinBit WB_SIZEABLE gesetzt werden. In diesem Fall muss noch
+folgender Handler ueberlagert werden:
+
+Split - Wenn dieser Handler gerufen wird, sollte das Fenster
+ auf die Breite angepasst werden, die von GetSplitSize()
+ zurueckgegeben wird. Dabei wird keine minimale und
+ maximale Breite beruecksichtig. Eine minimale Breite
+ kann mit GetMinSize() abgefragt werden und die maximale
+ Breite muss von der Anwendung selber berechnet werden.
+ Da nur Online-Resize unterstuetzt wird, muss das Fenster
+ innerhalb dieses Handlers in der Breite geaendert
+ werden und eventuell abhaengige Fenster ebenfalls. Fuer
+ diesen Handler kann auch mit SetSplitHdl() ein
+ Link gesetzt werden.
+
+Folgende Methoden liefern beim Splitten weitere Informationen:
+
+GetSplitSize() - Liefert die Breite des TabBars zurueck, auf die der
+ Anwender das Fenster resizen will. Dabei wird keine
+ minimale oder maximale Breite beruecksichtigt. Es wird
+ jedoch nie eine Breite < 5 zurueckgeliefert. Diese Methode
+ liefert nur solange richtige Werte, wie Splitten aktiv
+ ist.
+
+GetMinSize() - Mit dieser Methode kann eine minimale Fensterbreite
+ abgefragt werden, so das min. etwas eines Tabs sichtbar
+ ist. Jedoch kann der TabBar immer noch schmaler gesetzt
+ werden, als die Breite, die diese Methode zurueckliefert.
+ Diese Methode kann auch aufgerufen werden, wenn kein
+ Splitten aktiv ist.
+
+
+Edit-Modus
+----------
+
+Der Tabbar bietet auch Moeglichkeiten, das der Anwender in den Tabreitern
+die Namen aendern kann.
+
+EnableEditMode - Damit kann eingestellt werden, das bei Alt+LeftClick
+ StartEditMode() automatisch vom TabBar gerufen wird.
+ Im StartRenaming()-Handler kann dann das Umbenennen
+ noch abgelehnt werden.
+StartEditMode - Mit dieser Methode wird der EditModus auf einem
+ Tab gestartet. FALSE wird zurueckgegeben, wenn
+ der Editmodus schon aktiv ist, mit StartRenaming()
+ der Modus abgelehnt wurde oder kein Platz zum
+ Editieren vorhanden ist.
+EndEditMode - Mit dieser Methode wird der EditModus beendet.
+SetEditText - Mit dieser Methode kann der Text im AllowRenaming()-
+ Handler noch durch einen anderen Text ersetzt werden.
+GetEditText - Mit dieser Methode kann im AllowRenaming()-Handler
+ der Text abgefragt werden, den der Anwender eingegeben
+ hat.
+IsInEditMode - Mit dieser Methode kann abgefragt werden, ob der
+ Editmodus aktiv ist.
+IsEditModeCanceled - Mit dieser Methode kann im EndRenaming()-
+ Handler abgefragt werden, ob die Umbenenung
+ abgebrochen wurde.
+GetEditPageId - Mit dieser Methode wird in den Renaming-Handlern
+ abgefragt, welcher Tab umbenannt wird/wurde.
+
+StartRenaming() - Dieser Handler wird gerufen, wenn ueber StartEditMode()
+ der Editmodus gestartet wurde. Mit GetEditPageId()
+ kann abgefragt werden, welcher Tab umbenannt werden
+ soll. FALSE sollte zurueckgegeben werden, wenn
+ der Editmodus nicht gestartet werden soll.
+AllowRenaming() - Dieser Handler wird gerufen, wenn der Editmodus
+ beendet wird (nicht bei Cancel). In diesem Handler
+ kann dann getestet werden, ob der Text OK ist.
+ Mit GetEditPageId() kann abgefragt werden, welcher Tab
+ umbenannt wurde.
+ Es sollte einer der folgenden Werte zurueckgegeben
+ werden:
+ TAB_RENAMING_YES
+ Der Tab wird umbenannt.
+ TAB_RENAMING_NO
+ Der Tab wird nicht umbenannt, der Editmodus bleibt
+ jedoch aktiv, so das der Anwender den Namen
+ entsprechent anpassen kann.
+ TAB_RENAMING_CANCEL
+ Der Editmodus wird abgebrochen und der alte
+ Text wieder hergestellt.
+EndRenaming() - Dieser Handler wird gerufen, wenn der Editmodus
+ beendet wurde. Mit GetEditPageId() kann abgefragt
+ werden, welcher Tab umbenannt wurde. Mit
+ IsEditModeCanceled() kann abgefragt werden, ob der
+ Modus abgebrochen wurde und der Name dadurch nicht
+ geaendert wurde.
+
+
+Maximale Pagebreite
+-------------------
+
+Die Pagebreite der Tabs kann begrenzt werden, damit ein einfacheres
+Navigieren ueber diese moeglich ist. Wenn der Text dann nicht komplett
+angezeigt werden kann, wird er mit ... abgekuerzt und in der Tip-
+oder der aktiven Hilfe (wenn kein Hilfetext gesetzt ist) wird dann der
+ganze Text angezeigt. Mit EnableAutoMaxPageWidth() kann eingestellt
+werden, ob die maximale Pagebreite sich nach der gerade sichtbaren
+Breite richten soll (ist der default). Ansonsten kann auch die
+maximale Pagebreite mit SetMaxPageWidth() (in Pixeln) gesetzt werden
+(die AutoMaxPageWidth wird dann ignoriert).
+
+
+KontextMenu
+-----------
+
+Wenn ein kontextsensitives PopupMenu anzeigt werden soll, muss der
+Command-Handler ueberlagert werden. Mit GetPageId() und bei
+Uebergabe der Mausposition kann ermittelt werden, ob der Mausclick
+ueber einem bzw. ueber welchem Item durchgefuehrt wurde.
+*/
+
+// -----------
+// - WinBits -
+// -----------
+
+#define WB_RANGESELECT ((WinBits)0x00200000)
+#define WB_MULTISELECT ((WinBits)0x00400000)
+#define WB_TOPBORDER ((WinBits)0x04000000)
+#define WB_3DTAB ((WinBits)0x08000000)
+#define WB_MINSCROLL ((WinBits)0x20000000)
+#define WB_STDTABBAR WB_BORDER
+
+// ------------------
+// - TabBarPageBits -
+// ------------------
+
+typedef USHORT TabBarPageBits;
+
+// -------------------------
+// - Bits fuer TabBarPages -
+// -------------------------
+
+#define TPB_SPECIAL ((TabBarPageBits)0x0001)
+
+// ----------------
+// - TabBar-Types -
+// ----------------
+
+#define TAB_APPEND ((USHORT)0xFFFF)
+#define TAB_PAGE_NOTFOUND ((USHORT)0xFFFF)
+
+#define TAB_RENAMING_YES ((long)TRUE)
+#define TAB_RENAMING_NO ((long)FALSE)
+#define TAB_RENAMING_CANCEL ((long)2)
+
+// ----------
+// - TabBar -
+// ----------
+
+class TabBar : public Window
+{
+ friend class ImplTabButton;
+ friend class ImplTabSizer;
+
+private:
+ ImplTabBarList* mpItemList;
+ ImplTabButton* mpFirstBtn;
+ ImplTabButton* mpPrevBtn;
+ ImplTabButton* mpNextBtn;
+ ImplTabButton* mpLastBtn;
+ ImplTabSizer* mpSizer;
+ TabBarEdit* mpEdit;
+ XubString maEditText;
+ Color maSelColor;
+ Color maSelTextColor;
+ Size maWinSize;
+ long mnMaxPageWidth;
+ long mnCurMaxWidth;
+ long mnOffX;
+ long mnOffY;
+ long mnOutWidth;
+ long mnSplitSize;
+ ULONG mnSwitchTime;
+ WinBits mnWinStyle;
+ USHORT mnCurPageId;
+ USHORT mnFirstPos;
+ USHORT mnDropPos;
+ USHORT mnSwitchId;
+ USHORT mnEditId;
+ BOOL mbFormat;
+ BOOL mbFirstFormat;
+ BOOL mbSizeFormat;
+ BOOL mbAutoMaxWidth;
+ BOOL mbInSwitching;
+ BOOL mbAutoEditMode;
+ BOOL mbEditCanceled;
+ BOOL mbDropPos;
+ BOOL mbInSelect;
+ BOOL mbSelColor;
+ BOOL mbSelTextColor;
+ Link maSelectHdl;
+ Link maDoubleClickHdl;
+ Link maSplitHdl;
+ Link maActivatePageHdl;
+ Link maDeactivatePageHdl;
+ Link maStartRenamingHdl;
+ Link maAllowRenamingHdl;
+ Link maEndRenamingHdl;
+
+#ifdef _SV_TABBAR_CXX
+ void ImplInit( WinBits nWinStyle );
+ void ImplInitSettings( BOOL bFont, BOOL bBackground );
+ void ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
+ Color& rSelectColor, Color& rSelectTextColor );
+ void ImplShowPage( USHORT nPos );
+ BOOL ImplCalcWidth();
+ void ImplFormat();
+ USHORT ImplGetLastFirstPos();
+ void ImplInitControls();
+ void ImplEnableControls();
+ DECL_LINK( ImplClickHdl, ImplTabButton* );
+#endif
+
+public:
+ TabBar( Window* pParent, WinBits nWinStyle = WB_STDTABBAR );
+ virtual ~TabBar();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void StateChanged( StateChangedType nStateChange );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void Split();
+ virtual void ActivatePage();
+ virtual long DeactivatePage();
+ virtual long StartRenaming();
+ virtual long AllowRenaming();
+ virtual void EndRenaming();
+
+ void InsertPage( USHORT nPageId, const XubString& rText,
+ TabBarPageBits nBits = 0,
+ USHORT nPos = TAB_APPEND );
+ void RemovePage( USHORT nPageId );
+ void MovePage( USHORT nPageId, USHORT nNewPos );
+ void Clear();
+
+ void EnablePage( USHORT nPageId, BOOL bEnable = TRUE );
+ BOOL IsPageEnabled( USHORT nPageId ) const;
+
+ void SetPageBits( USHORT nPageId, TabBarPageBits nBits = 0 );
+ TabBarPageBits GetPageBits( USHORT nPageId ) const;
+
+ USHORT GetPageCount() const;
+ USHORT GetPageId( USHORT nPos ) const;
+ USHORT GetPagePos( USHORT nPageId ) const;
+ USHORT GetPageId( const Point& rPos ) const;
+ Rectangle GetPageRect( USHORT nPageId ) const;
+
+ void SetCurPageId( USHORT nPageId );
+ USHORT GetCurPageId() const { return mnCurPageId; }
+
+ void SetFirstPageId( USHORT nPageId );
+ USHORT GetFirstPageId() const { return GetPageId( mnFirstPos ); }
+
+ void SelectPage( USHORT nPageId, BOOL bSelect = TRUE );
+ void SelectPageRange( BOOL bSelect = FALSE,
+ USHORT nStartPos = 0,
+ USHORT nEndPos = TAB_APPEND );
+ USHORT GetSelectPage( USHORT nSelIndex = 0 ) const;
+ USHORT GetSelectPageCount() const;
+ BOOL IsPageSelected( USHORT nPageId ) const;
+
+ void EnableAutoMaxPageWidth( BOOL bEnable = TRUE ) { mbAutoMaxWidth = bEnable; }
+ BOOL IsAutoMaxPageWidthEnabled() const { return mbAutoMaxWidth; }
+ void SetMaxPageWidth( long nMaxWidth );
+ long GetMaxPageWidth() const { return mnMaxPageWidth; }
+ void ResetMaxPageWidth() { SetMaxPageWidth( 0 ); }
+ BOOL IsMaxPageWidth() const { return mnMaxPageWidth != 0; }
+
+ void EnableEditMode( BOOL bEnable = TRUE ) { mbAutoEditMode = bEnable; }
+ BOOL IsEditModeEnabled() const { return mbAutoEditMode; }
+ BOOL StartEditMode( USHORT nPageId );
+ void EndEditMode( BOOL bCancel = FALSE );
+ void SetEditText( const XubString& rText ) { maEditText = rText; }
+ const XubString& GetEditText() const { return maEditText; }
+ BOOL IsInEditMode() const { return (mpEdit != NULL); }
+ BOOL IsEditModeCanceled() const { return mbEditCanceled; }
+ USHORT GetEditPageId() const { return mnEditId; }
+
+ BOOL StartDrag( const CommandEvent& rCEvt, Region& rRegion );
+ USHORT ShowDropPos( const Point& rPos );
+ void HideDropPos();
+ BOOL SwitchPage( const Point& rPos );
+ void EndSwitchPage();
+ BOOL IsInSwitching() { return mbInSwitching; }
+
+ void SetSelectColor();
+ void SetSelectColor( const Color& rColor );
+ const Color& GetSelectColor() const { return maSelColor; }
+ BOOL IsSelectColor() const { return mbSelColor; }
+ void SetSelectTextColor();
+ void SetSelectTextColor( const Color& rColor );
+ const Color& GetSelectTextColor() const { return maSelTextColor; }
+ BOOL IsSelectTextColor() const { return mbSelTextColor; }
+
+ void SetPageText( USHORT nPageId, const XubString& rText );
+ XubString GetPageText( USHORT nPageId ) const;
+ void SetHelpText( USHORT nPageId, const XubString& rText );
+ XubString GetHelpText( USHORT nPageId ) const;
+ void SetHelpId( USHORT nPageId, ULONG nHelpId );
+ ULONG GetHelpId( USHORT nPageId ) const;
+
+ long GetSplitSize() const { return mnSplitSize; }
+ long GetMinSize() const;
+
+ void SetHelpText( const XubString& rText )
+ { Window::SetHelpText( rText ); }
+ XubString GetHelpText() const
+ { return Window::GetHelpText(); };
+ void SetHelpId( ULONG nId )
+ { Window::SetHelpId( nId ); }
+ ULONG GetHelpId() const
+ { return Window::GetHelpId(); }
+
+ void SetStyle( WinBits nStyle );
+ WinBits GetStyle() const { return mnWinStyle; }
+
+ Size CalcWindowSizePixel() const;
+
+ void SetSelectHdl( const Link& rLink ) { maSelectHdl = rLink; }
+ const Link& GetSelectHdl() const { return maSelectHdl; }
+ void SetDoubleClickHdl( const Link& rLink ) { maDoubleClickHdl = rLink; }
+ const Link& GetDoubleClickHdl() const { return maDoubleClickHdl; }
+ void SetSplitHdl( const Link& rLink ) { maSplitHdl = rLink; }
+ const Link& GetSplitHdl() const { return maSplitHdl; }
+ void SetActivatePageHdl( const Link& rLink ) { maActivatePageHdl = rLink; }
+ const Link& GetActivatePageHdl() const { return maActivatePageHdl; }
+ void SetDeactivatePageHdl( const Link& rLink ) { maDeactivatePageHdl = rLink; }
+ const Link& GetDeactivatePageHdl() const { return maDeactivatePageHdl; }
+ void SetStartRenamingHdl( const Link& rLink ) { maStartRenamingHdl = rLink; }
+ const Link& GetStartRenamingHdl() const { return maStartRenamingHdl; }
+ void SetAllowRenamingHdl( const Link& rLink ) { maAllowRenamingHdl = rLink; }
+ const Link& GetAllowRenamingHdl() const { return maAllowRenamingHdl; }
+ void SetEndRenamingHdl( const Link& rLink ) { maEndRenamingHdl = rLink; }
+ const Link& GetEndRenamingHdl() const { return maEndRenamingHdl; }
+};
+
+#endif // _TABBAR_HXX
diff --git a/svtools/inc/taskbar.hxx b/svtools/inc/taskbar.hxx
new file mode 100644
index 000000000000..4339c9451660
--- /dev/null
+++ b/svtools/inc/taskbar.hxx
@@ -0,0 +1,537 @@
+/*************************************************************************
+ *
+ * $RCSfile: taskbar.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TASKBAR_HXX
+#define _TASKBAR_HXX
+
+#ifndef _TOOLS_TIME_HXX
+#include <tools/time.hxx>
+#endif
+#ifndef _TOOLS_INTN_HXX
+#include <tools/intn.hxx>
+#endif
+#ifndef _TOOLS_LIST_HXX
+#include <tools/list.hxx>
+#endif
+
+#ifndef _SV_TIMER_HXX
+#include <vcl/timer.hxx>
+#endif
+#ifndef _SV_TOOLBOX_HXX
+#include <vcl/toolbox.hxx>
+#endif
+#ifndef _SV_STATUS_HXX
+#include <vcl/status.hxx>
+#endif
+
+class TaskBar;
+class TaskStatusFieldItem;
+class ImplTaskItemList;
+class ImplTaskSBItemList;
+class ImplTaskBarFloat;
+struct ImplTaskSBFldItem;
+
+// -----------------
+// - Dokumentation -
+// -----------------
+
+/*
+
+TaskToolBox
+===========
+
+StartUpdateTask()/UpdateTask()/EndUpdateTask()
+Diese muessen gerufen werden, wenn die Task upgedatet werden muessen.
+Dann muss StartUpdateTask() gerufen werden, dann UpdateTask() fuer alle
+Task's und danach EndUpdateTask() wo dann die TaskButtons entsprechend
+neu angeordnet werden.
+
+ActivateTask()
+Handler der gerufen wird, wenn ein Task aktiviert werden muss. Mit
+GetTaskItem() kann abgefragt werden, welcher Task aktiviert werden muss.
+
+ContextMenu()
+Dieser Handler wird gerufen, wenn ein ContextMenu angezeigt werden soll.
+Mit GetTaskMode() kann abgefragt werden, ob fuer einen Task oder ein
+Item.
+
+GetTaskItem()
+Diese Methode liefert das Item zurueck, welches bei UpdateTask an der
+entsprechenden Position eingefuegt wurde.
+
+GetContextMenuPos()
+Liefert die Position zurueck, wo das Contextmenu angezeigt werden soll.
+
+
+TaskStatusBar
+=============
+
+InsertStatusField()/RemoveStatusField()
+Fuegt ein Statusfeld ein, wo die aktuelle Uhrzeit angezeigt wird. In
+dieses Feld koennen dann mit AddStatusFielItem(), ModifyStatusFielItem()
+und RemoveStatusFielItem() Status-Items eingefuegt werden. Bei diesen
+muss man ein Image angeben, welches dann angezeigt wird. Ausserdem kann
+man bei diesen noch Hilfe-Texte angeben oder sagen, ob sie blinken
+sollen und ein Notify-Object, worueber man informiert wird, wenn ein
+Kontextmenu angezeigt wird oder das Item angeklickt wird. Am
+TaskStatusBar kann auch ein Notify-Object gesetzt werden, wenn man
+benachrichtigt werden will, wenn die Uhrzeit oder die TaskStatusBar
+angeklickt wird. Wenn der Notify fuer die Uhrzeit kommt, ist die
+Id TASKSTATUSBAR_CLOCKID, wenn er fuer die TaskStatusBar kommt, ist
+die Id 0. Mit SetFieldFlags() kann am TaskStatusBar auch die Flags
+hinterher umgesetzt werden, um zum Beispiel die Uhrzeit ein- und
+auszuschalten.
+
+
+TaskBar
+=======
+
+Erlaubte StyleBits
+------------------
+
+WB_BORDER - Border an der oberen Kante
+WB_SIZEABLE - Zwischen TaskToolBox und TaskStatusBar kann der Anwender
+ die Groesse aendern.
+
+Wenn WB_SIZEABLE gesetzt ist, kann die Breite des StatusBars gesetzt und
+abgefragt werden. Dazu kann man SetStatusSize()/GetStatusSize() aufrufen.
+0 steht dabei fuer optimale Groesse, was auch der Default ist. Bei einem
+Doppelklick auf den Trenner kann der Anwender auch wieder die optimale
+Groesse einstellen.
+
+Wichtige Methoden
+------------------
+
+virtual TaskToolBox* TaskBar::CreateButtonBar();
+virtual TaskToolBox* TaskBar::CreateTaskToolBox();
+virtual TaskStatusBar* TaskBar::CreateTaskStatusBar();
+
+Diese Methoden muesste man ueberladen, wenn man eine eigene Klasse anlegen
+will.
+
+void TaskBar::ShowStatusText( const String& rText );
+void TaskBar::HideStatusText();
+
+Blendet den ButtonBar und die TaskBar ein bzw. aus um den Hilfetexte in der
+gesammten Zeile anzuzeigen.
+*/
+
+// -----------------
+// - TaskButtonBar -
+// -----------------
+
+class TaskButtonBar : public ToolBox
+{
+ friend class TaskBar;
+
+private:
+ TaskBar* mpNotifyTaskBar;
+ void* mpDummy1;
+ void* mpDummy2;
+ void* mpDummy3;
+ void* mpDummy4;
+
+public:
+ TaskButtonBar( Window* pParent, WinBits nWinStyle = 0 );
+ ~TaskButtonBar();
+
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+
+ void InsertButton( USHORT nItemId,
+ const Image& rImage, const String& rText,
+ USHORT nPos = TOOLBOX_APPEND )
+ { InsertItem( nItemId, rImage, rText, TIB_LEFT | TIB_AUTOSIZE, nPos ); }
+ void RemoveButton( USHORT nItemId )
+ { RemoveItem( nItemId ); }
+};
+
+// ---------------------
+// - TaskToolBox-Types -
+// ---------------------
+
+#define TASKTOOLBOX_TASK_NOTFOUND ((USHORT)0xFFFF)
+
+// ---------------
+// - TaskToolBox -
+// ---------------
+
+class TaskToolBox : public ToolBox
+{
+ friend class TaskBar;
+
+private:
+ ImplTaskItemList* mpItemList;
+ TaskBar* mpNotifyTaskBar;
+ Point maContextMenuPos;
+ ULONG mnOldItemCount;
+ long mnMaxTextWidth;
+ long mnDummy1;
+ USHORT mnUpdatePos;
+ USHORT mnUpdateNewPos;
+ USHORT mnActiveItemId;
+ USHORT mnNewActivePos;
+ USHORT mnTaskItem;
+ USHORT mnSmallItem;
+ USHORT mnDummy2;
+ BOOL mbMinActivate;
+ BOOL mbDummy1;
+ Link maActivateTaskHdl;
+ Link maContextMenuHdl;
+
+#ifdef _TASKBAR_CXX
+ void ImplFormat();
+#endif
+
+public:
+ TaskToolBox( Window* pParent, WinBits nWinStyle = 0 );
+ ~TaskToolBox();
+
+ void ActivateTaskItem( USHORT nItemId,
+ BOOL bMinActivate = FALSE );
+ USHORT GetTaskItem( const Point& rPos ) const;
+
+ virtual void ActivateTask();
+ virtual void ContextMenu();
+
+ virtual void Select();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Resize();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual BOOL QueryDrop( DropEvent& rDEvt );
+
+ void StartUpdateTask();
+ void UpdateTask( const Image& rImage, const String& rText,
+ BOOL bActive = FALSE );
+ void EndUpdateTask();
+
+ const Point& GetContextMenuPos() const { return maContextMenuPos; }
+ USHORT GetTaskItem() const { return mnTaskItem; }
+ BOOL IsMinActivate() const { return mbMinActivate; }
+
+ void SetActivateTaskHdl( const Link& rLink ) { maActivateTaskHdl = rLink; }
+ const Link& GetActivateTaskHdl() const { return maActivateTaskHdl; }
+ void SetContextMenuHdl( const Link& rLink ) { maContextMenuHdl = rLink; }
+ const Link& GetContextMenuHdl() const { return maContextMenuHdl; }
+};
+
+inline USHORT TaskToolBox::GetTaskItem( const Point& rPos ) const
+{
+ USHORT nId = GetItemId( rPos );
+ if ( nId )
+ return nId-1;
+ else
+ return TASKTOOLBOX_TASK_NOTFOUND;
+}
+
+// ---------------------
+// - ITaskStatusNotify -
+// ---------------------
+
+class ITaskStatusNotify
+{
+public:
+ virtual BOOL MouseButtonDown( USHORT nItemd, const MouseEvent& rMEvt );
+ virtual BOOL MouseButtonUp( USHORT nItemd, const MouseEvent& rMEvt );
+ virtual BOOL MouseMove( USHORT nItemd, const MouseEvent& rMEvt );
+ virtual BOOL Command( USHORT nItemd, const CommandEvent& rCEvt );
+ virtual BOOL QueryDrop( USHORT nItemd, DropEvent& rDEvt, BOOL& bRet );
+ virtual BOOL Drop( USHORT nItemd, const DropEvent& rDEvt, BOOL& bRet );
+ virtual BOOL UpdateHelp( USHORT nItemd );
+};
+
+// -----------------------
+// - TaskStatusFieldItem -
+// -----------------------
+
+#define TASKSTATUSFIELDITEM_FLASH ((USHORT)0x0001)
+
+class TaskStatusFieldItem
+{
+private:
+ ITaskStatusNotify* mpNotify;
+ Image maImage;
+ XubString maQuickHelpText;
+ XubString maHelpText;
+ ULONG mnHelpId;
+ USHORT mnFlags;
+
+public:
+ TaskStatusFieldItem();
+ TaskStatusFieldItem( const TaskStatusFieldItem& rItem );
+ TaskStatusFieldItem( ITaskStatusNotify* pNotify,
+ const Image& rImage,
+ const XubString& rQuickHelpText,
+ const XubString& rHelpText,
+ USHORT nFlags );
+ ~TaskStatusFieldItem();
+
+ void SetNotifyObject( ITaskStatusNotify* pNotify ) { mpNotify = pNotify; }
+ ITaskStatusNotify* GetNotifyObject() const { return mpNotify; }
+ void SetImage( const Image& rImage ) { maImage = rImage; }
+ const Image& GetImage() const { return maImage; }
+ void SetQuickHelpText( const XubString& rStr ) { maQuickHelpText = rStr; }
+ const XubString& GetQuickHelpText() const { return maQuickHelpText; }
+ void SetHelpText( const XubString& rStr ) { maHelpText = rStr; }
+ const XubString& GetHelpText() const { return maHelpText; }
+ void SetHelpId( ULONG nHelpId ) { mnHelpId = nHelpId; }
+ ULONG GetHelpId() const { return mnHelpId; }
+ void SetFlags( USHORT nFlags ) { mnFlags = nFlags; }
+ USHORT GetFlags() const { return mnFlags; }
+
+ const TaskStatusFieldItem& operator=( const TaskStatusFieldItem& rItem );
+};
+
+// -----------------
+// - TaskStatusBar -
+// -----------------
+
+#define TASKSTATUSBAR_STATUSFIELDID ((USHORT)61000)
+
+#define TASKSTATUSBAR_CLOCKID ((USHORT)61000)
+#define TASKSTATUSFIELD_CLOCK ((USHORT)0x0001)
+
+class TaskStatusBar : public StatusBar
+{
+ friend class TaskBar;
+
+private:
+ ImplTaskSBItemList* mpFieldItemList;
+ TaskBar* mpNotifyTaskBar;
+ ITaskStatusNotify* mpNotify;
+ Time maTime;
+ XubString maTimeText;
+ AutoTimer maTimer;
+ International maIntn;
+ long mnClockWidth;
+ long mnItemWidth;
+ long mnFieldWidth;
+ USHORT mnFieldFlags;
+ USHORT mnDummy1;
+ BOOL mbFlashItems;
+ BOOL mbOutInterval;
+ BOOL mbDummy1;
+ BOOL mbDummy2;
+
+#ifdef _TASKBAR_CXX
+ ImplTaskSBFldItem* ImplGetFieldItem( USHORT nItemId ) const;
+ ImplTaskSBFldItem* ImplGetFieldItem( const Point& rPos, BOOL& rFieldRect ) const;
+ BOOL ImplUpdateClock();
+ BOOL ImplUpdateFlashItems();
+ void ImplUpdateField( BOOL bItems );
+ DECL_LINK( ImplTimerHdl, Timer* );
+#endif
+
+public:
+ TaskStatusBar( Window* pParent, WinBits nWinStyle = WB_LEFT );
+ ~TaskStatusBar();
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual BOOL QueryDrop( DropEvent& rDEvt );
+ virtual BOOL Drop( const DropEvent& rDEvt );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void UserDraw( const UserDrawEvent& rUDEvt );
+
+ void InsertStatusField( long nOffset = STATUSBAR_OFFSET,
+ USHORT nPos = STATUSBAR_APPEND,
+ USHORT nFlags = TASKSTATUSFIELD_CLOCK );
+ void RemoveStatusField()
+ { maTimer.Stop(); RemoveItem( TASKSTATUSBAR_STATUSFIELDID ); }
+ void SetFieldFlags( USHORT nFlags );
+ USHORT GetFieldFlags() const { return mnFieldFlags; }
+ void SetNotifyObject( ITaskStatusNotify* pNotify ) { mpNotify = pNotify; }
+ ITaskStatusNotify* GetNotifyObject() const { return mpNotify; }
+
+ void AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem,
+ USHORT nPos = 0xFFFF );
+ void ModifyStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem );
+ void RemoveStatusFieldItem( USHORT nItemId );
+ BOOL GetStatusFieldItem( USHORT nItemId, TaskStatusFieldItem& rItem ) const;
+};
+
+// -----------
+// - TaskBar -
+// -----------
+
+class TaskBar : public Window
+{
+private:
+ ImplTaskBarFloat* mpAutoHideBar;
+ TaskButtonBar* mpButtonBar;
+ TaskToolBox* mpTaskToolBox;
+ TaskStatusBar* mpStatusBar;
+ void* mpDummy1;
+ void* mpDummy2;
+ void* mpDummy3;
+ void* mpDummy4;
+ String maOldText;
+ long mnStatusWidth;
+ long mnMouseOff;
+ long mnOldStatusWidth;
+ long mnDummy1;
+ long mnDummy2;
+ long mnDummy3;
+ long mnDummy4;
+ WinBits mnWinBits;
+ USHORT mnLines;
+ BOOL mbStatusText;
+ BOOL mbShowItems;
+ BOOL mbAutoHide;
+ BOOL mbAlignDummy1;
+ BOOL mbDummy1;
+ BOOL mbDummy2;
+ BOOL mbDummy3;
+ BOOL mbDummy4;
+ Link maTaskResizeHdl;
+
+#ifdef _TASKBAR_CXX
+ void ImplInitSettings();
+ void ImplNewHeight( long nNewHeight );
+#endif
+
+public:
+ TaskBar( Window* pParent, WinBits nWinStyle = WB_BORDER | WB_SIZEABLE );
+ ~TaskBar();
+
+ virtual void TaskResize();
+
+ virtual TaskButtonBar* CreateButtonBar();
+ virtual TaskToolBox* CreateTaskToolBox();
+ virtual TaskStatusBar* CreateTaskStatusBar();
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rMEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+ virtual void StateChanged( StateChangedType nType );
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+
+ void Format();
+
+ void SetLines( USHORT nLines );
+ USHORT GetLines() const { return mnLines; }
+ void EnableAutoHide( BOOL bAutoHide = TRUE );
+ BOOL IsAutoHideEnabled() const { return mbAutoHide; }
+
+ void ShowStatusText( const String& rText );
+ void HideStatusText();
+
+ void SetStatusSize( long nNewSize )
+ { mnStatusWidth=nNewSize; Resize(); }
+ long GetStatusSize() const { return mnStatusWidth; }
+
+ Size CalcWindowSizePixel() const;
+
+ TaskButtonBar* GetButtonBar() const;
+ TaskToolBox* GetTaskToolBox() const;
+ TaskStatusBar* GetStatusBar() const;
+
+ void SetTaskResizeHdl( const Link& rLink ) { maTaskResizeHdl = rLink; }
+ const Link& GetTaskResizeHdl() const { return maTaskResizeHdl; }
+};
+
+// -----------------------
+// - WindowArrange-Types -
+// -----------------------
+
+#define WINDOWARRANGE_TILE 1
+#define WINDOWARRANGE_HORZ 2
+#define WINDOWARRANGE_VERT 3
+#define WINDOWARRANGE_CASCADE 4
+
+class ImplWindowArrangeList;
+
+// -----------------------
+// - class WindowArrange -
+// -----------------------
+
+class WindowArrange
+{
+private:
+ List* mpWinList;
+ void* mpDummy;
+ ULONG mnDummy;
+
+#ifdef _TASKBAR_CXX
+ void ImplTile( const Rectangle& rRect );
+ void ImplHorz( const Rectangle& rRect );
+ void ImplVert( const Rectangle& rRect );
+ void ImplCascade( const Rectangle& rRect );
+#endif
+
+public:
+ WindowArrange();
+ ~WindowArrange();
+
+ void AddWindow( Window* pWindow, ULONG nPos = LIST_APPEND )
+ { mpWinList->Insert( (void*)pWindow, nPos ); }
+ void RemoveAllWindows()
+ { mpWinList->Clear(); }
+
+ void Arrange( USHORT nType, const Rectangle& rRect );
+};
+
+#endif // _TASKBAR_HXX
diff --git a/svtools/inc/testtool.hxx b/svtools/inc/testtool.hxx
new file mode 100644
index 000000000000..1bd95d67d387
--- /dev/null
+++ b/svtools/inc/testtool.hxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * $RCSfile: testtool.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef SVTOOLS_TESTTOOL_HXX
+#define SVTOOLS_TESTTOOL_HXX
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+#ifndef _LINK_HXX //autogen
+#include <tools/link.hxx>
+#endif
+
+class Application;
+class SvStream;
+
+class StatementFlow;
+class CommunicationManager;
+class CommunicationLink;
+#ifdef DEBUG
+class EditWindow;
+#endif
+class ImplRC;
+
+class RemoteControl
+{
+ friend class StatementFlow;
+
+ BOOL m_bIdleInserted;
+#ifdef DEBUG
+ EditWindow *m_pDbgWin;
+#endif
+ ImplRC* pImplRC;
+
+public:
+ RemoteControl();
+ ~RemoteControl();
+ BOOL QueCommands( ULONG nServiceId, SvStream *pIn );
+ SvStream* GetReturnStream();
+
+ DECL_LINK( IdleHdl, Application* );
+ DECL_LINK( CommandHdl, Application* );
+
+ DECL_LINK( QueCommandsEvent, CommunicationLink* );
+ ULONG nStoredServiceId;
+ SvStream *pStoredStream;
+
+ void ExecuteURL( String &aURL );
+
+protected:
+ CommunicationManager *pServiceMgr;
+ SvStream *pRetStream;
+};
+
+#endif // SVTOOLS_TESTTOOL_HXX
diff --git a/svtools/inc/twain.hxx b/svtools/inc/twain.hxx
new file mode 100644
index 000000000000..6c7e9351f7e2
--- /dev/null
+++ b/svtools/inc/twain.hxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * $RCSfile: twain.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TWAIN_HXX
+#define _TWAIN_HXX
+
+// please add new platforms if TWAIN is available
+#if defined WIN || defined WNT || defined UNX
+#define TWAIN_AVAILABLE 1
+#else
+#undef TWAIN_AVAILABLE
+#endif
+
+// include following only, if define is not set
+#ifndef _TWAIN_HXX_CHECK
+
+#ifndef _SV_BITMAP_HXX //autogen
+#include <vcl/bitmap.hxx>
+#endif
+
+// -----------
+// - Defines -
+// -----------
+
+#define TWAIN_ERR_NO_ERROR 0
+#define TWAIN_ERR_MODULE_NOT_LOADED 2
+#define TWAIN_ERR_DSMENTRY_NOT_FOUND 4
+#define TWAIN_ERR_SOURCE_MANAGER_NOT_OPENED 6
+#define TWAIN_ERR_SOURCE_SELECTION_DIALOG 8
+
+// ---------
+// - Twain -
+// ---------
+
+struct TwainImp;
+namespace com { namespace sun { namespace star { namespace lang { struct EventObject; } } } }
+
+class Twain
+{
+friend class TwainEventListener;
+
+private:
+
+ TwainImp* mpImp;
+
+ Bitmap maBitmap;
+ Link maUpdateLink;
+ USHORT mnErrorCode;
+ BOOL mbScanning;
+
+ Twain();
+ Twain( const Twain& rTwain );
+ const Twain& operator=( const Twain& rTwain ) { return *this; }
+
+protected:
+
+ void Disposing( const com::sun::star::lang::EventObject& rEventObject );
+
+public:
+
+ Twain( const Link& rUpdateLink );
+ ~Twain();
+
+ BOOL SelectSource();
+ BOOL PerformTransfer();
+
+ Bitmap GetBitmap();
+
+ BOOL IsScanning() const { return mbScanning; }
+ USHORT GetErrorCode() const { return mnErrorCode; }
+};
+
+#endif // _TWAIN_HXX_CHECK
+#endif // _TWAIN_HXX
diff --git a/svtools/inc/txtattr.hxx b/svtools/inc/txtattr.hxx
new file mode 100644
index 000000000000..80acb67563bc
--- /dev/null
+++ b/svtools/inc/txtattr.hxx
@@ -0,0 +1,241 @@
+/*************************************************************************
+ *
+ * $RCSfile: txtattr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TXTATTR_HXX
+#define _TXTATTR_HXX
+
+#ifndef _SV_COLOR_HXX //autogen
+#include <vcl/color.hxx>
+#endif
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+class Font;
+
+#define TEXTATTR_INVALID 0
+#define TEXTATTR_FONTCOLOR 1
+#define TEXTATTR_HYPERLINK 2
+
+
+
+class TextAttrib
+{
+private:
+ USHORT mnWhich;
+
+protected:
+ TextAttrib( USHORT nWhich ) { mnWhich = nWhich; }
+ TextAttrib( const TextAttrib& rAttr ) { mnWhich = rAttr.mnWhich; }
+
+public:
+
+ virtual ~TextAttrib();
+
+ USHORT Which() const { return mnWhich; }
+
+ virtual void SetFont( Font& rFont ) const = 0;
+ virtual TextAttrib* Clone() const = 0;
+ virtual int operator==( const TextAttrib& rAttr ) const = 0;
+ int operator!=( const TextAttrib& rAttr ) const
+ { return !(*this == rAttr ); }
+};
+
+
+
+class TextAttribFontColor : public TextAttrib
+{
+private:
+ Color maColor;
+
+public:
+ TextAttribFontColor( const Color& rColor );
+ TextAttribFontColor( const TextAttribFontColor& rAttr );
+ ~TextAttribFontColor();
+
+ virtual void SetFont( Font& rFont ) const;
+ virtual TextAttrib* Clone() const;
+ virtual int operator==( const TextAttrib& rAttr ) const;
+};
+
+
+
+class TextAttribHyperLink : public TextAttrib
+{
+private:
+ XubString maURL;
+ XubString maDescription;
+ Color maColor;
+
+public:
+ TextAttribHyperLink( const XubString& rURL );
+ TextAttribHyperLink( const XubString& rURL, const XubString& rDescription );
+ TextAttribHyperLink( const TextAttribHyperLink& rAttr );
+ ~TextAttribHyperLink();
+
+ void SetURL( const XubString& rURL ) { maURL = rURL; }
+ const XubString& GetURL() const { return maURL; }
+
+ void SetDescription( const XubString& rDescr ) { maDescription = rDescr; }
+ const XubString& GetDescription() const { return maDescription; }
+
+ void SetColor( const Color& rColor ) { maColor = rColor; }
+ const Color& GetColor() const { return maColor; }
+
+ virtual void SetFont( Font& rFont ) const;
+ virtual TextAttrib* Clone() const;
+ virtual int operator==( const TextAttrib& rAttr ) const;
+};
+
+
+
+class TextCharAttrib
+{
+private:
+ TextAttrib* mpAttr;
+ USHORT mnStart;
+ USHORT mnEnd;
+
+protected:
+
+public:
+
+ TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd );
+ TextCharAttrib( const TextCharAttrib& rTextCharAttrib );
+ ~TextCharAttrib();
+
+ const TextAttrib& GetAttr() const { return *mpAttr; }
+
+ USHORT Which() const { return mpAttr->Which(); }
+
+ USHORT GetStart() const { return mnStart; }
+ USHORT& GetStart() { return mnStart; }
+
+ USHORT GetEnd() const { return mnEnd; }
+ USHORT& GetEnd() { return mnEnd; }
+
+ inline USHORT GetLen() const;
+
+ inline void MoveForward( USHORT nDiff );
+ inline void MoveBackward( USHORT nDiff );
+
+ inline void Expand( USHORT nDiff );
+ inline void Collaps( USHORT nDiff );
+
+ inline BOOL IsIn( USHORT nIndex );
+ inline BOOL IsInside( USHORT nIndex );
+ inline BOOL IsEmpty();
+
+};
+
+inline USHORT TextCharAttrib::GetLen() const
+{
+ DBG_ASSERT( mnEnd >= mnStart, "TextCharAttrib: nEnd < nStart!" );
+ return mnEnd-mnStart;
+}
+
+inline void TextCharAttrib::MoveForward( USHORT nDiff )
+{
+ DBG_ASSERT( ((long)mnEnd + nDiff) <= 0xFFFF, "TextCharAttrib: MoveForward?!" );
+ mnStart += nDiff;
+ mnEnd += nDiff;
+}
+
+inline void TextCharAttrib::MoveBackward( USHORT nDiff )
+{
+ DBG_ASSERT( ((long)mnStart - nDiff) >= 0, "TextCharAttrib: MoveBackward?!" );
+ mnStart -= nDiff;
+ mnEnd -= nDiff;
+}
+
+inline void TextCharAttrib::Expand( USHORT nDiff )
+{
+ DBG_ASSERT( ( ((long)mnEnd + nDiff) <= (long)0xFFFF ), "TextCharAttrib: Expand?!" );
+ mnEnd += nDiff;
+}
+
+inline void TextCharAttrib::Collaps( USHORT nDiff )
+{
+ DBG_ASSERT( (long)mnEnd - nDiff >= (long)mnStart, "TextCharAttrib: Collaps?!" );
+ mnEnd -= nDiff;
+}
+
+inline BOOL TextCharAttrib::IsIn( USHORT nIndex )
+{
+ return ( ( mnStart <= nIndex ) && ( mnEnd >= nIndex ) );
+}
+
+inline BOOL TextCharAttrib::IsInside( USHORT nIndex )
+{
+ return ( ( mnStart < nIndex ) && ( mnEnd > nIndex ) );
+}
+
+inline BOOL TextCharAttrib::IsEmpty()
+{
+ return mnStart == mnEnd;
+}
+
+#endif // _TXTATTR_HXX
diff --git a/svtools/inc/txtcmp.hxx b/svtools/inc/txtcmp.hxx
new file mode 100644
index 000000000000..7c7375c9d469
--- /dev/null
+++ b/svtools/inc/txtcmp.hxx
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * $RCSfile: txtcmp.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _TXTCMP_HXX
+#define _TXTCMP_HXX
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XTEXTSEARCH_HPP_
+#include <com/sun/star/util/XTextSearch.hpp>
+#endif
+
+// Forward-Deklaration
+class International;
+class CharClass;
+
+// SS - Klasse fuers Suchen
+class SearchParam
+{
+public:
+ enum SearchType{ SRCH_NORMAL, SRCH_REGEXP, SRCH_LEVDIST };
+
+private:
+ friend class SearchText;
+
+ String sSrchStr; // der Such-String
+ String sReplaceStr; // nur fuer SS - der Ersetzungs-String
+
+ SearchType eSrchType; // suche normal/regulaer/LevDist
+
+ int bWordOnly : 1; // nur bei normaler Suche
+ int bSrchInSel : 1; // Suche in vorgebener Grenze
+ int bCaseSense : 1; // Gross-/Klein-Schreibung beachten
+
+ // Werte fuer "Gewichtete Levenshtein-Distanz"
+ int bLEV_Relaxed : 1;
+ int nLEV_OtherX;
+ int nLEV_ShorterY;
+ int nLEV_LongerZ;
+
+public:
+ SearchParam( const String &rText,
+ SearchType eSrchType = SearchParam::SRCH_NORMAL,
+ BOOL bCaseSens = TRUE,
+ BOOL bWrdOnly = FALSE,
+ BOOL bSrchInSel = FALSE );
+ SearchParam( const SearchParam& );
+
+ const String& GetSrchStr() const { return sSrchStr; }
+ const String& GetReplaceStr() const { return sReplaceStr; }
+ SearchType GetSrchType() const { return eSrchType; }
+
+ int IsCaseSensitive() const { return bCaseSense; }
+ int IsSrchInSelection() const { return bSrchInSel; }
+ int IsSrchWordOnly() const { return bWordOnly; }
+
+
+ void SetSrchStr( const String& rStr ) { sSrchStr = rStr; }
+ void SetReplaceStr( const String& rStr ) { sReplaceStr = rStr; }
+ void SetSrchType( SearchType eType ) { eSrchType = eType; }
+
+ void SetCaseSensitive( int bFlag ) { bCaseSense = bFlag; }
+ void SetSrchInSelection( int bFlag ) { bSrchInSel = bFlag; }
+ void SetSrchWordOnly( int bFlag ) { bWordOnly = bFlag; }
+
+
+ // Methoden fuer "Gewichtete Levenshtein-Distanz"
+ int IsSrchRelaxed() const { return bLEV_Relaxed; }
+ int GetLEVOther() const { return nLEV_OtherX; }
+ int GetLEVShorter() const { return nLEV_ShorterY; }
+ int GetLEVLonger() const { return nLEV_LongerZ; }
+
+ void SetSrchRelaxed( int bFlag ) { bLEV_Relaxed = bFlag; }
+ void SetLEVOther( int nValue ) { nLEV_OtherX = nValue; }
+ void SetLEVShorter( int nValue ) { nLEV_ShorterY = nValue; }
+ void SetLEVLonger( int nValue ) { nLEV_LongerZ = nValue; }
+};
+
+// Klasse zum Suchen eines Strings in einem String.
+// Unterstuetzt werden folgende Verfahren:
+// - normalen Text (Bayer/Moore)
+// - regulaere Ausdruecke
+// - gewichtete Levenshtein Distanz
+//
+// Es kann Vorwaerts und Rueckwaerts gesucht werden!
+
+class SearchText
+{
+ com::sun::star::uno::Reference < com::sun::star::util::XTextSearch >
+ xTextSearch;
+ BOOL bSearchRegular;
+
+ void Init( const SearchParam & rParam,
+ const ::com::sun::star::lang::Locale& rLocale );
+
+public:
+ // rText ist der zusuchende String
+ SearchText(const SearchParam & rPara, const International & rTheIntnl);
+ SearchText(const SearchParam & rPara, const CharClass& rCClass );
+ ~SearchText();
+
+ /* Suche im Text den initialen String:
+ rScrTxt - der Text, worin geuscht wird.
+ pStart - Startposition im Text fuers Suchen
+ nEnde - Endposition im Text
+
+ RETURN Werte == TRUE: wenn gefunden gibt,
+ - pStart zeigt auf die Startposition im Text,
+ - pEnde zeigt auf die Endposition im Text
+
+ == FALSE: nicht gefunden, pStart,pEnde unveraendert.
+ */
+ int SearchFrwrd( const String &rStr, xub_StrLen* pStart, xub_StrLen* pEnde );
+ int SearchBkwrd( const String &rStr, xub_StrLen* pStart, xub_StrLen* pEnde );
+};
+
+/*************************************************************************
+
+ Source Code Control System - Header
+
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/svtools/inc/txtcmp.hxx,v 1.1.1.1 2000-09-18 16:58:54 hr Exp $
+
+ Source Code Control System - Update
+
+ $Log: not supported by cvs2svn $
+ Revision 1.13 2000/09/18 14:13:18 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.12 2000/09/01 13:52:29 jp
+ move search into INT - DLL
+
+ Revision 1.11 2000/08/31 13:41:16 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.10 2000/08/28 11:55:35 jp
+ new: use CharClass instead of International
+
+ Revision 1.9 2000/03/31 10:48:39 jp
+ Changes for unicode
+
+ Revision 1.8 2000/02/09 16:16:19 hr
+ #70473# changes for unicode ( patched by automated patchtool )
+
+ Revision 1.7 1999/08/24 13:56:27 sb
+ #66082# Make use of International explicitly through ctor.
+
+ Revision 1.6 1997/07/30 08:36:52 MH
+ chg: header
+
+
+ Rev 1.5 30 Jul 1997 10:36:52 MH
+ chg: header
+
+ Rev 1.4 18 Jun 1996 14:56:14 WP
+ richtig includen
+
+ Rev 1.3 25 Mar 1996 09:54:06 MT
+ CLOOK-Vorbeugung
+
+ Rev 1.2 27 Nov 1995 18:27:46 AB
+ Unicode-Anpassung
+
+ Rev 1.1 23 Dec 1994 11:44:02 JP
+ endif ohne Kommentar
+
+ Rev 1.0 01 Dec 1994 16:35:46 MT
+ Initial revision.
+
+*************************************************************************/
+
+#endif
+ // _TXTCMP_HXX
diff --git a/svtools/inc/urihelper.hxx b/svtools/inc/urihelper.hxx
new file mode 100644
index 000000000000..6656b0d22c3c
--- /dev/null
+++ b/svtools/inc/urihelper.hxx
@@ -0,0 +1,228 @@
+/*************************************************************************
+ *
+ * $RCSfile: urihelper.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_URIHELPER_HXX
+#define SVTOOLS_URIHELPER_HXX
+
+#ifndef _RTL_TEXTENC_H
+#include <rtl/textenc.h>
+#endif
+#ifndef _LINK_HXX
+#include <tools/link.hxx>
+#endif
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+#ifndef _URLOBJ_HXX
+#include <tools/urlobj.hxx>
+#endif
+
+namespace com { namespace sun { namespace star { namespace uno {
+ class RuntimeException;
+} } } }
+class ByteString;
+class CharClass;
+class UniString;
+
+//============================================================================
+namespace URIHelper {
+
+UniString
+SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
+ ByteString const & rTheRelURIRef,
+ Link const & rMaybeFileHdl = Link(),
+ bool bCheckFileExists = true,
+ bool bIgnoreFragment = false,
+ INetURLObject::EncodeMechanism eEncodeMechanism
+ = INetURLObject::WAS_ENCODED,
+ INetURLObject::DecodeMechanism eDecodeMechanism
+ = INetURLObject::DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ bool bRelativeNonURIs = false,
+ INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT);
+
+UniString
+SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
+ UniString const & rTheRelURIRef,
+ Link const & rMaybeFileHdl = Link(),
+ bool bCheckFileExists = true,
+ bool bIgnoreFragment = false,
+ INetURLObject::EncodeMechanism eEncodeMechanism
+ = INetURLObject::WAS_ENCODED,
+ INetURLObject::DecodeMechanism eDecodeMechanism
+ = INetURLObject::DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ bool bRelativeNonURIs = false,
+ INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT);
+
+//============================================================================
+void SetMaybeFileHdl(Link const & rTheMaybeFileHdl);
+
+//============================================================================
+Link GetMaybeFileHdl();
+
+//============================================================================
+inline UniString
+SmartRelToAbs(ByteString const & rTheRelURIRef,
+ bool bIgnoreFragment = false,
+ INetURLObject::EncodeMechanism eEncodeMechanism
+ = INetURLObject::WAS_ENCODED,
+ INetURLObject::DecodeMechanism eDecodeMechanism
+ = INetURLObject::DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT)
+{
+ return SmartRel2Abs(INetURLObject(INetURLObject::GetBaseURL()),
+ rTheRelURIRef, GetMaybeFileHdl(), true,
+ bIgnoreFragment, eEncodeMechanism, eDecodeMechanism,
+ eCharset, false, eStyle);
+}
+
+inline UniString
+SmartRelToAbs(UniString const & rTheRelURIRef,
+ bool bIgnoreFragment = false,
+ INetURLObject::EncodeMechanism eEncodeMechanism
+ = INetURLObject::WAS_ENCODED,
+ INetURLObject::DecodeMechanism eDecodeMechanism
+ = INetURLObject::DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ INetURLObject::FSysStyle eStyle = INetURLObject::FSYS_DETECT)
+{
+ return SmartRel2Abs(INetURLObject(INetURLObject::GetBaseURL()),
+ rTheRelURIRef, GetMaybeFileHdl(), true,
+ bIgnoreFragment, eEncodeMechanism, eDecodeMechanism,
+ eCharset, false, eStyle);
+}
+
+//============================================================================
+UniString
+FindFirstURLInText(UniString const & rText,
+ xub_StrLen & rBegin,
+ xub_StrLen & rEnd,
+ CharClass const & rCharClass,
+ INetURLObject::EncodeMechanism eMechanism
+ = INetURLObject::WAS_ENCODED,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8,
+ INetURLObject::FSysStyle eStyle
+ = INetURLObject::FSYS_DETECT);
+
+//============================================================================
+/** Remove any password component from both absolute and relative URLs.
+
+ @ATT The current implementation will not remove a password from a
+ relative URL that has an authority component (e.g., the password is not
+ removed from the relative ftp URL <//user:password@domain/path>). But
+ since our functions to translate between absolute and relative URLs never
+ produce relative URLs with authority components, this is no real problem.
+
+ @ATT For relative URLs (or anything not recognized as an absolute URI),
+ the current implementation will return the input unmodified, not applying
+ any translations implied by the encode/decode parameters.
+
+ @param rURI An absolute or relative URI reference.
+
+ @param eEncodeMechanism See the general discussion for INetURLObject set-
+ methods.
+
+ @param eDecodeMechanism See the general discussion for INetURLObject get-
+ methods.
+
+ @param eCharset See the general discussion for INetURLObject get- and
+ set-methods.
+
+ @return The input URI with any password component removed.
+ */
+UniString
+removePassword(UniString const & rURI,
+ INetURLObject::EncodeMechanism eEncodeMechanism
+ = INetURLObject::WAS_ENCODED,
+ INetURLObject::DecodeMechanism eDecodeMechanism
+ = INetURLObject::DECODE_TO_IURI,
+ rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8);
+
+//============================================================================
+/** Query the notational conventions used in the file system provided by some
+ file content provider.
+
+ @param rFileUrl This file URL determines which file content provider is
+ used to query the desired information. (The UCB's usual mapping from URLs
+ to content providers is used.)
+
+ @param bAddConvenienceStyles If true, the return value contains not only
+ the style bit corresponding to the queried content provider's conventions,
+ but may also contain additional style bits that make using this function
+ more convenient in certain situations. Currently, the effect is that
+ FSYS_UNX is extended with FSYS_VOS, and both FSYS_DOS and FSYS_MAC are
+ extended with FSYS_VOS and FSYS_UNX (i.e., the---unambiguous---detection
+ of VOS style and Unix style file system paths is always enabled); also, in
+ case the content provider's conventions cannot be determined, FSYS_DETECT
+ is returned instead of FSysStyle(0).
+
+ @return The style bit corresponding to the queried content provider's
+ conventions, or FSysStyle(0) if these cannot be determined.
+ */
+INetURLObject::FSysStyle queryFSysStyle(UniString const & rFileUrl,
+ bool bAddConvenienceStyles = true)
+ throw (com::sun::star::uno::RuntimeException);
+
+}
+
+#endif // SVTOOLS_URIHELPER_HXX
diff --git a/svtools/inc/urlbmk.hxx b/svtools/inc/urlbmk.hxx
new file mode 100644
index 000000000000..b01a662e5728
--- /dev/null
+++ b/svtools/inc/urlbmk.hxx
@@ -0,0 +1,133 @@
+/*************************************************************************
+ *
+ * $RCSfile: urlbmk.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _URLBMK_HXX
+#define _URLBMK_HXX
+
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+class SvData;
+class SotDataObject;
+
+//=========================================================================
+
+class INetBookmark
+
+/* [Beschreibung]
+
+ Diese Klasse stellt ein Bookmark dar, welches aus einer URL und
+ einem dazuge"horigen Beschreibungstext besteht.
+
+ Es gibt ein eigenes Clipboardformat und Hilfsmethoden zum Kopieren
+ und Einf"ugen in und aus Clipboard und DragServer.
+*/
+
+{
+ String aUrl;
+ String aDescr;
+
+protected:
+ String CopyExchange() const;
+ void PasteExchange( String aString );
+
+ void SetURL( const String& rS ) { aUrl = rS; }
+ void SetDescription( const String& rS ) { aDescr = rS; }
+
+public:
+ INetBookmark( const String &rUrl, const String &rDescr )
+ : aUrl( rUrl ), aDescr( rDescr )
+ {}
+ INetBookmark()
+ {}
+
+ const String& GetURL() const { return aUrl; }
+ const String& GetDescription() const { return aDescr; }
+
+ static BOOL ClipboardHasFormat();
+ static BOOL DragServerHasFormat( USHORT nItem );
+
+ BOOL CopyClipboard() const;
+ BOOL CopyDragServer() const;
+ BOOL PasteClipboard();
+ BOOL PasteDragServer( USHORT nItem );
+
+ BOOL SetData( SvData& rData ) const;
+ static ULONG HasFormat( const SotDataObject& rObj );
+ BOOL Copy( SotDataObject& rObj ) const;
+ BOOL Paste( SotDataObject& rObj, ULONG nFormat );
+
+ BOOL _SetData( SvData& rData ) const
+ { return INetBookmark::SetData( rData ); }
+ static ULONG _HasFormat( const SotDataObject& rObj )
+ { return INetBookmark::HasFormat( rObj ); }
+ BOOL _Copy( SotDataObject& rObj ) const
+ { return INetBookmark::Copy( rObj ); }
+ BOOL _Paste( SotDataObject& rObj, ULONG nFormat )
+ { return INetBookmark::Paste( rObj, nFormat ); }
+
+};
+
+
+#endif
+
diff --git a/svtools/inc/wallitem.hxx b/svtools/inc/wallitem.hxx
new file mode 100644
index 000000000000..63e36b946cae
--- /dev/null
+++ b/svtools/inc/wallitem.hxx
@@ -0,0 +1,230 @@
+/*************************************************************************
+ *
+ * $RCSfile: wallitem.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _WALLITEM_HXX
+#define _WALLITEM_HXX
+
+#ifndef SHL_HXX
+#include <tools/shl.hxx>
+#endif
+
+// -----------------------------------------------------------------------------------------
+// Hilfsklasse, um die Download-Funktionalitaet des SvxBrushItems unterhalb
+// des SVX zu benutzen. Der Link wird im Konstruktor von SvxDialogDll gesetzt.
+#ifndef _SFX_BRUSHITEMLINK_DECLARED
+#define _SFX_BRUSHITEMLINK_DECLARED
+#ifndef _SV_GRAPH_HXX
+#include <vcl/graph.hxx>
+#endif
+
+#ifndef SHL_BRUSHITEM
+#define SHL_BRUSHITEM SHL_SHL1
+#endif
+
+class Window;
+class SfxItemSet;
+
+typedef void* (*CreateSvxBrushTabPage)(Window *pParent, const SfxItemSet &rAttrSet);
+typedef USHORT* (*GetSvxBrushTabPageRanges)();
+
+class Graphic;
+class String;
+class SfxBrushItemLink
+{
+public:
+ virtual Graphic GetGraphic( const String& rLink, const String& rFilter) = 0;
+ virtual CreateSvxBrushTabPage GetBackgroundTabpageCreateFunc() = 0;
+ virtual GetSvxBrushTabPageRanges GetBackgroundTabpageRanges() = 0;
+ static SfxBrushItemLink* Get() { return *(SfxBrushItemLink**)GetAppData(SHL_BRUSHITEM); }
+ static void Set( SfxBrushItemLink* pLink );
+};
+#endif // _SFX_BRUSHITEMLINK_DECLARED
+// -----------------------------------------------------------------------------------------
+
+#ifndef _SFX_BRUSHITEMLINK
+
+#ifndef _RTTI_HXX
+#include <tools/rtti.hxx>
+#endif
+#ifndef _SV_WALL_HXX
+#include <vcl/wall.hxx>
+#endif
+
+#include "poolitem.hxx"
+
+class SvStream;
+class Graphic;
+
+DBG_NAMEEX(SfxWallpaperItem);
+
+class SfxWallpaperItem : public SfxPoolItem
+{
+private:
+ Wallpaper _aWallpaper;
+ XubString _aURL;
+ XubString _aFilter;
+ USHORT _nFlags;
+ BOOL IsDownloaded() const;
+ void Download();
+public:
+ TYPEINFO();
+
+ SfxWallpaperItem( USHORT nWhich );
+ SfxWallpaperItem( USHORT nWhich, SvStream& rStream, USHORT nVersion );
+ SfxWallpaperItem( const SfxWallpaperItem& rCpy );
+ SfxWallpaperItem( USHORT nWhich, const Wallpaper& );
+ ~SfxWallpaperItem();
+
+ virtual int operator==( const SfxPoolItem& ) const;
+ virtual SfxPoolItem* Create( SvStream&, USHORT nItemVersion ) const;
+ virtual SvStream& Store( SvStream&, USHORT nItemVersion ) const;
+ virtual SfxPoolItem* Clone( SfxItemPool* pPool = 0 ) const;
+
+ virtual BOOL QueryValue( com::sun::star::uno::Any& rVal,
+ BYTE nMemberId = 0 ) const;
+ virtual BOOL PutValue ( const com::sun::star::uno::Any& rVal,
+ BYTE nMemberId = 0 );
+
+ void SetBitmapURL( const XubString& rURL, const XubString& rFilter );
+ void SetGraphic( const Graphic& rGraphic, BOOL bKeepLink=FALSE );
+ void SetColor( const Color& rColor ) { _aWallpaper.SetColor(rColor); }
+ void SetStyle( WallpaperStyle eStyle ) { _aWallpaper.SetStyle(eStyle); }
+
+ const Wallpaper& GetWallpaper( BOOL bNeedsBitmap = TRUE ) const;
+ const XubString& GetBitmapURL() const { return _aURL; }
+ const XubString& GetBitmapFilter() const { return _aFilter; }
+};
+
+class WallpaperLoader_Impl;
+class CntWallpaperItem;
+
+class WallpaperLoader : public SvRefBase
+{
+ WallpaperLoader_Impl *pImp;
+
+public:
+
+ WallpaperLoader( const CntWallpaperItem& rItem);
+ ~WallpaperLoader();
+
+ void RequestData( const Link& rLink );
+ const Wallpaper& GetWallpaper() const;
+ void Done();
+ void SetBitmap( SvStream* pStream );
+};
+
+SV_DECL_REF( WallpaperLoader );
+SV_IMPL_REF( WallpaperLoader );
+
+#endif // _SFX_BRUSHITEM_LINK
+
+
+////////////////////////////////////////////////////////////////////////////////
+/*
+ $Log: not supported by cvs2svn $
+ Revision 1.15 2000/09/18 14:13:18 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.14 2000/08/31 13:41:16 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.13 2000/03/22 11:47:48 kso
+ Removed: SmartUno leftovers.
+
+ Revision 1.12 2000/03/21 11:39:32 kso
+ Added: [Put|QueryValue( ... com::sun::star::uno::Any ... )
+
+ Revision 1.11 2000/02/09 16:16:37 hr
+ #70473# changes for unicode ( patched by automated patchtool )
+
+ Revision 1.10 1999/08/19 14:23:00 dv
+ no include cntwall.hxx needed
+
+ Revision 1.9 1999/08/18 23:33:43 hjs
+ includes
+
+ Revision 1.8 1999/08/18 09:17:45 dv
+ #66082# The WallpaperLoader is now constructed with a CntWallpaperItem
+
+ Revision 1.7 1999/06/25 09:02:25 dv
+ #63380# WallpaperLoader neu
+
+ Revision 1.6 1999/06/15 12:29:07 hjs
+ once again...
+
+ Revision 1.4 1998/08/13 15:17:28 DV
+ #52764# Put/Query Value neu
+
+ Rev 1.3 13 Aug 1998 17:17:28 DV
+ #52764# Put/Query Value neu
+
+ Rev 1.2 03 Jul 1998 09:42:08 OV
+ Impl.
+
+ Rev 1.1 01 Jul 1998 09:28:02 OV
+ Erweiterungen, Umstellungen
+
+ Rev 1.0 30 Jun 1998 10:50:56 OV
+ Neu: SfxWallpaperItem
+
+*/
+
+#endif // _WALLITEM_HXX
+
diff --git a/svtools/inc/whiter.hxx b/svtools/inc/whiter.hxx
new file mode 100644
index 000000000000..342a0e2fe0ee
--- /dev/null
+++ b/svtools/inc/whiter.hxx
@@ -0,0 +1,91 @@
+/*************************************************************************
+ *
+ * $RCSfile: whiter.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_WHITER_HXX
+#define _SFX_WHITER_HXX
+
+#include <limits.h>
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+class SfxItemSet;
+
+
+// INCLUDE ---------------------------------------------------------------
+
+class SfxWhichIter
+{
+ const USHORT *pRanges, *pStart;
+ USHORT nOfst, nFrom, nTo;
+public:
+ SfxWhichIter( const SfxItemSet& rSet, USHORT nFrom = 0, USHORT nTo = USHRT_MAX );
+ ~SfxWhichIter();
+
+ USHORT GetCurWhich() const { return *pRanges + nOfst; }
+ USHORT NextWhich();
+ USHORT PrevWhich();
+
+ USHORT FirstWhich();
+ USHORT LastWhich();
+};
+
+#endif
diff --git a/svtools/inc/whmap.hxx b/svtools/inc/whmap.hxx
new file mode 100644
index 000000000000..c15f6b86112e
--- /dev/null
+++ b/svtools/inc/whmap.hxx
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: whmap.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SFX_WHMAP_HXX
+#define _SFX_WHMAP_HXX
+
+#include <solar.h>
+
+struct SfxWhichMapEntry
+{
+ USHORT nWhichId;
+ USHORT nSlotId;
+};
+
+class SfxWhichMap
+{
+ const SfxWhichMapEntry *pMap;
+
+public:
+ inline SfxWhichMap( const SfxWhichMapEntry *pMappings = 0 );
+ virtual ~SfxWhichMap();
+
+ int IsNull() const
+ { return 0 == pMap; }
+ virtual USHORT GetWhich(USHORT nSlot) const;
+ virtual USHORT GetSlot(USHORT nWhich) const;
+ virtual SfxWhichMap*Clone() const;
+};
+
+inline SfxWhichMap::SfxWhichMap( const SfxWhichMapEntry *pMappings ):
+ pMap( pMappings )
+{
+}
+
+#endif
diff --git a/svtools/inc/xbmread.hxx b/svtools/inc/xbmread.hxx
new file mode 100644
index 000000000000..e501d7e9e180
--- /dev/null
+++ b/svtools/inc/xbmread.hxx
@@ -0,0 +1,181 @@
+/*************************************************************************
+ *
+ * $RCSfile: xbmread.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _XBMREAD_HXX
+#define _XBMREAD_HXX
+
+#ifdef VCL
+
+#ifndef _GRAPH_HXX
+#include <vcl/graph.hxx>
+#endif
+#ifndef _BMPACC_HXX
+#include <vcl/bmpacc.hxx>
+#endif
+
+#else // VCL
+
+#ifndef _GEN_HXX
+#include <tools/gen.hxx>
+#endif
+#ifndef _FLTDEFS_HXX
+#include "fltdefs.hxx"
+#endif
+
+#endif // VCL
+
+#ifdef _XBMPRIVATE
+
+// ---------
+// - Enums -
+// ---------
+
+enum XBMFormat
+{
+ XBM10,
+ XBM11
+};
+
+enum ReadState
+{
+ XBMREAD_OK,
+ XBMREAD_ERROR,
+ XBMREAD_NEED_MORE
+};
+
+// -------------
+// - XBMReader -
+// -------------
+
+#ifdef VCL
+
+class XBMReader : public GraphicReader
+{
+ SvStream& rIStm;
+ Bitmap aBmp1;
+ BitmapWriteAccess* pAcc1;
+ short* pHexTable;
+ BitmapColor aWhite;
+ BitmapColor aBlack;
+ long nLastPos;
+ long nWidth;
+ long nHeight;
+ BOOL bStatus;
+
+ void InitTable();
+ ByteString FindTokenLine( SvStream* pInStm, const char* pTok1,
+ const char* pTok2 = NULL, const char* pTok3 = NULL );
+ long ParseDefine( const sal_Char* pDefine );
+ BOOL ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat );
+
+
+public:
+
+ XBMReader( SvStream& rStm, void* pCallData );
+ virtual ~XBMReader();
+
+ ReadState ReadXBM( Graphic& rGraphic );
+};
+
+#else // VCL
+
+class XBMReader : public GraphicReader
+{
+ SvStream& rIStm;
+ PDIBBYTE pMonoDIB;
+ PDIBBYTE pMonoDIBBytes;
+ PDIBBYTE pRow1;
+ PDIBBYTE pMonoFile;
+ short pHexTable[ 256 ];
+ long nLastPos;
+ long nWidth;
+ long nHeight;
+ long nWidthAl1;
+ long nMonoTotal;
+ BOOL bStatus;
+
+ void InitTable();
+ void CreateMonoDIB( long nWidth, long nHeight );
+ void CreateGraphic( Graphic& rGraphic );
+ String FindTokenLine( SvStream* pInStm, const char* pTok1,
+ const char* pTok2 = NULL, const char* pTok3 = NULL );
+ long ParseDefine( const char* pDefine );
+ BOOL ParseData( SvStream* pInStm, const String& aLastLine, XBMFormat eFormat );
+
+
+public:
+
+ XBMReader( SvStream& rStm, void* pCallData );
+ virtual ~XBMReader();
+
+ ReadState ReadXBM( Graphic& rGraphic );
+};
+
+#endif // VCL
+#endif // _XBMPRIVATE
+
+// -------------
+// - ImportXBM -
+// -------------
+
+BOOL ImportXBM( SvStream& rStream, Graphic& rGraphic, void* pCallerData );
+
+#endif // _XBMREAD_HXX
diff --git a/svtools/inc/xmlcnimp.hxx b/svtools/inc/xmlcnimp.hxx
new file mode 100644
index 000000000000..073845bed911
--- /dev/null
+++ b/svtools/inc/xmlcnimp.hxx
@@ -0,0 +1,179 @@
+/*************************************************************************
+ *
+ * $RCSfile: xmlcnimp.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_XMLCNIMP_HXX
+#define _SVTOOLS_XMLCNIMP_HXX
+
+#ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
+#include <com/sun/star/container/XNameAccess.hpp>
+#endif
+
+#ifndef _SVARRAY_HXX
+#include "svarray.hxx"
+#endif
+
+#ifndef _SVTOOLS_NMSPMAP_HXX
+#include <xmloff/nmspmap.hxx>
+#endif
+
+namespace rtl { class OUString; }
+
+typedef ::rtl::OUString *OUStringPtr;
+SV_DECL_PTRARR_DEL( OUStringsDtor2_Impl, OUStringPtr, 5, 5 )
+
+class SvXMLAttrContainerItem_Impl
+{
+ SvXMLNamespaceMap aNamespaceMap;
+ SvUShorts aPrefixPoss;
+ OUStringsDtor2_Impl aLNames;
+ OUStringsDtor2_Impl aValues;
+
+ inline sal_uInt16 GetPrefixPos( sal_uInt16 i ) const;
+public:
+
+ SvXMLAttrContainerItem_Impl( const SvXMLAttrContainerItem_Impl& rImpl );
+ SvXMLAttrContainerItem_Impl();
+
+ int operator ==( const SvXMLAttrContainerItem_Impl& rCmp ) const;
+
+ BOOL AddAttr( const ::rtl::OUString& rLName, const NAMESPACE_RTL(OUString)& rValue );
+ BOOL AddAttr( const ::rtl::OUString& rPrefix, const NAMESPACE_RTL(OUString)& rNamespace,
+ const ::rtl::OUString& rLName, const NAMESPACE_RTL(OUString)& rValue );
+ BOOL AddAttr( const ::rtl::OUString& rPrefix,
+ const ::rtl::OUString& rLName,
+ const ::rtl::OUString& rValue );
+
+ sal_uInt16 GetAttrCount() const { return aLNames.Count(); }
+ inline ::rtl::OUString GetAttrNamespace( sal_uInt16 i ) const;
+ inline ::rtl::OUString GetAttrPrefix( sal_uInt16 i ) const;
+ inline const ::rtl::OUString& GetAttrLName( sal_uInt16 i ) const;
+ inline const ::rtl::OUString& GetAttrValue( sal_uInt16 i ) const;
+
+ sal_uInt16 GetFirstNamespaceIndex() const { return aNamespaceMap.GetFirstIndex(); }
+ sal_uInt16 GetNextNamespaceIndex( sal_uInt16 nIdx ) const { return aNamespaceMap.GetNextIndex( nIdx ); }
+ inline const ::rtl::OUString& GetNamespace( sal_uInt16 i ) const;
+ inline const ::rtl::OUString& GetPrefix( sal_uInt16 i ) const;
+
+ BOOL SetAt( sal_uInt16 i,
+ const ::rtl::OUString& rLName, const NAMESPACE_RTL(OUString)& rValue );
+ BOOL SetAt( sal_uInt16 i,
+ const ::rtl::OUString& rPrefix, const NAMESPACE_RTL(OUString)& rNamespace,
+ const ::rtl::OUString& rLName, const NAMESPACE_RTL(OUString)& rValue );
+ BOOL SetAt( sal_uInt16 i,
+ const ::rtl::OUString& rPrefix,
+ const ::rtl::OUString& rLName,
+ const ::rtl::OUString& rValue );
+
+ void Remove( sal_uInt16 i );
+};
+
+inline sal_uInt16 SvXMLAttrContainerItem_Impl::GetPrefixPos( sal_uInt16 i ) const
+{
+// DBG_ASSERT( i >= 0 && i < aPrefixPoss.Count(),
+// "SvXMLAttrContainerItem_Impl::GetPrefixPos: illegal index" );
+ return aPrefixPoss[i];
+}
+
+inline ::rtl::OUString SvXMLAttrContainerItem_Impl::GetAttrNamespace( sal_uInt16 i ) const
+{
+ ::rtl::OUString sRet;
+ sal_uInt16 nPos = GetPrefixPos( i );
+ if( USHRT_MAX != nPos )
+ sRet = aNamespaceMap.GetNameByIndex( nPos );
+ return sRet;
+}
+
+inline ::rtl::OUString SvXMLAttrContainerItem_Impl::GetAttrPrefix( sal_uInt16 i ) const
+{
+ ::rtl::OUString sRet;
+ sal_uInt16 nPos = GetPrefixPos( i );
+ if( USHRT_MAX != nPos )
+ sRet = aNamespaceMap.GetPrefixByIndex( nPos );
+ return sRet;
+}
+
+inline const ::rtl::OUString& SvXMLAttrContainerItem_Impl::GetAttrLName(sal_uInt16 i) const
+{
+ DBG_ASSERT( i >= 0 && i < aLNames.Count(),
+ "SvXMLAttrContainerItem_Impl::GetLName: illegal index" );
+ return *aLNames[i];
+}
+
+inline const ::rtl::OUString& SvXMLAttrContainerItem_Impl::GetAttrValue(sal_uInt16 i) const
+{
+ DBG_ASSERT( i >= 0 && i < aValues.Count(),
+ "SvXMLAttrContainerItem_Impl::GetValue: illegal index" );
+ return *aValues[i];
+}
+
+inline const ::rtl::OUString& SvXMLAttrContainerItem_Impl::GetNamespace(
+ sal_uInt16 i ) const
+{
+ return aNamespaceMap.GetNameByIndex( i );
+}
+
+inline const ::rtl::OUString& SvXMLAttrContainerItem_Impl::GetPrefix( sal_uInt16 i ) const
+{
+ return aNamespaceMap.GetPrefixByIndex( i );
+}
+
+#endif
+
diff --git a/svtools/inc/xmlement.hxx b/svtools/inc/xmlement.hxx
new file mode 100644
index 000000000000..bdbd19f4ed28
--- /dev/null
+++ b/svtools/inc/xmlement.hxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * $RCSfile: xmlement.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_XMLEMENT_HXX
+#define _SVTOOLS_XMLEMENT_HXX
+
+#ifndef _SAL_TYPES_H
+#include <sal/types.h>
+#endif
+
+struct SvXMLEnumMapEntry
+{
+ const sal_Char *pName;
+ sal_uInt16 nValue;
+};
+
+
+#endif // _SVTOOLS_XMLEMENT_HXX
+
diff --git a/svtools/inc/xpmread.hxx b/svtools/inc/xpmread.hxx
new file mode 100644
index 000000000000..e54fc13414b1
--- /dev/null
+++ b/svtools/inc/xpmread.hxx
@@ -0,0 +1,165 @@
+/*************************************************************************
+ *
+ * $RCSfile: xpmread.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _XPMREAD_HXX
+#define _XPMREAD_HXX
+
+#ifndef _BITMAP_HXX
+#include <vcl/bitmap.hxx>
+#endif
+
+#ifdef _XPMPRIVATE
+
+#define XPMTEMPBUFSIZE 0x00008000
+#define XPMSTRINGBUF 0x00008000
+
+#define XPMIDENTIFIER 0x00000001 // mnIdentifier includes on of the six phases
+#define XPMDEFINITION 0x00000002 // the XPM format consists of
+#define XPMVALUES 0x00000003
+#define XPMCOLORS 0x00000004
+#define XPMPIXELS 0x00000005
+#define XPMEXTENSIONS 0x00000006
+#define XPMENDEXT 0x00000007
+
+
+#define XPMREMARK 0x00000001 // defines used by mnStatus
+#define XPMDOUBLE 0x00000002
+#define XPMSTRING 0x00000004
+#define XPMFINISHED 0x00000008
+
+#define XPMCASESENSITIVE 0x00000001
+#define XPMCASENONSENSITIVE 0x00000002
+
+// ---------
+// - Enums -
+// ---------
+
+enum ReadState
+{
+ XPMREAD_OK,
+ XPMREAD_ERROR,
+ XPMREAD_NEED_MORE
+};
+
+// -------------
+// - XPMReader -
+// -------------
+
+class BitmapWriteAccess;
+class Graphic;
+
+class XPMReader : public GraphicReader
+{
+private:
+
+ SvStream& mrIStm;
+ Bitmap maBmp;
+ BitmapWriteAccess* mpAcc;
+ Bitmap maMaskBmp;
+ BitmapWriteAccess* mpMaskAcc;
+ long mnLastPos;
+
+ ULONG mnWidth;
+ ULONG mnHeight;
+ ULONG mnColors;
+ ULONG mnCpp; // characters per pix
+ BOOL mbTransparent;
+ BOOL mbStatus;
+ ULONG mnStatus;
+ ULONG mnIdentifier;
+ BYTE mcThisByte;
+ BYTE mcLastByte;
+ ULONG mnTempAvail;
+ BYTE* mpTempBuf;
+ BYTE* mpTempPtr;
+ BYTE* mpFastColorTable;
+ BYTE* mpColMap;
+ ULONG mnStringSize;
+ BYTE* mpStringBuf;
+ ULONG mnParaSize;
+ BYTE* mpPara;
+
+ BOOL ImplGetString( void );
+ BOOL ImplGetColor( ULONG );
+ BOOL ImplGetScanLine( ULONG );
+ BOOL ImplGetColSub( BYTE* );
+ BOOL ImplGetColKey( BYTE );
+ void ImplGetRGBHex( BYTE*, ULONG );
+ BOOL ImplGetPara( ULONG numb );
+ BOOL ImplCompare( BYTE*, BYTE*, ULONG, ULONG nmode = XPMCASENONSENSITIVE );
+ ULONG ImplGetULONG( ULONG nPara );
+
+public:
+ XPMReader( SvStream& rStm, void* pCallData );
+ virtual ~XPMReader();
+
+ ReadState ReadXPM( Graphic& rGraphic );
+};
+
+#endif // _XPMPRIVATE
+
+// -------------
+// - ImportXPM -
+// -------------
+
+BOOL ImportXPM( SvStream& rStream, Graphic& rGraphic, void* pCallerData );
+
+#endif // _XPMREAD_HXX
diff --git a/svtools/inc/zforfind.hxx b/svtools/inc/zforfind.hxx
new file mode 100644
index 000000000000..60f9c590b6b3
--- /dev/null
+++ b/svtools/inc/zforfind.hxx
@@ -0,0 +1,261 @@
+/*************************************************************************
+ *
+ * $RCSfile: zforfind.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:54 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _ZFORFIND_HXX
+#define _ZFORFIND_HXX
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+class International;
+class Date;
+class SvNumberformat;
+class SvNumberFormatter;
+
+// passiert in "string.hxx":
+//
+// #ifdef ENABLEUNICODE /* bei Unicode */
+// #define XubString UniString /* Wide-Strings */
+// #define xub_Unicode sal_Unicode /* Wide-Character */
+// #else /* sonst */
+// #define XubString String /* normale Strings */
+// #define xub_Unicode char /* normaler char */
+// #endif
+
+#define SV_MAX_ANZ_INPUT_STRINGS 20 // max. Anzahl der Sub-Strings
+
+class ImpSvNumberInputScan
+{
+public: // ---- oeffentlicher Teil
+ ImpSvNumberInputScan( SvNumberFormatter* pFormatter );
+ ~ImpSvNumberInputScan();
+
+/*!*/ void ChangeIntl(); // MUST be called if language changes
+
+ void ChangeNullDate( // Referenzdatum setzen
+ const USHORT nDay,
+ const USHORT nMonth,
+ const USHORT nYear );
+
+ BOOL IsNumberFormat( // Eingabe in Zahl umwandeln
+ const XubString& rString, // Eingabestring
+ short& F_Type, // Typus, Format (in + out)
+ double& fOutNumber, // ermittelter Wert
+ const SvNumberformat* pFormat = NULL ); // evtl. gesetztes Zahlenformat
+
+ // nach IsNumberFormat:
+ short GetDecPos() const { return nDecPos; }
+ USHORT GetAnzNums() const { return nAnzNums; }
+ void SetYear2000( USHORT nVal ) { nYear2000 = nVal; }
+ USHORT GetYear2000() const { return nYear2000; }
+
+private: // ---- privater Teil
+ SvNumberFormatter* pFormatter;
+ XubString aUpperMonthText[12]; // Die 12 Monate
+ XubString aUpperAbbrevMonthText[12]; // Die 12 Monate, abgekuerzt
+ XubString aUpperDayText[7]; // Die 7 Wochentage
+ XubString aUpperAbbrevDayText[7]; // Die 7 Wochentage, abgekuerzt
+ XubString aUpperCurrSymbol; // Das Waehrungssymbol
+ BOOL bTextInitialized; // Sind Monate und Wochentage initialisert?
+ Date* pNullDate; // "1.1.1900"
+ // Variablen für Zwischenergebnisse:
+ XubString sStrArray[SV_MAX_ANZ_INPUT_STRINGS]; // Array der Zahl- oder Str.-Symbole
+ BOOL IsNum[SV_MAX_ANZ_INPUT_STRINGS]; // Markiert die Zahl-Symb.
+ USHORT nNums[SV_MAX_ANZ_INPUT_STRINGS]; // Die Zahlen in Reihenfolge
+ USHORT nAnzStrings; // Gesamtzahl der Symbole
+ USHORT nAnzNums; // Anzahl der Zahlensymbole
+ BOOL bDecSepInDateSeps; // True <=> DecSep in {.,-,/,DateSep}
+
+ short nSign; // Vorzeichen der Zahl
+ short nMonth; // Monat(1..12), falls Datum
+ // negativ => Kurzformat
+ short nMonthPos; // 1 = vorn, 2 = Mitte
+ // 3 = hinten
+ USHORT nTimePos; // Index of first time separator (+1)
+ short nDecPos; // Index des Strings mit ", " (+1)
+ short nNegCheck; // '( )' fuer negativ
+ short nESign; // Vorzeichen Exp
+ short nAmPm; // +1 AM, -1 PM, sonst 0
+ short nLogical; // -1 => False, 1 => True
+ USHORT nThousand; // Anz. der Tausenderpkte.
+ USHORT nPosThousandString; // Position des zusammenge-
+ // fassten 000.000.000-Strings
+ short eScannedType; // Typ gemaess Scan
+ short eSetType; // Typ gemaess Zelle
+
+ USHORT nStringScanNumFor; // fixe Strings erkannt in
+ // pFormat->NumFor[nNumForStringScan]
+ short nStringScanSign; // Vorzeichen durch FixString
+ USHORT nYear2000; // Bis zu welcher Zahl zweistellige
+ // Jahresangaben als 20xx erkannt
+ // werden, default 18
+ // Zahl <= nYear2000 => 20xx
+ // Zahl > nYear2000 => 19xx
+
+#ifdef _ZFORFIND_CXX // ----- private Methoden -----
+ void Reset(); // Reset aller Variablen vor Analysestart
+
+ void InitText(); // Monate und Wochentage initialisieren
+
+ double StringToDouble( // String in double umwandlen
+ const XubString& rStr );
+
+ BOOL NextNumberStringSymbol( // Naechstes Zahl/String Symbol
+ const xub_Unicode*& pStr,
+ XubString& rSymbol );
+
+ BOOL SkipThousands( // Fasst .000.123 Bloecke in
+ const xub_Unicode*& pStr, // der Eingabe zusammen 000123
+ XubString& rSymbol );
+ void NumberStringDivision( // Zerlegen in Zahlen/Strings in obige Arrays und Var.
+ const XubString& rString ); // Leerzeichen am Anfang und hinter Zahlen fallen weg!
+
+ static BOOL StringContains( // if rString contains rWhat at nPos
+ const XubString& rWhat,
+ const XubString& rString,
+ xub_StrLen nPos );
+ static inline BOOL SkipChar( // spezielles Zeichen ueberspringen
+ xub_Unicode c,
+ const XubString& rString,
+ xub_StrLen& nPos );
+ static inline void SkipBlanks( // ueberspringe Leerzeichen
+ const XubString& rString,
+ xub_StrLen& nPos );
+ static inline BOOL SkipString( // jump over rWhat in rString at nPos
+ const XubString& rWhat,
+ const XubString& rString,
+ xub_StrLen& nPos );
+
+ inline BOOL GetThousandSep( // erkennt genau .111 als Tausenderpunkt
+ const XubString& rString,
+ xub_StrLen& nPos,
+ USHORT nStringPos );
+ short GetLogical( // logischen Wert holen
+ const XubString& rString );
+ short GetMonth( // Monat holen
+ const XubString& rString,
+ xub_StrLen& nPos );
+ short GetDayOfWeek( // Wochentag holen
+ const XubString& rString,
+ xub_StrLen& nPos );
+ BOOL GetCurrency( // Waehrungssysmbol holen
+ const XubString& rString,
+ xub_StrLen& nPos,
+ const SvNumberformat* pFormat = NULL ); // evtl. gesetztes Zahlenformat
+ BOOL GetTimeAmPm( // Symbol Am od. Pm holen
+ const XubString& rString,
+ xub_StrLen& nPos );
+ inline BOOL GetDecSep( // Dezimaltrenner holen
+ const XubString& rString,
+ xub_StrLen& nPos );
+ short GetSign( // Vorzeichen holen
+ const XubString& rString, // mit Sonderfall '('
+ xub_StrLen& nPos );
+ short GetESign( // Vorzeichen holen
+ const XubString& rString, // f. Exponent
+ xub_StrLen& nPos );
+
+ inline BOOL GetNextNumber( // Naechste Zahl holen
+ USHORT& i,
+ USHORT& j );
+ void GetTimeRef( // Umwandlung Zeit -> double (nur Nachkomma)
+ double& fOutNumber, // Ergebniss als double
+ USHORT nIndex, // Index der Stunde in der Eingabe,
+ USHORT nAnz ); // Anz der Zeitstrings in der Eingabe
+ USHORT ImplGetDay ( USHORT nIndex ); // Tag: Eingabe od. aktuell
+ USHORT ImplGetMonth( USHORT nIndex ); // Monat: Eingabe od. aktuell
+ USHORT ImplGetYear ( USHORT nIndex ); // Jahr: nix: aktuell, xx=19xx
+ BOOL GetDateRef( // Umwandlung Datum -> Date
+ Date& aDt,
+ USHORT& nCounter, // zaehlt Datumsstrings
+ const SvNumberformat* pFormat = NULL ); // evtl. gesetztes Zahlenformat
+
+ BOOL ScanStartString( // Analyse des Anfangs
+ const XubString& rString,
+ const SvNumberformat* pFormat = NULL );
+ BOOL ScanMidString( // Analyse der Mitte
+ const XubString& rString,
+ USHORT nStringPos );
+ BOOL ScanEndString( // Analyse des Endes
+ const XubString& rString,
+ const SvNumberformat* pFormat = NULL );
+
+ BOOL ScanStringNumFor(
+ const XubString& rString,
+ xub_StrLen nPos,
+ const SvNumberformat* pFormat,
+ USHORT nString );
+ // String mit TeilString nString aus Format vergleichen,
+ // nString == 0xFFFF => letzter
+
+ BOOL IsNumberFormatMain( // Verteilfunktion zur Analyse
+ const XubString& rString,
+ double& fOutNumber, // Rueckgabewert, falls als Zahl darstellbar
+ const SvNumberformat* pFormat = NULL ); // evtl. gesetztes Zahlenformat
+
+
+#endif // _ZFORFIND_CXX
+};
+
+
+
+#endif // _ZFORFIND_HXX
diff --git a/svtools/prj/d.lst b/svtools/prj/d.lst
new file mode 100644
index 000000000000..60887b49439b
--- /dev/null
+++ b/svtools/prj/d.lst
@@ -0,0 +1,267 @@
+mkdir: %_DEST%\inc%_EXT%\svtools
+
+..\%__SRC%\srs\ehdl.srs %_DEST%\res%_EXT%\svtools.srs
+..\%__SRC%\lib\_notify.lib %_DEST%\lib%_EXT%\_notify.lib
+..\%__SRC%\lib\_libcall.lib %_DEST%\lib%_EXT%\_libcall.lib
+..\%__SRC%\lib\_ctrl.lib %_DEST%\lib%_EXT%\_ctrl.lib
+..\%__SRC%\lib\ctrl.lib %_DEST%\lib%_EXT%\ctrl.lib
+..\%__SRC%\lib\isvl.lib %_DEST%\lib%_EXT%\isvl.lib
+..\%__SRC%\lib\undo.lib %_DEST%\lib%_EXT%\undo.lib
+..\%__SRC%\lib\misc.lib %_DEST%\lib%_EXT%\misc.lib
+..\%__SRC%\lib\dialogs.lib %_DEST%\lib%_EXT%\dialogs.lib
+..\%__SRC%\lib\edit.lib %_DEST%\lib%_EXT%\edit.lib
+..\%__SRC%\lib\eaimp.lib %_DEST%\lib%_EXT%\eaimp.lib
+..\%__SRC%\lib\svcontnr.lib %_DEST%\lib%_EXT%\svcontnr.lib
+..\%__SRC%\lib\svmem.lib %_DEST%\lib%_EXT%\svmem.lib
+..\%__SRC%\lib\ssvmem.lib %_DEST%\lib%_EXT%\ssvmem.lib
+..\%__SRC%\lib\svdde.lib %_DEST%\lib%_EXT%\svdde.lib
+..\%__SRC%\lib\svtool.lib %_DEST%\lib%_EXT%\svtool.lib
+..\%__SRC%\slb\svt.lib %_DEST%\lib%_EXT%\xsvtool.lib
+..\%__SRC%\obj\wordsel2.obj %_DEST%\lib%_EXT%\xword2.obj
+..\%__SRC%\lib\filearch.lib %_DEST%\lib%_EXT%\filearch.lib
+..\%__SRC%\bin\dllver.exe %_DEST%\bin%_EXT%\dllver.exe
+..\%__SRC%\bin\dllver %_DEST%\bin%_EXT%\dllver
+..\%__SRC%\bin\svt%UPD%*.dll %_DEST%\bin%_EXT%\svt%UPD%*.dll
+..\%__SRC%\bin\svt%UPD%*.res %_DEST%\bin%_EXT%\svt%UPD%*.res
+..\%__SRC%\bin\svs%UPD%*.res %_DEST%\bin%_EXT%\svs%UPD%*.res
+..\%__SRC%\bin\bmp%UPD%*.res %_DEST%\bin%_EXT%\bmp%UPD%*.res
+..\%__SRC%\bin\san%UPD%*.res %_DEST%\bin%_EXT%\san%UPD%*.res
+..\%__SRC%\bin\svt%UPD%*.sym %_DEST%\bin%_EXT%\svt%UPD%*.sym
+..\%__SRC%\bin\svl%UPD%*.dll %_DEST%\bin%_EXT%\svl%UPD%*.dll
+..\%__SRC%\bin\bmp.* %_DEST%\bin%_EXT%\bmp.*
+..\%__SRC%\bin\bmp %_DEST%\bin%_EXT%\bmp
+..\%__SRC%\res\bmp.* %_DEST%\bin%_EXT%\bmp.*
+..\%__SRC%\misc\svt%UPD%*.map %_DEST%\bin%_EXT%\svt%UPD%*.map
+..\%__SRC%\lib\libsvt%UPD%* %_DEST%\lib%_EXT%\*
+..\%__SRC%\lib\libsvl%UPD%* %_DEST%\lib%_EXT%\*
+..\%__SRC%\misc\svtools.hid %_DEST%\bin%_EXT%\svtools.hid
+..\%__SRC%\inc\svtools\proped.hxx %_DEST%\inc%_EXT%\svtools\proped.hxx
+
+hedabu: ..\inc\testtool.hxx %_DEST%\inc%_EXT%\svtools\testtool.hxx
+hedabu: ..\inc\flbytes.hxx %_DEST%\inc%_EXT%\svtools\flbytes.hxx
+hedabu: ..\inc\args.hxx %_DEST%\inc%_EXT%\svtools\args.hxx
+hedabu: ..\inc\agprop.hxx %_DEST%\inc%_EXT%\svtools\agprop.hxx
+hedabu: ..\inc\aeitem.hxx %_DEST%\inc%_EXT%\svtools\aeitem.hxx
+hedabu: ..\inc\adrparse.hxx %_DEST%\inc%_EXT%\svtools\adrparse.hxx
+hedabu: ..\inc\brdcst.hxx %_DEST%\inc%_EXT%\svtools\brdcst.hxx
+hedabu: ..\inc\brooker.hxx %_DEST%\inc%_EXT%\svtools\brooker.hxx
+hedabu: ..\inc\brwbox.hxx %_DEST%\inc%_EXT%\svtools\brwbox.hxx
+hedabu: ..\inc\calendar.hxx %_DEST%\inc%_EXT%\svtools\calendar.hxx
+hedabu: ..\inc\cancel.hxx %_DEST%\inc%_EXT%\svtools\cancel.hxx
+hedabu: ..\inc\cntnrsrt.hxx %_DEST%\inc%_EXT%\svtools\cntnrsrt.hxx
+hedabu: ..\inc\colrdlg.hxx %_DEST%\inc%_EXT%\svtools\colrdlg.hxx
+hedabu: ..\inc\colctrl.hxx %_DEST%\inc%_EXT%\svtools\colctrl.hxx
+hedabu: ..\inc\compat.hxx %_DEST%\inc%_EXT%\svtools\compat.hxx
+hedabu: ..\inc\ctrlbox.hxx %_DEST%\inc%_EXT%\svtools\ctrlbox.hxx
+hedabu: ..\inc\ctrltool.hxx %_DEST%\inc%_EXT%\svtools\ctrltool.hxx
+hedabu: ..\inc\config.hxx %_DEST%\inc%_EXT%\svtools\config.hxx
+hedabu: ..\inc\confitem.hxx %_DEST%\inc%_EXT%\svtools\confitem.hxx
+hedabu: ..\inc\cntwids.hrc %_DEST%\inc%_EXT%\svtools\cntwids.hrc
+hedabu: ..\inc\dateitem.hxx %_DEST%\inc%_EXT%\svtools\dateitem.hxx
+hedabu: ..\inc\dtritem.hxx %_DEST%\inc%_EXT%\svtools\dtritem.hxx
+hedabu: ..\inc\frqitem.hxx %_DEST%\inc%_EXT%\svtools\frqitem.hxx
+hedabu: ..\inc\cstitem.hxx %_DEST%\inc%_EXT%\svtools\cstitem.hxx
+hedabu: ..\inc\tfrmitem.hxx %_DEST%\inc%_EXT%\svtools\tfrmitem.hxx
+hedabu: ..\inc\cntcmpmn.hxx %_DEST%\inc%_EXT%\svtools\cntcmpmn.hxx
+hedabu: ..\inc\cntwall.hxx %_DEST%\inc%_EXT%\svtools\cntwall.hxx
+hedabu: ..\inc\itemdel.hxx %_DEST%\inc%_EXT%\svtools\itemdel.hxx
+hedabu: ..\inc\wallitem.hxx %_DEST%\inc%_EXT%\svtools\wallitem.hxx
+hedabu: ..\inc\sfontitm.hxx %_DEST%\inc%_EXT%\svtools\sfontitm.hxx
+hedabu: ..\inc\bintitem.hxx %_DEST%\inc%_EXT%\svtools\bintitem.hxx
+hedabu: ..\source\misc\demo.hxx %_DEST%\inc%_EXT%\svtools\demo.hxx
+hedabu: ..\inc\pver.hxx %_DEST%\inc%_EXT%\svtools\pver.hxx
+hedabu: ..\inc\eitem.hxx %_DEST%\inc%_EXT%\svtools\eitem.hxx
+hedabu: ..\inc\filedlg.hxx %_DEST%\inc%_EXT%\svtools\filedlg.hxx
+hedabu: ..\inc\filerec.hxx %_DEST%\inc%_EXT%\svtools\filerec.hxx
+hedabu: ..\inc\flagitem.hxx %_DEST%\inc%_EXT%\svtools\flagitem.hxx
+hedabu: ..\inc\fltcall.hxx %_DEST%\inc%_EXT%\svtools\fltcall.hxx
+hedabu: ..\inc\wmf.hxx %_DEST%\inc%_EXT%\svtools\wmf.hxx
+hedabu: ..\inc\fltdefs.hxx %_DEST%\inc%_EXT%\svtools\fltdefs.hxx
+hedabu: ..\inc\filter.hxx %_DEST%\inc%_EXT%\svtools\filter.hxx
+hedabu: ..\inc\fmtfield.hxx %_DEST%\inc%_EXT%\svtools\fmtfield.hxx
+hedabu: ..\inc\fontdlg.hxx %_DEST%\inc%_EXT%\svtools\fontdlg.hxx
+hedabu: ..\inc\hint.hxx %_DEST%\inc%_EXT%\svtools\hint.hxx
+hedabu: ..\inc\inetdef.hxx %_DEST%\inc%_EXT%\svtools\inetdef.hxx
+hedabu: ..\inc\inethist.hxx %_DEST%\inc%_EXT%\svtools\inethist.hxx
+hedabu: ..\inc\inetmsg.hxx %_DEST%\inc%_EXT%\svtools\inetmsg.hxx
+hedabu: ..\inc\inetstrm.hxx %_DEST%\inc%_EXT%\svtools\inetstrm.hxx
+hedabu: ..\inc\inidef.hxx %_DEST%\inc%_EXT%\svtools\inidef.hxx
+hedabu: ..\inc\iniman.hxx %_DEST%\inc%_EXT%\svtools\iniman.hxx
+hedabu: ..\inc\iniadrtk.hxx %_DEST%\inc%_EXT%\svtools\iniadrtk.hxx
+hedabu: ..\inc\iniprop.hxx %_DEST%\inc%_EXT%\svtools\iniprop.hxx
+hedabu: ..\inc\intitem.hxx %_DEST%\inc%_EXT%\svtools\intitem.hxx
+hedabu: ..\inc\isethint.hxx %_DEST%\inc%_EXT%\svtools\isethint.hxx
+hedabu: ..\inc\itemiter.hxx %_DEST%\inc%_EXT%\svtools\itemiter.hxx
+hedabu: ..\inc\itempool.hxx %_DEST%\inc%_EXT%\svtools\itempool.hxx
+hedabu: ..\inc\itemset.hxx %_DEST%\inc%_EXT%\svtools\itemset.hxx
+hedabu: ..\inc\lckbitem.hxx %_DEST%\inc%_EXT%\svtools\lckbitem.hxx
+hedabu: ..\inc\libcall.hxx %_DEST%\inc%_EXT%\svtools\libcall.hxx
+hedabu: ..\inc\lstner.hxx %_DEST%\inc%_EXT%\svtools\lstner.hxx
+hedabu: ..\inc\macitem.hxx %_DEST%\inc%_EXT%\svtools\macitem.hxx
+hedabu: ..\inc\memberid.hrc %_DEST%\inc%_EXT%\svtools\memberid.hrc
+hedabu: ..\inc\nranges.hxx %_DEST%\inc%_EXT%\svtools\nranges.hxx
+hedabu: ..\inc\ownlist.hxx %_DEST%\inc%_EXT%\svtools\ownlist.hxx
+hedabu: ..\inc\prgsbar.hxx %_DEST%\inc%_EXT%\svtools\prgsbar.hxx
+hedabu: ..\inc\prnsetup.hxx %_DEST%\inc%_EXT%\svtools\prnsetup.hxx
+hedabu: ..\inc\poolcach.hxx %_DEST%\inc%_EXT%\svtools\poolcach.hxx
+hedabu: ..\inc\poolitem.hxx %_DEST%\inc%_EXT%\svtools\poolitem.hxx
+hedabu: ..\inc\printer.hxx %_DEST%\inc%_EXT%\svtools\printer.hxx
+hedabu: ..\inc\printdlg.hxx %_DEST%\inc%_EXT%\svtools\printdlg.hxx
+hedabu: ..\inc\ptitem.hxx %_DEST%\inc%_EXT%\svtools\ptitem.hxx
+hedabu: ..\inc\szitem.hxx %_DEST%\inc%_EXT%\svtools\szitem.hxx
+hedabu: ..\inc\rectitem.hxx %_DEST%\inc%_EXT%\svtools\rectitem.hxx
+hedabu: ..\inc\rngitem.hxx %_DEST%\inc%_EXT%\svtools\rngitem.hxx
+hedabu: ..\inc\ruler.hxx %_DEST%\inc%_EXT%\svtools\ruler.hxx
+hedabu: ..\inc\scrwin.hxx %_DEST%\inc%_EXT%\svtools\scrwin.hxx
+hedabu: ..\inc\slstitm.hxx %_DEST%\inc%_EXT%\svtools\slstitm.hxx
+hedabu: ..\inc\smplhint.hxx %_DEST%\inc%_EXT%\svtools\smplhint.hxx
+hedabu: ..\inc\cnclhint.hxx %_DEST%\inc%_EXT%\svtools\cnclhint.hxx
+hedabu: ..\inc\inettype.hxx %_DEST%\inc%_EXT%\svtools\inettype.hxx
+hedabu: ..\inc\brwhead.hxx %_DEST%\inc%_EXT%\svtools\brwhead.hxx
+hedabu: ..\inc\solar.hrc %_DEST%\inc%_EXT%\svtools\solar.hrc
+hedabu: ..\inc\stdctrl.hxx %_DEST%\inc%_EXT%\svtools\stdctrl.hxx
+hedabu: ..\inc\stritem.hxx %_DEST%\inc%_EXT%\svtools\stritem.hxx
+hedabu: ..\inc\style.hrc %_DEST%\inc%_EXT%\svtools\style.hrc
+hedabu: ..\inc\style.hxx %_DEST%\inc%_EXT%\svtools\style.hxx
+hedabu: ..\inc\svarray.hxx %_DEST%\inc%_EXT%\svtools\svarray.hxx
+hedabu: ..\inc\svdde.hxx %_DEST%\inc%_EXT%\svtools\svdde.hxx
+hedabu: ..\inc\svtdata.hxx %_DEST%\inc%_EXT%\svtools\svtdata.hxx
+hedabu: ..\inc\tabbar.hxx %_DEST%\inc%_EXT%\svtools\tabbar.hxx
+hedabu: ..\inc\taskbar.hxx %_DEST%\inc%_EXT%\svtools\taskbar.hxx
+hedabu: ..\inc\undo.hxx %_DEST%\inc%_EXT%\svtools\undo.hxx
+hedabu: ..\inc\whiter.hxx %_DEST%\inc%_EXT%\svtools\whiter.hxx
+hedabu: ..\inc\valueset.hxx %_DEST%\inc%_EXT%\svtools\valueset.hxx
+hedabu: ..\inc\stdmenu.hxx %_DEST%\inc%_EXT%\svtools\stdmenu.hxx
+hedabu: ..\inc\headbar.hxx %_DEST%\inc%_EXT%\svtools\headbar.hxx
+hedabu: ..\inc\svicnvw.hxx %_DEST%\inc%_EXT%\svtools\svicnvw.hxx
+hedabu: ..\inc\svlbitm.hxx %_DEST%\inc%_EXT%\svtools\svlbitm.hxx
+hedabu: ..\inc\svlbox.hxx %_DEST%\inc%_EXT%\svtools\svlbox.hxx
+hedabu: ..\inc\svtabbx.hxx %_DEST%\inc%_EXT%\svtools\svtabbx.hxx
+hedabu: ..\inc\svtreebx.hxx %_DEST%\inc%_EXT%\svtools\svtreebx.hxx
+hedabu: ..\inc\treelist.hxx %_DEST%\inc%_EXT%\svtools\treelist.hxx
+hedabu: ..\inc\xtextedt.hxx %_DEST%\inc%_EXT%\svtools\xtextedt.hxx
+hedabu: ..\inc\texteng.hxx %_DEST%\inc%_EXT%\svtools\texteng.hxx
+hedabu: ..\inc\textview.hxx %_DEST%\inc%_EXT%\svtools\textview.hxx
+hedabu: ..\inc\textdata.hxx %_DEST%\inc%_EXT%\svtools\textdata.hxx
+hedabu: ..\inc\txtattr.hxx %_DEST%\inc%_EXT%\svtools\txtattr.hxx
+hedabu: ..\inc\sychconv.hxx %_DEST%\inc%_EXT%\svtools\sychconv.hxx
+hedabu: ..\inc\rcontrol.hxx %_DEST%\inc%_EXT%\svtools\rcontrol.hxx
+hedabu: ..\inc\communi.hxx %_DEST%\inc%_EXT%\svtools\communi.hxx
+hedabu: ..\inc\ttprops.hxx %_DEST%\inc%_EXT%\svtools\ttprops.hxx
+hedabu: ..\inc\ttglobal.hrc %_DEST%\inc%_EXT%\svtools\ttglobal.hrc
+hedabu: ..\inc\svtmsg.hrc %_DEST%\inc%_EXT%\svtools\svtmsg.hrc
+hedabu: ..\source\memtools\hashtab.hxx %_DEST%\inc%_EXT%\svtools\hashtab.hxx
+hedabu: ..\source\memtools\hashcont.hxx %_DEST%\inc%_EXT%\svtools\hashcont.hxx
+hedabu: ..\inc\sbx.hxx %_DEST%\inc%_EXT%\svtools\sbx.hxx
+hedabu: ..\source\sbx\sbxbase.hxx %_DEST%\inc%_EXT%\svtools\sbxbase.hxx
+hedabu: ..\inc\sbxcore.hxx %_DEST%\inc%_EXT%\svtools\sbxcore.hxx
+hedabu: ..\inc\sbxdef.hxx %_DEST%\inc%_EXT%\svtools\sbxdef.hxx
+hedabu: ..\source\sbx\sbxfac.hxx %_DEST%\inc%_EXT%\svtools\sbxfac.hxx
+hedabu: ..\inc\sbxform.hxx %_DEST%\inc%_EXT%\svtools\sbxform.hxx
+hedabu: ..\inc\sbxmeth.hxx %_DEST%\inc%_EXT%\svtools\sbxmeth.hxx
+hedabu: ..\source\sbx\sbxmstrm.hxx %_DEST%\inc%_EXT%\svtools\sbxmstrm.hxx
+hedabu: ..\inc\sbxobj.hxx %_DEST%\inc%_EXT%\svtools\sbxobj.hxx
+hedabu: ..\inc\sbxprop.hxx %_DEST%\inc%_EXT%\svtools\sbxprop.hxx
+hedabu: ..\inc\sbxvar.hxx %_DEST%\inc%_EXT%\svtools\sbxvar.hxx
+hedabu: ..\source\search\levdis.hxx %_DEST%\inc%_EXT%\svtools\levdis.hxx
+hedabu: ..\source\search\wordsel.hxx %_DEST%\inc%_EXT%\svtools\wordsel.hxx
+hedabu: ..\inc\txtcmp.hxx %_DEST%\inc%_EXT%\svtools\txtcmp.hxx
+hedabu: ..\inc\urlbmk.hxx %_DEST%\inc%_EXT%\svtools\urlbmk.hxx
+hedabu: ..\source\urlobj\inetimg.hxx %_DEST%\inc%_EXT%\svtools\inetimg.hxx
+hedabu: ..\inc\svmedit.hxx %_DEST%\inc%_EXT%\svtools\svmedit.hxx
+hedabu: ..\inc\svstdarr.hxx %_DEST%\inc%_EXT%\svtools\svstdarr.hxx
+hedabu: ..\inc\extattr.hxx %_DEST%\inc%_EXT%\svtools\extattr.hxx
+hedabu: ..\inc\metitem.hxx %_DEST%\inc%_EXT%\svtools\metitem.hxx
+hedabu: ..\inc\nfversi.hxx %_DEST%\inc%_EXT%\svtools\nfversi.hxx
+hedabu: ..\inc\wizdlg.hxx %_DEST%\inc%_EXT%\svtools\wizdlg.hxx
+hedabu: ..\inc\zforlist.hxx %_DEST%\inc%_EXT%\svtools\zforlist.hxx
+hedabu: ..\inc\zformat.hxx %_DEST%\inc%_EXT%\svtools\zformat.hxx
+hedabu: ..\inc\numuno.hxx %_DEST%\inc%_EXT%\svtools\numuno.hxx
+hedabu: ..\source\misc\filearch.hxx %_DEST%\inc%_EXT%\svtools\filearch.hxx
+hedabu: ..\inc\loginerr.hxx %_DEST%\inc%_EXT%\svtools\loginerr.hxx
+hedabu: ..\inc\httpcook.hxx %_DEST%\inc%_EXT%\svtools\httpcook.hxx
+hedabu: ..\source\misc\demo.hxx %_DEST%\inc%_EXT%\svtools\svtdemo.hxx
+hedabu: ..\source\uno\unoiface.hxx %_DEST%\inc%_EXT%\svtools\unoiface.hxx
+hedabu: ..\source\uno\imgprod.hxx %_DEST%\inc%_EXT%\svtools\imgprod.hxx
+hedabu: ..\inc\itemprop.hxx %_DEST%\inc%_EXT%\svtools\itemprop.hxx
+hedabu: ..\inc\itempro3.hxx %_DEST%\inc%_EXT%\svtools\itempro3.hxx
+hedabu: ..\inc\strcrypt.hxx %_DEST%\inc%_EXT%\svtools\strcrypt.hxx
+
+hedabu: ..\inc\imap.hxx %_DEST%\inc%_EXT%\svtools\imap.hxx
+hedabu: ..\inc\imapobj.hxx %_DEST%\inc%_EXT%\svtools\imapobj.hxx
+hedabu: ..\inc\imaprect.hxx %_DEST%\inc%_EXT%\svtools\imaprect.hxx
+hedabu: ..\inc\imapcirc.hxx %_DEST%\inc%_EXT%\svtools\imapcirc.hxx
+hedabu: ..\inc\imappoly.hxx %_DEST%\inc%_EXT%\svtools\imappoly.hxx
+hedabu: ..\inc\svtuiks.hxx %_DEST%\inc%_EXT%\svtools\svtuiks.hxx
+
+hedabu: ..\inc\parhtml.hxx %_DEST%\inc%_EXT%\svtools\parhtml.hxx
+hedabu: ..\inc\htmltokn.h %_DEST%\inc%_EXT%\svtools\htmltokn.h
+hedabu: ..\inc\htmlkywd.hxx %_DEST%\inc%_EXT%\svtools\htmlkywd.hxx
+hedabu: ..\inc\svparser.hxx %_DEST%\inc%_EXT%\svtools\svparser.hxx
+hedabu: ..\source\svhtml\htmlout.hxx %_DEST%\inc%_EXT%\svtools\htmlout.hxx
+hedabu: ..\source\svrtf\rtfout.hxx %_DEST%\inc%_EXT%\svtools\rtfout.hxx
+hedabu: ..\source\svrtf\parrtf.hxx %_DEST%\inc%_EXT%\svtools\parrtf.hxx
+hedabu: ..\source\svrtf\rtftoken.h %_DEST%\inc%_EXT%\svtools\rtftoken.h
+hedabu: ..\source\svrtf\rtfkeywd.hxx %_DEST%\inc%_EXT%\svtools\rtfkeywd.hxx
+
+hedabu: ..\source\svxml\xmlerror.h %_DEST%\inc%_EXT%\svtools\xmlerror.h
+hedabu: ..\source\svxml\xmlattr.hxx %_DEST%\inc%_EXT%\svtools\xmlattr.hxx
+hedabu: ..\source\svxml\domdoc.hxx %_DEST%\inc%_EXT%\svtools\domdoc.hxx
+
+hedabu: ..\inc\ctypeitm.hxx %_DEST%\inc%_EXT%\svtools\ctypeitm.hxx
+hedabu: ..\inc\groupset.hxx %_DEST%\inc%_EXT%\svtools\groupset.hxx
+
+hedabu: ..\inc\fmtfield.hxx %_DEST%\inc%_EXT%\svtools\fmtfield.hxx
+hedabu: ..\inc\svtoxstr.hxx %_DEST%\inc%_EXT%\svtools\svtoxstr.hxx
+hedabu: ..\inc\strmadpt.hxx %_DEST%\inc%_EXT%\svtools\strmadpt.hxx
+hedabu: ..\inc\instrm.hxx %_DEST%\inc%_EXT%\svtools\instrm.hxx
+hedabu: ..\inc\outstrm.hxx %_DEST%\inc%_EXT%\svtools\outstrm.hxx
+
+hedabu: ..\inc\section.hxx %_DEST%\inc%_EXT%\svtools\section.hxx
+hedabu: ..\inc\sectctr.hxx %_DEST%\inc%_EXT%\svtools\sectctr.hxx
+hedabu: ..\inc\privsplt.hxx %_DEST%\inc%_EXT%\svtools\privsplt.hxx
+hedabu: ..\inc\expander.hxx %_DEST%\inc%_EXT%\svtools\expander.hxx
+hedabu: ..\source\svsql\sdbsql.hxx %_DEST%\inc%_EXT%\svtools\sdbsql.hxx
+hedabu: ..\source\svsql\sdbyacc.hxx %_DEST%\inc%_EXT%\svtools\sdbyacc.hxx
+hedabu: ..\source\svsql\sdbparse.hxx %_DEST%\inc%_EXT%\svtools\sdbparse.hxx
+hedabu: ..\%__SRC%\inc\svtools\sdbbison.hxx %_DEST%\inc%_EXT%\svtools\sdbbison.hxx
+hedabu: ..\source\svsql\converter.hxx %_DEST%\inc%_EXT%\svtools\converter.hxx
+hedabu: ..\source\cmdparse\cmdparse.hxx %_DEST%\inc%_EXT%\svtools\cmdparse.hxx
+
+
+hedabu: ..\inc\filectrl.hxx %_DEST%\inc%_EXT%\svtools\filectrl.hxx
+hedabu: ..\inc\cenumitm.hxx %_DEST%\inc%_EXT%\svtools\cenumitm.hxx
+hedabu: ..\inc\cintitem.hxx %_DEST%\inc%_EXT%\svtools\cintitem.hxx
+hedabu: ..\inc\custritm.hxx %_DEST%\inc%_EXT%\svtools\custritm.hxx
+
+hedabu: ..\inc\sfxecode.hxx %_DEST%\inc%_EXT%\svtools\sfxecode.hxx
+hedabu: ..\inc\ehdl.hxx %_DEST%\inc%_EXT%\svtools\ehdl.hxx
+hedabu: ..\inc\svtools.hrc %_DEST%\inc%_EXT%\svtools\svtools.hrc
+
+hedabu: ..\source\xmlfilt\attrlist.hxx %_DEST%\inc%_EXT%\svtools\attrlist.hxx
+hedabu: ..\source\xmlfilt\i18nmap.hxx %_DEST%\inc%_EXT%\svtools\i18nmap.hxx
+hedabu: ..\inc\nmspmap.hxx %_DEST%\inc%_EXT%\svtools\nmspmap.hxx
+hedabu: ..\source\xmlfilt\xmltkmap.hxx %_DEST%\inc%_EXT%\svtools\xmltkmap.hxx
+hedabu: ..\source\xmlfilt\xmlkywd.hxx %_DEST%\inc%_EXT%\svtools\xmlkywd.hxx
+hedabu: ..\source\xmlfilt\xmlexp.hxx %_DEST%\inc%_EXT%\svtools\xmlexp.hxx
+hedabu: ..\source\xmlfilt\xmlehelp.hxx %_DEST%\inc%_EXT%\svtools\xmlehelp.hxx
+hedabu: ..\source\xmlfilt\xmlimp.hxx %_DEST%\inc%_EXT%\svtools\xmlimp.hxx
+hedabu: ..\source\xmlfilt\xmlictxt.hxx %_DEST%\inc%_EXT%\svtools\xmlictxt.hxx
+hedabu: ..\source\xmlfilt\xmlitem.hxx %_DEST%\inc%_EXT%\svtools\xmlitem.hxx
+hedabu: ..\source\xmlfilt\xmlstyle.hxx %_DEST%\inc%_EXT%\svtools\xmlstyle.hxx
+hedabu: ..\source\xmlfilt\xmlastpl.hxx %_DEST%\inc%_EXT%\svtools\xmlastpl.hxx
+hedabu: ..\source\xmlfilt\wstrhelp.hxx %_DEST%\inc%_EXT%\svtools\wstrhelp.hxx
+hedabu: ..\inc\xmluconv.hxx %_DEST%\inc%_EXT%\svtools\xmluconv.hxx
+hedabu: ..\source\xmlfilt\xmlitmpr.hxx %_DEST%\inc%_EXT%\svtools\xmlitmpr.hxx
+hedabu: ..\inc\xmlement.hxx %_DEST%\inc%_EXT%\svtools\xmlement.hxx
+hedabu: ..\source\xmlfilt\xmlnmspe.hxx %_DEST%\inc%_EXT%\svtools\xmlnmspe.hxx
+hedabu: ..\source\xmlfilt\xmlimpit.hxx %_DEST%\inc%_EXT%\svtools\xmlimpit.hxx
+hedabu: ..\source\xmlfilt\xmlexpit.hxx %_DEST%\inc%_EXT%\svtools\xmlexpit.hxx
+hedabu: ..\source\xmlfilt\xmlitmap.hxx %_DEST%\inc%_EXT%\svtools\xmlitmap.hxx
+hedabu: ..\source\xmlfilt\xmlnumfe.hxx %_DEST%\inc%_EXT%\svtools\xmlnumfe.hxx
+hedabu: ..\inc\xmlcnitm.hxx %_DEST%\inc%_EXT%\svtools\xmlcnitm.hxx
+hedabu: ..\inc\tresitem.hxx %_DEST%\inc%_EXT%\svtools\tresitem.hxx
+hedabu: ..\inc\urihelper.hxx %_DEST%\inc%_EXT%\svtools\urihelper.hxx
+hedabu: ..\inc\reginfo.hxx %_DEST%\inc%_EXT%\svtools\reginfo.hxx
+hedabu: ..\inc\pathoptions.hxx %_DEST%\inc%_EXT%\svtools\pathoptions.hxx
+hedabu: ..\inc\useroptions.hxx %_DEST%\inc%_EXT%\svtools\useroptions.hxx
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx
new file mode 100644
index 000000000000..53c90ed1e64a
--- /dev/null
+++ b/svtools/source/brwbox/brwbox1.cxx
@@ -0,0 +1,2396 @@
+/*************************************************************************
+ *
+ * $RCSfile: brwbox1.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <brwbox.hxx>
+#include <tools/debug.hxx>
+#include <tools/stream.hxx>
+#include <vcl/sound.hxx>
+#include "brwhead.hxx"
+#include "datwin.hxx"
+
+#pragma hdrstop
+
+#ifndef _SV_MULTISEL_HXX
+#include <tools/multisel.hxx>
+#endif
+
+DBG_NAME(BrowseBox);
+
+extern const char* BrowseBoxCheckInvariants( const void* pVoid );
+
+DECLARE_LIST( BrowserColumns, BrowserColumn* );
+
+#ifdef VCL
+#define SCROLL_FLAGS (SCROLL_CLIP | SCROLL_NOCHILDREN)
+#else
+#define SCROLL_FLAGS TRUE
+#endif
+
+//-------------------------------------------------------------------
+
+#if DBG_MI
+void DoLog_Impl( const BrowseBox *pThis, const char *pWhat, const char *pWho )
+{
+ SvFileStream aLog( "d:\\cursor.log", STREAM_WRITE|STREAM_NOCREATE );
+ if ( aLog.IsOpen() )
+ {
+ aLog.Seek( STREAM_SEEK_TO_END );
+ String aEntry( (long) pThis );
+ aEntry += "(row=";
+ aEntry += pThis->GetCurRow();
+ aEntry += "): ";
+ aEntry += pWhat;
+ aEntry += " from ";
+ aEntry += pWho;
+ aEntry += " => ";
+ aEntry += pThis->GetCursorHideCount();
+ aLog.WriteLine( aEntry );
+ }
+}
+#endif
+
+//===================================================================
+
+void BrowseBox::Construct( BrowserMode nMode )
+{
+ DBG_TRACE1( "BrowseBox: %p->Construct", this );
+ bMultiSelection = FALSE;
+ pColSel = 0;
+ pDataWin = 0;
+ pVScroll = 0;
+
+ pDataWin = new BrowserDataWin( this );
+ pCols = new BrowserColumns;
+
+ aLineColor = Color( COL_LIGHTGRAY );
+ InitSettings_Impl( this );
+ InitSettings_Impl( pDataWin );
+
+ bBootstrapped = FALSE;
+ bHasBitmapHandle = FALSE;
+ nDataRowHeight = 0;
+ nTitleLines = 1;
+ nFirstCol = 0;
+ nTopRow = 0;
+ nCurRow = BROWSER_ENDOFSELECTION;
+ nCurColId = 0;
+ bResizing = FALSE;
+ bSelect = FALSE;
+ bSelecting = FALSE;
+ bScrolling = FALSE;
+ bSelectionIsVisible = FALSE;
+ bNotToggleSel = FALSE;
+ bDrag = FALSE;
+ bHit = FALSE;
+ bRubber = FALSE;
+ bHideSelect = FALSE;
+ bHideCursor = FALSE;
+ nRowCount = 0;
+ m_bFocusOnlyCursor = TRUE;
+ m_aCursorColor = COL_TRANSPARENT;
+ m_nCurrentMode = 0;
+
+ aHScroll.SetLineSize(1);
+ aHScroll.SetScrollHdl( LINK( this, BrowseBox, ScrollHdl ) );
+ aHScroll.SetEndScrollHdl( LINK( this, BrowseBox, EndScrollHdl ) );
+ pDataWin->Show();
+
+ SetMode( nMode );
+ bSelectionIsVisible = bKeepHighlight;
+ bHasFocus = HasChildPathFocus();
+ ((BrowserDataWin*)pDataWin)->nCursorHidden =
+ ( bHasFocus ? 0 : 1 ) + ( GetUpdateMode() ? 0 : 1 );
+ LOG( this, "Construct", "*" );
+}
+
+//-------------------------------------------------------------------
+
+BrowseBox::BrowseBox( Window* pParent, WinBits nBits, BrowserMode nMode ) :
+ Control( pParent, nBits | WB_3DLOOK ),
+ aHScroll( this, WinBits( WB_HSCROLL ) )
+{
+ DBG_CTOR( BrowseBox, NULL );
+ Construct( nMode );
+}
+
+//-------------------------------------------------------------------
+
+BrowseBox::BrowseBox( Window* pParent, const ResId& rId, BrowserMode nMode ):
+ Control( pParent, rId ),
+ aHScroll( this, WinBits(WB_HSCROLL) )
+{
+ DBG_CTOR( BrowseBox, NULL );
+ Construct(nMode);
+}
+
+//-------------------------------------------------------------------
+
+BrowseBox::~BrowseBox()
+{
+ DBG_DTOR(BrowseBox,BrowseBoxCheckInvariants);
+ DBG_TRACE1( "BrowseBox: %p~", this );
+
+ Hide();
+ delete ((BrowserDataWin*)pDataWin)->pHeaderBar;
+ delete ((BrowserDataWin*)pDataWin)->pCornerWin;
+ delete pDataWin;
+ delete pVScroll;
+
+ // free columns-space
+ for ( USHORT n = 0; n < pCols->Count(); ++n )
+ delete pCols->GetObject(n);
+ delete pCols;
+ delete pColSel;
+ if ( bMultiSelection )
+ delete uRow.pSel;
+}
+
+//-------------------------------------------------------------------
+
+short BrowseBox::GetCursorHideCount() const
+{
+ return ((BrowserDataWin*)pDataWin)->nCursorHidden;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::DoShowCursor( const char *pWhoLogs )
+{
+ short nHiddenCount = --((BrowserDataWin*)pDataWin)->nCursorHidden;
+ if (PaintCursorIfHiddenOnce())
+ {
+ if (1 == nHiddenCount)
+ DrawCursor();
+ }
+ else
+ {
+ if (0 == nHiddenCount)
+ DrawCursor();
+ }
+ LOG( this, "DoShowCursor", pWhoLogs );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::DoHideCursor( const char *pWhoLogs )
+{
+ short nHiddenCount = ++((BrowserDataWin*)pDataWin)->nCursorHidden;
+ if (PaintCursorIfHiddenOnce())
+ {
+ if (2 == nHiddenCount)
+ DrawCursor();
+ }
+ else
+ {
+ if (1 == nHiddenCount)
+ DrawCursor();
+ }
+ LOG( this, "DoHideCursor", pWhoLogs );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetRealRowCount( const String &rRealRowCount )
+{
+ ((BrowserDataWin*)pDataWin)->aRealRowCount = rRealRowCount;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetMapMode( const MapMode& rNewMapMode )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ pDataWin->SetMapMode( rNewMapMode );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetFont( const Font& rNewFont )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ pDataWin->SetFont( rNewFont );
+ ImpGetDataRowHeight();
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::InsertHandleColumn( ULONG nWidth, BOOL bBitmap )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ pCols->Insert( new BrowserColumn( 0, Image(), String(), nWidth, GetZoom(), 0 ), (ULONG) 0 );
+ FreezeColumn( 0 );
+
+ // Headerbar anpassen
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ {
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetPosPixel(
+ Point(nWidth, 0));
+
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetSizePixel(
+ Size( GetOutputSizePixel().Width() - nWidth, GetTitleHeight() ) );
+ }
+
+ /*if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->InsertItem( USHRT_MAX - 1,
+ "", nWidth, HIB_FIXEDPOS|HIB_FIXED, 0 );*/
+ ColumnInserted( 0 );
+ bHasBitmapHandle = bBitmap;
+}
+
+//-------------------------------------------------------------------
+#if SUPD<380
+void BrowseBox::InsertDataColumn( USHORT nItemId, const String &rTitle,
+ ULONG nWidth, BrowserColumnMode nFlags, USHORT nPos )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ pCols->Insert( new BrowserColumn( nItemId, Image(), rTitle, nWidth, GetZoom(), nFlags ),
+ Min( nPos, (USHORT)(pCols->Count()) ) );
+ if ( nCurColId == 0 )
+ nCurColId = nItemId;
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->InsertItem(
+ nItemId, rTitle, nWidth, HIB_STDSTYLE, nPos );
+ ColumnInserted( nPos );
+}
+#else
+//-------------------------------------------------------------------
+
+void BrowseBox::InsertDataColumn( USHORT nItemId, const Image& rImage,
+ long nWidth, HeaderBarItemBits nBits, USHORT nPos )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ pCols->Insert( new BrowserColumn( nItemId, rImage, String(), nWidth, GetZoom(), nBits ),
+ Min( nPos, (USHORT)(pCols->Count()) ) );
+ if ( nCurColId == 0 )
+ nCurColId = nItemId;
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ {
+ // Handlecolumn nicht in der Headerbar
+ USHORT nHeaderPos = nPos;
+ if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
+ nHeaderPos--;
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->InsertItem(
+ nItemId, rImage, nWidth, nBits, nHeaderPos );
+ }
+ ColumnInserted( nPos );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::InsertDataColumn( USHORT nItemId, const XubString& rText,
+ long nWidth, HeaderBarItemBits nBits, USHORT nPos )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ pCols->Insert( new BrowserColumn( nItemId, Image(), rText, nWidth, GetZoom(), nBits ),
+ Min( nPos, (USHORT)(pCols->Count()) ) );
+ if ( nCurColId == 0 )
+ nCurColId = nItemId;
+
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ {
+ // Handlecolumn nicht in der Headerbar
+ USHORT nHeaderPos = nPos;
+ if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
+ nHeaderPos--;
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->InsertItem(
+ nItemId, rText, nWidth, nBits, nHeaderPos );
+ }
+ ColumnInserted( nPos );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::InsertDataColumn( USHORT nItemId,
+ const Image& rImage, const XubString& rText,
+ long nWidth, HeaderBarItemBits nBits, USHORT nPos,
+ const String* pHelpText )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ pCols->Insert( new BrowserColumn( nItemId, rImage, rText, nWidth, GetZoom(), nBits ),
+ Min( nPos, (USHORT)(pCols->Count()) ) );
+ if ( nCurColId == 0 )
+ nCurColId = nItemId;
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ {
+ // Handlecolumn nicht in der Headerbar
+ USHORT nHeaderPos = nPos;
+ if (nHeaderPos != HEADERBAR_APPEND && !GetColumnId(0))
+ nHeaderPos--;
+
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->InsertItem(
+ nItemId, rImage, rText, nWidth, nBits, nHeaderPos );
+ if( pHelpText && !rText.Len() )
+ {
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetHelpText(
+ nItemId, *pHelpText );
+ }
+ }
+ ColumnInserted( nPos );
+}
+#endif
+//-------------------------------------------------------------------
+
+void BrowseBox::FreezeColumn( USHORT nItemId, BOOL bFreeze )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // never unfreeze the handle-column
+ if ( nItemId == 0 && !bFreeze )
+ return;
+
+ // get the position in the current array
+ USHORT nItemPos = GetColumnPos( nItemId );
+ if ( nItemPos >= pCols->Count() )
+ // not available!
+ return;
+
+ // doesn't the state change?
+ if ( pCols->GetObject(nItemPos)->IsFrozen() == bFreeze )
+ return;
+
+ // remark the column selection
+ USHORT nSelectedColId = USHRT_MAX;
+ if ( pColSel && pColSel->GetSelectCount() )
+ {
+ DoHideCursor( "FreezeColumn" );
+ ToggleSelection();
+ nSelectedColId = pCols->GetObject(pColSel->FirstSelected())->GetId();
+ pColSel->SelectAll(FALSE);
+ }
+
+ // freeze or unfreeze?
+ if ( bFreeze )
+ {
+ // to be moved?
+ if ( nItemPos != 0 && !pCols->GetObject(nItemPos-1)->IsFrozen() )
+ {
+ // move to the right of the last frozen column
+ USHORT nFirstScrollable = FrozenColCount();
+ BrowserColumn *pColumn = pCols->GetObject(nItemPos);
+ pCols->Remove( (ULONG) nItemPos );
+ nItemPos = nFirstScrollable;
+ pCols->Insert( pColumn, (ULONG) nItemPos );
+ }
+
+ // adjust the number of the first scrollable and visible column
+ if ( nFirstCol <= nItemPos )
+ nFirstCol = nItemPos + 1;
+ }
+ else
+ {
+ // to be moved?
+ if ( nItemPos != FrozenColCount()-1 )
+ {
+ // move to the leftmost scrollable colum
+ USHORT nFirstScrollable = FrozenColCount();
+ BrowserColumn *pColumn = pCols->GetObject(nItemPos);
+ pCols->Remove( (ULONG) nItemPos );
+ nItemPos = nFirstScrollable;
+ pCols->Insert( pColumn, (ULONG) nItemPos );
+ }
+
+ // adjust the number of the first scrollable and visible column
+ nFirstCol = nItemPos;
+ }
+
+ // toggle the freeze-state of the column
+ pCols->GetObject(nItemPos)->Freeze( bFreeze );
+
+ // align the scrollbar-range
+ UpdateScrollbars();
+
+ // repaint
+ Control::Invalidate();
+ ((BrowserDataWin*)pDataWin)->Invalidate();
+
+ // remember the column selection
+ if ( pColSel && nSelectedColId != USHRT_MAX )
+ {
+ pColSel->Select( GetColumnPos( nSelectedColId ) );
+ ToggleSelection();
+ DBG_TRACE1( "BrowseBox: %p->ShowCursor", this );
+ DoShowCursor( "FreezeColumn" );
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetColumnPos( USHORT nColumnId, USHORT nPos )
+{
+ // never set pos of the handle-column
+ if ( nColumnId == 0 )
+ return;
+
+ // do not move handle column
+ if (nPos == 0 && !pCols->GetObject(0)->GetId())
+ return;
+
+ // get the position in the current array
+ USHORT nOldPos = GetColumnPos( nColumnId );
+ if ( nOldPos >= pCols->Count() )
+ // not available!
+ return;
+
+ // does the state change?
+ BrowserColumn *pCol = pCols->GetObject(nOldPos);
+ if (nOldPos != nPos)
+ {
+ // determine old column area
+ Size aDataWinSize( pDataWin->GetSizePixel() );
+ Rectangle aFromRect( GetFieldRect( nColumnId) );
+
+ // move column internally
+ pCols->Insert( pCols->Remove( nOldPos ), nPos );
+
+ // determine new column area
+ Rectangle aToRect( GetFieldRect( nColumnId ) );
+
+ // do scroll, let redraw
+ Rectangle aForNewArea( Point( aToRect.Left(), 0 ),
+ Size( aDataWinSize.Width() - aToRect.Left(),
+ aDataWinSize.Height() ) );
+ Rectangle aForOldArea( Point( aFromRect.Right(), 0 ),
+ Size( aDataWinSize.Width() - aFromRect.Right(),
+ aDataWinSize.Height() ) );
+
+ if( pDataWin->GetBackground().IsScrollable() )
+ {
+ if ( nOldPos > nPos )
+ pDataWin->Scroll( -aFromRect.GetWidth()-4, 0, aForOldArea );
+ pDataWin->Scroll( aToRect.GetWidth()+4, 0, aForNewArea );
+ if ( nOldPos < nPos )
+ pDataWin->Scroll( -aFromRect.GetWidth()-4, 0, aForOldArea );
+ }
+ else
+ pDataWin->Window::Invalidate( INVALIDATE_NOCHILDREN );
+ }
+
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetColumnMode( USHORT nColumnId, BrowserColumnMode nFlags )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // never set mode of the handle-column
+ if ( nColumnId == 0 )
+ return;
+
+ // get the position in the current array
+ USHORT nColumnPos = GetColumnPos( nColumnId );
+ if ( nColumnPos >= pCols->Count() )
+ // not available!
+ return;
+
+ // does the state change?
+ BrowserColumn *pCol = pCols->GetObject(nColumnPos);
+ if ( pCol->Flags() != nFlags )
+ {
+ pCol->Flags() = nFlags;
+
+ // redraw visible colums
+ if ( GetUpdateMode() && ( pCol->IsFrozen() || nColumnPos > nFirstCol ) )
+ Invalidate( Rectangle( Point(0,0),
+ Size( GetOutputSizePixel().Width(), GetTitleHeight() ) ) );
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetColumnTitle( USHORT nItemId, const String& rTitle )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // never set title of the handle-column
+ if ( nItemId == 0 )
+ return;
+
+ // get the position in the current array
+ USHORT nItemPos = GetColumnPos( nItemId );
+ if ( nItemPos >= pCols->Count() )
+ // not available!
+ return;
+
+ // does the state change?
+ BrowserColumn *pCol = pCols->GetObject(nItemPos);
+ if ( pCol->Title() != rTitle )
+ {
+ pCol->Title() = rTitle;
+
+ // Headerbar-Column anpassen
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetItemText(
+ nItemId ? nItemId : USHRT_MAX - 1, rTitle );
+ else
+ {
+ // redraw visible colums
+ if ( GetUpdateMode() && ( pCol->IsFrozen() || nItemPos > nFirstCol ) )
+ Invalidate( Rectangle( Point(0,0),
+ Size( GetOutputSizePixel().Width(), GetTitleHeight() ) ) );
+ }
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetColumnWidth( USHORT nItemId, ULONG nWidth )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // get the position in the current array
+ USHORT nItemPos = GetColumnPos( nItemId );
+ if ( nItemPos >= pCols->Count() )
+ return;
+
+ // does the state change?
+ nWidth = QueryColumnResize( nItemId, nWidth );
+ if ( nWidth >= LONG_MAX || pCols->GetObject(nItemPos)->Width() != nWidth )
+ {
+ long nOldWidth = pCols->GetObject(nItemPos)->Width();
+
+ // ggf. letzte Spalte anpassen
+ if ( IsVisible() && nItemPos == pCols->Count() - 1 )
+ {
+ long nMaxWidth = pDataWin->GetSizePixel().Width();
+ nMaxWidth -= ((BrowserDataWin*)pDataWin)->bAutoSizeLastCol
+ ? GetFieldRect(nItemId).Left()
+ : GetFrozenWidth();
+ if ( ( (BrowserDataWin*)pDataWin )->bAutoSizeLastCol || nWidth > (ULONG)nMaxWidth )
+ {
+ nWidth = nMaxWidth > 16 ? nMaxWidth : nOldWidth;
+ nWidth = QueryColumnResize( nItemId, nWidth );
+ }
+ }
+
+ // OV
+ // In AutoSizeLastColumn() wird SetColumnWidth mit nWidth==0xffff
+ // gerufen. Deshalb muss hier nochmal geprueft werden, ob sich die
+ // Breite tatsaechlich geaendert hat.
+ if( (ULONG)nOldWidth == nWidth )
+ return;
+
+ // soll die Aenderung sofort dargestellt werden?
+ BOOL bUpdate = GetUpdateMode() &&
+ ( pCols->GetObject(nItemPos)->IsFrozen() || nItemPos >= nFirstCol );
+
+ if ( bUpdate )
+ {
+ // Selection hiden
+ DoHideCursor( "SetColumnWidth" );
+ ToggleSelection();
+ //!((BrowserDataWin*)pDataWin)->Update();
+ //!Control::Update();
+ }
+
+ // Breite setzen
+ pCols->GetObject(nItemPos)->SetWidth(nWidth, GetZoom());
+#if 0
+ if ( nItemPos != pCols->Count() - 1 )
+ {
+ long nLastColMaxWidth = pDataWin->GetSizePixel().Width() -
+ GetFieldRect(GetColumnId(pCols->Count()-1)).Left();
+ pCols->GetObject(pCols->Count()-1)->Width() = nLastColMaxWidth;
+ }
+#endif
+
+ // scroll and invalidate
+ if ( bUpdate )
+ {
+ // X-Pos der veraenderten Spalte ermitteln
+ long nX = 0;
+ for ( USHORT nCol = 0; nCol < nItemPos; ++nCol )
+ {
+ BrowserColumn *pCol = pCols->GetObject(nCol);
+ if ( pCol->IsFrozen() || nCol >= nFirstCol )
+ nX += pCol->Width();
+ }
+
+ // eigentliches scroll+invalidate
+ pDataWin->SetClipRegion();
+ BOOL bSelVis = bSelectionIsVisible;
+ bSelectionIsVisible = FALSE;
+ if( GetBackground().IsScrollable() )
+ {
+
+ Rectangle aScrRect( nX + min( (ULONG)nOldWidth, nWidth ), 0,
+ GetSizePixel().Width() , // the header is longer than the datawin
+ pDataWin->GetPosPixel().Y() - 1 );
+ Control::Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS );
+ aScrRect.Bottom() = pDataWin->GetSizePixel().Height();
+ ((BrowserDataWin*)pDataWin)->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS );
+ Rectangle aInvRect( nX, 0, nX + max( nWidth, (ULONG)nOldWidth ), USHRT_MAX );
+ Control::Invalidate( aInvRect );
+ ( (BrowserDataWin*)pDataWin )->Invalidate( aInvRect );
+ }
+ else
+ {
+ Control::Invalidate( INVALIDATE_NOCHILDREN );
+ ((BrowserDataWin*)pDataWin)->Window::Invalidate( INVALIDATE_NOCHILDREN );
+ }
+
+
+ //!((BrowserDataWin*)pDataWin)->Update();
+ //!Control::Update();
+ bSelectionIsVisible = bSelVis;
+ ToggleSelection();
+ DoShowCursor( "SetColumnWidth" );
+ }
+ UpdateScrollbars();
+
+ // Headerbar-Column anpassen
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetItemSize(
+ nItemId ? nItemId : USHRT_MAX - 1, nWidth );
+
+ // adjust last column
+ if ( nItemPos != pCols->Count() - 1 )
+ AutoSizeLastColumn();
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::AutoSizeLastColumn()
+{
+ if ( ((BrowserDataWin*)pDataWin)->bAutoSizeLastCol &&
+ ((BrowserDataWin*)pDataWin)->GetUpdateMode() )
+ {
+ USHORT nId = GetColumnId( (USHORT)pCols->Count() - 1 );
+ SetColumnWidth( nId, LONG_MAX );
+ ColumnResized( nId );
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::RemoveColumn( USHORT nItemId )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // Spaltenposition ermitteln
+ USHORT nPos = GetColumnPos(nItemId);
+ if ( nPos >= ColCount() )
+ // nicht vorhanden
+ return;
+
+ // Spaltenselektion korrigieren
+ if ( pColSel )
+ pColSel->Remove( nPos );
+
+ // Spaltencursor korrigieren
+ if ( nCurColId == nItemId )
+ nCurColId = 0;
+
+ if ( nFirstCol >= nPos && nFirstCol > 0 )
+ --nFirstCol;
+
+ // Spalte entfernen
+ delete( pCols->Remove( (ULONG) nPos ));
+
+ // Handlecolumn nicht in der Headerbar
+ if (nItemId)
+ {
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->RemoveItem( nItemId );
+ }
+ else
+ {
+ // Headerbar anpassen
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ {
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetPosPixel(
+ Point(0, 0));
+
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetSizePixel(
+ Size( GetOutputSizePixel().Width(), GetTitleHeight() ) );
+ }
+ }
+
+ // vertikalen Scrollbar korrigieren
+ UpdateScrollbars();
+
+ // ggf. Repaint ausl"osen
+ if ( GetUpdateMode() )
+ {
+ ((BrowserDataWin*)pDataWin)->Invalidate();
+ Control::Invalidate();
+ if ( ((BrowserDataWin*)pDataWin)->bAutoSizeLastCol && nPos ==ColCount() )
+ SetColumnWidth( GetColumnId( nPos - 1 ), LONG_MAX );
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::RemoveColumns()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // alle Spalten entfernen
+ while ( pCols->Count() )
+ delete ( pCols->Remove( (ULONG) 0 ));
+
+ // Spaltenselektion korrigieren
+ if ( pColSel )
+ {
+ pColSel->SelectAll(FALSE);
+ pColSel->SetTotalRange( Range( 0, 0 ) );
+ }
+
+ // Spaltencursor korrigieren
+ nCurColId = 0;
+ nFirstCol = 0;
+
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->Clear( );
+
+ // vertikalen Scrollbar korrigieren
+ UpdateScrollbars();
+
+ // ggf. Repaint ausl"osen
+ if ( GetUpdateMode() )
+ {
+ ((BrowserDataWin*)pDataWin)->Invalidate();
+ Control::Invalidate();
+ }
+}
+
+//-------------------------------------------------------------------
+
+String BrowseBox::GetColumnTitle( USHORT nId ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ USHORT nItemPos = GetColumnPos( nId );
+ if ( nItemPos >= pCols->Count() )
+ return String();
+ return pCols->GetObject(nItemPos)->Title();
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::GetRowCount() const
+{
+ return nRowCount;
+}
+
+//-------------------------------------------------------------------
+
+USHORT BrowseBox::ColCount() const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return (USHORT) pCols->Count();
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::ImpGetDataRowHeight() const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ BrowseBox *pThis = (BrowseBox*)this;
+ pThis->nDataRowHeight = pThis->CalcReverseZoom(pDataWin->GetTextHeight() + 2);
+ pThis->Resize();
+ ((BrowserDataWin*)pDataWin)->Invalidate();
+ return nDataRowHeight;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetDataRowHeight( long nPixel )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ nDataRowHeight = CalcReverseZoom(nPixel);
+ Resize();
+ ((BrowserDataWin*)pDataWin)->Invalidate();
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetTitleLines( USHORT nLines )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ nTitleLines = nLines;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::ToTop()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::ToBottom()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::ScrollColumns( long nCols )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( nFirstCol + nCols < 0 ||
+ nFirstCol + nCols >= (long)pCols->Count() )
+ //?MI: pCols->GetObject( nFirstCol + nCols )->IsFrozen() )
+ return 0;
+
+ // implicitly hides cursor while scrolling
+ StartScroll();
+ bScrolling = TRUE;
+ BOOL bScrollable = pDataWin->GetBackground().IsScrollable();
+ BOOL bInvalidateView = FALSE;
+
+ // eine Spalte nach links scrollen?
+ if ( nCols == 1 )
+ {
+ // update internal value and scrollbar
+ ++nFirstCol;
+ aHScroll.SetThumbPos( nFirstCol - FrozenColCount() );
+
+ long nDelta = pCols->GetObject(nFirstCol-1)->Width();
+ long nFrozenWidth = GetFrozenWidth();
+
+ // scroll the title-line
+ Rectangle aScrollRect(
+ Point( nFrozenWidth + nDelta, 0 ),
+ Size( GetOutputSizePixel().Width() - nFrozenWidth - nDelta,
+ GetTitleHeight() - 1 ) );
+
+ // ggf. Headerbar mitscrollen
+ if ( !((BrowserDataWin*)pDataWin)->pHeaderBar && nTitleLines )
+ {
+ if( bScrollable )
+ Scroll( -nDelta, 0, aScrollRect );
+ else
+ bInvalidateView = TRUE;
+ }
+
+
+ long nSkippedWidth = GetOutputSizePixel().Width() -
+ 2 * aScrollRect.GetWidth() - nFrozenWidth;
+ if ( nSkippedWidth > 0 )
+ {
+ aScrollRect.Right() = aScrollRect.Left()-1;
+ aScrollRect.Left() -= nSkippedWidth;
+ Invalidate( aScrollRect );
+ }
+
+ // scroll the data-area
+ aScrollRect = Rectangle(
+ Point( nFrozenWidth + nDelta, 0 ),
+ Size( pDataWin->GetOutputSizePixel().Width() - nFrozenWidth -
+ nDelta, pDataWin->GetSizePixel().Height() ) );
+ if( bScrollable )
+ pDataWin->Scroll( -nDelta, 0, aScrollRect );
+ else
+ bInvalidateView = TRUE;
+ nSkippedWidth = pDataWin->GetOutputSizePixel().Width() -
+ 2 * aScrollRect.GetWidth() - nFrozenWidth;
+ if ( nSkippedWidth > 0 )
+ {
+ aScrollRect.Right() = aScrollRect.Left()-1;
+ aScrollRect.Left() -= nSkippedWidth;
+ ((BrowserDataWin*)pDataWin)->Invalidate( aScrollRect );
+ }
+ }
+
+ // eine Spalte nach rechts scrollen?
+ else if ( nCols == -1 )
+ {
+ --nFirstCol;
+ aHScroll.SetThumbPos( nFirstCol - FrozenColCount() );
+
+ long nDelta = pCols->GetObject(nFirstCol)->Width();
+ long nFrozenWidth = GetFrozenWidth();
+
+ // ggf. Headerbar mitscrollen
+ if ( !((BrowserDataWin*)pDataWin)->pHeaderBar && nTitleLines )
+ {
+ if( bScrollable )
+ {
+ Scroll( nDelta, 0, Rectangle(
+ Point( nFrozenWidth, 0 ),
+ Size( GetOutputSizePixel().Width() - nFrozenWidth,
+ GetTitleHeight() - 1 ) ) );
+ }
+ else
+ bInvalidateView = TRUE;
+ }
+ if( bScrollable )
+ {
+ pDataWin->Scroll( nDelta, 0, Rectangle(
+ Point( nFrozenWidth, 0 ),
+ Size( pDataWin->GetSizePixel().Width() - nFrozenWidth,
+ pDataWin->GetSizePixel().Height() ) ) );
+ }
+ else
+ bInvalidateView = TRUE;
+
+ }
+ else
+ {
+ if ( GetUpdateMode() )
+ {
+ Invalidate( Rectangle(
+ Point( GetFrozenWidth(), 0 ),
+ Size( GetOutputSizePixel().Width(), GetTitleHeight() ) ) );
+ ((BrowserDataWin*)pDataWin)->Invalidate( Rectangle(
+ Point( GetFrozenWidth(), 0 ),
+ pDataWin->GetSizePixel() ) );
+ }
+
+ nFirstCol += (USHORT)nCols;
+ aHScroll.SetThumbPos( nFirstCol - FrozenColCount() );
+ }
+
+ // ggf. externe Headerbar anpassen
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ {
+ long nWidth = 0;
+ for ( USHORT nCol = 0;
+ nCol < pCols->Count() && nCol < nFirstCol;
+ ++nCol )
+ {
+ // HandleColumn nicht
+ if ( pCols->GetObject(nCol)->GetId() )
+ nWidth += pCols->GetObject(nCol)->Width();
+ }
+
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetOffset( nWidth );
+ }
+
+ if( bInvalidateView )
+ {
+ Control::Invalidate( INVALIDATE_NOCHILDREN );
+ pDataWin->Window::Invalidate( INVALIDATE_NOCHILDREN );
+ }
+
+ // implicitly show cursor after scrolling
+ if ( nCols )
+ {
+ ((BrowserDataWin*)pDataWin)->Update();
+ Update();
+ }
+ bScrolling = FALSE;
+ EndScroll();
+
+ return nCols;
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::ScrollRows( long nRows )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // out of range?
+ if ( ((BrowserDataWin*)pDataWin)->bNoScrollBack && nRows < 0 )
+ return 0;
+
+ // compute new top row
+ long nTmpMin = Min( (long)(nTopRow + nRows), (long)(nRowCount - 1) );
+
+ long nNewTopRow = Max( (long)nTmpMin, (long)0 );
+
+ if ( nNewTopRow == nTopRow )
+ return 0;
+
+ USHORT nVisibleRows =
+ (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+
+ VisibleRowsChanged(nNewTopRow, nVisibleRows);
+
+ // compute new top row again (nTopRow might have changed!)
+ nTmpMin = Min( (long)(nTopRow + nRows), (long)(nRowCount - 1) );
+
+ nNewTopRow = Max( (long)nTmpMin, (long)0 );
+
+ StartScroll();
+
+ // scroll area on screen and/or repaint
+ long nDeltaY = GetDataRowHeight() * ( nNewTopRow - nTopRow );
+ long nOldTopRow = nTopRow;
+ nTopRow = nNewTopRow;
+
+ if ( GetUpdateMode() )
+ {
+ pVScroll->SetRange( Range( 0L, nRowCount ) );
+ pVScroll->SetThumbPos( nTopRow );
+
+ if( pDataWin->GetBackground().IsScrollable() &&
+ Abs( nDeltaY ) > 0 &&
+ Abs( nDeltaY ) < pDataWin->GetSizePixel().Height() )
+ {
+ pDataWin->Scroll( 0, (short)-nDeltaY );
+ }
+ else
+ ((BrowserDataWin*)pDataWin)->Invalidate();
+
+ if ( nTopRow - nOldTopRow )
+ ((BrowserDataWin*)pDataWin)->Update();
+ }
+
+ EndScroll();
+
+ return nTopRow - nOldTopRow;
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::ScrollPages( long nPagesY )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return ScrollRows( pDataWin->GetSizePixel().Height() / GetDataRowHeight() );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::RowModified( long nRow, USHORT nColId )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( !GetUpdateMode() )
+ return;
+
+ Rectangle aRect;
+ if ( nColId == USHRT_MAX )
+ // invalidate the whole row
+ aRect = Rectangle( Point( 0, (nRow-nTopRow) * GetDataRowHeight() ),
+ Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) );
+ else
+ {
+ // invalidate the specific field
+ aRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ }
+ ((BrowserDataWin*)pDataWin)->Invalidate( aRect );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::Clear()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // adjust the total number of rows
+ DoHideCursor( "Clear" );
+ nRowCount = 0;
+ nCurRow = BROWSER_ENDOFSELECTION;
+ nTopRow = 0;
+ nCurColId = 0;
+
+ // nFirstCol darf nicht zurueckgesetzt werden, da ansonsten das Scrollen
+ // total durcheinander kommt
+ // nFirstCol darf nur beim Hinzufuegen oder Loeschen von Spalten geaendert werden
+ // nFirstCol = 0; ->Falsch!!!!
+ aHScroll.SetThumbPos( 0 );
+ pVScroll->SetThumbPos( 0 );
+
+ Invalidate();
+ UpdateScrollbars();
+ SetNoSelection();
+ DoShowCursor( "Clear" );
+ CursorMoved();
+}
+
+//-------------------------------------------------------------------
+#if SUPD > 511
+
+#else
+
+void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint )
+{
+ RowInserted( nRow, nNumRows, bDoPaint, FALSE );
+}
+
+#endif
+
+void BrowseBox::RowInserted( long nRow, long nNumRows, BOOL bDoPaint, BOOL bKeepSelection )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if (nRow < 0)
+ nRow = 0;
+ else if (nRow > nRowCount) // maximal = nRowCount
+ nRow = nRowCount;
+
+ if ( nNumRows <= 0 )
+ return;
+
+#if 0
+ // Zerlegung in einzelne RowInserted-Aufrufe:
+ if (nNumRows > 1)
+ {
+ for (long i = 0; i < nNumRows; i++)
+ RowInserted(nRow + i,1,bDoPaint);
+ return;
+ }
+#endif
+
+ // adjust total row count
+ BOOL bLastRow = nRow >= nRowCount;
+ nRowCount += nNumRows;
+
+ DoHideCursor( "RowInserted" );
+
+ // must we paint the new rows?
+ long nOldCurRow = nCurRow;
+ Size aSz = pDataWin->GetOutputSizePixel();
+ if ( bDoPaint && nRow >= nTopRow &&
+ nRow <= nTopRow + aSz.Height() / GetDataRowHeight() )
+ {
+ long nY = (nRow-nTopRow) * GetDataRowHeight();
+ if ( !bLastRow )
+ {
+ // scroll down the rows behind the new row
+ pDataWin->SetClipRegion();
+ if( pDataWin->GetBackground().IsScrollable() )
+ {
+ pDataWin->Scroll( 0, GetDataRowHeight() * nNumRows,
+ Rectangle( Point( 0, nY ),
+ Size( aSz.Width(), aSz.Height() - nY ) ),
+ SCROLL_CLIP );
+ }
+ else
+ pDataWin->Window::Invalidate( INVALIDATE_NOCHILDREN );
+ }
+ else
+ // scroll would cause a repaint, so we must explicitly invalidate
+ pDataWin->Invalidate( Rectangle( Point( 0, nY ),
+ Size( aSz.Width(), nNumRows * GetDataRowHeight() ) ) );
+ }
+
+ // ggf. Top-Row korrigieren
+ if ( nRow < nTopRow )
+ nTopRow += nNumRows;
+
+ // adjust the selection
+ if ( bMultiSelection )
+ uRow.pSel->Insert( nRow, nNumRows );
+ else if ( uRow.nSel != BROWSER_ENDOFSELECTION && nRow <= uRow.nSel )
+ uRow.nSel += nNumRows;
+
+ // adjust the cursor
+ if ( nCurRow == BROWSER_ENDOFSELECTION )
+ GoToRow( 0, FALSE, bKeepSelection );
+ else if ( nRow <= nCurRow )
+ GoToRow( nCurRow += nNumRows, FALSE, bKeepSelection );
+
+ // adjust the vertical scrollbar
+ if ( bDoPaint )
+ {
+ UpdateScrollbars();
+ AutoSizeLastColumn();
+ }
+
+ DoShowCursor( "RowInserted" );
+ if ( nCurRow != nOldCurRow )
+ CursorMoved();
+
+ DBG_ASSERT(nRowCount > 0,"BrowseBox: nRowCount <= 0");
+ DBG_ASSERT(nCurRow >= 0,"BrowseBox: nCurRow < 0");
+ DBG_ASSERT(nCurRow < nRowCount,"nCurRow >= nRowCount");
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::RowRemoved( long nRow, long nNumRows, BOOL bDoPaint )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( nRow < 0 )
+ nRow = 0;
+ else if ( nRow >= nRowCount )
+ nRow = nRowCount - 1;
+
+ if ( nNumRows <= 0 )
+ return;
+
+ if ( nRowCount <= 0 )
+ return;
+
+ if ( bDoPaint )
+ {
+ // hide cursor and selection
+ DBG_TRACE1( "BrowseBox: %p->HideCursor", this );
+ ToggleSelection();
+ DoHideCursor( "RowRemoved" );
+ }
+
+ // adjust total row count
+ nRowCount -= nNumRows;
+ if (nRowCount < 0) nRowCount = 0;
+ long nOldCurRow = nCurRow;
+
+ // adjust the selection
+ if ( bMultiSelection )
+ // uRow.pSel->Remove( nRow, nNumRows );
+ for ( long i = 0; i < nNumRows; i++ )
+ uRow.pSel->Remove( nRow );
+ else if ( nRow < uRow.nSel && uRow.nSel >= nNumRows )
+ uRow.nSel -= nNumRows;
+ else if ( nRow <= uRow.nSel )
+ uRow.nSel = BROWSER_ENDOFSELECTION;
+
+ // adjust the cursor
+ if ( nRowCount == 0 ) // don't compare nRowCount with nNumRows as nNumRows already was subtracted from nRowCount
+ nCurRow = BROWSER_ENDOFSELECTION;
+ else if ( nRow < nCurRow )
+ {
+ nCurRow -= Min( nCurRow - nRow, nNumRows );
+ // with the above nCurRow points a) to the first row after the removed block or b) to the same line
+ // as before, but moved up nNumRows
+ // case a) needs an additional correction if the last n lines were deleted, as 'the first row after the
+ // removed block' is an invalid position then
+ // FS - 09/28/99 - 68429
+ if (nCurRow == nRowCount)
+ --nCurRow;
+ }
+ else if( nRow == nCurRow && nCurRow == nRowCount )
+ nCurRow = nRowCount-1;
+
+ // is the deleted row visible?
+ Size aSz = pDataWin->GetOutputSizePixel();
+ if ( nRow >= nTopRow &&
+ nRow <= nTopRow + aSz.Height() / GetDataRowHeight() )
+ {
+ if ( bDoPaint )
+ {
+ // scroll up the rows behind the deleted row
+ // if there are Rows behind
+ if (nRow < nRowCount)
+ {
+ long nY = (nRow-nTopRow) * GetDataRowHeight();
+ pDataWin->SetClipRegion();
+ if( pDataWin->GetBackground().IsScrollable() )
+ {
+ pDataWin->Scroll( 0, - (short) GetDataRowHeight() * nNumRows,
+ Rectangle( Point( 0, nY ), Size( aSz.Width(),
+ aSz.Height() - nY + nNumRows*GetDataRowHeight() ) ),
+ SCROLL_CLIP );
+ }
+ else
+ pDataWin->Window::Invalidate( INVALIDATE_NOCHILDREN );
+ }
+ else
+ {
+ // Repaint the Rect of the deleted row
+ Rectangle aRect(
+ Point( 0, (nRow-nTopRow)*GetDataRowHeight() ),
+ Size( pDataWin->GetSizePixel().Width(),
+ nNumRows * GetDataRowHeight() ) );
+ pDataWin->Invalidate( aRect );
+ }
+ }
+ }
+ // is the deleted row above of the visible area?
+ else if ( nRow < nTopRow )
+ nTopRow = nTopRow >= nNumRows ? nTopRow-nNumRows : 0;
+
+ if ( bDoPaint )
+ {
+ // reshow cursor and selection
+ ToggleSelection();
+ DBG_TRACE1( "BrowseBox: %p->ShowCursor", this );
+ DoShowCursor( "RowRemoved" );
+
+ // adjust the vertical scrollbar
+ UpdateScrollbars();
+ AutoSizeLastColumn();
+ }
+
+ if ( nOldCurRow != nCurRow )
+ CursorMoved();
+
+ DBG_ASSERT(nRowCount >= 0,"BrowseBox: nRowCount < 0");
+ DBG_ASSERT(nCurRow >= 0 || nRowCount == 0,"BrowseBox: nCurRow < 0 && nRowCount != 0");
+ DBG_ASSERT(nCurRow < nRowCount,"nCurRow >= nRowCount");
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::GoToRow( long nRow)
+{
+ return GoToRow(nRow, FALSE, FALSE);
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::GoToRowAndDoNotModifySelection( long nRow )
+{
+ return GoToRow( nRow, FALSE, TRUE );
+}
+
+//-------------------------------------------------------------------
+
+#if SUPD > 511
+
+#else
+BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove )
+{
+ return GoToRow( nRow, bRowColMove, FALSE );
+}
+#endif
+
+BOOL BrowseBox::GoToRow( long nRow, BOOL bRowColMove, BOOL bKeepSelection )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ long nOldCurRow = nCurRow;
+
+ // nothing to do?
+ if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) )
+ return TRUE;
+
+ // out of range?
+ if ( nRow < 0 || nRow >= nRowCount )
+ return FALSE;
+
+ // nicht erlaubt?
+ if ( ( !bRowColMove && !IsCursorMoveAllowed( nRow, nCurColId ) ) )
+ return FALSE;
+
+ if ( ((BrowserDataWin*)pDataWin)->bNoScrollBack && nRow < nTopRow )
+ nRow = nTopRow;
+
+ // compute the last visible row
+ Size aSz( pDataWin->GetSizePixel() );
+ USHORT nVisibleRows = USHORT( aSz.Height() ) / GetDataRowHeight() - 1;
+ long nLastRow = nTopRow + nVisibleRows;
+
+ // suspend Updates
+ ((BrowserDataWin*)pDataWin)->EnterUpdateLock();
+
+ // ggf. altes Highlight weg
+ if ( !bMultiSelection && !bKeepSelection )
+ ToggleSelection();
+ DoHideCursor( "GoToRow" );
+
+ // must we scroll?
+ BOOL bWasVisible = bSelectionIsVisible;
+ if (! bMultiSelection)
+ {
+ if( !bKeepSelection )
+ bSelectionIsVisible = FALSE;
+ }
+ if ( nRow < nTopRow )
+ ScrollRows( nRow - nTopRow );
+ else if ( nRow > nLastRow )
+ ScrollRows( nRow - nLastRow );
+ bSelectionIsVisible = bWasVisible;
+
+ // adjust cursor (selection) and thumb
+ if ( GetUpdateMode() )
+ pVScroll->SetThumbPos( nTopRow );
+
+ // relative positioning (because nCurRow might have changed in the meantime)!
+ if (nCurRow != BROWSER_ENDOFSELECTION )
+ nCurRow = nCurRow + (nRow - nOldCurRow);
+
+ // make sure that the current position is valid
+ if (nCurRow == BROWSER_ENDOFSELECTION && nRowCount > 0)
+ nCurRow = 0;
+ else if ( nCurRow >= nRowCount )
+ nCurRow = nRowCount - 1;
+ aSelRange = Range( nCurRow, nCurRow );
+
+ // ggf. neues Highlight anzeigen
+ if ( !bMultiSelection && !bKeepSelection )
+ uRow.nSel = nRow;
+
+ // resume Updates
+ ((BrowserDataWin*)pDataWin)->LeaveUpdateLock();
+
+ // Cursor+Highlight
+ if ( !bMultiSelection && !bKeepSelection)
+ ToggleSelection();
+ DoShowCursor( "GoToRow" );
+ if ( !bRowColMove && nOldCurRow != nCurRow )
+ CursorMoved();
+
+ if ( !bMultiSelection && !bKeepSelection )
+ if ( !bSelecting )
+ Select();
+ else
+ bSelect = TRUE;
+ return TRUE;
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::GoToColumnId( USHORT nColId)
+{
+ return GoToColumnId(nColId,TRUE,FALSE);
+}
+
+
+BOOL BrowseBox::GoToColumnId( USHORT nColId, BOOL bMakeVisible, BOOL bRowColMove)
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if (!bColumnCursor)
+ return FALSE;
+
+ // erlaubt?
+ if (!bRowColMove && !IsCursorMoveAllowed( nCurRow, nColId ) )
+ return FALSE;
+
+ if ( nColId != nCurColId || bMakeVisible && !IsFieldVisible(nCurRow, nColId, TRUE))
+ {
+ DoHideCursor( "GoToColumnId" );
+ nCurColId = nColId;
+
+ USHORT nNewPos = GetColumnPos(nColId);
+ DBG_ASSERT( nNewPos != USHRT_MAX, "unknown column-id" );
+ USHORT nFirstPos = nFirstCol;
+ USHORT nWidth = (USHORT)pCols->GetObject( nNewPos )->Width();
+ USHORT nLastPos = GetColumnAtXPosPixel(
+ pDataWin->GetSizePixel().Width()-nWidth, FALSE );
+ USHORT nFrozen = FrozenColCount();
+ if ( bMakeVisible && nLastPos &&
+ nNewPos >= nFrozen && ( nNewPos < nFirstPos || nNewPos > nLastPos ) )
+ if ( nNewPos < nFirstPos )
+ ScrollColumns( nNewPos-nFirstPos );
+ else if ( nNewPos > nLastPos )
+ ScrollColumns( nNewPos-nLastPos );
+
+ DoShowCursor( "GoToColumnId" );
+ if (!bRowColMove)
+ CursorMoved();
+ return TRUE;
+ }
+ return TRUE;
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::GoToRowColumnId( long nRow, USHORT nColId )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ long nOldCurRow = nCurRow;
+
+ // out of range?
+ if ( nRow < 0 || nRow >= nRowCount )
+ return FALSE;
+
+ if (!bColumnCursor)
+ return FALSE;
+
+ // nothing to do ?
+ if ( nRow == nCurRow && ( bMultiSelection || uRow.nSel == nRow ) &&
+ nColId == nCurColId && IsFieldVisible(nCurRow, nColId, TRUE))
+ return TRUE;
+
+ // erlaubt?
+ if (!IsCursorMoveAllowed(nRow, nColId))
+ return FALSE;
+
+ DoHideCursor( "GoToRowColumnId" );
+ BOOL bMoved = GoToRow(nRow, TRUE) && GoToColumnId(nColId, TRUE, TRUE);
+ DoShowCursor( "GoToRowColumnId" );
+
+ if (bMoved)
+ CursorMoved();
+
+ return bMoved;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetNoSelection()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // is there no selection
+ if ( ( !pColSel || !pColSel->GetSelectCount() ) &&
+ ( ( !bMultiSelection && uRow.nSel == BROWSER_ENDOFSELECTION ) ||
+ ( bMultiSelection && !uRow.pSel->GetSelectCount() ) ) )
+ // nothing to do
+ return;
+
+ DBG_TRACE1( "BrowseBox: %p->HideCursor", this );
+ ToggleSelection();
+
+ // unselect all
+ if ( bMultiSelection )
+ uRow.pSel->SelectAll(FALSE);
+ else
+ uRow.nSel = BROWSER_ENDOFSELECTION;
+ if ( pColSel )
+ pColSel->SelectAll(FALSE);
+ if ( !bSelecting )
+ Select();
+ else
+ bSelect = TRUE;
+
+ // restore screen
+ DBG_TRACE1( "BrowseBox: %p->ShowCursor", this );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetSelection( const MultiSelection &rSel )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ DBG_ASSERT( bMultiSelection, "SetSelection only allowed with Multi-Selection-Mode" );
+
+ // prepare inverted areas
+ DBG_TRACE1( "BrowseBox: %p->HideCursor", this );
+ ToggleSelection();
+
+ // assign Selection
+ *uRow.pSel = rSel;
+
+ // only highlight painted areas
+ pDataWin->Update();
+
+ // notify derived class
+ if ( !bSelecting )
+ Select();
+ else
+ bSelect = TRUE;
+
+ // restore screen
+ ToggleSelection();
+ DBG_TRACE1( "BrowseBox: %p->ShowCursor", this );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SelectAll()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( !bMultiSelection )
+ return;
+
+ DBG_TRACE1( "BrowseBox: %p->HideCursor", this );
+ ToggleSelection();
+
+ // select all rows
+ if ( pColSel )
+ pColSel->SelectAll(FALSE);
+ uRow.pSel->SelectAll(TRUE);
+
+ // Handle-Column nicht highlighten
+ BrowserColumn *pFirstCol = pCols->GetObject(0);
+ long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
+
+ // highlight the row selection
+ if ( !bHideSelect )
+ {
+ Rectangle aHighlightRect;
+ USHORT nVisibleRows =
+ (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+ for ( long nRow = Max( nTopRow, uRow.pSel->FirstSelected() );
+ nRow != BROWSER_ENDOFSELECTION && nRow < nTopRow + nVisibleRows;
+ nRow = uRow.pSel->NextSelected() )
+ aHighlightRect.Union( Rectangle(
+ Point( nOfsX, (nRow-nTopRow)*GetDataRowHeight() ),
+ Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) ) );
+ pDataWin->Invalidate( aHighlightRect );
+ }
+
+ if ( !bSelecting )
+ Select();
+ else
+ bSelect = TRUE;
+
+ // restore screen
+ DBG_TRACE1( "BrowseBox: %p->ShowCursor", this );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SelectRow( long nRow, BOOL bSelect, BOOL bExpand )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( !bMultiSelection )
+ {
+ // deselecting is impossible, selecting via cursor
+ if ( bSelect )
+ GoToRow(nRow, FALSE);
+ return;
+ }
+
+ DBG_TRACE1( "BrowseBox: %p->HideCursor", this );
+
+ // remove old selection?
+ if ( !bExpand || !bMultiSelection )
+ {
+ ToggleSelection();
+ if ( bMultiSelection )
+ uRow.pSel->SelectAll(FALSE);
+ else
+ uRow.nSel = BROWSER_ENDOFSELECTION;
+ if ( pColSel )
+ pColSel->SelectAll(FALSE);
+ }
+
+ // set new selection
+ if ( !bHideSelect &&
+ ( (bMultiSelection && uRow.pSel->GetTotalRange().Max() >= nRow && uRow.pSel->Select(nRow,bSelect)) ||
+ (!bMultiSelection && ( uRow.nSel = nRow ) != BROWSER_ENDOFSELECTION ) ) )
+ {
+ // Handle-Column nicht highlighten
+ BrowserColumn *pFirstCol = pCols->GetObject(0);
+ long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
+
+ // highlight only newly selected part
+ Rectangle aRect(
+ Point( nOfsX, (nRow-nTopRow)*GetDataRowHeight() ),
+ Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) );
+ pDataWin->Invalidate( aRect );
+ }
+
+ if ( !bSelecting )
+ Select();
+ else
+ bSelect = TRUE;
+
+ // restore screen
+ DBG_TRACE1( "BrowseBox: %p->ShowCursor", this );
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::GetSelectRowCount() const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return bMultiSelection ? uRow.pSel->GetSelectCount() :
+ uRow.nSel == BROWSER_ENDOFSELECTION ? 0 : 1;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SelectColumnPos( USHORT nNewColPos, BOOL bSelect, BOOL bMakeVisible )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( !bColumnCursor )
+ return;
+
+ if ( !bMultiSelection )
+ {
+ if ( bSelect )
+ GoToColumnId( pCols->GetObject(nNewColPos)->GetId(), bMakeVisible );
+ return;
+ }
+ else if (!GoToColumnId( pCols->GetObject(nNewColPos)->GetId(), bMakeVisible ))
+ return;
+
+ DBG_TRACE1( "BrowseBox: %p->HideCursor", this );
+ ToggleSelection();
+ if ( bMultiSelection )
+ uRow.pSel->SelectAll(FALSE);
+ else
+ uRow.nSel = BROWSER_ENDOFSELECTION;
+ pColSel->SelectAll(FALSE);
+
+ if ( pColSel->Select( nNewColPos ) )
+ {
+ // GoToColumnId( pCols->GetObject(nNewColPos)->GetId(), bMakeVisible );
+
+ // only highlight painted areas
+ pDataWin->Update();
+ Rectangle aFieldRectPix( GetFieldRectPixel( nCurRow, nCurColId, FALSE ) );
+ Rectangle aRect(
+ Point( aFieldRectPix.Left() - MIN_COLUMNWIDTH, 0 ),
+ Size( pCols->GetObject(nNewColPos)->Width(),
+ pDataWin->GetOutputSizePixel().Height() ) );
+ pDataWin->Invalidate( aRect );
+ if ( !bSelecting )
+ Select();
+ else
+ bSelect = TRUE;
+ }
+
+ // restore screen
+ DBG_TRACE1( "BrowseBox: %p->ShowCursor", this );
+}
+
+//-------------------------------------------------------------------
+
+USHORT BrowseBox::GetSelectColumnCount() const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // while bAutoSelect (==!pColSel), 1 if any rows (yes rows!) else none
+ return pColSel ? (USHORT) pColSel->GetSelectCount() :
+ nCurRow >= 0 ? 1 : 0;
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::FirstSelectedRow( BOOL bInverse )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return bMultiSelection ? uRow.pSel->FirstSelected(bInverse) : uRow.nSel;
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::NextSelectedRow()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return bMultiSelection ? uRow.pSel->NextSelected() : BROWSER_ENDOFSELECTION;
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::PrevSelectedRow()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return bMultiSelection ? uRow.pSel->PrevSelected() : BROWSER_ENDOFSELECTION;
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::LastSelectedRow( BOOL bInverse )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return bMultiSelection ? uRow.pSel->LastSelected(bInverse) : uRow.nSel;
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::IsRowSelected( long nRow ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return bMultiSelection ? uRow.pSel->IsSelected(nRow) : nRow == uRow.nSel;
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::IsColumnSelected( USHORT nColumnId ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return pColSel ? pColSel->IsSelected( GetColumnPos(nColumnId) ) :
+ nCurColId == nColumnId;
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::MakeFieldVisible
+(
+ long nRow, // Zeilen-Nr des Feldes (beginnend mit 0)
+ USHORT nColId, // Spalten-Id des Feldes
+ BOOL bComplete // (== FALSE), TRUE => vollst"andig sichtbar machen
+)
+
+/* [Beschreibung]
+
+ Macht das durch 'nRow' und 'nColId' beschriebene Feld durch
+ entsprechendes scrollen sichtbar. Ist 'bComplete' gesetzt, dann wird
+ gefordert, da\s das Feld ganz sichtbar wird.
+
+ [R"uckgabewert]
+
+ BOOL TRUE
+ Das angegebene Feld wurde sichtbar gemacht, bzw. war
+ bereits sichtbar.
+
+ FALSE
+ Das angegebene Feld konnte nicht sichtbar bzw. bei
+ 'bComplete' nicht vollst"andig sichtbar gemacht werden.
+*/
+
+{
+ Size aTestSize = pDataWin->GetSizePixel();
+
+ if ( !bBootstrapped ||
+ ( aTestSize.Width() == 0 && aTestSize.Height() == 0 ) )
+ return FALSE;
+
+ // ist es schon sichtbar?
+ BOOL bVisible = IsFieldVisible( nRow, nColId, bComplete );
+ if ( bVisible )
+ return TRUE;
+
+ // Spaltenposition und Feld-Rechteck und Ausgabebereich berechnen
+ USHORT nColPos = GetColumnPos( nColId );
+ Rectangle aFieldRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ Rectangle aDataRect = Rectangle( Point(0, 0), pDataWin->GetSizePixel() );
+
+ // links au\serhalb?
+ if ( nColPos >= FrozenColCount() && nColPos < nFirstCol )
+ // => nach rechts scrollen
+ ScrollColumns( nColPos - nFirstCol );
+
+ // solange rechts au\serhalb
+ while ( aDataRect.Right() < ( bComplete
+ ? aFieldRect.Right()
+ : aFieldRect.Left()+aFieldRect.GetWidth()/2 ) )
+ {
+ // => nach links scrollen
+ if ( ScrollColumns( 1 ) != 1 )
+ // nichts mehr zu scrollen
+ break;
+ aFieldRect = GetFieldRectPixel( nRow, nColId, FALSE );
+ }
+
+ // oben au\serhalb?
+ if ( nRow < nTopRow )
+ // nach unten scrollen
+ ScrollRows( nRow - nTopRow );
+
+ // unten au\serhalb?
+ long nBottomRow = nTopRow + GetVisibleRows();
+ // OV: damit nBottomRow die Nummer der letzten sichtbaren Zeile ist
+ // (Zaehlung ab Null!), muss sie dekrementiert werden.
+ // Beispiel: BrowseBox enthaelt genau einen Eintrag. nBottomRow := 0 + 1 - 1
+ if( nBottomRow )
+ nBottomRow--;
+
+ if ( nRow > nBottomRow )
+ // nach oben scrollen
+ ScrollRows( nRow - nBottomRow );
+
+ // jetzt kann es immer noch nicht passen, z.B. weil Window zu klein
+ return IsFieldVisible( nRow, nColId, bComplete );
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::IsFieldVisible( long nRow, USHORT nColumnId,
+ BOOL bCompletely ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // durch frozen-Column verdeckt?
+ USHORT nColPos = GetColumnPos( nColumnId );
+ if ( nColPos >= FrozenColCount() && nColPos < nFirstCol )
+ return FALSE;
+
+ Rectangle aRect( ImplFieldRectPixel( nRow, nColumnId ) );
+ if ( aRect.IsEmpty() )
+ return FALSE;
+
+ // get the visible area
+ Rectangle aOutRect( Point(0, 0), pDataWin->GetOutputSizePixel() );
+
+ if ( bCompletely )
+ // test if the field is completely visible
+ return aOutRect.IsInside( aRect );
+ else
+ // test if the field is partly of completely visible
+ return !aOutRect.Intersection( aRect ).IsEmpty();
+}
+
+//-------------------------------------------------------------------
+
+Rectangle BrowseBox::GetFieldRectPixel( long nRow, USHORT nColumnId,
+ BOOL bRelToBrowser ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // get the rectangle relative to DataWin
+ Rectangle aRect( ImplFieldRectPixel( nRow, nColumnId ) );
+ if ( aRect.IsEmpty() )
+ return aRect;
+
+ // adjust relative to BrowseBox's output area
+ Point aTopLeft( aRect.TopLeft() );
+ if ( bRelToBrowser )
+ {
+ aTopLeft = pDataWin->OutputToScreenPixel( aTopLeft );
+ aTopLeft = ScreenToOutputPixel( aTopLeft );
+ }
+
+ return Rectangle( aTopLeft, aRect.GetSize() );
+}
+
+//-------------------------------------------------------------------
+
+Rectangle BrowseBox::GetRowRectPixel( long nRow, BOOL bRelToBrowser ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // get the rectangle relative to DataWin
+ Rectangle aRect;
+ if ( nTopRow > nRow )
+ // row is above visible area
+ return aRect;
+ aRect = Rectangle(
+ Point( 0, GetDataRowHeight() * (nRow-nTopRow) ),
+ Size( pDataWin->GetOutputSizePixel().Width(), GetDataRowHeight() ) );
+ if ( aRect.TopLeft().Y() > pDataWin->GetOutputSizePixel().Height() )
+ // row is below visible area
+ return aRect;
+
+ // adjust relative to BrowseBox's output area
+ Point aTopLeft( aRect.TopLeft() );
+ if ( bRelToBrowser )
+ {
+ aTopLeft = pDataWin->OutputToScreenPixel( aTopLeft );
+ aTopLeft = ScreenToOutputPixel( aTopLeft );
+ }
+
+ return Rectangle( aTopLeft, aRect.GetSize() );
+}
+
+//-------------------------------------------------------------------
+
+Rectangle BrowseBox::ImplFieldRectPixel( long nRow, USHORT nColumnId ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // compute the X-coordinte realtiv to DataWin by accumulation
+ long nColX = 0;
+ USHORT nFrozenCols = FrozenColCount();
+ USHORT nCol;
+ for ( nCol = 0;
+ nCol < pCols->Count() && pCols->GetObject(nCol)->GetId() != nColumnId;
+ ++nCol )
+ if ( pCols->GetObject(nCol)->IsFrozen() || nCol >= nFirstCol )
+ nColX += pCols->GetObject(nCol)->Width();
+
+ if ( nCol >= pCols->Count() || ( nCol >= nFrozenCols && nCol < nFirstCol ) )
+ return Rectangle();
+
+ // compute the Y-coordinate relative to DataWin
+ long nRowY = ( nRow - nTopRow ) * GetDataRowHeight();
+
+ // assemble the Rectangle relative to DataWin
+ return Rectangle(
+ Point( nColX + MIN_COLUMNWIDTH, nRowY ),
+ Size( pCols->GetObject(nCol)->Width() - 2*MIN_COLUMNWIDTH,
+ GetDataRowHeight() - 1 ) );
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::GetRowAtYPosPixel( long nY, BOOL bRelToBrowser ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // compute the Y-coord
+ if ( bRelToBrowser )
+ {
+ Point aDataTopLeft = pDataWin->OutputToScreenPixel( Point(0, 0) );
+ Point aTopLeft = OutputToScreenPixel( Point(0, 0) );
+ nY -= aDataTopLeft.Y() - aTopLeft.Y();
+ }
+
+ // no row there (e.g. in the header)
+ if ( nY < 0 || nY >= pDataWin->GetOutputSizePixel().Height() )
+ return -1;
+
+ return nY / GetDataRowHeight() + nTopRow;
+}
+
+//-------------------------------------------------------------------
+
+Rectangle BrowseBox::GetFieldRect( USHORT nColumnId ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return GetFieldRectPixel( nCurRow, nColumnId );
+}
+
+//-------------------------------------------------------------------
+
+USHORT BrowseBox::GetColumnAtXPosPixel( long nX, BOOL ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // accumulate the withds of the visible columns
+ long nColX = 0;
+ USHORT nCol;
+ for ( nCol = 0; nCol < USHORT(pCols->Count()); ++nCol )
+ {
+ BrowserColumn *pCol = pCols->GetObject(nCol);
+ if ( pCol->IsFrozen() || nCol >= nFirstCol )
+ nColX += pCol->Width();
+
+ if ( nColX > nX )
+ return nCol;
+ }
+
+ return BROWSER_INVALIDID;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::ReserveControlArea( USHORT nWidth )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( nWidth != nControlAreaWidth )
+ {
+ nControlAreaWidth = nWidth;
+ UpdateScrollbars();
+ }
+}
+
+//-------------------------------------------------------------------
+
+Rectangle BrowseBox::GetControlArea() const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return Rectangle(
+ Point( 0, GetOutputSizePixel().Height() - aHScroll.GetSizePixel().Height() ),
+ Size( GetOutputSizePixel().Width() - aHScroll.GetSizePixel().Width(),
+ aHScroll.GetSizePixel().Height() ) );
+}
+
+#if SUPD<558
+//-------------------------------------------------------------------
+
+BrowserMode BrowseBox::GetMode( ) const
+{
+ return m_nCurrentMode;
+}
+#endif
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetMode( BrowserMode nMode )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+#ifdef DBG_MIx
+ Sound::Beep();
+ nMode =
+// BROWSER_COLUMNSELECTION |
+// BROWSER_MULTISELECTION |
+ BROWSER_THUMBDRAGGING |
+ BROWSER_KEEPHIGHLIGHT |
+ BROWSER_HLINES |
+ BROWSER_VLINES |
+// BROWSER_HIDECURSOR |
+// BROWSER_NO_HSCROLL |
+// BROWSER_NO_SCROLLBACK |
+ BROWSER_AUTO_VSCROLL |
+ BROWSER_AUTO_HSCROLL |
+ BROWSER_TRACKING_TIPS |
+// BROWSER_HIGHLIGHT_NONE |
+ BROWSER_HIGHLIGHT_AUTO |
+// BROWSER_HIGHLIGHT_MANU |
+ BROWSER_HEADERBAR_NEW |
+// BROWSER_AUTOSIZE_LASTCOL |
+ 0;
+#endif
+
+ ((BrowserDataWin*)pDataWin)->bAutoHScroll =
+ BROWSER_AUTO_HSCROLL == ( nMode & BROWSER_AUTO_HSCROLL);
+ ((BrowserDataWin*)pDataWin)->bAutoVScroll =
+ BROWSER_AUTO_VSCROLL == ( nMode & BROWSER_AUTO_VSCROLL);
+
+ ((BrowserDataWin*)pDataWin)->bNoHScroll =
+ BROWSER_NO_HSCROLL == ( nMode & BROWSER_NO_HSCROLL);
+ if ( ((BrowserDataWin*)pDataWin)->bNoHScroll )
+ {
+ aHScroll.Hide();
+ nControlAreaWidth = 0;
+ }
+ else
+ nControlAreaWidth = USHRT_MAX;
+
+ ((BrowserDataWin*)pDataWin)->bNoScrollBack =
+ BROWSER_NO_SCROLLBACK == ( nMode & BROWSER_NO_SCROLLBACK);
+
+ long nOldRowSel = bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel;
+ MultiSelection *pOldRowSel = bMultiSelection ? uRow.pSel : 0;
+ MultiSelection *pOldColSel = pColSel;
+
+ delete pVScroll;
+
+ bThumbDragging = ( nMode & BROWSER_THUMBDRAGGING ) == BROWSER_THUMBDRAGGING;
+ bMultiSelection = ( nMode & BROWSER_MULTISELECTION ) == BROWSER_MULTISELECTION;
+ bColumnCursor = ( nMode & BROWSER_COLUMNSELECTION ) == BROWSER_COLUMNSELECTION;
+ bKeepHighlight = ( nMode & BROWSER_KEEPSELECTION ) == BROWSER_KEEPSELECTION;
+
+ bHideSelect = ((nMode & BROWSER_HIDESELECT) == BROWSER_HIDESELECT);
+ bHideCursor = ((nMode & BROWSER_HIDECURSOR) == BROWSER_HIDECURSOR);
+ m_bFocusOnlyCursor = ((nMode & BROWSER_CURSOR_WO_FOCUS) == 0);
+
+ bHLines = ( nMode & BROWSER_HLINESFULL ) == BROWSER_HLINESFULL;
+ bVLines = ( nMode & BROWSER_VLINESFULL ) == BROWSER_VLINESFULL;
+ bHDots = ( nMode & BROWSER_HLINESDOTS ) == BROWSER_HLINESDOTS;
+ bVDots = ( nMode & BROWSER_VLINESDOTS ) == BROWSER_VLINESDOTS;
+
+ WinBits nVScrollWinBits =
+ WB_VSCROLL | ( ( nMode & BROWSER_THUMBDRAGGING ) ? WB_DRAG : 0 );
+ pVScroll = ( nMode & BROWSER_TRACKING_TIPS ) == BROWSER_TRACKING_TIPS
+ ? new BrowserScrollBar( this, nVScrollWinBits,
+ (BrowserDataWin*) pDataWin )
+ : new ScrollBar( this, nVScrollWinBits );
+ pVScroll->SetLineSize( 1 );
+ pVScroll->SetPageSize(1);
+ pVScroll->SetScrollHdl( LINK( this, BrowseBox, ScrollHdl ) );
+ pVScroll->SetEndScrollHdl( LINK( this, BrowseBox, EndScrollHdl ) );
+
+ ((BrowserDataWin*)pDataWin)->bHighlightAuto =
+ BROWSER_HIGHLIGHT_AUTO == ( nMode & BROWSER_HIGHLIGHT_AUTO ) ||
+ BROWSER_HIGHLIGHT_MANU != ( nMode & BROWSER_HIGHLIGHT_MANU );
+ ((BrowserDataWin*)pDataWin)->bAutoSizeLastCol =
+ BROWSER_AUTOSIZE_LASTCOL == ( nMode & BROWSER_AUTOSIZE_LASTCOL );
+ ((BrowserDataWin*)pDataWin)->bOwnDataChangedHdl =
+ BROWSER_OWN_DATACHANGED == ( nMode & BROWSER_OWN_DATACHANGED );
+
+ // Headerbar erzeugen, was passiert, wenn eine erzeugt werden muß und schon Spalten bestehen ?
+ if ( BROWSER_HEADERBAR_NEW == ( nMode & BROWSER_HEADERBAR_NEW ) )
+ {
+ if (!((BrowserDataWin*)pDataWin)->pHeaderBar)
+ ((BrowserDataWin*)pDataWin)->pHeaderBar = CreateHeaderBar( this );
+ }
+ else
+ {
+ DELETEZ(((BrowserDataWin*)pDataWin)->pHeaderBar);
+ }
+
+
+
+ if ( bColumnCursor )
+ {
+ pColSel = pOldColSel ? pOldColSel : new MultiSelection;
+ pColSel->SetTotalRange( Range( 0, pCols->Count()-1 ) );
+ }
+ else
+ {
+ pColSel = 0;
+ delete pColSel;
+ }
+
+ if ( bMultiSelection )
+ {
+ if ( pOldRowSel )
+ uRow.pSel = pOldRowSel;
+ else
+ uRow.pSel = new MultiSelection;
+ }
+ else
+ {
+ uRow.nSel = nOldRowSel;
+ delete pOldRowSel;
+ }
+
+ if ( bBootstrapped )
+ {
+ StateChanged( STATE_CHANGE_INITSHOW );
+ if ( bMultiSelection && !pOldRowSel &&
+ nOldRowSel != BROWSER_ENDOFSELECTION )
+ uRow.pSel->Select( nOldRowSel );
+ }
+
+ if ( pDataWin )
+ pDataWin->Invalidate();
+
+ // kein Cursor auf Handle-Column
+ if ( nCurColId == 0 )
+ nCurColId = GetColumnId( 1 );
+
+ m_nCurrentMode = nMode;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::VisibleRowsChanged( long nNewTopRow, USHORT nNumRows)
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // Das alte Verhalten: NumRows automatisch korrigieren:
+ if ( nRowCount < GetRowCount() )
+ {
+ RowInserted(nRowCount,GetRowCount() - nRowCount,FALSE);
+ }
+ else if ( nRowCount > GetRowCount() )
+ {
+ RowRemoved(nRowCount-(nRowCount - GetRowCount()),nRowCount - GetRowCount(),FALSE);
+ }
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::IsCursorMoveAllowed( long nNewRow, USHORT nNewColId ) const
+
+/* [Beschreibung]
+
+ Diese virtuelle Methode wird immer gerufen bevor der Cursor direkt
+ bewegt werden soll. Durch 'return FALSE' kann verhindert werden, da\s
+ dies geschieht, wenn z.B. ein Datensatz irgendwelchen Rules widerspricht.
+
+ Diese Methode wird nicht gerufen, wenn die Cursorbewegung durch
+ ein L"oschen oder Einf"ugen (einer Zeile/Spalte) ausgel"ost wird, also
+ genaugenommen nur eine Cursor-Korrektur vorliegt.
+
+ Die Basisimplementierung liefert derzeit immer TRUE.
+*/
+
+{
+ return TRUE;
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::GetDataRowHeight() const
+{
+ return CalcZoom(nDataRowHeight ? nDataRowHeight : ImpGetDataRowHeight());
+}
+
+//-------------------------------------------------------------------
+
+Window& BrowseBox::GetEventWindow() const
+{
+ return *((BrowserDataWin*)pDataWin)->pEventWin;
+}
+
+//-------------------------------------------------------------------
+
+#if SUPD >= 376
+
+BrowserHeader* BrowseBox::CreateHeaderBar( BrowseBox* pParent )
+{
+ BrowserHeader* pNewBar = new BrowserHeader( pParent );
+ pNewBar->SetStartDragHdl( LINK( this, BrowseBox, StartDragHdl ) );
+ return pNewBar;
+}
+
+void BrowseBox::SetHeaderBar( BrowserHeader* pHeaderBar )
+{
+ delete ( (BrowserDataWin*)pDataWin )->pHeaderBar;
+ ( (BrowserDataWin*)pDataWin )->pHeaderBar = pHeaderBar;
+ ( (BrowserDataWin*)pDataWin )->pHeaderBar->SetStartDragHdl( LINK( this, BrowseBox, StartDragHdl ) );
+}
+
+#endif
+
+//-------------------------------------------------------------------
+
+#ifdef DBG_UTIL
+const char* BrowseBoxCheckInvariants( const void * pVoid )
+{
+ const BrowseBox * p = (const BrowseBox *)pVoid;
+
+ if (p->nRowCount < 0) return "BrowseBox: nRowCount < 0";
+ if (p->nTopRow < 0) return "BrowseBox: nTopRow < 0";
+ if (p->nTopRow >= p->nRowCount && p->nRowCount != 0) return "BrowseBox: nTopRow >= nRowCount && nRowCount != 0";
+ if (p->nCurRow < -1) return "BrowseBox: nCurRow < -1";
+ if (p->nCurRow > p->nRowCount) return "BrowseBox: nCurRow > nRowCount";
+
+ // Leider waehrend der Bearbeitung nicht immer der Fall:
+ //if (p->nCurRow < 0 && p->nRowCount != 0) return "nCurRow < 0 && nRowCount != 0";
+ //if (p->nCurRow >= p->nRowCount && p->nRowCount != 0) return "nCurRow >= nRowCount && nRowCount != 0";
+
+ return NULL;
+}
+#endif
+
+//-------------------------------------------------------------------
+long BrowseBox::GetTitleHeight() const
+{
+ long nHeight;
+ // ask the header bar for the text height (if possible), as the header bar's font is adjusted with
+ // our (and the header's) zoom factor
+ HeaderBar* pHeaderBar = ( (BrowserDataWin*)pDataWin )->pHeaderBar;
+ if ( pHeaderBar )
+ nHeight = pHeaderBar->GetTextHeight();
+ else
+ nHeight = GetTextHeight();
+
+ return nTitleLines ? nTitleLines * nHeight + 4 : 0;
+}
+
+//-------------------------------------------------------------------
+long BrowseBox::CalcReverseZoom(long nVal)
+{
+ if (IsZoom())
+ {
+ const Fraction& rZoom = GetZoom();
+ double n = (double)nVal;
+ n *= (double)rZoom.GetDenominator();
+ n /= (double)rZoom.GetNumerator();
+ nVal = n>0 ? (long)(n + 0.5) : -(long)(-n + 0.5);
+ }
+
+ return nVal;
+}
+
+//-------------------------------------------------------------------
+HeaderBar* BrowseBox::GetHeaderBar() const
+{
+ return ((BrowserDataWin*)pDataWin)->pHeaderBar;
+}
+
+
diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx
new file mode 100644
index 000000000000..916db78bc5c5
--- /dev/null
+++ b/svtools/source/brwbox/brwbox2.cxx
@@ -0,0 +1,2021 @@
+/*************************************************************************
+ *
+ * $RCSfile: brwbox2.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <tools/debug.hxx>
+#include <brwbox.hxx>
+#include "datwin.hxx"
+
+#ifndef _SV_SALGTYPE_HXX
+#include <vcl/salgtype.hxx>
+#endif
+
+#pragma hdrstop
+
+#ifndef _SV_MULTISEL_HXX
+#include <tools/multisel.hxx>
+#endif
+
+#if SUPD<558
+BOOL BrowseBox::m_bFocusOnlyCursor;
+Color BrowseBox::m_aCursorColor;
+BrowserMode BrowseBox::m_nCurrentMode;
+#endif
+
+
+//===================================================================
+
+DBG_NAMEEX(BrowseBox);
+
+//===================================================================
+
+extern const char* BrowseBoxCheckInvariants( const void * pVoid );
+
+DECLARE_LIST( BrowserColumns, BrowserColumn* );
+
+//===================================================================
+
+void BrowseBox::Command( const CommandEvent& rEvt )
+{
+ if ( !((BrowserDataWin*)pDataWin)->bInCommand )
+ Control::Command( rEvt );
+}
+
+//===================================================================
+
+BOOL BrowseBox::IsInCommandEvent() const
+{
+ return ((BrowserDataWin*)pDataWin)->bInCommand;
+}
+
+//===================================================================
+
+void BrowseBox::StateChanged( StateChangedType nStateChange )
+{
+ if ( STATE_CHANGE_INITSHOW == nStateChange )
+ {
+ bBootstrapped = TRUE; // muss zuerst gesetzt werden!
+
+ Resize();
+ if ( bMultiSelection )
+ uRow.pSel->SetTotalRange( Range( 0, nRowCount - 1 ) );
+ if ( nRowCount == 0 )
+ nCurRow = BROWSER_ENDOFSELECTION;
+ else if ( nCurRow == BROWSER_ENDOFSELECTION )
+ nCurRow = 0;
+
+
+ if ( HasFocus() )
+ {
+ bSelectionIsVisible = TRUE;
+ bHasFocus = TRUE;
+ }
+ UpdateScrollbars();
+ AutoSizeLastColumn();
+ CursorMoved();
+ }
+ else if (STATE_CHANGE_ZOOM == nStateChange)
+ {
+ pDataWin->SetZoom(GetZoom());
+ HeaderBar* pHeaderBar = ( (BrowserDataWin*)pDataWin )->pHeaderBar;
+ if (pHeaderBar)
+ pHeaderBar->SetZoom(GetZoom());
+
+ // let the cols calc their new widths and adjust the header bar
+ for ( USHORT nPos = 0; nPos < pCols->Count(); ++nPos )
+ {
+ pCols->GetObject(nPos)->ZoomChanged(GetZoom());
+ if ( pHeaderBar )
+ pHeaderBar->SetItemSize( pCols->GetObject(nPos)->GetId(), pCols->GetObject(nPos)->Width() );
+ }
+
+ // all our controls have to be repositioned
+ Resize();
+ }
+}
+
+//===================================================================
+
+void BrowseBox::Select()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::DoubleClick( const BrowserMouseEvent & )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::CursorMoved()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::QueryColumnResize( USHORT nId, long nWidth )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ return nWidth;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::ColumnResized( USHORT nId )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::ColumnMoved( USHORT nId )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::StartScroll()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ //((Control*)pDataWin)->HideFocus();
+ DoHideCursor( "StartScroll" );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::EndScroll()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ UpdateScrollbars();
+ AutoSizeLastColumn();
+ DoShowCursor( "EndScroll" );
+}
+
+//-------------------------------------------------------------------
+
+#pragma optimize( "", off )
+
+void BrowseBox::ToggleSelection( BOOL bForce )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // selection highlight-toggling allowed?
+ if ( bHideSelect )
+ return;
+ if ( !bForce &&
+ ( bNotToggleSel || !IsUpdateMode() || !bSelectionIsVisible ) )
+ return;
+//MI, 28.01.98
+// if ( !((BrowserDataWin*)pDataWin)->bHighlightToggle &&
+// !((BrowserDataWin*)pDataWin)->bHighlightAuto )
+// return;
+
+ // only highlight painted areas!
+ bNotToggleSel = TRUE;
+ if ( FALSE && !((BrowserDataWin*)pDataWin)->bInPaint )
+ pDataWin->Update();
+
+ // accumulate areas of rows to highlight
+ RectangleList aHighlightList;
+ long nLastRowInRect = 0; // fuer den CFront
+
+ // Handle-Column nicht highlighten
+ BrowserColumn *pFirstCol = pCols->GetObject(0);
+ long nOfsX = (!pFirstCol || pFirstCol->GetId()) ? 0 : pFirstCol->Width();
+
+ // accumulate old row selection
+ long nBottomRow = nTopRow +
+ pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight();
+ if ( nBottomRow > GetRowCount() && GetRowCount() )
+ nBottomRow = GetRowCount();
+ for ( long nRow = bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel;
+ nRow != BROWSER_ENDOFSELECTION && nRow <= nBottomRow;
+ nRow = bMultiSelection ? uRow.pSel->NextSelected() : BROWSER_ENDOFSELECTION )
+ {
+ if ( nRow < nTopRow )
+ continue;
+
+ Rectangle aAddRect(
+ Point( nOfsX, (nRow-nTopRow)*GetDataRowHeight() ),
+ Size( pDataWin->GetSizePixel().Width(), GetDataRowHeight() ) );
+ if ( aHighlightList.Count() && nLastRowInRect == ( nRow - 1 ) )
+ aHighlightList.First()->Union( aAddRect );
+ else
+ aHighlightList.Insert( new Rectangle( aAddRect ), (ULONG) 0 );
+ nLastRowInRect = nRow;
+ }
+
+ // unhighlight the old selection (if any)
+ while ( aHighlightList.Count() )
+ {
+ Rectangle *pRect = aHighlightList.Remove( aHighlightList.Count() - 1 );
+ pDataWin->Invalidate( *pRect );
+ delete pRect;
+ }
+
+ // unhighlight old column selection (if any)
+ for ( long nColId = pColSel ? pColSel->FirstSelected() : BROWSER_ENDOFSELECTION;
+ nColId != BROWSER_ENDOFSELECTION;
+ nColId = pColSel->NextSelected() )
+ {
+ Rectangle aRect( GetFieldRectPixel(nCurRow,
+ pCols->GetObject(nColId)->GetId(),
+ FALSE ) );
+ aRect.Left() -= MIN_COLUMNWIDTH;
+ aRect.Right() += MIN_COLUMNWIDTH;
+ aRect.Top() = 0;
+ aRect.Bottom() = pDataWin->GetOutputSizePixel().Height();
+ pDataWin->Invalidate( aRect );
+ }
+
+ bNotToggleSel = FALSE;
+}
+
+#pragma optimize( "", on )
+
+//-------------------------------------------------------------------
+
+void BrowseBox::DrawCursor()
+{
+ short nCursorHideCount = GetCursorHideCount();
+ BOOL bHidden = bHideCursor || !bSelectionIsVisible ||
+ !IsUpdateMode() || bScrolling || nCurRow < 0;
+
+ if (PaintCursorIfHiddenOnce())
+ bHidden |= ( GetCursorHideCount() > 1 );
+ else
+ bHidden |= ( GetCursorHideCount() > 0 );
+// bHidden |= ( GetCursorHideCount() > 0 ) && !( ( !m_bFocusOnlyCursor && GetCursorHideCount() == 1 ) && !HasFocus() );
+ // hidden if the hide count non-zero
+ // exception : we hided the cursor exactly once in LoseFocus and we have to show the cursor
+
+ // keine Cursor auf Handle-Column
+ if ( nCurColId == 0 )
+ nCurColId = GetColumnId(1);
+
+ // Cursor-Rechteck berechnen
+ Rectangle aCursor;
+ if ( bColumnCursor )
+ {
+ aCursor = GetFieldRectPixel( nCurRow, nCurColId, FALSE );
+ //! --aCursor.Bottom();
+ aCursor.Left() -= MIN_COLUMNWIDTH;
+ aCursor.Right() += 1;
+ aCursor.Bottom() += 1;
+ }
+ else
+ aCursor = Rectangle(
+ Point( ( pCols->Count() && pCols->GetObject(0)->GetId() == 0 ) ?
+ pCols->GetObject(0)->Width() : 0,
+ (nCurRow - nTopRow) * GetDataRowHeight() + 1 ),
+ Size( pDataWin->GetOutputSizePixel().Width() + 1,
+ GetDataRowHeight() - 2 ) );
+ if ( bHLines )
+ {
+ if ( !bMultiSelection )
+ --aCursor.Top();
+ --aCursor.Bottom();
+ }
+
+ //!mi_mac pDataWin->Update();
+
+ if (m_aCursorColor == COL_TRANSPARENT)
+ {
+ // auf diesem Plattformen funktioniert der StarView-Focus richtig
+ if ( bHidden )
+ ((Control*)pDataWin)->HideFocus();
+ else
+ ((Control*)pDataWin)->ShowFocus( aCursor );
+ }
+ else
+ {
+ Color rCol = bHidden ? pDataWin->GetFillColor() : m_aCursorColor;
+ Color aOldFillColor = pDataWin->GetFillColor();
+ Color aOldLineColor = pDataWin->GetLineColor();
+ pDataWin->SetFillColor();
+ pDataWin->SetLineColor( rCol );
+ pDataWin->DrawRect( aCursor );
+ pDataWin->SetLineColor( aOldLineColor );
+ pDataWin->SetFillColor( aOldFillColor );
+ }
+}
+
+//-------------------------------------------------------------------
+
+ULONG BrowseBox::GetColumnWidth( USHORT nId ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ USHORT nItemPos = GetColumnPos( nId );
+ if ( nItemPos >= pCols->Count() )
+ return 0;
+ return pCols->GetObject(nItemPos)->Width();
+}
+
+//-------------------------------------------------------------------
+
+USHORT BrowseBox::GetColumnId( USHORT nPos ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( nPos >= pCols->Count() )
+ return 0;
+ return pCols->GetObject(nPos)->GetId();
+}
+
+//-------------------------------------------------------------------
+
+USHORT BrowseBox::GetColumnPos( USHORT nId ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ for ( USHORT nPos = 0; nPos < pCols->Count(); ++nPos )
+ if ( pCols->GetObject(nPos)->GetId() == nId )
+ return nPos;
+ return BROWSER_INVALIDID;
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::IsFrozen( USHORT nColumnId ) const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ for ( USHORT nPos = 0; nPos < pCols->Count(); ++nPos )
+ if ( pCols->GetObject(nPos)->GetId() == nColumnId )
+ return pCols->GetObject(nPos)->IsFrozen();
+ return FALSE;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::ExpandRowSelection( const BrowserMouseEvent& rEvt )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ DoHideCursor( "ExpandRowSelection" );
+
+ // expand the last selection
+ if ( bMultiSelection )
+ {
+ Range aJustifiedRange( aSelRange );
+ aJustifiedRange.Justify();
+
+ BOOL bSelectThis =
+ ( bSelect && !aJustifiedRange.IsInside( rEvt.GetRow() ) ) ||
+ ( !bSelect && aJustifiedRange.IsInside( rEvt.GetRow() ) );
+
+ if ( aJustifiedRange.IsInside( rEvt.GetRow() ) )
+ {
+ // down and up
+ while ( rEvt.GetRow() < aSelRange.Max() )
+ { // ZTC/Mac bug - dont put these statemants together!
+ SelectRow( aSelRange.Max(), bSelectThis, TRUE );
+ --aSelRange.Max();
+ }
+ while ( rEvt.GetRow() > aSelRange.Max() )
+ { // ZTC/Mac bug - dont put these statemants together!
+ SelectRow( aSelRange.Max(), bSelectThis, TRUE );
+ ++aSelRange.Max();
+ }
+ }
+ else
+ {
+ // up and down
+ BOOL bOldSelecting = bSelecting;
+ bSelecting = TRUE;
+ while ( rEvt.GetRow() < aSelRange.Max() )
+ { // ZTC/Mac bug - dont put these statemants together!
+ --aSelRange.Max();
+ if ( !IsRowSelected( aSelRange.Max() ) )
+ {
+ SelectRow( aSelRange.Max(), bSelectThis, TRUE );
+ bSelect = TRUE;
+ }
+ }
+ while ( rEvt.GetRow() > aSelRange.Max() )
+ { // ZTC/Mac bug - dont put these statemants together!
+ ++aSelRange.Max();
+ if ( !IsRowSelected( aSelRange.Max() ) )
+ {
+ SelectRow( aSelRange.Max(), bSelectThis, TRUE );
+ bSelect = TRUE;
+ }
+ }
+ bSelecting = bOldSelecting;
+ if ( bSelect )
+ Select();
+ }
+ }
+ else
+ if ( !bMultiSelection || !IsRowSelected( rEvt.GetRow() ) )
+ SelectRow( rEvt.GetRow(), TRUE );
+
+ GoToRow( rEvt.GetRow(), FALSE );
+ DoShowCursor( "ExpandRowSelection" );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::Resize()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ if ( !bBootstrapped && IsReallyVisible() )
+ BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
+ if ( !pCols->Count() )
+ {
+ ((BrowserDataWin*)pDataWin)->bResizeOnPaint = TRUE;
+ return;
+ }
+ ((BrowserDataWin*)pDataWin)->bResizeOnPaint = FALSE;
+
+ // calc the size of the scrollbars
+ // (we can't ask the scrollbars for their widths cause if we're zoomed they still have to be
+ // resized - which is done in UpdateScrollbars)
+ ULONG nSBSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ if (IsZoom())
+ nSBSize = (ULONG)(nSBSize * (double)GetZoom());
+
+ long nSize = pDataWin->GetPosPixel().Y();
+ if( !((BrowserDataWin*)pDataWin)->bNoHScroll )
+ nSize += aHScroll.GetSizePixel().Height();
+ if ( GetOutputSizePixel().Height() < nSize ) return;
+
+ DoHideCursor( "Resize" );
+ USHORT nOldVisibleRows =
+ (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+
+ // did we need a horiz. scroll bar oder gibt es eine Control Area?
+ if ( !((BrowserDataWin*)pDataWin)->bNoHScroll &&
+ ( ( pCols->Count() - FrozenColCount() ) > 1 || nControlAreaWidth > 0 ) )
+ aHScroll.Show();
+ else
+ aHScroll.Hide();
+
+ // calculate the size of the data window
+ long nDataHeight = GetOutputSizePixel().Height() - GetTitleHeight();
+ if ( aHScroll.IsVisible() )
+ nDataHeight -= nSBSize;
+
+ long nDataWidth = GetOutputSizePixel().Width();
+ if ( pVScroll->IsVisible() )
+ nDataWidth -= nSBSize;
+
+ // adjust position and size of data window
+ pDataWin->SetPosSizePixel(
+ Point( 0, GetTitleHeight() ),
+ Size( nDataWidth, nDataHeight ) );
+
+ USHORT nVisibleRows =
+ (USHORT)(pDataWin->GetOutputSizePixel().Height() / GetDataRowHeight() + 1);
+
+ // TopRow ist unveraendert, aber die Anzahl sichtbarer Zeilen hat sich
+ // geaendert
+ if ( nVisibleRows != nOldVisibleRows )
+ VisibleRowsChanged(nTopRow, nVisibleRows);
+
+ UpdateScrollbars();
+
+ // Control-Area
+ Rectangle aInvalidArea( GetControlArea() );
+ aInvalidArea.Right() = GetOutputSizePixel().Width();
+ aInvalidArea.Left() = 0;
+ Invalidate( aInvalidArea );
+
+ // external header-bar
+ HeaderBar* pHeaderBar = ( (BrowserDataWin*)pDataWin )->pHeaderBar;
+ if ( pHeaderBar )
+ {
+ // Handle-Column beruecksichtigen
+ BrowserColumn *pFirstCol = pCols->GetObject(0);
+ long nOfsX = pFirstCol->GetId() ? 0 : pFirstCol->Width();
+ pHeaderBar->SetPosPixel( Point( nOfsX, 0 ) );
+ pHeaderBar->SetSizePixel( Size( GetOutputSizePixel().Width() - nOfsX, GetTitleHeight() ) );
+ }
+
+ AutoSizeLastColumn(); // adjust last column width
+ DoShowCursor( "Resize" );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::Paint( const Rectangle& rRect )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // initializations
+ if ( !bBootstrapped && IsReallyVisible() )
+ BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
+ if ( !pCols->Count() )
+ return;
+
+ BrowserColumn *pFirstCol = pCols->GetObject(0);
+ BOOL bHandleCol = pFirstCol && pFirstCol->GetId() == 0;
+ BOOL bHeaderBar = ((BrowserDataWin*)pDataWin)->pHeaderBar != NULL;
+
+ // draw delimitational lines
+ if ( !((BrowserDataWin*)pDataWin)->bNoHScroll )
+ DrawLine( Point( 0, aHScroll.GetPosPixel().Y() ),
+ Point( GetOutputSizePixel().Width(),
+ aHScroll.GetPosPixel().Y() ) );
+
+ if ( nTitleLines )
+ {
+ if ( !bHeaderBar )
+ DrawLine( Point( 0, GetTitleHeight() - 1 ),
+ Point( GetOutputSizePixel().Width(),
+ GetTitleHeight() - 1 ) );
+ else if ( bHandleCol )
+ DrawLine( Point( 0, GetTitleHeight() - 1 ),
+ Point( pFirstCol->Width(), GetTitleHeight() - 1 ) );
+ }
+
+ // Title Bar
+ // Wenn es eine Handle Column gibt und die Headerbar verfuegbar ist, dann nur
+ // die HandleColumn
+ // Handle-Column beruecksichtigen
+ if ( nTitleLines && (!bHeaderBar || bHandleCol) )
+ {
+ // iterate through columns to redraw
+ long nX = 0;
+ USHORT nCol;
+ for ( nCol = 0;
+ nCol < pCols->Count() && nX < rRect.Right();
+ ++nCol )
+ {
+ // skip invisible colums between frozen and scrollable area
+ if ( nCol < nFirstCol && !pCols->GetObject(nCol)->IsFrozen() )
+ nCol = nFirstCol;
+
+ // nur die HandleCol ?
+ if (bHeaderBar && bHandleCol && nCol > 0)
+ break;
+
+ BrowserColumn *pCol = pCols->GetObject(nCol);
+
+ // draw the column and increment position
+ if ( pCol->Width() > 4 )
+ {
+ ButtonFrame aButtonFrame( Point( nX, 0 ),
+ Size( pCol->Width()-1, GetTitleHeight()-1 ),
+ pCol->Title(), FALSE, FALSE,
+ 0 != (BROWSER_COLUMN_TITLEABBREVATION&pCol->Flags()) );
+ aButtonFrame .Draw( *this );
+ DrawLine( Point( nX + pCol->Width() - 1, 0 ),
+ Point( nX + pCol->Width() - 1, GetTitleHeight()-1 ) );
+ }
+ else
+ {
+ Color aOldFillColor = GetFillColor();
+ SetFillColor( Color( COL_BLACK ) );
+ DrawRect( Rectangle( Point( nX, 0 ), Size( pCol->Width(), GetTitleHeight() - 1 ) ) );
+ SetFillColor( aOldFillColor );
+ }
+
+ // skip column
+ nX += pCol->Width();
+ }
+
+ // retouching
+ if ( !bHeaderBar && nCol == pCols->Count() )
+ {
+ const StyleSettings &rSettings = GetSettings().GetStyleSettings();
+ Color aColFace( rSettings.GetFaceColor() );
+ Color aOldFillColor = GetFillColor();
+ Color aOldLineColor = GetLineColor();
+ SetFillColor( aColFace );
+ SetLineColor( aColFace );
+ DrawRect( Rectangle(
+ Point( nX, 0 ),
+ Point( rRect.Right(), GetTitleHeight() - 2 ) ) );
+ SetFillColor( aOldLineColor );
+ SetLineColor( aOldFillColor );
+ }
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::PaintRow( OutputDevice &rDev, const Rectangle &rRect )
+{
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+{
+ BOOL bDrawSelection = (nFlags & WINDOW_DRAW_NOSELECTION) == 0;
+
+ // we need pixel coordinates
+ Size aRealSize = pDev->LogicToPixel(rSize);
+ Point aRealPos = pDev->LogicToPixel(rPos);
+
+ if ((rSize.Width() < 3) || (rSize.Height() < 3))
+ // we want to have two pixels frame ...
+ return;
+
+ Font aFont = GetDataWindow().GetDrawPixelFont( pDev );
+ // the 'normal' painting uses always the data window as device to output to, so we have to calc the new font
+ // relative to the data wins current settings
+
+ pDev->Push();
+ pDev->SetMapMode();
+ pDev->SetFont( aFont );
+
+ // draw a frame
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ pDev->SetLineColor(rStyleSettings.GetDarkShadowColor());
+ pDev->DrawLine(Point(aRealPos.X(), aRealPos.Y()),
+ Point(aRealPos.X(), aRealPos.Y() + aRealSize.Height() - 1));
+ pDev->DrawLine(Point(aRealPos.X(), aRealPos.Y()),
+ Point(aRealPos.X() + aRealSize.Width() - 1, aRealPos.Y()));
+ pDev->SetLineColor(rStyleSettings.GetShadowColor());
+ pDev->DrawLine(Point(aRealPos.X() + aRealSize.Width() - 1, aRealPos.Y() + 1),
+ Point(aRealPos.X() + aRealSize.Width() - 1, aRealPos.Y() + aRealSize.Height() - 1));
+ pDev->DrawLine(Point(aRealPos.X() + aRealSize.Width() - 1, aRealPos.Y() + aRealSize.Height() - 1),
+ Point(aRealPos.X() + 1, aRealPos.Y() + aRealSize.Height() - 1));
+
+ HeaderBar* pBar = ((BrowserDataWin*)pDataWin)->pHeaderBar;
+
+ // we're drawing onto a foreign device, so we have to fake the DataRowHeight for the subsequent ImplPaintData
+ // (as it is based on the settings of our data window, not the foreign device)
+ if (!nDataRowHeight)
+ ImpGetDataRowHeight();
+ long nHeightLogic = PixelToLogic(Size(0, nDataRowHeight), MAP_10TH_MM).Height();
+ long nForeignHeightPixel = pDev->LogicToPixel(Size(0, nHeightLogic), MAP_10TH_MM).Height();
+
+ long nOriginalHeight = nDataRowHeight;
+ nDataRowHeight = nForeignHeightPixel;
+
+ // this counts for the column widths, too
+ USHORT nPos;
+ for ( nPos = 0; nPos < pCols->Count(); ++nPos )
+ {
+ BrowserColumn* pCurrent = pCols->GetObject(nPos);
+
+ long nWidthLogic = PixelToLogic(Size(pCurrent->Width(), 0), MAP_10TH_MM).Width();
+ long nForeignWidthPixel = pDev->LogicToPixel(Size(nWidthLogic, 0), MAP_10TH_MM).Width();
+
+ pCurrent->SetWidth(nForeignWidthPixel, GetZoom());
+ if ( pBar )
+ pBar->SetItemSize( pCurrent->GetId(), pCurrent->Width() );
+ }
+
+ // a smaller area for the content
+ ++aRealPos.X();
+ ++aRealPos.Y();
+ aRealSize.Width() -= 2;
+ aRealSize.Height() -= 2;
+
+ // let the header bar draw itself
+ if ( pBar )
+ {
+ // the title height with respect to the font set for the given device
+ long nTitleHeight = PixelToLogic(Size(0, GetTitleHeight()), MAP_10TH_MM).Height();
+ nTitleHeight = pDev->LogicToPixel(Size(0, nTitleHeight), MAP_10TH_MM).Height();
+
+ BrowserColumn* pFirstCol = pCols->Count() ? pCols->GetObject(0) : NULL;
+
+ Point aHeaderPos(pFirstCol && (pFirstCol->GetId() == 0) ? pFirstCol->Width() : 0, 0);
+ Size aHeaderSize(aRealSize.Width() - aHeaderPos.X(), nTitleHeight);
+
+ aHeaderPos += aRealPos;
+ // do this before converting to logics !
+
+ // the header's draw expects logic coordinates, again
+ aHeaderPos = pDev->PixelToLogic(aHeaderPos);
+ aHeaderSize = pDev->PixelToLogic(aHeaderSize);
+
+ pBar->Draw(pDev, aHeaderPos, aHeaderSize, nFlags);
+
+ // draw the "upper left cell" (the intersection between the header bar and the handle column)
+ if (( pFirstCol->GetId() == 0 ) && ( pFirstCol->Width() > 4 ))
+ {
+ ButtonFrame aButtonFrame( aRealPos,
+ Size( pFirstCol->Width()-1, nTitleHeight-1 ),
+ pFirstCol->Title(), FALSE, FALSE, FALSE);
+ aButtonFrame.Draw( *pDev );
+
+ Color aOldColor = pDev->GetLineColor();
+ pDev->SetLineColor( Color( COL_BLACK ) );
+
+ pDev->DrawLine( Point( aRealPos.X(), aRealPos.Y() + nTitleHeight-1 ),
+ Point( aRealPos.X() + pFirstCol->Width() - 1, aRealPos.Y() + nTitleHeight-1 ) );
+ pDev->DrawLine( Point( aRealPos.X() + pFirstCol->Width() - 1, aRealPos.Y() ),
+ Point( aRealPos.X() + pFirstCol->Width() - 1, aRealPos.Y() + nTitleHeight-1 ) );
+
+ pDev->SetLineColor( aOldColor );
+ }
+
+ aRealPos.Y() += aHeaderSize.Height();
+ aRealSize.Height() -= aHeaderSize.Height();
+ }
+
+ // draw our own content (with clipping)
+ Region aRegion(Rectangle(aRealPos, aRealSize));
+ pDev->SetClipRegion( pDev->PixelToLogic( aRegion ) );
+
+ // do we have to paint the background
+ BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && GetDataWindow().IsControlBackground();
+ if ( bBackground )
+ {
+ Rectangle aRect( aRealPos, aRealSize );
+ pDev->SetFillColor( GetDataWindow().GetControlBackground() );
+ pDev->DrawRect( aRect );
+ }
+
+ ImplPaintData( *pDev, Rectangle( aRealPos, aRealSize ), TRUE, bDrawSelection );
+
+ // restore the column widths/data row height
+ nDataRowHeight = nOriginalHeight;
+ for ( nPos = 0; nPos < pCols->Count(); ++nPos )
+ {
+ BrowserColumn* pCurrent = pCols->GetObject(nPos);
+
+ long nForeignWidthLogic = pDev->PixelToLogic(Size(pCurrent->Width(), 0), MAP_10TH_MM).Width();
+ long nWidthPixel = LogicToPixel(Size(nForeignWidthLogic, 0), MAP_10TH_MM).Width();
+
+ pCurrent->SetWidth(nWidthPixel, GetZoom());
+ if ( pBar )
+ pBar->SetItemSize( pCurrent->GetId(), pCurrent->Width() );
+ }
+
+ pDev->Pop();
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::ImplPaintData(OutputDevice& _rOut, const Rectangle& _rRect, BOOL _bForeignDevice, BOOL _bDrawSelections)
+{
+ Point aOverallAreaPos = _bForeignDevice ? _rRect.TopLeft() : Point(0,0);
+ Size aOverallAreaSize = _bForeignDevice ? _rRect.GetSize() : GetDataWindow().GetOutputSizePixel();
+ Point aOverallAreaBRPos = _bForeignDevice ? _rRect.BottomRight() : Point( aOverallAreaSize.Width(), aOverallAreaSize.Height() );
+
+ long nDataRowHeigt = GetDataRowHeight();
+
+ // compute relative rows to redraw
+ ULONG nRelTopRow = _bForeignDevice ? 0 : ((ULONG)_rRect.Top() / nDataRowHeigt);
+ ULONG nRelBottomRow = (ULONG)(_bForeignDevice ? aOverallAreaSize.Height() : _rRect.Bottom()) / nDataRowHeigt;
+
+ // cache frequently used values
+ Point aPos( aOverallAreaPos.X(), nRelTopRow * nDataRowHeigt + aOverallAreaPos.Y() );
+ _rOut.SetLineColor( Color( COL_WHITE ) );
+ const StyleSettings &rSettings = _rOut.GetSettings().GetStyleSettings();
+ const Color &rHighlightTextColor = rSettings.GetHighlightTextColor();
+ const Color &rHighlightFillColor = rSettings.GetHighlightColor();
+ Color aOldTextColor = _rOut.GetTextColor();
+ Color aOldFillColor = _rOut.GetFillColor();
+ Color aOldLineColor = _rOut.GetLineColor();
+ long nHLineX = 0 == pCols->GetObject(0)->GetId()
+ ? pCols->GetObject(0)->Width()
+ : 0;
+ nHLineX += aOverallAreaPos.X();
+
+ // redraw the invalid fields
+ BOOL bRetouching = FALSE;
+ for ( ULONG nRelRow = nRelTopRow;
+ nRelRow <= nRelBottomRow && (ULONG)nTopRow+nRelRow < (ULONG)nRowCount;
+ ++nRelRow, aPos.Y() += nDataRowHeigt )
+ {
+ // get row
+ // Zur Sicherheit auf zul"assigen Bereich abfragen:
+ DBG_ASSERT( (USHORT)(nTopRow+nRelRow) >= 0 && (USHORT)(nTopRow+nRelRow) < nRowCount,
+ "BrowseBox::ImplPaintData: invalid seek" );
+ if ( (nTopRow+nRelRow) < 0 || (USHORT)(nTopRow+nRelRow) >= nRowCount )
+ continue;
+
+ // prepare row
+ ULONG nCurRow = nTopRow+nRelRow;
+ if ( !SeekRow( nCurRow) )
+ DBG_ERROR("BrowseBox::ImplPaintData: SeekRow gescheitert");
+ _rOut.SetClipRegion();
+ aPos.X() = aOverallAreaPos.X();
+
+
+ // #73325# don't paint the row outside the painting rectangle (DG)
+ // prepare auto-highlight
+ Rectangle aRowRect( Point( _rRect.TopLeft().X(), aPos.Y() ),
+ Size( _rRect.GetSize().Width(), nDataRowHeigt ) );
+ PaintRow( _rOut, aRowRect );
+
+ BOOL bRowAutoHighlight = _bDrawSelections
+ && !bHideSelect
+ && ((BrowserDataWin&)GetDataWindow()).bHighlightAuto
+ && IsRowSelected( nCurRow );
+ if ( bRowAutoHighlight )
+ {
+ _rOut.SetTextColor( rHighlightTextColor );
+ _rOut.SetFillColor( rHighlightFillColor );
+ _rOut.SetLineColor();
+ _rOut.DrawRect( aRowRect );
+ }
+
+ // iterate through columns to redraw
+ USHORT nCol;
+ for ( nCol = 0; nCol < pCols->Count(); ++nCol )
+ {
+ // get column
+ BrowserColumn *pCol = pCols->GetObject(nCol);
+
+ // at end of invalid area
+ if ( aPos.X() >= _rRect.Right() )
+ break;
+
+ // skip invisible colums between frozen and scrollable area
+ if ( nCol < nFirstCol && !pCol->IsFrozen() )
+ {
+ nCol = nFirstCol;
+ pCol = pCols->GetObject(nCol);
+ if (!pCol)
+ { // FS - 21.05.99 - 66325
+ // ist zwar eigentlich woanders (an der richtigen Stelle) gefixt, aber sicher ist sicher ...
+ DBG_ERROR("BrowseBox::PaintData : nFirstCol is probably invalid !");
+ break;
+ }
+ }
+
+ // prepare Column-AutoHighlight
+ BOOL bColAutoHighlight = _bDrawSelections
+ && bColumnCursor
+ && IsColumnSelected( pCol->GetId() );
+ if ( bColAutoHighlight )
+ {
+ _rOut.SetClipRegion();
+ _rOut.SetTextColor( rHighlightTextColor );
+ _rOut.SetFillColor( rHighlightFillColor );
+ _rOut.SetLineColor();
+ Rectangle aFieldRect( aPos,
+ Size( pCol->Width(), nDataRowHeigt ) );
+ _rOut.DrawRect( aFieldRect );
+ }
+
+ if (!m_bFocusOnlyCursor && (pCol->GetId() == GetCurColumnId()) && (nCurRow == GetCurRow()))
+ DrawCursor();
+
+ // draw a single field
+ // #63864#, Sonst wird auch etwas gezeichnet, bsp Handle Column
+ if (pCol->Width())
+ {
+ // clip the column's output to the field area
+ if (_bForeignDevice)
+ { // (not neccessary if painting onto the data window)
+ Size aFieldSize(pCol->Width(), nDataRowHeigt);
+
+ if (aPos.X() + aFieldSize.Width() > aOverallAreaBRPos.X())
+ aFieldSize.Width() = aOverallAreaBRPos.X() - aPos.X();
+
+ if (aPos.Y() + aFieldSize.Height() > aOverallAreaBRPos.Y() + 1)
+ {
+ // for non-handle cols we don't clip vertically : we just don't draw the cell if the line isn't completely visible
+ if (pCol->GetId() != 0)
+ continue;
+ aFieldSize.Height() = aOverallAreaBRPos.Y() + 1 - aPos.Y();
+ }
+
+ Region aClipToField(Rectangle(aPos, aFieldSize));
+ _rOut.SetClipRegion(aClipToField);
+ }
+ pCol->Draw( *this, _rOut, aPos, FALSE );
+ if (_bForeignDevice)
+ _rOut.SetClipRegion();
+ }
+
+ // reset Column-auto-highlight
+ if ( bColAutoHighlight )
+ {
+ _rOut.SetTextColor( aOldTextColor );
+ _rOut.SetFillColor( aOldFillColor );
+ _rOut.SetLineColor( aOldLineColor );
+ }
+
+ // skip column
+ aPos.X() += pCol->Width();
+ }
+
+ if ( nCol == pCols->Count() )
+ bRetouching = TRUE;
+
+ // reset auto-highlight
+ if ( bRowAutoHighlight )
+ {
+ _rOut.SetTextColor( aOldTextColor );
+ _rOut.SetFillColor( aOldFillColor );
+ _rOut.SetLineColor( aOldLineColor );
+ }
+
+ if ( bHLines )
+ {
+ // draw horizontal delimitation lines
+ _rOut.SetClipRegion();
+ Color aOldColor = _rOut.GetLineColor();
+ _rOut.SetLineColor( aLineColor );
+ long nY = aPos.Y() + nDataRowHeigt - 1;
+ if (nY <= aOverallAreaBRPos.Y())
+ _rOut.DrawLine( Point( nHLineX, nY ),
+ Point( bVLines
+ ? min(long(long(aPos.X()) - 1), aOverallAreaBRPos.X())
+ : aOverallAreaBRPos.X(),
+ nY ) );
+ _rOut.SetLineColor( aOldColor );
+ }
+ }
+
+ if (aPos.Y() > aOverallAreaBRPos.Y() + 1)
+ aPos.Y() = aOverallAreaBRPos.Y() + 1;
+ // needed for some of the following drawing
+
+ // retouching
+ _rOut.SetClipRegion();
+ aOldLineColor = _rOut.GetLineColor();
+ aOldFillColor = _rOut.GetFillColor();
+ _rOut.SetFillColor( rSettings.GetFaceColor() );
+ if ( pCols->Count() && ( pCols->GetObject(0)->GetId() == 0 ) && ( aPos.Y() <= _rRect.Bottom() ) )
+ {
+ // fill rectangle gray below handle column
+ // DG: fill it only until the end of the drawing rect and not to the end, as this may overpaint handle columns
+ _rOut.SetLineColor( Color( COL_BLACK ) );
+ _rOut.DrawRect( Rectangle(
+ Point( aOverallAreaPos.X() - 1, aPos.Y() - 1 ),
+ Point( aOverallAreaPos.X() + pCols->GetObject(0)->Width() - 1,
+ _rRect.Bottom() + 1) ) );
+ }
+ _rOut.SetFillColor( aOldFillColor );
+
+ // draw vertical delimitational line between frozen and scrollable cols
+ _rOut.SetLineColor( COL_BLACK );
+ long nFrozenWidth = GetFrozenWidth()-1;
+ _rOut.DrawLine( Point( aOverallAreaPos.X() + nFrozenWidth, aPos.Y() ),
+ Point( aOverallAreaPos.X() + nFrozenWidth, bHLines
+ ? aPos.Y() - 1
+ : aOverallAreaBRPos.Y() ) );
+
+ // draw vertical delimitational lines?
+ if ( bVLines )
+ {
+ _rOut.SetLineColor( aLineColor );
+ Point aVertPos( aOverallAreaPos.X() - 1, aOverallAreaPos.Y() );
+ long nDeltaY = aOverallAreaBRPos.Y();
+ for ( USHORT nCol = 0; nCol < pCols->Count(); ++nCol )
+ {
+ // get column
+ BrowserColumn *pCol = pCols->GetObject(nCol);
+
+ // skip invisible colums between frozen and scrollable area
+ if ( nCol < nFirstCol && !pCol->IsFrozen() )
+ {
+ nCol = nFirstCol;
+ pCol = pCols->GetObject(nCol);
+ }
+
+ // skip column
+ aVertPos.X() += pCol->Width();
+
+ // at end of invalid area
+ // invalid area is first reached when X > Right
+ // and not >=
+ if ( aVertPos.X() > _rRect.Right() )
+ break;
+
+ // draw a single line
+ if ( pCol->GetId() != 0 )
+ _rOut.DrawLine( aVertPos, Point( aVertPos.X(),
+ bHLines
+ ? aPos.Y() - 1
+ : aPos.Y() + nDeltaY ) );
+ }
+ }
+
+ _rOut.SetLineColor( aOldLineColor );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::PaintData( Window& rWin, const Rectangle& rRect )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ if ( !bBootstrapped && IsReallyVisible() )
+ BrowseBox::StateChanged( STATE_CHANGE_INITSHOW );
+
+ // initializations
+ if ( !pCols || !pCols->Count() || !rWin.IsUpdateMode() )
+ return;
+ if ( ((BrowserDataWin*)pDataWin)->bResizeOnPaint )
+ Resize();
+ // MI: wer war das denn? Window::Update();
+
+ ImplPaintData(rWin, rRect, FALSE, TRUE);
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::UpdateScrollbars()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( !bBootstrapped || !IsUpdateMode() )
+ return;
+
+ // Rekursionsschutz
+ BrowserDataWin *pBDW = (BrowserDataWin*) pDataWin;
+ if ( pBDW->bInUpdateScrollbars )
+ {
+ pBDW->bHadRecursion = TRUE;
+ return;
+ }
+ pBDW->bInUpdateScrollbars = TRUE;
+
+ // the size of the corner window (and the width of the VSB/height of the HSB)
+ ULONG nCornerSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ if (IsZoom())
+ nCornerSize = (ULONG)(nCornerSize * (double)GetZoom());
+
+ // needs VScroll?
+ long nMaxRows = (pDataWin->GetSizePixel().Height()) / GetDataRowHeight();
+ BOOL bNeedsVScroll = ((BrowserDataWin*)pDataWin)->bAutoVScroll
+ ? nTopRow || nRowCount > nMaxRows
+ : TRUE;
+ Size aDataWinSize = pDataWin->GetSizePixel();
+ if ( !bNeedsVScroll )
+ {
+ if ( pVScroll->IsVisible() )
+ {
+ pVScroll->Hide();
+ Size aNewSize( aDataWinSize );
+ aNewSize.Width() = GetOutputSizePixel().Width();
+ aDataWinSize = aNewSize;
+ }
+ }
+ else if ( !pVScroll->IsVisible() )
+ {
+ Size aNewSize( aDataWinSize );
+ aNewSize.Width() = GetOutputSizePixel().Width() - nCornerSize;
+ aDataWinSize = aNewSize;
+ }
+
+ // needs HScroll?
+ ULONG nLastCol = GetColumnAtXPosPixel( aDataWinSize.Width() - 1 );
+
+ USHORT nFrozenCols = FrozenColCount();
+ BOOL bNeedsHScroll = ((BrowserDataWin*)pDataWin)->bAutoHScroll
+ ? nFirstCol > nFrozenCols || nLastCol <= pCols->Count()
+ : !((BrowserDataWin*)pDataWin)->bNoHScroll;
+ if ( !bNeedsHScroll )
+ {
+ if ( aHScroll.IsVisible() )
+ {
+ aHScroll.Hide();
+ Size aNewSize( aDataWinSize );
+ aNewSize.Height() = GetOutputSizePixel().Height() - GetTitleHeight();
+ aDataWinSize = aNewSize;
+ }
+ }
+ else if ( !aHScroll.IsVisible() )
+ {
+ Size aNewSize( aDataWinSize );
+ aNewSize.Height() = GetOutputSizePixel().Height() - GetTitleHeight() - nCornerSize;
+ aDataWinSize = aNewSize;
+ }
+
+ // adjust position and Width of horizontal scrollbar
+ ULONG nHScrX = nControlAreaWidth == USHRT_MAX
+ ? GetFrozenWidth() - 1
+ : nControlAreaWidth;
+
+ aHScroll.SetPosSizePixel(
+ Point( nHScrX, GetOutputSizePixel().Height() - nCornerSize ),
+ Size( aDataWinSize.Width() - nHScrX, nCornerSize ) );
+
+ // Scrollable Columns insgesamt
+ short nScrollCols = short(pCols->Count()) - (short)nFrozenCols;
+ /*short nVisibleHSize= max(nLastCol == BROWSER_INVALIDID
+ ? pCols->Count() - nFirstCol -1
+ : nLastCol - nFirstCol - 1, 0);
+
+ aHScroll.SetVisibleSize( nVisibleHSize );
+ aHScroll.SetRange( Range( 0, Max( min(nScrollCols, nVisibleHSize), (short)0 ) ) );
+ if ( bNeedsHScroll && !aHScroll.IsVisible() )
+ aHScroll.Show();*/
+
+ // Sichtbare Columns
+ short nVisibleHSize = nLastCol == BROWSER_INVALIDID
+ ? (short)( pCols->Count() - nFirstCol )
+ : (short)( nLastCol - nFirstCol );
+
+ short nRange = Max( nScrollCols, (short)0 );
+ aHScroll.SetVisibleSize( nVisibleHSize );
+ aHScroll.SetRange( Range( 0, nRange ));
+ if ( bNeedsHScroll && !aHScroll.IsVisible() )
+ aHScroll.Show();
+
+ // adjust position and height of vertical scrollbar
+ pVScroll->SetPageSize( nMaxRows );
+
+ if ( nTopRow > nRowCount )
+ {
+ nTopRow = nRowCount - 1;
+ DBG_ERROR("BrowseBox: nTopRow > nRowCount");
+ }
+
+ if ( pVScroll->GetThumbPos() != nTopRow )
+ pVScroll->SetThumbPos( nTopRow );
+ long nVisibleSize = Min( Min( nRowCount, nMaxRows ), long(nRowCount-nTopRow) );
+ pVScroll->SetVisibleSize( nVisibleSize ? nVisibleSize : 1 );
+ pVScroll->SetRange( Range( 0, nRowCount ) );
+ pVScroll->SetPosSizePixel(
+ Point( aDataWinSize.Width(), GetTitleHeight() ),
+ Size( nCornerSize, aDataWinSize.Height() ) );
+ if ( nRowCount <
+ long( aDataWinSize.Height() / GetDataRowHeight() ) )
+ ScrollRows( -nTopRow );
+ long nDelta = nCornerSize;
+ if ( bNeedsVScroll && !pVScroll->IsVisible() )
+ pVScroll->Show();
+
+ pDataWin->SetSizePixel( aDataWinSize );
+
+ // needs corner-window?
+ // (do that AFTER positioning BOTH scrollbars)
+ if ( aHScroll.IsVisible() && pVScroll && pVScroll->IsVisible() )
+ {
+ if ( !( (BrowserDataWin*)pDataWin )->pCornerWin )
+ ( (BrowserDataWin*)pDataWin )->pCornerWin = new ScrollBarBox( this, WB_3DLOOK );
+ ( (BrowserDataWin*)pDataWin )->pCornerWin->SetPosSizePixel(
+ Point( pVScroll->GetPosPixel().X(), aHScroll.GetPosPixel().Y() ),
+ Size( nCornerSize, nCornerSize ) );
+ ( (BrowserDataWin*)pDataWin )->pCornerWin->Show();
+ }
+ else
+ DELETEZ( ( (BrowserDataWin*)pDataWin )->pCornerWin );
+
+ // ggf. Headerbar mitscrollen
+ if ( ((BrowserDataWin*)pDataWin)->pHeaderBar )
+ {
+ long nWidth = 0;
+ for ( USHORT nCol = 0;
+ nCol < pCols->Count() && nCol < nFirstCol;
+ ++nCol )
+ {
+ // HandleColumn nicht
+ if ( pCols->GetObject(nCol)->GetId() )
+ nWidth += pCols->GetObject(nCol)->Width();
+ }
+
+ ((BrowserDataWin*)pDataWin)->pHeaderBar->SetOffset( nWidth );
+ }
+
+ pBDW->bInUpdateScrollbars = FALSE;
+ if ( pBDW->bHadRecursion )
+ {
+ pBDW->bHadRecursion = FALSE;
+ UpdateScrollbars();
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::Invalidate()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // readjust cursor and selection
+ if ( bMultiSelection )
+ uRow.pSel->SetTotalRange( Range( 0, nRowCount-1 ) );
+ else
+ uRow.nSel = Min( uRow.nSel, (long)(nRowCount-1) );
+ nCurRow = Min( nCurRow, (long)(nRowCount-1 ));
+
+ // BowseBox::Resize(); if Size not set, last Culumn will be cuttet ?!?
+ Control::Invalidate(INVALIDATE_NOCHILDREN /*OV*/ );
+ ((BrowserDataWin*)pDataWin)->Invalidate();
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetUpdateMode( BOOL bUpdate )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ BOOL bWasUpdate = IsUpdateMode();
+ if ( bWasUpdate == bUpdate )
+ return;
+
+ Control::SetUpdateMode( bUpdate );
+ // OV
+ // Wenn an der BrowseBox WB_CLIPCHILDREN gesetzt ist (wg. Flackerminimierung),
+ // wird das Datenfenster nicht von SetUpdateMode invalidiert.
+ if( bUpdate )
+ ((BrowserDataWin*)pDataWin)->Invalidate();
+ ((BrowserDataWin*)pDataWin)->SetUpdateMode( bUpdate );
+
+
+ if ( bUpdate )
+ {
+ if ( bBootstrapped )
+ {
+ UpdateScrollbars();
+ AutoSizeLastColumn();
+ }
+ DoShowCursor( "SetUpdateMode" );
+ }
+ else
+ DoHideCursor( "SetUpdateMode" );
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::GetUpdateMode() const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return ((BrowserDataWin*)pDataWin)->IsUpdateMode();
+}
+
+//-------------------------------------------------------------------
+
+long BrowseBox::GetFrozenWidth() const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ long nWidth = 0;
+ for ( USHORT nCol = 0;
+ nCol < pCols->Count() && pCols->GetObject(nCol)->IsFrozen();
+ ++nCol )
+ nWidth += pCols->GetObject(nCol)->Width();
+ return nWidth;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::ColumnInserted( USHORT nPos )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( pColSel )
+ pColSel->Insert( nPos );
+ UpdateScrollbars();
+}
+
+//-------------------------------------------------------------------
+
+USHORT BrowseBox::FrozenColCount() const
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ USHORT nCol;
+ for ( nCol = 0;
+ nCol < pCols->Count() && pCols->GetObject(nCol)->IsFrozen();
+ ++nCol )
+ /* empty loop */;
+ return nCol;
+}
+
+//-------------------------------------------------------------------
+
+IMPL_LINK(BrowseBox,ScrollHdl,ScrollBar*,pBar)
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( pBar->GetDelta() == 0 )
+ return 0;
+
+ if ( pBar->GetDelta() < 0 && ((BrowserDataWin*)pDataWin)->bNoScrollBack )
+ {
+ UpdateScrollbars();
+ return 0;
+ }
+
+ if ( pBar == &aHScroll )
+ ScrollColumns( aHScroll.GetDelta() );
+ if ( pBar == pVScroll )
+ ScrollRows( pVScroll->GetDelta() );
+
+ return 0;
+}
+
+//-------------------------------------------------------------------
+
+IMPL_LINK( BrowseBox,EndScrollHdl,ScrollBar*, pBar )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // kein Focus grabben!
+ /// GrabFocus();
+
+ if ( /*pBar->GetDelta() <= 0 &&*/ ((BrowserDataWin*)pDataWin)->bNoScrollBack )
+ {
+ // UpdateScrollbars();
+ EndScroll();
+ return 0;
+ }
+
+ return 0;
+}
+
+//-------------------------------------------------------------------
+
+IMPL_LINK( BrowseBox, StartDragHdl, HeaderBar*, pBar )
+{
+ pBar->SetDragSize( pDataWin->GetOutputSizePixel().Height() );
+ return 0;
+}
+
+//-------------------------------------------------------------------
+// MI: es wurde immer nur die 1. Spalte resized
+#pragma optimize("elg",off)
+
+void BrowseBox::MouseButtonDown( const MouseEvent& rEvt )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ GrabFocus();
+
+ // onl< mouse events in the title-line are supported
+ const Point &rEvtPos = rEvt.GetPosPixel();
+ if ( rEvtPos.Y() >= GetTitleHeight() )
+ return;
+
+ long nX = 0;
+ long nWidth = GetOutputSizePixel().Width();
+ for ( USHORT nCol = 0; nCol < pCols->Count() && nX < nWidth; ++nCol )
+ {
+ // is this column visible?
+ BrowserColumn *pCol = pCols->GetObject(nCol);
+ if ( pCol->IsFrozen() || nCol >= nFirstCol )
+ {
+ // compute right end of column
+ long nR = nX + pCol->Width() - 1;
+
+ // at the end of a column (and not handle column)?
+ if ( pCol->GetId() && Abs( nR - rEvtPos.X() ) < 2 )
+ {
+ // start resizing the column
+ bResizing = TRUE;
+ nResizeCol = nCol;
+ nDragX = nResizeX = rEvtPos.X();
+ SetPointer( Pointer( POINTER_HSPLIT ) );
+ CaptureMouse();
+ pDataWin->DrawLine( Point( nDragX, 0 ),
+ Point( nDragX, pDataWin->GetSizePixel().Height() ) );
+ nMinResizeX = nX + MIN_COLUMNWIDTH;
+ return;
+ }
+ else if ( nX < rEvtPos.X() && nR > rEvtPos.X() )
+ {
+ MouseButtonDown( BrowserMouseEvent(
+ this, rEvt, -1, nCol, pCol->GetId(), Rectangle() ) );
+ return;
+ }
+ nX = nR + 1;
+ }
+ }
+
+ // event occured out of data area
+ if ( rEvt.IsRight() )
+ pDataWin->Command(
+ CommandEvent( Point( 1, LONG_MAX ), COMMAND_CONTEXTMENU, TRUE ) );
+ else
+ SetNoSelection();
+}
+
+#pragma optimize("",on)
+
+//-------------------------------------------------------------------
+
+void BrowseBox::MouseMove( const MouseEvent& rEvt )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ Pointer aNewPointer;
+
+ USHORT nX = 0;
+ for ( USHORT nCol = 0;
+ nCol < USHORT(pCols->Count()) &&
+ ( nX + pCols->GetObject(nCol)->Width() ) < USHORT(GetOutputSizePixel().Width());
+ ++nCol )
+ // is this column visible?
+ if ( pCols->GetObject(nCol)->IsFrozen() || nCol >= nFirstCol )
+ {
+ // compute right end of column
+ BrowserColumn *pCol = pCols->GetObject(nCol);
+ USHORT nR = (USHORT)(nX + pCol->Width() - 1);
+
+ // show resize-pointer?
+ if ( bResizing || ( pCol->GetId() &&
+ Abs( ((long) nR ) - rEvt.GetPosPixel().X() ) < MIN_COLUMNWIDTH ) )
+ {
+ aNewPointer = Pointer( POINTER_HSPLIT );
+ if ( bResizing )
+ {
+ // alte Hilfslinie loeschen
+ pDataWin->HideTracking() ;
+
+ // erlaubte breite abholen und neues Delta
+ nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX );
+ long nDeltaX = nDragX - nResizeX;
+ USHORT nId = GetColumnId(nResizeCol);
+ ULONG nOldWidth = GetColumnWidth(nId);
+ nDragX = QueryColumnResize( GetColumnId(nResizeCol),
+ nOldWidth + nDeltaX )
+ + nResizeX - nOldWidth;
+
+ // neue Hilfslinie zeichnen
+ pDataWin->ShowTracking( Rectangle( Point( nDragX, 0 ),
+ Size( 1, pDataWin->GetSizePixel().Height() ) ),
+ SHOWTRACK_SPLIT|SHOWTRACK_WINDOW );
+ }
+
+ }
+
+ nX = nR + 1;
+ }
+
+ SetPointer( aNewPointer );
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::MouseButtonUp( const MouseEvent & rEvt )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ if ( bResizing )
+ {
+ // Hilfslinie loeschen
+ pDataWin->HideTracking();
+
+ // width changed?
+ nDragX = Max( rEvt.GetPosPixel().X(), nMinResizeX );
+ if ( (nDragX - nResizeX) != (long)pCols->GetObject(nResizeCol)->Width() )
+ {
+ // resize column
+ long nMaxX = pDataWin->GetSizePixel().Width();
+ nDragX = Min( nDragX, nMaxX );
+ long nDeltaX = nDragX - nResizeX;
+ USHORT nId = GetColumnId(nResizeCol);
+ SetColumnWidth( GetColumnId(nResizeCol), GetColumnWidth(nId) + nDeltaX );
+ ColumnResized( nId );
+ }
+
+ // end action
+ SetPointer( Pointer() );
+ ReleaseMouse();
+ bResizing = FALSE;
+ }
+ else
+ MouseButtonUp( BrowserMouseEvent( (BrowserDataWin*)pDataWin,
+ MouseEvent( Point( rEvt.GetPosPixel().X(),
+ rEvt.GetPosPixel().Y() - pDataWin->GetPosPixel().Y() ),
+ rEvt.GetClicks(), rEvt.GetMode(), rEvt.GetButtons(),
+ rEvt.GetModifier() ) ) );
+}
+
+//-------------------------------------------------------------------
+
+BOOL bExtendedMode = FALSE;
+BOOL bFieldMode = FALSE;
+
+void BrowseBox::MouseButtonDown( const BrowserMouseEvent& rEvt )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ GrabFocus();
+
+ // adjust selection while and after double-click
+ if ( rEvt.GetClicks() == 2 )
+ {
+ SetNoSelection();
+ if ( rEvt.GetRow() >= 0 )
+ {
+ GoToRow( rEvt.GetRow() );
+ SelectRow( rEvt.GetRow(), TRUE, FALSE );
+ }
+ else if ( bColumnCursor && rEvt.GetColumn() != 0 )
+ SelectColumnPos( rEvt.GetColumn(), TRUE, FALSE);
+ DoubleClick( rEvt );
+ }
+ // selections
+ else if ( ( rEvt.GetMode() & ( MOUSE_SELECT | MOUSE_SIMPLECLICK ) ) &&
+ ( bColumnCursor || rEvt.GetRow() >= 0 ) )
+ {
+ if ( rEvt.GetClicks() == 1 )
+ {
+ // initialise flags
+ bDrag = FALSE;
+ bHit = FALSE;
+ bRubber = FALSE;
+ a1stPoint =
+ a2ndPoint = PixelToLogic( rEvt.GetPosPixel() );
+
+ // selection out of range?
+ if ( rEvt.GetRow() >= nRowCount ||
+ rEvt.GetColumnId() == BROWSER_INVALIDID )
+ {
+ SetNoSelection();
+ return;
+ }
+
+ // while selecting, no cursor
+ bSelecting = TRUE;
+ DoHideCursor( "MouseButtonDown" );
+
+ // DataRow?
+ if ( rEvt.GetRow() >= 0 )
+ {
+ // Zeilenselektion?
+ if ( rEvt.GetColumnId() == 0 || !bColumnCursor )
+ {
+ if ( bMultiSelection )
+ {
+ // remove column-selection, if exists
+ if ( pColSel && pColSel->GetSelectCount() )
+ {
+ ToggleSelection();
+ if ( bMultiSelection )
+ uRow.pSel->SelectAll(FALSE);
+ else
+ uRow.nSel = BROWSER_ENDOFSELECTION;
+ if ( pColSel )
+ pColSel->SelectAll(FALSE);
+ bSelect = TRUE;
+ }
+
+ // expanding mode?
+ if ( rEvt.GetMode() & MOUSE_RANGESELECT )
+ {
+ // select the further touched rows too
+ bSelect = TRUE;
+ ExpandRowSelection( rEvt );
+ return;
+ }
+
+ // click in the selected area?
+ else if ( IsRowSelected( rEvt.GetRow() ) )
+ {
+ // auf Drag&Drop warten
+ bHit = TRUE;
+ bExtendedMode = MOUSE_MULTISELECT ==
+ ( rEvt.GetMode() & MOUSE_MULTISELECT );
+ return;
+ }
+
+ // extension mode?
+ else if ( rEvt.GetMode() & MOUSE_MULTISELECT )
+ {
+ // determine the new selection range
+ // and selection/deselection
+ aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
+ SelectRow( rEvt.GetRow(),
+ !uRow.pSel->IsSelected( rEvt.GetRow() ) );
+ bSelect = TRUE;
+ return;
+ }
+ }
+
+ // select directly
+ SetNoSelection();
+ GoToRow( rEvt.GetRow() );
+ SelectRow( rEvt.GetRow(), TRUE );
+ aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
+ bSelect = TRUE;
+ }
+ else // Column/Field-Selection
+ {
+ // click in selected column
+ if ( IsColumnSelected( rEvt.GetColumn() ) ||
+ IsRowSelected( rEvt.GetRow() ) )
+ {
+ bHit = TRUE;
+ bFieldMode = TRUE;
+ return;
+ }
+
+ SetNoSelection();
+ GoToRowColumnId( rEvt.GetRow(), rEvt.GetColumnId() );
+ bSelect = TRUE;
+ }
+ }
+ else
+ {
+ if ( bMultiSelection && rEvt.GetColumnId() == 0 )
+ {
+ // toggle all-selection
+ if ( uRow.pSel->GetSelectCount() > ( GetRowCount() / 2 ) )
+ SetNoSelection();
+ else
+ SelectAll();
+ }
+ else
+ SelectColumnId( rEvt.GetColumnId(), TRUE, FALSE );
+ }
+
+ // ggf. Cursor wieder an
+ bSelecting = FALSE;
+ DoShowCursor( "MouseButtonDown" );
+ if ( bSelect )
+ Select();
+ }
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::MouseMove( const BrowserMouseEvent &rEvt )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::MouseButtonUp( const BrowserMouseEvent &rEvt )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ // D&D was possible, but did not occur
+ if ( bHit )
+ {
+ aSelRange = Range( rEvt.GetRow(), rEvt.GetRow() );
+ if ( bExtendedMode )
+ SelectRow( rEvt.GetRow(), FALSE );
+ else
+ {
+ SetNoSelection();
+ if ( bFieldMode )
+ GoToRowColumnId( rEvt.GetRow(), rEvt.GetColumnId() );
+ else
+ {
+ GoToRow( rEvt.GetRow() );
+ SelectRow( rEvt.GetRow(), TRUE );
+ }
+ }
+ bSelect = TRUE;
+ bExtendedMode = FALSE;
+ bFieldMode = FALSE;
+ bHit = FALSE;
+ }
+
+ // activate cursor
+ if ( bSelecting )
+ {
+ bSelecting = FALSE;
+ DoShowCursor( "MouseButtonUp" );
+ if ( bSelect )
+ Select();
+ }
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::Drop( const BrowserDropEvent& )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return FALSE;
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::QueryDrop( const BrowserDropEvent& )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ return FALSE;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::KeyInput( const KeyEvent& rEvt )
+{
+ if ( !ProcessKey( rEvt ) )
+ Control::KeyInput( rEvt );
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowseBox::ProcessKey( const KeyEvent& rEvt )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ USHORT nCode = rEvt.GetKeyCode().GetCode();
+ BOOL bShift = rEvt.GetKeyCode().IsShift();
+ BOOL bCtrl = rEvt.GetKeyCode().IsMod1();
+ BOOL bAlt = rEvt.GetKeyCode().IsMod2();
+
+ USHORT nId = BROWSER_NONE;
+
+ if ( !bAlt && !bCtrl && !bShift )
+ {
+ switch ( nCode )
+ {
+ case KEY_DOWN: nId = BROWSER_CURSORDOWN; break;
+ case KEY_UP: nId = BROWSER_CURSORUP; break;
+ case KEY_HOME: nId = BROWSER_CURSORHOME; break;
+ case KEY_END: nId = BROWSER_CURSOREND; break;
+ case KEY_TAB:
+ if ( !bColumnCursor )
+ break;
+ case KEY_RIGHT: nId = BROWSER_CURSORRIGHT; break;
+ case KEY_LEFT: nId = BROWSER_CURSORLEFT; break;
+ case KEY_SPACE: nId = BROWSER_SELECT; break;
+ }
+ if ( BROWSER_NONE != nId )
+ SetNoSelection();
+
+ switch ( nCode )
+ {
+ case KEY_PAGEDOWN: nId = BROWSER_CURSORPAGEDOWN; break;
+ case KEY_PAGEUP: nId = BROWSER_CURSORPAGEUP; break;
+ }
+ }
+
+ if ( !bAlt && !bCtrl && bShift )
+ switch ( nCode )
+ {
+ case KEY_DOWN: nId = BROWSER_SELECTDOWN; break;
+ case KEY_UP: nId = BROWSER_SELECTUP; break;
+ case KEY_TAB:
+ if ( !bColumnCursor )
+ break;
+ nId = BROWSER_CURSORLEFT; break;
+ case KEY_HOME: nId = BROWSER_SELECTHOME; break;
+ case KEY_END: nId = BROWSER_SELECTEND; break;
+ }
+
+
+ if ( !bAlt && bCtrl && !bShift )
+ switch ( nCode )
+ {
+ case KEY_DOWN: nId = BROWSER_CURSORDOWN; break;
+ case KEY_UP: nId = BROWSER_CURSORUP; break;
+ case KEY_PAGEDOWN: nId = BROWSER_CURSORENDOFFILE; break;
+ case KEY_PAGEUP: nId = BROWSER_CURSORTOPOFFILE; break;
+ case KEY_HOME: nId = BROWSER_CURSORTOPOFSCREEN; break;
+ case KEY_END: nId = BROWSER_CURSORENDOFSCREEN; break;
+ case KEY_SPACE: nId = BROWSER_ENHANCESELECTION; break;
+ }
+
+ if ( nId != BROWSER_NONE )
+ Dispatch( nId );
+ return nId != BROWSER_NONE;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::Dispatch( USHORT nId )
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+
+ long nRowsOnPage = pDataWin->GetSizePixel().Height() / GetDataRowHeight();
+ BOOL bDone = FALSE;
+
+ switch ( nId )
+ {
+ case BROWSER_CURSORDOWN:
+ if ( ( GetCurRow() + 1 ) < nRowCount )
+ bDone = GoToRow( GetCurRow() + 1, FALSE );
+ break;
+ case BROWSER_CURSORUP:
+ if ( GetCurRow() > 0 )
+ bDone = GoToRow( GetCurRow() - 1, FALSE );
+ break;
+ case BROWSER_SELECTHOME:
+ {
+ DoHideCursor( "BROWSER_SELECTHOME" );
+ for ( long nRow = GetCurRow(); nRow >= 0; --nRow )
+ SelectRow( nRow );
+ GoToRow( 0, TRUE );
+ DoShowCursor( "BROWSER_SELECTHOME" );
+ break;
+ }
+ case BROWSER_SELECTEND:
+ {
+ DoHideCursor( "BROWSER_SELECTEND" );
+ long nRowCount = GetRowCount();
+ for ( long nRow = GetCurRow(); nRow < nRowCount; ++nRow )
+ SelectRow( nRow );
+ GoToRow( GetRowCount() - 1, TRUE );
+ DoShowCursor( "BROWSER_SELECTEND" );
+ break;
+ }
+ case BROWSER_SELECTDOWN:
+ {
+ if ( ( GetCurRow() + 1 ) < nRowCount )
+ {
+ // deselect the current row, if it isn't the first
+ // and there is no other selected row above
+ long nCurRow = GetCurRow();
+ BOOL bSelect = ( !IsRowSelected( nCurRow ) ||
+ GetSelectRowCount() == 1 || IsRowSelected( nCurRow - 1 ) );
+ SelectRow( nCurRow, bSelect, TRUE );
+ if ( bDone = GoToRow( GetCurRow() + 1 , FALSE ) )
+ SelectRow( GetCurRow(), TRUE, TRUE );
+ }
+ else
+ bDone = ScrollRows( 1 ) != 0;
+ break;
+ }
+ case BROWSER_SELECTUP:
+ {
+ // deselect the current row, if it isn't the first
+ // and there is no other selected row under
+ long nCurRow = GetCurRow();
+ BOOL bSelect = ( !IsRowSelected( nCurRow ) ||
+ GetSelectRowCount() == 1 || IsRowSelected( nCurRow + 1 ) );
+ SelectRow( nCurRow, bSelect, TRUE );
+ if ( bDone = GoToRow( nCurRow - 1 , FALSE ) )
+ SelectRow( GetCurRow(), TRUE, TRUE );
+ break;
+ }
+ case BROWSER_CURSORPAGEDOWN:
+ bDone = (BOOL)ScrollRows( nRowsOnPage );
+ break;
+ case BROWSER_CURSORPAGEUP:
+ bDone = (BOOL)ScrollRows( -nRowsOnPage );
+ break;
+ case BROWSER_CURSOREND:
+ if ( bColumnCursor )
+ {
+ USHORT nNewId = GetColumnId(ColCount() -1);
+ bDone = (nNewId != 0) && GoToColumnId( nNewId );
+ break;
+ }
+ case BROWSER_CURSORENDOFFILE:
+ bDone = GoToRow( nRowCount - 1, FALSE );
+ break;
+ case BROWSER_CURSORRIGHT:
+ if ( bColumnCursor )
+ {
+ USHORT nNewPos = GetColumnPos( GetCurColumnId() ) + 1;
+ USHORT nNewId = GetColumnId( nNewPos );
+ if (nNewId != 0) // Am Zeilenende ?
+ bDone = GoToColumnId( nNewId );
+ else
+ {
+ USHORT nColId = ( GetColumnId(0) == 0 ) ? GetColumnId(1) : GetColumnId(0);
+ bDone = ( nCurRow < GetRowCount() - 1 ) && GoToRowColumnId( nCurRow + 1, nColId );
+ }
+ }
+ else
+ bDone = ScrollColumns( 1 ) != 0;
+ break;
+ case BROWSER_CURSORHOME:
+ if ( bColumnCursor )
+ {
+ USHORT nNewId = GetColumnId(1);
+ bDone = (nNewId != 0) && GoToColumnId( nNewId );
+ break;
+ }
+ case BROWSER_CURSORTOPOFFILE:
+ bDone = GoToRow( 0, FALSE );
+ break;
+ case BROWSER_CURSORLEFT:
+ if ( bColumnCursor )
+ {
+ USHORT nNewPos = GetColumnPos( GetCurColumnId() ) - 1;
+ USHORT nNewId = GetColumnId( nNewPos );
+ if (nNewId != 0)
+ bDone = GoToColumnId( nNewId );
+ else
+ bDone = (nCurRow > 0) && GoToRowColumnId(nCurRow - 1, GetColumnId(ColCount() -1));
+ }
+ else
+ bDone = ScrollColumns( -1 ) != 0;
+ break;
+ case BROWSER_ENHANCESELECTION:
+ SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), TRUE );
+ bDone = TRUE;
+ break;
+ case BROWSER_SELECT:
+ SelectRow( GetCurRow(), !IsRowSelected( GetCurRow() ), FALSE );
+ bDone = TRUE;
+ break;
+ }
+
+ //! return bDone;
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::LoseFocus()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ DBG_TRACE1( "BrowseBox: %p->LoseFocus", this );
+
+ if ( bHasFocus )
+ {
+ DBG_TRACE1( "BrowseBox: %p->HideCursor", this );
+ DoHideCursor( "LoseFocus" );
+
+ if ( !bKeepHighlight )
+ {
+ ToggleSelection();
+ bSelectionIsVisible = FALSE;
+ }
+
+ bHasFocus = FALSE;
+ }
+ Control::LoseFocus();
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::GetFocus()
+{
+ DBG_CHKTHIS(BrowseBox,BrowseBoxCheckInvariants);
+ DBG_TRACE1( "BrowseBox: %p->GetFocus", this );
+
+ if ( !bHasFocus )
+ {
+ if ( !bSelectionIsVisible )
+ {
+ bSelectionIsVisible = TRUE;
+ if ( bBootstrapped )
+ ToggleSelection();
+ }
+
+ bHasFocus = TRUE;
+ DoShowCursor( "GetFocus" );
+ }
+ Control::GetFocus();
+}
+
+//-------------------------------------------------------------------
+
+void BrowseBox::SetCursorColor(const Color& _rCol)
+{
+ if (_rCol == m_aCursorColor)
+ return;
+
+ // ensure the cursor is hidden
+ DoHideCursor("SetCursorColor");
+ if (!m_bFocusOnlyCursor)
+ DoHideCursor("SetCursorColor - force");
+
+ m_aCursorColor = _rCol;
+
+ if (!m_bFocusOnlyCursor)
+ DoShowCursor("SetCursorColor - force");
+ DoShowCursor("SetCursorColor");
+}
+
+
diff --git a/svtools/source/brwbox/brwhead.cxx b/svtools/source/brwbox/brwhead.cxx
new file mode 100644
index 000000000000..f38be0045746
--- /dev/null
+++ b/svtools/source/brwbox/brwhead.cxx
@@ -0,0 +1,144 @@
+/*************************************************************************
+ *
+ * $RCSfile: brwhead.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "brwhead.hxx"
+#include "brwbox.hxx"
+
+#pragma hdrstop
+
+//===================================================================
+
+BrowserHeader::BrowserHeader( BrowseBox* pParent, WinBits nWinBits )
+: HeaderBar( pParent, nWinBits ),
+ _pBrowseBox( pParent )
+{
+ long nHeight = pParent->IsZoom() ? pParent->CalcZoom(nHeight) : pParent->GetTitleHeight();
+
+ SetPosSizePixel( Point( 0, 0),
+ Size( pParent->GetOutputSizePixel().Width(),
+ nHeight ) );
+ Show();
+}
+
+//-------------------------------------------------------------------
+
+void BrowserHeader::Command( const CommandEvent& rCEvt )
+{
+ if ( !GetCurItemId() && COMMAND_CONTEXTMENU == rCEvt.GetCommand() )
+ {
+ Point aPos( rCEvt.GetMousePosPixel() );
+ _pBrowseBox->GetDataWindow().Command( CommandEvent(
+ Point( aPos.X(), aPos.Y() - GetSizePixel().Height() ),
+ COMMAND_CONTEXTMENU, rCEvt.IsMouseEvent() ) );
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowserHeader::Select()
+{
+ HeaderBar::Select();
+}
+
+//-------------------------------------------------------------------
+
+void BrowserHeader::EndDrag()
+{
+ // call before other actions, it looks more nice in most cases
+ HeaderBar::EndDrag();
+ Update();
+
+ // not aborted?
+ USHORT nId = GetCurItemId();
+ if ( nId )
+ {
+ // Handle-Column?
+ if ( nId == USHRT_MAX-1 )
+ nId = 0;
+
+ if ( !IsItemMode() )
+ {
+ // column resize
+ _pBrowseBox->SetColumnWidth( nId, GetItemSize( nId ) );
+ _pBrowseBox->ColumnResized( nId );
+ SetItemSize( nId, _pBrowseBox->GetColumnWidth( nId ) );
+ }
+ else
+ {
+ // column drag
+ // Hat sich die Position eigentlich veraendert
+ // Handlecolumn beruecksichtigen
+ USHORT nOldPos = _pBrowseBox->GetColumnPos(nId),
+ nNewPos = GetItemPos( nId );
+
+ if (!_pBrowseBox->GetColumnId(0)) // Handle
+ nNewPos++;
+
+ if (nOldPos != nNewPos)
+ {
+ _pBrowseBox->SetColumnPos( nId, nNewPos );
+ _pBrowseBox->ColumnMoved( nId );
+ }
+ }
+ }
+}
+
+
diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx
new file mode 100644
index 000000000000..3bf03276acf7
--- /dev/null
+++ b/svtools/source/brwbox/datwin.cxx
@@ -0,0 +1,694 @@
+/*************************************************************************
+ *
+ * $RCSfile: datwin.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "datwin.hxx"
+
+#pragma hdrstop
+
+#ifndef _APP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+
+#ifndef _HELP_HXX
+#include <vcl/help.hxx>
+#endif
+#ifndef _IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+
+#include <tools/debug.hxx>
+
+DECLARE_LIST( BrowserColumns, BrowserColumn* );
+
+//===================================================================
+
+static String FitInWidth( OutputDevice& rWin, String aVal, ULONG nWidth, BOOL bAbbr )
+{
+ if ( nWidth < 8 )
+ return String();
+ ULONG nValWidth = rWin.GetTextWidth( aVal );
+ if ( nValWidth > nWidth )
+ {
+ String aDots( "...", RTL_TEXTENCODING_IBM_850 );
+ ULONG nDotsWidth = 2;
+ if ( bAbbr )
+ nDotsWidth = rWin.GetTextWidth( aDots );
+ if ( nDotsWidth > nWidth )
+ aVal.Erase();
+ else
+ {
+ aVal.Erase( aVal.Len() - 1 );
+ while ( aVal.Len() && rWin.GetTextWidth( aVal ) + nDotsWidth > nWidth )
+ aVal.Erase( aVal.Len() - 1 );
+ if ( bAbbr )
+ aVal += aDots;
+ }
+ }
+
+ return aVal;
+}
+
+//-------------------------------------------------------------------
+
+void ButtonFrame::Draw( OutputDevice& rDev )
+{
+ Color aOldFillColor = rDev.GetFillColor();
+ Color aOldLineColor = rDev.GetLineColor();
+
+ const StyleSettings &rSettings = rDev.GetSettings().GetStyleSettings();
+ Color aColLight( rSettings.GetLightColor() );
+ Color aColShadow( rSettings.GetShadowColor() );
+ Color aColFace( rSettings.GetFaceColor() );
+
+ rDev.SetLineColor( bPressed ? aColShadow : aColLight );
+ rDev.DrawLine( aRect.TopLeft(), Point( aRect.Right(), aRect.Top() ) );
+ rDev.DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom() - 1 ) );
+ rDev.SetLineColor( bPressed ? aColLight : aColShadow );
+ rDev.DrawLine( aRect.BottomRight(), Point( aRect.Right(), aRect.Top() ) );
+ rDev.DrawLine( aRect.BottomRight(), Point( aRect.Left(), aRect.Bottom() ) );
+
+ rDev.SetLineColor( aColFace );
+ rDev.SetFillColor( aColFace );
+ rDev.DrawRect( aInnerRect );
+
+ if ( aText.Len() )
+ {
+ String aVal( FitInWidth( rDev, aText, aInnerRect.GetWidth() - 2*MIN_COLUMNWIDTH, bAbbr ) );
+ Font aFont( rDev.GetFont() );
+ BOOL bOldTransp = aFont.IsTransparent();
+ if ( !bOldTransp )
+ {
+ aFont.SetTransparent( TRUE );
+ rDev.SetFont( aFont );
+ }
+
+ rDev.DrawText( Point(
+ ( aInnerRect.Left() + aInnerRect.Right() ) / 2 - ( rDev.GetTextWidth(aVal) / 2 ),
+ aInnerRect.Top() ), aVal );
+
+ if ( !bOldTransp )
+ {
+ aFont.SetTransparent(FALSE);
+ rDev.SetFont( aFont );
+ }
+ }
+
+ if ( bCurs )
+ {
+ rDev.SetLineColor( Color( COL_BLACK ) );
+ rDev.SetFillColor();
+ rDev.DrawRect( Rectangle(
+ Point( aRect.Left(), aRect.Top() ), Point( aRect.Right(), aRect.Bottom() ) ) );
+ }
+
+ rDev.SetLineColor( aOldLineColor );
+ rDev.SetFillColor( aOldFillColor );
+}
+
+//-------------------------------------------------------------------
+
+BrowserColumn::BrowserColumn( USHORT nItemId, const class Image &rImage,
+ const String& rTitle, ULONG nWidthPixel, const Fraction& rCurrentZoom,
+ HeaderBarItemBits nFlags )
+: _nId( nItemId ),
+ _nWidth( nWidthPixel ),
+ _aImage( rImage ),
+ _aTitle( rTitle ),
+ _bFrozen( FALSE ),
+ _nFlags( nFlags )
+{
+ double n = (double)_nWidth;
+ n *= (double)rCurrentZoom.GetDenominator();
+ n /= (double)rCurrentZoom.GetNumerator();
+ _nOriginalWidth = n>0 ? (long)(n+0.5) : -(long)(-n+0.5);
+}
+
+//-------------------------------------------------------------------
+
+void BrowserColumn::SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom)
+{
+ _nWidth = nNewWidthPixel;
+ double n = (double)_nWidth;
+ n *= (double)rCurrentZoom.GetDenominator();
+ n /= (double)rCurrentZoom.GetNumerator();
+ _nOriginalWidth = n>0 ? (long)(n+0.5) : -(long)(-n+0.5);
+}
+
+//-------------------------------------------------------------------
+
+void BrowserColumn::Draw( BrowseBox& rBox, OutputDevice& rDev, const Point& rPos, BOOL bCurs )
+{
+ if ( _nId == 0 )
+ {
+ // paint handle column
+ ButtonFrame( rPos, Size( Width()-1, rBox.GetDataRowHeight()-1 ),
+ String(), FALSE, bCurs,
+ 0 != (BROWSER_COLUMN_TITLEABBREVATION&_nFlags) ).Draw( rDev );
+ Color aOldLineColor = rDev.GetLineColor();
+ rDev.SetLineColor( Color( COL_BLACK ) );
+ rDev.DrawLine(
+ Point( rPos.X(), rPos.Y()+rBox.GetDataRowHeight()-1 ),
+ Point( rPos.X() + Width() - 1, rPos.Y()+rBox.GetDataRowHeight()-1 ) );
+ rDev.DrawLine(
+ Point( rPos.X() + Width() - 1, rPos.Y() ),
+ Point( rPos.X() + Width() - 1, rPos.Y()+rBox.GetDataRowHeight()-1 ) );
+ rDev.SetLineColor( aOldLineColor );
+
+ if ( rBox.bHasBitmapHandle )
+ rBox.PaintField( rDev,
+ Rectangle(
+ Point( rPos.X() + 2, rPos.Y() + 2 ),
+ Size( Width()-1, rBox.GetDataRowHeight()-1 ) ),
+ GetId() );
+ }
+ else
+ {
+ // paint data column
+ long nWidth = Width() == LONG_MAX ? rBox.GetDataWindow().GetSizePixel().Width() : Width();
+
+ rBox.PaintField( rDev,
+ Rectangle(
+ Point( rPos.X() + MIN_COLUMNWIDTH, rPos.Y() ),
+ Size( nWidth-2*MIN_COLUMNWIDTH, rBox.GetDataRowHeight()-1 ) ),
+ GetId() );
+ }
+}
+
+//-------------------------------------------------------------------
+
+void BrowserColumn::ZoomChanged(const Fraction& rNewZoom)
+{
+ double n = (double)_nOriginalWidth;
+ n *= (double)rNewZoom.GetNumerator();
+ n /= (double)rNewZoom.GetDenominator();
+
+ _nWidth = n>0 ? (long)(n+0.5) : -(long)(-n+0.5);
+}
+
+//-------------------------------------------------------------------
+
+BrowserDataWin::BrowserDataWin( BrowseBox* pParent ) :
+ Control( pParent, WinBits(WB_CLIPCHILDREN) ),
+ pHeaderBar( 0 ),
+ pEventWin( pParent ),
+ pCornerWin( 0 ),
+ bInPaint( FALSE ),
+ bInCommand( FALSE ),
+ bNoScrollBack( FALSE ),
+ bUpdateMode( TRUE ),
+ bResizeOnPaint( FALSE ),
+ bUpdateOnUnlock( FALSE ),
+ bInUpdateScrollbars( FALSE ),
+ bHadRecursion( FALSE ),
+ bOwnDataChangedHdl( FALSE ),
+ nUpdateLock( 0 ),
+ nCursorHidden( 0 ),
+ pDtorNotify( 0 )
+{
+ aMouseTimer.SetTimeoutHdl( LINK( this, BrowserDataWin, RepeatedMouseMove ) );
+ aMouseTimer.SetTimeout( 100 );
+}
+
+//-------------------------------------------------------------------
+BrowserDataWin::~BrowserDataWin()
+{
+ if( pDtorNotify )
+ *pDtorNotify = TRUE;
+ if ( IsMouseCaptured() )
+ ReleaseMouse();
+}
+
+//-------------------------------------------------------------------
+void BrowserDataWin::LeaveUpdateLock()
+{
+ if ( !--nUpdateLock )
+ {
+ DoOutstandingInvalidations();
+ if (bUpdateOnUnlock )
+ {
+ Control::Update();
+ bUpdateOnUnlock = FALSE;
+ }
+ }
+}
+
+//-------------------------------------------------------------------
+void InitSettings_Impl( Window *pWin,
+ BOOL bFont, BOOL bForeground, BOOL bBackground )
+{
+ const StyleSettings& rStyleSettings =
+ pWin->GetSettings().GetStyleSettings();
+
+ if ( bFont )
+ {
+ Font aFont = rStyleSettings.GetAppFont();
+ if ( pWin->IsControlFont() )
+ aFont.Merge( pWin->GetControlFont() );
+ pWin->SetPointFont( aFont );
+ }
+
+ if ( bFont || bForeground )
+ {
+ Color aTextColor = rStyleSettings.GetWindowTextColor();
+ if ( pWin->IsControlForeground() )
+ aTextColor = pWin->GetControlForeground();
+ pWin->SetTextColor( aTextColor );
+ }
+
+ if ( bBackground )
+ {
+ if( pWin->IsControlBackground() )
+ pWin->SetBackground( pWin->GetControlBackground() );
+ else
+ pWin->SetBackground( rStyleSettings.GetWindowColor() );
+ }
+}
+
+//-------------------------------------------------------------------
+void BrowserDataWin::Update()
+{
+ if ( !nUpdateLock )
+ Control::Update();
+ else
+ bUpdateOnUnlock = TRUE;
+}
+
+//-------------------------------------------------------------------
+void BrowserDataWin::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ if( !bOwnDataChangedHdl )
+ {
+ InitSettings_Impl( this, TRUE, TRUE, TRUE );
+ Invalidate();
+ InitSettings_Impl( GetParent(), TRUE, TRUE, TRUE );
+ GetParent()->Invalidate();
+ }
+ }
+ else
+ Control::DataChanged( rDCEvt );
+}
+
+//-------------------------------------------------------------------
+void BrowserDataWin::Paint( const Rectangle& rRect )
+{
+ if ( !nUpdateLock && GetUpdateMode() )
+ {
+ bInPaint = TRUE;
+ ( (BrowseBox*) GetParent() )->PaintData( *this, rRect );
+ bInPaint = FALSE;
+ }
+ else
+ aInvalidRegion.Insert( new Rectangle( rRect ) );
+}
+
+//-------------------------------------------------------------------
+
+BrowseEvent BrowserDataWin::CreateBrowseEvent( const Point& rPosPixel )
+{
+ BrowseBox *pBox = GetParent();
+
+ // seek to row under mouse
+ short nRelRow = rPosPixel.Y() < 0
+ ? -1
+ : rPosPixel.Y() / pBox->GetDataRowHeight();
+ long nRow = nRelRow < 0 ? -1 : nRelRow + pBox->nTopRow;
+
+ // find column under mouse
+ long nMouseX = rPosPixel.X();
+ long nColX = 0;
+ USHORT nCol;
+ for ( nCol = 0;
+ nCol < pBox->pCols->Count() && nColX < GetSizePixel().Width();
+ ++nCol )
+ if ( pBox->pCols->GetObject(nCol)->IsFrozen() || nCol >= pBox->nFirstCol )
+ {
+ nColX += pBox->pCols->GetObject(nCol)->Width();
+ if ( nMouseX < nColX )
+ break;
+ }
+ USHORT nColId = BROWSER_INVALIDID;
+ if ( nCol < pBox->pCols->Count() )
+ nColId = pBox->pCols->GetObject(nCol)->GetId();
+
+ // compute the field rectangle and field relative MouseEvent
+ Rectangle aFieldRect;
+ MouseEvent aRelEvt;
+ if ( nCol < pBox->pCols->Count() )
+ {
+ nColX -= pBox->pCols->GetObject(nCol)->Width();
+ aFieldRect = Rectangle(
+ Point( nColX, nRelRow * pBox->GetDataRowHeight() ),
+ Size( pBox->pCols->GetObject(nCol)->Width(),
+ pBox->GetDataRowHeight() ) );
+ }
+
+ // assemble and return the BrowseEvent
+ return BrowseEvent( this, nRow, nCol, nColId, aFieldRect );
+}
+
+//-------------------------------------------------------------------
+void BrowserDataWin::Command( const CommandEvent& rEvt )
+{
+ // Scrollmaus-Event?
+ BrowseBox *pBox = GetParent();
+ if ( ( (rEvt.GetCommand() == COMMAND_WHEEL) ||
+ (rEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
+ (rEvt.GetCommand() == COMMAND_AUTOSCROLL) ) &&
+ ( HandleScrollCommand( rEvt, &pBox->aHScroll, pBox->pVScroll ) ) )
+ return;
+
+ Point aEventPos( rEvt.GetMousePosPixel() );
+ long nRow = pBox->GetRowAtYPosPixel( aEventPos.Y(), FALSE);
+ MouseEvent aMouseEvt( aEventPos, 1, MOUSE_SELECT, MOUSE_LEFT );
+ if ( COMMAND_CONTEXTMENU == rEvt.GetCommand() && rEvt.IsMouseEvent() &&
+ nRow < pBox->GetRowCount() && !pBox->IsRowSelected(nRow) )
+ {
+ BOOL bDeleted = FALSE;
+ pDtorNotify = &bDeleted;
+ bInCommand = TRUE;
+ MouseButtonDown( aMouseEvt );
+ if( bDeleted )
+ return;
+ MouseButtonUp( aMouseEvt );
+ if( bDeleted )
+ return;
+ pDtorNotify = 0;
+ bInCommand = FALSE;
+ }
+
+ aEventPos.Y() += GetParent()->GetTitleHeight();
+ CommandEvent aEvt( aEventPos, rEvt.GetCommand(),
+ rEvt.IsMouseEvent(), rEvt.GetData() );
+ bInCommand = TRUE;
+ BOOL bDeleted = FALSE;
+ pDtorNotify = &bDeleted;
+ GetParent()->Command( aEvt );
+ if( bDeleted )
+ return;
+ pDtorNotify = 0;
+ bInCommand = FALSE;
+
+ if ( COMMAND_STARTDRAG == rEvt.GetCommand() )
+ MouseButtonUp( aMouseEvt );
+
+ Control::Command( rEvt );
+}
+
+//-------------------------------------------------------------------
+
+void BrowserDataWin::MouseButtonDown( const MouseEvent& rEvt )
+{
+ aLastMousePos = OutputToScreenPixel( rEvt.GetPosPixel() );
+ CaptureMouse();
+ GetParent()->MouseButtonDown( BrowserMouseEvent( this, rEvt ) );
+}
+
+//-------------------------------------------------------------------
+
+void BrowserDataWin::MouseMove( const MouseEvent& rEvt )
+{
+ // Pseudo MouseMoves verhindern
+ Point aNewPos = OutputToScreenPixel( rEvt.GetPosPixel() );
+ if ( aNewPos == aLastMousePos )
+ return;
+ aLastMousePos = aNewPos;
+
+ // Paint-Probleme abfangen
+ if ( !IsMouseCaptured() )
+ return;
+
+ // transform to a BrowseEvent
+ GetParent()->MouseMove( BrowserMouseEvent( this, rEvt ) );
+
+ // dragging out of the visible area?
+ if ( rEvt.IsLeft() &&
+ ( rEvt.GetPosPixel().Y() > GetSizePixel().Height() ||
+ rEvt.GetPosPixel().Y() < 0 ) )
+ {
+ // repeat the event
+ aRepeatEvt = rEvt;
+ aMouseTimer.Start();
+ }
+ else
+ // killing old repeat-event
+ if ( aMouseTimer.IsActive() )
+ aMouseTimer.Stop();
+}
+
+//-------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( BrowserDataWin, RepeatedMouseMove, void *, pvoid )
+{
+ GetParent()->MouseMove( BrowserMouseEvent( this, aRepeatEvt ) );
+ return 0;
+}
+IMPL_LINK_INLINE_END( BrowserDataWin, RepeatedMouseMove, void *, pvoid )
+
+//-------------------------------------------------------------------
+
+void BrowserDataWin::MouseButtonUp( const MouseEvent& rEvt )
+{
+ // Pseudo MouseMoves verhindern
+ Point aNewPos = OutputToScreenPixel( rEvt.GetPosPixel() );
+ aLastMousePos = aNewPos;
+
+ // Paint-Probleme abfangen
+ if ( !IsMouseCaptured() )
+ return;
+
+ // Move an die aktuelle Position simulieren
+ MouseMove( rEvt );
+
+ // eigentliches Up-Handling
+ ReleaseMouse();
+ if ( aMouseTimer.IsActive() )
+ aMouseTimer.Stop();
+ GetParent()->MouseButtonUp( BrowserMouseEvent( this, rEvt ) );
+}
+
+//-------------------------------------------------------------------
+
+void BrowserDataWin::KeyInput( const KeyEvent& rEvt )
+{
+ // pass to parent window
+ if ( !GetParent()->ProcessKey( rEvt ) )
+ Control::KeyInput( rEvt );
+}
+
+//-------------------------------------------------------------------
+
+void BrowserDataWin::RequestHelp( const HelpEvent& rHEvt )
+{
+ pEventWin = this;
+ GetParent()->RequestHelp( rHEvt );
+ pEventWin = GetParent();
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowserDataWin::Drop( const DropEvent& rEvt )
+{
+ return GetParent()->Drop( BrowserDropEvent( this, rEvt ) );
+}
+
+//-------------------------------------------------------------------
+
+BOOL BrowserDataWin::QueryDrop( DropEvent& rEvt )
+{
+ BrowserDropEvent aBrwDEvt( this, rEvt );
+ BOOL bRet = GetParent()->QueryDrop( aBrwDEvt );
+ rEvt = aBrwDEvt;
+ return bRet;
+}
+
+//===================================================================
+
+BrowseEvent::BrowseEvent( Window* pWindow,
+ long nAbsRow, USHORT nColumn, USHORT nColumnId,
+ const Rectangle& rRect ):
+ pWin(pWindow),
+ nRow(nAbsRow),
+ nCol(nColumn),
+ nColId(nColumnId),
+ aRect(rRect)
+{
+}
+
+//===================================================================
+
+BrowserMouseEvent::BrowserMouseEvent( BrowserDataWin *pWin,
+ const MouseEvent& rEvt ):
+ MouseEvent(rEvt),
+ BrowseEvent( pWin->CreateBrowseEvent( rEvt.GetPosPixel() ) )
+{
+}
+
+//-------------------------------------------------------------------
+
+BrowserMouseEvent::BrowserMouseEvent( Window *pWin, const MouseEvent& rEvt,
+ long nAbsRow, USHORT nColumn, USHORT nColumnId,
+ const Rectangle& rRect ):
+ MouseEvent(rEvt),
+ BrowseEvent( pWin, nAbsRow, nColumn, nColumnId, rRect )
+{
+}
+
+//===================================================================
+
+BrowserDropEvent::BrowserDropEvent( BrowserDataWin *pWin, const DropEvent& rEvt ):
+ DropEvent(rEvt),
+ BrowseEvent( pWin->CreateBrowseEvent( rEvt.GetPosPixel() ) )
+{
+}
+
+//-------------------------------------------------------------------
+
+void BrowserDataWin::SetUpdateMode( BOOL bMode )
+{
+ DBG_ASSERT( !bUpdateMode || aInvalidRegion.Count() == 0,
+ "invalid region not empty" );
+ if ( bMode == bUpdateMode )
+ return;
+
+ bUpdateMode = bMode;
+ if ( bMode )
+ DoOutstandingInvalidations();
+}
+
+//-------------------------------------------------------------------
+void BrowserDataWin::DoOutstandingInvalidations()
+{
+ for ( Rectangle* pRect = aInvalidRegion.First();
+ pRect;
+ pRect = aInvalidRegion.Next() )
+ {
+ Window::Invalidate( *pRect, INVALIDATE_NOCHILDREN /*OV*/);
+ delete pRect;
+ }
+ aInvalidRegion.Clear();
+}
+
+//-------------------------------------------------------------------
+
+void BrowserDataWin::Invalidate()
+{
+ if ( !GetUpdateMode() )
+ {
+ for ( Rectangle* pRect = aInvalidRegion.First();
+ pRect;
+ pRect = aInvalidRegion.Next() )
+ delete pRect;
+ aInvalidRegion.Clear();
+ aInvalidRegion.Insert(
+ new Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) );
+ }
+ else
+ Window::Invalidate(INVALIDATE_NOCHILDREN /*OV*/ );
+}
+
+//-------------------------------------------------------------------
+
+void BrowserDataWin::Invalidate( const Rectangle& rRect )
+{
+ if ( !GetUpdateMode() )
+ aInvalidRegion.Insert( new Rectangle( rRect ) );
+ else
+ Window::Invalidate( rRect, INVALIDATE_NOCHILDREN /*OV*/ );
+}
+
+//===================================================================
+
+void BrowserScrollBar::Tracking( const TrackingEvent& rTEvt )
+{
+ ULONG nPos = GetThumbPos();
+ if ( nPos != _nLastPos )
+ {
+ if ( _nTip )
+ Help::HideTip( _nTip );
+
+ String aTip( String::CreateFromInt32(nPos) );
+ aTip += '/';
+ if ( _pDataWin->GetRealRowCount().Len() )
+ aTip += _pDataWin->GetRealRowCount();
+ else
+ aTip += String::CreateFromInt32(GetRangeMax());
+ Rectangle aRect( GetPointerPosPixel(), Size( GetTextHeight(), GetTextWidth( aTip ) ) );
+ _nTip = Help::ShowTip( this, aRect, aTip );
+ _nLastPos = nPos;
+ }
+
+ ScrollBar::Tracking( rTEvt );
+}
+
+//-------------------------------------------------------------------
+
+void BrowserScrollBar::EndScroll()
+{
+ if ( _nTip )
+ Help::HideTip( _nTip );
+ _nTip = 0;
+ ScrollBar::EndScroll();
+}
+
+
diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx
new file mode 100644
index 000000000000..3fcd002e392d
--- /dev/null
+++ b/svtools/source/brwbox/datwin.hxx
@@ -0,0 +1,269 @@
+/*************************************************************************
+ *
+ * $RCSfile: datwin.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXDATWIN_HXX
+#define _SFXDATWIN_HXX
+
+#ifndef _BRWBOX_HXX
+#include <brwbox.hxx>
+#endif
+
+#ifndef _BRWHEAD_HXX
+#include <brwhead.hxx>
+#endif
+
+#ifndef _TIMER_HXX //autogen
+#include <vcl/timer.hxx>
+#endif
+#ifndef _IMAGE_HXX //autogen
+#include <vcl/image.hxx>
+#endif
+#ifndef _LIST_HXX //autogen
+#include <tools/list.hxx>
+#endif
+//===================================================================
+
+#define MIN_COLUMNWIDTH 2
+#define DRAG_CRITICAL 4
+
+DECLARE_LIST( RectangleList, Rectangle* );
+
+//===================================================================
+
+class ButtonFrame
+{
+ Rectangle aRect;
+ Rectangle aInnerRect;
+ String aText;
+ BOOL bPressed;
+ BOOL bCurs;
+ BOOL bAbbr;
+
+public:
+ ButtonFrame( const Point& rPt, const Size& rSz,
+ const String &rText,
+ BOOL bPress = FALSE, BOOL bCursor = FALSE,
+ BOOL bAbbreviate = TRUE ) :
+ aRect( rPt, rSz ),
+ aInnerRect( Point( aRect.Left()+1, aRect.Top()+1 ),
+ Size( aRect.GetWidth()-2, aRect.GetHeight()-2 ) ),
+ aText(rText),
+ bPressed(bPress),
+ bCurs(bCursor),
+ bAbbr(bAbbreviate)
+ {}
+
+ void Draw( OutputDevice& rDev );
+};
+
+//===================================================================
+
+class BrowserColumn
+{
+ USHORT _nId;
+ ULONG _nOriginalWidth;
+ ULONG _nWidth;
+ Image _aImage;
+ String _aTitle;
+ BOOL _bFrozen;
+ HeaderBarItemBits _nFlags;
+
+public:
+ BrowserColumn( USHORT nItemId, const Image &rImage,
+ const String& rTitle, ULONG nWidthPixel, const Fraction& rCurrentZoom,
+ HeaderBarItemBits nFlags );
+
+ USHORT GetId() const { return _nId; }
+
+ ULONG Width() { return _nWidth; }
+ Image& GetImage() { return _aImage; }
+ String& Title() { return _aTitle; }
+ HeaderBarItemBits& Flags() { return _nFlags; }
+
+ BOOL IsFrozen() const { return _bFrozen; }
+ void Freeze( BOOL bFreeze = TRUE ) { _bFrozen = bFreeze; }
+
+ virtual void Draw( BrowseBox& rBox, OutputDevice& rDev,
+ const Point& rPos, BOOL bCurs );
+
+ void SetWidth(ULONG nNewWidthPixel, const Fraction& rCurrentZoom);
+ void ZoomChanged(const Fraction& rNewZoom);
+};
+
+//===================================================================
+
+class BrowserDataWin: public Control
+{
+friend class BrowseBox;
+ BrowserHeader* pHeaderBar; // only for BROWSER_HEADERBAR_NEW
+ Window* pEventWin; // Window of forwarded events
+ ScrollBarBox* pCornerWin; // Window in the corner btw the ScrollBars
+ BOOL* pDtorNotify;
+ AutoTimer aMouseTimer; // recalls MouseMove on dragging out
+ MouseEvent aRepeatEvt; // a MouseEvent to repeat
+ Point aLastMousePos; // verhindert pseudo-MouseMoves
+
+ String aRealRowCount; // zur Anzeige im VScrollBar
+
+ RectangleList aInvalidRegion; // invalidated Rectangles during !UpdateMode
+ FASTBOOL bInPaint; // TRUE while in Paint
+ FASTBOOL bInCommand; // TRUE while in Command
+ FASTBOOL bNoScrollBack; // nur vorwaerts scrollen
+ FASTBOOL bNoHScroll; // kein horizontaler Scrollbar
+ FASTBOOL bAutoHScroll; // autohide horizontaler Scrollbar
+ FASTBOOL bAutoVScroll; // autohide horizontaler Scrollbar
+ FASTBOOL bUpdateMode; // nicht SV-UpdateMode wegen Invalidate()
+ FASTBOOL bAutoSizeLastCol;// last column always fills up window
+ FASTBOOL bHighlightAuto; // new auto-highlight by SetFont() etc.
+ FASTBOOL bResizeOnPaint; // outstanding resize-event
+ FASTBOOL bUpdateOnUnlock; // Update() while locked
+ FASTBOOL bInUpdateScrollbars; // Rekursionsschutz
+ FASTBOOL bHadRecursion; // Rekursion war aufgetreten
+ FASTBOOL bOwnDataChangedHdl; // dont change colors in DataChanged
+ USHORT nUpdateLock; // lock count, dont call Control::Update()!
+ short nCursorHidden; // new conuter for DoHide/ShowCursor
+
+public:
+ BrowserDataWin( BrowseBox* pParent );
+ ~BrowserDataWin();
+
+ virtual void DataChanged( const DataChangedEvent& rDCEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual void RequestHelp( const HelpEvent& rHEvt );
+ virtual void Command( const CommandEvent& rEvt );
+ virtual void MouseButtonDown( const MouseEvent& rEvt );
+ virtual void MouseMove( const MouseEvent& rEvt );
+ DECL_LINK( RepeatedMouseMove, void * );
+
+ virtual void MouseButtonUp( const MouseEvent& rEvt );
+ virtual void KeyInput( const KeyEvent& rEvt );
+
+ virtual BOOL QueryDrop( DropEvent& rEvt );
+ virtual BOOL Drop( const DropEvent& rEvt );
+
+ BrowseEvent CreateBrowseEvent( const Point& rPosPixel );
+ void Repaint();
+ BrowseBox* GetParent() const
+ { return (BrowseBox*) Window::GetParent(); }
+ const String& GetRealRowCount() const { return aRealRowCount; }
+
+ void SetUpdateMode( BOOL bMode );
+ FASTBOOL GetUpdateMode() const { return bUpdateMode; }
+ void EnterUpdateLock() { ++nUpdateLock; }
+ void LeaveUpdateLock();
+ void Update();
+ void DoOutstandingInvalidations();
+ void Invalidate();
+ void Invalidate( const Rectangle& rRect );
+};
+
+//-------------------------------------------------------------------
+
+inline void BrowserDataWin::Repaint()
+{
+ if ( GetUpdateMode() )
+ Update();
+ Paint( Rectangle( Point(), GetOutputSizePixel() ) );
+}
+
+//===================================================================
+
+class BrowserScrollBar: public ScrollBar
+{
+ ULONG _nTip;
+ ULONG _nLastPos;
+ BrowserDataWin* _pDataWin;
+
+public:
+ BrowserScrollBar( Window* pParent, WinBits nStyle,
+ BrowserDataWin *pDataWin )
+ : ScrollBar( pParent, nStyle ),
+ _nTip( 0 ),
+ _nLastPos( ULONG_MAX ),
+ _pDataWin( pDataWin )
+ {}
+ //ScrollBar( Window* pParent, const ResId& rResId );
+
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void EndScroll();
+};
+
+//===================================================================
+
+void InitSettings_Impl( Window *pWin,
+ BOOL bFont = TRUE, BOOL bForeground = TRUE, BOOL bBackground = TRUE );
+
+//===================================================================
+
+#ifdef DBG_MI
+
+void DoLog_Impl( const BrowseBox *pThis, const char *pWhat, const char *pWho );
+#define LOG(pThis,what,who) DoLog_Impl(pThis,what,who)
+
+#else
+
+#define LOG(pThis,what,who)
+
+#endif
+
+
+#endif
+
diff --git a/svtools/source/brwbox/makefile.mk b/svtools/source/brwbox/makefile.mk
new file mode 100644
index 000000000000..2379c21e72c1
--- /dev/null
+++ b/svtools/source/brwbox/makefile.mk
@@ -0,0 +1,99 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=browse
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES= \
+ brwbox1.cxx \
+ brwbox2.cxx \
+ brwhead.cxx \
+ datwin.cxx
+
+.IF "$(GUI)" == "WIN"
+CXXFILES+= \
+ brwdll.cxx
+.ENDIF
+
+SLOFILES= \
+ $(SLO)$/brwbox1.obj \
+ $(SLO)$/brwbox2.obj \
+ $(SLO)$/brwhead.obj \
+ $(SLO)$/datwin.obj
+
+.IF "$(GUI)" == "WIN"
+SLOFILES+= \
+ $(SLO)$/brwdll.obj
+.ENDIF
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/config/makefile.mk b/svtools/source/config/makefile.mk
new file mode 100644
index 000000000000..b5b01fbbd6db
--- /dev/null
+++ b/svtools/source/config/makefile.mk
@@ -0,0 +1,82 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=config
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+SLOFILES = \
+ $(SLO)$/pathoptions.obj \
+ $(SLO)$/useroptions.obj
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svtools/source/config/pathoptions.cxx b/svtools/source/config/pathoptions.cxx
new file mode 100644
index 000000000000..4a659bed30d7
--- /dev/null
+++ b/svtools/source/config/pathoptions.cxx
@@ -0,0 +1,409 @@
+/*************************************************************************
+ *
+ * $RCSfile: pathoptions.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "pathoptions.hxx"
+
+#ifndef _UTL_CONFIGMGR_HXX_
+#include <unotools/configmgr.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
+#endif
+
+using namespace utl;
+using namespace rtl;
+using namespace com::sun::star::uno;
+
+// class SvtPathOptions --------------------------------------------------
+
+// initialize the static member
+SvtPathOptions* SvtPathOptions::m_pOptions = NULL;
+
+// -----------------------------------------------------------------------
+
+Sequence< OUString > SvtPathOptions::GetPropertyNames()
+{
+ static const char* aPropNames[] =
+ {
+ "Addin", // PATH_ADDIN
+ "AutoCorrect", // PATH_AUTOCORRECT
+ "AutoPilot", // PATH_AUTOPILOT
+ "Backup", // PATH_BACKUP
+ "Basic", // PATH_BASIC
+ "Bitmap", // PATH_BITMAP
+ "Config", // PATH_CONFIG
+ "Database", // PATH_DATABASE
+ "Dictionary", // PATH_DICTIONARY
+ "Favorite", // PATH_FAVORITES
+ "Filter", // PATH_FILTER
+ "Gallery", // PATH_GALLERY
+ "Glossary", // PATH_GLOSSARY
+ "Graphic", // PATH_GRAPHIC
+ "Help", // PATH_HELP
+ "Linguistic", // PATH_LINGUISTIC
+ "Module", // PATH_MODULE
+ "New", // PATH_NEWMENU
+ "Palette", // PATH_PALETTE
+ "Plugin", // PATH_PLUGIN
+ "Storage", // PATH_STORAGE
+ "SubIni", // PATH_SUBINI
+ "Temp", // PATH_TEMP
+ "Template", // PATH_TEMPLATE
+ "Trash", // PATH_TRASH
+ "UserConfig", // PATH_USERCONFIG
+ "UserDictionary", // PATH_USERDICTIONARY
+ "Work" // PATH_WORK
+ };
+
+ const int nCount = 28;
+ Sequence< OUString > aNames( nCount );
+ OUString* pNames = aNames.getArray();
+ for ( int i = 0; i < nCount; i++ )
+ pNames[i] = OUString::createFromAscii( aPropNames[i] );
+
+ return aNames;
+}
+
+// -----------------------------------------------------------------------
+
+const String& SvtPathOptions::GetPath( int nIndex )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( PATH_ADDIN == nIndex )
+ return m_aAddinPath;
+ else if ( PATH_AUTOCORRECT == nIndex )
+ return m_aAutoCorrectPath;
+ else if ( PATH_AUTOPILOT == nIndex )
+ return m_aAutoPilotPath;
+ else if ( PATH_BACKUP == nIndex )
+ return m_aBackupPath;
+ else if ( PATH_BASIC == nIndex )
+ return m_aBasicPath;
+ else if ( PATH_BITMAP == nIndex )
+ return m_aBitmapPath;
+ else if ( PATH_CONFIG == nIndex )
+ return m_aConfigPath;
+ else if ( PATH_DATABASE == nIndex )
+ return m_aDatabasePath;
+ else if ( PATH_DICTIONARY == nIndex )
+ return m_aDictionaryPath;
+ else if ( PATH_FAVORITES == nIndex )
+ return m_aFavoritesPath;
+ else if ( PATH_FILTER == nIndex )
+ return m_aFilterPath;
+ else if ( PATH_GALLERY == nIndex )
+ return m_aGalleryPath;
+ else if ( PATH_GLOSSARY == nIndex )
+ return m_aGlossaryPath;
+ else if ( PATH_GRAPHIC == nIndex )
+ return m_aGraphicPath;
+ else if ( PATH_HELP == nIndex )
+ return m_aHelpPath;
+ else if ( PATH_LINGUISTIC == nIndex )
+ return m_aLinguisticPath;
+ else if ( PATH_MODULE == nIndex )
+ return m_aModulePath;
+ else if ( PATH_NEWMENU == nIndex )
+ return m_aNewMenuPath;
+ else if ( PATH_PALETTE == nIndex )
+ return m_aPalettePath;
+ else if ( PATH_PLUGIN == nIndex )
+ return m_aPluginPath;
+ else if ( PATH_STORAGE == nIndex )
+ return m_aStoragePath;
+ else if ( PATH_SUBINI == nIndex )
+ return m_aSubIniPath;
+ else if ( PATH_TEMP == nIndex )
+ return m_aTempPath;
+ else if ( PATH_TEMPLATE == nIndex )
+ return m_aTemplatePath;
+ else if ( PATH_TRASH == nIndex )
+ return m_aTrashPath;
+ else if ( PATH_USERCONFIG == nIndex )
+ return m_aUserConfigPath;
+ else if ( PATH_USERDICTIONARY == nIndex )
+ return m_aUserDictionaryPath;
+ else if ( PATH_WORK == nIndex )
+ return m_aWorkPath;
+ else
+ {
+ DBG_ERRORFILE( "invalid index to get a path" );
+ return m_aEmptyString;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SvtPathOptions::SetPath( int nIndex, const String& rNewPath )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( PATH_ADDIN == nIndex )
+ m_aAddinPath = rNewPath;
+ else if ( PATH_AUTOCORRECT == nIndex )
+ m_aAutoCorrectPath = rNewPath;
+ else if ( PATH_AUTOPILOT == nIndex )
+ m_aAutoPilotPath = rNewPath;
+ else if ( PATH_BACKUP == nIndex )
+ m_aBackupPath = rNewPath;
+ else if ( PATH_BASIC == nIndex )
+ m_aBasicPath = rNewPath;
+ else if ( PATH_BITMAP == nIndex )
+ m_aBitmapPath = rNewPath;
+ else if ( PATH_CONFIG == nIndex )
+ m_aConfigPath = rNewPath;
+ else if ( PATH_DATABASE == nIndex )
+ m_aDatabasePath = rNewPath;
+ else if ( PATH_DICTIONARY == nIndex )
+ m_aDictionaryPath = rNewPath;
+ else if ( PATH_FAVORITES == nIndex )
+ m_aFavoritesPath = rNewPath;
+ else if ( PATH_FILTER == nIndex )
+ m_aFilterPath = rNewPath;
+ else if ( PATH_GALLERY == nIndex )
+ m_aGalleryPath = rNewPath;
+ else if ( PATH_GLOSSARY == nIndex )
+ m_aGlossaryPath = rNewPath;
+ else if ( PATH_GRAPHIC == nIndex )
+ m_aGraphicPath = rNewPath;
+ else if ( PATH_HELP == nIndex )
+ m_aHelpPath = rNewPath;
+ else if ( PATH_LINGUISTIC == nIndex )
+ m_aLinguisticPath = rNewPath;
+ else if ( PATH_MODULE == nIndex )
+ m_aModulePath = rNewPath;
+ else if ( PATH_NEWMENU == nIndex )
+ m_aNewMenuPath = rNewPath;
+ else if ( PATH_PALETTE == nIndex )
+ m_aPalettePath = rNewPath;
+ else if ( PATH_PLUGIN == nIndex )
+ m_aPluginPath = rNewPath;
+ else if ( PATH_STORAGE == nIndex )
+ m_aStoragePath = rNewPath;
+ else if ( PATH_SUBINI == nIndex )
+ m_aSubIniPath = rNewPath;
+ else if ( PATH_TEMP == nIndex )
+ m_aTempPath = rNewPath;
+ else if ( PATH_TEMPLATE == nIndex )
+ m_aTemplatePath = rNewPath;
+ else if ( PATH_TRASH == nIndex )
+ m_aTrashPath = rNewPath;
+ else if ( PATH_USERCONFIG == nIndex )
+ m_aUserConfigPath = rNewPath;
+ else if ( PATH_USERDICTIONARY == nIndex )
+ m_aUserDictionaryPath = rNewPath;
+ else if ( PATH_WORK == nIndex )
+ m_aWorkPath = rNewPath;
+ else
+ DBG_ERRORFILE( "invalid index to set a path" );
+ SetModified();
+}
+
+// -----------------------------------------------------------------------
+
+SvtPathOptions::SvtPathOptions() : ConfigItem( OUString::createFromAscii("Office/Common/Path") )
+{
+ Sequence< OUString > aNames = GetPropertyNames();
+ Sequence< Any > aValues = GetProperties( aNames );
+ EnableNotification( aNames );
+ const Any* pValues = aValues.getConstArray();
+ DBG_ASSERT( aValues.getLength() == aNames.getLength(), "GetProperties failed" );
+ if ( aValues.getLength() == aNames.getLength() )
+ {
+ OUString aTempStr;
+
+ for ( int nProp = 0; nProp < aNames.getLength(); nProp++ )
+ {
+ DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" );
+ if ( pValues[nProp].hasValue() )
+ {
+ pValues[nProp] >>= aTempStr;
+ switch ( nProp )
+ {
+ case PATH_ADDIN: m_aAddinPath = String( aTempStr ); break;
+ case PATH_AUTOCORRECT: m_aAutoCorrectPath = String( aTempStr ); break;
+ case PATH_AUTOPILOT: m_aAutoPilotPath = String( aTempStr ); break;
+ case PATH_BACKUP: m_aBackupPath = String( aTempStr ); break;
+ case PATH_BASIC: m_aBasicPath = String( aTempStr ); break;
+ case PATH_BITMAP: m_aBitmapPath = String( aTempStr ); break;
+ case PATH_CONFIG: m_aConfigPath = String( aTempStr ); break;
+ case PATH_DATABASE: m_aDatabasePath = String( aTempStr ); break;
+ case PATH_DICTIONARY: m_aDictionaryPath = String( aTempStr ); break;
+ case PATH_FAVORITES: m_aFavoritesPath = String( aTempStr ); break;
+ case PATH_FILTER: m_aFilterPath = String( aTempStr ); break;
+ case PATH_GALLERY: m_aGalleryPath = String( aTempStr ); break;
+ case PATH_GLOSSARY: m_aGlossaryPath = String( aTempStr ); break;
+ case PATH_GRAPHIC: m_aGraphicPath = String( aTempStr ); break;
+ case PATH_HELP: m_aHelpPath = String( aTempStr ); break;
+ case PATH_LINGUISTIC: m_aLinguisticPath = String( aTempStr ); break;
+ case PATH_MODULE: m_aModulePath = String( aTempStr ); break;
+ case PATH_NEWMENU: m_aNewMenuPath = String( aTempStr ); break;
+ case PATH_PALETTE: m_aPalettePath = String( aTempStr ); break;
+ case PATH_PLUGIN: m_aPluginPath = String( aTempStr ); break;
+ case PATH_STORAGE: m_aStoragePath = String( aTempStr ); break;
+ case PATH_SUBINI: m_aSubIniPath = String( aTempStr ); break;
+ case PATH_TEMP: m_aTempPath = String( aTempStr ); break;
+ case PATH_TEMPLATE: m_aTemplatePath = String( aTempStr ); break;
+ case PATH_TRASH: m_aTrashPath = String( aTempStr ); break;
+ case PATH_USERCONFIG: m_aUserConfigPath = String( aTempStr ); break;
+ case PATH_USERDICTIONARY: m_aUserDictionaryPath = String( aTempStr ); break;
+ case PATH_WORK: m_aWorkPath = String( aTempStr ); break;
+
+ default:
+ DBG_ERRORFILE( "invalid index to load a path" );
+ }
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+SvtPathOptions::~SvtPathOptions()
+{
+}
+
+// -----------------------------------------------------------------------
+
+SvtPathOptions* SvtPathOptions::GetPathOptions()
+{
+ if ( !m_pOptions )
+ m_pOptions = new SvtPathOptions;
+ return m_pOptions;
+}
+
+// -----------------------------------------------------------------------
+
+void SvtPathOptions::DestroyPathOptions()
+{
+ if ( m_pOptions )
+ DELETEZ( m_pOptions );
+}
+
+// -----------------------------------------------------------------------
+
+void SvtPathOptions::Commit()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ Sequence< OUString > aNames = GetPropertyNames();
+ OUString* pNames = aNames.getArray();
+ Sequence< Any > aValues( aNames.getLength() );
+ Any* pValues = aValues.getArray();
+ const Type& rType = ::getBooleanCppuType();
+ OUString aTempStr;
+ for ( int nProp = 0; nProp < aNames.getLength(); nProp++ )
+ {
+ switch ( nProp )
+ {
+ case PATH_ADDIN: aTempStr = OUString( m_aAddinPath ); break;
+ case PATH_AUTOCORRECT: aTempStr = OUString( m_aAutoCorrectPath ); break;
+ case PATH_AUTOPILOT: aTempStr = OUString( m_aAutoPilotPath ); break;
+ case PATH_BACKUP: aTempStr = OUString( m_aBackupPath ); break;
+ case PATH_BASIC: aTempStr = OUString( m_aBasicPath ); break;
+ case PATH_BITMAP: aTempStr = OUString( m_aBitmapPath ); break;
+ case PATH_CONFIG: aTempStr = OUString( m_aConfigPath ); break;
+ case PATH_DATABASE: aTempStr = OUString( m_aDatabasePath ); break;
+ case PATH_DICTIONARY: aTempStr = OUString( m_aDictionaryPath ); break;
+ case PATH_FAVORITES: aTempStr = OUString( m_aFavoritesPath ); break;
+ case PATH_FILTER: aTempStr = OUString( m_aFilterPath ); break;
+ case PATH_GALLERY: aTempStr = OUString( m_aGalleryPath ); break;
+ case PATH_GLOSSARY: aTempStr = OUString( m_aGlossaryPath ); break;
+ case PATH_GRAPHIC: aTempStr = OUString( m_aGraphicPath ); break;
+ case PATH_HELP: aTempStr = OUString( m_aHelpPath ); break;
+ case PATH_LINGUISTIC: aTempStr = OUString( m_aLinguisticPath ); break;
+ case PATH_MODULE: aTempStr = OUString( m_aModulePath ); break;
+ case PATH_NEWMENU: aTempStr = OUString( m_aNewMenuPath ); break;
+ case PATH_PALETTE: aTempStr = OUString( m_aPalettePath ); break;
+ case PATH_PLUGIN: aTempStr = OUString( m_aPluginPath ); break;
+ case PATH_STORAGE: aTempStr = OUString( m_aStoragePath ); break;
+ case PATH_SUBINI: aTempStr = OUString( m_aSubIniPath ); break;
+ case PATH_TEMP: aTempStr = OUString( m_aTempPath ); break;
+ case PATH_TEMPLATE: aTempStr = OUString( m_aTemplatePath ); break;
+ case PATH_TRASH: aTempStr = OUString( m_aTrashPath ); break;
+ case PATH_USERCONFIG: aTempStr = OUString( m_aUserConfigPath ); break;
+ case PATH_USERDICTIONARY: aTempStr = OUString( m_aUserDictionaryPath ); break;
+ case PATH_WORK: aTempStr = OUString( m_aWorkPath ); break;
+
+ default:
+ DBG_ERRORFILE( "invalid index to save a path" );
+ }
+ pValues[nProp] <<= aTempStr;
+ }
+ PutProperties( aNames, aValues );
+}
+
+// -----------------------------------------------------------------------
+
+void SvtPathOptions::Notify( const Sequence<rtl::OUString>& aPropertyNames )
+{
+ DBG_ERRORFILE( "properties have been changed" );
+}
+
diff --git a/svtools/source/config/useroptions.cxx b/svtools/source/config/useroptions.cxx
new file mode 100644
index 000000000000..578978f6f075
--- /dev/null
+++ b/svtools/source/config/useroptions.cxx
@@ -0,0 +1,325 @@
+/*************************************************************************
+ *
+ * $RCSfile: useroptions.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "useroptions.hxx"
+
+#ifndef _UTL_CONFIGMGR_HXX_
+#include <unotools/configmgr.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
+#endif
+
+using namespace utl;
+using namespace rtl;
+using namespace com::sun::star::uno;
+
+// class SvtUserOptions --------------------------------------------------
+
+// initialize the static member
+SvtUserOptions* SvtUserOptions::m_pOptions = NULL;
+
+// -----------------------------------------------------------------------
+
+Sequence< OUString > SvtUserOptions::GetPropertyNames()
+{
+ static const char* aPropNames[] =
+ {
+ "Company", // USER_COMPANY
+ "FirstName", // USER_FIRSTNAME
+ "LastName", // USER_LASTNAME
+ "UserID", // USER_ID
+ "Street", // USER_STREET
+ "City", // USER_CITY
+ "State", // USER_STATE
+ "Zip", // USER_ZIP
+ "Country", // USER_COUNTRY
+ "Position", // USER_POSITION
+ "Title", // USER_TITLE
+ "TelephoneHome", // USER_TELEPHONEHOME
+ "TelephoneWork", // USER_TELEPHONEWORK
+ "Fax", // USER_FAX
+ "EMail", // USER_EMAIL
+ "CustomerNumber" // USER_CUSTOMERNUMBER
+ };
+
+ const int nCount = 16;
+ Sequence< OUString > aNames( nCount );
+ OUString* pNames = aNames.getArray();
+ for ( int i = 0; i < nCount; i++ )
+ pNames[i] = OUString::createFromAscii( aPropNames[i] );
+
+ return aNames;
+}
+
+// -----------------------------------------------------------------------
+
+const String& SvtUserOptions::GetUserToken( int nIndex )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( USER_COMPANY == nIndex )
+ return m_aCompany;
+ else if ( USER_FIRSTNAME == nIndex )
+ return m_aFirstName;
+ else if ( USER_LASTNAME == nIndex )
+ return m_aLastName;
+ else if ( USER_ID == nIndex )
+ return m_aID;
+ else if ( USER_STREET == nIndex )
+ return m_aStreet;
+ else if ( USER_CITY == nIndex )
+ return m_aCity;
+ else if ( USER_STATE == nIndex )
+ return m_aState;
+ else if ( USER_ZIP == nIndex )
+ return m_aZip;
+ else if ( USER_COUNTRY == nIndex )
+ return m_aCountry;
+ else if ( USER_POSITION == nIndex )
+ return m_aPosition;
+ else if ( USER_TITLE == nIndex )
+ return m_aTitle;
+ else if ( USER_TELEPHONEHOME == nIndex )
+ return m_aTelephoneHome;
+ else if ( USER_TELEPHONEWORK == nIndex )
+ return m_aTelephoneWork;
+ else if ( USER_FAX == nIndex )
+ return m_aFax;
+ else if ( USER_EMAIL == nIndex )
+ return m_aEmail;
+ else if ( USER_CUSTOMERNUMBER == nIndex )
+ return m_aCustomerNumber;
+ else
+ {
+ DBG_ERRORFILE( "invalid index to get a user token" );
+ return m_aEmptyString;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void SvtUserOptions::SetUserToken( int nIndex, const String& rNewToken )
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ if ( USER_COMPANY == nIndex )
+ m_aCompany = rNewToken;
+ else if ( USER_FIRSTNAME == nIndex )
+ m_aFirstName = rNewToken;
+ else if ( USER_LASTNAME == nIndex )
+ m_aLastName = rNewToken;
+ else if ( USER_ID == nIndex )
+ m_aID = rNewToken;
+ else if ( USER_STREET == nIndex )
+ m_aStreet = rNewToken;
+ else if ( USER_CITY == nIndex )
+ m_aCity = rNewToken;
+ else if ( USER_STATE == nIndex )
+ m_aState = rNewToken;
+ else if ( USER_ZIP == nIndex )
+ m_aZip = rNewToken;
+ else if ( USER_COUNTRY == nIndex )
+ m_aCountry = rNewToken;
+ else if ( USER_POSITION == nIndex )
+ m_aPosition = rNewToken;
+ else if ( USER_TITLE == nIndex )
+ m_aTitle = rNewToken;
+ else if ( USER_TELEPHONEHOME == nIndex )
+ m_aTelephoneHome = rNewToken;
+ else if ( USER_TELEPHONEWORK == nIndex )
+ m_aTelephoneWork = rNewToken;
+ else if ( USER_FAX == nIndex )
+ m_aFax = rNewToken;
+ else if ( USER_EMAIL == nIndex )
+ m_aEmail = rNewToken;
+ else if ( USER_CUSTOMERNUMBER == nIndex )
+ m_aCustomerNumber = rNewToken;
+ else
+ DBG_ERRORFILE( "invalid index to set a user token" );
+ SetModified();
+}
+
+// -----------------------------------------------------------------------
+
+SvtUserOptions::SvtUserOptions() : ConfigItem( OUString::createFromAscii("UserProfile/Data") )
+{
+ Sequence< OUString > aNames = GetPropertyNames();
+ Sequence< Any > aValues = GetProperties( aNames );
+ EnableNotification( aNames );
+ const Any* pValues = aValues.getConstArray();
+ DBG_ASSERT( aValues.getLength() == aNames.getLength(), "GetProperties failed" );
+ if ( aValues.getLength() == aNames.getLength() )
+ {
+ OUString aTempStr;
+
+ for ( int nProp = 0; nProp < aNames.getLength(); nProp++ )
+ {
+ DBG_ASSERT( pValues[nProp].hasValue(), "property value missing" );
+ if ( pValues[nProp].hasValue() )
+ {
+ pValues[nProp] >>= aTempStr;
+ switch ( nProp )
+ {
+ case USER_COMPANY: m_aCompany = String( aTempStr ); break;
+ case USER_FIRSTNAME: m_aFirstName = String( aTempStr ); break;
+ case USER_LASTNAME: m_aLastName = String( aTempStr ); break;
+ case USER_ID: m_aID = String( aTempStr ); break;
+ case USER_STREET: m_aStreet = String( aTempStr ); break;
+ case USER_CITY: m_aCity = String( aTempStr ); break;
+ case USER_STATE: m_aState = String( aTempStr ); break;
+ case USER_ZIP: m_aZip = String( aTempStr ); break;
+ case USER_COUNTRY: m_aCountry = String( aTempStr ); break;
+ case USER_POSITION: m_aPosition = String( aTempStr ); break;
+ case USER_TITLE: m_aTitle = String( aTempStr ); break;
+ case USER_TELEPHONEHOME: m_aTelephoneHome = String( aTempStr ); break;
+ case USER_TELEPHONEWORK: m_aTelephoneWork = String( aTempStr ); break;
+ case USER_FAX: m_aFax = String( aTempStr ); break;
+ case USER_EMAIL: m_aEmail = String( aTempStr ); break;
+ case USER_CUSTOMERNUMBER: m_aCustomerNumber = String( aTempStr ); break;
+
+ default:
+ DBG_ERRORFILE( "invalid index to load a user token" );
+ }
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+SvtUserOptions::~SvtUserOptions()
+{
+}
+
+// -----------------------------------------------------------------------
+
+SvtUserOptions* SvtUserOptions::GetUserOptions()
+{
+ if ( !m_pOptions )
+ m_pOptions = new SvtUserOptions;
+ return m_pOptions;
+}
+
+// -----------------------------------------------------------------------
+
+void SvtUserOptions::DestroyUserOptions()
+{
+ if ( m_pOptions )
+ DELETEZ( m_pOptions );
+}
+
+// -----------------------------------------------------------------------
+
+void SvtUserOptions::Commit()
+{
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ Sequence< OUString > aNames = GetPropertyNames();
+ OUString* pNames = aNames.getArray();
+ Sequence< Any > aValues( aNames.getLength() );
+ Any* pValues = aValues.getArray();
+ const Type& rType = ::getBooleanCppuType();
+ OUString aTempStr;
+ for ( int nProp = 0; nProp < aNames.getLength(); nProp++ )
+ {
+ switch ( nProp )
+ {
+ case USER_COMPANY: aTempStr = OUString( m_aCompany ); break;
+ case USER_FIRSTNAME: aTempStr = OUString( m_aFirstName ); break;
+ case USER_LASTNAME: aTempStr = OUString( m_aLastName ); break;
+ case USER_ID: aTempStr = OUString( m_aID ); break;
+ case USER_STREET: aTempStr = OUString( m_aStreet ); break;
+ case USER_CITY: aTempStr = OUString( m_aCity ); break;
+ case USER_STATE: aTempStr = OUString( m_aState ); break;
+ case USER_ZIP: aTempStr = OUString( m_aZip ); break;
+ case USER_COUNTRY: aTempStr = OUString( m_aCountry ); break;
+ case USER_POSITION: aTempStr = OUString( m_aPosition ); break;
+ case USER_TITLE: aTempStr = OUString( m_aTitle ); break;
+ case USER_TELEPHONEHOME: aTempStr = OUString( m_aTelephoneHome ); break;
+ case USER_TELEPHONEWORK: aTempStr = OUString( m_aTelephoneWork ); break;
+ case USER_FAX: aTempStr = OUString( m_aFax ); break;
+ case USER_EMAIL: aTempStr = OUString( m_aEmail ); break;
+ case USER_CUSTOMERNUMBER: aTempStr = OUString( m_aCustomerNumber ); break;
+
+ default:
+ DBG_ERRORFILE( "invalid index to save a user token" );
+ }
+ pValues[nProp] <<= aTempStr;
+ }
+ PutProperties( aNames, aValues );
+}
+
+// -----------------------------------------------------------------------
+
+void SvtUserOptions::Notify( const Sequence<rtl::OUString>& aPropertyNames )
+{
+ DBG_ERRORFILE( "properties have been changed" );
+}
+
diff --git a/svtools/source/contnr/cont_pch.cxx b/svtools/source/contnr/cont_pch.cxx
new file mode 100644
index 000000000000..4753a03158dc
--- /dev/null
+++ b/svtools/source/contnr/cont_pch.cxx
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * $RCSfile: cont_pch.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <sv.hxx>
+#include "treelist.hxx"
+#include "svtabbx.hxx"
+#include "svtreebx.hxx"
+#include "svicnvw.hxx"
+#include "svimpbox.hxx"
+#include "svimpicn.hxx"
+#include "svlbox.hxx"
+#include "svlbitm.hxx"
+
+#pragma hdrstop
+
diff --git a/svtools/source/contnr/ctrdll.cxx b/svtools/source/contnr/ctrdll.cxx
new file mode 100644
index 000000000000..20729e743e5b
--- /dev/null
+++ b/svtools/source/contnr/ctrdll.cxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrdll.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef WIN
+
+#ifndef _SVWIN_H
+#include <svwin.h>
+#endif
+
+#ifndef _SYSDEP_HXX
+#include <sysdep.hxx>
+#endif
+
+// Statische DLL-Verwaltungs-Variablen
+static HINSTANCE hDLLInst = 0; // HANDLE der DLL
+
+
+/***************************************************************************
+|*
+|* LibMain()
+|*
+|* Beschreibung Initialisierungsfunktion der DLL
+|* Ersterstellung TH 05.05.93
+|* Letzte Aenderung TH 05.05.93
+|*
+***************************************************************************/
+
+extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
+{
+#ifndef WNT
+ if ( nHeap )
+ UnlockData( 0 );
+#endif
+
+ hDLLInst = hDLL;
+
+ return TRUE;
+}
+
+/***************************************************************************
+|*
+|* WEP()
+|*
+|* Beschreibung DLL-Deinitialisierung
+|* Ersterstellung TH 05.05.93
+|* Letzte Aenderung TH 05.05.93
+|*
+***************************************************************************/
+
+extern "C" int CALLBACK WEP( int )
+{
+ return 1;
+}
+
+#endif
diff --git a/svtools/source/contnr/makefile.mk b/svtools/source/contnr/makefile.mk
new file mode 100644
index 000000000000..cddb84f1bc6c
--- /dev/null
+++ b/svtools/source/contnr/makefile.mk
@@ -0,0 +1,134 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=svcontnr
+
+PROJECTPCH4DLL=TRUE
+PROJECTPCH=cont_pch
+PROJECTPCHSOURCE=cont_pch
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(COM)"=="WTC"
+CFLAGS=$(CFLAGS) -od -3r
+.ENDIF
+
+.IF "$(header)" == ""
+
+CXXFILES= svtabbx.cxx \
+ svicnvw.cxx \
+ svimpicn.cxx \
+ treelist.cxx \
+ svlbox.cxx \
+ svimpbox.cxx \
+ svlbitm.cxx \
+ svtreebx.cxx \
+ cont_pch.cxx \
+ ctrdll.cxx
+
+SLOFILES= $(SLO)$/svtabbx.obj \
+ $(SLO)$/svicnvw.obj \
+ $(SLO)$/svimpicn.obj \
+ $(SLO)$/treelist.obj \
+ $(SLO)$/svlbox.obj \
+ $(SLO)$/svimpbox.obj \
+ $(SLO)$/svlbitm.obj \
+ $(SLO)$/svtreebx.obj
+
+# Fuer das Setup bauen wir noch mal statisch
+.IF "$(VCSID)" != "OV"
+
+OBJFILES= $(OBJ)$/svtabbx.obj \
+ $(OBJ)$/svicnvw.obj \
+ $(OBJ)$/svimpicn.obj \
+ $(OBJ)$/treelist.obj \
+ $(OBJ)$/svlbox.obj \
+ $(OBJ)$/svimpbox.obj \
+ $(OBJ)$/svlbitm.obj \
+ $(OBJ)$/svtreebx.obj
+
+.ENDIF
+
+.ENDIF
+
+HXX1TARGET= svcontnr
+HXX1EXT= hxx
+HXX1FILES= $(PRJ)$/inc$/svlbox.hxx \
+ $(PRJ)$/inc$/svlbitm.hxx \
+ $(PRJ)$/inc$/svtreebx.hxx \
+ $(PRJ)$/inc$/svicnvw.hxx \
+ $(PRJ)$/inc$/svtabbx.hxx \
+ $(PRJ)$/inc$/treelist.hxx
+HXX1EXCL= -E:*include*
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/contnr/svicnvw.cxx b/svtools/source/contnr/svicnvw.cxx
new file mode 100644
index 000000000000..e2948c69e60a
--- /dev/null
+++ b/svtools/source/contnr/svicnvw.cxx
@@ -0,0 +1,855 @@
+/*************************************************************************
+ *
+ * $RCSfile: svicnvw.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <svlbox.hxx>
+#include <svicnvw.hxx>
+#include <svimpicn.hxx>
+#include <svlbitm.hxx>
+
+#pragma hdrstop
+
+#define ICNVW_BLOCK_ENTRYINS 0x0001
+
+SvIcnVwDataEntry::SvIcnVwDataEntry()
+ : nIcnVwFlags(0),eTextMode(ShowTextDontKnow)
+{
+}
+
+SvIcnVwDataEntry::~SvIcnVwDataEntry()
+{
+}
+
+SvIconView::SvIconView( Window* pParent, WinBits nWinStyle ) :
+ SvLBox( pParent, nWinStyle | WB_BORDER )
+{
+ nWinBits = nWinStyle;
+ nIcnVwFlags = 0;
+ pImp = new SvImpIconView( this, GetModel(), nWinStyle | WB_ICON );
+ pImp->pViewData = 0;
+ SetSelectionMode( SINGLE_SELECTION );
+ SetLineColor();
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
+ SetDefaultFont();
+}
+
+SvIconView::SvIconView( Window* pParent , const ResId& rResId ) :
+ SvLBox( pParent, rResId )
+{
+ pImp = new SvImpIconView( this, GetModel(), WB_BORDER | WB_ICON );
+ nIcnVwFlags = 0;
+ pImp->pViewData = 0;
+ SetLineColor();
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
+ SetDefaultFont();
+ pImp->SetSelectionMode( GetSelectionMode() );
+ pImp->SetWindowBits( nWindowStyle );
+ nWinBits = nWindowStyle;
+}
+
+SvIconView::~SvIconView()
+{
+ delete pImp;
+}
+
+void SvIconView::SetDefaultFont()
+{
+ SetFont( GetFont() );
+}
+
+SvLBoxEntry* SvIconView::CreateEntry( const XubString& rStr,
+ const Image& rCollEntryBmp, const Image& rExpEntryBmp )
+{
+ SvLBoxEntry* pEntry = new SvLBoxEntry;
+
+ SvLBoxContextBmp* pContextBmp =
+ new SvLBoxContextBmp( pEntry,0, rCollEntryBmp,rExpEntryBmp, 0xffff );
+ pEntry->AddItem( pContextBmp );
+
+ SvLBoxString* pString = new SvLBoxString( pEntry, 0, rStr );
+ pEntry->AddItem( pString );
+
+ return pEntry;
+}
+
+void SvIconView::DisconnectFromModel()
+{
+ SvLBox::DisconnectFromModel();
+ pImp->SetModel( GetModel(), 0 );
+}
+
+
+SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
+ SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos )
+{
+ SvLBoxEntry* pEntry = CreateEntry(
+ rText, aCollapsedEntryBmp, aExpandedEntryBmp );
+ pEntry->EnableChildsOnDemand( bChildsOnDemand );
+
+ if ( !pParent )
+ SvLBox::Insert( pEntry, nPos );
+ else
+ SvLBox::Insert( pEntry, pParent, nPos );
+ return pEntry;
+}
+
+SvLBoxEntry* SvIconView::InsertEntry( const XubString& rText,
+ const Image& rExpEntryBmp,
+ const Image& rCollEntryBmp,
+ SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos)
+{
+ SvLBoxEntry* pEntry = CreateEntry(
+ rText, rCollEntryBmp, rExpEntryBmp );
+
+ pEntry->EnableChildsOnDemand( bChildsOnDemand );
+ if ( !pParent )
+ SvLBox::Insert( pEntry, nPos );
+ else
+ SvLBox::Insert( pEntry, pParent, nPos );
+ return pEntry;
+}
+
+
+void SvIconView::SetEntryText(SvLBoxEntry* pEntry, const XubString& rStr)
+{
+ SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ if ( pItem )
+ {
+ pItem->SetText( pEntry, rStr );
+ GetModel()->InvalidateEntry( pEntry );
+ }
+}
+
+void SvIconView::SetExpandedEntryBmp(SvLBoxEntry* pEntry, const Image& rBmp)
+{
+ SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ if ( pItem )
+ {
+ pItem->SetBitmap2( pEntry, rBmp );
+ GetModel()->InvalidateEntry( pEntry );
+ }
+}
+
+void SvIconView::SetCollapsedEntryBmp(SvLBoxEntry* pEntry,
+ const Image& rBmp )
+{
+ SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ if ( pItem )
+ {
+ pItem->SetBitmap1( pEntry, rBmp );
+ GetModel()->InvalidateEntry( pEntry );
+ }
+}
+
+XubString SvIconView::GetEntryText(SvLBoxEntry* pEntry ) const
+{
+ XubString aStr;
+ SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ if ( pItem )
+ aStr = pItem->GetText();
+ return aStr;
+}
+
+Image SvIconView::GetExpandedEntryBmp(SvLBoxEntry* pEntry) const
+{
+ Image aBmp;
+ SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ if ( pItem )
+ aBmp = pItem->GetBitmap2();
+ return aBmp;
+}
+
+Image SvIconView::GetCollapsedEntryBmp(SvLBoxEntry* pEntry) const
+{
+ Image aBmp;
+ SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ if ( pItem )
+ aBmp = pItem->GetBitmap1();
+ return aBmp;
+}
+
+
+SvLBoxEntry* SvIconView::CloneEntry( SvLBoxEntry* pSource )
+{
+ XubString aStr;
+ Image aCollEntryBmp;
+ Image aExpEntryBmp;
+
+ SvLBoxString* pStringItem = (SvLBoxString*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ if ( pStringItem )
+ aStr = pStringItem->GetText();
+ SvLBoxContextBmp* pBmpItem =(SvLBoxContextBmp*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ if ( pBmpItem )
+ {
+ aCollEntryBmp = pBmpItem->GetBitmap1();
+ aExpEntryBmp = pBmpItem->GetBitmap2();
+ }
+ SvLBoxEntry* pEntry = CreateEntry( aStr, aCollEntryBmp, aExpEntryBmp );
+ pEntry->SvListEntry::Clone( pSource );
+ pEntry->EnableChildsOnDemand( pSource->HasChildsOnDemand() );
+ pEntry->SetUserData( pSource->GetUserData() );
+ return pEntry;
+}
+
+
+USHORT SvIconView::IsA()
+{
+ return SV_LISTBOX_ID_ICONVIEW;
+}
+
+void SvIconView::RequestingChilds( SvLBoxEntry* pParent )
+{
+ if ( !pParent->HasChilds() )
+ InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND );
+}
+
+void __EXPORT SvIconView::Paint( const Rectangle& rRect )
+{
+ pImp->Paint( rRect );
+}
+
+void __EXPORT SvIconView::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ pImp->MouseButtonDown( rMEvt );
+}
+
+void __EXPORT SvIconView::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ pImp->MouseButtonUp( rMEvt );
+}
+
+void __EXPORT SvIconView::MouseMove( const MouseEvent& rMEvt )
+{
+ pImp->MouseMove( rMEvt );
+}
+
+void __EXPORT SvIconView::KeyInput( const KeyEvent& rKEvt )
+{
+ // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down
+ if( IsEditingActive() )
+ return;
+
+ nImpFlags |= SVLBOX_IS_TRAVELSELECT;
+ BOOL bKeyUsed = pImp->KeyInput( rKEvt );
+ if ( !bKeyUsed )
+ SvLBox::KeyInput( rKEvt );
+ nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
+}
+
+void __EXPORT SvIconView::Resize()
+{
+ pImp->Resize();
+ SvLBox::Resize();
+}
+
+void __EXPORT SvIconView::GetFocus()
+{
+ pImp->GetFocus();
+ SvLBox::GetFocus();
+}
+
+void __EXPORT SvIconView::LoseFocus()
+{
+ pImp->LoseFocus();
+ SvLBox::LoseFocus();
+}
+
+void SvIconView::SetUpdateMode( BOOL bUpdate )
+{
+ Control::SetUpdateMode( bUpdate );
+ if ( bUpdate )
+ pImp->UpdateAll();
+}
+
+void SvIconView::SetModel( SvLBoxTreeList* pNewModel )
+{
+}
+
+void SvIconView::SetModel( SvLBoxTreeList* pNewModel, SvLBoxEntry* pParent )
+{
+ nIcnVwFlags |= ICNVW_BLOCK_ENTRYINS;
+ SvLBox::SetModel( pNewModel );
+ nIcnVwFlags &= (~ICNVW_BLOCK_ENTRYINS);
+ if ( pParent && pParent->HasChildsOnDemand() )
+ RequestingChilds( pParent );
+ pImp->SetModel( pNewModel, pParent );
+}
+
+void __EXPORT SvIconView::ModelHasCleared()
+{
+ SvLBox::ModelHasCleared();
+ pImp->Clear();
+}
+
+void __EXPORT SvIconView::ModelHasInserted( SvListEntry* pEntry )
+{
+ if( !(nIcnVwFlags & ICNVW_BLOCK_ENTRYINS ) )
+ pImp->EntryInserted( (SvLBoxEntry*)pEntry );
+}
+
+void __EXPORT SvIconView::ModelHasInsertedTree( SvListEntry* pEntry )
+{
+ pImp->TreeInserted( (SvLBoxEntry*)pEntry );
+}
+
+void __EXPORT SvIconView::ModelIsMoving(SvListEntry* pSource,
+ SvListEntry* /* pTargetParent */ , ULONG /* nChildPos */ )
+{
+ pImp->MovingEntry( (SvLBoxEntry*)pSource );
+}
+
+void __EXPORT SvIconView::ModelHasMoved(SvListEntry* pSource )
+{
+ pImp->EntryMoved( (SvLBoxEntry*)pSource );
+}
+
+void __EXPORT SvIconView::ModelIsRemoving( SvListEntry* pEntry )
+{
+ pImp->RemovingEntry( (SvLBoxEntry*)pEntry );
+ NotifyRemoving( (SvLBoxEntry*)pEntry );
+}
+
+void __EXPORT SvIconView::ModelHasRemoved( SvListEntry* /* pEntry */ )
+{
+ pImp->EntryRemoved();
+}
+
+void __EXPORT SvIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
+{
+ // die einzelnen Items des Entries reinitialisieren
+ SvLBox::ModelHasEntryInvalidated( pEntry );
+ // painten
+ pImp->ModelHasEntryInvalidated( pEntry );
+}
+
+void SvIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow )
+{
+ pImp->ShowTargetEmphasis( pEntry, bShow );
+}
+
+Point SvIconView::GetEntryPos( SvLBoxEntry* pEntry ) const
+{
+ return ((SvIconView*)this)->pImp->GetEntryPos( pEntry );
+}
+
+void SvIconView::SetEntryPos( SvLBoxEntry* pEntry, const Point& rPos)
+{
+ pImp->SetEntryPos( pEntry, rPos, FALSE, TRUE );
+}
+
+void SvIconView::SetEntryPos( SvLBoxEntry* pEntry, const Point& rPos, BOOL bAdjustAtGrid )
+{
+ pImp->SetEntryPos( pEntry, rPos, bAdjustAtGrid );
+}
+
+void SvIconView::SetFont( const Font& rFont )
+{
+ Font aTempFont( rFont );
+ aTempFont.SetTransparent( TRUE );
+ SvLBox::SetFont( aTempFont );
+ RecalcViewData();
+ pImp->ChangedFont();
+}
+
+void SvIconView::ViewDataInitialized( SvLBoxEntry* pEntry )
+{
+ pImp->ViewDataInitialized( pEntry );
+}
+
+SvLBoxEntry* SvIconView::GetCurEntry() const
+{
+ return pImp->GetCurEntry();
+}
+
+SvLBoxEntry* SvIconView::GetDropTarget( const Point& rPos )
+{
+ return pImp->GetDropTarget( rPos );
+}
+
+SvLBoxEntry* SvIconView::GetEntry( const Point& rPixPos, BOOL ) const
+{
+ Point aPos( rPixPos );
+ aPos -= GetMapMode().GetOrigin();
+ return ((SvIconView*)this)->pImp->GetEntry( aPos );
+}
+
+SvLBoxEntry* SvIconView::GetEntryFromLogicPos( const Point& rDocPos ) const
+{
+ return ((SvIconView*)this)->pImp->GetEntry( rDocPos );
+}
+
+
+void SvIconView::SetWindowBits( WinBits nWinStyle )
+{
+ nWinBits = nWinStyle;
+ pImp->SetWindowBits( nWinStyle );
+}
+
+void SvIconView::PaintEntry( SvLBoxEntry* pEntry )
+{
+ pImp->PaintEntry( pEntry );
+}
+
+
+void SvIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos )
+{
+ pImp->PaintEntry( pEntry, rPos );
+}
+
+Rectangle SvIconView::GetFocusRect( SvLBoxEntry* pEntry )
+{
+ return pImp->CalcFocusRect( pEntry );
+}
+
+void SvIconView::InvalidateEntry( SvLBoxEntry* pEntry )
+{
+ pImp->InvalidateEntry( pEntry );
+}
+
+void SvIconView::SetDragDropMode( DragDropMode nDDMode )
+{
+ SvLBox::SetDragDropMode( nDDMode );
+ pImp->SetDragDropMode( nDDMode );
+}
+
+void SvIconView::SetSelectionMode( SelectionMode eSelMode )
+{
+ SvLBox::SetSelectionMode( eSelMode );
+ pImp->SetSelectionMode( eSelMode );
+}
+
+BOOL SvIconView::Select( SvLBoxEntry* pEntry, BOOL bSelect )
+{
+ EndEditing();
+ BOOL bRetVal = SvListView::Select( pEntry, bSelect );
+ if( bRetVal )
+ {
+ pImp->EntrySelected( pEntry, bSelect );
+ pHdlEntry = pEntry;
+ SelectHdl();
+ }
+ return bRetVal;
+}
+
+void SvIconView::SelectAll( BOOL bSelect, BOOL bPaint )
+{
+ SvLBoxEntry* pEntry = pImp->GetCurParent();
+ pEntry = FirstChild( pEntry );
+ while( pEntry )
+ {
+ Select( pEntry, bSelect );
+ pEntry = NextSibling( pEntry );
+ }
+}
+
+void SvIconView::Arrange()
+{
+#ifdef DBG_UTIL
+ USHORT n=1;
+ if( n == 1 && n-1 == 0 )
+ {
+ pImp->Arrange();
+ }
+ else
+ {
+ pImp->AdjustAtGrid();
+ }
+#else
+ pImp->Arrange();
+#endif
+}
+
+
+void SvIconView::SetSpaceBetweenEntries( long nX, long nY )
+{
+ pImp->SetSpaceBetweenEntries( nX, nY );
+}
+
+BOOL SvIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+{
+ return pImp->NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
+}
+
+BOOL SvIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+{
+ return pImp->NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos);
+}
+
+
+void SvIconView::EnableInplaceEditing( BOOL bEnable )
+{
+ SvLBox::EnableInplaceEditing( bEnable );
+}
+
+void SvIconView::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
+ const Point& )
+{
+ if ( pItem->IsA() == SV_ITEM_ID_LBOXSTRING )
+ {
+ Selection aSel( SELECTION_MIN, SELECTION_MAX );
+ if ( EditingEntry( pEntry, aSel ) )
+ {
+ SelectAll( FALSE );
+ EditItemText( pEntry, (SvLBoxString*)pItem, aSel );
+ }
+ }
+}
+
+
+void SvIconView::EditItemText( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
+ const Selection& rSel )
+{
+ DBG_ASSERT(pEntry&&pItem,"EditItemText:Params?")
+ pCurEdEntry = pEntry;
+ pCurEdItem = pItem;
+ Rectangle aRect( pImp->CalcTextRect( pEntry, (SvLBoxString*)pItem,0,TRUE ));
+
+ aRect.Bottom() += 4;
+ pImp->MakeVisible( aRect ); // vor der Umrechnung in Pixel-Koord. rufen!
+ aRect.Bottom() -= 4;
+
+ Point aPos( aRect.TopLeft() );
+ aPos += GetMapMode().GetOrigin(); // Dok-Koord. -> Window-Koord.
+ aRect.SetPos( aPos );
+
+ aRect.Bottom() += 2; // sieht huebscher aus
+
+#ifdef WIN
+ aRect.Bottom() += 4;
+#endif
+#ifdef OS2
+
+#if OS2_SINGLE_LINE_EDIT
+ aRect.Left() -= 3;
+ aRect.Right() += 3;
+ aRect.Top() -= 3;
+ aRect.Bottom() += 3;
+#else
+ aRect.Left() -= 10;
+ aRect.Right() += 10;
+ aRect.Top() -= 5;
+ aRect.Bottom() += 5;
+#endif
+
+#endif // OS2
+ EditText( ((SvLBoxString*)pItem)->GetText(), aRect, rSel, TRUE );
+}
+
+void SvIconView::EditEntry( SvLBoxEntry* pEntry )
+{
+ if( !pEntry )
+ pEntry = pImp->GetCurEntry();
+ if( pEntry )
+ {
+ SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ if( pItem )
+ {
+ Selection aSel( SELECTION_MIN, SELECTION_MAX );
+ if( EditingEntry( pEntry, aSel ) )
+ {
+ SelectAll( FALSE );
+ EditItemText( pEntry, pItem, aSel );
+ }
+ }
+ }
+}
+
+void SvIconView::EditedText( const XubString& rStr )
+{
+ XubString aRefStr( ((SvLBoxString*)pCurEdItem)->GetText() );
+ if ( EditedEntry( pCurEdEntry, rStr ) )
+ {
+ ((SvLBoxString*)pCurEdItem)->SetText( pCurEdEntry, rStr );
+ pModel->InvalidateEntry( pCurEdEntry );
+ }
+ if( GetSelectionMode()==SINGLE_SELECTION && !GetSelectionCount())
+ Select( pCurEdEntry );
+}
+
+
+BOOL SvIconView::EditingEntry( SvLBoxEntry*, Selection& )
+{
+ return TRUE;
+}
+
+BOOL SvIconView::EditedEntry( SvLBoxEntry*, const XubString& )
+{
+ return TRUE;
+}
+
+
+void SvIconView::WriteDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo)
+{
+ pImp->WriteDragServerInfo( rPos, pInfo );
+}
+
+void SvIconView::ReadDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo )
+{
+ pImp->ReadDragServerInfo( rPos, pInfo );
+}
+
+void SvIconView::Command( const CommandEvent& rCEvt )
+{
+ pImp->Command( rCEvt );
+}
+
+void SvIconView::SetCurParent( SvLBoxEntry* pNewParent )
+{
+ if ( pNewParent && pNewParent->HasChildsOnDemand() )
+ RequestingChilds( pNewParent );
+ pImp->SetCurParent( pNewParent );
+}
+
+SvLBoxEntry* SvIconView::GetCurParent() const
+{
+ return pImp->GetCurParent();
+}
+
+SvViewData* SvIconView::CreateViewData( SvListEntry* pEntry )
+{
+ SvIcnVwDataEntry* pEntryData = new SvIcnVwDataEntry;
+ return (SvViewData*)pEntryData;
+}
+
+void SvIconView::InitViewData( SvViewData* pData, SvListEntry* pEntry )
+{
+ SvLBox::InitViewData( pData, pEntry );
+ pImp->InvalidateBoundingRect( ((SvIcnVwDataEntry*)pData)->aRect );
+}
+
+Region SvIconView::GetDragRegion() const
+{
+ Rectangle aRect;
+ SvLBoxEntry* pEntry = GetCurEntry();
+ if( pEntry )
+ aRect = pImp->GetBoundingRect( pEntry );
+ Region aRegion( aRect );
+ return aRegion;
+}
+
+ULONG SvIconView::GetSelectionCount() const
+{
+ return (ULONG)(pImp->GetSelectionCount());
+}
+
+void SvIconView::SetGrid( long nDX, long nDY )
+{
+ pImp->SetGrid( nDX, nDY );
+}
+
+void SvIconView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, ULONG nPos )
+{
+ SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos );
+ switch( nActionId )
+ {
+ case LISTACTION_RESORTING:
+ SetUpdateMode( FALSE );
+ break;
+
+ case LISTACTION_RESORTED:
+ SetUpdateMode( TRUE );
+ Arrange();
+ break;
+
+ case LISTACTION_CLEARED:
+ if( IsUpdateMode() )
+ Update();
+ break;
+ }
+}
+
+
+void SvIconView::Scroll( long nDeltaX, long nDeltaY )
+{
+ pImp->Scroll( nDeltaX, nDeltaY, FALSE );
+}
+
+void SvIconView::PrepareCommandEvent( const CommandEvent& rCEvt )
+{
+ pImp->PrepareCommandEvent( rCEvt );
+}
+
+void SvIconView::BeginDrag( const Point& rPos )
+{
+ SvLBoxEntry* pEntry = GetEntry( rPos, TRUE );
+ pImp->pViewData = pEntry;
+ SvLBox::BeginDrag( rPos );
+}
+
+BOOL __EXPORT SvIconView::QueryDrop( DropEvent& rDEvt )
+{
+ if( pImp->pViewData )
+ {
+ pImp->HideDDIcon();
+ }
+ BOOL bResult = SvLBox::QueryDrop( rDEvt );
+ if( bResult )
+ {
+ pImp->ShowDDIcon( pImp->pViewData, rDEvt.GetPosPixel() );
+ }
+ return bResult;
+}
+
+BOOL SvIconView::Drop( const DropEvent& rDEvt )
+{
+ if( pImp->pViewData )
+ {
+ pImp->HideDDIcon();
+ pImp->pViewData = 0;
+ }
+ return SvLBox::Drop( rDEvt );
+}
+
+void SvIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos )
+{
+ pImp->ShowDDIcon( pRefEntry, rPos );
+}
+
+void SvIconView::HideDDIcon()
+{
+ pImp->HideDDIcon();
+}
+
+void SvIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPos )
+{
+ pImp->HideShowDDIcon( pRefEntry, rPos );
+}
+
+void SvIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
+ SvPtrarr* pRects, short nOffs )
+{
+ pImp->SelectRect( rRect, bAdd, pRects, nOffs );
+}
+
+void SvIconView::CalcScrollOffsets( const Point& rRefPosPixel, long& rX, long& rY,
+ BOOL b, USHORT nBorderWidth )
+{
+ pImp->CalcScrollOffsets( rRefPosPixel, rX, rY, b, nBorderWidth );
+}
+
+void SvIconView::EndTracking()
+{
+ pImp->EndTracking();
+}
+
+void SvIconView::MakeVisible( SvLBoxEntry* pEntry )
+{
+ pImp->MakeVisible( pEntry );
+}
+
+void SvIconView::PreparePaint( SvLBoxEntry* )
+{
+}
+
+void SvIconView::AdjustAtGrid( SvLBoxEntry* pEntry )
+{
+ pImp->AdjustAtGrid( pEntry );
+}
+
+void SvIconView::LockEntryPos( SvLBoxEntry* pEntry, BOOL bLock )
+{
+ SvIcnVwDataEntry* pViewData = (SvIcnVwDataEntry*)GetViewData( pEntry );
+ if( bLock )
+ pViewData->SetVwFlags( ICNVW_FLAG_POS_LOCKED );
+ else
+ pViewData->ClearVwFlags( ICNVW_FLAG_POS_LOCKED );
+}
+
+BOOL SvIconView::IsEntryPosLocked( const SvLBoxEntry* pEntry ) const
+{
+ const SvIcnVwDataEntry* pViewData = (const SvIcnVwDataEntry*)GetViewData( (SvListEntry*)pEntry );
+ return pViewData->IsEntryPosLocked();
+}
+
+void SvIconView::SetTextMode( SvIconViewTextMode eMode, SvLBoxEntry* pEntry )
+{
+ pImp->SetTextMode( eMode, pEntry );
+}
+
+SvIconViewTextMode SvIconView::GetTextMode( const SvLBoxEntry* pEntry ) const
+{
+ return pImp->GetTextMode( pEntry );
+}
+
+SvLBoxEntry* SvIconView::GetNextEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const
+{
+ Point aPos( rPixPos );
+ aPos -= GetMapMode().GetOrigin();
+ return ((SvIconView*)this)->pImp->GetNextEntry( aPos, pCurEntry );
+}
+
+SvLBoxEntry* SvIconView::GetPrevEntry( const Point& rPixPos, SvLBoxEntry* pCurEntry, BOOL ) const
+{
+ Point aPos( rPixPos );
+ aPos -= GetMapMode().GetOrigin();
+ return ((SvIconView*)this)->pImp->GetPrevEntry( aPos, pCurEntry );
+}
+
+void SvIconView::ShowFocusRect( const SvLBoxEntry* pEntry )
+{
+ pImp->ShowFocusRect( pEntry );
+}
+
+
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
new file mode 100644
index 000000000000..ebdc765651cf
--- /dev/null
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -0,0 +1,3171 @@
+/*************************************************************************
+ *
+ * $RCSfile: svimpbox.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+
+#ifndef _HELP_HXX
+#include <vcl/help.hxx>
+#endif
+#ifndef _TABBAR_HXX
+#include <tabbar.hxx>
+#endif
+
+#pragma hdrstop
+
+#define _SVTREEBX_CXX
+#include <svtreebx.hxx>
+#ifndef _SVLBOX_HXX
+#include <svlbox.hxx>
+#endif
+#include <svimpbox.hxx>
+
+
+#define NODE_BMP_TABDIST_NOTVALID -2000000
+
+SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits nWinStyle) :
+ aVerSBar( pLBView, WB_DRAG | WB_VSCROLL ),
+ aHorSBar( pLBView, WB_DRAG | WB_HSCROLL ),
+ aScrBarBox( pLBView ),
+ aOutputSize( 0,0 ),
+ aSelEng( pLBView, (FunctionSet*)0 ),
+ aFctSet( this, &aSelEng, pLBView ),
+ pTabBar(0)
+{
+ pView = pLBView;
+ pTree = pLBTree;
+ aSelEng.SetFunctionSet( (FunctionSet*)&aFctSet );
+ aSelEng.ExpandSelectionOnMouseMove( FALSE );
+ SetWindowBits( nWinStyle );
+ SetSelectionMode( SINGLE_SELECTION );
+ SetDragDropMode( 0 );
+
+ aVerSBar.SetScrollHdl( LINK( this, SvImpLBox, ScrollUpDownHdl ) );
+ aHorSBar.SetScrollHdl( LINK( this, SvImpLBox, ScrollLeftRightHdl ) );
+ aHorSBar.SetEndScrollHdl( LINK( this, SvImpLBox, EndScrollHdl ) );
+ aVerSBar.SetEndScrollHdl( LINK( this, SvImpLBox, EndScrollHdl ) );
+#if SUPD > 358
+ aVerSBar.SetRange( Range(0,0) );
+ aVerSBar.Hide();
+#endif
+ aHorSBar.SetRange( Range(0,0) );
+ aHorSBar.SetPageSize( 24 ); // Pixel
+ aHorSBar.SetLineSize( 8 ); // Pixel
+
+ nHorSBarHeight = (short)aHorSBar.GetSizePixel().Height();
+ nVerSBarWidth = (short)aVerSBar.GetSizePixel().Width();
+
+ pStartEntry = 0;
+ pCursor = 0;
+ pAnchor = 0;
+ nVisibleCount = 0; // Anzahl Daten-Zeilen im Control
+ nNodeBmpTabDistance = NODE_BMP_TABDIST_NOTVALID;
+ nYoffsNodeBmp = 0;
+ nNodeBmpWidth = 0;
+
+ bAsyncBeginDrag = FALSE;
+ aAsyncBeginDragTimer.SetTimeout( 0 );
+ aAsyncBeginDragTimer.SetTimeoutHdl( LINK(this,SvImpLBox,BeginDragHdl));
+ // Button-Animation in Listbox
+ pActiveButton = 0;
+ pActiveEntry = 0;
+ pActiveTab = 0;
+
+ nFlags = 0;
+
+ aEditTimer.SetTimeout( 800 );
+ aEditTimer.SetTimeoutHdl( LINK(this,SvImpLBox,EditTimerCall) );
+
+ nMostRight = -1;
+ pMostRightEntry = 0;
+ nCurUserEvent = 0xffffffff;
+
+ bUpdateMode = TRUE;
+ bInVScrollHdl = FALSE;
+ nFlags |= F_FILLING;
+}
+
+SvImpLBox::~SvImpLBox()
+{
+ aEditTimer.Stop();
+ StopUserEvent();
+}
+
+void SvImpLBox::SetWindowBits( WinBits nWinStyle )
+{
+ nWinBits = nWinStyle;
+ if((nWinStyle & WB_SIMPLEMODE) && aSelEng.GetSelectionMode()==MULTIPLE_SELECTION)
+ aSelEng.AddAlways( TRUE );
+}
+
+// Das Model darf hier nicht mehr angefasst werden
+void SvImpLBox::Clear()
+{
+ StopUserEvent();
+ pStartEntry = 0;
+ pAnchor = 0;
+
+ pActiveButton = 0;
+ pActiveEntry = 0;
+ pActiveTab = 0;
+
+ nMostRight = -1;
+ pMostRightEntry = 0;
+
+ // Der Cursor darf hier nicht mehr angefasst werden!
+ if( pCursor )
+ {
+ if( pView->HasFocus() )
+ pView->HideFocus();
+ pCursor = 0;
+ }
+ aVerSBar.Hide();
+ aVerSBar.SetThumbPos( 0 );
+ Range aRange( 0, 0 );
+ aVerSBar.SetRange( aRange );
+ aOutputSize = pView->Control::GetOutputSizePixel();
+ nFlags &= ~(F_VER_SBARSIZE_WITH_HBAR | F_HOR_SBARSIZE_WITH_VBAR );
+ if( pTabBar )
+ {
+ aOutputSize.Height() -= nHorSBarHeight;
+ nFlags |= F_VER_SBARSIZE_WITH_HBAR;
+ }
+ if( !pTabBar )
+ aHorSBar.Hide();
+ aHorSBar.SetThumbPos( 0 );
+ MapMode aMapMode( pView->GetMapMode());
+ aMapMode.SetOrigin( Point(0,0) );
+ pView->Control::SetMapMode( aMapMode );
+ aHorSBar.SetRange( aRange );
+ aHorSBar.SetSizePixel(Size(aOutputSize.Width(),nHorSBarHeight));
+ pView->SetClipRegion();
+ if( GetUpdateMode() )
+ pView->Invalidate( GetVisibleArea() );
+ nFlags |= F_FILLING;
+ if( !aHorSBar.IsVisible() && !aVerSBar.IsVisible() )
+ aScrBarBox.Hide();
+}
+
+// *********************************************************************
+// Painten, Navigieren, Scrollen
+// *********************************************************************
+
+IMPL_LINK_INLINE_START( SvImpLBox, EndScrollHdl, ScrollBar *, pScrollBar )
+{
+ if( nFlags & F_ENDSCROLL_SET_VIS_SIZE )
+ {
+ aVerSBar.SetVisibleSize( nNextVerVisSize );
+ nFlags &= ~F_ENDSCROLL_SET_VIS_SIZE;
+ }
+ EndScroll();
+ return 0;
+}
+IMPL_LINK_INLINE_END( SvImpLBox, EndScrollHdl, ScrollBar *, pScrollBar )
+
+
+// Handler vertikale ScrollBar
+
+IMPL_LINK( SvImpLBox, ScrollUpDownHdl, ScrollBar *, pScrollBar )
+{
+ DBG_ASSERT(!bInVScrollHdl,"Scroll-Handler ueberholt sich!");
+ long nDelta = pScrollBar->GetDelta();
+ if( !nDelta )
+ return 0;
+
+ nFlags &= (~F_FILLING);
+
+ bInVScrollHdl = TRUE;
+
+ if( pView->IsEditingActive() )
+ {
+ pView->EndEditing( TRUE ); // Cancel
+ pView->Update();
+ }
+ BeginScroll();
+
+ if( nDelta > 0 )
+ {
+ if( nDelta == 1 )
+ CursorDown();
+ else
+ PageDown( (USHORT) nDelta );
+ }
+ else
+ {
+ nDelta *= (-1);
+ if( nDelta == 1 )
+ CursorUp();
+ else
+ PageUp( (USHORT) nDelta );
+ }
+ bInVScrollHdl = FALSE;
+ return 0;
+}
+
+
+void SvImpLBox::CursorDown()
+{
+ SvLBoxEntry* pNextFirstToDraw = (SvLBoxEntry*)(pView->NextVisible( pStartEntry));
+ if( pNextFirstToDraw )
+ {
+ nFlags &= (~F_FILLING);
+ pView->NotifyScrolling( -1 );
+ ShowCursor( FALSE );
+ pView->Update();
+ pStartEntry = pNextFirstToDraw;
+ Rectangle aArea( GetVisibleArea() );
+ pView->Scroll( 0, -(pView->GetEntryHeight()), aArea, SCROLL_NOCHILDREN );
+ pView->Update();
+ ShowCursor( TRUE );
+ pView->NotifyScrolled();
+ }
+}
+
+void SvImpLBox::CursorUp()
+{
+ SvLBoxEntry* pPrevFirstToDraw = (SvLBoxEntry*)(pView->PrevVisible( pStartEntry));
+ if( pPrevFirstToDraw )
+ {
+ nFlags &= (~F_FILLING);
+ long nEntryHeight = pView->GetEntryHeight();
+ pView->NotifyScrolling( 1 );
+ ShowCursor( FALSE );
+ pView->Update();
+ pStartEntry = pPrevFirstToDraw;
+ Rectangle aArea( GetVisibleArea() );
+ aArea.Bottom() -= nEntryHeight;
+ pView->Scroll( 0, nEntryHeight, aArea, SCROLL_NOCHILDREN );
+ pView->Update();
+ ShowCursor( TRUE );
+ pView->NotifyScrolled();
+ }
+}
+
+void SvImpLBox::PageDown( USHORT nDelta )
+{
+ USHORT nRealDelta = nDelta;
+
+ if( !nDelta )
+ return;
+
+ SvLBoxEntry* pNext;
+ pNext = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nRealDelta ));
+ if( (ULONG)pNext == (ULONG)pStartEntry )
+ return;
+
+ ShowCursor( FALSE );
+
+ nFlags &= (~F_FILLING);
+ pView->Update();
+ pStartEntry = pNext;
+
+ if( nRealDelta >= nVisibleCount )
+ {
+ pView->Invalidate( GetVisibleArea() );
+ pView->Update();
+ }
+ else
+ {
+ long nScroll = nRealDelta * (-1);
+ pView->NotifyScrolling( nScroll );
+ Rectangle aArea( GetVisibleArea() );
+ nScroll = pView->GetEntryHeight()*nRealDelta;
+ nScroll = -nScroll;
+ pView->Update();
+ pView->Scroll( 0, nScroll, aArea, SCROLL_NOCHILDREN );
+ pView->Update();
+ pView->NotifyScrolled();
+ }
+
+ ShowCursor( TRUE );
+}
+
+void SvImpLBox::PageUp( USHORT nDelta )
+{
+ USHORT nRealDelta = nDelta;
+ if( !nDelta )
+ return;
+
+ SvLBoxEntry* pPrev = (SvLBoxEntry*)(pView->PrevVisible( pStartEntry, nRealDelta ));
+ if( (ULONG)pPrev == (ULONG)pStartEntry )
+ return;
+
+ nFlags &= (~F_FILLING);
+ ShowCursor( FALSE );
+
+ pView->Update();
+ pStartEntry = pPrev;
+ if( nRealDelta >= nVisibleCount )
+ {
+ pView->Invalidate( GetVisibleArea() );
+ pView->Update();
+ }
+ else
+ {
+ long nEntryHeight = pView->GetEntryHeight();
+ pView->NotifyScrolling( (long)nRealDelta );
+ Rectangle aArea( GetVisibleArea() );
+ pView->Update();
+ pView->Scroll( 0, nEntryHeight*nRealDelta, aArea, SCROLL_NOCHILDREN );
+ pView->Update();
+ pView->NotifyScrolled();
+ }
+
+ ShowCursor( TRUE );
+}
+
+void SvImpLBox::KeyUp( BOOL bPageUp, BOOL bNotifyScroll )
+{
+ if( !aVerSBar.IsVisible() )
+ return;
+
+ long nDelta;
+ if( bPageUp )
+ nDelta = aVerSBar.GetPageSize();
+ else
+ nDelta = 1;
+
+ long nThumbPos = aVerSBar.GetThumbPos();
+
+ if( nThumbPos < nDelta )
+ nDelta = nThumbPos;
+
+ if( nDelta <= 0 )
+ return;
+
+ nFlags &= (~F_FILLING);
+ if( bNotifyScroll )
+ BeginScroll();
+
+ aVerSBar.SetThumbPos( nThumbPos - nDelta );
+ if( bPageUp )
+ PageUp( (short)nDelta );
+ else
+ CursorUp();
+
+ if( bNotifyScroll )
+ EndScroll();
+}
+
+
+void SvImpLBox::KeyDown( BOOL bPageDown, BOOL bNotifyScroll )
+{
+ if( !aVerSBar.IsVisible() )
+ return;
+
+ long nDelta;
+ if( bPageDown )
+ nDelta = aVerSBar.GetPageSize();
+ else
+ nDelta = 1;
+
+ long nThumbPos = aVerSBar.GetThumbPos();
+ long nVisibleSize = aVerSBar.GetVisibleSize();
+ long nRange = aVerSBar.GetRange().Len();
+
+ long nTmp = nThumbPos+nVisibleSize;
+ while( (nDelta > 0) && (nTmp+nDelta) >= nRange )
+ nDelta--;
+
+ if( nDelta <= 0 )
+ return;
+
+ nFlags &= (~F_FILLING);
+ if( bNotifyScroll )
+ BeginScroll();
+
+ aVerSBar.SetThumbPos( nThumbPos+nDelta );
+ if( bPageDown )
+ PageDown( (short)nDelta );
+ else
+ CursorDown();
+
+ if( bNotifyScroll )
+ EndScroll();
+}
+
+
+
+void SvImpLBox::InvalidateEntriesFrom( long nY ) const
+{
+ if( !(nFlags & F_IN_PAINT ))
+ {
+ Rectangle aRect( GetVisibleArea() );
+ aRect.Top() = nY;
+ pView->Invalidate( aRect );
+ }
+}
+
+void SvImpLBox::InvalidateEntry( long nY ) const
+{
+ if( !(nFlags & F_IN_PAINT ))
+ {
+ Rectangle aRect( GetVisibleArea() );
+ long nMaxBottom = aRect.Bottom();
+ aRect.Top() = nY;
+ aRect.Bottom() = nY; aRect.Bottom() += pView->GetEntryHeight();
+ if( aRect.Top() > nMaxBottom )
+ return;
+ if( aRect.Bottom() > nMaxBottom )
+ aRect.Bottom() = nMaxBottom;
+ pView->Invalidate( aRect );
+ }
+}
+
+void SvImpLBox::InvalidateEntry( SvLBoxEntry* pEntry )
+{
+ if( GetUpdateMode() )
+ {
+ long nPrev = nMostRight;
+ SetMostRight( pEntry );
+ if( nPrev < nMostRight )
+ ShowVerSBar();
+ }
+ if( !(nFlags & F_IN_PAINT ))
+ {
+ BOOL bHasFocusRect = FALSE;
+ if( pEntry==pCursor && pView->HasFocus() )
+ {
+ bHasFocusRect = TRUE;
+ ShowCursor( FALSE );
+ }
+ InvalidateEntry( GetEntryLine( pEntry ) );
+ if( bHasFocusRect )
+ ShowCursor( TRUE );
+ }
+}
+
+
+void SvImpLBox::RecalcFocusRect()
+{
+ if( pView->HasFocus() && pCursor )
+ {
+ pView->HideFocus();
+ long nY = GetEntryLine( pCursor );
+ Rectangle aRect = pView->GetFocusRect( pCursor, nY );
+ Region aOldClip( pView->GetClipRegion());
+ Region aClipRegion( GetClipRegionRect() );
+ pView->SetClipRegion( aClipRegion );
+ pView->ShowFocus( aRect );
+ pView->SetClipRegion( aOldClip );
+ }
+}
+
+//
+// Setzt Cursor. Passt bei SingleSelection die Selektion an
+//
+
+void SvImpLBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
+{
+ SvViewDataEntry* pViewDataNewCur = 0;
+ if( pEntry )
+ pViewDataNewCur= pView->GetViewDataEntry(pEntry);
+ if( pEntry &&
+ pEntry == pCursor &&
+ pViewDataNewCur->HasFocus() &&
+ pViewDataNewCur->IsSelected())
+ {
+ return;
+ }
+ SvLBoxEntry* pOldCursor = pCursor;
+ if( pCursor && pEntry != pCursor )
+ {
+ pView->SetEntryFocus( pCursor, FALSE );
+ if( bSimpleTravel )
+ pView->Select( pCursor, FALSE );
+ pView->HideFocus();
+ }
+ pCursor = pEntry;
+ if( pCursor )
+ {
+ pViewDataNewCur->SetFocus( TRUE );
+ if(!bForceNoSelect && bSimpleTravel && !(nFlags & F_DESEL_ALL) && GetUpdateMode())
+ {
+ pView->Select( pCursor, TRUE );
+ }
+ // Mehrfachselektion: Im Cursor-Move selektieren, wenn
+ // nicht im Add-Mode (Ctrl-F8)
+ else if( GetUpdateMode() &&
+ pView->GetSelectionMode() == MULTIPLE_SELECTION &&
+ !(nFlags & F_DESEL_ALL) && !aSelEng.IsAddMode() &&
+ !bForceNoSelect )
+ {
+ pView->Select( pCursor, TRUE );
+ }
+ else
+ {
+ ShowCursor( TRUE );
+ }
+
+ if( pAnchor )
+ {
+ DBG_ASSERT(aSelEng.GetSelectionMode() != SINGLE_SELECTION,"Mode?")
+ SetAnchorSelection( pOldCursor, pCursor );
+ }
+ }
+ nFlags &= (~F_DESEL_ALL);
+}
+
+void SvImpLBox::ShowCursor( BOOL bShow )
+{
+ if( !bShow || !pCursor || !pView->HasFocus() )
+ pView->HideFocus();
+ else
+ {
+ long nY = GetEntryLine( pCursor );
+ Rectangle aRect = pView->GetFocusRect( pCursor, nY );
+ Region aOldClip( pView->GetClipRegion());
+ Region aClipRegion( GetClipRegionRect() );
+ pView->SetClipRegion( aClipRegion );
+ pView->ShowFocus( aRect );
+ pView->SetClipRegion( aOldClip );
+ }
+}
+
+
+
+void SvImpLBox::UpdateAll( BOOL bInvalidateCompleteView,
+ BOOL bUpdateVerScrollBar )
+{
+ if( bUpdateVerScrollBar )
+ FindMostRight(0);
+ aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1 ) );
+ SyncVerThumb();
+ FillView();
+ ShowVerSBar();
+ if( bSimpleTravel && pCursor && pView->HasFocus() )
+ pView->Select( pCursor, TRUE );
+ ShowCursor( TRUE );
+ if( bInvalidateCompleteView )
+ pView->Invalidate();
+ else
+ pView->Invalidate( GetVisibleArea() );
+}
+
+IMPL_LINK_INLINE_START( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar )
+{
+ long nDelta = pScrollBar->GetDelta();
+ if( nDelta )
+ {
+ if( pView->IsEditingActive() )
+ {
+ pView->EndEditing( TRUE ); // Cancel
+ pView->Update();
+ }
+ pView->nFocusWidth = -1;
+ KeyLeftRight( nDelta );
+ }
+ return 0;
+}
+IMPL_LINK_INLINE_END( SvImpLBox, ScrollLeftRightHdl, ScrollBar *, pScrollBar )
+
+void SvImpLBox::KeyLeftRight( long nDelta )
+{
+ if( !(nFlags & F_IN_RESIZE) )
+ pView->Update();
+ BeginScroll();
+ nFlags &= (~F_FILLING);
+ pView->NotifyScrolling( 0 ); // 0 == horizontales Scrolling
+ ShowCursor( FALSE );
+
+ // neuen Origin berechnen
+ long nPos = aHorSBar.GetThumbPos();
+ Point aOrigin( -nPos, 0 );
+
+ MapMode aMapMode( pView->GetMapMode() );
+ aMapMode.SetOrigin( aOrigin );
+ pView->SetMapMode( aMapMode );
+
+ if( !(nFlags & F_IN_RESIZE) )
+ {
+ Rectangle aRect( GetVisibleArea() );
+ pView->Scroll( -nDelta, 0, aRect, SCROLL_NOCHILDREN );
+ }
+ else
+ pView->Invalidate();
+ RecalcFocusRect();
+ ShowCursor( TRUE );
+ pView->NotifyScrolled();
+}
+
+
+// gibt letzten Eintrag zurueck, wenn Position unter
+// dem letzten Eintrag ist
+SvLBoxEntry* SvImpLBox::GetClickedEntry( const Point& rPoint ) const
+{
+ if( pView->GetEntryCount() == 0 || !pStartEntry)
+ return 0;
+
+ USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() );
+ USHORT nTemp = nClickedEntry;
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
+ return pEntry;
+}
+
+//
+// prueft, ob der Eintrag "richtig" getroffen wurde
+// (Focusrect+ ContextBitmap bei TreeListBox)
+//
+BOOL SvImpLBox::EntryReallyHit(SvLBoxEntry* pEntry,const Point& rPosPixel,long nLine)
+{
+ BOOL bRet;
+ // bei "besonderen" Entries (mit CheckButtons usw.) sind wir
+ // nicht so pingelig
+ if( pEntry->ItemCount() >= 3 )
+ return TRUE;
+
+ Rectangle aRect( pView->GetFocusRect( pEntry, nLine ));
+ if( pView->IsA() == SV_LISTBOX_ID_TREEBOX )
+ {
+ SvLBoxContextBmp* pBmp = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ aRect.Left() -= pBmp->GetSize(pView,pEntry).Width();
+ aRect.Left() -= 4; // etwas Speilraum lassen
+ }
+ Point aPos( rPosPixel );
+ aPos -= pView->GetMapMode().GetOrigin();
+ if( aRect.IsInside( aPos ) )
+ bRet = TRUE;
+ else
+ bRet = FALSE;
+ return bRet;
+}
+
+
+// gibt 0 zurueck, wenn Position unter dem letzten Eintrag ist
+SvLBoxEntry* SvImpLBox::GetEntry( const Point& rPoint ) const
+{
+ if( (pView->GetEntryCount() == 0) || !pStartEntry ||
+ (rPoint.Y() > aOutputSize.Height()) )
+ return 0;
+
+ USHORT nClickedEntry = (USHORT)(rPoint.Y() / pView->GetEntryHeight() );
+ USHORT nTemp = nClickedEntry;
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nTemp ));
+ if( nTemp != nClickedEntry )
+ pEntry = 0;
+ return pEntry;
+}
+
+
+SvLBoxEntry* SvImpLBox::MakePointVisible(const Point& rPoint,BOOL bNotifyScroll)
+{
+ if( !pCursor )
+ return 0;
+ long nY = rPoint.Y();
+ SvLBoxEntry* pEntry = 0;
+ long nMax = aOutputSize.Height();
+ if( nY < 0 || nY >= nMax ) // aOutputSize.Height() )
+ {
+ if( nY < 0 )
+ pEntry = (SvLBoxEntry*)(pView->PrevVisible( pCursor ));
+ else
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pCursor ));
+
+ if( pEntry && pEntry != pCursor )
+ pView->SetEntryFocus( pCursor, FALSE );
+
+ if( nY < 0 )
+ KeyUp( FALSE, bNotifyScroll );
+ else
+ KeyDown( FALSE, bNotifyScroll );
+ }
+ else
+ {
+ pEntry = GetClickedEntry( rPoint );
+ if( !pEntry )
+ {
+ USHORT nSteps = 0xFFFF;
+ // LastVisible ist noch nicht implementiert!
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry, nSteps ));
+ }
+ if( pEntry )
+ {
+ if( pEntry != pCursor &&
+ aSelEng.GetSelectionMode() == SINGLE_SELECTION
+ )
+ pView->Select( pCursor, FALSE );
+ }
+ }
+ return pEntry;
+}
+
+Rectangle SvImpLBox::GetClipRegionRect() const
+{
+ Point aOrigin( pView->GetMapMode().GetOrigin() );
+ aOrigin.X() *= -1; // Umrechnung Dokumentkoord.
+ Rectangle aClipRect( aOrigin, aOutputSize );
+ aClipRect.Bottom()++;
+ return aClipRect;
+}
+
+
+void SvImpLBox::Paint( const Rectangle& rRect )
+{
+ if( !pView->GetVisibleCount() )
+ return;
+
+ nFlags |= F_IN_PAINT;
+
+//#if SUPD > 364
+ if( nFlags & F_FILLING )
+ {
+ SvLBoxEntry* pFirst = pView->First();
+ if( pFirst != pStartEntry )
+ {
+ ShowCursor( FALSE );
+ pStartEntry = pView->First();
+ aVerSBar.SetThumbPos( 0 );
+ StopUserEvent();
+ ShowCursor( TRUE );
+ nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent),(void*)1);
+ return;
+ }
+ }
+//#endif
+
+ if( !pStartEntry )
+ {
+ pStartEntry = pView->First();
+ }
+
+#ifdef XX_OV
+ ULONG nXAbsPos = (USHORT)pTree->GetAbsPos( pStartEntry );
+ ULONG nXVisPos = pView->GetVisiblePos( pStartEntry );
+ SvLBoxString* pXStr = (SvLBoxString*)pStartEntry->GetFirstItem( SV_ITEM_ID_LBOXSTRING);
+#endif
+
+
+
+ if( nNodeBmpTabDistance == NODE_BMP_TABDIST_NOTVALID )
+ SetNodeBmpTabDistance();
+
+ long nRectHeight = rRect.GetHeight();
+ long nEntryHeight = pView->GetEntryHeight();
+
+ int bHorSBar;
+ if( (pView->nWindowStyle) & WB_HSCROLL )
+ bHorSBar = TRUE;
+ else
+ bHorSBar = FALSE;
+
+ // Bereich der zu zeichnenden Entries berechnen
+ USHORT nStartLine = (USHORT)( rRect.Top() / nEntryHeight );
+ USHORT nCount = (USHORT)( nRectHeight / nEntryHeight );
+ nCount += 2; // keine Zeile vergessen
+
+ long nY = nStartLine * nEntryHeight;
+ SvLBoxEntry* pEntry = pStartEntry;
+ while( nStartLine && pEntry )
+ {
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ nStartLine--;
+ }
+
+ Region aClipRegion( GetClipRegionRect() );
+
+ // erst die Linien Zeichnen, dann clippen!
+ pView->SetClipRegion();
+ if( nWinBits & ( WB_HASLINES | WB_HASLINESATROOT ) )
+ DrawNet();
+
+ pView->SetClipRegion( aClipRegion );
+
+ for( USHORT n=0; n< nCount && pEntry; n++ )
+ {
+ /*long nMaxRight=*/
+ pView->PaintEntry1( pEntry, nY, 0xffff, TRUE );
+ nY += nEntryHeight;
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+
+ if( !pCursor )
+ {
+ if( aSelEng.GetSelectionMode()==SINGLE_SELECTION )
+ {
+ if( nWinBits & WB_NOINITIALSELECTION )
+ {
+ // nicht selektieren
+ SetCursor( pStartEntry, TRUE );
+ }
+ else
+ SetCursor( pStartEntry );
+ }
+ else
+ // nicht selektieren
+ SetCursor( pStartEntry, TRUE );
+ //OV, 16.7.97, warum HideFocus?? (siehe Bugid 41404)
+ //pView->HideFocus();
+ }
+ nFlags &= (~F_DESEL_ALL);
+
+ pView->SetClipRegion();
+ Rectangle aRect;
+ if( !(nFlags & F_PAINTED) )
+ {
+ nFlags |= F_PAINTED;
+ RepaintScrollBars();
+ }
+ nFlags &= (~F_IN_PAINT);
+}
+
+void SvImpLBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
+{
+ if( !pEntry )
+ return;
+
+ BOOL bInView = IsEntryInView( pEntry );
+
+ if( bInView && (!bMoveToTop || pStartEntry == pEntry) )
+ return; // ist schon sichtbar
+
+ if( pStartEntry || (nWinBits & WB_FORCE_MAKEVISIBLE) )
+ nFlags &= (~F_FILLING);
+ if( !bInView )
+ {
+ if( !pView->IsEntryVisible(pEntry) ) // Parent(s) zugeklappt ?
+ {
+ SvLBoxEntry* pParent = pView->GetParent( pEntry );
+ while( pParent )
+ {
+ if( !pView->IsExpanded( pParent ) )
+ {
+ BOOL bRet = pView->Expand( pParent );
+ DBG_ASSERT(bRet,"Not expanded!");
+ }
+ pParent = pView->GetParent( pParent );
+ }
+ // Passen Childs der Parents in View oder muessen wir scrollen ?
+ if( IsEntryInView( pEntry ) && !bMoveToTop )
+ return; // Scrollen nicht noetig -> tschuess
+ }
+ }
+
+ pStartEntry = pEntry;
+ ShowCursor( FALSE );
+ FillView();
+ aVerSBar.SetThumbPos( (long)(pView->GetVisiblePos( pStartEntry )) );
+ ShowCursor( TRUE );
+ pView->Invalidate();
+}
+
+
+void SvImpLBox::RepaintSelectionItems()
+{
+ if( !pView->GetVisibleCount() )
+ return;
+
+ if( !pStartEntry )
+ pStartEntry = pView->First();
+
+ if( nNodeBmpTabDistance == NODE_BMP_TABDIST_NOTVALID )
+ SetNodeBmpTabDistance();
+
+ ShowCursor( FALSE );
+
+ long nEntryHeight = pView->GetEntryHeight();
+
+ USHORT nCount = nVisibleCount;
+ long nY = 0;
+ SvLBoxEntry* pEntry = pStartEntry;
+ for( USHORT n=0; n< nCount && pEntry; n++ )
+ {
+ pView->PaintEntry1( pEntry, nY, 0xffff ); //wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
+ nY += nEntryHeight;
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+
+ ShowCursor( TRUE );
+}
+
+
+void SvImpLBox::DrawNet()
+{
+ if( pView->GetVisibleCount() < 2 && !pStartEntry->HasChildsOnDemand() &&
+ !pStartEntry->HasChilds() )
+ return;
+ long nEntryHeight = pView->GetEntryHeight();
+ long nEntryHeightDIV2 = nEntryHeight / 2;
+ if( nEntryHeightDIV2 && !(nEntryHeight & 0x0001))
+ nEntryHeightDIV2--;
+
+ SvLBoxEntry* pChild;
+ SvLBoxEntry* pEntry = pStartEntry;
+
+ SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab();
+ while( pTree->GetDepth( pEntry ) > 0 )
+ pEntry = pView->GetParent( pEntry );
+ USHORT nOffs = (USHORT)(pView->GetVisiblePos( pStartEntry ) -
+ pView->GetVisiblePos( pEntry ));
+ long nY = 0;
+ nY -= ( nOffs * nEntryHeight );
+
+ DBG_ASSERT(pFirstDynamicTab,"No Tree!")
+
+ Color aOldLineColor = pView->GetLineColor();
+ const StyleSettings& rStyleSettings = pView->GetSettings().GetStyleSettings();
+ Color aCol= rStyleSettings.GetFaceColor();
+
+ if( aCol.IsRGBEqual( pView->GetBackground().GetColor()) )
+ aCol = rStyleSettings.GetShadowColor();
+ pView->SetLineColor( aCol );
+ Point aPos1, aPos2;
+ USHORT nDistance;
+ USHORT nMax = nVisibleCount + nOffs + 1;
+ for( USHORT n=0; n< nMax && pEntry; n++ )
+ {
+ if( pView->IsExpanded(pEntry) )
+ {
+ aPos1.X() = pView->GetTabPos(pEntry, pFirstDynamicTab);
+ // wenn keine ContextBitmap, dann etwas nach rechts
+ // unter den ersten Text (Node.Bmp ebenfalls
+ if( !pView->nContextBmpWidthMax )
+ aPos1.X() += aExpNodeBmp.GetSizePixel().Width() / 2;
+
+ aPos1.Y() = nY;
+ aPos1.Y() += nEntryHeightDIV2;
+
+ pChild = pView->FirstChild( pEntry );
+ DBG_ASSERT(pChild,"Child?")
+ pChild = pTree->LastSibling( pChild );
+ nDistance = (USHORT)(pView->GetVisiblePos(pChild) -
+ pView->GetVisiblePos(pEntry));
+ aPos2 = aPos1;
+ aPos2.Y() += nDistance * nEntryHeight;
+ pView->DrawLine( aPos1, aPos2 );
+ }
+ // Sichtbar im Control ?
+ if( n>= nOffs && ((nWinBits & WB_HASLINESATROOT) || !pTree->IsAtRootDepth(pEntry)))
+ {
+ // kann aPos1 recyclet werden ?
+ if( !pView->IsExpanded(pEntry) )
+ {
+ // njet
+ aPos1.X() = pView->GetTabPos(pEntry, pFirstDynamicTab);
+ // wenn keine ContextBitmap, dann etwas nach rechts
+ // unter den ersten Text (Node.Bmp ebenfalls
+ if( !pView->nContextBmpWidthMax )
+ aPos1.X() += aExpNodeBmp.GetSizePixel().Width() / 2;
+ aPos1.Y() = nY;
+ aPos1.Y() += nEntryHeightDIV2;
+ aPos2.X() = aPos1.X();
+ }
+ aPos2.Y() = aPos1.Y();
+ aPos2.X() -= pView->GetIndent();
+ pView->DrawLine( aPos1, aPos2 );
+ }
+ nY += nEntryHeight;
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ if( nWinBits & WB_HASLINESATROOT )
+ {
+ pEntry = pView->First();
+ aPos1.X() = pView->GetTabPos( pEntry, pFirstDynamicTab);
+ // wenn keine ContextBitmap, dann etwas nach rechts
+ // unter den ersten Text (Node.Bmp ebenfalls
+ if( !pView->nContextBmpWidthMax )
+ aPos1.X() += aExpNodeBmp.GetSizePixel().Width() / 2;
+ aPos1.X() -= pView->GetIndent();
+ aPos1.Y() = GetEntryLine( pEntry );
+ aPos1.Y() += nEntryHeightDIV2;
+ pChild = pTree->LastSibling( pEntry );
+ aPos2.X() = aPos1.X();
+ aPos2.Y() = GetEntryLine( pChild );
+ aPos2.Y() += nEntryHeightDIV2;
+ pView->DrawLine( aPos1, aPos2 );
+ }
+ pView->SetLineColor( aOldLineColor );
+}
+
+
+static long GetOptSize( TabBar* pTabBar )
+{
+#if SUPD > 373
+ return pTabBar->CalcWindowSizePixel().Width();
+#else
+ long nWidth = 0;
+ USHORT nCount = pTabBar->GetPageCount();
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ USHORT nId = pTabBar->GetPageId( nCur );
+ nWidth+= pTabBar->GetTextSize(pTabBar->GetPageText(nId)).Width();
+ nWidth += 18;
+ }
+ return nWidth;
+#endif
+}
+
+void SvImpLBox::PositionScrollBars( Size& rSize, USHORT nMask )
+{
+ long nOverlap = 0;
+
+ Size aVerSize( nVerSBarWidth, rSize.Height() );
+ Size aHorSize( rSize.Width(), nHorSBarHeight );
+ long nTabBarWidth = 0;
+ if( pTabBar )
+ {
+ nTabBarWidth = GetOptSize( pTabBar );
+ long nMaxWidth = (rSize.Width() * 700) / 1000;
+ if( nTabBarWidth > nMaxWidth )
+ {
+ nTabBarWidth = nMaxWidth;
+ pTabBar->SetStyle( pTabBar->GetStyle() | WB_MINSCROLL );
+ }
+ else
+ {
+ WinBits nStyle = pTabBar->GetStyle();
+ nStyle &= ~(WB_MINSCROLL);
+ pTabBar->SetStyle( nStyle );
+ }
+ aHorSize.Width() -= nTabBarWidth;
+ Size aTabSize( pTabBar->GetSizePixel() );
+ aTabSize.Width() = nTabBarWidth;
+ pTabBar->SetSizePixel( aTabSize );
+ }
+ if( nMask & 0x0001 )
+ aHorSize.Width() -= nVerSBarWidth;
+ if( nMask & 0x0002 )
+ aVerSize.Height() -= nHorSBarHeight;
+
+ aVerSize.Height() += 2 * nOverlap;
+ Point aVerPos( rSize.Width() - aVerSize.Width() + nOverlap, -nOverlap );
+ aVerSBar.SetPosSizePixel( aVerPos, aVerSize );
+
+ aHorSize.Width() += 2 * nOverlap;
+ Point aHorPos( -nOverlap, rSize.Height() - aHorSize.Height() + nOverlap );
+ if( pTabBar )
+ pTabBar->SetPosPixel( aHorPos );
+ aHorPos.X() += nTabBarWidth;
+ aHorSBar.SetPosSizePixel( aHorPos, aHorSize );
+
+ if( nMask & 0x0001 )
+ rSize.Width() = aVerPos.X();
+ if( nMask & 0x0002 )
+ rSize.Height() = aHorPos.Y();
+ if( pTabBar )
+ pTabBar->Show();
+
+ if( (nMask & (0x0001|0x0002)) == (0x0001|0x0002) )
+ aScrBarBox.Show();
+ else
+ aScrBarBox.Hide();
+
+}
+
+// nResult: Bit0 == VerSBar Bit1 == HorSBar
+USHORT SvImpLBox::AdjustScrollBars( Size& rSize )
+{
+ long nEntryHeight = pView->GetEntryHeight();
+ if( !nEntryHeight )
+ return 0;
+
+ USHORT nResult = 0;
+
+ Size aOSize( pView->Control::GetOutputSizePixel() );
+
+ int bVerSBar = pView->nWindowStyle & WB_VSCROLL;
+ int bHorBar = 0;
+ long nMaxRight = aOSize.Width(); //GetOutputSize().Width();
+ Point aOrigin( pView->GetMapMode().GetOrigin() );
+ aOrigin.X() *= -1;
+ nMaxRight += aOrigin.X() - 1;
+ long nVis = nMostRight - aOrigin.X();
+ if( pTabBar || (
+ (pView->nWindowStyle & WB_HSCROLL) &&
+ (nVis < nMostRight || nMaxRight < nMostRight) ))
+ bHorBar = 1;
+
+ // Anzahl aller nicht eingeklappten Eintraege
+ ULONG nTotalCount = pView->GetVisibleCount();
+
+ // Anzahl in der View sichtbarer Eintraege
+ nVisibleCount = aOSize.Height() / nEntryHeight;
+
+ // muessen wir eine vertikale Scrollbar einblenden?
+ if( bVerSBar || nTotalCount > nVisibleCount - 1 )
+ {
+ nResult = 1;
+ nFlags |= F_HOR_SBARSIZE_WITH_VBAR;
+ nMaxRight -= nVerSBarWidth;
+ if( !bHorBar )
+ {
+ if( (pView->nWindowStyle & WB_HSCROLL) &&
+ (nVis < nMostRight || nMaxRight < nMostRight) )
+ bHorBar = 1;
+ }
+ }
+
+ // muessen wir eine horizontale Scrollbar einblenden?
+ if( bHorBar )
+ {
+ nResult |= 0x0002;
+ // die Anzahl der in der View sichtbaren Eintraege
+ // muss neu berechnet werden, da die horizontale
+ // ScrollBar eingeblendet wird
+ nVisibleCount = (aOSize.Height() - nHorSBarHeight) / nEntryHeight;
+ // eventuell brauchen wir jetzt doch eine vertikale ScrollBar
+ if( !(nResult & 0x0001) &&
+ ((nTotalCount > nVisibleCount - 1) || bVerSBar) )
+ {
+ nResult = 3;
+ nFlags |= F_VER_SBARSIZE_WITH_HBAR;
+ }
+ }
+
+ PositionScrollBars( aOSize, nResult );
+
+ // Range, VisibleRange usw. anpassen
+
+ // Output-Size aktualisieren, falls wir scrollen muessen
+ Rectangle aRect;
+ aRect.SetSize( aOSize );
+ aSelEng.SetVisibleArea( aRect );
+
+ // Vertikale ScrollBar
+ long nTemp = (long)nVisibleCount;
+ nTemp--;
+ if( nTemp != aVerSBar.GetVisibleSize() )
+ {
+ if( !bInVScrollHdl )
+ {
+ aVerSBar.SetPageSize( nTemp - 1 );
+ aVerSBar.SetVisibleSize( nTemp );
+ }
+ else
+ {
+ nFlags |= F_ENDSCROLL_SET_VIS_SIZE;
+ nNextVerVisSize = nTemp;
+ }
+ }
+
+ // Horizontale ScrollBar
+ nTemp = aHorSBar.GetThumbPos();
+ aHorSBar.SetVisibleSize( aOSize.Width() );
+ long nNewThumbPos = aHorSBar.GetThumbPos();
+ Range aRange( aHorSBar.GetRange() );
+ if( aRange.Max() < nMostRight+25 )
+ {
+ aRange.Max() = nMostRight+25;
+ aHorSBar.SetRange( aRange );
+ }
+
+ if( nTemp != nNewThumbPos )
+ {
+ nTemp = nNewThumbPos - nTemp;
+ if( pView->IsEditingActive() )
+ {
+ pView->EndEditing( TRUE ); // Cancel
+ pView->Update();
+ }
+ pView->nFocusWidth = -1;
+ KeyLeftRight( nTemp );
+ }
+
+ if( nResult & 0x0001 )
+ aVerSBar.Show();
+ else
+ aVerSBar.Hide();
+
+ if( nResult & 0x0002 )
+ aHorSBar.Show();
+ else
+ {
+ if( !pTabBar )
+ aHorSBar.Hide();
+ }
+ rSize = aOSize;
+ return nResult;
+}
+
+void SvImpLBox::InitScrollBarBox()
+{
+ aScrBarBox.SetSizePixel( Size(nVerSBarWidth, nHorSBarHeight) );
+ Size aSize( pView->Control::GetOutputSizePixel() );
+ aScrBarBox.SetPosPixel( Point(aSize.Width()-nVerSBarWidth, aSize.Height()-nHorSBarHeight));
+}
+
+void SvImpLBox::Resize()
+{
+ Size aSize( pView->Control::GetOutputSizePixel());
+ if( aSize.Width() <= 0 || aSize.Height() <= 0 )
+ return;
+ nFlags |= F_IN_RESIZE;
+ InitScrollBarBox();
+
+ if( pView->GetEntryHeight())
+ {
+ AdjustScrollBars( aOutputSize );
+ FillView();
+ }
+ // !!!HACK, da in Floating- & Docking-Windows nach Resizes
+ // die Scrollbars nicht richtig, bzw. ueberhaupt nicht gezeichnet werden
+ if( aHorSBar.IsVisible())
+ aHorSBar.Invalidate();
+ if( aVerSBar.IsVisible())
+ aVerSBar.Invalidate();
+ nFlags &= (~(F_IN_RESIZE | F_PAINTED));
+}
+
+void SvImpLBox::FillView()
+{
+ if( !pStartEntry )
+ {
+ USHORT nVisibleCount = (USHORT)(pView->GetVisibleCount());
+ USHORT nTempThumb = (USHORT)aVerSBar.GetThumbPos();
+ if( nTempThumb >= nVisibleCount )
+ nTempThumb = nVisibleCount - 1;
+ pStartEntry = (SvLBoxEntry*)(pView->GetEntryAtVisPos(nTempThumb));
+ }
+ if( pStartEntry )
+ {
+ USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
+ USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry ));
+ USHORT nCurDispEntries = nLast-nThumb+1;
+ if( nCurDispEntries < nVisibleCount )
+ {
+ ShowCursor( FALSE );
+ // Fenster fuellen, indem der Thumb schrittweise
+ // nach oben bewegt wird
+ BOOL bFound = FALSE;
+ SvLBoxEntry* pTemp = pStartEntry;
+ while( nCurDispEntries < nVisibleCount && pTemp )
+ {
+ pTemp = (SvLBoxEntry*)(pView->PrevVisible(pStartEntry));
+ if( pTemp )
+ {
+ nThumb--;
+ pStartEntry = pTemp;
+ nCurDispEntries++;
+ bFound = TRUE;
+ }
+ }
+ if( bFound )
+ {
+ aVerSBar.SetThumbPos( nThumb );
+ ShowCursor( TRUE ); // Focusrect neu berechnen
+ pView->Invalidate();
+ }
+ }
+ }
+}
+
+
+
+
+void SvImpLBox::ShowVerSBar()
+{
+ USHORT bVerBar = pView->nWindowStyle & WB_VSCROLL;
+ ULONG nVis;
+ if( !bVerBar )
+ nVis = pView->GetVisibleCount();
+ if( bVerBar || (nVisibleCount && nVis > (ULONG)(nVisibleCount-1)) )
+ {
+ if( !aVerSBar.IsVisible() )
+ {
+ pView->nFocusWidth = -1;
+ AdjustScrollBars( aOutputSize );
+ if( GetUpdateMode() )
+ aVerSBar.Update();
+ }
+ }
+ else
+ {
+ if( aVerSBar.IsVisible() )
+ {
+ pView->nFocusWidth = -1;
+ AdjustScrollBars( aOutputSize );
+ }
+ }
+
+ long nMaxRight = GetOutputSize().Width();
+ Point aPos( pView->GetMapMode().GetOrigin() );
+ aPos.X() *= -1; // Umrechnung Dokumentkoord.
+ nMaxRight = nMaxRight + aPos.X() - 1;
+ if( nMaxRight < nMostRight )
+ {
+ if( !aHorSBar.IsVisible() )
+ {
+ pView->nFocusWidth = -1;
+ AdjustScrollBars( aOutputSize );
+ if( GetUpdateMode() )
+ aHorSBar.Update();
+ }
+ else
+ {
+ Range aRange( aHorSBar.GetRange() );
+ if( aRange.Max() < nMostRight+25 )
+ {
+ aRange.Max() = nMostRight+25;
+ aHorSBar.SetRange( aRange );
+ }
+ else
+ {
+ pView->nFocusWidth = -1;
+ AdjustScrollBars( aOutputSize );
+ }
+ }
+ }
+ else
+ {
+ if( aHorSBar.IsVisible() )
+ {
+ pView->nFocusWidth = -1;
+ AdjustScrollBars( aOutputSize );
+ }
+ }
+}
+
+
+void SvImpLBox::SyncVerThumb()
+{
+ if( pStartEntry )
+ {
+ long nEntryPos = pView->GetVisiblePos( pStartEntry );
+ aVerSBar.SetThumbPos( nEntryPos );
+ }
+ else
+ aVerSBar.SetThumbPos( 0 );
+}
+
+BOOL SvImpLBox::IsEntryInView( SvLBoxEntry* pEntry ) const
+{
+ // Parent eingeklappt
+ if( !pView->IsEntryVisible(pEntry) )
+ return FALSE;
+ long nY = GetEntryLine( pEntry );
+ if( nY < 0 )
+ return FALSE;
+ long nMax = nVisibleCount * pView->GetEntryHeight();
+ if( nY >= nMax )
+ return FALSE;
+ return TRUE;
+}
+
+
+long SvImpLBox::GetEntryLine( SvLBoxEntry* pEntry ) const
+{
+ if(!pStartEntry )
+ return -1; // unsichtbare Position
+
+ long nFirstVisPos = pView->GetVisiblePos( pStartEntry );
+ long nEntryVisPos = pView->GetVisiblePos( pEntry );
+ nFirstVisPos = nEntryVisPos - nFirstVisPos;
+ nFirstVisPos *= pView->GetEntryHeight();
+ return nFirstVisPos;
+}
+
+void SvImpLBox::SetEntryHeight( short /* nHeight */ )
+{
+ SetNodeBmpYOffset( aExpNodeBmp );
+ SetNodeBmpYOffset( aCollNodeBmp );
+ if(!pView->HasViewData()) // stehen wir im Clear?
+ {
+ Size aSize = pView->Control::GetOutputSizePixel();
+ AdjustScrollBars( aSize );
+ }
+ else
+ {
+ Resize();
+ if( GetUpdateMode() )
+ pView->Invalidate();
+ }
+}
+
+
+
+// ***********************************************************************
+// Callback-Functions
+// ***********************************************************************
+
+void SvImpLBox::IndentChanged( short /* nIndentPixel */ ) {}
+
+void SvImpLBox::EntryExpanded( SvLBoxEntry* pEntry )
+{
+ // SelAllDestrAnch( FALSE, TRUE ); //DeselectAll();
+ if( GetUpdateMode() )
+ {
+ ShowCursor( FALSE );
+ long nY = GetEntryLine( pEntry );
+ if( IsLineVisible(nY) )
+ {
+ InvalidateEntriesFrom( nY );
+ FindMostRight( pEntry, 0 );
+ }
+ aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1 ) );
+ // falls vor dem Thumb expandiert wurde, muss
+ // die Thumb-Position korrigiert werden.
+ SyncVerThumb();
+ ShowVerSBar();
+ ShowCursor( TRUE );
+ }
+}
+
+void SvImpLBox::EntryCollapsed( SvLBoxEntry* pEntry )
+{
+ if( !pView->IsEntryVisible( pEntry ) )
+ return;
+
+ ShowCursor( FALSE );
+
+ if( !pMostRightEntry || pTree->IsChild( pEntry,pMostRightEntry ) )
+ {
+ FindMostRight(0);
+ }
+
+ if( pStartEntry )
+ {
+ long nOldThumbPos = aVerSBar.GetThumbPos();
+ ULONG nVisList = pView->GetVisibleCount();
+ aVerSBar.SetRange( Range(0, nVisList-1) );
+ long nNewThumbPos = aVerSBar.GetThumbPos();
+ if( nNewThumbPos != nOldThumbPos )
+ {
+ pStartEntry = pView->First();
+ USHORT nDistance = (USHORT)nNewThumbPos;
+ if( nDistance )
+ pStartEntry = (SvLBoxEntry*)(pView->NextVisible( pStartEntry,
+ nDistance));
+ if( GetUpdateMode() )
+ pView->Invalidate();
+ }
+ else
+ SyncVerThumb();
+ ShowVerSBar();
+ }
+ // wurde Cursor eingeklappt ?
+ if( pTree->IsChild( pEntry, pCursor ) )
+ SetCursor( pEntry );
+ if( GetUpdateMode() )
+ ShowVerSBar();
+ ShowCursor( TRUE );
+ if( GetUpdateMode() )
+ pView->Select( pCursor, TRUE );
+}
+
+void SvImpLBox::CollapsingEntry( SvLBoxEntry* pEntry )
+{
+ if( !pView->IsEntryVisible( pEntry ) || !pStartEntry )
+ return;
+
+ SelAllDestrAnch( FALSE, TRUE ); // deselectall
+
+ // ist der eingeklappte Parent sichtbar ?
+ long nY = GetEntryLine( pEntry );
+ if( IsLineVisible(nY) )
+ {
+ if( GetUpdateMode() )
+ InvalidateEntriesFrom( nY );
+ }
+ else
+ {
+ if( pTree->IsChild(pEntry, pStartEntry) )
+ {
+ pStartEntry = pEntry;
+ if( GetUpdateMode() )
+ pView->Invalidate();
+ }
+ }
+}
+
+
+void SvImpLBox::SetNodeBmpYOffset( const Image& rBmp )
+{
+ Size aSize;
+ nYoffsNodeBmp = pView->GetHeightOffset( rBmp, aSize );
+ nNodeBmpWidth = aSize.Width();
+}
+
+void SvImpLBox::SetNodeBmpTabDistance()
+{
+ nNodeBmpTabDistance = -pView->GetIndent();
+ if( pView->nContextBmpWidthMax )
+ {
+ // nur, wenn der erste dynamische Tab zentriert ist
+ // (setze ich momentan voraus)
+ Size aSize = aExpNodeBmp.GetSizePixel();
+ nNodeBmpTabDistance -= aSize.Width() / 2;
+ }
+}
+
+//
+// korrigiert bei SingleSelection den Cursor
+//
+void SvImpLBox::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
+{
+ if( nFlags & F_IGNORE_SELECT )
+ return;
+
+ /*
+ if( (nWinBits & WB_HIDESELECTION) && pEntry && !pView->HasFocus() )
+ {
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ pViewData->SetCursored( bSelect );
+ }
+ */
+
+ nFlags &= (~F_DESEL_ALL);
+ if( bSelect &&
+ aSelEng.GetSelectionMode() == SINGLE_SELECTION &&
+ pEntry != pCursor )
+ {
+ SetCursor( pEntry );
+ DBG_ASSERT(pView->GetSelectionCount()==1,"selection count?")
+ }
+
+ if( GetUpdateMode() && pView->IsEntryVisible(pEntry) )
+ {
+ long nY = GetEntryLine( pEntry );
+ if( IsLineVisible( nY ) )
+ {
+ ShowCursor( FALSE );
+ pView->PaintEntry1( pEntry, nY, 0xffff ); // wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
+ ShowCursor( TRUE );
+ }
+ }
+}
+
+
+void SvImpLBox::RemovingEntry( SvLBoxEntry* pEntry )
+{
+ DestroyAnchor();
+
+ if( !pView->IsEntryVisible( pEntry ) )
+ {
+ // wenn Parent eingeklappt, dann tschuess
+ nFlags |= F_REMOVED_ENTRY_INVISIBLE;
+ return;
+ }
+
+ if( pEntry == pMostRightEntry || (
+ pEntry->HasChilds() && pView->IsExpanded(pEntry) &&
+ pTree->IsChild(pEntry, pMostRightEntry)))
+ {
+ nFlags |= F_REMOVED_RECALC_MOST_RIGHT;
+ }
+
+ SvLBoxEntry* pOldStartEntry = pStartEntry;
+
+ SvLBoxEntry* pParent = (SvLBoxEntry*)(pView->GetModel()->GetParent(pEntry));
+
+ if( pParent && pView->GetModel()->GetChildList(pParent)->Count() == 1 )
+ {
+ DBG_ASSERT( pView->IsExpanded( pParent ), "Parent not expanded");
+ pParent->SetFlags( pParent->GetFlags() | SV_ENTRYFLAG_NO_NODEBMP);
+ InvalidateEntry( pParent );
+ }
+
+ if( pCursor && pTree->IsChild( pEntry, pCursor) )
+ pCursor = pEntry;
+ if( pStartEntry && pTree->IsChild(pEntry,pStartEntry) )
+ pStartEntry = pEntry;
+
+ SvLBoxEntry* pTemp;
+ if( pCursor && pCursor == pEntry )
+ {
+ if( bSimpleTravel )
+ pView->Select( pCursor, FALSE );
+ ShowCursor( FALSE ); // Focus-Rect weg
+ // NextSibling, weil auch Childs des Cursors geloescht werden
+ pTemp = pView->NextSibling( pCursor );
+ if( !pTemp )
+ pTemp = (SvLBoxEntry*)(pView->PrevVisible( pCursor ));
+
+ SetCursor( pTemp, TRUE );
+ }
+ if( pStartEntry && pStartEntry == pEntry )
+ {
+ pTemp = pView->NextSibling( pStartEntry );
+ if( !pTemp )
+ pTemp = (SvLBoxEntry*)(pView->PrevVisible( pStartEntry ));
+ pStartEntry = pTemp;
+ }
+ if( GetUpdateMode())
+ {
+ // wenns der letzte ist, muss invalidiert werden, damit die Linien
+ // richtig gezeichnet (in diesem Fall geloescht) werden.
+ if( pStartEntry && (pStartEntry != pOldStartEntry || pEntry == (SvLBoxEntry*)pView->GetModel()->Last()) )
+ {
+ aVerSBar.SetThumbPos( pView->GetVisiblePos( pStartEntry ));
+ pView->Invalidate( GetVisibleArea() );
+ }
+ else
+ InvalidateEntriesFrom( GetEntryLine( pEntry ) );
+ }
+}
+
+void SvImpLBox::EntryRemoved()
+{
+ if( nFlags & F_REMOVED_ENTRY_INVISIBLE )
+ {
+ nFlags &= (~F_REMOVED_ENTRY_INVISIBLE);
+ return;
+ }
+ if( !pStartEntry )
+ pStartEntry = pTree->First();
+ if( !pCursor )
+ SetCursor( pStartEntry, TRUE );
+
+ if( pCursor && (bSimpleTravel || !pView->GetSelectionCount() ))
+ pView->Select( pCursor, TRUE );
+
+ if( GetUpdateMode())
+ {
+ if( nFlags & F_REMOVED_RECALC_MOST_RIGHT )
+ FindMostRight(0);
+ aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1 ) );
+ FillView();
+ if( pStartEntry )
+ // falls ueber dem Thumb geloescht wurde
+ aVerSBar.SetThumbPos( pView->GetVisiblePos( pStartEntry) );
+
+ ShowVerSBar();
+ if( pCursor && pView->HasFocus() && !pView->IsSelected(pCursor) )
+ {
+ if( pView->GetSelectionCount() )
+ {
+ // ist ein benachbarter Eintrag selektiert?
+ SvLBoxEntry* pNextCursor = (SvLBoxEntry*)pView->PrevVisible( pCursor );
+ if( !pNextCursor || !pView->IsSelected( pNextCursor ))
+ pNextCursor = (SvLBoxEntry*)pView->NextVisible( pCursor );
+ if( !pNextCursor || !pView->IsSelected( pNextCursor ))
+ // kein Nachbar selektiert: Ersten selektierten nehmen
+ pNextCursor = pView->FirstSelected();
+ SetCursor( pNextCursor );
+ MakeVisible( pCursor );
+ }
+ else
+ pView->Select( pCursor, TRUE );
+ }
+ ShowCursor( TRUE );
+ }
+ nFlags &= (~F_REMOVED_RECALC_MOST_RIGHT);
+}
+
+
+void SvImpLBox::MovingEntry( SvLBoxEntry* pEntry )
+{
+ int bDeselAll = nFlags & F_DESEL_ALL;
+ SelAllDestrAnch( FALSE, TRUE ); // DeselectAll();
+ if( !bDeselAll )
+ nFlags &= (~F_DESEL_ALL);
+
+ if( pEntry == pCursor )
+ ShowCursor( FALSE );
+ if( IsEntryInView( pEntry ) )
+ pView->Invalidate();
+ if( pEntry == pStartEntry )
+ {
+ SvLBoxEntry* pNew = 0;
+ if( !pEntry->HasChilds() )
+ {
+ pNew = (SvLBoxEntry*)(pView->NextVisible( pStartEntry ));
+ if( !pNew )
+ pNew = (SvLBoxEntry*)(pView->PrevVisible( pStartEntry ));
+ }
+ else
+ {
+ pNew = pTree->NextSibling( pEntry );
+ if( !pNew )
+ pNew = pTree->PrevSibling( pEntry );
+ }
+ pStartEntry = pNew;
+ }
+}
+
+void SvImpLBox::EntryMoved( SvLBoxEntry* pEntry )
+{
+ aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
+ USHORT nFirstPos = (USHORT)pTree->GetAbsPos( pStartEntry );
+ USHORT nNewPos = (USHORT)pTree->GetAbsPos( pEntry );
+ FindMostRight(0);
+ if( nNewPos < nFirstPos )
+ {
+ //!!!Notloesung
+ pStartEntry = pEntry;
+ SyncVerThumb();
+ }
+ if( pEntry == pCursor )
+ {
+ if( pView->IsEntryVisible( pCursor ) )
+ ShowCursor( TRUE );
+ else
+ {
+ SvLBoxEntry* pParent = pEntry;
+ do {
+ pParent = pTree->GetParent( pParent );
+ }
+ while( !pView->IsEntryVisible( pParent ) );
+ SetCursor( pParent );
+ }
+ }
+ if( IsEntryInView( pEntry ) )
+ pView->Invalidate();
+}
+
+
+
+void SvImpLBox::EntryInserted( SvLBoxEntry* pEntry )
+{
+ if( GetUpdateMode() )
+ {
+ SvLBoxEntry* pParent = (SvLBoxEntry*)pTree->GetParent(pEntry);
+ if( pParent && pTree->GetChildList(pParent)->Count() == 1 )
+ // Pluszeichen zeichnen
+ pTree->InvalidateEntry( pParent );
+
+ if( !pView->IsEntryVisible( pEntry ) )
+ return;
+ int bDeselAll = nFlags & F_DESEL_ALL;
+ if( bDeselAll )
+ SelAllDestrAnch( FALSE, TRUE );
+ else
+ DestroyAnchor();
+ // nFlags &= (~F_DESEL_ALL);
+// ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt
+ long nY = GetEntryLine( pEntry );
+ BOOL bEntryVisible = IsLineVisible( nY );
+ BOOL bPrevEntryVisible = IsLineVisible(nY-pView->GetEntryHeight());
+ if( bEntryVisible )
+ {
+ ShowCursor( FALSE ); // falls sich Cursor nach unten verschiebt
+ nY -= pView->GetEntryHeight(); // wg. Linien
+ InvalidateEntriesFrom( nY );
+ }
+ else if( pStartEntry && nY < GetEntryLine(pStartEntry) )
+ {
+ // pruefen, ob die View komplett gefuellt ist. Wenn
+ // nicht, dann pStartEntry und den Cursor anpassen
+ // (automatisches scrollen)
+ USHORT nLast = (USHORT)(pView->GetVisiblePos( (SvLBoxEntry*)(pView->LastVisible())));
+ USHORT nThumb = (USHORT)(pView->GetVisiblePos( pStartEntry ));
+ USHORT nCurDispEntries = nLast-nThumb+1;
+ if( nCurDispEntries < nVisibleCount )
+ {
+ // beim naechsten Paint-Event setzen
+ pStartEntry = 0;
+ SetCursor( 0 );
+ pView->Invalidate();
+ }
+ }
+ else if( !pStartEntry )
+ pView->Invalidate();
+
+ // die Linien invalidieren
+ /*
+ if( (bEntryVisible || bPrevEntryVisible) &&
+ (nWinBits & ( WB_HASLINES | WB_HASLINESATROOT )) )
+ {
+ SvLBoxTab* pTab = pView->GetFirstDynamicTab();
+ if( pTab )
+ {
+ long nDX = pView->GetTabPos( pEntry, pTab );
+ Point aTmpPoint;
+ Size aSize( nDX, nY );
+ Rectangle aRect( aTmpPoint, aSize );
+ pView->Invalidate( aRect );
+ }
+ }
+ */
+
+ SetMostRight( pEntry );
+ aVerSBar.SetRange( Range(0, pView->GetVisibleCount()-1));
+ SyncVerThumb(); // falls vor Thumb eingefuegt wurde
+ ShowVerSBar();
+ ShowCursor( TRUE );
+//#if SUPD > 364
+ if( pStartEntry != pView->First() && (nFlags & F_FILLING) )
+ pView->Update();
+//#endif
+ }
+}
+
+
+
+// ********************************************************************
+// Eventhandler
+// ********************************************************************
+
+
+// ****** Steuerung der Controlanimation
+
+BOOL SvImpLBox::ButtonDownCheckCtrl(const MouseEvent& rMEvt, SvLBoxEntry* pEntry,
+ long nY )
+{
+ SvLBoxItem* pItem = pView->GetItem(pEntry,rMEvt.GetPosPixel().X(),&pActiveTab);
+ if( pItem && (pItem->IsA()==SV_ITEM_ID_LBOXBUTTON))
+ {
+ pActiveButton = (SvLBoxButton*)pItem;
+ pActiveEntry = pEntry;
+ if( pCursor == pActiveEntry )
+ pView->HideFocus();
+ pView->CaptureMouse();
+ pActiveButton->SetStateHilighted( TRUE );
+ pView->PaintEntry1( pActiveEntry, nY,
+ SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
+ SV_LBOXTAB_ADJUST_RIGHT );
+ return TRUE;
+ }
+ else
+ pActiveButton = 0;
+ return FALSE;
+}
+
+BOOL SvImpLBox::MouseMoveCheckCtrl( const MouseEvent& rMEvt, SvLBoxEntry* pEntry)
+{
+ if( pActiveButton )
+ {
+ long nY;
+ long nMouseX = rMEvt.GetPosPixel().X();
+ if( pEntry == pActiveEntry &&
+ pView->GetItem(pActiveEntry, nMouseX) == pActiveButton )
+ {
+ if( !pActiveButton->IsStateHilighted() )
+ {
+ pActiveButton->SetStateHilighted(TRUE );
+ nY = GetEntryLine( pActiveEntry );
+ pView->PaintEntry1( pActiveEntry, nY,
+ SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
+ SV_LBOXTAB_ADJUST_RIGHT );
+ }
+ }
+ else
+ {
+ if( pActiveButton->IsStateHilighted() )
+ {
+ pActiveButton->SetStateHilighted(FALSE );
+ nY = GetEntryLine( pActiveEntry );
+ pView->PaintEntry1( pActiveEntry, nY, SV_LBOXTAB_PUSHABLE );
+ }
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+BOOL SvImpLBox::ButtonUpCheckCtrl( const MouseEvent& rMEvt )
+{
+ if( pActiveButton )
+ {
+ pView->ReleaseMouse();
+ SvLBoxEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() );
+ long nY = GetEntryLine( pActiveEntry );
+ pActiveButton->SetStateHilighted( FALSE );
+ long nMouseX = rMEvt.GetPosPixel().X();
+ if( pEntry == pActiveEntry &&
+ pView->GetItem( pActiveEntry, nMouseX ) == pActiveButton )
+ pActiveButton->ClickHdl( pView, pActiveEntry );
+ pView->PaintEntry1( pActiveEntry, nY,
+ SV_LBOXTAB_PUSHABLE | SV_LBOXTAB_ADJUST_CENTER |
+ SV_LBOXTAB_ADJUST_RIGHT );
+ if( pCursor == pActiveEntry )
+ ShowCursor( TRUE );
+ pActiveButton = 0;
+ pActiveEntry = 0;
+ pActiveTab = 0;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+// ******* Steuerung Plus/Minus-Button zum Expandieren/Kollabieren
+
+// FALSE == kein Expand/Collapse-Button getroffen
+BOOL SvImpLBox::IsNodeButton( const Point& rPosPixel, SvLBoxEntry* pEntry ) const
+{
+ if( !pEntry->HasChilds() && !pEntry->HasChildsOnDemand() )
+ return FALSE;
+
+ SvLBoxTab* pFirstDynamicTab = pView->GetFirstDynamicTab();
+ if( !pFirstDynamicTab )
+ return FALSE;
+
+ long nMouseX = rPosPixel.X();
+ // in Doc-Koords umrechnen
+ Point aOrigin( pView->GetMapMode().GetOrigin() );
+ nMouseX -= aOrigin.X();
+
+ long nX = pView->GetTabPos( pEntry, pFirstDynamicTab);
+ nX += nNodeBmpTabDistance;
+ if( nMouseX < nX )
+ return FALSE;
+ nX += nNodeBmpWidth;
+ if( nMouseX > nX )
+ return FALSE;
+ return TRUE;
+}
+
+// FALSE == kein Expand/Collapse-Button getroffen
+BOOL SvImpLBox::ButtonDownCheckExpand( const MouseEvent& rMEvt,
+ SvLBoxEntry* pEntry, long /* nY */ )
+{
+ // beim Inplace-Ed. gunnix machen
+ if( pView->IsEditingActive() && pEntry == pView->pEdEntry )
+ return TRUE;
+
+ if( IsNodeButton( rMEvt.GetPosPixel(), pEntry ) )
+ {
+ if( rMEvt.GetClicks() == 1 )
+ {
+ if( pView->IsExpanded(pEntry) )
+ {
+ pView->EndEditing( TRUE );
+ pView->Collapse( pEntry );
+ }
+ else
+ {
+ //einen Entry, der editiert wird, darf man aufklappen
+ pView->Expand( pEntry );
+ }
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void SvImpLBox::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( !rMEvt.IsLeft() && !rMEvt.IsRight())
+ return;
+
+#ifdef OS2
+ // unter OS/2 kommt zwischen MouseButtonDown und
+ // MouseButtonUp ein MouseMove
+ nFlags |= F_IGNORE_NEXT_MOUSEMOVE;
+#endif
+ aEditTimer.Stop();
+ Point aPos( rMEvt.GetPosPixel());
+
+ if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() )
+ return;
+
+ nFlags &= (~F_FILLING);
+ pView->GrabFocus();
+ SvLBoxEntry* pEntry = GetEntry( aPos );
+ if( !pEntry )
+ return;
+
+ long nY = GetEntryLine( pEntry );
+ // Node-Button?
+ if( ButtonDownCheckExpand( rMEvt, pEntry, nY ) )
+ return;
+
+ if( !EntryReallyHit(pEntry,aPos,nY))
+ return;
+
+//#if defined(MAC) || defined(OV_DEBUG)
+ SvLBoxItem* pXItem = pView->GetItem( pEntry, aPos.X() );
+ if( pXItem )
+ {
+ SvLBoxTab* pXTab = pView->GetTab( pEntry, pXItem );
+ if( !rMEvt.IsMod1() && !rMEvt.IsMod2() &&pXTab->IsEditable() )
+ nFlags |= F_START_EDITTIMER;
+#ifndef MAC
+ if( !pView->IsSelected( pEntry ))
+ nFlags &= ~F_START_EDITTIMER;
+#endif
+ }
+//#endif
+
+
+ if( (rMEvt.GetClicks() % 2) == 0 )
+ {
+//#ifdef MAC
+ nFlags &= (~F_START_EDITTIMER);
+//#endif
+ pView->pHdlEntry = pEntry;
+ if( pView->DoubleClickHdl() )
+ {
+ // falls im Handler der Eintrag geloescht wurde
+ pEntry = GetClickedEntry( aPos );
+ if( !pEntry )
+ return;
+ if( pEntry != pView->pHdlEntry )
+ {
+ // neu selektieren & tschuess
+ if( !bSimpleTravel && !aSelEng.IsAlwaysAdding())
+ SelAllDestrAnch( FALSE, TRUE ); // DeselectAll();
+ SetCursor( pEntry );
+ return;
+ }
+ if( pEntry->HasChilds() || pEntry->HasChildsOnDemand() )
+ {
+ if( pView->IsExpanded(pEntry) )
+ pView->Collapse( pEntry );
+ else
+ pView->Expand( pEntry );
+ if( pEntry == pCursor ) // nur wenn Entryitem angeklickt wurde
+ // (Nodebutton ist kein Entryitem!)
+ pView->Select( pCursor, TRUE );
+ return;
+ }
+ }
+ }
+ else
+ {
+ // CheckButton? (TreeListBox: Check + Info)
+ if( ButtonDownCheckCtrl(rMEvt, pEntry, nY) == TRUE)
+ return;
+ // Inplace-Editing?
+//#ifndef MAC
+#if 0
+ if( rMEvt.IsMod2() && pView->IsInplaceEditingEnabled() )
+ {
+ SvLBoxItem* pItem = pView->GetItem( pEntry, aPos.X() );
+ if( pItem )
+ pView->EditingRequest( pEntry, pItem, aPos );
+ return;
+ }
+#endif
+ }
+ aSelEng.SelMouseButtonDown( rMEvt );
+}
+
+void SvImpLBox::MouseButtonUp( const MouseEvent& rMEvt)
+{
+#ifdef OS2
+ nFlags &= (~F_IGNORE_NEXT_MOUSEMOVE);
+#endif
+ if(!ButtonUpCheckCtrl( rMEvt ) )
+ aSelEng.SelMouseButtonUp( rMEvt );
+ EndScroll();
+//#if defined(MAC) || defined(OV_DEBUG)
+ if( nFlags & F_START_EDITTIMER )
+ {
+ nFlags &= (~F_START_EDITTIMER);
+ aEditTimer.Start();
+ }
+//#endif
+
+ return;
+}
+
+void SvImpLBox::MouseMove( const MouseEvent& rMEvt)
+{
+#ifdef OS2
+ if( nFlags & F_IGNORE_NEXT_MOUSEMOVE )
+ {
+ nFlags &= (~F_IGNORE_NEXT_MOUSEMOVE);
+ return;
+ }
+#endif
+ SvLBoxEntry* pEntry = GetClickedEntry( rMEvt.GetPosPixel() );
+ if(!MouseMoveCheckCtrl( rMEvt, pEntry ) )
+ aSelEng.SelMouseMove( rMEvt );
+ return;
+}
+
+BOOL SvImpLBox::KeyInput( const KeyEvent& rKEvt)
+{
+//#if defined(MAC) || defined(OV_DEBUG)
+ aEditTimer.Stop();
+//#endif
+
+ if( rKEvt.GetKeyCode().IsMod2() )
+ return FALSE; // Alt-Taste nicht auswerten
+
+ nFlags &= (~F_FILLING);
+
+ if( !pCursor )
+ pCursor = pStartEntry;
+ if( !pCursor )
+ return FALSE;
+
+ BOOL bKeyUsed = TRUE;
+
+ USHORT nDelta = (USHORT)aVerSBar.GetPageSize();
+ USHORT aCode = rKEvt.GetKeyCode().GetCode();
+
+ BOOL bShift = rKEvt.GetKeyCode().IsShift();
+ BOOL bMod1 = rKEvt.GetKeyCode().IsMod1();
+
+ SvLBoxEntry* pNewCursor;
+ long nThumb;
+
+ switch( aCode )
+ {
+ case KEY_UP:
+ if( !IsEntryInView( pCursor ) )
+ MakeVisible( pCursor );
+ pNewCursor = (SvLBoxEntry*)(pView->PrevVisible( pCursor ));
+ if( pNewCursor )
+ {
+ aSelEng.CursorPosChanging( bShift, bMod1 );
+ if( IsEntryInView( pNewCursor ) )
+ SetCursor( pNewCursor );
+ else
+ {
+ SetCursor( pNewCursor );
+ KeyUp( FALSE );
+ }
+ }
+ break;
+
+ case KEY_DOWN:
+ if( !IsEntryInView( pCursor ) )
+ MakeVisible( pCursor );
+ pNewCursor = (SvLBoxEntry*)(pView->NextVisible( pCursor ));
+ if( pNewCursor )
+ {
+ aSelEng.CursorPosChanging( bShift, bMod1 );
+ if( IsEntryInView( pNewCursor ) )
+ SetCursor( pNewCursor );
+ else
+ {
+ if( pCursor )
+ pView->Select( pCursor, FALSE );
+ KeyDown( FALSE );
+ SetCursor( pNewCursor );
+ }
+ }
+ else
+ KeyDown( FALSE ); // weil ScrollBar-Range evtl. noch
+ // scrollen erlaubt
+ break;
+
+ case KEY_RIGHT:
+ if( pView->nWindowStyle & WB_HSCROLL )
+ {
+ nThumb = aHorSBar.GetThumbPos();
+ nThumb += aHorSBar.GetLineSize();
+ long nOldThumb = aHorSBar.GetThumbPos();
+ aHorSBar.SetThumbPos( nThumb );
+ nThumb = nOldThumb;
+ nThumb -= aHorSBar.GetThumbPos();
+ nThumb *= -1;
+ if( nThumb )
+ {
+ KeyLeftRight( nThumb );
+ EndScroll();
+ }
+ }
+ else
+ bKeyUsed = FALSE;
+ break;
+
+ case KEY_LEFT:
+ if( pView->nWindowStyle & WB_HSCROLL )
+ {
+ nThumb = aHorSBar.GetThumbPos();
+ nThumb -= aHorSBar.GetLineSize();
+ long nOldThumb = aHorSBar.GetThumbPos();
+ aHorSBar.SetThumbPos( nThumb );
+ nThumb = nOldThumb;
+ nThumb -= aHorSBar.GetThumbPos();
+ if( nThumb )
+ {
+ KeyLeftRight( -nThumb );
+ EndScroll();
+ }
+ }
+ else
+ bKeyUsed = FALSE;
+ break;
+
+ case KEY_PAGEUP:
+ if( !bMod1 )
+ {
+ pNewCursor = (SvLBoxEntry*)(pView->PrevVisible( pCursor, nDelta ));
+ if( nDelta )
+ {
+ DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?")
+ aSelEng.CursorPosChanging( bShift, bMod1 );
+ if( IsEntryInView( pNewCursor ) )
+ SetCursor( pNewCursor );
+ else
+ {
+ SetCursor( pNewCursor );
+ KeyUp( TRUE );
+ }
+ }
+ }
+ else
+ bKeyUsed = FALSE;
+ break;
+
+ case KEY_PAGEDOWN:
+ if( !bMod1 )
+ {
+ pNewCursor= (SvLBoxEntry*)(pView->NextVisible( pCursor, nDelta ));
+ if( nDelta )
+ {
+ DBG_ASSERT(pNewCursor&&(ULONG)pNewCursor!=(ULONG)pCursor,"Cursor?")
+ aSelEng.CursorPosChanging( bShift, bMod1 );
+ if( IsEntryInView( pNewCursor ) )
+ SetCursor( pNewCursor );
+ else
+ {
+ SetCursor( pNewCursor );
+ KeyDown( TRUE );
+ }
+ }
+ else
+ KeyDown( FALSE ); // siehe KEY_DOWN
+ }
+ else
+ bKeyUsed = FALSE;
+ break;
+
+ case KEY_SPACE:
+ if( pView->GetSelectionMode() >= MULTIPLE_SELECTION )
+ {
+ if( !bShift && !bMod1 )
+ {
+ if( aSelEng.IsAddMode() )
+ {
+ // toggle selection
+ BOOL bSel = TRUE;
+ if( pView->IsSelected( pCursor ))
+ bSel = FALSE;
+ pView->Select( pCursor, bSel );
+ }
+ else
+ {
+ SelAllDestrAnch( FALSE );
+ pView->Select( pCursor, TRUE );
+ }
+ }
+ }
+ break;
+
+#if 0
+ // Probleme mit Default-OK-Button!
+ case KEY_RETURN:
+ if( pCursor->HasChilds() || pCursor->HasChildsOnDemand() )
+ {
+ if( pView->IsExpanded(pCursor) )
+ pView->Collapse( pCursor );
+ else
+ pView->Expand( pCursor );
+ }
+#endif
+
+ case KEY_F2:
+ if( !bShift && !bMod1 )
+ EditTimerCall( 0 );
+ break;
+
+ case KEY_F8:
+ if( bShift && pView->GetSelectionMode()==MULTIPLE_SELECTION &&
+ !(nWinBits & WB_SIMPLEMODE))
+ {
+ if( aSelEng.IsAlwaysAdding() )
+ aSelEng.AddAlways( FALSE );
+ else
+ aSelEng.AddAlways( TRUE );
+ }
+ break;
+
+
+#ifdef OV_DEBUG
+ case KEY_F9:
+ MakeVisible( pCursor );
+ break;
+ case KEY_F10:
+ pView->RemoveSelection();
+ break;
+ case KEY_DELETE:
+ pView->RemoveEntry( pCursor );
+ break;
+#endif
+
+ case KEY_ADD:
+ if( pCursor )
+ {
+ if( !pView->IsExpanded(pCursor))
+ pView->Expand( pCursor );
+ if( bMod1 )
+ {
+ USHORT nRefDepth = pTree->GetDepth( pCursor );
+ SvLBoxEntry* pCur = pTree->Next( pCursor );
+ while( pCur && pTree->GetDepth(pCur) > nRefDepth )
+ {
+ if( pCur->HasChilds() && !pView->IsExpanded(pCur))
+ pView->Expand( pCur );
+ pCur = pTree->Next( pCur );
+ }
+ }
+ }
+ break;
+
+ case KEY_A:
+ if( bMod1 )
+ SelAllDestrAnch( TRUE );
+ break;
+
+ case KEY_SUBTRACT:
+ if( pCursor )
+ {
+ if( pView->IsExpanded(pCursor))
+ pView->Collapse( pCursor );
+ if( bMod1 )
+ {
+ // bis zur Root alle Parents einklappen
+ SvLBoxEntry* pParentToCollapse = (SvLBoxEntry*)pTree->GetRootLevelParent(pCursor);
+ if( pParentToCollapse )
+ {
+ USHORT nRefDepth;
+ // Sonderbehandlung Explorer: Befindet sich auf der
+ // Root nur ein Eintrag,dann den Root-Entry nicht
+ // einklappen
+ if( pTree->GetChildList(0)->Count() < 2 )
+ {
+ nRefDepth = 1;
+ pParentToCollapse = pCursor;
+ while( pTree->GetParent(pParentToCollapse) &&
+ pTree->GetDepth( pTree->GetParent(pParentToCollapse)) > 0)
+ {
+ pParentToCollapse = pTree->GetParent(pParentToCollapse);
+ }
+ }
+ else
+ nRefDepth = 0;
+
+ if( pView->IsExpanded(pParentToCollapse) )
+ pView->Collapse( pParentToCollapse );
+ SvLBoxEntry* pCur = pTree->Next( pParentToCollapse );
+ while( pCur && pTree->GetDepth(pCur) > nRefDepth )
+ {
+ if( pCur->HasChilds() && pView->IsExpanded(pCur) )
+ pView->Collapse( pCur );
+ pCur = pTree->Next( pCur );
+ }
+ }
+ }
+ }
+ break;
+
+ case KEY_DIVIDE :
+ if( bMod1 )
+ SelAllDestrAnch( TRUE );
+ break;
+
+ case KEY_COMMA :
+ if( bMod1 )
+ SelAllDestrAnch( FALSE );
+ break;
+
+ case KEY_HOME :
+ pNewCursor = pView->GetModel()->First();
+ if( pNewCursor && pNewCursor != pCursor )
+ {
+// SelAllDestrAnch( FALSE );
+ aSelEng.CursorPosChanging( bShift, bMod1 );
+ SetCursor( pNewCursor );
+ if( !IsEntryInView( pNewCursor ) )
+ MakeVisible( pNewCursor );
+ }
+ break;
+
+ case KEY_END :
+ pNewCursor = pView->GetModel()->Last();
+ if( pNewCursor && pNewCursor != pCursor)
+ {
+// SelAllDestrAnch( FALSE );
+ aSelEng.CursorPosChanging( bShift, bMod1 );
+ SetCursor( pNewCursor );
+ if( !IsEntryInView( pNewCursor ) )
+ MakeVisible( pNewCursor );
+ }
+ break;
+
+
+
+ default:
+ bKeyUsed = FALSE;
+ }
+ return bKeyUsed;
+}
+
+void __EXPORT SvImpLBox::GetFocus()
+{
+ if( pCursor )
+ {
+ pView->SetEntryFocus( pCursor, TRUE );
+ ShowCursor( TRUE );
+// auskommentiert wg. deselectall
+// if( bSimpleTravel && !pView->IsSelected(pCursor) )
+// pView->Select( pCursor, TRUE );
+ }
+ if( nWinBits & WB_HIDESELECTION )
+ {
+ SvLBoxEntry* pEntry = pView->FirstSelected();
+ while( pEntry )
+ {
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ InvalidateEntry( pEntry );
+ pEntry = pView->NextSelected( pEntry );
+ }
+ /*
+ SvLBoxEntry* pEntry = pView->GetModel()->First();
+ while( pEntry )
+ {
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ if( pViewData->IsCursored() )
+ {
+ pViewData->SetCursored( FALSE );
+ InvalidateEntry( pEntry );
+ }
+ pEntry = pView->GetModel()->Next( pEntry );
+ }
+ */
+
+
+ }
+}
+
+void __EXPORT SvImpLBox::LoseFocus()
+{
+//#if defined(MAC) || defined(OV_DEBUG)
+ aEditTimer.Stop();
+//#endif
+ if( pCursor )
+ pView->SetEntryFocus( pCursor,FALSE );
+ ShowCursor( FALSE );
+
+ if( nWinBits & WB_HIDESELECTION )
+ {
+ SvLBoxEntry* pEntry = pView->FirstSelected();
+ while( pEntry )
+ {
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ //pViewData->SetCursored( TRUE );
+ InvalidateEntry( pEntry );
+ pEntry = pView->NextSelected( pEntry );
+ }
+ }
+}
+
+
+// ********************************************************************
+// SelectionEngine
+// ********************************************************************
+
+inline void SvImpLBox::SelectEntry( SvLBoxEntry* pEntry, BOOL bSelect )
+{
+ pView->Select( pEntry, bSelect );
+}
+
+__EXPORT ImpLBSelEng::ImpLBSelEng( SvImpLBox* pImpl, SelectionEngine* pSEng,
+ SvTreeListBox* pV )
+{
+ pImp = pImpl;
+ pSelEng = pSEng;
+ pView = pV;
+}
+
+__EXPORT ImpLBSelEng::~ImpLBSelEng()
+{
+}
+
+void __EXPORT ImpLBSelEng::BeginDrag()
+{
+ pImp->BeginDrag();
+}
+
+/*
+void __EXPORT ImpLBSelEng::EndDrag( const Point& )
+{
+}
+*/
+
+void __EXPORT ImpLBSelEng::CreateAnchor()
+{
+ pImp->pAnchor = pImp->pCursor;
+}
+
+void __EXPORT ImpLBSelEng::DestroyAnchor()
+{
+ pImp->pAnchor = 0;
+}
+
+/*
+void __EXPORT ImpLBSelEng::CreateCursor()
+{
+ pImp->pAnchor = 0;
+}
+*/
+
+
+BOOL __EXPORT ImpLBSelEng::SetCursorAtPoint(const Point& rPoint, BOOL bDontSelectAtCursor)
+{
+ SvLBoxEntry* pNewCursor = pImp->MakePointVisible( rPoint );
+ if( pNewCursor != pImp->pCursor )
+ pImp->BeginScroll();
+
+ if( pNewCursor )
+ {
+ // bei SimpleTravel wird in SetCursor selektiert und
+ // der Select-Handler gerufen
+ //if( !bDontSelectAtCursor && !pImp->bSimpleTravel )
+ // pImp->SelectEntry( pNewCursor, TRUE );
+ pImp->SetCursor( pNewCursor, bDontSelectAtCursor );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+BOOL __EXPORT ImpLBSelEng::IsSelectionAtPoint( const Point& rPoint )
+{
+ SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
+ if( pEntry )
+ return pView->IsSelected(pEntry);
+ return FALSE;
+}
+
+void __EXPORT ImpLBSelEng::DeselectAtPoint( const Point& rPoint )
+{
+ SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
+ if( !pEntry )
+ return;
+ pImp->SelectEntry( pEntry, FALSE );
+}
+
+/*
+void __EXPORT ImpLBSelEng::SelectAtPoint( const Point& rPoint )
+{
+ SvLBoxEntry* pEntry = pImp->MakePointVisible( rPoint );
+ if( !pEntry )
+ return;
+ pImp->SelectEntry( pEntry, TRUE );
+}
+*/
+
+void __EXPORT ImpLBSelEng::DeselectAll()
+{
+ pImp->SelAllDestrAnch( FALSE, FALSE ); // SelectionEngine nicht resetten!
+ pImp->nFlags &= (~F_DESEL_ALL);
+}
+
+// ***********************************************************************
+// Selektion
+// ***********************************************************************
+
+void SvImpLBox::SetAnchorSelection(SvLBoxEntry* pOldCursor,SvLBoxEntry* pNewCursor)
+{
+ SvLBoxEntry* pEntry;
+ ULONG nAnchorVisPos = pView->GetVisiblePos( pAnchor );
+ ULONG nOldVisPos = pView->GetVisiblePos( pOldCursor );
+ ULONG nNewVisPos = pView->GetVisiblePos( pNewCursor );
+
+ if( nOldVisPos > nAnchorVisPos ||
+ ( nAnchorVisPos==nOldVisPos && nNewVisPos > nAnchorVisPos) )
+ {
+ if( nNewVisPos > nOldVisPos )
+ {
+ pEntry = pOldCursor;
+ while( pEntry && pEntry != pNewCursor )
+ {
+ pView->Select( pEntry, TRUE );
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ if( pEntry )
+ pView->Select( pEntry, TRUE );
+ return;
+ }
+
+ if( nNewVisPos < nAnchorVisPos )
+ {
+ pEntry = pAnchor;
+ while( pEntry && pEntry != pOldCursor )
+ {
+ pView->Select( pEntry, FALSE );
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ if( pEntry )
+ pView->Select( pEntry, FALSE );
+
+ pEntry = pNewCursor;
+ while( pEntry && pEntry != pAnchor )
+ {
+ pView->Select( pEntry, TRUE );
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ if( pEntry )
+ pView->Select( pEntry, TRUE );
+ return;
+ }
+
+ if( nNewVisPos < nOldVisPos )
+ {
+ pEntry = pNewCursor;
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ while( pEntry && pEntry != pOldCursor )
+ {
+ pView->Select( pEntry, FALSE );
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ if( pEntry )
+ pView->Select( pEntry, FALSE );
+ return;
+ }
+ }
+ else
+ {
+ if( nNewVisPos < nOldVisPos ) // Vergroessern der Selektion
+ {
+ pEntry = pNewCursor;
+ while( pEntry && pEntry != pOldCursor )
+ {
+ pView->Select( pEntry, TRUE );
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ if( pEntry )
+ pView->Select( pEntry, TRUE );
+ return;
+ }
+
+ if( nNewVisPos > nAnchorVisPos )
+ {
+ pEntry = pOldCursor;
+ while( pEntry && pEntry != pAnchor )
+ {
+ pView->Select( pEntry, FALSE );
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ if( pEntry )
+ pView->Select( pEntry, FALSE );
+ pEntry = pAnchor;
+ while( pEntry && pEntry != pNewCursor )
+ {
+ pView->Select( pEntry, TRUE );
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ if( pEntry )
+ pView->Select( pEntry, TRUE );
+ return;
+ }
+
+ if( nNewVisPos > nOldVisPos )
+ {
+ pEntry = pOldCursor;
+ while( pEntry && pEntry != pNewCursor )
+ {
+ pView->Select( pEntry, FALSE );
+ pEntry = (SvLBoxEntry*)(pView->NextVisible( pEntry ));
+ }
+ return;
+ }
+ }
+}
+
+void SvImpLBox::SelAllDestrAnch( BOOL bSelect, BOOL bDestroyAnchor,
+ BOOL bSingleSelToo )
+{
+ SvLBoxEntry* pEntry;
+ nFlags &= (~F_DESEL_ALL);
+ if( bSelect && bSimpleTravel )
+ {
+ if( pCursor && !pView->IsSelected( pCursor ))
+ {
+ pView->Select( pCursor, TRUE );
+ }
+ return;
+ }
+ if( !bSelect && pView->GetSelectionCount() == 0 )
+ {
+ if( bSimpleTravel && ( !GetUpdateMode() || !pCursor) )
+ nFlags |= F_DESEL_ALL;
+ return;
+ }
+ if( bSelect && pView->GetSelectionCount() == pView->GetEntryCount())
+ return;
+ if( !bSingleSelToo && bSimpleTravel )
+ return;
+
+ if( !bSelect && pView->GetSelectionCount()==1 && pCursor &&
+ pView->IsSelected( pCursor ))
+ {
+ pView->Select( pCursor, FALSE );
+ if( bDestroyAnchor )
+ DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen
+ else
+ pAnchor = 0; // internen Anker immer loeschen
+ return;
+ }
+
+ if( bSimpleTravel && !pCursor && !GetUpdateMode() )
+ nFlags |= F_DESEL_ALL;
+
+ ShowCursor( FALSE );
+ BOOL bUpdate = GetUpdateMode();
+
+ nFlags |= F_IGNORE_SELECT; // EntryInserted soll nix tun
+ pEntry = pTree->First();
+ while( pEntry )
+ {
+ if( pView->Select( pEntry, bSelect ) )
+ {
+ if( bUpdate && pView->IsEntryVisible(pEntry) )
+ {
+ long nY = GetEntryLine( pEntry );
+ if( IsLineVisible( nY ) )
+ pView->PaintEntry1( pEntry, nY, 0xffff ); // wg. ItemsetBrowser SV_LBOXTAB_SHOW_SELECTION );
+ }
+ }
+ pEntry = pTree->Next( pEntry );
+ }
+ nFlags &= ~F_IGNORE_SELECT;
+
+ if( bDestroyAnchor )
+ DestroyAnchor(); // Anker loeschen & SelectionEngine zuruecksetzen
+ else
+ pAnchor = 0; // internen Anker immer loeschen
+ ShowCursor( TRUE );
+}
+
+void SvImpLBox::SetSelectionMode( SelectionMode eSelMode )
+{
+ aSelEng.SetSelectionMode( eSelMode);
+ if( eSelMode == SINGLE_SELECTION )
+ bSimpleTravel = TRUE;
+ else
+ bSimpleTravel = FALSE;
+ if( (nWinBits & WB_SIMPLEMODE) && (eSelMode == MULTIPLE_SELECTION) )
+ aSelEng.AddAlways( TRUE );
+}
+
+// ***********************************************************************
+// Drag & Drop
+// ***********************************************************************
+
+void SvImpLBox::SetDragDropMode( DragDropMode eDDMode )
+{
+ if( eDDMode && eDDMode != SV_DRAGDROP_APP_DROP )
+ {
+ aSelEng.ExpandSelectionOnMouseMove( FALSE );
+ aSelEng.EnableDrag( TRUE );
+ }
+ else
+ {
+ aSelEng.ExpandSelectionOnMouseMove( TRUE );
+ aSelEng.EnableDrag( FALSE );
+ }
+}
+
+void SvImpLBox::BeginDrag()
+{
+ nFlags &= (~F_FILLING);
+ if( !bAsyncBeginDrag )
+ {
+ BeginScroll();
+ pView->BeginDrag( aSelEng.GetMousePosPixel() );
+ EndScroll();
+ }
+ else
+ {
+ aAsyncBeginDragPos = aSelEng.GetMousePosPixel();
+ aAsyncBeginDragTimer.Start();
+ }
+}
+
+IMPL_LINK( SvImpLBox, BeginDragHdl, void*, EMPTYARG )
+{
+ pView->BeginDrag( aAsyncBeginDragPos );
+ return 0;
+}
+
+void SvImpLBox::PaintDDCursor( SvLBoxEntry* pInsertionPos )
+{
+ long nY;
+ if( pInsertionPos )
+ {
+ nY = GetEntryLine( pInsertionPos );
+ nY += pView->GetEntryHeight();
+ }
+ else
+ nY = 1;
+ RasterOp eOldOp = pView->GetRasterOp();
+ pView->SetRasterOp( ROP_INVERT );
+ Color aOldLineColor = pView->GetLineColor();
+ pView->SetLineColor( Color( COL_BLACK ) );
+ pView->DrawLine( Point( 0, nY ), Point( aOutputSize.Width(), nY ) );
+ pView->SetLineColor( aOldLineColor );
+ pView->SetRasterOp( eOldOp );
+}
+
+void SvImpLBox::Command( const CommandEvent& rCEvt )
+{
+ // Rollmaus-Event?
+ if( (rCEvt.GetCommand() == COMMAND_WHEEL) ||
+ (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
+ (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) )
+ {
+ if( pView->HandleScrollCommand( rCEvt, &aHorSBar, &aVerSBar ) )
+ return;
+ }
+#ifndef NOCOMMAND
+ const Point& rPos = rCEvt.GetMousePosPixel();
+ if( rPos.X() < aOutputSize.Width() && rPos.Y() < aOutputSize.Height() )
+ aSelEng.Command( rCEvt );
+#endif
+}
+
+void SvImpLBox::BeginScroll()
+{
+ if( !(nFlags & F_IN_SCROLLING))
+ {
+ pView->NotifyBeginScroll();
+ nFlags |= F_IN_SCROLLING;
+ }
+}
+
+void SvImpLBox::EndScroll()
+{
+ if( nFlags & F_IN_SCROLLING)
+ {
+ pView->NotifyEndScroll();
+ nFlags &= (~F_IN_SCROLLING);
+ }
+}
+
+
+Rectangle SvImpLBox::GetVisibleArea() const
+{
+ Point aPos( pView->GetMapMode().GetOrigin() );
+ aPos.X() *= -1;
+ Rectangle aRect( aPos, aOutputSize );
+ return aRect;
+}
+
+void SvImpLBox::Invalidate()
+{
+ pView->SetClipRegion();
+}
+
+void SvImpLBox::SetCurEntry( SvLBoxEntry* pEntry )
+{
+ if( aSelEng.GetSelectionMode() != SINGLE_SELECTION )
+ SelAllDestrAnch( FALSE, TRUE, FALSE );
+ MakeVisible( pEntry );
+ SetCursor( pEntry );
+// if( bSimpleTravel )
+ pView->Select( pEntry, TRUE );
+}
+
+//#if defined(MAC) || defined(OV_DEBUG)
+IMPL_LINK( SvImpLBox, EditTimerCall, Timer *, pTimer )
+{
+ if( pView->IsInplaceEditingEnabled() )
+ {
+ SvLBoxEntry* pEntry = GetCurEntry();
+ if( pEntry )
+ {
+ ShowCursor( FALSE );
+ pView->EditEntry( pEntry );
+ ShowCursor( TRUE );
+ }
+ }
+ return 0;
+}
+//#endif
+
+
+BOOL SvImpLBox::RequestHelp( const HelpEvent& rHEvt )
+{
+ if( rHEvt.GetMode() & HELPMODE_QUICK )
+ {
+ Point aPos( pView->ScreenToOutputPixel( rHEvt.GetMousePosPixel() ));
+ if( !GetVisibleArea().IsInside( aPos ))
+ return FALSE;
+
+ SvLBoxEntry* pEntry = GetEntry( aPos );
+ if( pEntry )
+ {
+ // Rechteck des Textes berechnen
+ SvLBoxTab* pTab;
+ SvLBoxString* pItem = (SvLBoxString*)(pView->GetItem( pEntry, aPos.X(), &pTab ));
+ if( !pItem || pItem->IsA() != SV_ITEM_ID_LBOXSTRING )
+ return FALSE;
+
+ aPos = GetEntryPos( pEntry );
+ aPos.X() = pView->GetTabPos( pEntry, pTab ); //pTab->GetPos();
+ Size aSize( pItem->GetSize( pView, pEntry ) );
+ SvLBoxTab* pNextTab = NextTab( pTab );
+ BOOL bItemClipped = FALSE;
+ // wurde das Item von seinem rechten Nachbarn abgeschnitten?
+ if( pNextTab && pView->GetTabPos(pEntry,pNextTab) < aPos.X()+aSize.Width() )
+ {
+ aSize.Width() = pNextTab->GetPos() - pTab->GetPos();
+ bItemClipped = TRUE;
+ }
+ Rectangle aItemRect( aPos, aSize );
+
+ Rectangle aViewRect( GetVisibleArea() );
+
+ if( bItemClipped || !aViewRect.IsInside( aItemRect ) )
+ {
+ // rechten Item-Rand am View-Rand clippen
+ //if( aItemRect.Right() > aViewRect.Right() )
+ // aItemRect.Right() = aViewRect.Right();
+
+ Point aPt = pView->OutputToScreenPixel( aItemRect.TopLeft() );
+ aItemRect.Left() = aPt.X();
+ aItemRect.Top() = aPt.Y();
+ aPt = pView->OutputToScreenPixel( aItemRect.BottomRight() );
+ aItemRect.Right() = aPt.X();
+ aItemRect.Bottom() = aPt.Y();
+
+ Help::ShowQuickHelp( pView, aItemRect,
+ pItem->GetText(), QUICKHELP_LEFT | QUICKHELP_VCENTER );
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+SvLBoxTab* SvImpLBox::NextTab( SvLBoxTab* pTab )
+{
+ USHORT nTabCount = pView->TabCount();
+ if( nTabCount <= 1 )
+ return 0;
+ for( USHORT nTab=0; nTab < (nTabCount-1); nTab++)
+ {
+ if( pView->aTabs[nTab]==pTab )
+ return (SvLBoxTab*)(pView->aTabs[nTab+1]);
+ }
+ return 0;
+}
+
+void SvImpLBox::EndSelection()
+{
+ DestroyAnchor();
+ nFlags &= ~F_START_EDITTIMER;
+}
+
+void SvImpLBox::RepaintScrollBars()
+{
+#ifndef VCL
+ aHorSBar.Invalidate();
+ aHorSBar.Update();
+ aVerSBar.Invalidate();
+ aVerSBar.Update();
+#endif
+}
+
+void SvImpLBox::SetUpdateMode( BOOL bMode )
+{
+ if( bUpdateMode != bMode )
+ {
+ bUpdateMode = bMode;
+ if( bUpdateMode )
+ UpdateAll( FALSE );
+ }
+}
+
+void SvImpLBox::SetUpdateModeFast( BOOL bMode )
+{
+ if( bUpdateMode != bMode )
+ {
+ bUpdateMode = bMode;
+ if( bUpdateMode )
+ UpdateAll( FALSE, FALSE );
+ }
+}
+
+
+BOOL SvImpLBox::SetMostRight( SvLBoxEntry* pEntry )
+{
+ if( pView->nTreeFlags & TREEFLAG_RECALCTABS )
+ {
+ nFlags |= F_IGNORE_CHANGED_TABS;
+ pView->SetTabs();
+ nFlags &= ~F_IGNORE_CHANGED_TABS;
+ }
+
+ USHORT nLastTab = pView->aTabs.Count() - 1;
+ USHORT nLastItem = pEntry->ItemCount() - 1;
+ if( nLastTab != USHRT_MAX && nLastItem != USHRT_MAX )
+ {
+ if( nLastItem < nLastTab )
+ nLastTab = nLastItem;
+
+ SvLBoxTab* pTab = (SvLBoxTab*)pView->aTabs[ nLastTab ];
+ SvLBoxItem* pItem = pEntry->GetItem( nLastTab );
+
+ long nTabPos = pView->GetTabPos( pEntry, pTab );
+
+ long nMaxRight = GetOutputSize().Width();
+ Point aPos( pView->GetMapMode().GetOrigin() );
+ aPos.X() *= -1; // Umrechnung Dokumentkoord.
+ nMaxRight = nMaxRight + aPos.X() - 1;
+
+ long nNextTab = nTabPos < nMaxRight ? nMaxRight : nMaxRight + 50;
+ long nTabWidth = nNextTab - nTabPos + 1;
+ long nItemSize = pItem->GetSize(pView,pEntry).Width();
+ long nOffset = pTab->CalcOffset( nItemSize, nTabWidth );
+
+ long nRight = nTabPos + nOffset + nItemSize;
+ if( nRight > nMostRight )
+ {
+ nMostRight = nRight;
+ pMostRightEntry = pEntry;
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void SvImpLBox::FindMostRight( SvLBoxEntry* pEntryToIgnore )
+{
+ nMostRight = -1;
+ pMostRightEntry = 0;
+ if( !pView->GetModel() )
+ return;
+
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)pView->FirstVisible();
+ while( pEntry )
+ {
+ if( pEntry != pEntryToIgnore )
+ SetMostRight( pEntry );
+ pEntry = (SvLBoxEntry*)pView->NextVisible( pEntry );
+ }
+}
+
+void SvImpLBox::FindMostRight( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToIgnore )
+{
+ if( !pParent )
+ FindMostRight( pEntryToIgnore );
+ else
+ FindMostRight_Impl( pParent, pEntryToIgnore );
+}
+
+void SvImpLBox::FindMostRight_Impl( SvLBoxEntry* pParent, SvLBoxEntry* pEntryToIgnore )
+{
+ SvTreeEntryList* pList = pTree->GetChildList( pParent );
+
+ if( !pList )
+ return;
+
+ ULONG nCount = pList->Count();
+ for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ {
+ SvLBoxEntry* pChild = (SvLBoxEntry*)pList->GetObject( nCur );
+ if( pChild != pEntryToIgnore )
+ {
+ SetMostRight( pChild );
+ if( pChild->HasChilds() && pView->IsExpanded( pChild ))
+ FindMostRight_Impl( pChild, pEntryToIgnore );
+ }
+ }
+}
+
+void SvImpLBox::NotifyTabsChanged()
+{
+ if( GetUpdateMode() && !(nFlags & F_IGNORE_CHANGED_TABS ) &&
+ nCurUserEvent == 0xffffffff )
+ {
+ nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpLBox,MyUserEvent),(void*)0);
+ }
+}
+
+IMPL_LINK(SvImpLBox,MyUserEvent,void*, pArg )
+{
+ nCurUserEvent = 0xffffffff;
+ if( !pArg )
+ {
+ pView->Invalidate();
+ pView->Update();
+ }
+ else
+ {
+ FindMostRight( 0 );
+ ShowVerSBar();
+ pView->Invalidate( GetVisibleArea() );
+ }
+ return 0;
+}
+
+
+void SvImpLBox::StopUserEvent()
+{
+ if( nCurUserEvent != 0xffffffff )
+ {
+ Application::RemoveUserEvent( nCurUserEvent );
+ nCurUserEvent = 0xffffffff;
+ }
+}
+
+void SvImpLBox::ShowFocusRect( const SvLBoxEntry* pEntry )
+{
+ if( pEntry )
+ {
+ long nY = GetEntryLine( (SvLBoxEntry*)pEntry );
+ Rectangle aRect = pView->GetFocusRect( (SvLBoxEntry*)pEntry, nY );
+ Region aOldClip( pView->GetClipRegion());
+ Region aClipRegion( GetClipRegionRect() );
+ pView->SetClipRegion( aClipRegion );
+ pView->ShowFocus( aRect );
+ pView->SetClipRegion( aOldClip );
+
+ }
+ else
+ {
+ pView->HideFocus();
+ }
+}
+
+void SvImpLBox::SetTabBar( TabBar* _pTabBar )
+{
+ pTabBar = _pTabBar;
+}
+
+
diff --git a/svtools/source/contnr/svimpicn.cxx b/svtools/source/contnr/svimpicn.cxx
new file mode 100644
index 000000000000..5d0f83c01d78
--- /dev/null
+++ b/svtools/source/contnr/svimpicn.cxx
@@ -0,0 +1,4222 @@
+/*************************************************************************
+ *
+ * $RCSfile: svimpicn.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:56 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <limits.h>
+#ifndef _METRIC_HXX
+#include <vcl/metric.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifdef DBG_UTIL
+#include <vcl/sound.hxx>
+#endif
+
+#pragma hdrstop
+
+#include <svlbox.hxx>
+#include <svicnvw.hxx>
+#ifndef _SVIMPICN_HXX
+#include <svimpicn.hxx>
+#endif
+#ifndef _SVLBITM_HXX
+#include <svlbitm.hxx>
+#endif
+#ifndef _SVARRAY_HXX
+#include "svarray.hxx"
+#endif
+
+
+
+#define VIEWMODE_ICON 0x0001 // Text unter Bitmap
+#define VIEWMODE_NAME 0x0002 // Text rechts neben Bitmap
+#define VIEWMODE_TEXT 0x0004 // Text ohne Bitmap
+
+#define DD_SCROLL_PIXEL 10
+
+// alle Angaben in Pixel
+
+#define ICONVIEW_OFFS_BMP_STRING 3
+
+// fuer das Bounding-Rectangle
+#define LROFFS_BOUND 2
+#define TBOFFS_BOUND 2
+
+// fuer das Focus-Rectangle um Icons
+#define LROFFS_ICON 2
+#define TBOFFS_ICON 2
+
+#define NAMEVIEW_OFFS_BMP_STRING 3
+
+// Abstaende von Fensterraendern
+#define LROFFS_WINBORDER 4
+#define TBOFFS_WINBORDER 4
+
+// Breitenoffset Highlight-Rect bei Text
+#define LROFFS_TEXT 2
+
+
+#define ICNVIEWDATA(xPtr) (SvIcnVwDataEntry*)(pView->GetViewDataEntry(xPtr))
+#define ICNVIEWDATA2(xPtr) (SvIcnVwDataEntry*)(pView->pView->GetViewDataEntry(xPtr))
+
+//--------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+// -------------------------------------------------------------------------
+// Hilfsfunktionen von Thomas Hosemann zur mehrzeiligen Ausgabe von
+// Strings. Die Funktionen werden spaeter in StarView integriert.
+// -------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+
+// keine doppelten Defines
+#ifdef TEXT_DRAW_CLIP
+#undef TEXT_DRAW_CLIP
+#endif
+#ifdef TEXT_DRAW_MULTILINE
+#undef TEXT_DRAW_MULTILINE
+#endif
+#ifdef TEXT_DRAW_WORDBREAK
+#undef TEXT_DRAW_WORDBREAK
+#endif
+
+// #define TEXT_DRAW_DISABLE ((USHORT)0x0001)
+// #define TEXT_DRAW_3DLOOK ((USHORT)0x0002)
+// #define TEXT_DRAW_MNEMONIC ((USHORT)0x0004)
+#define TEXT_DRAW_LEFT ((USHORT)0x0010)
+#define TEXT_DRAW_CENTER ((USHORT)0x0020)
+#define TEXT_DRAW_RIGHT ((USHORT)0x0040)
+#define TEXT_DRAW_TOP ((USHORT)0x0080)
+#define TEXT_DRAW_VCENTER ((USHORT)0x0100)
+#define TEXT_DRAW_BOTTOM ((USHORT)0x0200)
+#define TEXT_DRAW_ENDELLIPSIS ((USHORT)0x0400)
+#define TEXT_DRAW_PATHELLIPSIS ((USHORT)0x0800)
+#define TEXT_DRAW_CLIP ((USHORT)0x1000)
+#define TEXT_DRAW_MULTILINE ((USHORT)0x2000)
+#define TEXT_DRAW_WORDBREAK ((USHORT)0x4000)
+
+XubString GetEllipsisString( OutputDevice* pDev,
+ const XubString& rStr, long nMaxWidth,
+ USHORT nStyle = TEXT_DRAW_ENDELLIPSIS )
+{
+ XubString aStr = rStr;
+
+ if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ {
+ USHORT nIndex = pDev->GetTextBreak( rStr, nMaxWidth );
+ if ( nIndex != STRING_LEN )
+ {
+ aStr.Erase( nIndex );
+ if ( nIndex > 1 )
+ {
+ aStr.AppendAscii("...");
+ while ( aStr.Len() &&
+ (pDev->GetTextWidth( aStr ) > nMaxWidth) )
+ {
+ if ( (nIndex > 1) || (nIndex == aStr.Len()) )
+ nIndex--;
+ aStr.Erase( nIndex, 1 );
+ }
+ }
+
+ if ( !aStr.Len() && (nStyle & TEXT_DRAW_CLIP) )
+ aStr += rStr.GetChar( 0 );
+ }
+ }
+
+ return aStr;
+}
+
+class TextLineInfo
+{
+private:
+ long mnWidth;
+ USHORT mnIndex;
+ USHORT mnLen;
+
+public:
+ TextLineInfo( long nWidth, USHORT nIndex, USHORT nLen )
+ {
+ mnWidth = nWidth;
+ mnIndex = nIndex;
+ mnLen = nLen;
+ }
+
+ long GetWidth() const { return mnWidth; }
+ USHORT GetIndex() const { return mnIndex; }
+ USHORT GetLen() const { return mnLen; }
+};
+
+#define MULTITEXTLINEINFO_RESIZE 16
+typedef TextLineInfo* PTextLineInfo;
+
+class MultiTextLineInfo
+{
+private:
+ PTextLineInfo* mpLines;
+ USHORT mnLines;
+ USHORT mnSize;
+
+public:
+ MultiTextLineInfo();
+ ~MultiTextLineInfo();
+
+ void AddLine( TextLineInfo* pLine );
+ void Clear();
+
+ TextLineInfo* GetLine( USHORT nLine ) const
+ { return mpLines[nLine]; }
+ USHORT Count() const { return mnLines; }
+
+private:
+ MultiTextLineInfo( const MultiTextLineInfo& );
+ MultiTextLineInfo& operator=( const MultiTextLineInfo& );
+};
+
+MultiTextLineInfo::MultiTextLineInfo()
+{
+ mpLines = new PTextLineInfo[MULTITEXTLINEINFO_RESIZE];
+ mnLines = 0;
+ mnSize = MULTITEXTLINEINFO_RESIZE;
+}
+
+MultiTextLineInfo::~MultiTextLineInfo()
+{
+ for ( USHORT i = 0; i < mnLines; i++ )
+ delete mpLines[i];
+ delete mpLines;
+}
+
+void MultiTextLineInfo::AddLine( TextLineInfo* pLine )
+{
+ if ( mnSize == mnLines )
+ {
+ mnSize += MULTITEXTLINEINFO_RESIZE;
+ PTextLineInfo* pNewLines = new PTextLineInfo[mnSize];
+ memcpy( pNewLines, mpLines, mnLines*sizeof(PTextLineInfo) );
+ mpLines = pNewLines;
+ }
+
+ mpLines[mnLines] = pLine;
+ mnLines++;
+}
+
+void MultiTextLineInfo::Clear()
+{
+ for ( USHORT i = 0; i < mnLines; i++ )
+ delete mpLines[i];
+ mnLines = 0;
+}
+
+// -----------------------------------------------------------------------
+
+long GetTextLines( OutputDevice* pDev, MultiTextLineInfo& rLineInfo,
+ long nWidth, const XubString& rStr,
+ USHORT nStyle = TEXT_DRAW_WORDBREAK )
+{
+ rLineInfo.Clear();
+ if ( !rStr.Len() )
+ return 0;
+ if ( nWidth <= 0 )
+ nWidth = 1;
+
+ USHORT nStartPos = 0; // Start-Position der Zeile
+ USHORT nLastLineLen = 0; // Zeilenlaenge bis zum vorherigen Wort
+ USHORT nLastWordPos = 0; // Position des letzten Wortanfangs
+ USHORT i = 0;
+ USHORT nPos; // StartPositon der Zeile (nur Temp)
+ USHORT nLen; // Laenge der Zeile (nur Temp)
+ USHORT nStrLen = rStr.Len();
+ long nMaxLineWidth = 0; // Maximale Zeilenlaenge
+ long nLineWidth; // Aktuelle Zeilenlaenge
+ long nLastLineWidth = 0; // Zeilenlaenge der letzten Zeile
+ xub_Unicode c;
+ xub_Unicode c2;
+ const xub_Unicode* pStr = rStr.GetBuffer();
+ BOOL bHardBreak = FALSE;
+
+ do
+ {
+ c = pStr[i];
+
+ // Auf Zeilenende ermitteln
+ if ( (c == _CR) || (c == _LF) )
+ bHardBreak = TRUE;
+ else
+ bHardBreak = FALSE;
+
+ // Testen, ob ein Wortende erreicht ist
+ if ( bHardBreak || (i == nStrLen) ||
+ (((c == ' ') || (c == '-')) && (nStyle & TEXT_DRAW_WORDBREAK)) )
+ {
+ nLen = i-nStartPos;
+ if ( c == '-' )
+ nLen++;
+ nLineWidth = pDev->GetTextWidth( rStr, nStartPos, nLen );
+
+ // Findet ein Zeilenumbruch statt
+ if ( bHardBreak || (i == nStrLen) ||
+ ((nLineWidth >= nWidth) && (nStyle & TEXT_DRAW_WORDBREAK)) )
+ {
+ nPos = nStartPos;
+
+ if ( (nLineWidth >= nWidth) && (nStyle & TEXT_DRAW_WORDBREAK) )
+ {
+ nLineWidth = nLastLineWidth;
+ nLen = nLastLineLen;
+ nStartPos = nLastWordPos;
+ nLastLineLen = i-nStartPos;
+ nLastWordPos = nStartPos+nLastLineLen+1;
+ if ( c == '-' )
+ nLastLineLen++;
+ else if ( bHardBreak && (i > nStartPos) )
+ i--;
+ }
+ else
+ {
+ nStartPos = i;
+ // Zeilenende-Zeichen und '-' beruecksichtigen
+ if ( bHardBreak )
+ {
+ nStartPos++;
+ c2 = pStr[i+1];
+ if ( (c != c2) && ((c2 == _CR) || (c2 == _LF)) )
+ {
+ nStartPos++;
+ i++;
+ }
+ }
+ else if ( c != '-' )
+ nStartPos++;
+ nLastWordPos = nStartPos;
+ nLastLineLen = 0;
+ }
+
+ if ( nLineWidth > nMaxLineWidth )
+ nMaxLineWidth = nLineWidth;
+
+ if ( nLen || bHardBreak )
+ rLineInfo.AddLine( new TextLineInfo( nLineWidth, nPos, nLen ) );
+
+ // Testen, ob aktuelles Wort noch auf die Zeile passt,
+ // denn ansonsten mueessen wir es auftrennen
+ if ( nLastLineLen )
+ {
+ nLineWidth = pDev->GetTextWidth( rStr, nStartPos, nLastLineLen );
+ if ( nLineWidth > nWidth )
+ {
+ // Wenn ein Wortumbruch in einem Wort stattfindet,
+ // ist die maximale Zeilenlaenge die Laenge
+ // des laengsten Wortes
+ if ( nLineWidth > nMaxLineWidth )
+ nMaxLineWidth = nLineWidth;
+
+ // Solange Wort auftrennen, bis es auf eine Zeile passt
+ do
+ {
+ nPos = pDev->GetTextBreak( rStr, nWidth, nStartPos, nLastLineLen );
+ nLen = nPos-nStartPos;
+ if ( !nLen )
+ {
+ nPos++;
+ nLen++;
+ }
+ nLineWidth = pDev->GetTextWidth( rStr, nStartPos, nLen );
+ rLineInfo.AddLine( new TextLineInfo( nLineWidth, nStartPos, nLen ) );
+ nStartPos = nPos;
+ nLastLineLen -= nLen;
+ nLineWidth = pDev->GetTextWidth( rStr, nStartPos, nLastLineLen );
+ }
+ while ( nLineWidth > nWidth );
+ }
+ nLastLineWidth = nLineWidth;
+
+ // Bei Stringende muessen wir die letzte Zeile auch noch
+ // dranhaengen
+ if ( (i == nStrLen) && nLastLineLen )
+ rLineInfo.AddLine( new TextLineInfo( nLastLineWidth, nStartPos, nLastLineLen ) );
+ }
+ else
+ nLastLineWidth = 0;
+ }
+ else
+ {
+ nLastLineWidth = nLineWidth;
+ nLastLineLen = nLen;
+ nLastWordPos = nStartPos+nLastLineLen;
+ if ( c != '-' )
+ nLastWordPos++;
+ }
+ }
+
+ i++;
+ }
+ while ( i <= nStrLen );
+
+ return nMaxLineWidth;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT GetTextLines( OutputDevice* pDev, const Rectangle& rRect,
+ const XubString& rStr,
+ USHORT nStyle = TEXT_DRAW_WORDBREAK,
+ long* pMaxWidth = NULL )
+{
+ MultiTextLineInfo aMultiLineInfo;
+ long nMaxWidth = GetTextLines( pDev, aMultiLineInfo,
+ rRect.GetWidth(), rStr, nStyle );
+ if ( pMaxWidth )
+ *pMaxWidth = nMaxWidth;
+ return aMultiLineInfo.Count();
+}
+
+// -----------------------------------------------------------------------
+
+Rectangle GetTextRect( OutputDevice* pDev, const Rectangle& rRect,
+ const XubString& rStr,
+ USHORT nStyle = TEXT_DRAW_WORDBREAK )
+{
+ Rectangle aRect = rRect;
+ USHORT nLines;
+ long nWidth = rRect.GetWidth();
+ long nMaxWidth;
+ long nTextHeight;
+
+ if ( nStyle & TEXT_DRAW_MULTILINE )
+ {
+ MultiTextLineInfo aMultiLineInfo;
+ TextLineInfo* pLineInfo;
+ USHORT nFormatLines;
+
+ nMaxWidth = 0;
+ GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle );
+ nFormatLines = aMultiLineInfo.Count();
+ nTextHeight = pDev->GetTextHeight();
+ nLines = (USHORT)(aRect.GetHeight()/nTextHeight);
+ if ( nFormatLines <= nLines )
+ nLines = nFormatLines;
+ else
+ {
+ if ( !(nStyle & TEXT_DRAW_ENDELLIPSIS) )
+ nLines = nFormatLines;
+ else
+ nMaxWidth = nWidth;
+ }
+ for ( USHORT i = 0; i < nLines; i++ )
+ {
+ pLineInfo = aMultiLineInfo.GetLine( i );
+ if ( pLineInfo->GetWidth() > nMaxWidth )
+ nMaxWidth = pLineInfo->GetWidth();
+ }
+ }
+ else
+ {
+ nLines = 1;
+ nMaxWidth = pDev->GetTextWidth( rStr );
+ nTextHeight = pDev->GetTextHeight();
+ if ( (nMaxWidth > nWidth) && (nStyle & TEXT_DRAW_ENDELLIPSIS) )
+ nMaxWidth = nWidth;
+ }
+
+ if ( nStyle & TEXT_DRAW_RIGHT )
+ aRect.Left() = aRect.Right()-nMaxWidth+1;
+ else if ( nStyle & TEXT_DRAW_CENTER )
+ {
+ aRect.Left() += (nWidth-nMaxWidth)/2;
+ aRect.Right() = aRect.Left()+nMaxWidth-1;
+ }
+ else
+ aRect.Right() = aRect.Left()+nMaxWidth-1;
+
+ if ( nStyle & TEXT_DRAW_BOTTOM )
+ aRect.Top() = aRect.Bottom()-(nTextHeight*nLines)+1;
+ else if ( nStyle & TEXT_DRAW_VCENTER )
+ {
+ aRect.Top() += (aRect.GetHeight()-(nTextHeight*nLines))/2;
+ aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1;
+ }
+ else
+ aRect.Bottom() = aRect.Top()+(nTextHeight*nLines)-1;
+
+ return aRect;
+}
+
+// -----------------------------------------------------------------------
+
+void DrawText( OutputDevice* pDev, const Rectangle& rRect,
+ const XubString& rStr, USHORT nStyle = 0 )
+{
+ if ( !rStr.Len() || rRect.IsEmpty() )
+ return;
+
+ Point aPos = rRect.TopLeft();
+ long nWidth = rRect.GetWidth();
+ long nHeight = rRect.GetHeight();
+ FontAlign eAlign = pDev->GetFont().GetAlign();
+
+ if ( ((nWidth <= 0) || (nHeight <= 0)) && (nStyle & TEXT_DRAW_CLIP) )
+ return;
+
+ // Mehrzeiligen Text behandeln wir anders
+ if ( nStyle & TEXT_DRAW_MULTILINE )
+ {
+ String aLastLine;
+ Region aOldRegion;
+ MultiTextLineInfo aMultiLineInfo;
+ TextLineInfo* pLineInfo;
+ long nTextHeight = pDev->GetTextHeight();
+ long nMaxTextWidth;
+ USHORT i;
+ USHORT nLines = (USHORT)(nHeight/nTextHeight);
+ USHORT nFormatLines;
+ BOOL bIsClipRegion;
+ nMaxTextWidth = GetTextLines( pDev, aMultiLineInfo, nWidth, rStr, nStyle );
+
+ nFormatLines = aMultiLineInfo.Count();
+ if ( nFormatLines > nLines )
+ {
+ if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ {
+ // Letzte Zeile zusammenbauen und kuerzen
+ nFormatLines = nLines-1;
+ pLineInfo = aMultiLineInfo.GetLine( nFormatLines );
+ aLastLine = rStr.Copy( pLineInfo->GetIndex() );
+ aLastLine.ConvertLineEnd( LINEEND_LF );
+ aLastLine.SearchAndReplace( _LF, ' ' );
+ aLastLine = GetEllipsisString( pDev, aLastLine, nWidth, nStyle );
+ nStyle &= ~(TEXT_DRAW_VCENTER | TEXT_DRAW_BOTTOM);
+ nStyle |= TEXT_DRAW_TOP;
+ }
+ }
+ else
+ {
+ if ( nMaxTextWidth <= nWidth )
+ nStyle &= ~TEXT_DRAW_CLIP;
+ }
+
+ // Clipping setzen
+ if ( nStyle & TEXT_DRAW_CLIP )
+ {
+ bIsClipRegion = pDev->IsClipRegion();
+ if ( bIsClipRegion )
+ {
+ aOldRegion = pDev->GetClipRegion();
+ pDev->IntersectClipRegion( rRect );
+ }
+ else
+ {
+ Region aRegion( rRect );
+ pDev->SetClipRegion( aRegion );
+ }
+ }
+
+ // Vertikales Alignment
+ if ( nStyle & TEXT_DRAW_BOTTOM )
+ aPos.Y() += nHeight-(nFormatLines*nTextHeight);
+ else if ( nStyle & TEXT_DRAW_VCENTER )
+ aPos.Y() += (nHeight-(nFormatLines*nTextHeight))/2;
+
+ // Font Alignment
+ if ( eAlign == ALIGN_BOTTOM )
+ aPos.Y() += nTextHeight;
+ else if ( eAlign == ALIGN_BASELINE )
+ aPos.Y() += pDev->GetFontMetric().GetAscent();
+
+ // Alle Zeilen ausgeben, bis auf die letzte
+ for ( i = 0; i < nFormatLines; i++ )
+ {
+ pLineInfo = aMultiLineInfo.GetLine( i );
+ if ( nStyle & TEXT_DRAW_RIGHT )
+ aPos.X() += nWidth-pLineInfo->GetWidth();
+ else if ( nStyle & TEXT_DRAW_CENTER )
+ aPos.X() += (nWidth-pLineInfo->GetWidth())/2;
+ pDev->DrawText( aPos, rStr, pLineInfo->GetIndex(), pLineInfo->GetLen() );
+ aPos.Y() += nTextHeight;
+ aPos.X() = rRect.Left();
+ }
+
+ // Gibt es noch eine letzte Zeile, dann diese linksbuendig ausgeben,
+ // da die Zeile gekuerzt wurde
+ if ( aLastLine.Len() )
+ pDev->DrawText( aPos, aLastLine );
+
+ // Clipping zuruecksetzen
+ if ( nStyle & TEXT_DRAW_CLIP )
+ {
+ if ( bIsClipRegion )
+ pDev->SetClipRegion( aOldRegion );
+ else
+ pDev->SetClipRegion();
+ }
+ }
+ else
+ {
+ XubString aStr = rStr;
+ Size aTextSize(pDev->GetTextWidth( aStr ), pDev->GetTextHeight());
+
+ // Evt. Text kuerzen
+ if ( aTextSize.Width() > nWidth )
+ {
+ if ( nStyle & TEXT_DRAW_ENDELLIPSIS )
+ {
+ aStr = GetEllipsisString( pDev, rStr, nWidth, nStyle );
+ nStyle &= ~(TEXT_DRAW_CENTER | TEXT_DRAW_RIGHT);
+ nStyle |= TEXT_DRAW_LEFT;
+ aTextSize.Width() = pDev->GetTextWidth(aStr);
+ }
+ }
+ else
+ {
+ if ( aTextSize.Height() <= nHeight )
+ nStyle &= ~TEXT_DRAW_CLIP;
+ }
+
+ // Vertikales Alignment
+ if ( nStyle & TEXT_DRAW_RIGHT )
+ aPos.X() += nWidth-aTextSize.Width();
+ else if ( nStyle & TEXT_DRAW_CENTER )
+ aPos.X() += (nWidth-aTextSize.Width())/2;
+
+ // Font Alignment
+ if ( eAlign == ALIGN_BOTTOM )
+ aPos.Y() += aTextSize.Height();
+ else if ( eAlign == ALIGN_BASELINE )
+ aPos.Y() += pDev->GetFontMetric().GetAscent();
+
+ if ( nStyle & TEXT_DRAW_BOTTOM )
+ aPos.Y() += nHeight-aTextSize.Height();
+ else if ( nStyle & TEXT_DRAW_VCENTER )
+ aPos.Y() += (nHeight-aTextSize.Height())/2;
+
+ if ( nStyle & TEXT_DRAW_CLIP )
+ {
+ BOOL bIsClipRegion = pDev->IsClipRegion();
+ if ( bIsClipRegion )
+ {
+ Region aOldRegion = pDev->GetClipRegion();
+ pDev->IntersectClipRegion( rRect );
+ pDev->DrawText( aPos, aStr );
+ pDev->SetClipRegion( aOldRegion );
+ }
+ else
+ {
+ Region aRegion( rRect );
+ pDev->SetClipRegion( aRegion );
+ pDev->DrawText( aPos, aStr );
+ pDev->SetClipRegion();
+ }
+ }
+ else
+ pDev->DrawText( aPos, aStr );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+
+//--------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+//--------------------------------------------------------------------------
+
+
+#define DRAWTEXT_FLAGS (TEXT_DRAW_CENTER|TEXT_DRAW_TOP|TEXT_DRAW_ENDELLIPSIS|\
+ TEXT_DRAW_CLIP|TEXT_DRAW_MULTILINE|TEXT_DRAW_WORDBREAK)
+
+
+class ImpIcnCursor
+{
+ SvImpIconView* pView;
+ SvPtrarr* pColumns;
+ SvPtrarr* pRows;
+ BOOL* pGridMap;
+ long nGridDX, nGridDY;
+ long nGridCols, nGridRows;
+ long nCols;
+ long nRows;
+ short nDeltaWidth;
+ short nDeltaHeight;
+ SvLBoxEntry* pCurEntry;
+ void SetDeltas();
+ void ImplCreate();
+ void Create() { if( !pColumns ) ImplCreate(); }
+
+ USHORT GetSortListPos( SvPtrarr* pList, long nValue, int bVertical);
+ SvLBoxEntry* SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,USHORT nPref,
+ BOOL bDown, BOOL bSimple );
+ SvLBoxEntry* SearchRow(USHORT nRow,USHORT nRight,USHORT nLeft,USHORT nPref,
+ BOOL bRight, BOOL bSimple );
+
+ void ExpandGrid();
+ void CreateGridMap();
+ // Rueckgabe FALSE: Eintrag liegt nicht in der GridMap. rGridx,y werden
+ // dann an nGridCols, nGridRows geclippt
+ BOOL GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const;
+ void SetGridUsed( USHORT nDX, USHORT nDY, BOOL bUsed )
+ {
+ pGridMap[ (nDY * nGridCols) + nDX ] = bUsed;
+ }
+ BOOL IsGridUsed( USHORT nDX, USHORT nDY )
+ {
+ return pGridMap[ (nDY * nGridCols) + nDX ];
+ }
+public:
+ ImpIcnCursor( SvImpIconView* pOwner );
+ ~ImpIcnCursor();
+ void Clear( BOOL bGridToo = TRUE );
+
+ // fuer Cursortravelling usw.
+ SvLBoxEntry* GoLeftRight( SvLBoxEntry*, BOOL bRight );
+ SvLBoxEntry* GoUpDown( SvLBoxEntry*, BOOL bDown );
+
+ // Rueckgaebe: FALSE == Das leere Rect steht hinter dem letzten
+ // Eintrag; d.h. beim naechsten Einfuegen ergibt sich das naechste
+ // leere Rechteck durch Addition. Hinweis: Das Rechteck kann dann
+ // ausserhalb des View-Space liegen
+ BOOL FindEmptyGridRect( Rectangle& rRect );
+
+ // Erzeugt fuer jede Zeile (Hoehe=nGridDY) eine nach BoundRect.Left()
+ // sortierte Liste der Eintraege, die in ihr stehen. Eine Liste kann
+ // leer sein. Die Listen gehen in das Eigentum des Rufenden ueber und
+ // muessen mit DestroyGridAdjustData geloescht werden
+ void CreateGridAjustData( SvPtrarr& pLists, SvLBoxEntry* pRow=0);
+ static void DestroyGridAdjustData( SvPtrarr& rLists );
+ void SetGridUsed( const Rectangle&, BOOL bUsed = TRUE );
+};
+
+
+
+
+SvImpIconView::SvImpIconView( SvIconView* pCurView, SvLBoxTreeList* pTree,
+ WinBits nWinStyle ) :
+ aVerSBar( pCurView, WB_DRAG | WB_VSCROLL ),
+ aHorSBar( pCurView, WB_DRAG | WB_HSCROLL )
+{
+ pView = pCurView;
+ pModel = pTree;
+ pCurParent = 0;
+ pZOrderList = new SvPtrarr;
+ SetWindowBits( nWinStyle );
+ nHorDist = 0;
+ nVerDist = 0;
+ nFlags = 0;
+ nCurUserEvent = 0;
+ nMaxVirtWidth = 200;
+ pDDRefEntry = 0;
+ pDDDev = 0;
+ pDDBufDev = 0;
+ pDDTempDev = 0;
+ eTextMode = ShowTextShort;
+ pImpCursor = new ImpIcnCursor( this );
+
+ aVerSBar.SetScrollHdl( LINK( this, SvImpIconView, ScrollUpDownHdl ) );
+ aHorSBar.SetScrollHdl( LINK( this, SvImpIconView, ScrollLeftRightHdl ) );
+ nHorSBarHeight = aHorSBar.GetSizePixel().Height();
+ nVerSBarWidth = aVerSBar.GetSizePixel().Width();
+
+ aMouseMoveTimer.SetTimeout( 20 );
+ aMouseMoveTimer.SetTimeoutHdl(LINK(this,SvImpIconView,MouseMoveTimeoutHdl));
+
+ aEditTimer.SetTimeout( 800 );
+ aEditTimer.SetTimeoutHdl(LINK(this,SvImpIconView,EditTimeoutHdl));
+
+ Clear( TRUE );
+}
+
+SvImpIconView::~SvImpIconView()
+{
+ StopEditTimer();
+ CancelUserEvent();
+ delete pZOrderList;
+ delete pImpCursor;
+ delete pDDDev;
+ delete pDDBufDev;
+ delete pDDTempDev;
+ ClearSelectedRectList();
+}
+
+void SvImpIconView::Clear( BOOL bInCtor )
+{
+ StopEditTimer();
+ CancelUserEvent();
+ nMaxBmpWidth = 0;
+ nMaxBmpHeight = 0;
+ nMaxTextWidth = 0;
+ bMustRecalcBoundingRects = FALSE;
+ nMaxBoundHeight = 0;
+
+ //XXX
+ nFlags |= F_GRID_INSERT;
+ nFlags &= ~F_PAINTED;
+ SetNextEntryPos( Point( LROFFS_WINBORDER, TBOFFS_WINBORDER ) );
+ pCursor = 0;
+ if( !bInCtor )
+ {
+ pImpCursor->Clear();
+ aVirtOutputSize.Width() = 0;
+ aVirtOutputSize.Height() = 0;
+ pZOrderList->Remove(0,pZOrderList->Count());
+ MapMode aMapMode( pView->GetMapMode());
+ aMapMode.SetOrigin( Point() );
+ pView->SetMapMode( aMapMode );
+ if( pView->IsUpdateMode() )
+ pView->Invalidate();
+ }
+ AdjustScrollBars();
+}
+
+void SvImpIconView::SetWindowBits( WinBits nWinStyle )
+{
+ nWinBits = nWinStyle;
+ nViewMode = VIEWMODE_TEXT;
+ if( nWinStyle & WB_NAME )
+ nViewMode = VIEWMODE_NAME;
+ if( nWinStyle & WB_ICON )
+ nViewMode = VIEWMODE_ICON;
+}
+
+
+IMPL_LINK( SvImpIconView, ScrollUpDownHdl, ScrollBar *, pScrollBar )
+{
+ pView->EndEditing( TRUE );
+ // Pfeil hoch: delta=-1; Pfeil runter: delta=+1
+ Scroll( 0, pScrollBar->GetDelta(), TRUE );
+ return 0;
+}
+
+IMPL_LINK( SvImpIconView, ScrollLeftRightHdl, ScrollBar *, pScrollBar )
+{
+ pView->EndEditing( TRUE );
+ // Pfeil links: delta=-1; Pfeil rechts: delta=+1
+ Scroll( pScrollBar->GetDelta(), 0, TRUE );
+ return 0;
+}
+
+void SvImpIconView::ChangedFont()
+{
+ StopEditTimer();
+ ImpArrange();
+}
+
+
+void SvImpIconView::CheckAllSizes()
+{
+ nMaxTextWidth = 0;
+ nMaxBmpWidth = 0;
+ nMaxBmpHeight = 0;
+ SvLBoxEntry* pEntry = pModel->First();
+ while( pEntry )
+ {
+ CheckSizes( pEntry );
+ pEntry = pModel->Next( pEntry );
+ }
+}
+
+void SvImpIconView::CheckSizes( SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData )
+{
+ Size aSize;
+
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(pEntry);
+
+ SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ if( pStringItem )
+ {
+ aSize = GetItemSize( pView, pEntry, pStringItem, pViewData );
+ if( aSize.Width() > nMaxTextWidth )
+ {
+ nMaxTextWidth = aSize.Width();
+ if( !(nFlags & F_GRIDMODE ) )
+ bMustRecalcBoundingRects = TRUE;
+ }
+ }
+ SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ if( pBmpItem )
+ {
+ aSize = GetItemSize( pView, pEntry, pBmpItem, pViewData );
+ if( aSize.Width() > nMaxBmpWidth )
+ {
+ nMaxBmpWidth = aSize.Width();
+ nMaxBmpWidth += (2*LROFFS_ICON);
+ if( !(nFlags & F_GRIDMODE ) )
+ bMustRecalcBoundingRects = TRUE;
+ }
+ if( aSize.Height() > nMaxBmpHeight )
+ {
+ nMaxBmpHeight = aSize.Height();
+ nMaxBmpHeight += (2*TBOFFS_ICON);;
+ if( !(nFlags & F_GRIDMODE ) )
+ bMustRecalcBoundingRects = TRUE;
+ }
+ }
+}
+
+void SvImpIconView::EntryInserted( SvLBoxEntry* pEntry )
+{
+ if( pModel->GetParent(pEntry) == pCurParent )
+ {
+ StopEditTimer();
+ DBG_ASSERT(pZOrderList->GetPos(pEntry)==0xffff,"EntryInserted:ZOrder?");
+ pZOrderList->Insert( pEntry, pZOrderList->Count() );
+ if( nFlags & F_GRIDMODE )
+ pImpCursor->Clear( FALSE );
+ else
+ pImpCursor->Clear( TRUE );
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ CheckSizes( pEntry, pViewData );
+ if( pView->IsUpdateMode() )
+ {
+ FindBoundingRect( pEntry, pViewData );
+ PaintEntry( pEntry, pViewData );
+ }
+ else
+ InvalidateBoundingRect( pViewData->aRect );
+ }
+}
+
+void SvImpIconView::RemovingEntry( SvLBoxEntry* pEntry )
+{
+ if( pModel->GetParent(pEntry) == pCurParent)
+ {
+ StopEditTimer();
+ DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"RemovingEntry:ZOrder?");
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ if( IsBoundingRectValid( pViewData->aRect ) )
+ {
+ // bei gueltigem Bounding-Rect muss in EntryRemoved eine
+ // Sonderbehandlung erfolgen
+ nFlags |= F_ENTRY_REMOVED;
+ pView->Invalidate( pViewData->aRect );
+ }
+ if( pEntry == pCursor )
+ {
+ SvLBoxEntry* pNewCursor = GetNewCursor();
+ ShowCursor( FALSE );
+ pCursor = 0; // damit er nicht deselektiert wird
+ SetCursor( pNewCursor );
+ }
+ USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ pZOrderList->Remove( nPos, 1 );
+ pImpCursor->Clear();
+ }
+}
+
+void SvImpIconView::EntryRemoved()
+{
+ if( (nFlags & (F_ENTRY_REMOVED | F_PAINTED)) == (F_ENTRY_REMOVED | F_PAINTED))
+ {
+ // Ein Eintrag mit gueltigem BoundRect wurde geloescht und wir
+ // haben schon mal gepaintet. In diesem Fall muessen wir die
+ // Position des naechsten Eintrags, der eingefuegt wird oder noch
+ // kein gueltiges BoundRect hat, "suchen" d.h. ein "Loch" in
+ // der View auffuellen.
+ nFlags &= ~( F_ENTRY_REMOVED | F_GRID_INSERT );
+ }
+}
+
+
+void SvImpIconView::MovingEntry( SvLBoxEntry* pEntry )
+{
+ DBG_ASSERT(pEntry,"MovingEntry: 0!");
+ pNextCursor = 0;
+ StopEditTimer();
+ if( pModel->GetParent(pEntry) == pCurParent )
+ {
+ DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"MovingEntry:ZOrder?");
+ nFlags |= F_MOVING_SIBLING;
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ if( IsBoundingRectValid( pViewData->aRect ) )
+ pView->Invalidate( pViewData->aRect );
+ // falls Eintrag seinen Parent wechselt vorsichtshalber
+ // die neue Cursorposition berechnen
+ if( pEntry == pCursor )
+ pNextCursor = GetNewCursor();
+ pImpCursor->Clear();
+ }
+}
+
+
+void SvImpIconView::EntryMoved( SvLBoxEntry* pEntry )
+{
+ ShowCursor( FALSE );
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ if( pModel->GetParent(pEntry)==pCurParent )
+ {
+ if( nFlags & F_MOVING_SIBLING )
+ {
+ // die Neu-Positionierung eines Eintrags bei D&D innerhalb
+ // einer IconView findet bereits in NotifyMoving statt
+ // (MovingEntry/EntryMoved wird dann nicht mehr gerufen)
+ ToTop( pEntry );
+ }
+ else
+ {
+ pImpCursor->Clear();
+ pZOrderList->Insert( pEntry, pZOrderList->Count() );
+ DBG_ASSERT(pZOrderList->Count()==pModel->GetChildCount(pCurParent),"EntryMoved:Bad zorder count");
+ FindBoundingRect( pEntry, pViewData );
+ }
+ PaintEntry( pEntry, pViewData );
+ }
+ else
+ {
+ if( pEntry == pCursor )
+ {
+ DBG_ASSERT(pNextCursor,"EntryMoved: Next cursor bad");
+ SetCursor( pNextCursor );
+ }
+ pImpCursor->Clear();
+ USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ pZOrderList->Remove( nPos, 1 );
+ pView->Select( pEntry, FALSE );
+ // wenn er nochmal in dieser View auftaucht, muss sein
+ // Bounding-Rect neu berechnet werden
+ InvalidateBoundingRect( pViewData->aRect );
+ }
+ nFlags &= (~F_MOVING_SIBLING);
+}
+
+void SvImpIconView::TreeInserted( SvLBoxEntry* pEntry )
+{
+ EntryMoved( pEntry ); // vorlaeufig
+}
+
+void SvImpIconView::EntryExpanded( SvLBoxEntry* )
+{
+}
+
+void SvImpIconView::EntryCollapsed( SvLBoxEntry*)
+{
+}
+
+void SvImpIconView::CollapsingEntry( SvLBoxEntry* )
+{
+}
+
+void SvImpIconView::EntrySelected( SvLBoxEntry* pEntry, BOOL bSelect )
+{
+ if( pModel->GetParent(pEntry) != pCurParent )
+ return;
+
+ // bei SingleSelection dafuer sorgen, dass der Cursor immer
+ // auf dem (einzigen) selektierten Eintrag steht
+ if( bSelect && pCursor &&
+ pView->GetSelectionMode() == SINGLE_SELECTION &&
+ pEntry != pCursor )
+ {
+ SetCursor( pEntry );
+ DBG_ASSERT(pView->GetSelectionCount()==1,"selection count?")
+ }
+ // bei Gummibandselektion ist uns das zu teuer
+ if( !(nFlags & F_RUBBERING ))
+ ToTop( pEntry );
+ if( pView->IsUpdateMode() )
+ {
+ if( pEntry == pCursor )
+ ShowCursor( FALSE );
+ if( nFlags & F_RUBBERING )
+ PaintEntry( pEntry );
+ else
+ pView->Invalidate( GetBoundingRect( pEntry ) );
+ if( pEntry == pCursor )
+ ShowCursor( TRUE );
+ }
+}
+
+void SvImpIconView::SetNextEntryPos(const Point& rPos)
+{
+ aPrevBoundRect.SetPos( rPos );
+ aPrevBoundRect.Right() = LONG_MAX; // dont know
+}
+
+Point SvImpIconView::FindNextEntryPos( const Size& rBoundSize )
+{
+ if( nFlags & F_GRIDMODE )
+ {
+ if( nFlags & F_GRID_INSERT )
+ {
+ if( aPrevBoundRect.Right() != LONG_MAX )
+ {
+ // passt der naechste Entry noch in die Zeile ?
+ long nNextWidth = aPrevBoundRect.Right() + nGridDX + LROFFS_WINBORDER;
+ if( nNextWidth > aVirtOutputSize.Width() )
+ {
+ // darf aVirtOutputSize verbreitert werden ?
+ if( nNextWidth < nMaxVirtWidth )
+ {
+ // verbreitern & in Zeile aufnehmen
+ aPrevBoundRect.Left() += nGridDX;
+ }
+ else
+ {
+ // erhoehen & neue Zeile beginnen
+ aPrevBoundRect.Top() += nGridDY;
+ aPrevBoundRect.Left() = LROFFS_WINBORDER;
+ }
+ }
+ else
+ {
+ // in die Zeile aufnehmen
+ aPrevBoundRect.Left() += nGridDX;
+ }
+ }
+ aPrevBoundRect.SetSize( Size( nGridDX, nGridDY ) );
+ }
+ else
+ {
+ if( !pImpCursor->FindEmptyGridRect( aPrevBoundRect ) )
+ {
+ // mitten in den Entries gibts keine Loecher mehr,
+ // wir koennen also wieder ins "Fast Insert" springen
+ nFlags |= F_GRID_INSERT;
+ }
+ }
+ }
+ else
+ {
+ if( aPrevBoundRect.Right() != LONG_MAX )
+ {
+ // passt der naechste Entry noch in die Zeile ?
+ long nNextWidth=aPrevBoundRect.Right()+rBoundSize.Width()+LROFFS_BOUND+nHorDist;
+ if( nNextWidth > aVirtOutputSize.Width() )
+ {
+ // darf aVirtOutputSize verbreitert werden ?
+ if( nNextWidth < nMaxVirtWidth )
+ {
+ // verbreitern & in Zeile aufnehmen
+ aPrevBoundRect.SetPos( aPrevBoundRect.TopRight() );
+ aPrevBoundRect.Left() += nHorDist;
+ }
+ else
+ {
+ // erhoehen & neue Zeile beginnen
+ aPrevBoundRect.Top() += nMaxBoundHeight + nVerDist + TBOFFS_BOUND;
+ aPrevBoundRect.Left() = LROFFS_WINBORDER;
+ }
+ }
+ else
+ {
+ // in die Zeile aufnehmen
+ aPrevBoundRect.SetPos( aPrevBoundRect.TopRight() );
+ aPrevBoundRect.Left() += nHorDist;
+ }
+ }
+ aPrevBoundRect.SetSize( rBoundSize );
+ }
+ return aPrevBoundRect.TopLeft();
+}
+
+void SvImpIconView::ResetVirtSize()
+{
+ StopEditTimer();
+ aVirtOutputSize.Width() = 0;
+ aVirtOutputSize.Height() = 0;
+ BOOL bLockedEntryFound = FALSE;
+ nFlags &= (~F_GRID_INSERT);
+ SvLBoxEntry* pCur = pModel->FirstChild( pCurParent );
+ while( pCur )
+ {
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur);
+ if( pViewData->IsEntryPosLocked() )
+ {
+ // VirtSize u.a. anpassen
+ if( !IsBoundingRectValid( pViewData->aRect ) )
+ FindBoundingRect( pCur, pViewData );
+ else
+ AdjustVirtSize( pViewData->aRect );
+ bLockedEntryFound = TRUE;
+ }
+ else
+ InvalidateBoundingRect( pViewData->aRect );
+
+ pCur = pModel->NextSibling( pCur );
+ }
+ if( !bLockedEntryFound )
+ {
+ //XXX
+ nFlags |= F_GRID_INSERT;
+ }
+
+ SetNextEntryPos( Point( LROFFS_WINBORDER, TBOFFS_WINBORDER ) );
+ pImpCursor->Clear();
+}
+
+
+void SvImpIconView::AdjustVirtSize( const Rectangle& rRect )
+{
+ long nHeightOffs = 0;
+ long nWidthOffs = 0;
+
+ if( aVirtOutputSize.Width() < (rRect.Right()+LROFFS_WINBORDER) )
+ nWidthOffs = (rRect.Right()+LROFFS_WINBORDER) - aVirtOutputSize.Width();
+
+ if( aVirtOutputSize.Height() < (rRect.Bottom()+TBOFFS_WINBORDER) )
+ nHeightOffs = (rRect.Bottom()+TBOFFS_WINBORDER) - aVirtOutputSize.Height();
+
+ if( nWidthOffs || nHeightOffs )
+ {
+ Range aRange;
+ aVirtOutputSize.Width() += nWidthOffs;
+ aRange.Max() = aVirtOutputSize.Width();
+ aHorSBar.SetRange( aRange );
+
+ aVirtOutputSize.Height() += nHeightOffs;
+ aRange.Max() = aVirtOutputSize.Height();
+ aVerSBar.SetRange( aRange );
+
+ pImpCursor->Clear();
+ AdjustScrollBars();
+ }
+}
+
+void SvImpIconView::Arrange()
+{
+ nMaxVirtWidth = aOutputSize.Width();
+ ImpArrange();
+}
+
+void SvImpIconView::ImpArrange()
+{
+ StopEditTimer();
+ ShowCursor( FALSE );
+ ResetVirtSize();
+ bMustRecalcBoundingRects = FALSE;
+ MapMode aMapMode( pView->GetMapMode());
+ aMapMode.SetOrigin( Point() );
+ pView->SetMapMode( aMapMode );
+ CheckAllSizes();
+ RecalcAllBoundingRectsSmart();
+ pView->Invalidate();
+ ShowCursor( TRUE );
+}
+
+void SvImpIconView::Paint( const Rectangle& rRect )
+{
+ if( !pView->IsUpdateMode() )
+ return;
+
+#if defined(DBG_UTIL) && defined(OV_DRAWGRID)
+ if( nFlags & F_GRIDMODE )
+ {
+ Color aOldColor = pView->GetLineColor();
+ Color aNewColor( COL_BLACK );
+ pView->SetLineColor( aNewColor );
+ Point aOffs( pView->GetMapMode().GetOrigin());
+ Size aXSize( pView->GetOutputSizePixel() );
+ for( long nDX = nGridDX; nDX <= aXSize.Width(); nDX += nGridDX )
+ {
+ Point aStart( nDX+LROFFS_BOUND, 0 );
+ Point aEnd( nDX+LROFFS_BOUND, aXSize.Height());
+ aStart -= aOffs;
+ aEnd -= aOffs;
+ pView->DrawLine( aStart, aEnd );
+ }
+ for( long nDY = nGridDY; nDY <= aXSize.Height(); nDY += nGridDY )
+ {
+ Point aStart( 0, nDY+TBOFFS_BOUND );
+ Point aEnd( aXSize.Width(), nDY+TBOFFS_BOUND );
+ aStart -= aOffs;
+ aEnd -= aOffs;
+ pView->DrawLine( aStart, aEnd );
+ }
+ pView->SetLineColor( aOldColor );
+ }
+#endif
+ nFlags |= F_PAINTED;
+
+ if( !(pModel->HasChilds( pCurParent ) ))
+ return;
+ if( !pCursor )
+ pCursor = pModel->FirstChild( pCurParent );
+
+ USHORT nCount = pZOrderList->Count();
+ if( !nCount )
+ return;
+
+ SvPtrarr* pNewZOrderList = new SvPtrarr;
+ SvPtrarr* pPaintedEntries = new SvPtrarr;
+
+ USHORT nPos = 0;
+ while( nCount )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos ));
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ const Rectangle& rBoundRect = GetBoundingRect( pEntry, pViewData );
+ if( rRect.IsOver( rBoundRect ) )
+ {
+ PaintEntry( pEntry, rBoundRect.TopLeft(), pViewData );
+ // Eintraege, die neu gezeichnet werden, auf Top setzen
+ pPaintedEntries->Insert( pEntry, pPaintedEntries->Count() );
+ }
+ else
+ pNewZOrderList->Insert( pEntry, pNewZOrderList->Count() );
+
+ nCount--;
+ nPos++;
+ }
+ delete pZOrderList;
+ pZOrderList = pNewZOrderList;
+ nCount = pPaintedEntries->Count();
+ if( nCount )
+ {
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ pZOrderList->Insert( pPaintedEntries->GetObject( nCur ),pZOrderList->Count());
+ }
+ delete pPaintedEntries;
+
+ Rectangle aRect;
+ if( GetResizeRect( aRect ))
+ PaintResizeRect( aRect );
+}
+
+BOOL SvImpIconView::GetResizeRect( Rectangle& rRect )
+{
+ if( aHorSBar.IsVisible() && aVerSBar.IsVisible() )
+ {
+ const MapMode& rMapMode = pView->GetMapMode();
+ Point aOrigin( rMapMode.GetOrigin());
+ aOrigin *= -1;
+ aOrigin.X() += aOutputSize.Width();
+ aOrigin.Y() += aOutputSize.Height();
+ rRect.SetPos( aOrigin );
+ rRect.SetSize( Size( nVerSBarWidth, nHorSBarHeight));
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void SvImpIconView::PaintResizeRect( const Rectangle& rRect )
+{
+ const StyleSettings& rStyleSettings = pView->GetSettings().GetStyleSettings();
+ Color aNewColor = rStyleSettings.GetFaceColor();
+ Color aOldColor = pView->GetFillColor();
+ pView->SetFillColor( aNewColor );
+ pView->DrawRect( rRect );
+ pView->SetFillColor( aOldColor );
+}
+
+void SvImpIconView::RepaintSelectionItems()
+{
+ DBG_ERROR("RepaintSelectionItems");
+ pView->Invalidate(); // vorlaeufig
+}
+
+SvLBoxItem* SvImpIconView::GetItem( SvLBoxEntry* pEntry,
+ const Point& rAbsPos )
+{
+ Rectangle aRect;
+ SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ if( pStringItem )
+ {
+ aRect = CalcTextRect( pEntry, pStringItem );
+ if( aRect.IsInside( rAbsPos ) )
+ return pStringItem;
+ }
+ SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ if( pBmpItem )
+ {
+ aRect = CalcBmpRect( pEntry );
+ if( aRect.IsInside( rAbsPos ) )
+ return pBmpItem;
+ }
+ return 0;
+}
+
+void SvImpIconView::CalcDocPos( Point& aMaeuschenPos )
+{
+ aMaeuschenPos -= pView->GetMapMode().GetOrigin();
+}
+
+void SvImpIconView::MouseButtonDown( const MouseEvent& rMEvt)
+{
+ StopEditTimer();
+ pView->GrabFocus();
+ Point aDocPos( rMEvt.GetPosPixel() );
+ if(aDocPos.X()>=aOutputSize.Width() || aDocPos.Y()>=aOutputSize.Height())
+ return;
+ CalcDocPos( aDocPos );
+ SvLBoxEntry* pEntry = GetEntry( aDocPos );
+ if( !pEntry )
+ {
+ if( pView->GetSelectionMode() != SINGLE_SELECTION )
+ {
+ if( !rMEvt.IsMod1() ) // Ctrl
+ {
+ pView->SelectAll( FALSE );
+ ClearSelectedRectList();
+ }
+ else
+ nFlags |= F_ADD_MODE;
+ nFlags |= F_RUBBERING;
+ aCurSelectionRect.SetPos( aDocPos );
+ pView->CaptureMouse();
+ }
+ return;
+ }
+
+ BOOL bSelected = pView->IsSelected( pEntry );
+ BOOL bEditingEnabled = pView->IsInplaceEditingEnabled();
+
+ if( rMEvt.GetClicks() == 2 )
+ {
+ DeselectAllBut( pEntry );
+ pView->pHdlEntry = pEntry;
+ pView->DoubleClickHdl();
+ }
+ else
+ {
+ // Inplace-Editing ?
+ if( rMEvt.IsMod2() ) // Alt?
+ {
+ if( bEditingEnabled )
+ {
+ SvLBoxItem* pItem = GetItem(pEntry,aDocPos);
+ if( pItem )
+ pView->EditingRequest( pEntry, pItem, aDocPos);
+ }
+ }
+ else if( pView->GetSelectionMode() == SINGLE_SELECTION )
+ {
+ DeselectAllBut( pEntry );
+ SetCursor( pEntry );
+ pView->Select( pEntry, TRUE );
+ if( bEditingEnabled && bSelected && !rMEvt.GetModifier() &&
+ rMEvt.IsLeft() && IsTextHit( pEntry, aDocPos ) )
+ {
+ nFlags |= F_START_EDITTIMER_IN_MOUSEUP;
+ }
+ }
+ else
+ {
+ if( !rMEvt.GetModifier() )
+ {
+ if( !bSelected )
+ {
+ DeselectAllBut( pEntry );
+ SetCursor( pEntry );
+ pView->Select( pEntry, TRUE );
+ }
+ else
+ {
+ // erst im Up deselektieren, falls Move per D&D!
+ nFlags |= F_DOWN_DESELECT;
+ if( bEditingEnabled && IsTextHit( pEntry, aDocPos ) &&
+ rMEvt.IsLeft())
+ {
+ nFlags |= F_START_EDITTIMER_IN_MOUSEUP;
+ }
+ }
+ }
+ else if( rMEvt.IsMod1() )
+ nFlags |= F_DOWN_CTRL;
+ }
+ }
+}
+
+void SvImpIconView::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ aMouseMoveTimer.Stop();
+ pView->ReleaseMouse();
+ // HACK, da Einar noch nicht PrepareCommandEvent aufruft
+ if( rMEvt.IsRight() && (nFlags & (F_DOWN_CTRL | F_DOWN_DESELECT) ))
+ nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
+
+ if( nFlags & F_RUBBERING )
+ {
+ aMouseMoveTimer.Stop();
+ AddSelectedRect( aCurSelectionRect );
+ HideSelectionRect();
+ nFlags &= ~(F_RUBBERING | F_ADD_MODE);
+ }
+
+ SvLBoxEntry* pEntry = pView->GetEntry( rMEvt.GetPosPixel(), TRUE );
+ if( pEntry )
+ {
+ if( nFlags & F_DOWN_CTRL )
+ {
+ // Ctrl & MultiSelection
+ ToggleSelection( pEntry );
+ SetCursor( pEntry );
+ }
+ else if( nFlags & F_DOWN_DESELECT )
+ {
+ DeselectAllBut( pEntry );
+ SetCursor( pEntry );
+ pView->Select( pEntry, TRUE );
+ }
+ }
+
+ nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
+ if( nFlags & F_START_EDITTIMER_IN_MOUSEUP )
+ {
+ StartEditTimer();
+ nFlags &= ~F_START_EDITTIMER_IN_MOUSEUP;
+ }
+}
+
+void SvImpIconView::MouseMove( const MouseEvent& rMEvt )
+{
+ if( nFlags & F_RUBBERING )
+ {
+ const Point& rPosPixel = rMEvt.GetPosPixel();
+ if( !aMouseMoveTimer.IsActive() )
+ {
+ aMouseMoveEvent = rMEvt;
+ aMouseMoveTimer.Start();
+ // ausserhalb des Fensters liegende Move-Events muessen
+ // vom Timer kommen, damit die Scrollgeschwindigkeit
+ // unabhaengig von Mausbewegungen ist.
+ if( rPosPixel.X() < 0 || rPosPixel.Y() < 0 )
+ return;
+ const Size& rSize = pView->GetOutputSizePixel();
+ if( rPosPixel.X() > rSize.Width() || rPosPixel.Y() > rSize.Height())
+ return;
+ }
+
+ if( &rMEvt != &aMouseMoveEvent )
+ aMouseMoveEvent = rMEvt;
+
+ long nScrollDX, nScrollDY;
+
+ CalcScrollOffsets(rMEvt.GetPosPixel(),nScrollDX,nScrollDY,FALSE );
+ BOOL bSelRectHidden = FALSE;
+ if( nScrollDX || nScrollDY )
+ {
+ HideSelectionRect();
+ bSelRectHidden = TRUE;
+ pView->Scroll( nScrollDX, nScrollDY );
+ }
+ Point aDocPos( rMEvt.GetPosPixel() );
+ aDocPos = pView->PixelToLogic( aDocPos );
+ Rectangle aRect( aCurSelectionRect.TopLeft(), aDocPos );
+ if( aRect != aCurSelectionRect )
+ {
+ HideSelectionRect();
+ bSelRectHidden = TRUE;
+ BOOL bAdd = (nFlags & F_ADD_MODE) ? TRUE : FALSE;
+ SelectRect( aRect, bAdd, &aSelectedRectList );
+ }
+ if( bSelRectHidden )
+ DrawSelectionRect( aRect );
+ }
+}
+
+BOOL SvImpIconView::KeyInput( const KeyEvent& rKEvt )
+{
+ StopEditTimer();
+ BOOL bKeyUsed = TRUE;
+ BOOL bMod1 = rKEvt.GetKeyCode().IsMod1();
+ BOOL bInAddMode = (BOOL)((nFlags & F_ADD_MODE) != 0);
+ int bDeselAll = (pView->GetSelectionMode() != SINGLE_SELECTION) &&
+ !bInAddMode;
+ SvLBoxEntry* pNewCursor;
+ USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ switch( nCode )
+ {
+ case KEY_UP:
+ if( pCursor )
+ {
+ MakeVisible( pCursor );
+ pNewCursor = pImpCursor->GoUpDown(pCursor,FALSE);
+ if( pNewCursor )
+ {
+ if( bDeselAll )
+ pView->SelectAll( FALSE );
+ ShowCursor( FALSE );
+ MakeVisible( pNewCursor );
+ SetCursor( pNewCursor );
+ if( !bInAddMode )
+ pView->Select( pCursor, TRUE );
+ }
+ else
+ {
+ Rectangle aRect( GetBoundingRect( pCursor ) );
+ if( aRect.Top())
+ {
+ aRect.Bottom() -= aRect.Top();
+ aRect.Top() = 0;
+ MakeVisible( aRect );
+ }
+ }
+ }
+ break;
+
+ case KEY_DOWN:
+ if( pCursor )
+ {
+ pNewCursor=pImpCursor->GoUpDown( pCursor,TRUE );
+ if( pNewCursor )
+ {
+ MakeVisible( pCursor );
+ if( bDeselAll )
+ pView->SelectAll( FALSE );
+ ShowCursor( FALSE );
+ MakeVisible( pNewCursor );
+ SetCursor( pNewCursor );
+ if( !bInAddMode )
+ pView->Select( pCursor, TRUE );
+ }
+ }
+ break;
+
+ case KEY_RIGHT:
+ if( pCursor )
+ {
+ pNewCursor=pImpCursor->GoLeftRight(pCursor,TRUE );
+ if( pNewCursor )
+ {
+ MakeVisible( pCursor );
+ if( bDeselAll )
+ pView->SelectAll( FALSE );
+ ShowCursor( FALSE );
+ MakeVisible( pNewCursor );
+ SetCursor( pNewCursor );
+ if( !bInAddMode )
+ pView->Select( pCursor, TRUE );
+ }
+ }
+ break;
+
+ case KEY_LEFT:
+ if( pCursor )
+ {
+ MakeVisible( pCursor );
+ pNewCursor = pImpCursor->GoLeftRight(pCursor,FALSE );
+ if( pNewCursor )
+ {
+ if( bDeselAll )
+ pView->SelectAll( FALSE );
+ ShowCursor( FALSE );
+ MakeVisible( pNewCursor );
+ SetCursor( pNewCursor );
+ if( !bInAddMode )
+ pView->Select( pCursor, TRUE );
+ }
+ else
+ {
+ Rectangle aRect( GetBoundingRect(pCursor));
+ if( aRect.Left() )
+ {
+ aRect.Right() -= aRect.Left();
+ aRect.Left() = 0;
+ MakeVisible( aRect );
+ }
+ }
+ }
+ break;
+
+ case KEY_ESCAPE:
+ if( nFlags & F_RUBBERING )
+ {
+ HideSelectionRect();
+ pView->SelectAll( FALSE );
+ nFlags &= ~F_RUBBERING;
+ }
+ break;
+
+ case KEY_F8:
+ if( rKEvt.GetKeyCode().IsShift() )
+ {
+ if( nFlags & F_ADD_MODE )
+ nFlags &= (~F_ADD_MODE);
+ else
+ nFlags |= F_ADD_MODE;
+ }
+ break;
+
+#ifdef OS2
+ case KEY_F9:
+ if( rKEvt.GetKeyCode().IsShift() )
+ {
+ if( pCursor && pView->IsInplaceEditingEnabled() )
+ pView->EditEntry( pCursor );
+ }
+ break;
+#endif
+
+ case KEY_SPACE:
+ if( pCursor )
+ {
+ ToggleSelection( pCursor );
+ }
+ break;
+
+
+ case KEY_PAGEDOWN:
+ break;
+ case KEY_PAGEUP:
+ break;
+
+ case KEY_ADD:
+ case KEY_DIVIDE :
+ if( bMod1 )
+ pView->SelectAll( TRUE );
+ break;
+
+ case KEY_SUBTRACT:
+ case KEY_COMMA :
+ if( bMod1 )
+ pView->SelectAll( FALSE );
+ break;
+
+ case KEY_RETURN:
+ if( bMod1 )
+ {
+ if( pCursor && pView->IsInplaceEditingEnabled() )
+ pView->EditEntry( pCursor );
+ }
+ break;
+
+ default:
+ bKeyUsed = FALSE;
+
+ }
+ return bKeyUsed;
+}
+
+
+void SvImpIconView::PositionScrollBars( long nRealWidth, long nRealHeight )
+{
+ // hor scrollbar
+ Point aPos( 0, nRealHeight );
+ aPos.Y() -= nHorSBarHeight;
+
+#ifdef WIN
+ // vom linken und unteren Rand ein Pixel abschneiden
+ aPos.Y()++;
+ aPos.X()--;
+#endif
+#ifdef OS2
+ aPos.Y()++;
+#endif
+ if( aHorSBar.GetPosPixel() != aPos )
+ aHorSBar.SetPosPixel( aPos );
+
+ // ver scrollbar
+ aPos.X() = nRealWidth; aPos.Y() = 0;
+ aPos.X() -= nVerSBarWidth;
+
+#if defined(WIN) || defined(WNT)
+ aPos.X()++;
+ aPos.Y()--;
+#endif
+
+#ifdef OS2
+ aPos.Y()--;
+ aPos.X()++;
+#endif
+
+#ifdef MAC
+ aPos.Y()--;
+ aPos.X()++;
+#endif
+ if( aVerSBar.GetPosPixel() != aPos )
+ aVerSBar.SetPosPixel( aPos );
+}
+
+
+
+void SvImpIconView::AdjustScrollBars( BOOL bVirtSizeGrowedOnly )
+{
+ long nVirtHeight = aVirtOutputSize.Height();
+ long nVirtWidth = aVirtOutputSize.Width();
+
+ Size aOSize( pView->Control::GetOutputSizePixel() );
+ long nRealHeight = aOSize.Height();
+ long nRealWidth = aOSize.Width();
+
+ PositionScrollBars( nRealWidth, nRealHeight );
+
+ const MapMode& rMapMode = pView->GetMapMode();
+ Point aOrigin( rMapMode.GetOrigin() );
+
+ long nVisibleWidth;
+ if( nRealWidth > nVirtWidth )
+ nVisibleWidth = nVirtWidth + aOrigin.X();
+ else
+ nVisibleWidth = nRealWidth;
+
+ long nVisibleHeight;
+ if( nRealHeight > nVirtHeight )
+ nVisibleHeight = nVirtHeight + aOrigin.Y();
+ else
+ nVisibleHeight = nRealHeight;
+
+ int bVerSBar = pView->nWindowStyle & WB_VSCROLL;
+ int bHorSBar = pView->nWindowStyle & WB_HSCROLL;
+
+ USHORT nResult = 0;
+ if( nVirtHeight )
+ {
+ // activate ver scrollbar ?
+ if( bVerSBar || ( nVirtHeight > nVisibleHeight) )
+ {
+ nResult = 0x0001;
+ nRealWidth -= nVerSBarWidth;
+
+ if( nRealWidth > nVirtWidth )
+ nVisibleWidth = nVirtWidth + aOrigin.X();
+ else
+ nVisibleWidth = nRealWidth;
+
+ nFlags |= F_HOR_SBARSIZE_WITH_VBAR;
+ }
+ // activate hor scrollbar ?
+ if( bHorSBar || (nVirtWidth > nVisibleWidth) )
+ {
+ nResult |= 0x0002;
+ nRealHeight -= nHorSBarHeight;
+
+ if( nRealHeight > nVirtHeight )
+ nVisibleHeight = nVirtHeight + aOrigin.Y();
+ else
+ nVisibleHeight = nRealHeight;
+
+ // brauchen wir jetzt doch eine senkrechte Scrollbar ?
+ if( !(nResult & 0x0001) && // nur wenn nicht schon da
+ ( (nVirtHeight > nVisibleHeight) || bVerSBar) )
+ {
+ nResult = 3; // both are active
+ nRealWidth -= nVerSBarWidth;
+
+ if( nRealWidth > nVirtWidth )
+ nVisibleWidth = nVirtWidth + aOrigin.X();
+ else
+ nVisibleWidth = nRealWidth;
+
+ nFlags |= F_VER_SBARSIZE_WITH_HBAR;
+ }
+ }
+ }
+
+ // size ver scrollbar
+ long nThumb = aVerSBar.GetThumbPos();
+ Size aSize( nVerSBarWidth, nRealHeight );
+#if defined(WIN) || defined(WNT)
+ aSize.Height() += 2;
+#endif
+#ifdef OS2
+ aSize.Height() += 3;
+#endif
+#ifdef MAC
+ aSize.Height() += 2;
+#endif
+ if( aSize != aVerSBar.GetSizePixel() )
+ aVerSBar.SetSizePixel( aSize );
+ aVerSBar.SetVisibleSize( nVisibleHeight );
+ aVerSBar.SetPageSize( (nVisibleHeight*75)/100 );
+ if( nResult & 0x0001 )
+ {
+ aVerSBar.SetThumbPos( nThumb );
+ aVerSBar.Show();
+ }
+ else
+ {
+ aVerSBar.SetThumbPos( 0 );
+ aVerSBar.Hide();
+ }
+
+ // size hor scrollbar
+ nThumb = aHorSBar.GetThumbPos();
+ aSize.Width() = nRealWidth;
+ aSize.Height() = nHorSBarHeight;
+#if defined(WIN) || defined(WNT)
+ aSize.Width()++;
+#endif
+#ifdef OS2
+ aSize.Width() += 3;
+ if( nResult & 0x0001 ) // vertikale Scrollbar ?
+ aSize.Width()--;
+#endif
+#if defined(WIN) || defined(WNT)
+ if( nResult & 0x0001 ) // vertikale Scrollbar ?
+ {
+ aSize.Width()++;
+ nRealWidth++;
+ }
+#endif
+ if( aSize != aHorSBar.GetSizePixel() )
+ aHorSBar.SetSizePixel( aSize );
+ aHorSBar.SetVisibleSize( nVisibleWidth ); //nRealWidth );
+ aHorSBar.SetPageSize( (nVisibleWidth*75)/100 );
+ if( nResult & 0x0002 )
+ {
+ aHorSBar.SetThumbPos( nThumb );
+ aHorSBar.Show();
+ }
+ else
+ {
+ aHorSBar.SetThumbPos( 0 );
+ aHorSBar.Hide();
+ }
+
+#ifdef OS2
+ nRealWidth++;
+#endif
+ aOutputSize.Width() = nRealWidth;
+#if defined(WIN) || defined(WNT)
+ if( nResult & 0x0002 ) // hor scrollbar ?
+ nRealHeight++; // weil unterer Rand geclippt wird
+#endif
+#ifdef OS2
+ if( nResult & 0x0002 ) // hor scrollbar ?
+ nRealHeight++;
+#endif
+ aOutputSize.Height() = nRealHeight;
+}
+
+void __EXPORT SvImpIconView::Resize()
+{
+ StopEditTimer();
+ Rectangle aRect;
+ if( GetResizeRect(aRect) )
+ pView->Invalidate( aRect );
+ aOutputSize = pView->GetOutputSizePixel();
+ pImpCursor->Clear();
+
+#if 1
+ const Size& rSize = pView->Control::GetOutputSizePixel();
+ PositionScrollBars( rSize.Width(), rSize.Height() );
+ // Die ScrollBars werden asynchron ein/ausgeblendet, damit abgeleitete
+ // Klassen im Resize ein Arrange durchfuehren koennen, ohne dass
+ // die ScrollBars aufblitzen (SfxExplorerIconView!)
+ nCurUserEvent = Application::PostUserEvent(LINK(this,SvImpIconView,UserEventHdl),0);
+#else
+ AdjustScrollBars();
+ if( GetResizeRect(aRect) )
+ PaintResizeRect( aRect );
+#endif
+}
+
+BOOL SvImpIconView::CheckHorScrollBar()
+{
+ if( !pZOrderList || !aHorSBar.IsVisible() )
+ return FALSE;
+ const MapMode& rMapMode = pView->GetMapMode();
+ Point aOrigin( rMapMode.GetOrigin() );
+ if(!(pView->nWindowStyle & WB_HSCROLL) && !aOrigin.X() )
+ {
+ long nWidth = aOutputSize.Width();
+ USHORT nCount = pZOrderList->Count();
+ long nMostRight = 0;
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur);
+ long nRight = GetBoundingRect(pEntry).Right();
+ if( nRight > nWidth )
+ return FALSE;
+ if( nRight > nMostRight )
+ nMostRight = nRight;
+ }
+ aHorSBar.Hide();
+ aOutputSize.Height() += nHorSBarHeight;
+ aVirtOutputSize.Width() = nMostRight;
+ aHorSBar.SetThumbPos( 0 );
+ Range aRange;
+ aRange.Max() = nMostRight - 1;
+ aHorSBar.SetRange( aRange );
+ if( aVerSBar.IsVisible() )
+ {
+ Size aSize( aVerSBar.GetSizePixel());
+ aSize.Height() += nHorSBarHeight;
+ aVerSBar.SetSizePixel( aSize );
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+BOOL SvImpIconView::CheckVerScrollBar()
+{
+ if( !pZOrderList || !aVerSBar.IsVisible() )
+ return FALSE;
+ const MapMode& rMapMode = pView->GetMapMode();
+ Point aOrigin( rMapMode.GetOrigin() );
+ if(!(pView->nWindowStyle & WB_VSCROLL) && !aOrigin.Y() )
+ {
+ long nDeepest = 0;
+ long nHeight = aOutputSize.Height();
+ USHORT nCount = pZOrderList->Count();
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)pZOrderList->operator[](nCur);
+ long nBottom = GetBoundingRect(pEntry).Bottom();
+ if( nBottom > nHeight )
+ return FALSE;
+ if( nBottom > nDeepest )
+ nDeepest = nBottom;
+ }
+ aVerSBar.Hide();
+ aOutputSize.Width() += nVerSBarWidth;
+ aVirtOutputSize.Height() = nDeepest;
+ aVerSBar.SetThumbPos( 0 );
+ Range aRange;
+ aRange.Max() = nDeepest - 1;
+ aVerSBar.SetRange( aRange );
+ if( aHorSBar.IsVisible() )
+ {
+ Size aSize( aHorSBar.GetSizePixel());
+ aSize.Width() += nVerSBarWidth;
+ aHorSBar.SetSizePixel( aSize );
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+// blendet Scrollbars aus, wenn sie nicht mehr benoetigt werden
+void SvImpIconView::CheckScrollBars()
+{
+ CheckVerScrollBar();
+ if( CheckHorScrollBar() )
+ CheckVerScrollBar();
+}
+
+
+void __EXPORT SvImpIconView::GetFocus()
+{
+ if( pCursor )
+ {
+ pView->SetEntryFocus( pCursor, TRUE );
+ ShowCursor( TRUE );
+ }
+}
+
+void __EXPORT SvImpIconView::LoseFocus()
+{
+ StopEditTimer();
+ if( pCursor )
+ pView->SetEntryFocus( pCursor,FALSE );
+ ShowCursor( FALSE );
+}
+
+void SvImpIconView::UpdateAll()
+{
+ AdjustScrollBars();
+ pImpCursor->Clear();
+ pView->Invalidate();
+}
+
+void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData )
+{
+ Point aPos( GetEntryPos( pEntry ) );
+ PaintEntry( pEntry, aPos, pViewData );
+}
+
+void SvImpIconView::PaintEmphasis( const Rectangle& rRect, BOOL bSelected,
+ BOOL bInUse, BOOL bCursored,
+ OutputDevice* pOut )
+{
+ // HACK fuer D&D
+ if( nFlags & F_NO_EMPHASIS )
+ return;
+
+ if( !pOut )
+ pOut = pView;
+
+ // Selektion painten
+ Color aOldFillColor = pOut->GetFillColor();
+ Color aOldLineColor = pOut->GetLineColor();
+ Color aNewColor;
+ const StyleSettings& rStyleSettings = pOut->GetSettings().GetStyleSettings();
+ if( bSelected )
+ {
+ aNewColor = rStyleSettings.GetHighlightColor();
+ }
+ else
+ {
+#ifndef OS2
+ aNewColor =rStyleSettings.GetFieldColor();
+#else
+ aNewColor = pOut->GetBackground().GetColor();
+#endif
+ }
+
+ if( bCursored )
+ {
+ pOut->SetLineColor( Color( COL_BLACK ) );
+ }
+ pOut->SetFillColor( aNewColor );
+ pOut->DrawRect( rRect );
+ pOut->SetFillColor( aOldFillColor );
+ pOut->SetLineColor( aOldLineColor );
+}
+
+void SvImpIconView::PaintItem( const Rectangle& rRect,
+ SvLBoxItem* pItem, SvLBoxEntry* pEntry, USHORT nPaintFlags,
+ OutputDevice* pOut )
+{
+ if( nViewMode == VIEWMODE_ICON && pItem->IsA() == SV_ITEM_ID_LBOXSTRING )
+ {
+ const String& rStr = ((SvLBoxString*)pItem)->GetText();
+ DrawText( pOut, rRect, rStr, DRAWTEXT_FLAGS );
+ }
+ else
+ {
+ Point aPos( rRect.TopLeft() );
+ const Size& rSize = GetItemSize( pView, pEntry, pItem );
+ if( nPaintFlags & PAINTFLAG_HOR_CENTERED )
+ aPos.X() += (rRect.GetWidth() - rSize.Width() ) / 2;
+ if( nPaintFlags & PAINTFLAG_VER_CENTERED )
+ aPos.Y() += (rRect.GetHeight() - rSize.Height() ) / 2;
+ pItem->Paint( aPos, *(SvLBox*)pOut, 0, pEntry );
+ }
+}
+
+void SvImpIconView::PaintEntry( SvLBoxEntry* pEntry, const Point& rPos,
+ SvIcnVwDataEntry* pViewData, OutputDevice* pOut )
+{
+ if( !pView->IsUpdateMode() )
+ return;
+
+ if( !pOut )
+ pOut = pView;
+
+ SvLBoxContextBmp* pBmpItem;
+
+ pView->PreparePaint( pEntry );
+
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(pEntry);
+
+ SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+
+ BOOL bSelected = pViewData->IsSelected();
+ BOOL bCursored = pViewData->IsCursored();
+ BOOL bInUse = pEntry->HasInUseEmphasis();
+
+ Font aTempFont( pOut->GetFont() );
+ // waehrend D&D nicht die Fontfarbe wechseln, da sonst auch die
+ // Emphasis gezeichnet werden muss! (weisser Adler auf weissem Grund)
+ if( bSelected && !(nFlags & F_NO_EMPHASIS) )
+ {
+ const StyleSettings& rStyleSettings = pOut->GetSettings().GetStyleSettings();
+ Font aNewFont( aTempFont );
+ aNewFont.SetColor( rStyleSettings.GetHighlightTextColor() );
+ pOut->SetFont( aNewFont );
+ }
+ Rectangle aTextRect( CalcTextRect(pEntry,pStringItem,&rPos,FALSE,pViewData));
+ Rectangle aBmpRect( CalcBmpRect(pEntry, &rPos, pViewData ) );
+
+ switch( nViewMode )
+ {
+ case VIEWMODE_ICON:
+ pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ PaintEmphasis( aBmpRect, bSelected, bInUse, bCursored, pOut );
+ PaintItem( aBmpRect, pBmpItem, pEntry,
+ PAINTFLAG_HOR_CENTERED | PAINTFLAG_VER_CENTERED, pOut );
+ PaintEmphasis( aTextRect, bSelected, FALSE, FALSE, pOut );
+ PaintItem( aTextRect, pStringItem, pEntry, PAINTFLAG_HOR_CENTERED, pOut );
+ break;
+
+ case VIEWMODE_NAME:
+ pBmpItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ PaintEmphasis( aBmpRect, bSelected, bInUse, bCursored, pOut );
+ PaintItem( aBmpRect, pBmpItem, pEntry, PAINTFLAG_VER_CENTERED, pOut );
+ PaintEmphasis( aTextRect, bSelected, FALSE, FALSE, pOut );
+ PaintItem( aTextRect, pStringItem, pEntry,PAINTFLAG_VER_CENTERED, pOut );
+ break;
+
+ case VIEWMODE_TEXT:
+ PaintEmphasis( aTextRect, bSelected, FALSE, bCursored, pOut );
+ PaintItem( aTextRect, pStringItem, pEntry, PAINTFLAG_VER_CENTERED, pOut );
+ break;
+ }
+ pOut->SetFont( aTempFont );
+}
+
+void SvImpIconView::SetEntryPos( SvLBoxEntry* pEntry, const Point& rPos,
+ BOOL bAdjustAtGrid, BOOL bCheckScrollBars )
+{
+ if( pModel->GetParent(pEntry) == pCurParent )
+ {
+ ShowCursor( FALSE );
+ long nVirtHeightOffs = 0;
+ long nVirtWidthOffs = 0;
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ Rectangle aBoundRect( GetBoundingRect( pEntry, pViewData ));
+ pView->Invalidate( aBoundRect );
+ ToTop( pEntry );
+ if( rPos != aBoundRect.TopLeft() )
+ {
+ Point aGridOffs = pViewData->aGridRect.TopLeft() -
+ pViewData->aRect.TopLeft();
+ pImpCursor->Clear();
+ nFlags &= ~F_GRID_INSERT;
+ aBoundRect.SetPos( rPos );
+ pViewData->aRect = aBoundRect;
+ pViewData->aGridRect.SetPos( rPos + aGridOffs );
+ AdjustVirtSize( aBoundRect );
+ }
+ //HACK(Billigloesung, die noch verbessert werden muss)
+ if( bAdjustAtGrid )
+ {
+ AdjustAtGrid( pEntry );
+ ToTop( pEntry );
+ }
+ if( bCheckScrollBars && pView->IsUpdateMode() )
+ CheckScrollBars();
+
+ PaintEntry( pEntry, pViewData );
+ ShowCursor( TRUE );
+ }
+}
+
+void SvImpIconView::ViewDataInitialized( SvLBoxEntry*)
+{
+}
+
+void SvImpIconView::ModelHasEntryInvalidated( SvListEntry* pEntry )
+{
+ if( pEntry == pCursor )
+ ShowCursor( FALSE );
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ pView->Invalidate( pViewData->aRect );
+
+ if( nFlags & F_GRIDMODE )
+ Center( (SvLBoxEntry*)pEntry, pViewData );
+ else
+ pViewData->aRect.SetSize( CalcBoundingSize(
+ (SvLBoxEntry*)pEntry, pViewData ) );
+
+ ViewDataInitialized( (SvLBoxEntry*)pEntry );
+ pView->Invalidate( pViewData->aRect );
+ if( pEntry == pCursor )
+ ShowCursor( TRUE );
+}
+
+
+void SvImpIconView::InvalidateEntry( SvLBoxEntry* pEntry )
+{
+ const Rectangle& rRect = GetBoundingRect( pEntry );
+ pView->Invalidate( rRect );
+}
+
+void SvImpIconView::SetNoSelection()
+{
+}
+
+void SvImpIconView::SetDragDropMode( DragDropMode )
+{
+}
+
+void SvImpIconView::SetSelectionMode( SelectionMode )
+{
+}
+
+BOOL SvImpIconView::IsEntryInView( SvLBoxEntry* )
+{
+ return FALSE;
+}
+
+SvLBoxEntry* SvImpIconView::GetDropTarget( const Point& rPos )
+{
+ Point aDocPos( rPos );
+ CalcDocPos( aDocPos );
+ SvLBoxEntry* pTarget = GetEntry( aDocPos );
+ if( !pTarget || !pTarget->HasChilds() )
+ pTarget = pCurParent;
+ return pTarget;
+}
+
+SvLBoxEntry* SvImpIconView::GetEntry( const Point& rDocPos )
+{
+ CheckBoundingRects();
+ SvLBoxEntry* pTarget = 0;
+ // Z-Order-Liste vom Ende her absuchen
+ USHORT nCount = pZOrderList->Count();
+ while( nCount )
+ {
+ nCount--;
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nCount));
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ if( pViewData->aRect.IsInside( rDocPos ) )
+ {
+ pTarget = pEntry;
+ break;
+ }
+ }
+ return pTarget;
+}
+
+SvLBoxEntry* SvImpIconView::GetNextEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry )
+{
+ CheckBoundingRects();
+ SvLBoxEntry* pTarget = 0;
+ USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ if( nStartPos != USHRT_MAX )
+ {
+ USHORT nCount = pZOrderList->Count();
+ for( USHORT nCur = nStartPos+1; nCur < nCount; nCur++ )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nCur));
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ if( pViewData->aRect.IsInside( rDocPos ) )
+ {
+ pTarget = pEntry;
+ break;
+ }
+ }
+ }
+ return pTarget;
+}
+
+SvLBoxEntry* SvImpIconView::GetPrevEntry( const Point& rDocPos, SvLBoxEntry* pCurEntry )
+{
+ CheckBoundingRects();
+ SvLBoxEntry* pTarget = 0;
+ USHORT nStartPos = pZOrderList->GetPos( (void*)pCurEntry );
+ if( nStartPos != USHRT_MAX && nStartPos != 0 )
+ {
+ nStartPos--;
+ do
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nStartPos));
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ if( pViewData->aRect.IsInside( rDocPos ) )
+ {
+ pTarget = pEntry;
+ break;
+ }
+ } while( nStartPos > 0 );
+ }
+ return pTarget;
+}
+
+
+Point SvImpIconView::GetEntryPos( SvLBoxEntry* pEntry )
+{
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ DBG_ASSERT(pViewData,"Entry not in model")
+ return pViewData->aRect.TopLeft();
+}
+
+const Rectangle& SvImpIconView::GetBoundingRect( SvLBoxEntry* pEntry, SvIcnVwDataEntry* pViewData )
+{
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(pEntry);
+ DBG_ASSERT(pViewData,"Entry not in model")
+ if( !IsBoundingRectValid( pViewData->aRect ))
+ FindBoundingRect( pEntry, pViewData );
+ return pViewData->aRect;
+}
+
+void SvImpIconView::SetSpaceBetweenEntries( long nHor, long nVer )
+{
+ nHorDist = nHor;
+ nVerDist = nVer;
+}
+
+Rectangle SvImpIconView::CalcBmpRect( SvLBoxEntry* pEntry, const Point* pPos,
+ SvIcnVwDataEntry* pViewData )
+{
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(pEntry);
+
+ Rectangle aBound = GetBoundingRect( pEntry, pViewData );
+ if( pPos )
+ aBound.SetPos( *pPos );
+ Point aPos( aBound.TopLeft() );
+
+ switch( nViewMode )
+ {
+ case VIEWMODE_ICON:
+ {
+ aPos.X() += ( aBound.GetWidth() - nMaxBmpWidth ) / 2;
+ Size aSize( nMaxBmpWidth, nMaxBmpHeight );
+ // das Bitmap-Rechteck soll nicht das TextRect beruehren
+ aSize.Height() -= 3;
+ return Rectangle( aPos, aSize );
+ }
+
+ case VIEWMODE_NAME:
+ return Rectangle( aPos,
+ Size( nMaxBmpWidth, aBound.GetHeight() ));
+
+ case VIEWMODE_TEXT:
+ return Rectangle( aPos, aBound.GetSize() );
+
+ default:
+ {
+ Rectangle aRect;
+ return aRect;
+ }
+ }
+}
+
+Rectangle SvImpIconView::CalcTextRect( SvLBoxEntry* pEntry,
+ SvLBoxString* pItem, const Point* pPos, BOOL bForInplaceEdit,
+ SvIcnVwDataEntry* pViewData )
+{
+ long nBmpHeight, nBmpWidth;
+
+ if( !pItem )
+ pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(pEntry);
+
+ Size aTextSize( GetItemSize( pView, pEntry, pItem, pViewData ));
+ aTextSize.Width() += 2*LROFFS_TEXT;
+
+ Size aContextBmpSize(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)->GetSize(pView,pEntry));
+ Rectangle aBound = GetBoundingRect( pEntry, pViewData );
+ if( pPos )
+ aBound.SetPos( *pPos );
+ Point aPos( aBound.TopLeft() );
+
+ switch( nViewMode )
+ {
+ case VIEWMODE_ICON:
+ nBmpHeight = aContextBmpSize.Height();
+ if( nBmpHeight < nMaxBmpHeight )
+ nBmpHeight = nMaxBmpHeight;
+ aPos.Y() += nBmpHeight;
+
+ // beim Inplace-Editieren, spendieren wir ein bisschen mehr Platz
+ if( bForInplaceEdit )
+ {
+ // 20% rauf
+ long nMinWidth = (( (aContextBmpSize.Width()*10) / 100 ) * 2 ) +
+ aContextBmpSize.Width();
+ if( nMinWidth > aBound.GetWidth() )
+ nMinWidth = aBound.GetWidth();
+
+ if( aTextSize.Width() < nMinWidth )
+ aTextSize.Width() = nMinWidth;
+
+ // beim Inplace-Ed. darfs auch untere Eintraege ueberlappen
+ Rectangle aMaxGridTextRect = CalcMaxTextRect(pEntry, pViewData);
+#ifndef VCL
+ aMaxGridTextRect.Bottom() = LONG_MAX - 1;
+ aMaxGridTextRect = GetTextRect( pView, aMaxGridTextRect,pItem->GetText(), DRAWTEXT_FLAGS );
+#endif
+ Size aOptSize = aMaxGridTextRect.GetSize();
+ if( aOptSize.Height() > aTextSize.Height() )
+ aTextSize.Height() = aOptSize.Height();
+ }
+
+
+ aPos.X() += ( aBound.GetWidth() - aTextSize.Width() ) / 2;
+ break;
+
+ case VIEWMODE_NAME:
+ nBmpWidth = aContextBmpSize.Width();
+ if( nBmpWidth < nMaxBmpWidth )
+ nBmpWidth = nMaxBmpWidth;
+ aPos.X() += nBmpWidth;
+ // vertikal ausrichten
+ aPos.Y() += ( nBmpWidth - aTextSize.Height() ) / 2;
+ break;
+ }
+
+ Rectangle aRect( aPos, aTextSize );
+// KNALLT BEIM D&D, WENN GECLIPPT WIRD (In DrawText von Thomas)
+// ClipAtVirtOutRect( aRect );
+ return aRect;
+}
+
+
+long SvImpIconView::CalcBoundingWidth( SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData ) const
+{
+ DBG_ASSERT(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP),"No Bitmaps")
+ DBG_ASSERT(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING),"No Text")
+ long nStringWidth = GetItemSize( pView, pEntry, pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING),pViewData).Width();
+ nStringWidth += 2*LROFFS_TEXT;
+ long nBmpWidth = pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)->GetSize(pView,pEntry).Width();
+ long nWidth = 0;
+
+ switch( nViewMode )
+ {
+ case VIEWMODE_ICON:
+ nWidth = Max( nStringWidth, nBmpWidth );
+ nWidth = Max( nWidth, nMaxBmpWidth );
+ break;
+
+ case VIEWMODE_NAME:
+ nWidth = Max( nBmpWidth, nMaxBmpWidth );
+ nWidth += NAMEVIEW_OFFS_BMP_STRING; // Abstand Bitmap String
+ nWidth += nStringWidth;
+ break;
+
+ case VIEWMODE_TEXT:
+ nWidth = nStringWidth;
+ break;
+ }
+ return nWidth;
+}
+
+long SvImpIconView::CalcBoundingHeight( SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData ) const
+{
+ DBG_ASSERT(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP),"No Bitmaps")
+ DBG_ASSERT(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING),"No Text")
+ long nStringHeight = GetItemSize(pView,pEntry,pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING),pViewData).Height();
+ long nBmpHeight = pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)->GetSize(pView,pEntry).Height();
+ long nHeight = 0;
+
+ switch( nViewMode )
+ {
+ case VIEWMODE_ICON:
+ nHeight = Max( nBmpHeight, nMaxBmpHeight );
+ nHeight += ICONVIEW_OFFS_BMP_STRING; // Abstand Bitmap String
+ nHeight += nStringHeight;
+ break;
+
+ case VIEWMODE_NAME:
+ nHeight = Max( nBmpHeight, nMaxBmpHeight );
+ nHeight = Max( nHeight, nStringHeight );
+ break;
+
+ case VIEWMODE_TEXT:
+ nHeight = nStringHeight;
+ break;
+ }
+ if( nHeight > nMaxBoundHeight )
+ {
+ ((SvImpIconView*)this)->nMaxBoundHeight = nHeight;
+ ((SvImpIconView*)this)->aHorSBar.SetLineSize( nHeight / 2 );
+ ((SvImpIconView*)this)->aVerSBar.SetLineSize( nHeight / 2 );
+ }
+ return nHeight;
+}
+
+Size SvImpIconView::CalcBoundingSize( SvLBoxEntry* pEntry,
+ SvIcnVwDataEntry* pViewData ) const
+{
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(pEntry);
+ return Size( CalcBoundingWidth(pEntry,pViewData),
+ CalcBoundingHeight(pEntry,pViewData) );
+}
+
+void SvImpIconView::RecalcAllBoundingRects()
+{
+ nMaxBoundHeight = 0;
+ pZOrderList->Remove(0, pZOrderList->Count() );
+ SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent );
+ while( pEntry )
+ {
+ FindBoundingRect( pEntry );
+ pZOrderList->Insert( pEntry, pZOrderList->Count() );
+ pEntry = pModel->NextSibling( pEntry );
+ }
+ bMustRecalcBoundingRects = FALSE;
+ AdjustScrollBars();
+}
+
+void SvImpIconView::RecalcAllBoundingRectsSmart()
+{
+ nMaxBoundHeight = 0;
+ pZOrderList->Remove(0, pZOrderList->Count() );
+ SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent );
+ while( pEntry )
+ {
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ if( IsBoundingRectValid( pViewData->aRect ))
+ {
+ Size aBoundSize( pViewData->aRect.GetSize() );
+ if( aBoundSize.Height() > nMaxBoundHeight )
+ nMaxBoundHeight = aBoundSize.Height();
+ pZOrderList->Insert( pEntry, pZOrderList->Count() );
+ }
+ else
+ {
+ FindBoundingRect( pEntry, pViewData );
+ }
+ pZOrderList->Insert( pEntry, pZOrderList->Count() );
+ pEntry = pModel->NextSibling( pEntry );
+ }
+ AdjustScrollBars();
+}
+
+void SvImpIconView::UpdateBoundingRects()
+{
+ SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent );
+ while( pEntry )
+ {
+ GetBoundingRect( pEntry );
+ pEntry = pModel->NextSibling( pEntry );
+ }
+}
+
+void SvImpIconView::FindBoundingRect( SvLBoxEntry* pEntry,
+ SvIcnVwDataEntry* pViewData )
+{
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(pEntry);
+
+ Size aSize( CalcBoundingSize( pEntry, pViewData ) );
+ Point aPos;
+
+ DBG_ASSERT(!pViewData->IsEntryPosLocked(),"Locked entry pos in FindBoundingRect");
+ // damits in der IconView nicht drunter & drueber geht
+ if( pViewData->IsEntryPosLocked() && IsBoundingRectValid(pViewData->aRect) )
+ {
+ AdjustVirtSize( pViewData->aRect );
+ return;
+ }
+
+ aPos = FindNextEntryPos( aSize );
+
+ if( nFlags & F_GRIDMODE )
+ {
+ Rectangle aGridRect( aPos, Size(nGridDX, nGridDY) );
+ pViewData->aGridRect = aGridRect;
+ Center( pEntry, pViewData );
+ AdjustVirtSize( pViewData->aRect );
+ pImpCursor->SetGridUsed( pViewData->aRect );
+ }
+ else
+ {
+ pViewData->aRect = Rectangle( aPos, aSize );
+ AdjustVirtSize( pViewData->aRect );
+ }
+}
+
+
+void SvImpIconView::SetCursor( SvLBoxEntry* pEntry )
+{
+ if( pEntry == pCursor )
+ return;
+
+ ShowCursor( FALSE );
+ if( pCursor )
+ {
+ pView->SetEntryFocus( pCursor, FALSE );
+ if( pView->GetSelectionMode() == SINGLE_SELECTION )
+ pView->Select( pCursor, FALSE );
+ }
+ pCursor = pEntry;
+ ToTop( pCursor );
+ if( pCursor )
+ {
+ pView->SetEntryFocus(pCursor, TRUE );
+ if( pView->GetSelectionMode() == SINGLE_SELECTION )
+ pView->Select( pCursor, TRUE );
+ ShowCursor( TRUE );
+ }
+}
+
+
+void SvImpIconView::ShowCursor( BOOL bShow )
+{
+ if( !pCursor || !bShow || !pView->HasFocus() )
+ {
+ pView->HideFocus();
+ return;
+ }
+ Rectangle aRect ( CalcFocusRect( pCursor ) );
+ pView->ShowFocus( aRect );
+}
+
+
+void SvImpIconView::HideDDIcon()
+{
+ pView->Update();
+ ImpHideDDIcon();
+ pDDBufDev = pDDDev;
+ pDDDev = 0;
+}
+
+void SvImpIconView::ImpHideDDIcon()
+{
+ if( pDDDev )
+ {
+ Size aSize( pDDDev->GetOutputSizePixel() );
+ // pView restaurieren
+ pView->DrawOutDev( aDDLastRectPos, aSize, Point(), aSize, *pDDDev );
+ }
+}
+
+
+void SvImpIconView::ShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix )
+{
+ pView->Update();
+ if( pRefEntry != pDDRefEntry )
+ {
+ DELETEZ(pDDDev);
+ DELETEZ(pDDBufDev);
+ }
+ BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE );
+ if( !pDDDev )
+ {
+ if( pDDBufDev )
+ {
+ // nicht bei jedem Move ein Device anlegen, da dies besonders
+ // auf Remote-Clients zu langsam ist
+ pDDDev = pDDBufDev;
+ pDDBufDev = 0;
+ }
+ else
+ {
+ pDDDev = new VirtualDevice( *pView );
+ pDDDev->SetFont( pView->GetFont() );
+ }
+ }
+ else
+ {
+ ImpHideDDIcon();
+ }
+ const Rectangle& rRect = GetBoundingRect( pRefEntry );
+ pDDDev->SetOutputSizePixel( rRect.GetSize() );
+
+ Point aPos( rPosPix );
+ CalcDocPos( aPos );
+
+ Size aSize( pDDDev->GetOutputSizePixel() );
+ pDDRefEntry = pRefEntry;
+ aDDLastEntryPos = aPos;
+ aDDLastRectPos = aPos;
+
+ // Hintergrund sichern
+ pDDDev->DrawOutDev( Point(), aSize, aPos, aSize, *pView );
+ // Icon in pView malen
+ nFlags |= F_NO_EMPHASIS;
+ PaintEntry( pRefEntry, aPos );
+ nFlags &= ~F_NO_EMPHASIS;
+ if( bSelected )
+ pView->SvListView::Select( pRefEntry, TRUE );
+}
+
+void SvImpIconView::HideShowDDIcon( SvLBoxEntry* pRefEntry, const Point& rPosPix )
+{
+/* In Notfaellen folgenden flackernden Code aktivieren:
+
+ HideDDIcon();
+ ShowDDIcon( pRefEntry, rPosPix );
+ return;
+*/
+ if( !pDDDev )
+ {
+ ShowDDIcon( pRefEntry, rPosPix );
+ return;
+ }
+
+ if( pRefEntry != pDDRefEntry )
+ {
+ HideDDIcon();
+ ShowDDIcon( pRefEntry, rPosPix );
+ return;
+ }
+
+ Point aEmptyPoint;
+
+ Point aCurEntryPos( rPosPix );
+ CalcDocPos( aCurEntryPos );
+
+ const Rectangle& rRect = GetBoundingRect( pRefEntry );
+ Size aEntrySize( rRect.GetSize() );
+ Rectangle aPrevEntryRect( aDDLastEntryPos, aEntrySize );
+ Rectangle aCurEntryRect( aCurEntryPos, aEntrySize );
+
+ if( !aPrevEntryRect.IsOver( aCurEntryRect ) )
+ {
+ HideDDIcon();
+ ShowDDIcon( pRefEntry, rPosPix );
+ return;
+ }
+
+ // Ueberlappung des neuen und alten D&D-Pointers!
+
+ Rectangle aFullRect( aPrevEntryRect.Union( aCurEntryRect ) );
+ if( !pDDTempDev )
+ {
+ pDDTempDev = new VirtualDevice( *pView );
+ pDDTempDev->SetFont( pView->GetFont() );
+ }
+
+ Size aFullSize( aFullRect.GetSize() );
+ Point aFullPos( aFullRect.TopLeft() );
+
+ pDDTempDev->SetOutputSizePixel( aFullSize );
+
+ // Hintergrund (mit dem alten D&D-Pointer!) sichern
+ pDDTempDev->DrawOutDev( aEmptyPoint, aFullSize, aFullPos, aFullSize, *pView );
+ // den alten Buffer in den neuen Buffer pasten
+ aDDLastRectPos = aDDLastRectPos - aFullPos;
+
+ pDDTempDev->DrawOutDev(
+ aDDLastRectPos,
+ pDDDev->GetOutputSizePixel(),
+ aEmptyPoint,
+ pDDDev->GetOutputSizePixel(),
+ *pDDDev );
+
+ // Swap
+ VirtualDevice* pTemp = pDDDev;
+ pDDDev = pDDTempDev;
+ pDDTempDev = pTemp;
+
+ // in den restaurierten Hintergrund den neuen D&D-Pointer zeichnen
+ pDDTempDev->SetOutputSizePixel( pDDDev->GetOutputSizePixel() );
+ pDDTempDev->DrawOutDev(
+ aEmptyPoint, aFullSize, aEmptyPoint, aFullSize, *pDDDev );
+ Point aRelPos = aCurEntryPos - aFullPos;
+ nFlags |= F_NO_EMPHASIS;
+ PaintEntry( pRefEntry, aRelPos, 0, pDDTempDev );
+ nFlags &= ~F_NO_EMPHASIS;
+
+ aDDLastRectPos = aFullPos;
+ aDDLastEntryPos = aCurEntryPos;
+
+ pView->DrawOutDev(
+ aDDLastRectPos,
+ pDDDev->GetOutputSizePixel(),
+ aEmptyPoint,
+ pDDDev->GetOutputSizePixel(),
+ *pDDTempDev );
+
+ BOOL bSelected = pView->SvListView::Select( pRefEntry, FALSE );
+ if( bSelected )
+ pView->SvListView::Select( pRefEntry, TRUE );
+}
+
+void SvImpIconView::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow )
+{
+ CheckBoundingRects();
+ Rectangle aRect;
+ if( pEntry != pCurParent &&
+ (pEntry->HasChilds() || pEntry->HasChildsOnDemand()) )
+ aRect = CalcBmpRect( pEntry );
+ else
+ {
+ aRect.SetSize( aOutputSize );
+ const MapMode& rMapMode = pView->GetMapMode();
+ Point aOrigin( rMapMode.GetOrigin());
+ aOrigin *= -1; // in Doc-Koord wandeln
+ aRect.SetPos( aOrigin );
+ aRect.Left()++; aRect.Top()++;
+ aRect.Right()--; aRect.Bottom()--;
+ }
+ ImpDrawXORRect( aRect );
+}
+
+BOOL SvImpIconView::NotifyMoving( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewPar, ULONG& rNewChildPos )
+{
+ if( pTarget == pCurParent && pModel->GetParent(pEntry) == pCurParent )
+ {
+ // D&D innerhalb einer Childlist
+ StopEditTimer();
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ Size aSize( pViewData->aRect.GetSize() );
+ Point aNewPos = FindNextEntryPos( aSize );
+ AdjustVirtSize( Rectangle( aNewPos, aSize ) );
+ SetEntryPos( pEntry, aNewPos, FALSE, TRUE );
+ return FALSE;
+ }
+ return pView->SvLBox::NotifyMoving(pTarget,pEntry,rpNewPar,rNewChildPos);
+}
+
+BOOL SvImpIconView::NotifyCopying( SvLBoxEntry* pTarget, SvLBoxEntry* pEntry,
+ SvLBoxEntry*& rpNewParent, ULONG& rNewChildPos )
+{
+ return pView->SvLBox::NotifyCopying(pTarget,pEntry,rpNewParent,rNewChildPos);
+}
+
+void SvImpIconView::WriteDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo)
+{
+ SvLBoxEntry* pCurEntry = GetCurEntry();
+ Point aEntryPos;
+ if( pCurEntry )
+ {
+ aEntryPos = rPos;
+ aEntryPos -= GetEntryPos( pCurEntry );
+ }
+ pInfo->nMouseRelX = aEntryPos.X();
+ pInfo->nMouseRelY = aEntryPos.Y();
+}
+
+void SvImpIconView::ReadDragServerInfo( const Point& rPos, SvLBoxDDInfo* pInfo )
+{
+ Point aDropPos( rPos );
+ aDropPos.X() -= pInfo->nMouseRelX;
+ aDropPos.Y() -= pInfo->nMouseRelY;
+ SetNextEntryPos( aDropPos );
+}
+
+void SvImpIconView::InvalidateBoundingRect( SvLBoxEntry* pEntry )
+{
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ InvalidateBoundingRect( pViewData->aRect );
+}
+
+void SvImpIconView::PrepareCommandEvent( const CommandEvent& rCEvt )
+{
+ aMouseMoveTimer.Stop();
+ StopEditTimer();
+ nFlags |= F_CMD_ARRIVED;
+ SvLBoxEntry* pEntry = pView->GetEntry( rCEvt.GetMousePosPixel(), TRUE );
+ if( (nFlags & F_DOWN_CTRL) && pEntry && !pView->IsSelected(pEntry) )
+ pView->Select( pEntry, TRUE );
+ nFlags &= ~(F_DOWN_CTRL | F_DOWN_DESELECT);
+}
+
+void SvImpIconView::Command( const CommandEvent& rCEvt )
+{
+ PrepareCommandEvent( rCEvt );
+ if( rCEvt.GetCommand() == COMMAND_STARTDRAG )
+ {
+ nFlags |= F_DRAG_SOURCE;
+ if( GetSelectionCount() )
+ {
+ ShowCursor( FALSE );
+ pView->BeginDrag( rCEvt.GetMousePosPixel() );
+ ShowCursor( TRUE );
+ }
+ nFlags &= (~F_DRAG_SOURCE);
+ }
+}
+
+void SvImpIconView::ToTop( SvLBoxEntry* pEntry )
+{
+ DBG_ASSERT(pZOrderList->GetPos(pEntry)!=0xffff,"ToTop:ZOrder?");
+ if( pZOrderList->GetObject( pZOrderList->Count() -1 ) != pEntry )
+ {
+ USHORT nPos = pZOrderList->GetPos( (void*)pEntry );
+ pZOrderList->Remove( nPos, 1 );
+ pZOrderList->Insert( pEntry, pZOrderList->Count() );
+ }
+}
+
+void SvImpIconView::SetCurParent( SvLBoxEntry* pNewParent )
+{
+ Clear();
+ pCurParent = pNewParent;
+ ImpArrange();
+}
+
+void SvImpIconView::ClipAtVirtOutRect( Rectangle& rRect ) const
+{
+ if( rRect.Bottom() >= aVirtOutputSize.Height() )
+ rRect.Bottom() = aVirtOutputSize.Height() - 1;
+ if( rRect.Right() >= aVirtOutputSize.Width() )
+ rRect.Right() = aVirtOutputSize.Width() - 1;
+ if( rRect.Top() < 0 )
+ rRect.Top() = 0;
+ if( rRect.Left() < 0 )
+ rRect.Left() = 0;
+}
+
+// rRect: Bereich des Dokumentes (in Dokumentkoordinaten), der
+// sichtbar gemacht werden soll.
+// bScrBar == TRUE: Das Rect wurde aufgrund eines ScrollBar-Events berechnet
+
+void SvImpIconView::MakeVisible( const Rectangle& rRect, BOOL bScrBar )
+{
+ Rectangle aRect( rRect );
+ ClipAtVirtOutRect( aRect );
+ MapMode aMapMode( pView->GetMapMode() );
+ Point aOrigin( aMapMode.GetOrigin() );
+ // in Dokumentkoordinate umwandeln
+ aOrigin *= -1;
+
+ Rectangle aOutputArea( aOrigin, aOutputSize );
+ if( aOutputArea.IsInside( aRect ) )
+ return; // ist schon sichtbar
+
+ long nDy;
+ if( aRect.Top() < aOutputArea.Top() )
+ {
+ // nach oben scrollen (nDy < 0)
+ nDy = aRect.Top() - aOutputArea.Top();
+ }
+ else if( aRect.Bottom() > aOutputArea.Bottom() )
+ {
+ // nach unten scrollen (nDy > 0)
+ nDy = aRect.Bottom() - aOutputArea.Bottom();
+ }
+ else
+ nDy = 0;
+
+ long nDx;
+ if( aRect.Left() < aOutputArea.Left() )
+ {
+ // nach links scrollen (nDx < 0)
+ nDx = aRect.Left() - aOutputArea.Left();
+ }
+ else if( aRect.Right() > aOutputArea.Right() )
+ {
+ // nach rechts scrollen (nDx > 0)
+ nDx = aRect.Right() - aOutputArea.Right();
+ }
+ else
+ nDx = 0;
+
+ aOrigin.X() += nDx;
+ aOrigin.Y() += nDy;
+ aOutputArea.SetPos( aOrigin );
+
+ pView->Update();
+
+ // Origin fuer SV invertieren (damit wir in
+ // Dokumentkoordinaten scrollen/painten koennen)
+ aOrigin *= -1;
+ aMapMode.SetOrigin( aOrigin );
+ pView->SetMapMode( aMapMode );
+
+ // in umgekehrte Richtung scrollen!
+ pView->Control::Scroll( -nDx, -nDy, aOutputArea, TRUE );
+ if( aHorSBar.IsVisible() || aVerSBar.IsVisible() )
+ {
+ if( !bScrBar )
+ {
+ aOrigin *= -1;
+ // Thumbs korrigieren
+ if(aHorSBar.IsVisible() && aHorSBar.GetThumbPos() != aOrigin.X())
+ aHorSBar.SetThumbPos( aOrigin.X() );
+ if(aVerSBar.IsVisible() && aVerSBar.GetThumbPos() != aOrigin.Y())
+ aVerSBar.SetThumbPos( aOrigin.Y() );
+ }
+ }
+ // pruefen, ob ScrollBars noch benoetigt werden
+ CheckScrollBars();
+ pView->Update();
+}
+
+
+SvLBoxEntry* SvImpIconView::GetNewCursor()
+{
+ SvLBoxEntry* pNewCursor;
+ if( pCursor )
+ {
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, FALSE );
+ if( !pNewCursor )
+ {
+ pNewCursor = pImpCursor->GoLeftRight( pCursor, TRUE );
+ if( !pNewCursor )
+ {
+ pNewCursor = pImpCursor->GoUpDown( pCursor, FALSE );
+ if( !pNewCursor )
+ pNewCursor = pImpCursor->GoUpDown( pCursor, TRUE );
+ }
+ }
+ }
+ else
+ pNewCursor = pModel->FirstChild( pCurParent );
+ DBG_ASSERT(!pNewCursor|| (pCursor&&pCursor!=pNewCursor),"GetNewCursor failed");
+ return pNewCursor;
+}
+
+
+USHORT SvImpIconView:: GetSelectionCount() const
+{
+ USHORT nSelected = 0;
+ SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent);
+ while( pEntry )
+ {
+ if( pView->IsSelected( pEntry ) )
+ nSelected++;
+ pEntry = pModel->NextSibling( pEntry );
+ }
+ return nSelected;
+}
+
+
+void SvImpIconView::ToggleSelection( SvLBoxEntry* pEntry )
+{
+ BOOL bSel;
+ if( pView->IsSelected( pEntry ) )
+ bSel = FALSE;
+ else
+ bSel = TRUE;
+ pView->Select( pEntry, bSel );
+}
+
+void SvImpIconView::DeselectAllBut( SvLBoxEntry* pThisEntryNot )
+{
+ ClearSelectedRectList();
+ SvLBoxEntry* pEntry = pModel->FirstChild( pCurParent );
+ while( pEntry )
+ {
+ if( pEntry != pThisEntryNot && pView->IsSelected( pEntry ))
+ pView->Select( pEntry, FALSE );
+ pEntry = pModel->NextSibling( pEntry );
+ }
+}
+
+#define ICN_ROWS 50
+#define ICN_COLS 30
+
+ImpIcnCursor::ImpIcnCursor( SvImpIconView* pOwner )
+{
+ pView = pOwner;
+ pColumns = 0;
+ pRows = 0;
+ pCurEntry = 0;
+ nDeltaWidth = 0;
+ nDeltaHeight= 0;
+ nCols = 0;
+ nRows = 0;
+ nGridCols = 0;
+ nGridRows = 0;
+ pGridMap = 0;
+}
+
+ImpIcnCursor::~ImpIcnCursor()
+{
+ delete[] pColumns;
+ delete[] pRows;
+ delete pGridMap;
+}
+
+USHORT ImpIcnCursor::GetSortListPos( SvPtrarr* pList, long nValue,
+ int bVertical )
+{
+ USHORT nCount = (USHORT)pList->Count();
+ if( !nCount )
+ return 0;
+
+ USHORT nCurPos = 0;
+ long nPrevValue = LONG_MIN;
+ while( nCount )
+ {
+ const Rectangle& rRect=
+ pView->GetBoundingRect((SvLBoxEntry*)(pList->GetObject(nCurPos)));
+ long nCurValue;
+ if( bVertical )
+ nCurValue = rRect.Top();
+ else
+ nCurValue = rRect.Left();
+ if( nValue >= nPrevValue && nValue <= nCurValue )
+ return (USHORT)nCurPos;
+ nPrevValue = nCurValue;
+ nCount--;
+ nCurPos++;
+ }
+ return pList->Count();
+}
+
+void ImpIcnCursor::ImplCreate()
+{
+ pView->CheckBoundingRects();
+ DBG_ASSERT(pColumns==0&&pRows==0,"ImplCreate: Not cleared");
+
+ SetDeltas();
+
+ pColumns = new SvPtrarr[ nCols ];
+ pRows = new SvPtrarr[ nRows ];
+
+ DELETEZ(pGridMap);
+
+ SvLBoxTreeList* pModel = pView->pModel;
+ SvLBoxEntry* pEntry = pModel->FirstChild( pView->pCurParent );
+ while( pEntry )
+ {
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
+ // const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ Rectangle rRect( pView->CalcBmpRect( pEntry,0,pViewData ) );
+ short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / nDeltaHeight );
+ short nX = (short)( ((rRect.Left()+rRect.Right())/2) / nDeltaWidth );
+
+ // Rundungsfehler abfangen
+ if( nY >= nRows )
+ nY = nRows - 1;
+ if( nX >= nCols )
+ nX = nCols - 1;
+
+ USHORT nIns = GetSortListPos( &pColumns[nX], rRect.Top(), TRUE );
+ pColumns[ nX ].Insert( pEntry, nIns );
+
+ nIns = GetSortListPos( &pRows[nY], rRect.Left(), FALSE );
+ pRows[ nY ].Insert( pEntry, nIns );
+
+ pViewData->nX = nX;
+ pViewData->nY = nY;
+
+ pEntry = pModel->NextSibling( pEntry );
+ }
+}
+
+void ImpIcnCursor::CreateGridMap()
+{
+ if( pGridMap )
+ return;
+
+ const Size& rSize = pView->aVirtOutputSize;
+ long nWidth = rSize.Width();
+ if( nWidth < pView->nMaxVirtWidth )
+ nWidth = pView->nMaxVirtWidth;
+ nWidth -= 2*LROFFS_WINBORDER;
+ if( nWidth <= 0 )
+ nWidth = 1;
+
+ nGridDX = pView->nGridDX;
+ nGridDY = pView->nGridDY;
+
+ // Hinweis: Wegen der Abrundung bei Berechnung von nGridCols
+ // ist es moeglich, dass Eintrage nicht im Grid liegen. Diese
+ // wurden typischerweise manuell verschoben und gelockt
+ nGridCols = nWidth / nGridDX;
+ if( !nGridCols ) nGridCols = 1;
+
+ nGridRows = rSize.Height() / nGridDY;
+ // nRows nicht abrunden, da zur Vermeidung von Ueberlappungen
+ // das gesamte BoundingRect des Eintrags zur Markierung im Grid
+ // herangezogen wird.
+ if( (nGridRows * nGridDY) < rSize.Height() )
+ nGridRows++;
+ else if( !nGridRows )
+ nGridRows = 1;
+
+ //XXX
+ //nGridRows += 50; // in fuenfziger-Schritten
+
+ pGridMap = new BOOL[ nGridRows*nGridCols];
+ memset( (void*)pGridMap, 0, nGridRows*nGridCols );
+
+ SvLBoxTreeList* pModel = pView->pModel;
+ SvLBoxEntry* pEntry = pModel->FirstChild( pView->pCurParent );
+ while( pEntry )
+ {
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
+ const Rectangle& rRect = pViewData->aRect;
+ // nur, wenn der Entry schon plaziert ist
+ if( pView->IsBoundingRectValid( rRect ))
+ {
+ // Alle vom Eintrag beruehrten Grids kennzeichnen
+ SetGridUsed( pView->GetBoundingRect( pEntry, pViewData ) );
+ }
+ pEntry = pModel->NextSibling( pEntry );
+ }
+}
+
+BOOL ImpIcnCursor::GetGrid( const Point& rDocPos, USHORT& rGridX, USHORT& rGridY ) const
+{
+ Point aPos( rDocPos );
+ aPos.X() -= LROFFS_WINBORDER;
+ aPos.Y() -= TBOFFS_WINBORDER;
+ rGridX = (USHORT)(aPos.X() / nGridDX);
+ rGridY = (USHORT)(aPos.Y() / nGridDY);
+ BOOL bInGrid = TRUE;
+ if( rGridX >= nGridCols )
+ {
+ rGridX = nGridCols - 1;
+ bInGrid = FALSE;
+ }
+ if( rGridY >= nGridRows )
+ {
+ rGridY = nGridRows - 1;
+ if( !bInGrid )
+ return FALSE; // beide Koordinaten nicht im Grid
+ }
+ return TRUE;
+}
+
+void ImpIcnCursor::SetGridUsed( const Rectangle& rRect, BOOL bUsed )
+{
+ CreateGridMap();
+ USHORT nTLX, nTLY, nBRX, nBRY;
+
+ BOOL bTLInGrid = GetGrid( rRect.TopLeft(), nTLX, nTLY );
+ BOOL bBRInGrid = GetGrid( rRect.BottomRight(), nBRX, nBRY );
+
+ if( !bTLInGrid && !bBRInGrid )
+ return;
+
+ for( USHORT nCurY = nTLY; nCurY <= nBRY; nCurY++ )
+ {
+ for( USHORT nCurX = nTLX; nCurX <= nBRX; nCurX++ )
+ {
+ SetGridUsed( nCurX, nCurY, bUsed );
+ }
+ }
+}
+
+void ImpIcnCursor::Clear( BOOL bGridToo )
+{
+ if( pColumns )
+ {
+ delete[] pColumns;
+ delete[] pRows;
+ pColumns = 0;
+ pRows = 0;
+ pCurEntry = 0;
+ nDeltaWidth = 0;
+ nDeltaHeight = 0;
+ }
+ if( bGridToo && pGridMap )
+ {
+ DELETEZ(pGridMap);
+ nGridRows = 0;
+ nGridCols = 0;
+ }
+}
+
+SvLBoxEntry* ImpIcnCursor::SearchCol(USHORT nCol,USHORT nTop,USHORT nBottom,
+ USHORT nPref, BOOL bDown, BOOL bSimple )
+{
+ DBG_ASSERT(pCurEntry,"SearchCol: No reference entry");
+ SvPtrarr* pList = &(pColumns[ nCol ]);
+ USHORT nCount = pList->Count();
+ if( !nCount )
+ return 0;
+
+ const Rectangle& rRefRect = pView->GetBoundingRect(pCurEntry);
+
+ if( bSimple )
+ {
+ USHORT nListPos = pList->GetPos( pCurEntry );
+ DBG_ASSERT(nListPos!=0xffff,"Entry not in Col-List");
+ if( bDown )
+ {
+ while( nListPos < nCount-1 )
+ {
+ nListPos++;
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)pList->GetObject( nListPos );
+ const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ if( rRect.Top() > rRefRect.Top() )
+ return pEntry;
+ }
+ return 0;
+ }
+ else
+ {
+ while( nListPos )
+ {
+ nListPos--;
+ if( nListPos < nCount )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)pList->GetObject( nListPos );
+ const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ if( rRect.Top() < rRefRect.Top() )
+ return pEntry;
+ }
+ }
+ return 0;
+ }
+ }
+
+ if( nTop > nBottom )
+ {
+ USHORT nTemp = nTop;
+ nTop = nBottom;
+ nBottom = nTemp;
+ }
+ long nMinDistance = LONG_MAX;
+ SvLBoxEntry* pResult = 0;
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur ));
+ if( pEntry != pCurEntry )
+ {
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
+ USHORT nY = pViewData->nY;
+ if( nY >= nTop && nY <= nBottom )
+ {
+ const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ long nDistance = rRect.Top() - rRefRect.Top();
+ if( nDistance < 0 )
+ nDistance *= -1;
+ if( nDistance && nDistance < nMinDistance )
+ {
+ nMinDistance = nDistance;
+ pResult = pEntry;
+ }
+ }
+ }
+ }
+ return pResult;
+}
+
+SvLBoxEntry* ImpIcnCursor::SearchRow(USHORT nRow,USHORT nLeft,USHORT nRight,
+ USHORT nPref, BOOL bRight, BOOL bSimple )
+{
+ DBG_ASSERT(pCurEntry,"SearchRow: No reference entry");
+ SvPtrarr* pList = &(pRows[ nRow ]);
+ USHORT nCount = pList->Count();
+ if( !nCount )
+ return 0;
+
+ const Rectangle& rRefRect = pView->GetBoundingRect(pCurEntry);
+
+ if( bSimple )
+ {
+ USHORT nListPos = pList->GetPos( pCurEntry );
+ DBG_ASSERT(nListPos!=0xffff,"Entry not in Row-List");
+ if( bRight )
+ {
+ while( nListPos < nCount-1 )
+ {
+ nListPos++;
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)pList->GetObject( nListPos );
+ const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ if( rRect.Left() > rRefRect.Left() )
+ return pEntry;
+ }
+ return 0;
+ }
+ else
+ {
+ while( nListPos )
+ {
+ nListPos--;
+ if( nListPos < nCount )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)pList->GetObject( nListPos );
+ const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ if( rRect.Left() < rRefRect.Left() )
+ return pEntry;
+ }
+ }
+ return 0;
+ }
+
+ }
+ if( nRight < nLeft )
+ {
+ USHORT nTemp = nRight;
+ nRight = nLeft;
+ nLeft = nTemp;
+ }
+ long nMinDistance = LONG_MAX;
+ SvLBoxEntry* pResult = 0;
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pList->GetObject( nCur ));
+ if( pEntry != pCurEntry )
+ {
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
+ USHORT nX = pViewData->nX;
+ if( nX >= nLeft && nX <= nRight )
+ {
+ const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ long nDistance = rRect.Left() - rRefRect.Left();
+ if( nDistance < 0 )
+ nDistance *= -1;
+ if( nDistance && nDistance < nMinDistance )
+ {
+ nMinDistance = nDistance;
+ pResult = pEntry;
+ }
+ }
+ }
+ }
+ return pResult;
+}
+
+
+
+/*
+ Sucht ab dem uebergebenen Eintrag den naechsten rechts- bzw.
+ linksstehenden. Suchverfahren am Beispiel bRight = TRUE:
+
+ c
+ b c
+ a b c
+ S 1 1 1 ====> Suchrichtung
+ a b c
+ b c
+ c
+
+ S : Startposition
+ 1 : erstes Suchrechteck
+ a,b,c : 2., 3., 4. Suchrechteck
+*/
+
+SvLBoxEntry* ImpIcnCursor::GoLeftRight( SvLBoxEntry* pEntry, BOOL bRight )
+{
+ SvLBoxEntry* pResult;
+ pCurEntry = pEntry;
+ Create();
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
+ USHORT nY = pViewData->nY;
+ USHORT nX = pViewData->nX;
+ DBG_ASSERT(nY< nRows,"GoLeftRight:Bad column");
+ DBG_ASSERT(nX< nCols,"GoLeftRight:Bad row");
+ // Nachbar auf gleicher Zeile ?
+ if( bRight )
+ pResult = SearchRow( nY, nX ,nCols-1, nX, TRUE, TRUE );
+ else
+ pResult = SearchRow( nY, nX ,0, nX, FALSE, TRUE );
+ if( pResult )
+ return pResult;
+
+ long nCurCol = nX;
+
+ long nColOffs, nLastCol;
+ if( bRight )
+ {
+ nColOffs = 1;
+ nLastCol = nCols;
+ }
+ else
+ {
+ nColOffs = -1;
+ nLastCol = -1; // 0-1
+ }
+
+ USHORT nRowMin = nY;
+ USHORT nRowMax = nY;
+ do
+ {
+ SvLBoxEntry* pEntry = SearchCol((USHORT)nCurCol,nRowMin,nRowMax,nY,TRUE, FALSE);
+ if( pEntry )
+ return pEntry;
+ if( nRowMin )
+ nRowMin--;
+ if( nRowMax < (nRows-1))
+ nRowMax++;
+ nCurCol += nColOffs;
+ } while( nCurCol != nLastCol );
+ return 0;
+}
+
+SvLBoxEntry* ImpIcnCursor::GoUpDown( SvLBoxEntry* pEntry, BOOL bDown)
+{
+ SvLBoxEntry* pResult;
+ pCurEntry = pEntry;
+ Create();
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA2(pEntry);
+ USHORT nY = pViewData->nY;
+ USHORT nX = pViewData->nX;
+ DBG_ASSERT(nY<nRows,"GoUpDown:Bad column");
+ DBG_ASSERT(nX<nCols,"GoUpDown:Bad row");
+
+ // Nachbar in gleicher Spalte ?
+ if( bDown )
+ pResult = SearchCol( nX, nY ,nRows-1, nY, TRUE, TRUE );
+ else
+ pResult = SearchCol( nX, nY ,0, nY, FALSE, TRUE );
+ if( pResult )
+ return pResult;
+
+ long nCurRow = nY;
+
+ long nRowOffs, nLastRow;
+ if( bDown )
+ {
+ nRowOffs = 1;
+ nLastRow = nRows;
+ }
+ else
+ {
+ nRowOffs = -1;
+ nLastRow = -1; // 0-1
+ }
+
+ USHORT nColMin = nX;
+ USHORT nColMax = nX;
+ do
+ {
+ SvLBoxEntry* pEntry = SearchRow((USHORT)nCurRow,nColMin,nColMax,nX,TRUE, FALSE);
+ if( pEntry )
+ return pEntry;
+ if( nColMin )
+ nColMin--;
+ if( nColMax < (nCols-1))
+ nColMax++;
+ nCurRow += nRowOffs;
+ } while( nCurRow != nLastRow );
+ return 0;
+}
+
+void ImpIcnCursor::SetDeltas()
+{
+ const Size& rSize = pView->aVirtOutputSize;
+ if( pView->nFlags & F_GRIDMODE )
+ {
+ nGridDX = pView->nGridDX;
+ nGridDY = pView->nGridDY;
+ }
+ else
+ {
+ nGridDX = 20;
+ nGridDY = 20;
+ }
+ nCols = rSize.Width() / nGridDX;
+ if( !nCols )
+ nCols = 1;
+ nRows = rSize.Height() / nGridDY;
+ if( (nRows * nGridDY) < rSize.Height() )
+ nRows++;
+ if( !nRows )
+ nRows = 1;
+
+ nDeltaWidth = (short)(rSize.Width() / nCols);
+ nDeltaHeight = (short)(rSize.Height() / nRows);
+ if( !nDeltaHeight )
+ {
+ nDeltaHeight = 1;
+ DBG_WARNING("SetDeltas:Bad height");
+ }
+ if( !nDeltaWidth )
+ {
+ nDeltaWidth = 1;
+ DBG_WARNING("SetDeltas:Bad width");
+ }
+}
+
+
+void ImpIcnCursor::ExpandGrid()
+{
+ if( pGridMap )
+ {
+ long nNewGridRows = nGridRows + 20;
+ unsigned char* pTempMap = new unsigned char[ nNewGridRows * nGridCols ];
+ memset( pTempMap, nNewGridRows * nGridCols, 0 );
+ memcpy( pTempMap, pGridMap, nGridRows * nGridCols );
+ delete pGridMap;
+ pGridMap = pTempMap;
+ nGridRows = nNewGridRows;
+ }
+}
+
+BOOL ImpIcnCursor::FindEmptyGridRect( Rectangle& rRect )
+{
+ CreateGridMap();
+ USHORT nCount = (USHORT)(nGridCols * nGridRows);
+ if( !nCount )
+ return FALSE;
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ if( !pGridMap[ nCur ] )
+ {
+ USHORT nCol = (USHORT)(nCur % nGridCols);
+ USHORT nRow = (USHORT)(nCur / nGridCols);
+ rRect.Top() = nRow * nGridDY + TBOFFS_WINBORDER;
+ rRect.Bottom() = rRect.Top() + nGridDY;
+ rRect.Left() = nCol * nGridDX+ LROFFS_WINBORDER;
+ rRect.Right() = rRect.Left() + nGridDX;
+ SetGridUsed( nCol, nRow, TRUE );
+
+ //XXX
+ //if( nRow + 5 > nGridRows )
+ // ExpandGrid();
+ DBG_ASSERT(pGridMap[nCur],"SetGridUsed failed");
+ return TRUE;
+ }
+ }
+ // Gridmap ist voll: Um eine Zeile erweitern
+ rRect.Top() = nGridRows * nGridDY + TBOFFS_WINBORDER;
+ rRect.Bottom() = rRect.Top() + nGridDY;
+ rRect.Left() = LROFFS_WINBORDER;
+ rRect.Right() = rRect.Left() + nGridDX;
+ return FALSE;
+ //XXX
+ //ExpandGrid();
+ //return TRUE;
+}
+
+void ImpIcnCursor::CreateGridAjustData( SvPtrarr& rLists, SvLBoxEntry* pRefEntry)
+{
+ if( !pRefEntry )
+ {
+ USHORT nRows = (USHORT)(pView->aVirtOutputSize.Height() / pView->nGridDY);
+ nRows++; // wg. Abrundung!
+
+ if( !nRows )
+ return;
+ for( USHORT nCurList = 0; nCurList < nRows; nCurList++ )
+ {
+ SvPtrarr* pRow = new SvPtrarr;
+ rLists.Insert( (void*)pRow, nCurList );
+ }
+ SvLBoxEntry* pEntry = pView->pModel->FirstChild( pView->pCurParent );
+ while( pEntry )
+ {
+ const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
+ USHORT nIns = GetSortListPos((SvPtrarr*)rLists[nY],rRect.Left(),FALSE);
+ ((SvPtrarr*)rLists[ nY ])->Insert( pEntry, nIns );
+ pEntry = pView->pModel->NextSibling( pEntry );
+ }
+ }
+ else
+ {
+ // Aufbau eines hor. "Schlauchs" auf der RefEntry-Zeile
+
+ // UEBERLEGEN: BoundingRect nehmen wg. Ueberlappungen???
+
+ Rectangle rRefRect( pView->CalcBmpRect( pRefEntry ) );
+ //const Rectangle& rRefRect = pView->GetBoundingRect( pRefEntry );
+ short nRefRow = (short)( ((rRefRect.Top()+rRefRect.Bottom())/2) / pView->nGridDY );
+ SvPtrarr* pRow = new SvPtrarr;
+ rLists.Insert( (void*)pRow, 0 );
+ SvLBoxEntry* pEntry = pView->pModel->FirstChild( pView->pCurParent );
+ while( pEntry )
+ {
+ Rectangle rRect( pView->CalcBmpRect(pEntry) );
+ //const Rectangle& rRect = pView->GetBoundingRect( pEntry );
+ short nY = (short)( ((rRect.Top()+rRect.Bottom())/2) / pView->nGridDY );
+ if( nY == nRefRow )
+ {
+ USHORT nIns = GetSortListPos( pRow, rRect.Left(), FALSE );
+ pRow->Insert( pEntry, nIns );
+ }
+ pEntry = pView->pModel->NextSibling( pEntry );
+ }
+ }
+}
+
+//static
+void ImpIcnCursor::DestroyGridAdjustData( SvPtrarr& rLists )
+{
+ USHORT nCount = rLists.Count();
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ SvPtrarr* pArr = (SvPtrarr*)rLists[ nCur ];
+ delete pArr;
+ }
+ rLists.Remove( 0, rLists.Count() );
+}
+
+void SvImpIconView::SetGrid( long nDX, long nDY )
+{
+ nGridDX = nDX;
+ nGridDY = nDY;
+ nFlags |= F_GRIDMODE;
+}
+
+Rectangle SvImpIconView::CalcMaxTextRect( const SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData ) const
+{
+ Rectangle aRect = pViewData->aGridRect;
+ long nBmpHeight = ((SvLBoxEntry*)pEntry)->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP)->GetSize(pView,(SvLBoxEntry*)pEntry).Height();
+ aRect.Top() += nBmpHeight;
+ aRect.Top() += ICONVIEW_OFFS_BMP_STRING;
+ if( aRect.Top() > aRect.Bottom())
+ aRect.Top() = aRect.Bottom();
+ aRect.Left() += LROFFS_BOUND;
+ aRect.Left()++;
+ aRect.Right() -= LROFFS_BOUND;
+ aRect.Right()--;
+ if( aRect.Left() > aRect.Right())
+ aRect.Left() = aRect.Right();
+ if( GetTextMode( pEntry, pViewData ) == ShowTextFull )
+ aRect.Bottom() = LONG_MAX;
+ return aRect;
+}
+
+void SvImpIconView::Center( SvLBoxEntry* pEntry,
+ SvIcnVwDataEntry* pViewData ) const
+{
+ SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ const String& rEntryText = pStringItem->GetText();
+
+ Rectangle aTextRect = CalcMaxTextRect(pEntry,pViewData);
+ aTextRect = GetTextRect( pView, aTextRect, rEntryText, DRAWTEXT_FLAGS );
+ pViewData->aTextSize = aTextRect.GetSize();
+
+ pViewData->aRect = pViewData->aGridRect;
+ Size aSize( CalcBoundingSize( pEntry, pViewData ) );
+ long nBorder = pViewData->aGridRect.GetWidth() - aSize.Width();
+ pViewData->aRect.Left() += nBorder / 2;
+ pViewData->aRect.Right() -= nBorder / 2;
+ pViewData->aRect.Bottom() = pViewData->aRect.Top() + aSize.Height();
+}
+
+
+// Die Deltas entsprechen Offsets, um die die View auf dem Doc verschoben wird
+// links, hoch: Offsets < 0
+// rechts, runter: Offsets > 0
+void SvImpIconView::Scroll( long nDeltaX, long nDeltaY, BOOL bScrollBar )
+{
+ const MapMode& rMapMode = pView->GetMapMode();
+ Point aOrigin( rMapMode.GetOrigin() );
+ // in Dokumentkoordinate umwandeln
+ aOrigin *= -1;
+ aOrigin.Y() += nDeltaY;
+ aOrigin.X() += nDeltaX;
+ Rectangle aRect( aOrigin, aOutputSize );
+ MakeVisible( aRect, bScrollBar );
+}
+
+
+const Size& SvImpIconView::GetItemSize( SvIconView* pView,
+ SvLBoxEntry* pEntry, SvLBoxItem* pItem, const SvIcnVwDataEntry* pViewData) const
+{
+ if( (nFlags & F_GRIDMODE) && pItem->IsA() == SV_ITEM_ID_LBOXSTRING )
+ {
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(pEntry);
+ return pViewData->aTextSize;
+ }
+ else
+ return pItem->GetSize( pView, pEntry );
+}
+
+Rectangle SvImpIconView::CalcFocusRect( SvLBoxEntry* pEntry )
+{
+#if !defined(OS2)
+ SvLBoxString* pStringItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ DBG_ASSERT(pStringItem,"Text not set");
+ return CalcTextRect( pEntry, pStringItem );
+#else
+ return CalcBmpRect( pEntry );
+#endif
+}
+
+
+void SvImpIconView::SelectRect( const Rectangle& rRect, BOOL bAdd,
+ SvPtrarr* pOtherRects, short nBorderOffs )
+{
+ if( !pZOrderList || !pZOrderList->Count() )
+ return;
+
+ CheckBoundingRects();
+ pView->Update();
+ USHORT nCount = pZOrderList->Count();
+
+ Rectangle aRect( rRect );
+ aRect.Justify();
+ if( nBorderOffs )
+ {
+ aRect.Left() -= nBorderOffs;
+ aRect.Right() += nBorderOffs;
+ aRect.Top() -= nBorderOffs;
+ aRect.Bottom() += nBorderOffs;
+ }
+ BOOL bCalcOverlap = (bAdd && pOtherRects && pOtherRects->Count()) ? TRUE : FALSE;
+
+ for( USHORT nPos = 0; nPos < nCount; nPos++ )
+ {
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)(pZOrderList->GetObject(nPos ));
+
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ DBG_ASSERT(pViewData,"Entry not in model")
+ if( !IsBoundingRectValid( pViewData->aRect ))
+ FindBoundingRect( pEntry, pViewData );
+ const Rectangle& rBoundRect = pViewData->aRect;
+ BOOL bSelected = pViewData->IsSelected();
+
+ BOOL bOverlaps;
+ if( bCalcOverlap )
+ bOverlaps = IsOver( pOtherRects, rBoundRect );
+ else
+ bOverlaps = FALSE;
+ BOOL bOver = aRect.IsOver( rBoundRect );
+
+ if( bOver && !bOverlaps )
+ {
+ // Ist im neuen Selektionsrechteck und in keinem alten
+ // => selektieren
+ if( !bSelected )
+ pView->Select( pEntry, TRUE );
+ }
+ else if( !bAdd )
+ {
+ // ist ausserhalb des Selektionsrechtecks
+ // => Selektion entfernen
+ if( bSelected )
+ pView->Select( pEntry, FALSE );
+ }
+ else if( bAdd && bOverlaps )
+ {
+ // Der Eintrag befindet sich in einem alten (=>Aufspannen
+ // mehrerer Rechtecke mit Ctrl!) Selektionsrechteck
+
+ // Hier ist noch ein Bug! Der Selektionsstatus eines Eintrags
+ // in einem vorherigen Rechteck, muss restauriert werden, wenn
+ // er vom aktuellen Selektionsrechteck beruehrt wurde, jetzt aber
+ // nicht mehr in ihm liegt. Ich gehe hier der Einfachheit halber
+ // pauschal davon aus, dass die Eintraege in den alten Rechtecken
+ // alle selektiert sind. Ebenso ist es falsch, die Schnittmenge
+ // nur zu deselektieren.
+ // Loesungsmoeglichkeit: Snapshot der Selektion vor dem Auf-
+ // spannen des Rechtecks merken
+ if( rBoundRect.IsOver( rRect))
+ {
+ // Schnittmenge zwischen alten Rects & aktuellem Rect desel.
+ if( bSelected )
+ pView->Select( pEntry, FALSE );
+ }
+ else
+ {
+ // Eintrag eines alten Rects selektieren
+ if( !bSelected )
+ pView->Select( pEntry, TRUE );
+ }
+ }
+ else if( !bOver && bSelected )
+ {
+ // Der Eintrag liegt voellig ausserhalb und wird deshalb desel.
+ pView->Select( pEntry, FALSE );
+ }
+ }
+ pView->Update();
+}
+
+BOOL SvImpIconView::IsOver( SvPtrarr* pRectList, const Rectangle& rBoundRect ) const
+{
+ USHORT nCount = pRectList->Count();
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ Rectangle* pRect = (Rectangle*)pRectList->GetObject( nCur );
+ if( rBoundRect.IsOver( *pRect ))
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void SvImpIconView::AddSelectedRect( const Rectangle& rRect, short nBorderOffs )
+{
+ Rectangle* pRect = new Rectangle( rRect );
+ pRect->Justify();
+ if( nBorderOffs )
+ {
+ pRect->Left() -= nBorderOffs;
+ pRect->Right() += nBorderOffs;
+ pRect->Top() -= nBorderOffs;
+ pRect->Bottom() += nBorderOffs;
+ }
+ aSelectedRectList.Insert( (void*)pRect, aSelectedRectList.Count() );
+}
+
+void SvImpIconView::ClearSelectedRectList()
+{
+ USHORT nCount = aSelectedRectList.Count();
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ Rectangle* pRect = (Rectangle*)aSelectedRectList.GetObject( nCur );
+ delete pRect;
+ }
+ aSelectedRectList.Remove( 0, aSelectedRectList.Count() );
+}
+
+
+void SvImpIconView::DrawSelectionRect( const Rectangle& rRect )
+{
+ pView->HideTracking();
+ nFlags |= F_SELRECT_VISIBLE;
+ pView->ShowTracking( rRect, SHOWTRACK_SMALL | SHOWTRACK_WINDOW );
+ aCurSelectionRect = rRect;
+}
+
+void SvImpIconView::HideSelectionRect()
+{
+ if( nFlags & F_SELRECT_VISIBLE )
+ {
+ pView->HideTracking();
+ nFlags &= ~F_SELRECT_VISIBLE;
+ }
+}
+
+void SvImpIconView::ImpDrawXORRect( const Rectangle& rRect )
+{
+ RasterOp eOldOp = pView->GetRasterOp();
+ pView->SetRasterOp( ROP_XOR );
+ Color aOldColor = pView->GetFillColor();
+ pView->SetFillColor();
+ pView->DrawRect( rRect );
+ pView->SetFillColor( aOldColor );
+ pView->SetRasterOp( eOldOp );
+}
+
+void SvImpIconView::CalcScrollOffsets( const Point& rPosPixel,
+ long& rX, long& rY, BOOL bInDragDrop, USHORT nBorderWidth)
+{
+ // Scrolling der View, falls sich der Mauszeiger im Grenzbereich des
+ // Fensters befindet
+ long nPixelToScrollX = 0;
+ long nPixelToScrollY = 0;
+ Size aWndSize = aOutputSize;
+
+ nBorderWidth = (USHORT)(Min( (long)(aWndSize.Height()-1), (long)nBorderWidth ));
+ nBorderWidth = (USHORT)(Min( (long)(aWndSize.Width()-1), (long)nBorderWidth ));
+
+ if ( rPosPixel.X() < nBorderWidth )
+ {
+ if( bInDragDrop )
+ nPixelToScrollX = -DD_SCROLL_PIXEL;
+ else
+ nPixelToScrollX = rPosPixel.X()- nBorderWidth;
+ }
+ else if ( rPosPixel.X() > aWndSize.Width() - nBorderWidth )
+ {
+ if( bInDragDrop )
+ nPixelToScrollX = DD_SCROLL_PIXEL;
+ else
+ nPixelToScrollX = rPosPixel.X() - (aWndSize.Width() - nBorderWidth);
+ }
+ if ( rPosPixel.Y() < nBorderWidth )
+ {
+ if( bInDragDrop )
+ nPixelToScrollY = -DD_SCROLL_PIXEL;
+ else
+ nPixelToScrollY = rPosPixel.Y() - nBorderWidth;
+ }
+ else if ( rPosPixel.Y() > aWndSize.Height() - nBorderWidth )
+ {
+ if( bInDragDrop )
+ nPixelToScrollY = DD_SCROLL_PIXEL;
+ else
+ nPixelToScrollY = rPosPixel.Y() - (aWndSize.Height() - nBorderWidth);
+ }
+
+ rX = nPixelToScrollX;
+ rY = nPixelToScrollY;
+}
+
+IMPL_LINK(SvImpIconView, MouseMoveTimeoutHdl, Timer*, pTimer )
+{
+ pTimer->Start();
+ MouseMove( aMouseMoveEvent );
+ return 0;
+}
+
+void SvImpIconView::EndTracking()
+{
+ pView->ReleaseMouse();
+ if( nFlags & F_RUBBERING )
+ {
+ aMouseMoveTimer.Stop();
+ nFlags &= ~(F_RUBBERING | F_ADD_MODE);
+ }
+}
+
+BOOL SvImpIconView::IsTextHit( SvLBoxEntry* pEntry, const Point& rDocPos )
+{
+ SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ if( pItem )
+ {
+ Rectangle aRect( CalcTextRect( pEntry, pItem ));
+ if( aRect.IsInside( rDocPos ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+IMPL_LINK(SvImpIconView, EditTimeoutHdl, Timer*, pTimer )
+{
+ SvLBoxEntry* pEntry = GetCurEntry();
+ if( pView->IsInplaceEditingEnabled() && pEntry &&
+ pView->IsSelected( pEntry ))
+ {
+ pView->EditEntry( pEntry );
+ }
+ return 0;
+}
+
+
+//
+// Funktionen zum Ausrichten der Eintraege am Grid
+//
+
+// pStart == 0: Alle Eintraege werden ausgerichtet
+// sonst: Alle Eintraege der Zeile ab einschliesslich pStart werden ausgerichtet
+void SvImpIconView::AdjustAtGrid( SvLBoxEntry* pStart )
+{
+ SvPtrarr aLists;
+ pImpCursor->CreateGridAjustData( aLists, pStart );
+ USHORT nCount = aLists.Count();
+ for( USHORT nCur = 0; nCur < nCount; nCur++ )
+ {
+ AdjustAtGrid( *(SvPtrarr*)aLists[ nCur ], pStart );
+ }
+ ImpIcnCursor::DestroyGridAdjustData( aLists );
+ CheckScrollBars();
+}
+
+// Richtet eine Zeile aus, erweitert ggf. die Breite; Bricht die Zeile nicht um
+void SvImpIconView::AdjustAtGrid( const SvPtrarr& rRow, SvLBoxEntry* pStart )
+{
+ if( !rRow.Count() )
+ return;
+
+ BOOL bGo;
+ if( !pStart )
+ bGo = TRUE;
+ else
+ bGo = FALSE;
+
+ long nCurRight = 0;
+ for( USHORT nCur = 0; nCur < rRow.Count(); nCur++ )
+ {
+ SvLBoxEntry* pCur = (SvLBoxEntry*)rRow[ nCur ];
+ if( !bGo && pCur == pStart )
+ bGo = TRUE;
+
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pCur);
+ // Massgebend (fuer das menschliche Auge) ist die Bitmap, da sonst
+ // durch lange Texte der Eintrag stark springen kann
+ const Rectangle& rBoundRect = GetBoundingRect( pCur, pViewData );
+ Rectangle aCenterRect( CalcBmpRect( pCur, 0, pViewData ));
+ if( bGo && !pViewData->IsEntryPosLocked() )
+ {
+ long nWidth = aCenterRect.GetSize().Width();
+ Point aNewPos( AdjustAtGrid( aCenterRect, rBoundRect ) );
+ while( aNewPos.X() < nCurRight )
+ aNewPos.X() += nGridDX;
+ if( aNewPos != rBoundRect.TopLeft() )
+ SetEntryPos( pCur, aNewPos );
+ nCurRight = aNewPos.X() + nWidth;
+ }
+ else
+ {
+ nCurRight = rBoundRect.Right();
+ }
+ }
+}
+
+// Richtet Rect am Grid aus, garantiert jedoch nicht, dass die
+// neue Pos. frei ist. Die Pos. kann fuer SetEntryPos verwendet werden.
+// Das CenterRect beschreibt den Teil des BoundRects, der fuer
+// die Berechnung des Ziel-Rechtecks verwendet wird.
+Point SvImpIconView::AdjustAtGrid( const Rectangle& rCenterRect,
+ const Rectangle& rBoundRect ) const
+{
+ Point aPos( rCenterRect.TopLeft() );
+ Size aSize( rCenterRect.GetSize() );
+
+ aPos.X() -= LROFFS_WINBORDER;
+ aPos.Y() -= TBOFFS_WINBORDER;
+
+ // align (ref ist mitte des rects)
+ short nGridX = (short)((aPos.X()+(aSize.Width()/2)) / nGridDX);
+ short nGridY = (short)((aPos.Y()+(aSize.Height()/2)) / nGridDY);
+ aPos.X() = nGridX * nGridDX;
+ aPos.Y() = nGridY * nGridDY;
+ // hor. center
+ aPos.X() += (nGridDX - rBoundRect.GetSize().Width() ) / 2;
+
+ aPos.X() += LROFFS_WINBORDER;
+ aPos.Y() += TBOFFS_WINBORDER;
+
+ return aPos;
+}
+
+
+void SvImpIconView::SetTextMode( SvIconViewTextMode eMode, SvLBoxEntry* pEntry )
+{
+ if( !pEntry )
+ {
+ if( eTextMode != eMode )
+ {
+ if( eTextMode == ShowTextDontKnow )
+ eTextMode = ShowTextShort;
+ eTextMode = eMode;
+ pView->Arrange();
+ }
+ }
+ else
+ {
+ SvIcnVwDataEntry* pViewData = ICNVIEWDATA(pEntry);
+ if( pViewData->eTextMode != eMode )
+ {
+ pViewData->eTextMode = eMode;
+ pModel->InvalidateEntry( pEntry );
+ AdjustVirtSize( pViewData->aRect );
+ }
+ }
+}
+
+SvIconViewTextMode SvImpIconView::GetTextMode( const SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData ) const
+{
+ if( !pEntry )
+ return eTextMode;
+ else
+ {
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(((SvLBoxEntry*)pEntry));
+ return pViewData->GetTextMode();
+ }
+}
+
+SvIconViewTextMode SvImpIconView::GetEntryTextModeSmart( const SvLBoxEntry* pEntry,
+ const SvIcnVwDataEntry* pViewData ) const
+{
+ DBG_ASSERT(pEntry,"GetEntryTextModeSmart: Entry not set");
+ if( !pViewData )
+ pViewData = ICNVIEWDATA(((SvLBoxEntry*)pEntry));
+ SvIconViewTextMode eMode = pViewData->GetTextMode();
+ if( eMode == ShowTextDontKnow )
+ return eTextMode;
+ return eMode;
+}
+
+void SvImpIconView::ShowFocusRect( const SvLBoxEntry* pEntry )
+{
+ if( !pEntry )
+ pView->HideFocus();
+ else
+ {
+ Rectangle aRect ( CalcFocusRect( (SvLBoxEntry*)pEntry ) );
+ pView->ShowFocus( aRect );
+ }
+}
+
+IMPL_LINK(SvImpIconView, UserEventHdl, void*, EMPTYARG )
+{
+ nCurUserEvent = 0;
+ AdjustScrollBars();
+ Rectangle aRect;
+ if( GetResizeRect(aRect) )
+ PaintResizeRect( aRect );
+ return 0;
+}
+
+void SvImpIconView::CancelUserEvent()
+{
+ if( nCurUserEvent )
+ {
+ Application::RemoveUserEvent( nCurUserEvent );
+ nCurUserEvent = 0;
+ }
+}
+
+
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
new file mode 100644
index 000000000000..fc6cd0c85cf8
--- /dev/null
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -0,0 +1,449 @@
+/*************************************************************************
+ *
+ * $RCSfile: svlbitm.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#include <svlbox.hxx>
+#include <svlbitm.hxx>
+
+#pragma hdrstop
+
+#define TABOFFS_NOT_VALID -2000000
+
+DBG_NAME(SvLBoxButtonData);
+
+SvLBoxButtonData::SvLBoxButtonData()
+{
+ DBG_CTOR(SvLBoxButtonData,0);
+ bDataOk = FALSE;
+ pEntry = 0;
+ eState = SV_BUTTON_UNCHECKED;
+}
+
+SvLBoxButtonData::~SvLBoxButtonData()
+{
+ DBG_DTOR(SvLBoxButtonData,0);
+}
+
+
+void SvLBoxButtonData::CallLink()
+{
+ DBG_CHKTHIS(SvLBoxButtonData,0);
+ aLink.Call( this );
+}
+
+
+USHORT SvLBoxButtonData::GetIndex( USHORT nItemState )
+{
+ DBG_CHKTHIS(SvLBoxButtonData,0);
+ nItemState &= 0x000F;
+ USHORT nIdx;
+ switch( nItemState )
+ {
+ case SV_ITEMSTATE_UNCHECKED:
+ nIdx = SV_BMP_UNCHECKED; break;
+ case SV_ITEMSTATE_CHECKED:
+ nIdx = SV_BMP_CHECKED; break;
+ case SV_ITEMSTATE_TRISTATE:
+ nIdx = SV_BMP_TRISTATE; break;
+ case SV_ITEMSTATE_UNCHECKED | SV_ITEMSTATE_HILIGHTED:
+ nIdx = SV_BMP_HIUNCHECKED; break;
+ case SV_ITEMSTATE_CHECKED | SV_ITEMSTATE_HILIGHTED:
+ nIdx = SV_BMP_HICHECKED; break;
+ case SV_ITEMSTATE_TRISTATE | SV_ITEMSTATE_HILIGHTED:
+ nIdx = SV_BMP_HITRISTATE; break;
+ default:
+ nIdx = SV_BMP_UNCHECKED;
+ }
+ return nIdx;
+}
+
+void SvLBoxButtonData::SetWidthAndHeight()
+{
+ DBG_CHKTHIS(SvLBoxButtonData,0);
+ Size aSize = aBmps[0].GetSizePixel();
+ nWidth = aSize.Width();
+ nHeight = aSize.Height();
+ bDataOk = TRUE;
+}
+
+
+void SvLBoxButtonData::StoreButtonState( SvLBoxEntry* pActEntry, USHORT nItemFlags )
+{
+ DBG_CHKTHIS(SvLBoxButtonData,0);
+ pEntry = pActEntry;
+ eState = ConvertToButtonState( nItemFlags );
+}
+
+SvButtonState SvLBoxButtonData::ConvertToButtonState( USHORT nItemFlags ) const
+{
+ DBG_CHKTHIS(SvLBoxButtonData,0);
+ nItemFlags &= (SV_ITEMSTATE_UNCHECKED |
+ SV_ITEMSTATE_CHECKED |
+ SV_ITEMSTATE_TRISTATE);
+ switch( nItemFlags )
+ {
+ case SV_ITEMSTATE_UNCHECKED:
+ return SV_BUTTON_UNCHECKED;
+
+ case SV_ITEMSTATE_CHECKED:
+ return SV_BUTTON_CHECKED;
+
+ case SV_ITEMSTATE_TRISTATE:
+ return SV_BUTTON_TRISTATE;
+ default:
+ return SV_BUTTON_UNCHECKED;
+ }
+}
+
+
+// ***************************************************************
+// class SvLBoxString
+// ***************************************************************
+
+DBG_NAME(SvLBoxString);
+
+SvLBoxString::SvLBoxString( SvLBoxEntry* pEntry,USHORT nFlags,const XubString& rStr) :
+ SvLBoxItem( pEntry, nFlags )
+{
+ DBG_CTOR(SvLBoxString,0);
+ SetText( pEntry, rStr );
+}
+
+SvLBoxString::SvLBoxString() : SvLBoxItem()
+{
+ DBG_CTOR(SvLBoxString,0);
+}
+
+SvLBoxString::~SvLBoxString()
+{
+ DBG_DTOR(SvLBoxString,0);
+}
+
+USHORT SvLBoxString::IsA()
+{
+ DBG_CHKTHIS(SvLBoxString,0);
+ return SV_ITEM_ID_LBOXSTRING;
+}
+
+void SvLBoxString::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
+ SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBoxString,0);
+ rDev.DrawText( rPos, aStr );
+}
+
+SvLBoxItem* SvLBoxString::Create() const
+{
+ DBG_CHKTHIS(SvLBoxString,0);
+ return new SvLBoxString;
+}
+
+void SvLBoxString::Clone( SvLBoxItem* pSource )
+{
+ DBG_CHKTHIS(SvLBoxString,0);
+ aStr = ((SvLBoxString*)pSource)->aStr;
+}
+
+void SvLBoxString::SetText( SvLBoxEntry*, const XubString& rStr )
+{
+ DBG_CHKTHIS(SvLBoxString,0);
+ aStr = rStr;
+}
+
+void SvLBoxString::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
+ SvViewDataItem* pViewData)
+{
+ DBG_CHKTHIS(SvLBoxString,0);
+ if( !pViewData )
+ pViewData = pView->GetViewDataItem( pEntry, this );
+ pViewData->aSize = Size(pView->GetTextWidth( aStr ), pView->GetTextHeight());
+}
+
+// ***************************************************************
+// class SvLBoxBmp
+// ***************************************************************
+
+DBG_NAME(SvLBoxBmp);
+
+SvLBoxBmp::SvLBoxBmp( SvLBoxEntry* pEntry, USHORT nFlags, Image aBitmap ) :
+ SvLBoxItem( pEntry, nFlags )
+{
+ DBG_CTOR(SvLBoxBmp,0);
+ SetBitmap( pEntry, aBitmap);
+}
+
+SvLBoxBmp::SvLBoxBmp() : SvLBoxItem()
+{
+ DBG_CTOR(SvLBoxBmp,0);
+}
+
+SvLBoxBmp::~SvLBoxBmp()
+{
+ DBG_DTOR(SvLBoxBmp,0);
+}
+
+USHORT SvLBoxBmp::IsA()
+{
+ DBG_CHKTHIS(SvLBoxBmp,0);
+ return SV_ITEM_ID_LBOXBMP;
+}
+
+void SvLBoxBmp::SetBitmap( SvLBoxEntry*, Image aBitmap)
+{
+ DBG_CHKTHIS(SvLBoxBmp,0);
+ aBmp = aBitmap;
+}
+
+void SvLBoxBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
+ SvViewDataItem* pViewData)
+{
+ DBG_CHKTHIS(SvLBoxBmp,0);
+ if( !pViewData )
+ pViewData = pView->GetViewDataItem( pEntry, this );
+ pViewData->aSize = aBmp.GetSizePixel();
+}
+
+void SvLBoxBmp::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
+ SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBoxBmp,0);
+ rDev.DrawImage( rPos, aBmp );
+}
+
+SvLBoxItem* SvLBoxBmp::Create() const
+{
+ DBG_CHKTHIS(SvLBoxBmp,0);
+ return new SvLBoxBmp;
+}
+
+void SvLBoxBmp::Clone( SvLBoxItem* pSource )
+{
+ DBG_CHKTHIS(SvLBoxBmp,0);
+ aBmp = ((SvLBoxBmp*)pSource)->aBmp;
+}
+
+// ***************************************************************
+// class SvLBoxButton
+// ***************************************************************
+
+DBG_NAME(SvLBoxButton);
+
+SvLBoxButton::SvLBoxButton( SvLBoxEntry* pEntry,USHORT nFlags,SvLBoxButtonData* pBData)
+ : SvLBoxItem( pEntry, nFlags )
+{
+ DBG_CTOR(SvLBoxButton,0);
+ nBaseOffs = 0;
+ nItemFlags = 0;
+ SetStateUnchecked();
+ pData = pBData;
+}
+
+SvLBoxButton::SvLBoxButton() : SvLBoxItem()
+{
+ DBG_CTOR(SvLBoxButton,0);
+ nItemFlags = 0;
+ SetStateUnchecked();
+}
+
+SvLBoxButton::~SvLBoxButton()
+{
+ DBG_DTOR(SvLBoxButton,0);
+}
+
+USHORT SvLBoxButton::IsA()
+{
+ DBG_CHKTHIS(SvLBoxButton,0);
+ return SV_ITEM_ID_LBOXBUTTON;
+}
+
+void SvLBoxButton::Check(SvLBox*, SvLBoxEntry*, BOOL bOn)
+{
+ DBG_CHKTHIS(SvLBoxButton,0);
+ if ( bOn != IsStateChecked() )
+ {
+ if ( bOn )
+ SetStateChecked();
+ else
+ SetStateUnchecked();
+ }
+}
+
+BOOL SvLBoxButton::ClickHdl( SvLBox*, SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvLBoxButton,0);
+ if ( IsStateChecked() )
+ SetStateUnchecked();
+ else
+ SetStateChecked();
+ pData->StoreButtonState( pEntry, nItemFlags );
+ pData->CallLink();
+ return FALSE;
+}
+
+void SvLBoxButton::Paint( const Point& rPos, SvLBox& rDev, USHORT /* nFlags */,
+ SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBoxButton,0);
+ USHORT nIndex = pData->GetIndex( nItemFlags );
+ rDev.DrawImage( rPos, pData->aBmps[nIndex + nBaseOffs] );
+}
+
+SvLBoxItem* SvLBoxButton::Create() const
+{
+ DBG_CHKTHIS(SvLBoxButton,0);
+ return new SvLBoxButton;
+}
+
+void SvLBoxButton::Clone( SvLBoxItem* pSource )
+{
+ DBG_CHKTHIS(SvLBoxButton,0);
+ pData = ((SvLBoxButton*)pSource)->pData;
+}
+
+void SvLBoxButton::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
+ SvViewDataItem* pViewData )
+{
+ DBG_CHKTHIS(SvLBoxButton,0);
+ if( !pViewData )
+ pViewData = pView->GetViewDataItem( pEntry, this );
+ pViewData->aSize = Size( pData->Width(), pData->Height() );
+}
+
+
+
+// ***************************************************************
+// class SvLBoxContextBmp
+// ***************************************************************
+
+DBG_NAME(SvLBoxContextBmp);
+
+SvLBoxContextBmp::SvLBoxContextBmp( SvLBoxEntry* pEntry, USHORT nItemFlags,
+ Image aBmp1, Image aBmp2, USHORT nEntryFlags )
+ : SvLBoxItem( pEntry, nItemFlags )
+{
+ DBG_CTOR(SvLBoxContextBmp,0);
+ nEntryFlagsBmp1 = nEntryFlags;
+ SetBitmap1( pEntry, aBmp1 );
+ SetBitmap2( pEntry, aBmp2 );
+}
+
+SvLBoxContextBmp::SvLBoxContextBmp()
+{
+ DBG_CTOR(SvLBoxContextBmp,0);
+}
+
+SvLBoxContextBmp::~SvLBoxContextBmp()
+{
+ DBG_DTOR(SvLBoxContextBmp,0);
+}
+
+USHORT SvLBoxContextBmp::IsA()
+{
+ DBG_CHKTHIS(SvLBoxContextBmp,0);
+ return SV_ITEM_ID_LBOXCONTEXTBMP;
+}
+
+void SvLBoxContextBmp::SetBitmap1( SvLBoxEntry*, Image aBmp )
+{
+ DBG_CHKTHIS(SvLBoxContextBmp,0);
+ aBmp1 = aBmp;
+}
+
+void SvLBoxContextBmp::SetBitmap2( SvLBoxEntry*, Image aBmp)
+{
+ DBG_CHKTHIS(SvLBoxContextBmp,0);
+ aBmp2 = aBmp;
+}
+
+void SvLBoxContextBmp::InitViewData( SvLBox* pView,SvLBoxEntry* pEntry,
+ SvViewDataItem* pViewData)
+{
+ DBG_CHKTHIS(SvLBoxContextBmp,0);
+ if( !pViewData )
+ pViewData = pView->GetViewDataItem( pEntry, this );
+ pViewData->aSize = aBmp1.GetSizePixel();
+}
+
+void SvLBoxContextBmp::Paint( const Point& rPos, SvLBox& rDev,
+ USHORT nViewDataEntryFlags, SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvLBoxContextBmp,0);
+ Image* pBmp = &aBmp1;
+ if( nViewDataEntryFlags & nEntryFlagsBmp1 )
+ pBmp = &aBmp2;
+ rDev.DrawImage( rPos, *pBmp);
+}
+
+SvLBoxItem* SvLBoxContextBmp::Create() const
+{
+ DBG_CHKTHIS(SvLBoxContextBmp,0);
+ return new SvLBoxContextBmp;
+}
+
+void SvLBoxContextBmp::Clone( SvLBoxItem* pSource )
+{
+ DBG_CHKTHIS(SvLBoxContextBmp,0);
+ aBmp1 = ((SvLBoxContextBmp*)pSource)->aBmp1;
+ aBmp2 = ((SvLBoxContextBmp*)pSource)->aBmp2;
+ nEntryFlagsBmp1 = ((SvLBoxContextBmp*)pSource)->nEntryFlagsBmp1;
+}
+
+
diff --git a/svtools/source/contnr/svlbox.cxx b/svtools/source/contnr/svlbox.cxx
new file mode 100644
index 000000000000..2d7b9b333e99
--- /dev/null
+++ b/svtools/source/contnr/svlbox.cxx
@@ -0,0 +1,1691 @@
+/*************************************************************************
+ *
+ * $RCSfile: svlbox.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+/*
+ Todo:
+ - Anker loeschen in SelectionEngine bei manuellem Selektieren
+ - SelectAll( FALSE ), nur die deselektierten Entries repainten
+*/
+
+
+#include <string.h>
+#ifndef _SVEDI_HXX
+#include <svmedit.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_ACCEL_HXX
+#include <vcl/accel.hxx>
+#endif
+#ifndef _SV_DRAG_HXX
+#include <vcl/drag.hxx>
+#endif
+#ifndef _SOT_FORMATS_HXX
+#include <sot/formats.hxx>
+#endif
+
+#pragma hdrstop
+
+#include <svlbox.hxx>
+#include <svlbitm.hxx>
+
+// fuer Drag&Drop
+static SvLBox* pDDSource = 0;
+static SvLBox* pDDTarget = 0;
+
+DBG_NAME(SvInplaceEdit);
+DBG_NAME(SvInplaceEdit2);
+
+#define SVLBOX_ACC_RETURN 1
+#define SVLBOX_ACC_ESCAPE 2
+
+SvInplaceEdit::SvInplaceEdit( Window* pParent, const Point& rPos,
+ const Size& rSize, const XubString& rData, const Link& rNotifyEditEnd,
+ const Selection& rSelection) :
+#ifndef OS2
+ Edit( pParent, WB_LEFT ),
+#else
+ Edit( pParent, WB_LEFT | WB_BORDER ),
+#endif
+ aCallBackHdl( rNotifyEditEnd ),
+ bCanceled( FALSE ),
+ bAlreadyInCallBack( FALSE )
+{
+ DBG_CTOR(SvInplaceEdit,0);
+ Font aFont( pParent->GetFont() );
+ aFont.SetTransparent( FALSE );
+ Color aColor( pParent->GetBackground().GetColor() );
+ aFont.SetFillColor(aColor );
+ SetFont( aFont );
+ SetBackground( pParent->GetBackground() );
+ SetPosPixel( rPos );
+ SetSizePixel( rSize );
+ SetText( rData );
+ SetSelection( rSelection );
+ SaveValue();
+
+ aAccReturn.InsertItem( SVLBOX_ACC_RETURN, KeyCode(KEY_RETURN) );
+ aAccEscape.InsertItem( SVLBOX_ACC_ESCAPE, KeyCode(KEY_ESCAPE) );
+
+ aAccReturn.SetActivateHdl( LINK( this, SvInplaceEdit, ReturnHdl_Impl) );
+ aAccEscape.SetActivateHdl( LINK( this, SvInplaceEdit, EscapeHdl_Impl) );
+ GetpApp()->InsertAccel( &aAccReturn );
+ GetpApp()->InsertAccel( &aAccEscape );
+
+ Show();
+ GrabFocus();
+}
+
+__EXPORT SvInplaceEdit::~SvInplaceEdit()
+{
+ DBG_DTOR(SvInplaceEdit,0);
+ if( !bAlreadyInCallBack )
+ {
+ GetpApp()->RemoveAccel( &aAccReturn );
+ GetpApp()->RemoveAccel( &aAccEscape );
+ }
+}
+
+
+
+IMPL_LINK_INLINE_START( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, pAccelerator )
+{
+ DBG_CHKTHIS(SvInplaceEdit,0);
+ bCanceled = FALSE;
+ CallCallBackHdl_Impl();
+ return 1;
+}
+IMPL_LINK_INLINE_END( SvInplaceEdit, ReturnHdl_Impl, Accelerator *, pAccelerator )
+
+IMPL_LINK_INLINE_START( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, pAccelerator )
+{
+ DBG_CHKTHIS(SvInplaceEdit,0);
+ bCanceled = TRUE;
+ CallCallBackHdl_Impl();
+ return 1;
+}
+IMPL_LINK_INLINE_END( SvInplaceEdit, EscapeHdl_Impl, Accelerator *, pAccelerator )
+
+
+void __EXPORT SvInplaceEdit::KeyInput( const KeyEvent& rKEvt )
+{
+ DBG_CHKTHIS(SvInplaceEdit,0);
+ USHORT nCode = rKEvt.GetKeyCode().GetCode();
+ switch ( nCode )
+ {
+ case KEY_ESCAPE:
+ bCanceled = TRUE;
+ CallCallBackHdl_Impl();
+ break;
+
+ case KEY_RETURN:
+ bCanceled = FALSE;
+ CallCallBackHdl_Impl();
+ break;
+
+ default:
+ Edit::KeyInput( rKEvt );
+ }
+}
+
+void SvInplaceEdit::StopEditing( BOOL bCancel )
+{
+ DBG_CHKTHIS(SvInplaceEdit,0);
+ if ( !bAlreadyInCallBack )
+ {
+ bCanceled = bCancel;
+ CallCallBackHdl_Impl();
+ }
+}
+
+void __EXPORT SvInplaceEdit::LoseFocus()
+{
+ DBG_CHKTHIS(SvInplaceEdit,0);
+ if ( !bAlreadyInCallBack )
+ {
+ bCanceled = FALSE;
+ aTimer.SetTimeout(10);
+ aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit,Timeout_Impl));
+ aTimer.Start();
+ }
+}
+
+IMPL_LINK_INLINE_START( SvInplaceEdit, Timeout_Impl, Timer *, pTimer )
+{
+ DBG_CHKTHIS(SvInplaceEdit,0);
+ CallCallBackHdl_Impl();
+ return 0;
+}
+IMPL_LINK_INLINE_END( SvInplaceEdit, Timeout_Impl, Timer *, pTimer )
+
+void SvInplaceEdit::CallCallBackHdl_Impl()
+{
+ DBG_CHKTHIS(SvInplaceEdit,0);
+ aTimer.Stop();
+ if ( !bAlreadyInCallBack )
+ {
+ bAlreadyInCallBack = TRUE;
+ GetpApp()->RemoveAccel( &aAccReturn );
+ GetpApp()->RemoveAccel( &aAccEscape );
+ Hide();
+ aCallBackHdl.Call( this );
+ // bAlreadyInCallBack = FALSE;
+ }
+}
+
+
+// ***************************************************************
+
+class MyEdit_Impl : public Edit
+{
+ SvInplaceEdit2* pOwner;
+public:
+ MyEdit_Impl( Window* pParent, SvInplaceEdit2* pOwner );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void LoseFocus();
+};
+
+class MyMultiEdit_Impl : public MultiLineEdit
+{
+ SvInplaceEdit2* pOwner;
+public:
+ MyMultiEdit_Impl( Window* pParent, SvInplaceEdit2* pOwner );
+ virtual void KeyInput( const KeyEvent& rKEvt );
+ virtual void LoseFocus();
+};
+
+MyEdit_Impl::MyEdit_Impl( Window* pParent, SvInplaceEdit2* _pOwner )
+ :
+#ifndef OS2
+ Edit( pParent, WB_LEFT ),
+#else
+ Edit( pParent, WB_LEFT | WB_BORDER ),
+#endif
+ pOwner(_pOwner)
+{
+}
+
+void MyEdit_Impl::KeyInput( const KeyEvent& rKEvt )
+{
+ if( !pOwner->KeyInput( rKEvt ))
+ Edit::KeyInput( rKEvt );
+}
+
+void MyEdit_Impl::LoseFocus()
+{
+ pOwner->LoseFocus();
+}
+
+MyMultiEdit_Impl::MyMultiEdit_Impl( Window* pParent, SvInplaceEdit2* _pOwner )
+ : MultiLineEdit( pParent,
+#if !defined(VCL)
+#if defined(WIN) || defined(WNT)
+ WB_CENTER
+#else
+ WB_LEFT
+#endif
+#else
+ WB_CENTER
+#endif
+ ), pOwner(_pOwner)
+{
+}
+
+void MyMultiEdit_Impl::KeyInput( const KeyEvent& rKEvt )
+{
+ if( !pOwner->KeyInput( rKEvt ))
+ MultiLineEdit::KeyInput( rKEvt );
+}
+
+void MyMultiEdit_Impl::LoseFocus()
+{
+ pOwner->LoseFocus();
+}
+
+
+SvInplaceEdit2::SvInplaceEdit2( Window* pParent, const Point& rPos,
+ const Size& rSize, const XubString& rData, const Link& rNotifyEditEnd,
+ const Selection& rSelection, BOOL bMulti) :
+ aCallBackHdl( rNotifyEditEnd ),
+ bCanceled( FALSE ),
+ bAlreadyInCallBack( FALSE ),
+ bMultiLine( bMulti )
+{
+ DBG_CTOR(SvInplaceEdit2,0);
+ if( bMulti )
+ pEdit = new MyMultiEdit_Impl( pParent, this );
+ else
+ pEdit = new MyEdit_Impl( pParent, this );
+
+ Font aFont( pParent->GetFont() );
+ aFont.SetTransparent( FALSE );
+ Color aColor( pParent->GetBackground().GetColor() );
+ aFont.SetFillColor(aColor );
+ pEdit->SetFont( aFont );
+ pEdit->SetBackground( pParent->GetBackground() );
+ pEdit->SetPosPixel( rPos );
+ pEdit->SetSizePixel( rSize );
+ pEdit->SetText( rData );
+#ifndef OS2
+ pEdit->SetSelection( rSelection );
+#else
+ if( !bMulti )
+ pEdit->SetSelection( rSelection );
+#endif
+ pEdit->SaveValue();
+
+ aAccReturn.InsertItem( SVLBOX_ACC_RETURN, KeyCode(KEY_RETURN) );
+ aAccEscape.InsertItem( SVLBOX_ACC_ESCAPE, KeyCode(KEY_ESCAPE) );
+
+ aAccReturn.SetActivateHdl( LINK( this, SvInplaceEdit2, ReturnHdl_Impl) );
+ aAccEscape.SetActivateHdl( LINK( this, SvInplaceEdit2, EscapeHdl_Impl) );
+ GetpApp()->InsertAccel( &aAccReturn );
+ GetpApp()->InsertAccel( &aAccEscape );
+
+ pEdit->Show();
+ pEdit->GrabFocus();
+}
+
+SvInplaceEdit2::~SvInplaceEdit2()
+{
+ DBG_DTOR(SvInplaceEdit2,0);
+ if( !bAlreadyInCallBack )
+ {
+ GetpApp()->RemoveAccel( &aAccReturn );
+ GetpApp()->RemoveAccel( &aAccEscape );
+ }
+ delete pEdit;
+}
+
+XubString SvInplaceEdit2::GetSavedValue() const
+{
+ return pEdit->GetSavedValue();
+}
+
+void SvInplaceEdit2::Hide()
+{
+ pEdit->Hide();
+}
+
+
+IMPL_LINK_INLINE_START( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, pAccelerator )
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ bCanceled = FALSE;
+ CallCallBackHdl_Impl();
+ return 1;
+}
+IMPL_LINK_INLINE_END( SvInplaceEdit2, ReturnHdl_Impl, Accelerator *, pAccelerator )
+
+IMPL_LINK_INLINE_START( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, pAccelerator )
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ bCanceled = TRUE;
+ CallCallBackHdl_Impl();
+ return 1;
+}
+IMPL_LINK_INLINE_END( SvInplaceEdit2, EscapeHdl_Impl, Accelerator *, pAccelerator )
+
+
+BOOL SvInplaceEdit2::KeyInput( const KeyEvent& rKEvt )
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ KeyCode aCode = rKEvt.GetKeyCode();
+ USHORT nCode = aCode.GetCode();
+
+ switch ( nCode )
+ {
+ case KEY_ESCAPE:
+ bCanceled = TRUE;
+ CallCallBackHdl_Impl();
+ return TRUE;
+
+ case KEY_RETURN:
+// if( !aCode.IsShift() && !aCode.IsMod1() && !aCode.IsMod2() )
+ {
+ bCanceled = FALSE;
+ CallCallBackHdl_Impl();
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+void SvInplaceEdit2::StopEditing( BOOL bCancel )
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ if ( !bAlreadyInCallBack )
+ {
+ bCanceled = bCancel;
+ CallCallBackHdl_Impl();
+ }
+}
+
+void SvInplaceEdit2::LoseFocus()
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ if ( !bAlreadyInCallBack
+#ifdef VCL
+ && ((!Application::GetFocusWindow()) || !pEdit->IsChild( Application::GetFocusWindow()) )
+#endif
+ )
+ {
+ bCanceled = FALSE;
+ aTimer.SetTimeout(10);
+ aTimer.SetTimeoutHdl(LINK(this,SvInplaceEdit2,Timeout_Impl));
+ aTimer.Start();
+ }
+}
+
+IMPL_LINK_INLINE_START( SvInplaceEdit2, Timeout_Impl, Timer *, pTimer )
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ CallCallBackHdl_Impl();
+ return 0;
+}
+IMPL_LINK_INLINE_END( SvInplaceEdit2, Timeout_Impl, Timer *, pTimer )
+
+void SvInplaceEdit2::CallCallBackHdl_Impl()
+{
+ DBG_CHKTHIS(SvInplaceEdit2,0);
+ aTimer.Stop();
+ if ( !bAlreadyInCallBack )
+ {
+ bAlreadyInCallBack = TRUE;
+ GetpApp()->RemoveAccel( &aAccReturn );
+ GetpApp()->RemoveAccel( &aAccEscape );
+ pEdit->Hide();
+ aCallBackHdl.Call( this );
+ }
+}
+
+XubString SvInplaceEdit2::GetText() const
+{
+ return pEdit->GetText();
+}
+
+// ***************************************************************
+// class SvLBoxTab
+// ***************************************************************
+
+DBG_NAME(SvLBoxTab);
+
+SvLBoxTab::SvLBoxTab()
+{
+ DBG_CTOR(SvLBoxTab,0);
+ nPos = 0;
+ pUserData = 0;
+ nFlags = 0;
+}
+
+SvLBoxTab::SvLBoxTab( long nPosition, USHORT nTabFlags )
+{
+ DBG_CTOR(SvLBoxTab,0);
+ nPos = nPosition;
+ pUserData = 0;
+ nFlags = nTabFlags;
+}
+
+SvLBoxTab::SvLBoxTab( const SvLBoxTab& rTab )
+{
+ DBG_CTOR(SvLBoxTab,0);
+ nPos = rTab.nPos;
+ pUserData = rTab.pUserData;
+ nFlags = rTab.nFlags;
+}
+
+SvLBoxTab::~SvLBoxTab()
+{
+ DBG_DTOR(SvLBoxTab,0);
+}
+
+
+long SvLBoxTab::CalcOffset( long nItemWidth, long nTabWidth )
+{
+ DBG_CHKTHIS(SvLBoxTab,0);
+ long nOffset = 0;
+ if ( nFlags & SV_LBOXTAB_ADJUST_RIGHT )
+ {
+ nOffset = nTabWidth - nItemWidth;
+ if( nOffset < 0 )
+ nOffset = 0;
+ }
+ else if ( nFlags & SV_LBOXTAB_ADJUST_CENTER )
+ {
+ if( nFlags & SV_LBOXTAB_FORCE )
+ {
+ //richtige Implementierung der Zentrierung
+ nOffset = ( nTabWidth - nItemWidth ) / 2;
+ if( nOffset < 0 )
+ nOffset = 0;
+ }
+ else
+ {
+ // historisch gewachsene falsche Berechnung des Tabs, auf die sich
+ // Abo-Tabbox, Extras/Optionen/Anpassen etc. verlassen
+ nItemWidth++;
+ nOffset = -( nItemWidth / 2 );
+ }
+ }
+ return nOffset;
+}
+
+/*
+long SvLBoxTab::CalcOffset( const XubString& rStr, const OutputDevice& rOutDev )
+{
+ DBG_CHKTHIS(SvLBoxTab,0);
+ long nWidth;
+ if ( nFlags & SV_LBOXTAB_ADJUST_NUMERIC )
+ {
+ USHORT nPos = rStr.Search( '.' );
+ if ( nPos == STRING_NOTFOUND )
+ nPos = rStr.Search( ',' );
+ if ( nPos == STRING_NOTFOUND )
+ nPos = STRING_LEN;
+
+ nWidth = rOutDev.GetTextSize( rStr, 0, nPos ).Width();
+ nWidth *= -1;
+ }
+ else
+ {
+ nWidth = rOutDev.GetTextSize( rStr ).Width();
+ nWidth = CalcOffset( nWidth );
+ }
+ return nWidth;
+}
+*/
+
+// ***************************************************************
+// class SvLBoxItem
+// ***************************************************************
+
+DBG_NAME(SvLBoxItem);
+
+SvLBoxItem::SvLBoxItem( SvLBoxEntry*, USHORT )
+{
+ DBG_CTOR(SvLBoxItem,0);
+}
+
+SvLBoxItem::SvLBoxItem()
+{
+ DBG_CTOR(SvLBoxItem,0);
+}
+
+SvLBoxItem::~SvLBoxItem()
+{
+ DBG_DTOR(SvLBoxItem,0);
+}
+
+const Size& SvLBoxItem::GetSize( SvLBox* pView,SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvLBoxItem,0);
+ SvViewDataItem* pViewData = pView->GetViewDataItem( pEntry, this );
+ return pViewData->aSize;
+}
+
+const Size& SvLBoxItem::GetSize( SvLBoxEntry* pEntry, SvViewDataEntry* pViewData)
+{
+ DBG_CHKTHIS(SvLBoxItem,0);
+ USHORT nItemPos = pEntry->GetPos( this );
+ SvViewDataItem* pItemData = pViewData->pItemData+nItemPos;
+ return pItemData->aSize;
+}
+
+DBG_NAME(SvViewDataItem);
+
+SvViewDataItem::SvViewDataItem()
+{
+ DBG_CTOR(SvViewDataItem,0);
+}
+
+SvViewDataItem::~SvViewDataItem()
+{
+ DBG_DTOR(SvViewDataItem,0);
+}
+
+
+
+// ***************************************************************
+// class SvLBoxEntry
+// ***************************************************************
+
+DBG_NAME(SvLBoxEntry);
+
+SvLBoxEntry::SvLBoxEntry() : aItems()
+{
+ DBG_CTOR(SvLBoxEntry,0);
+ nEntryFlags = 0;
+ pUserData = 0;
+}
+
+SvLBoxEntry::~SvLBoxEntry()
+{
+ DBG_DTOR(SvLBoxEntry,0);
+ DeleteItems_Impl();
+}
+
+void SvLBoxEntry::DeleteItems_Impl()
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ USHORT nCount = aItems.Count();
+ while( nCount )
+ {
+ nCount--;
+ SvLBoxItem* pItem = (SvLBoxItem*)aItems.GetObject( nCount );
+ delete pItem;
+ }
+ aItems.Remove(0, aItems.Count() );
+}
+
+
+void SvLBoxEntry::AddItem( SvLBoxItem* pItem )
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ aItems.Insert( pItem, aItems.Count() );
+}
+
+void SvLBoxEntry::Clone( SvListEntry* pSource )
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ SvListEntry::Clone( pSource );
+ SvLBoxItem* pNewItem;
+ DeleteItems_Impl();
+ USHORT nCount = ((SvLBoxEntry*)pSource)->ItemCount();
+ USHORT nCurPos = 0;
+ while( nCurPos < nCount )
+ {
+ SvLBoxItem* pItem = ((SvLBoxEntry*)pSource)->GetItem( nCurPos );
+ pNewItem = pItem->Create();
+ pNewItem->Clone( pItem );
+ AddItem( pNewItem );
+ nCurPos++;
+ }
+ pUserData = ((SvLBoxEntry*)pSource)->GetUserData();
+ nEntryFlags = ((SvLBoxEntry*)pSource)->nEntryFlags;
+}
+
+void SvLBoxEntry::EnableChildsOnDemand( BOOL bEnable )
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ if ( bEnable )
+ nEntryFlags |= SV_ENTRYFLAG_CHILDS_ON_DEMAND;
+ else
+ nEntryFlags &= (~SV_ENTRYFLAG_CHILDS_ON_DEMAND);
+}
+
+void SvLBoxEntry::ReplaceItem( SvLBoxItem* pNewItem, USHORT nPos )
+{
+ DBG_CHKTHIS(SvLBoxEntry,0);
+ DBG_ASSERT(pNewItem,"ReplaceItem:No Item")
+ SvLBoxItem* pOld = GetItem( nPos );
+ if ( pOld )
+ {
+ aItems.Remove( nPos );
+ aItems.Insert( pNewItem, nPos );
+ delete pOld;
+ }
+}
+
+SvLBoxItem* SvLBoxEntry::GetFirstItem( USHORT nId )
+{
+ USHORT nCount = aItems.Count();
+ USHORT nCur = 0;
+ SvLBoxItem* pItem;
+ while( nCur < nCount )
+ {
+ pItem = GetItem( nCur );
+ if( pItem->IsA() == nId )
+ return pItem;
+ nCur++;
+ }
+ return 0;
+}
+
+// ***************************************************************
+// class SvLBoxViewData
+// ***************************************************************
+
+DBG_NAME(SvViewDataEntry);
+
+SvViewDataEntry::SvViewDataEntry()
+ : SvViewData()
+{
+ DBG_CTOR(SvViewDataEntry,0);
+ pItemData = 0;
+}
+
+SvViewDataEntry::~SvViewDataEntry()
+{
+ DBG_DTOR(SvViewDataEntry,0);
+ __DELETE(nItmCnt) pItemData;
+}
+
+// ***************************************************************
+// class SvLBox
+// ***************************************************************
+
+DBG_NAME(SvLBox);
+
+
+__EXPORT SvLBox::SvLBox( Window* pParent, WinBits nWinStyle ) :
+ Control( pParent, nWinStyle | WB_CLIPCHILDREN )
+{
+ DBG_CTOR(SvLBox,0);
+ nWindowStyle = nWinStyle;
+ nDragOptions = DRAG_ALL;
+ nImpFlags = 0;
+ pTargetEntry = 0;
+ nDragDropMode = 0;
+ pReserved = 0;
+ nReserved = 0;
+ SvLBoxTreeList* pTempModel = new SvLBoxTreeList;
+ pTempModel->SetRefCount( 0 );
+ SetModel( pTempModel );
+ pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
+ pModel->InsertView( this );
+ pHdlEntry = 0;
+ pEdCtrl = 0;
+ aMovePtr = Pointer( POINTER_MOVEDATA );
+ aCopyPtr = Pointer( POINTER_COPYDATA );
+ SetSelectionMode( SINGLE_SELECTION ); // pruefen ob TreeListBox gecallt wird
+ SetDragDropMode( SV_DRAGDROP_NONE );
+#ifdef MAC
+ Font aFont( "Geneva", Size( 0, 10 ) );
+ SetFont( aFont );
+#endif
+}
+
+__EXPORT SvLBox::SvLBox( Window* pParent, const ResId& rResId ) :
+ Control( pParent, rResId )
+{
+ DBG_CTOR(SvLBox,0);
+ pTargetEntry = 0;
+ nImpFlags = 0;
+ nWindowStyle = 0;
+ pReserved = 0;
+ nReserved = 0;
+ nDragOptions = DRAG_ALL;
+ nDragDropMode = 0;
+ SvLBoxTreeList* pTempModel = new SvLBoxTreeList;
+ pTempModel->SetRefCount( 0 );
+ SetModel( pTempModel );
+ pModel->InsertView( this );
+ pHdlEntry = 0;
+ pEdCtrl = 0;
+ pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
+ aMovePtr = Pointer( POINTER_MOVEDATA );
+ aCopyPtr = Pointer( POINTER_COPYDATA );
+#ifdef MAC
+ Font aFont( "Geneva", Size( 0, 10 ) );
+ SetFont( aFont );
+#endif
+}
+
+
+__EXPORT SvLBox::~SvLBox()
+{
+ DBG_DTOR(SvLBox,0);
+ delete pEdCtrl;
+ pEdCtrl = 0;
+ pModel->RemoveView( this );
+ if ( pModel->GetRefCount() == 0 )
+ {
+ pModel->Clear();
+ delete pModel;
+ }
+ if( nReserved )
+ {
+ *((BOOL*)nReserved) = TRUE;
+ }
+}
+
+void SvLBox::SetModel( SvLBoxTreeList* pNewModel )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ // erledigt das ganz CleanUp
+ SvListView::SetModel( pNewModel );
+ pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
+ SvLBoxEntry* pEntry = First();
+ while( pEntry )
+ {
+ ModelHasInserted( pEntry );
+ pEntry = Next( pEntry );
+ }
+}
+
+void SvLBox::DisconnectFromModel()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ SvLBoxTreeList* pNewModel = new SvLBoxTreeList;
+ SvListView::SetModel( pNewModel );
+}
+
+void SvLBox::Clear()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ pModel->Clear(); // Model ruft SvLBox::ModelHasCleared() auf
+}
+
+
+USHORT SvLBox::IsA()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return SVLISTBOX_ID_LBOX;
+}
+
+IMPL_LINK_INLINE_START( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return (long)(CloneEntry((SvLBoxEntry*)pEntry));
+}
+IMPL_LINK_INLINE_END( SvLBox, CloneHdl_Impl, SvListEntry*, pEntry )
+
+ULONG SvLBox::Insert( SvLBoxEntry* pEntry, SvLBoxEntry* pParent, ULONG nPos )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ ULONG nInsPos = pModel->Insert( pEntry, pParent, nPos );
+ return nInsPos;
+}
+
+ULONG SvLBox::Insert( SvLBoxEntry* pEntry,ULONG nRootPos )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ ULONG nInsPos = pModel->Insert( pEntry, nRootPos );
+ return nInsPos;
+}
+
+long SvLBox::ExpandingHdl()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return aExpandingHdl.IsSet() ? aExpandingHdl.Call( this ) : 1;
+}
+
+void SvLBox::ExpandedHdl()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ aExpandedHdl.Call( this );
+}
+
+void SvLBox::SelectHdl()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ aSelectHdl.Call( this );
+}
+
+void SvLBox::DeselectHdl()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ aDeselectHdl.Call( this );
+}
+
+BOOL SvLBox::DoubleClickHdl()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ aDoubleClickHdl.Call( this );
+ return TRUE;
+}
+
+void __EXPORT SvLBox::BeginDrag( const Point& rPos )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ BOOL bDeleted = FALSE;
+
+ ReleaseMouse();
+ SvLBoxDDInfo aDDInfo;
+ SvLBoxEntry* pEntry = GetEntry( rPos ); // GetDropTarget( rPos );
+ if ( !pEntry )
+ {
+ EndDrag();
+ return;
+ }
+
+ DragServer::Clear();
+
+ DragDropMode nTemp = GetDragDropMode();
+ nDragDropMode = NotifyBeginDrag(pEntry);
+ if( !nDragDropMode || GetSelectionCount() == 0 )
+ {
+ nDragDropMode = nTemp;
+ EndDrag();
+ return;
+ }
+
+ ULONG nDDFormatId = SOT_FORMATSTR_ID_TREELISTBOX;
+ memset(&aDDInfo,0,sizeof(SvLBoxDDInfo));
+ aDDInfo.pApp = GetpApp();
+ aDDInfo.pSource = this;
+ aDDInfo.pDDStartEntry = pEntry;
+ // abgeleitete Views zum Zuge kommen lassen
+ WriteDragServerInfo( rPos, &aDDInfo );
+ DragServer::CopyData( &aDDInfo, sizeof(SvLBoxDDInfo), nDDFormatId );
+ pDDSource = this;
+ pDDTarget = 0;
+ DropAction eAction;
+
+ BOOL bOldUpdateMode = Control::IsUpdateMode();
+ Control::SetUpdateMode( TRUE );
+ Update();
+ Control::SetUpdateMode( bOldUpdateMode );
+
+ // Selektion & deren Childs im Model als DropTargets sperren
+ // Wichtig: Wenn im DropHandler die Selektion der
+ // SourceListBox veraendert wird, muessen vorher die Eintraege
+ // als DropTargets wieder freigeschaltet werden:
+ // (GetSourceListBox()->EnableSelectionAsDropTarget( TRUE, TRUE );)
+ EnableSelectionAsDropTarget( FALSE, TRUE /* with Childs */ );
+
+ Region aRegion( GetDragRegion() ); // fuer die Mac-Leute
+ nReserved = (ULONG)&bDeleted;
+ eAction = ExecuteDrag( aMovePtr, aCopyPtr, nDragOptions, &aRegion );
+ nReserved = 0;
+ if( bDeleted )
+ {
+ EndDrag();
+ return;
+ }
+
+ EnableSelectionAsDropTarget( TRUE, TRUE );
+
+ if( (eAction == DROP_MOVE) &&
+ (
+ (pDDTarget && ((ULONG)(pDDTarget->GetModel())!=(ULONG)(this->GetModel()))) ||
+ !pDDTarget ))
+ {
+ RemoveSelection();
+ }
+
+ ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ EndDrag();
+ nDragDropMode = nTemp;
+}
+
+
+void SvLBox::EndDrag()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ pDDSource = 0;
+ pDDTarget = 0;
+ pTargetEntry = 0;
+}
+
+BOOL SvLBox::CheckDragAndDropMode( SvLBox* pSource, DropAction eAction )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ if ( pSource == this )
+ {
+ if ( !(nDragDropMode & (SV_DRAGDROP_CTRL_MOVE | SV_DRAGDROP_CTRL_COPY) ) )
+ return FALSE; // D&D innerhalb der Liste gesperrt
+ if ( eAction == DROP_MOVE )
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_CTRL_MOVE) )
+ return FALSE; // kein lokales Move
+ }
+ else
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_CTRL_COPY))
+ return FALSE; // kein lokales Copy
+ }
+ }
+ else
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_APP_DROP ) )
+ return FALSE; // kein Drop
+ if ( eAction == DROP_MOVE )
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_APP_MOVE) )
+ return FALSE; // kein globales Move
+ }
+ else
+ {
+ if ( !(nDragDropMode & SV_DRAGDROP_APP_COPY))
+ return FALSE; // kein globales Copy
+ }
+ }
+ return TRUE;
+}
+
+
+BOOL __EXPORT SvLBox::QueryDrop( DropEvent& rDEvt )
+{
+ DBG_CHKTHIS(SvLBox,0);
+
+ if ( rDEvt.IsLeaveWindow() || !CheckDragAndDropMode( pDDSource, rDEvt.GetAction() ) )
+ {
+ ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ return FALSE;
+ }
+
+ if ( !nDragDropMode )
+ {
+ DBG_ERRORFILE( "SvLBox::QueryDrop(): no target" );
+ return FALSE;
+ }
+
+ BOOL bAllowDrop = TRUE;
+
+ ULONG nDDFormatId = SOT_FORMATSTR_ID_TREELISTBOX;
+ if ( !DragServer::HasFormat( 0, nDDFormatId ) )
+ {
+ DBG_ERRORFILE( "SvLBox::QueryDrop(): no format" );
+ bAllowDrop = FALSE;
+ }
+
+ SvLBoxEntry* pEntry = GetDropTarget( rDEvt.GetPosPixel() );
+
+ if ( bAllowDrop )
+ {
+ DBG_ASSERT( pDDSource, "SvLBox::QueryDrop(): SourceBox == 0 (__EXPORT?)" );
+ if ( pEntry && pDDSource->GetModel() == this->GetModel()
+ && rDEvt.GetAction()==DROP_MOVE
+ && ( pEntry->nEntryFlags & SV_ENTRYFLAG_DISABLE_DROP ) )
+ {
+ bAllowDrop = FALSE; // nicht auf sich selbst moven
+ }
+ }
+ if ( bAllowDrop )
+ bAllowDrop = NotifyQueryDrop( pEntry );
+
+
+ // **** Emphasis zeichnen ****
+
+ if ( bAllowDrop )
+ {
+ if ( pEntry != pTargetEntry || !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
+ {
+ ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ pTargetEntry = pEntry;
+ ImplShowTargetEmphasis( pTargetEntry, TRUE );
+ }
+ }
+ else
+ ImplShowTargetEmphasis( pTargetEntry, FALSE );
+
+ return bAllowDrop;
+}
+
+BOOL __EXPORT SvLBox::Drop( const DropEvent& rDEvt )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ GetSourceView()->EnableSelectionAsDropTarget( TRUE, TRUE );
+
+ ImplShowTargetEmphasis( pTargetEntry, FALSE );
+ pDDTarget = this;
+ ULONG nDDFormatId = SOT_FORMATSTR_ID_TREELISTBOX;
+
+ SvLBoxDDInfo aDDInfo;
+ if( !DragServer::PasteData(0, &aDDInfo, sizeof(SvLBoxDDInfo),nDDFormatId ))
+ return FALSE;
+ ReadDragServerInfo( rDEvt.GetPosPixel(), &aDDInfo );
+
+ SvLBoxEntry* pTarget = pTargetEntry; // !!! kann 0 sein !!!
+ BOOL bDataAccepted;
+ if ( rDEvt.GetAction() == DROP_COPY )
+ bDataAccepted = CopySelection( aDDInfo.pSource, pTarget );
+ else
+ bDataAccepted = MoveSelection( aDDInfo.pSource, pTarget );
+ return bDataAccepted;
+}
+
+DragDropMode SvLBox::NotifyBeginDrag( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return (DragDropMode)0xffff;
+}
+
+BOOL SvLBox::NotifyQueryDrop( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return TRUE;
+}
+
+void SvLBox::NotifyRemoving( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+/*
+ NotifyMoving/Copying
+ ====================
+
+ Standard-Verhalten:
+
+ 1. Target hat keine Childs
+ - Entry wird Sibling des Targets. Entry steht hinter dem
+ Target (->Fenster: Unter dem Target)
+ 2. Target ist ein aufgeklappter Parent
+ - Entry wird an den Anfang der Target-Childlist gehaengt
+ 3. Target ist ein zugeklappter Parent
+ - Entry wird an das Ende der Target-Childlist gehaengt
+*/
+
+BOOL SvLBox::NotifyMoving(
+ SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
+ SvLBoxEntry* pEntry, // Zu verschiebender Entry aus
+ // GetSourceListBox()->GetModel()
+ SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
+ ULONG& rNewChildPos) // Position in Childlist des Target-Parents
+{
+ DBG_CHKTHIS(SvLBox,0);
+ DBG_ASSERT(pEntry,"NotifyMoving:SoureEntry?")
+ if( !pTarget )
+ {
+ rpNewParent = 0;
+ rNewChildPos = 0;
+ return TRUE;
+ }
+ if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() )
+ {
+ // Fall 1
+ rpNewParent = GetParent( pTarget );
+ rNewChildPos = pModel->GetRelPos( pTarget ) + 1;
+ rNewChildPos += nCurEntrySelPos;
+ nCurEntrySelPos++;
+ }
+ else
+ {
+ // Faelle 2 & 3
+ rpNewParent = pTarget;
+ if( IsExpanded(pTarget))
+ rNewChildPos = 0;
+ else
+ rNewChildPos = LIST_APPEND;
+ }
+ return TRUE;
+}
+
+BOOL SvLBox::NotifyCopying(
+ SvLBoxEntry* pTarget, // D&D-Drop-Position in this->GetModel()
+ SvLBoxEntry* pEntry, // Zu kopierender Entry aus
+ // GetSourceListBox()->GetModel()
+ SvLBoxEntry*& rpNewParent, // Neuer Target-Parent
+ ULONG& rNewChildPos) // Position in Childlist des Target-Parents
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return NotifyMoving(pTarget,pEntry,rpNewParent,rNewChildPos);
+ /*
+ DBG_ASSERT(pEntry,"NotifyCopying:SourceEntry?")
+ if( !pTarget )
+ {
+ rpNewParent = 0;
+ rNewChildPos = 0;
+ return TRUE;
+ }
+ if ( !pTarget->HasChilds() && !pTarget->HasChildsOnDemand() )
+ {
+ // Fall 1
+ rpNewParent = GetParent( pTarget );
+ rNewChildPos = GetRelPos( pTarget ) + 1;
+ }
+ else
+ {
+ // Faelle 2 & 3
+ rpNewParent = pTarget;
+ if( IsExpanded(pTarget))
+ rNewChildPos = 0;
+ else
+ rNewChildPos = LIST_APPEND;
+ }
+ return TRUE;
+ */
+}
+
+SvLBoxEntry* __EXPORT SvLBox::CloneEntry( SvLBoxEntry* pSource )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ SvLBoxEntry* pEntry = (SvLBoxEntry*)CreateEntry(); // new SvLBoxEntry;
+ pEntry->Clone( (SvListEntry*)pSource );
+ return pEntry;
+}
+
+
+// Rueckgabe: Alle Entries wurden kopiert
+BOOL SvLBox::CopySelection( SvLBox* pSource, SvLBoxEntry* pTarget )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying
+ BOOL bSuccess = TRUE;
+ SvTreeEntryList aList;
+ BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() );
+ Link aCloneLink( pModel->GetCloneLink() );
+ pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
+
+ // Selektion zwischenspeichern, um bei D&D-Austausch
+ // innerhalb der gleichen Listbox das Iterieren ueber
+ // die Selektion zu vereinfachen
+ SvLBoxEntry* pSourceEntry = pSource->FirstSelected();
+ while ( pSourceEntry )
+ {
+ // Childs werden automatisch mitkopiert
+ pSource->SelectChilds( pSourceEntry, FALSE );
+ aList.Insert( pSourceEntry, LIST_APPEND );
+ pSourceEntry = pSource->NextSelected( pSourceEntry );
+ }
+
+ pSourceEntry = (SvLBoxEntry*)aList.First();
+ while ( pSourceEntry )
+ {
+ SvLBoxEntry* pNewParent = 0;
+ ULONG nInsertionPos = LIST_APPEND;
+ BOOL bOk=NotifyCopying(pTarget,pSourceEntry,pNewParent,nInsertionPos);
+ if ( bOk )
+ {
+ if ( bClone )
+ {
+ ULONG nCloneCount = 0;
+ pSourceEntry = (SvLBoxEntry*)
+ pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
+ pModel->InsertTree( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ }
+ else
+ {
+ ULONG nListPos = pModel->Copy( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ pSourceEntry = GetEntry( pNewParent, nListPos );
+ }
+ }
+ else
+ bSuccess = FALSE;
+
+ if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen?
+ MakeVisible( pSourceEntry );
+
+ pSourceEntry = (SvLBoxEntry*)aList.Next();
+ }
+ pModel->SetCloneLink( aCloneLink );
+ return bSuccess;
+}
+
+// Rueckgabe: Alle Entries wurden verschoben
+BOOL SvLBox::MoveSelection( SvLBox* pSource, SvLBoxEntry* pTarget )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ nCurEntrySelPos = 0; // Selektionszaehler fuer NotifyMoving/Copying
+ BOOL bSuccess = TRUE;
+ SvTreeEntryList aList;
+ BOOL bClone = (BOOL)( (ULONG)(pSource->GetModel()) != (ULONG)GetModel() );
+ Link aCloneLink( pModel->GetCloneLink() );
+ if ( bClone )
+ pModel->SetCloneLink( LINK(this, SvLBox, CloneHdl_Impl ));
+
+ SvLBoxEntry* pSourceEntry = pSource->FirstSelected();
+ while ( pSourceEntry )
+ {
+ // Childs werden automatisch mitbewegt
+ pSource->SelectChilds( pSourceEntry, FALSE );
+ aList.Insert( pSourceEntry, LIST_APPEND );
+ pSourceEntry = pSource->NextSelected( pSourceEntry );
+ }
+
+ pSourceEntry = (SvLBoxEntry*)aList.First();
+ while ( pSourceEntry )
+ {
+ SvLBoxEntry* pNewParent = 0;
+ ULONG nInsertionPos = LIST_APPEND;
+ BOOL bOk= NotifyMoving(pTarget,pSourceEntry,pNewParent,nInsertionPos);
+ if ( bOk )
+ {
+ if ( bClone )
+ {
+ ULONG nCloneCount = 0;
+ pSourceEntry = (SvLBoxEntry*)
+ pModel->Clone( (SvListEntry*)pSourceEntry, nCloneCount );
+ pModel->InsertTree( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ }
+ else
+ pModel->Move( (SvListEntry*)pSourceEntry,
+ (SvListEntry*)pNewParent, nInsertionPos );
+ }
+ else
+ bSuccess = FALSE;
+
+ if( bOk == (BOOL)2 ) // !!!HACK verschobenen Entry sichtbar machen?
+ MakeVisible( pSourceEntry );
+
+ pSourceEntry = (SvLBoxEntry*)aList.Next();
+ }
+ pModel->SetCloneLink( aCloneLink );
+ return bSuccess;
+}
+
+void SvLBox::RemoveSelection()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ SvTreeEntryList aList;
+ // Selektion zwischenspeichern, da die Impl bei
+ // dem ersten Remove alles deselektiert!
+ SvLBoxEntry* pEntry = FirstSelected();
+ while ( pEntry )
+ {
+ aList.Insert( pEntry );
+ if ( pEntry->HasChilds() )
+ // Remove loescht Childs automatisch
+ SelectChilds( pEntry, FALSE );
+ pEntry = NextSelected( pEntry );
+ }
+ pEntry = (SvLBoxEntry*)aList.First();
+ while ( pEntry )
+ {
+ pModel->Remove( pEntry );
+ pEntry = (SvLBoxEntry*)aList.Next();
+ }
+}
+
+
+SvLBox* __EXPORT SvLBox::GetSourceView() const
+ { return pDDSource; }
+
+SvLBox* __EXPORT SvLBox::GetTargetView() const
+ { return pDDTarget; }
+
+void SvLBox::RequestingChilds( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ DBG_ERROR("Child-Request-Hdl not implemented!")
+}
+
+void SvLBox::RecalcViewData()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ SvLBoxEntry* pEntry = First();
+ while( pEntry )
+ {
+ USHORT nCount = pEntry->ItemCount();
+ USHORT nCurPos = 0;
+ while ( nCurPos < nCount )
+ {
+ SvLBoxItem* pItem = pEntry->GetItem( nCurPos );
+ pItem->InitViewData( this, pEntry );
+ nCurPos++;
+ }
+ ViewDataInitialized( pEntry );
+ pEntry = Next( pEntry );
+ }
+}
+
+void SvLBox::ViewDataInitialized( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+
+void SvLBox::ImplShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL bShow)
+{
+ DBG_CHKTHIS(SvLBox,0);
+ if ( bShow && (nImpFlags & SVLBOX_TARGEMPH_VIS) )
+ return;
+ if ( !bShow && !(nImpFlags & SVLBOX_TARGEMPH_VIS) )
+ return;
+ ShowTargetEmphasis( pEntry, bShow );
+ if( bShow )
+ nImpFlags |= SVLBOX_TARGEMPH_VIS;
+ else
+ nImpFlags &= ~SVLBOX_TARGEMPH_VIS;
+}
+
+void SvLBox::ShowTargetEmphasis( SvLBoxEntry*, BOOL /* bShow */ )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+
+BOOL SvLBox::Expand( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return TRUE;
+}
+
+BOOL SvLBox::Collapse( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return TRUE;
+}
+
+BOOL SvLBox::Select( SvLBoxEntry*, BOOL )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return FALSE;
+}
+
+ULONG SvLBox::SelectChilds( SvLBoxEntry* , BOOL )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return 0;
+}
+
+void SvLBox::SelectAll( BOOL /* bSelect */ , BOOL /* bPaint */ )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+void SvLBox::SetSelectionMode( SelectionMode eSelectMode )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ eSelMode = eSelectMode;
+}
+
+void SvLBox::SetDragDropMode( DragDropMode nDDMode )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ if( nDDMode && !nDragDropMode )
+ EnableDrop();
+ nDragDropMode = nDDMode;
+}
+
+SvViewData* SvLBox::CreateViewData( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ SvViewDataEntry* pEntryData = new SvViewDataEntry;
+ return (SvViewData*)pEntryData;
+}
+
+void SvLBox::InitViewData( SvViewData* pData, SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ SvLBoxEntry* pInhEntry = (SvLBoxEntry*)pEntry;
+ SvViewDataEntry* pEntryData = (SvViewDataEntry*)pData;
+
+ pEntryData->pItemData = new SvViewDataItem[ pInhEntry->ItemCount() ];
+ SvViewDataItem* pItemData = pEntryData->pItemData;
+ pEntryData->nItmCnt = pInhEntry->ItemCount(); // Anzahl Items fuer delete
+ USHORT nCount = pInhEntry->ItemCount();
+ USHORT nCurPos = 0;
+ while( nCurPos < nCount )
+ {
+ SvLBoxItem* pItem = pInhEntry->GetItem( nCurPos );
+ pItem->InitViewData( this, pInhEntry, pItemData );
+ pItemData++;
+ nCurPos++;
+ }
+}
+
+
+
+void SvLBox::EnableSelectionAsDropTarget( BOOL bEnable, BOOL bWithChilds )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ USHORT nRefDepth;
+ SvLBoxEntry* pTemp;
+
+ SvLBoxEntry* pSelEntry = FirstSelected();
+ while( pSelEntry )
+ {
+ if ( !bEnable )
+ {
+ pSelEntry->nEntryFlags |= SV_ENTRYFLAG_DISABLE_DROP;
+ if ( bWithChilds )
+ {
+ nRefDepth = pModel->GetDepth( pSelEntry );
+ pTemp = Next( pSelEntry );
+ while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
+ {
+ pTemp->nEntryFlags |= SV_ENTRYFLAG_DISABLE_DROP;
+ pTemp = Next( pTemp );
+ }
+ }
+ }
+ else
+ {
+ pSelEntry->nEntryFlags &= (~SV_ENTRYFLAG_DISABLE_DROP);
+ if ( bWithChilds )
+ {
+ nRefDepth = pModel->GetDepth( pSelEntry );
+ pTemp = Next( pSelEntry );
+ while( pTemp && pModel->GetDepth( pTemp ) > nRefDepth )
+ {
+ pTemp->nEntryFlags &= (~SV_ENTRYFLAG_DISABLE_DROP);
+ pTemp = Next( pTemp );
+ }
+ }
+ }
+ pSelEntry = NextSelected( pSelEntry );
+ }
+}
+
+SvLBoxEntry* SvLBox::GetDropTarget( const Point& )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return 0;
+}
+
+// ******************************************************************
+// InplaceEditing
+// ******************************************************************
+
+void SvLBox::EditText( const XubString& rStr, const Rectangle& rRect,
+ const Selection& rSel )
+{
+ EditText( rStr, rRect, rSel, FALSE );
+}
+
+void SvLBox::EditText( const XubString& rStr, const Rectangle& rRect,
+ const Selection& rSel, BOOL bMulti )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ if( pEdCtrl )
+ delete pEdCtrl;
+ nImpFlags |= SVLBOX_IN_EDT;
+ nImpFlags &= ~SVLBOX_EDTEND_CALLED;
+ HideFocus();
+ pEdCtrl = new SvInplaceEdit2(
+ this, rRect.TopLeft(), rRect.GetSize(), rStr,
+ LINK( this, SvLBox, TextEditEndedHdl_Impl ),
+ rSel, bMulti );
+}
+
+IMPL_LINK( SvLBox, TextEditEndedHdl_Impl, SvInplaceEdit2 *, pSvInplaceEdit )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ if ( nImpFlags & SVLBOX_EDTEND_CALLED ) // Nesting verhindern
+ return 0;
+ nImpFlags |= SVLBOX_EDTEND_CALLED;
+ XubString aStr;
+ if ( !pEdCtrl->EditingCanceled() )
+ aStr = pEdCtrl->GetText();
+ else
+ aStr = pEdCtrl->GetSavedValue();
+ EditedText( aStr );
+ // Hide darf erst gerufen werden, nachdem der neue Text in den
+ // Entry gesetzt wurde, damit im GetFocus der ListBox nicht
+ // der Selecthandler mit dem alten EntryText gerufen wird.
+ pEdCtrl->Hide();
+ // delete pEdCtrl;
+ // pEdCtrl = 0;
+ nImpFlags &= (~SVLBOX_IN_EDT);
+// GrabFocus();
+ return 0;
+}
+
+void SvLBox::CancelTextEditing()
+{
+ DBG_CHKTHIS(SvLBox,0);
+ if ( pEdCtrl )
+ pEdCtrl->StopEditing( TRUE );
+ nImpFlags &= (~SVLBOX_IN_EDT);
+}
+
+void SvLBox::EndEditing( BOOL bCancel )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ if( pEdCtrl )
+ pEdCtrl->StopEditing( bCancel );
+ nImpFlags &= (~SVLBOX_IN_EDT);
+}
+
+
+void SvLBox::EditedText( const XubString& )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+void SvLBox::EditingRequest( SvLBoxEntry*, SvLBoxItem*,const Point& )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+
+SvLBoxEntry* SvLBox::CreateEntry() const
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return new SvLBoxEntry;
+}
+
+void SvLBox::MakeVisible( SvLBoxEntry* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+Region SvLBox::GetDragRegion() const
+{
+ DBG_CHKTHIS(SvLBox,0);
+ Region aRegion;
+ return aRegion;
+}
+
+void SvLBox::Command( const CommandEvent& )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+SvLBoxEntry* SvLBox::GetEntry( const Point& rPos, BOOL ) const
+{
+ DBG_CHKTHIS(SvLBox,0);
+ return 0;
+}
+
+void __EXPORT SvLBox::ModelHasEntryInvalidated( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ USHORT nCount = ((SvLBoxEntry*)pEntry)->ItemCount();
+ for( USHORT nIdx = 0; nIdx < nCount; nIdx++ )
+ {
+ SvLBoxItem* pItem = ((SvLBoxEntry*)pEntry)->GetItem( nIdx );
+ pItem->InitViewData( this, (SvLBoxEntry*)pEntry, 0 );
+ }
+}
+
+void SvLBox::SetInUseEmphasis( SvLBoxEntry* pEntry, BOOL bInUse )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
+ if( bInUse )
+ {
+ if( !pEntry->HasInUseEmphasis() )
+ {
+ pEntry->nEntryFlags |= SV_ENTRYFLAG_IN_USE;
+ pModel->InvalidateEntry( pEntry );
+ }
+ }
+ else
+ {
+ if( pEntry->HasInUseEmphasis() )
+ {
+ pEntry->nEntryFlags &= (~SV_ENTRYFLAG_IN_USE);
+ pModel->InvalidateEntry( pEntry );
+ }
+ }
+}
+
+void SvLBox::SetCursorEmphasis( SvLBoxEntry* pEntry, BOOL bCursored )
+{
+ DBG_CHKTHIS(SvLBox,0);
+ DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
+ SvViewDataEntry* pViewData = GetViewDataEntry( pEntry );
+ if( pViewData && (bCursored != pViewData->IsCursored()) )
+ {
+ pViewData->SetCursored( bCursored );
+ // paintet in allen Views
+ // pModel->InvalidateEntry( pEntry );
+ // invalidiert nur in dieser View
+ ModelHasEntryInvalidated( pEntry );
+ }
+}
+
+BOOL SvLBox::HasCursorEmphasis( SvLBoxEntry* pEntry ) const
+{
+ DBG_CHKTHIS(SvLBox,0);
+ DBG_ASSERT(pEntry,"SetInUseEmphasis:No Entry");
+ SvViewDataEntry* pViewData = GetViewDataEntry( pEntry );
+ DBG_ASSERT(pViewData,"Entry not in View");
+ return pViewData->IsCursored();
+}
+
+void SvLBox::WriteDragServerInfo( const Point&, SvLBoxDDInfo* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+void SvLBox::ReadDragServerInfo(const Point&, SvLBoxDDInfo* )
+{
+ DBG_CHKTHIS(SvLBox,0);
+}
+
+BOOL SvLBox::EditingCanceled() const
+{
+ if( pEdCtrl && pEdCtrl->EditingCanceled() )
+ return TRUE;
+ return FALSE;
+}
+
+
diff --git a/svtools/source/contnr/svtabbx.cxx b/svtools/source/contnr/svtabbx.cxx
new file mode 100644
index 000000000000..2ab576bc2d54
--- /dev/null
+++ b/svtools/source/contnr/svtabbx.cxx
@@ -0,0 +1,639 @@
+/*************************************************************************
+ *
+ * $RCSfile: svtabbx.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+/*
+ Todo
+ - Tokenparsing optimieren
+ - Optimierungsfehler Microsoft/Win3.1 Funktion suchen
+*/
+
+// !!!HACK
+#ifdef _MSC_VER
+#pragma optimize( "", off )
+#endif
+#pragma hdrstop
+
+#include "svtabbx.hxx"
+#include "headbar.hxx"
+
+#define MYTABMASK (SV_LBOXTAB_ADJUST_RIGHT | SV_LBOXTAB_ADJUST_LEFT |\
+ SV_LBOXTAB_ADJUST_CENTER | SV_LBOXTAB_ADJUST_NUMERIC)
+
+// SvTreeListBox-Callback
+
+void SvTabListBox::SetTabs()
+{
+ SvTreeListBox::SetTabs();
+ if( nTabCount )
+ {
+ DBG_ASSERT(pTabList,"TabList ?");
+
+ // die TreeListBox hat jetzt ihre Tabulatoren in die Liste eingefuegt.
+ // jetzt plustern wir die Liste mit zusaetzlichen Tabulatoren auf,
+ // und passen den ganz rechten Tab der Treelistbox an.
+
+ // den ganz rechten Tab nehmen
+ // HACK fuer den Explorer! Wenn der ViewParent != 0 ist, dann wird
+ // der erste Tab der TreeListBox von der TreelistBox berechnet!
+ // Dies wird fuer ButtonsOnRoot benoetigt, da der Explorer nicht
+ // weiss, welchen zusaetzlichen Offset er in diesem Modus auf
+ // den Tabulator addieren muss. Die TreeListBox weiss es!
+ /*
+ if( !pViewParent )
+ {
+ SvLBoxTab* pFirstTab = (SvLBoxTab*)aTabs.GetObject( aTabs.Count()-1 );
+ pFirstTab->SetPos( pTabList[0].GetPos() );
+ pFirstTab->nFlags &= ~MYTABMASK;
+ pFirstTab->nFlags |= pTabList[0].nFlags;
+ }
+ */
+
+ // alle anderen Tabs an Liste haengen
+ for( USHORT nCurTab = 1; nCurTab < nTabCount; nCurTab++ )
+ {
+ SvLBoxTab* pTab = pTabList+nCurTab;
+ AddTab( pTab->GetPos(), pTab->nFlags );
+ }
+ }
+}
+
+void SvTabListBox::InitEntry( SvLBoxEntry* pEntry, const XubString& rStr,
+ const Image& rColl, const Image& rExp )
+{
+ SvTreeListBox::InitEntry( pEntry, rStr, rColl, rExp);
+ XubString aToken;
+
+ const xub_Unicode* pCurToken = aCurEntry.GetBuffer();
+ USHORT nCurTokenLen;
+ const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen );
+ USHORT nCount = nTabCount; nCount--;
+ for( USHORT nToken = 0; nToken < nCount; nToken++ )
+ {
+ if( pCurToken && nCurTokenLen )
+ // aToken.Assign( pCurToken, nCurTokenLen );
+ aToken = XubString( pCurToken, nCurTokenLen );
+ else
+ aToken.Erase();
+ SvLBoxString* pStr = new SvLBoxString( pEntry, 0, aToken );
+ pEntry->AddItem( pStr );
+ pCurToken = pNextToken;
+ if( pCurToken )
+ pNextToken = GetToken( pCurToken, nCurTokenLen );
+ else
+ nCurTokenLen = 0;
+ }
+}
+
+
+SvTabListBox::SvTabListBox( Window* pParent, WinBits nBits )
+ : SvTreeListBox( pParent, nBits )
+{
+ pTabList = 0;
+ nTabCount = 0;
+ pViewParent = 0;
+ SetHighlightRange(); // ueber volle Breite selektieren
+}
+
+SvTabListBox::SvTabListBox( Window* pParent, const ResId& rResId )
+ : SvTreeListBox( pParent, rResId )
+{
+ pTabList = 0;
+ nTabCount = 0;
+ pViewParent = 0;
+ SvTabListBox::Resize();
+ SetHighlightRange();
+}
+
+SvTabListBox::~SvTabListBox()
+{
+ // array-delete
+ __DELETE(nTabCount) pTabList;
+#ifdef DBG_UTIL
+ pTabList = 0;
+ nTabCount = 0;
+#endif
+}
+
+void SvTabListBox::SetTabs( long* pTabs, MapUnit eMapUnit )
+{
+ DBG_ASSERT(pTabs,"SetTabs:NULL-Ptr");
+ if( !pTabs )
+ return;
+
+ __DELETE(nTabCount) pTabList;
+ USHORT nCount = (USHORT)(*pTabs);
+ pTabList = new SvLBoxTab[ nCount ];
+ nTabCount = nCount;
+
+ MapMode aMMSource( eMapUnit );
+ MapMode aMMDest( MAP_PIXEL );
+
+ pTabs++;
+ for( USHORT nIdx = 0; nIdx < nCount; nIdx++, pTabs++ )
+ {
+ Size aSize( *pTabs, 0 );
+ aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
+ long nNewTab = aSize.Width();
+ pTabList[nIdx].SetPos( nNewTab );
+ pTabList[nIdx].nFlags=(SV_LBOXTAB_ADJUST_LEFT| SV_LBOXTAB_INV_ALWAYS);
+ }
+ SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
+ if( IsUpdateMode() )
+ Invalidate();
+}
+
+void SvTabListBox::SetTab( USHORT nTab,long nValue,MapUnit eMapUnit )
+{
+ DBG_ASSERT(nTab<nTabCount,"Invalid Tab-Pos");
+ if( nTab < nTabCount )
+ {
+ DBG_ASSERT(pTabList,"TabList?");
+ MapMode aMMSource( eMapUnit );
+ MapMode aMMDest( MAP_PIXEL );
+ Size aSize( nValue, 0 );
+ aSize = LogicToLogic( aSize, &aMMSource, &aMMDest );
+ nValue = aSize.Width();
+ pTabList[ nTab ].SetPos( nValue );
+ SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
+ if( IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+#if SUPD < 375
+
+SvLBoxEntry* SvTabListBox::InsertEntry(const XubString& rStr,SvLBoxEntry* pParent,ULONG nPos,USHORT nCol )
+{
+ XubString aStr;
+ if( nCol != 0xffff )
+ {
+ while( nCol )
+ {
+ aStr += '\t';
+ nCol--;
+ }
+ }
+ aStr += rStr;
+ XubString aFirstStr( aStr );
+ USHORT nEnd = aFirstStr.Search( '\t' );
+ if( nEnd != STRING_NOTFOUND )
+ {
+ aFirstStr.Cut( nEnd );
+ aCurEntry = aStr;
+ aCurEntry.Erase( 0, ++nEnd );
+ }
+ else
+ aCurEntry.Erase();
+ return SvTreeListBox::InsertEntry( aFirstStr, pParent, FALSE, nPos );
+}
+
+SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rStr,
+ const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
+ SvLBoxEntry* pParent,ULONG nPos,USHORT nCol )
+{
+ XubString aStr;
+ if( nCol != 0xffff )
+ {
+ while( nCol )
+ {
+ aStr += '\t';
+ nCol--;
+ }
+ }
+ aStr += rStr;
+ XubString aFirstStr( aStr );
+ USHORT nEnd = aFirstStr.Search( '\t' );
+ if( nEnd != STRING_NOTFOUND )
+ {
+ aFirstStr.Cut( nEnd );
+ aCurEntry = aStr;
+ aCurEntry.Erase( 0, ++nEnd );
+ }
+ else
+ aCurEntry.Erase();
+
+ return SvTreeListBox::InsertEntry(
+ aFirstStr,
+ rExpandedEntryBmp, rCollapsedEntryBmp,
+ pParent, FALSE, nPos );
+}
+
+
+SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rStr, ULONG nPos,
+ USHORT nCol )
+{
+ return InsertEntry( rStr,0,nPos, nCol );
+}
+
+SvLBoxEntry* SvTabListBox::InsertEntry(const XubString& rStr,SvLBoxEntry* pParent,ULONG nPos,USHORT nCol,
+ void* pUser )
+{
+ XubString aStr;
+ if( nCol != 0xffff )
+ {
+ while( nCol )
+ {
+ aStr += '\t';
+ nCol--;
+ }
+ }
+ aStr += rStr;
+ XubString aFirstStr( aStr );
+ USHORT nEnd = aFirstStr.Search( '\t' );
+ if( nEnd != STRING_NOTFOUND )
+ {
+ aFirstStr.Cut( nEnd );
+ aCurEntry = aStr;
+ aCurEntry.Erase( 0, ++nEnd );
+ }
+ else
+ aCurEntry.Erase();
+ return SvTreeListBox::InsertEntry( aFirstStr, pParent, FALSE, nPos, pUser );
+}
+
+SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rStr,
+ const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
+ SvLBoxEntry* pParent,ULONG nPos,USHORT nCol, void* pUser )
+{
+ XubString aStr;
+ if( nCol != 0xffff )
+ {
+ while( nCol )
+ {
+ aStr += '\t';
+ nCol--;
+ }
+ }
+ aStr += rStr;
+ XubString aFirstStr( aStr );
+ USHORT nEnd = aFirstStr.Search( '\t' );
+ if( nEnd != STRING_NOTFOUND )
+ {
+ aFirstStr.Cut( nEnd );
+ aCurEntry = aStr;
+ aCurEntry.Erase( 0, ++nEnd );
+ }
+ else
+ aCurEntry.Erase();
+
+ return SvTreeListBox::InsertEntry(
+ aFirstStr,
+ rExpandedEntryBmp, rCollapsedEntryBmp,
+ pParent, FALSE, nPos, pUser );
+}
+
+
+SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rStr, ULONG nPos,
+ USHORT nCol, void* pUser )
+{
+ return InsertEntry( rStr,0,nPos, nCol, pUser );
+}
+
+#else
+
+SvLBoxEntry* SvTabListBox::InsertEntry(const XubString& rStr,SvLBoxEntry* pParent,ULONG nPos,USHORT nCol,
+ void* pUser )
+{
+ XubString aStr;
+ if( nCol != 0xffff )
+ {
+ while( nCol )
+ {
+ aStr += '\t';
+ nCol--;
+ }
+ }
+ aStr += rStr;
+ XubString aFirstStr( aStr );
+ USHORT nEnd = aFirstStr.Search( '\t' );
+ if( nEnd != STRING_NOTFOUND )
+ {
+ aFirstStr.Erase( nEnd );
+ aCurEntry = aStr;
+ aCurEntry.Erase( 0, ++nEnd );
+ }
+ else
+ aCurEntry.Erase();
+ return SvTreeListBox::InsertEntry( aFirstStr, pParent, FALSE, nPos, pUser );
+}
+
+SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rStr,
+ const Image& rExpandedEntryBmp, const Image& rCollapsedEntryBmp,
+ SvLBoxEntry* pParent,ULONG nPos,USHORT nCol, void* pUser )
+{
+ XubString aStr;
+ if( nCol != 0xffff )
+ {
+ while( nCol )
+ {
+ aStr += '\t';
+ nCol--;
+ }
+ }
+ aStr += rStr;
+ XubString aFirstStr( aStr );
+ USHORT nEnd = aFirstStr.Search( '\t' );
+ if( nEnd != STRING_NOTFOUND )
+ {
+ aFirstStr.Erase( nEnd );
+ aCurEntry = aStr;
+ aCurEntry.Erase( 0, ++nEnd );
+ }
+ else
+ aCurEntry.Erase();
+
+ return SvTreeListBox::InsertEntry(
+ aFirstStr,
+ rExpandedEntryBmp, rCollapsedEntryBmp,
+ pParent, FALSE, nPos, pUser );
+}
+
+
+SvLBoxEntry* SvTabListBox::InsertEntry( const XubString& rStr, ULONG nPos,
+ USHORT nCol, void* pUser )
+{
+ return InsertEntry( rStr,0,nPos, nCol, pUser );
+}
+
+#endif
+
+XubString SvTabListBox::GetEntryText( ULONG nPos, USHORT nCol ) const
+{
+ SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos );
+ return GetEntryText( pEntry, nCol );
+}
+
+XubString SvTabListBox::GetEntryText( SvLBoxEntry* pEntry, USHORT nCol ) const
+{
+ DBG_ASSERT(pEntry,"GetEntryText:Invalid Entry");
+ XubString aResult;
+ if( pEntry )
+ {
+ USHORT nCount = pEntry->ItemCount();
+ USHORT nCur = 0;
+ while( nCur < nCount )
+ {
+ SvLBoxItem* pStr = pEntry->GetItem( nCur );
+ if( pStr->IsA() == SV_ITEM_ID_LBOXSTRING )
+ {
+ if( nCol == 0xffff )
+ {
+ if( aResult.Len() )
+ aResult += '\t';
+ aResult += ((SvLBoxString*)pStr)->GetText();
+ }
+ else
+ {
+ if( nCol == 0 )
+ return ((SvLBoxString*)pStr)->GetText();
+ nCol--;
+ }
+ }
+ nCur++;
+ }
+ }
+ return aResult;
+}
+
+void SvTabListBox::SetEntryText( const XubString& rStr, ULONG nPos,
+ USHORT nCol )
+{
+ SvLBoxEntry* pEntry = SvTreeListBox::GetEntry( nPos );
+ SetEntryText( rStr, pEntry, nCol );
+}
+
+void SvTabListBox::SetEntryText( const XubString& rStr, SvLBoxEntry* pEntry,
+ USHORT nCol )
+{
+ DBG_ASSERT(pEntry,"SetEntryText:Invalid Entry");
+ if( !pEntry )
+ return;
+
+ const xub_Unicode* pCurToken = rStr.GetBuffer();
+ USHORT nCurTokenLen;
+ const xub_Unicode* pNextToken = GetToken( pCurToken, nCurTokenLen );
+
+ XubString aTemp;
+ USHORT nCount = pEntry->ItemCount();
+ USHORT nCur = 0;
+ while( nCur < nCount )
+ {
+ SvLBoxItem* pStr = pEntry->GetItem( nCur );
+ if( pStr && pStr->IsA() == SV_ITEM_ID_LBOXSTRING )
+ {
+ if( nCol == 0xffff )
+ {
+ if( pCurToken )
+ aTemp = XubString( pCurToken, nCurTokenLen );
+ else
+ aTemp.Erase(); // alle Spalten ohne Token loeschen
+ ((SvLBoxString*)pStr)->SetText( pEntry, aTemp );
+ pCurToken = pNextToken;
+ pNextToken = GetToken( pCurToken, nCurTokenLen );
+ }
+ else
+ {
+ if( !nCol )
+ {
+ aTemp = XubString( pCurToken, nCurTokenLen );
+ ((SvLBoxString*)pStr)->SetText( pEntry, aTemp );
+ if( !pNextToken )
+ break;
+ pCurToken = pNextToken;
+ pNextToken = GetToken( pCurToken, nCurTokenLen );
+ }
+ else
+ nCol--;
+ }
+ }
+ nCur++;
+ }
+ GetModel()->InvalidateEntry( pEntry );
+}
+
+
+
+ULONG SvTabListBox::GetEntryPos( const XubString& rStr, USHORT nCol )
+{
+ ULONG nPos = 0;
+ SvLBoxEntry* pEntry = First();
+ while( pEntry )
+ {
+ XubString aStr( GetEntryText( pEntry, nCol ));
+ if( aStr == rStr )
+ return nPos;
+ pEntry = Next( pEntry );
+ nPos++;
+ }
+ return 0xffffffff;
+}
+
+void __EXPORT SvTabListBox::Resize()
+{
+ SvTreeListBox::Resize();
+}
+
+// static
+const xub_Unicode* SvTabListBox::GetToken( const xub_Unicode* pPtr, USHORT& rLen )
+{
+ if( !pPtr || *pPtr == 0 )
+ {
+ rLen = 0;
+ return 0;
+ }
+ xub_Unicode c = *pPtr;
+ USHORT nLen = 0;
+ while( c != '\t' && c != 0 )
+ {
+ pPtr++;
+ nLen++;
+ c = *pPtr;
+ }
+ if( c )
+ pPtr++; // Tab ueberspringen
+ else
+ pPtr = 0;
+ rLen = nLen;
+ return pPtr;
+}
+
+
+void SvTabListBox::SetTabJustify( USHORT nTab, SvTabJustify eJustify)
+{
+ if( nTab >= nTabCount )
+ return;
+ SvLBoxTab* pTab = &(pTabList[ nTab ]);
+ USHORT nFlags = pTab->nFlags;
+ nFlags &= (~MYTABMASK);
+ nFlags |= (USHORT)eJustify;
+ pTab->nFlags = nFlags;
+ SvTreeListBox::nTreeFlags |= TREEFLAG_RECALCTABS;
+ if( IsUpdateMode() )
+ Invalidate();
+}
+
+SvTabJustify SvTabListBox::GetTabJustify( USHORT nTab ) const
+{
+ SvTabJustify eResult = AdjustLeft;
+ if( nTab >= nTabCount )
+ return eResult;
+ SvLBoxTab* pTab = &(pTabList[ nTab ]);
+ USHORT nFlags = pTab->nFlags;
+ nFlags &= MYTABMASK;
+ eResult = (SvTabJustify)nFlags;
+ return eResult;
+}
+
+long SvTabListBox::GetLogicTab( USHORT nTab )
+{
+ if( SvTreeListBox::nTreeFlags & TREEFLAG_RECALCTABS )
+ ((SvTabListBox*)this)->SetTabs();
+
+ DBG_ASSERT(nTab<nTabCount,"GetTabPos:Invalid Tab");
+ return ((SvLBoxTab*)aTabs.GetObject( nTab ))->GetPos();
+}
+
+// class SvHeaderTabListBox ----------------------------------------------
+
+SvHeaderTabListBox::SvHeaderTabListBox( Window* pParent, WinBits nWinStyle ) :
+
+ SvTabListBox( pParent, nWinStyle ),
+
+ mbFirstPaint( TRUE )
+
+{
+}
+
+// -----------------------------------------------------------------------
+
+SvHeaderTabListBox::~SvHeaderTabListBox()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void SvHeaderTabListBox::Paint( const Rectangle& rRect )
+{
+ if ( mbFirstPaint )
+ {
+ mbFirstPaint = FALSE;
+ RepaintScrollBars();
+ }
+ SvTabListBox::Paint( rRect );
+}
+
+// -----------------------------------------------------------------------
+
+void SvHeaderTabListBox::InitHeaderBar( HeaderBar* pHeaderBar )
+{
+ mpHeaderBar = pHeaderBar;
+ SetScrolledHdl( LINK( this, SvHeaderTabListBox, ScrollHdl_Impl ) );
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( SvHeaderTabListBox, ScrollHdl_Impl, SvTabListBox*, pList )
+{
+ mpHeaderBar->SetOffset( -GetXOffset() );
+ return 0;
+}
+
+
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
new file mode 100644
index 000000000000..bc7f6de0ab05
--- /dev/null
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -0,0 +1,2355 @@
+/*************************************************************************
+ *
+ * $RCSfile: svtreebx.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SVTREEBX_CXX
+
+#ifndef _SV_SVAPP_HXX //autogen wg. Application
+#include <vcl/svapp.hxx>
+#endif
+#pragma hdrstop
+
+class TabBar;
+
+#include <svlbox.hxx>
+#include <svlbitm.hxx>
+#include <svtreebx.hxx>
+#ifndef _SVIMPLBOX_HXX
+#include <svimpbox.hxx>
+#endif
+
+/*
+ Bugs/ToDo
+
+ - Berechnung Rectangle beim Inplace-Editing (Bug bei manchen Fonts)
+ - SetSpaceBetweenEntries: Offset wird in SetEntryHeight nicht
+ beruecksichtigt
+*/
+
+#define TREEFLAG_FIXEDHEIGHT 0x0010
+
+
+DBG_NAME(SvTreeListBox);
+
+#define SV_LBOX_DEFAULT_INDENT_PIXEL 20
+
+__EXPORT SvTreeListBox::SvTreeListBox( Window* pParent, WinBits nWinStyle )
+ : SvLBox(pParent,nWinStyle )
+{
+ DBG_CTOR(SvTreeListBox,0);
+ InitTreeView( nWinStyle );
+}
+
+__EXPORT SvTreeListBox::SvTreeListBox( Window* pParent , const ResId& rResId )
+ : SvLBox( pParent,rResId )
+{
+ DBG_CTOR(SvTreeListBox,0);
+ InitTreeView( 0 );
+ Resize();
+}
+
+void SvTreeListBox::InitTreeView( WinBits nWinStyle )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pCheckButtonData = 0;
+ nEntryHeight = 0;
+ pEdCtrl = 0;
+ nFirstSelTab = 0;
+ nLastSelTab = 0;
+ nFocusWidth = -1;
+
+ Link* pLink = new Link( LINK(this,SvTreeListBox, DefaultCompare) );
+ pReserved = pLink;
+
+ nTreeFlags = TREEFLAG_RECALCTABS;
+ nIndent = SV_LBOX_DEFAULT_INDENT_PIXEL;
+ nEntryHeightOffs = SV_ENTRYHEIGHTOFFS_PIXEL;
+ pImp = new SvImpLBox( this, GetModel(), nWinStyle );
+
+ aContextBmpMode = SVLISTENTRYFLAG_EXPANDED;
+ nContextBmpWidthMax = 0;
+ SetFont( GetFont() );
+ SetSpaceBetweenEntries( 0 );
+ SetLineColor();
+ InitSettings( TRUE, TRUE, TRUE );
+ SetWindowBits( nWinStyle );
+ SetTabs();
+ InitAcc();
+}
+
+
+__EXPORT SvTreeListBox::~SvTreeListBox()
+{
+ DBG_DTOR(SvTreeListBox,0);
+ if( IsInplaceEditingEnabled() )
+ Application::RemoveAccel( &aInpEditAcc );
+ delete pImp;
+ delete (Link*)pReserved;
+ ClearTabList();
+}
+
+void SvTreeListBox::SetModel( SvLBoxTreeList* pNewModel )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->SetModel( pNewModel );
+ SvLBox::SetModel( pNewModel );
+}
+
+void SvTreeListBox::DisconnectFromModel()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBox::DisconnectFromModel();
+ pImp->SetModel( GetModel() );
+}
+
+
+USHORT SvTreeListBox::IsA()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return SV_LISTBOX_ID_TREEBOX;
+}
+
+void SvTreeListBox::InitAcc()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+#ifdef OS2
+ aInpEditAcc.InsertItem( 1, KeyCode(KEY_F9,KEY_SHIFT) );
+#else
+ aInpEditAcc.InsertItem( 1, KeyCode(KEY_RETURN,KEY_MOD2) );
+#endif
+ aInpEditAcc.SetActivateHdl( LINK( this, SvTreeListBox, InpEdActivateHdl) );
+}
+
+IMPL_LINK_INLINE_START( SvTreeListBox, InpEdActivateHdl, Accelerator *, pAccelerator )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ EditEntry();
+ return 1;
+}
+IMPL_LINK_INLINE_END( SvTreeListBox, InpEdActivateHdl, Accelerator *, pAccelerator )
+
+
+void __EXPORT SvTreeListBox::Resize()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( IsEditingActive() )
+ EndEditing( TRUE );
+ SvLBox::Resize();
+ pImp->Resize();
+ nFocusWidth = -1;
+ pImp->ShowCursor( FALSE );
+ pImp->ShowCursor( TRUE );
+}
+
+/* Faelle:
+
+ A) Entries haben Bitmaps
+ 0. Keine Buttons
+ 1. Node-Buttons (optional auch an Root-Items)
+ 2. Node-Buttons (optional auch an Root-Items) + CheckButton
+ 3. CheckButton
+ B) Entries haben keine Bitmaps (->ueber WindowBits wg. D&D !!!!!!)
+ 0. Keine Buttons
+ 1. Node-Buttons (optional auch an Root-Items)
+ 2. Node-Buttons (optional auch an Root-Items) + CheckButton
+ 3. CheckButton
+*/
+
+#define NO_BUTTONS 0
+#define NODE_BUTTONS 1
+#define NODE_AND_CHECK_BUTTONS 2
+#define CHECK_BUTTONS 3
+
+#define TABFLAGS_TEXT (SV_LBOXTAB_DYNAMIC | \
+ SV_LBOXTAB_ADJUST_LEFT | \
+ SV_LBOXTAB_EDITABLE | \
+ SV_LBOXTAB_SHOW_SELECTION)
+
+#define TABFLAGS_CONTEXTBMP (SV_LBOXTAB_DYNAMIC | SV_LBOXTAB_ADJUST_CENTER)
+
+#define TABFLAGS_CHECKBTN (SV_LBOXTAB_DYNAMIC | \
+ SV_LBOXTAB_ADJUST_CENTER | \
+ SV_LBOXTAB_PUSHABLE)
+
+#define TAB_STARTPOS 2
+
+// bei Aenderungen GetTextOffset beruecksichtigen
+void SvTreeListBox::SetTabs()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( IsEditingActive() )
+ EndEditing( TRUE );
+ nTreeFlags &= (~TREEFLAG_RECALCTABS);
+ nFocusWidth = -1;
+ BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
+ BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ WB_HASBUTTONSATROOT))!=0;
+ long nStartPos = TAB_STARTPOS;
+ long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
+
+ long nCheckWidth = 0;
+ if( nTreeFlags & TREEFLAG_CHKBTN )
+ nCheckWidth = pCheckButtonData->aBmps[0].GetSizePixel().Width();
+ long nCheckWidthDIV2 = nCheckWidth / 2;
+
+ long nContextWidth = nContextBmpWidthMax;
+ long nContextWidthDIV2 = nContextWidth / 2;
+
+ ClearTabList();
+
+ int nCase = NO_BUTTONS;
+ if( !(nTreeFlags & TREEFLAG_CHKBTN) )
+ {
+ if( bHasButtons )
+ nCase = NODE_BUTTONS;
+ }
+ else
+ {
+ if( bHasButtons )
+ nCase = NODE_AND_CHECK_BUTTONS;
+ else
+ nCase = CHECK_BUTTONS;
+ }
+
+ switch( nCase )
+ {
+ case NO_BUTTONS :
+ nStartPos += nContextWidthDIV2; // wg. Zentrierung
+ AddTab( nStartPos, TABFLAGS_CONTEXTBMP );
+ nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp
+ // Abstand setzen nur wenn Bitmaps da
+ if( nContextBmpWidthMax )
+ nStartPos += 5; // Abstand Context-Bmp - Text
+ AddTab( nStartPos, TABFLAGS_TEXT );
+ break;
+
+ case NODE_BUTTONS :
+ if( bHasButtonsAtRoot )
+ nStartPos += ( nIndent + (nNodeWidthPixel/2) );
+ else
+ nStartPos += nContextWidthDIV2;
+ AddTab( nStartPos, TABFLAGS_CONTEXTBMP );
+ nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp
+ // Abstand setzen nur wenn Bitmaps da
+ if( nContextBmpWidthMax )
+ nStartPos += 5; // Abstand Context-Bmp - Text
+ AddTab( nStartPos, TABFLAGS_TEXT );
+ break;
+
+ case NODE_AND_CHECK_BUTTONS :
+ if( bHasButtonsAtRoot )
+ nStartPos += ( nIndent + nNodeWidthPixel );
+ else
+ nStartPos += nCheckWidthDIV2;
+ AddTab( nStartPos, TABFLAGS_CHECKBTN );
+ nStartPos += nCheckWidthDIV2; // rechter Rand des CheckButtons
+ nStartPos += 3; // Abstand CheckButton Context-Bmp
+ nStartPos += nContextWidthDIV2; // Mitte der Context-Bmp
+ AddTab( nStartPos, TABFLAGS_CONTEXTBMP );
+ nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp
+ // Abstand setzen nur wenn Bitmaps da
+ if( nContextBmpWidthMax )
+ nStartPos += 5; // Abstand Context-Bmp - Text
+ AddTab( nStartPos, TABFLAGS_TEXT );
+ break;
+
+ case CHECK_BUTTONS :
+ nStartPos += nCheckWidthDIV2;
+ AddTab( nStartPos, TABFLAGS_CHECKBTN );
+ nStartPos += nCheckWidthDIV2; // rechter Rand CheckButton
+ nStartPos += 3; // Abstand CheckButton Context-Bmp
+ nStartPos += nContextWidthDIV2; // Mitte der Context-Bmp
+ AddTab( nStartPos, TABFLAGS_CONTEXTBMP );
+ nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp
+ // Abstand setzen nur wenn Bitmaps da
+ if( nContextBmpWidthMax )
+ nStartPos += 5; // Abstand Context-Bmp - Text
+ AddTab( nStartPos, TABFLAGS_TEXT );
+ break;
+ }
+ pImp->NotifyTabsChanged();
+}
+
+void SvTreeListBox::InitEntry( SvLBoxEntry* pEntry,
+ const XubString& aStr, const Image& aCollEntryBmp, const Image& aExpEntryBmp)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxButton* pButton;
+ SvLBoxString* pString;
+ SvLBoxContextBmp* pContextBmp;
+
+ if( nTreeFlags & TREEFLAG_CHKBTN )
+ {
+ pButton= new SvLBoxButton( pEntry,0,pCheckButtonData );
+ pEntry->AddItem( pButton );
+ }
+
+ pContextBmp= new SvLBoxContextBmp( pEntry,0, aCollEntryBmp,aExpEntryBmp,
+ aContextBmpMode );
+ pEntry->AddItem( pContextBmp );
+
+ pString = new SvLBoxString( pEntry, 0, aStr );
+ pEntry->AddItem( pString );
+}
+
+XubString SvTreeListBox::GetEntryText(SvLBoxEntry* pEntry) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pEntry,"Entry?")
+ SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ DBG_ASSERT(pItem,"GetEntryText:Item not found")
+ return pItem->GetText();
+}
+
+const Image& SvTreeListBox::GetExpandedEntryBmp(SvLBoxEntry* pEntry) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pEntry,"Entry?")
+ SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ DBG_ASSERT(pItem,"GetContextBmp:Item not found")
+ return pItem->GetBitmap2();
+}
+
+const Image& SvTreeListBox::GetCollapsedEntryBmp(SvLBoxEntry* pEntry ) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pEntry,"Entry?")
+ SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ DBG_ASSERT(pItem,"GetContextBmp:Item not found")
+ return pItem->GetBitmap1();
+}
+
+IMPL_LINK_INLINE_START( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pHdlEntry = pData->GetActEntry();
+ CheckButtonHdl();
+ return 0;
+}
+IMPL_LINK_INLINE_END( SvTreeListBox, CheckButtonClick, SvLBoxButtonData *, pData )
+
+SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,SvLBoxEntry* pParent,
+ BOOL bChildsOnDemand, ULONG nPos, void* pUser )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nTreeFlags |= TREEFLAG_MANINS;
+
+ aCurInsertedExpBmp = aExpandedEntryBmp;
+ aCurInsertedColBmp = aCollapsedEntryBmp;
+
+ SvLBoxEntry* pEntry = CreateEntry();
+ pEntry->SetUserData( pUser );
+ InitEntry( pEntry, aText, aCollapsedEntryBmp, aExpandedEntryBmp );
+ pEntry->EnableChildsOnDemand( bChildsOnDemand );
+
+ if( !pParent )
+ SvLBox::Insert( pEntry, nPos );
+ else
+ SvLBox::Insert( pEntry, pParent, nPos );
+
+ aPrevInsertedExpBmp = aExpandedEntryBmp;
+ aPrevInsertedColBmp = aCollapsedEntryBmp;
+
+ nTreeFlags &= (~TREEFLAG_MANINS);
+
+ return pEntry;
+}
+
+SvLBoxEntry* SvTreeListBox::InsertEntry( const XubString& aText,
+ const Image& aExpEntryBmp, const Image& aCollEntryBmp,
+ SvLBoxEntry* pParent, BOOL bChildsOnDemand, ULONG nPos, void* pUser )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nTreeFlags |= TREEFLAG_MANINS;
+
+ aCurInsertedExpBmp = aExpEntryBmp;
+ aCurInsertedColBmp = aCollEntryBmp;
+
+ short nExpWidth = (short)aExpEntryBmp.GetSizePixel().Width();
+ short nColWidth = (short)aCollEntryBmp.GetSizePixel().Width();
+ short nMax = Max(nExpWidth, nColWidth);
+ if( nMax > nContextBmpWidthMax )
+ {
+ nContextBmpWidthMax = nMax;
+ SetTabs();
+ }
+
+ SvLBoxEntry* pEntry = CreateEntry();
+ pEntry->SetUserData( pUser );
+ InitEntry( pEntry, aText, aCollEntryBmp, aExpEntryBmp );
+
+ pEntry->EnableChildsOnDemand( bChildsOnDemand );
+
+ if( !pParent )
+ SvLBox::Insert( pEntry, nPos );
+ else
+ SvLBox::Insert( pEntry, pParent, nPos );
+
+ aPrevInsertedExpBmp = aExpEntryBmp;
+ aPrevInsertedColBmp = aCollEntryBmp;
+
+ nTreeFlags &= (~TREEFLAG_MANINS);
+
+ return pEntry;
+}
+
+void SvTreeListBox::SetEntryText( SvLBoxEntry* pEntry, const XubString& aStr)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxString* pItem = (SvLBoxString*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ DBG_ASSERT(pItem,"SetText:Item not found")
+ pItem->SetText( pEntry, aStr );
+ pItem->InitViewData( this, pEntry, 0 );
+ GetModel()->InvalidateEntry( pEntry );
+}
+
+void SvTreeListBox::SetExpandedEntryBmp(SvLBoxEntry* pEntry, const Image& aBmp)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ DBG_ASSERT(pItem,"SetExpBmp:Item not found")
+ pItem->SetBitmap2( pEntry, aBmp );
+ GetModel()->InvalidateEntry( pEntry );
+ SetEntryHeight( pEntry );
+ Size aSize = aBmp.GetSizePixel();
+ if( aSize.Width() > nContextBmpWidthMax )
+ {
+ nContextBmpWidthMax = (short)aSize.Width();
+ SetTabs();
+ }
+}
+
+void SvTreeListBox::SetCollapsedEntryBmp(SvLBoxEntry* pEntry,const Image& aBmp )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxContextBmp* pItem = (SvLBoxContextBmp*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ DBG_ASSERT(pItem,"SetExpBmp:Item not found")
+ pItem->SetBitmap1( pEntry, aBmp );
+ GetModel()->InvalidateEntry( pEntry );
+ SetEntryHeight( pEntry );
+ Size aSize = aBmp.GetSizePixel();
+ if( aSize.Width() > nContextBmpWidthMax )
+ {
+ nContextBmpWidthMax = (short)aSize.Width();
+ SetTabs();
+ }
+}
+
+void SvTreeListBox::ImpEntryInserted( SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ SvLBoxEntry* pParent = (SvLBoxEntry*)pModel->GetParent( pEntry );
+ if( pParent )
+ {
+ USHORT nFlags = pParent->GetFlags();
+ nFlags &= ~SV_ENTRYFLAG_NO_NODEBMP;
+ pParent->SetFlags( nFlags );
+ }
+
+ if(!((nTreeFlags & TREEFLAG_MANINS) &&
+ (aPrevInsertedExpBmp == aCurInsertedExpBmp) &&
+ (aPrevInsertedColBmp == aCurInsertedColBmp) ))
+ {
+ Size aSize = GetCollapsedEntryBmp( pEntry ).GetSizePixel();
+ if( aSize.Width() > nContextBmpWidthMax )
+ {
+ nContextBmpWidthMax = (short)aSize.Width();
+ nTreeFlags |= TREEFLAG_RECALCTABS;
+ }
+ aSize = GetExpandedEntryBmp( pEntry ).GetSizePixel();
+ if( aSize.Width() > nContextBmpWidthMax )
+ {
+ nContextBmpWidthMax = (short)aSize.Width();
+ nTreeFlags |= TREEFLAG_RECALCTABS;
+ }
+ }
+ SetEntryHeight( (SvLBoxEntry*)pEntry );
+}
+
+
+
+void SvTreeListBox::SetCheckButtonState( SvLBoxEntry* pEntry, SvButtonState eState)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( nTreeFlags & TREEFLAG_CHKBTN )
+ {
+ SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ DBG_ASSERT(pItem,"SetCheckButton:Item not found")
+ switch( eState )
+ {
+ case SV_BUTTON_CHECKED:
+ pItem->SetStateChecked();
+ break;
+
+ case SV_BUTTON_UNCHECKED:
+ pItem->SetStateUnchecked();
+ break;
+
+ case SV_BUTTON_TRISTATE:
+ pItem->SetStateTristate();
+ break;
+ }
+ InvalidateEntry( pEntry );
+ }
+}
+
+SvButtonState SvTreeListBox::GetCheckButtonState( SvLBoxEntry* pEntry ) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvButtonState eState = SV_BUTTON_UNCHECKED;
+ if( nTreeFlags & TREEFLAG_CHKBTN )
+ {
+ SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ DBG_ASSERT(pItem,"GetChButnState:Item not found")
+ USHORT nButtonFlags = pItem->GetButtonFlags();
+ eState = pCheckButtonData->ConvertToButtonState( nButtonFlags );
+ }
+ return eState;
+}
+
+
+void __EXPORT SvTreeListBox::CheckButtonHdl()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ aCheckButtonHdl.Call( this );
+}
+
+BOOL __EXPORT SvTreeListBox::QueryDrop( DropEvent& rDEvt )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return SvLBox::QueryDrop( rDEvt ); // Basisklasse rufen
+}
+
+
+
+// *********************************************************************
+// *********************************************************************
+
+//
+// TODO: Momentan werden die Daten so geklont, dass sie dem
+// Standard-TreeView-Format entsprechen. Hier sollte eigentlich
+// das Model als Referenz dienen. Dies fuehrt dazu, dass
+// SvLBoxEntry::Clone _nicht_ gerufen wird, sondern nur dessen
+// Basisklasse SvListEntry
+//
+
+SvLBoxEntry* __EXPORT SvTreeListBox::CloneEntry( SvLBoxEntry* pSource )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ XubString aStr;
+ Image aCollEntryBmp;
+ Image aExpEntryBmp;
+
+ SvLBoxString* pStringItem = (SvLBoxString*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXSTRING));
+ if( pStringItem )
+ aStr = pStringItem->GetText();
+ SvLBoxContextBmp* pBmpItem = (SvLBoxContextBmp*)(pSource->GetFirstItem(SV_ITEM_ID_LBOXCONTEXTBMP));
+ if( pBmpItem )
+ {
+ aCollEntryBmp = pBmpItem->GetBitmap1();
+ aExpEntryBmp = pBmpItem->GetBitmap2();
+ }
+ SvLBoxEntry* pEntry = CreateEntry();
+ InitEntry( pEntry, aStr, aCollEntryBmp, aExpEntryBmp );
+ pEntry->SvListEntry::Clone( pSource );
+ pEntry->EnableChildsOnDemand( pSource->HasChildsOnDemand() );
+ pEntry->SetUserData( pSource->GetUserData() );
+ return pEntry;
+}
+
+// *********************************************************************
+// *********************************************************************
+
+
+void SvTreeListBox::ShowExpandBitmapOnCursor( BOOL bYes )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( bYes )
+ aContextBmpMode = SVLISTENTRYFLAG_FOCUSED;
+ else
+ aContextBmpMode = SVLISTENTRYFLAG_EXPANDED;
+}
+
+void SvTreeListBox::SetIndent( short nNewIndent )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nIndent = nNewIndent;
+ SetTabs();
+ if( IsUpdateMode() )
+ Invalidate();
+}
+
+void SvTreeListBox::SetDefaultExpandedEntryBmp( const Image& aBmp)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Size aSize = aBmp.GetSizePixel();
+ if( aSize.Width() > nContextBmpWidthMax )
+ nContextBmpWidthMax = (short)aSize.Width();
+ SetTabs();
+ aExpandedEntryBmp = aBmp;
+}
+
+void SvTreeListBox::SetDefaultCollapsedEntryBmp( const Image& aBmp)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Size aSize = aBmp.GetSizePixel();
+ if( aSize.Width() > nContextBmpWidthMax )
+ nContextBmpWidthMax = (short)aSize.Width();
+ SetTabs();
+ aCollapsedEntryBmp = aBmp;
+}
+
+void SvTreeListBox::EnableCheckButton( SvLBoxButtonData* pData )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(!GetEntryCount(),"EnableCheckButton: Entry count != 0");
+ if( !pData )
+ nTreeFlags &= (~TREEFLAG_CHKBTN);
+ else
+ {
+ pCheckButtonData = pData;
+ nTreeFlags |= TREEFLAG_CHKBTN;
+ pData->SetLink( LINK(this, SvTreeListBox, CheckButtonClick));
+ }
+
+ SetTabs();
+ if( IsUpdateMode() )
+ Invalidate();
+}
+
+void SvTreeListBox::SetNodeBitmaps( const Image& rCollapsedNodeBmp,
+ const Image& rExpandedNodeBmp)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SetExpandedNodeBmp( rExpandedNodeBmp );
+ SetCollapsedNodeBmp( rCollapsedNodeBmp );
+ SetTabs();
+}
+
+BOOL SvTreeListBox::EditingEntry( SvLBoxEntry*, Selection& )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return TRUE;
+}
+
+BOOL SvTreeListBox::EditedEntry( SvLBoxEntry* /*pEntry*/,const XubString& /*rNewText*/)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return TRUE;
+}
+
+void SvTreeListBox::EnableInplaceEditing( BOOL bOn )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBox::EnableInplaceEditing( bOn );
+ if( Control::HasFocus() )
+ Application::InsertAccel( &aInpEditAcc );
+}
+
+void __EXPORT SvTreeListBox::KeyInput( const KeyEvent& rKEvt )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ // unter OS/2 bekommen wir auch beim Editieren Key-Up/Down
+ if( IsEditingActive() )
+ return;
+
+ nImpFlags |= SVLBOX_IS_TRAVELSELECT;
+ USHORT nCode = rKEvt.GetKeyCode().GetCode();
+
+#ifdef OVDEBUG
+ switch ( nCode )
+ {
+ case KEY_F1:
+ {
+ SvLBoxEntry* pEntry = First();
+ pEntry = NextVisible( pEntry );
+ SetEntryText( pEntry, "SetEntryText" );
+ Sound::Beep();
+ }
+ break;
+ }
+#endif
+
+ if( IsInplaceEditingEnabled() &&
+ nCode == KEY_RETURN &&
+ rKEvt.GetKeyCode().IsMod2() )
+ {
+ SvLBoxEntry* pEntry = GetCurEntry();
+ if( pEntry )
+ EditEntry( pEntry );
+ nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
+ }
+ else
+ {
+ BOOL bKeyUsed = pImp->KeyInput( rKEvt );
+ nImpFlags &= ~SVLBOX_IS_TRAVELSELECT;
+ if( !bKeyUsed )
+ SvLBox::KeyInput( rKEvt );
+ }
+}
+
+void SvTreeListBox::RequestingChilds( SvLBoxEntry* pParent )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( !pParent->HasChilds() )
+ InsertEntry( String::CreateFromAscii("<dummy>"), pParent, FALSE, LIST_APPEND );
+}
+
+void __EXPORT SvTreeListBox::GetFocus()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( IsInplaceEditingEnabled() )
+ Application::InsertAccel( &aInpEditAcc );
+ pImp->GetFocus();
+ SvLBox::GetFocus();
+}
+
+void __EXPORT SvTreeListBox::LoseFocus()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( IsInplaceEditingEnabled() )
+ Application::RemoveAccel( &aInpEditAcc );
+ pImp->LoseFocus();
+ SvLBox::LoseFocus();
+}
+
+void __EXPORT SvTreeListBox::ModelHasCleared()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->pCursor = 0; //sonst Absturz beim Inplace-Editieren im GetFocus
+ delete pEdCtrl;
+ pEdCtrl = 0;
+ pImp->Clear();
+ nFocusWidth = -1;
+
+ nContextBmpWidthMax = 0;
+ SetDefaultExpandedEntryBmp( GetDefaultExpandedEntryBmp() );
+ SetDefaultCollapsedEntryBmp( GetDefaultCollapsedEntryBmp() );
+
+ if( !(nTreeFlags & TREEFLAG_FIXEDHEIGHT ))
+ nEntryHeight = 0;
+ AdjustEntryHeight( GetFont() );
+ AdjustEntryHeight( GetDefaultExpandedEntryBmp() );
+ AdjustEntryHeight( GetDefaultCollapsedEntryBmp() );
+
+ SvLBox::ModelHasCleared();
+// if( IsUpdateMode() )
+// Invalidate();
+}
+
+void SvTreeListBox::ShowTargetEmphasis( SvLBoxEntry* pEntry, BOOL /* bShow */ )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->PaintDDCursor( pEntry );
+}
+
+void SvTreeListBox::ScrollOutputArea( short nDeltaEntries )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( !nDeltaEntries || !pImp->aVerSBar.IsVisible() )
+ return;
+
+ long nThumb = pImp->aVerSBar.GetThumbPos();
+ long nMax = pImp->aVerSBar.GetRange().Max();
+
+ NotifyBeginScroll();
+ if( nDeltaEntries < 0 )
+ {
+ // das Fenster nach oben verschieben
+ nDeltaEntries *= -1;
+ long nVis = pImp->aVerSBar.GetVisibleSize();
+ long nTemp = nThumb + nVis;
+ if( nDeltaEntries > (nMax - nTemp) )
+ nDeltaEntries = (short)(nMax - nTemp);
+ pImp->PageDown( (USHORT)nDeltaEntries );
+ }
+ else
+ {
+ if( nDeltaEntries > nThumb )
+ nDeltaEntries = (short)nThumb;
+ pImp->PageUp( (USHORT)nDeltaEntries );
+ }
+ pImp->SyncVerThumb();
+ NotifyEndScroll();
+}
+
+void SvTreeListBox::SetSelectionMode( SelectionMode eSelectMode )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBox::SetSelectionMode( eSelectMode );
+ pImp->SetSelectionMode( eSelectMode );
+}
+
+void SvTreeListBox::SetDragDropMode( DragDropMode nDDMode )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBox::SetDragDropMode( nDDMode );
+ pImp->SetDragDropMode( nDDMode );
+}
+
+short SvTreeListBox::GetHeightOffset(const Image& rBmp, Size& aSizeLogic )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ short nOffset = 0;
+ aSizeLogic = rBmp.GetSizePixel();
+ if( GetEntryHeight() > aSizeLogic.Height() )
+ nOffset = ( GetEntryHeight() - (short)aSizeLogic.Height()) / 2;
+ return nOffset;
+}
+
+short SvTreeListBox::GetHeightOffset(const Font& /* rFont */, Size& aSizeLogic )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ short nOffset = 0;
+ aSizeLogic = Size(GetTextWidth('X'), GetTextHeight());
+ if( GetEntryHeight() > aSizeLogic.Height() )
+ nOffset = ( GetEntryHeight() - (short)aSizeLogic.Height()) / 2;
+ return nOffset;
+}
+
+void SvTreeListBox::SetEntryHeight( SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ short nHeight, nHeightMax=0;
+ USHORT nCount = pEntry->ItemCount();
+ USHORT nCur = 0;
+ SvViewDataEntry* pViewData = GetViewDataEntry( pEntry );
+ while( nCur < nCount )
+ {
+ SvLBoxItem* pItem = pEntry->GetItem( nCur );
+ nHeight = (short)(pItem->GetSize( pViewData, nCur ).Height());
+ if( nHeight > nHeightMax )
+ nHeightMax = nHeight;
+ nCur++;
+ }
+
+ if( nHeightMax > nEntryHeight )
+ {
+ nEntryHeight = nHeightMax;
+ SvLBox::SetFont( GetFont() );
+ pImp->SetEntryHeight( nHeightMax );
+ }
+}
+
+void SvTreeListBox::SetEntryHeight( short nHeight, BOOL bAlways )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ if( bAlways || nHeight > nEntryHeight )
+ {
+ nEntryHeight = nHeight;
+ if( nEntryHeight )
+ nTreeFlags |= TREEFLAG_FIXEDHEIGHT;
+ else
+ nTreeFlags &= ~TREEFLAG_FIXEDHEIGHT;
+ SvLBox::SetFont( GetFont() );
+ pImp->SetEntryHeight( nHeight );
+ }
+}
+
+
+void SvTreeListBox::AdjustEntryHeight( const Image& rBmp )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Size aSize;
+ GetHeightOffset( rBmp, aSize );
+ if( aSize.Height() > nEntryHeight )
+ {
+ nEntryHeight = (short)aSize.Height() + nEntryHeightOffs;
+ pImp->SetEntryHeight( nEntryHeight );
+ }
+}
+
+void SvTreeListBox::AdjustEntryHeight( const Font& rFont )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Size aSize;
+ GetHeightOffset( rFont, aSize );
+ if( aSize.Height() > nEntryHeight )
+ {
+ nEntryHeight = (short)aSize.Height() + nEntryHeightOffs;
+ pImp->SetEntryHeight( nEntryHeight );
+ }
+}
+
+BOOL SvTreeListBox::Expand( SvLBoxEntry* pParent )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pHdlEntry = pParent;
+ BOOL bExpanded = FALSE;
+ USHORT nFlags;
+
+ if( pParent->HasChildsOnDemand() )
+ RequestingChilds( pParent );
+ if( pParent->HasChilds() )
+ {
+ nImpFlags |= SVLBOX_IS_EXPANDING;
+ if( ExpandingHdl() )
+ {
+ bExpanded = TRUE;
+ SvListView::Expand( pParent );
+ pImp->EntryExpanded( pParent );
+ ExpandedHdl();
+ }
+ nFlags = pParent->GetFlags();
+ nFlags &= ~SV_ENTRYFLAG_NO_NODEBMP;
+ nFlags |= SV_ENTRYFLAG_HAD_CHILDREN;
+ pParent->SetFlags( nFlags );
+ }
+ else
+ {
+ nFlags = pParent->GetFlags();
+ nFlags |= SV_ENTRYFLAG_NO_NODEBMP;
+ pParent->SetFlags( nFlags );
+ GetModel()->InvalidateEntry( pParent ); // neu zeichnen
+ }
+ return bExpanded;
+}
+
+BOOL SvTreeListBox::Collapse( SvLBoxEntry* pParent )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nImpFlags &= ~SVLBOX_IS_EXPANDING;
+ pHdlEntry = pParent;
+ BOOL bCollapsed = FALSE;
+
+ if( ExpandingHdl() )
+ {
+ bCollapsed = TRUE;
+ pImp->CollapsingEntry( pParent );
+ SvListView::Collapse( pParent );
+ pImp->EntryCollapsed( pParent );
+ ExpandedHdl();
+ }
+ return bCollapsed;
+}
+
+BOOL SvTreeListBox::Select( SvLBoxEntry* pEntry, BOOL bSelect )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pEntry,"Select: Null-Ptr")
+ BOOL bRetVal = SvListView::Select( pEntry, bSelect );
+ DBG_ASSERT(IsSelected(pEntry)==bSelect,"Select failed");
+ if( bRetVal )
+ {
+ pImp->EntrySelected( pEntry, bSelect );
+ pHdlEntry = pEntry;
+ if( bSelect )
+ SelectHdl();
+ else
+ DeselectHdl();
+ }
+ return bRetVal;
+}
+
+ULONG SvTreeListBox::SelectChilds( SvLBoxEntry* pParent, BOOL bSelect )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->DestroyAnchor();
+ ULONG nRet = 0;
+ if( !pParent->HasChilds() )
+ return 0;
+ USHORT nRefDepth = pModel->GetDepth( pParent );
+ SvLBoxEntry* pChild = FirstChild( pParent );
+ do {
+ nRet++;
+ Select( pChild, bSelect );
+ pChild = Next( pChild );
+ } while( pChild && pModel->GetDepth( pChild ) > nRefDepth );
+ return nRet;
+}
+
+void SvTreeListBox::SelectAll( BOOL bSelect, BOOL bPaint )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->SelAllDestrAnch(
+ bSelect,
+ TRUE, // Anker loeschen,
+ TRUE ); // auch bei SINGLE_SELECTION den Cursor deselektieren
+}
+
+void __EXPORT SvTreeListBox::ModelHasInsertedTree( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ USHORT nRefDepth = pModel->GetDepth( (SvLBoxEntry*)pEntry );
+ SvLBoxEntry* pTmp = (SvLBoxEntry*)pEntry;
+ do
+ {
+ ImpEntryInserted( pTmp );
+ pTmp = Next( pTmp );
+ } while( pTmp && nRefDepth < pModel->GetDepth( pTmp ) );
+ pImp->TreeInserted( (SvLBoxEntry*)pEntry );
+}
+
+void __EXPORT SvTreeListBox::ModelHasInserted( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ ImpEntryInserted( (SvLBoxEntry*)pEntry );
+ pImp->EntryInserted( (SvLBoxEntry*)pEntry );
+}
+
+void __EXPORT SvTreeListBox::ModelIsMoving(SvListEntry* pSource,
+ SvListEntry* /* pTargetParent */,
+ ULONG /* nChildPos */ )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->MovingEntry( (SvLBoxEntry*)pSource );
+}
+
+void __EXPORT SvTreeListBox::ModelHasMoved( SvListEntry* pSource )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->EntryMoved( (SvLBoxEntry*)pSource );
+}
+
+void __EXPORT SvTreeListBox::ModelIsRemoving( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->RemovingEntry( (SvLBoxEntry*)pEntry );
+ NotifyRemoving( (SvLBoxEntry*)pEntry );
+}
+
+void __EXPORT SvTreeListBox::ModelHasRemoved( SvListEntry* /* pEntry */ )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->EntryRemoved();
+}
+
+void SvTreeListBox::SetCollapsedNodeBmp( const Image& rBmp)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ AdjustEntryHeight( rBmp );
+ pImp->SetCollapsedNodeBmp( rBmp );
+}
+
+void SvTreeListBox::SetExpandedNodeBmp( const Image& rBmp)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ AdjustEntryHeight( rBmp );
+ pImp->SetExpandedNodeBmp( rBmp );
+}
+
+
+void SvTreeListBox::SetFont( const Font& rFont )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Font aTempFont( rFont );
+ aTempFont.SetTransparent( TRUE );
+#ifndef VCL
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ aTempFont.SetColor( rStyleSettings.GetFieldTextColor() );
+#endif
+ Control::SetFont( aTempFont );
+ AdjustEntryHeight( aTempFont );
+ // immer Invalidieren, sonst fallen wir
+ // bei SetEntryHeight auf die Nase
+ RecalcViewData();
+}
+
+
+void __EXPORT SvTreeListBox::Paint( const Rectangle& rRect )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBox::Paint( rRect );
+ if( nTreeFlags & TREEFLAG_RECALCTABS )
+ SetTabs();
+ pImp->Paint( rRect );
+}
+
+void __EXPORT SvTreeListBox::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->MouseButtonDown( rMEvt );
+}
+
+void __EXPORT SvTreeListBox::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->MouseButtonUp( rMEvt );
+}
+
+void __EXPORT SvTreeListBox::MouseMove( const MouseEvent& rMEvt )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->MouseMove( rMEvt );
+}
+
+
+void __EXPORT SvTreeListBox::SetUpdateMode( BOOL bUpdate )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->SetUpdateMode( bUpdate );
+}
+
+void SvTreeListBox::SetUpdateModeFast( BOOL bUpdate )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->SetUpdateModeFast( bUpdate );
+}
+
+void SvTreeListBox::SetSpaceBetweenEntries( short nOffsLogic )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( nOffsLogic != nEntryHeightOffs )
+ {
+ nEntryHeight -= nEntryHeightOffs;
+ nEntryHeightOffs = (short)nOffsLogic;
+ nEntryHeight += nOffsLogic;
+ AdjustEntryHeight( GetFont() );
+ RecalcViewData();
+ pImp->SetEntryHeight( nEntryHeight );
+ }
+}
+
+void SvTreeListBox::SetCursor( SvLBoxEntry* pEntry, BOOL bForceNoSelect )
+{
+ pImp->SetCursor(pEntry, bForceNoSelect);
+}
+
+void SvTreeListBox::SetCurEntry( SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( pEntry )
+ pImp->SetCurEntry( pEntry );
+}
+
+Image SvTreeListBox::GetCollapsedNodeBmp() const
+{
+ return pImp->GetCollapsedNodeBmp();
+}
+
+Image SvTreeListBox::GetExpandedNodeBmp() const
+{
+ return pImp->GetExpandedNodeBmp();
+}
+
+Point SvTreeListBox::GetEntryPos( SvLBoxEntry* pEntry ) const
+{
+ return pImp->GetEntryPos( pEntry );
+}
+
+void SvTreeListBox::ShowEntry( SvLBoxEntry* pEntry )
+{
+ MakeVisible( pEntry );
+}
+
+void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry )
+{
+ pImp->MakeVisible(pEntry);
+}
+
+void SvTreeListBox::MakeVisible( SvLBoxEntry* pEntry, BOOL bMoveToTop )
+{
+ pImp->MakeVisible( pEntry, bMoveToTop );
+}
+
+void __EXPORT SvTreeListBox::ModelHasEntryInvalidated( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ // die einzelnen Items des Entries reinitialisieren
+ SvLBox::ModelHasEntryInvalidated( pEntry );
+ // repainten
+ pImp->InvalidateEntry( (SvLBoxEntry*)pEntry );
+}
+
+void SvTreeListBox::EditItemText( SvLBoxEntry* pEntry, SvLBoxString* pItem,
+ const Selection& rSelection )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pEntry&&pItem,"EditItemText: Bad params");
+ if( IsSelected( pEntry ))
+ {
+ pImp->ShowCursor( FALSE );
+ SvListView::Select( pEntry, FALSE );
+ PaintEntry( pEntry );
+ SvListView::Select( pEntry, TRUE );
+ pImp->ShowCursor( TRUE );
+ }
+ pEdEntry = pEntry;
+ pEdItem = pItem;
+ SvLBoxTab* pTab = GetTab( pEntry, pItem );
+ DBG_ASSERT(pTab,"EditItemText:Tab not found");
+
+ Size aItemSize( pItem->GetSize(this, pEntry) );
+ Point aPos = GetEntryPos( pEntry );
+ aPos.Y() += ( nEntryHeight - aItemSize.Height() ) / 2;
+ aPos.X() = GetTabPos( pEntry, pTab );
+ long nOutputWidth = pImp->GetOutputSize().Width();
+ Size aSize( nOutputWidth - aPos.X(), aItemSize.Height() );
+ USHORT nPos = aTabs.GetPos( pTab );
+ if( nPos+1 < aTabs.Count() )
+ {
+ SvLBoxTab* pRightTab = (SvLBoxTab*)aTabs.GetObject( nPos + 1 );
+ long nRight = GetTabPos( pEntry, pRightTab );
+ if( nRight <= nOutputWidth )
+ aSize.Width() = nRight - aPos.X();
+ }
+ Point aOrigin( GetMapMode().GetOrigin() );
+ aPos += aOrigin; // in Win-Koord umrechnen
+ aSize.Width() -= aOrigin.X();
+ Rectangle aRect( aPos, aSize );
+#ifdef OS2
+ // Platz lassen fuer WB_BORDER
+ aRect.Left() -= 2;
+ aRect.Top() -= 3;
+ aRect.Bottom() += 3;
+#endif
+ EditText( pItem->GetText(), aRect, rSelection );
+}
+
+void SvTreeListBox::CancelEditing()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBox::CancelTextEditing();
+}
+
+void SvTreeListBox::EditEntry( SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( IsEditingActive() )
+ EndEditing();
+ if( !pEntry )
+ pEntry = GetCurEntry();
+ if( pEntry )
+ {
+ SvLBoxString* pItem = (SvLBoxString* )pEntry->GetFirstItem(SV_ITEM_ID_LBOXSTRING);
+ Selection aSel( SELECTION_MIN, SELECTION_MAX );
+ if( pItem && EditingEntry( pEntry, aSel ) )
+ {
+ SelectAll( FALSE );
+ MakeVisible( pEntry );
+ EditItemText( pEntry, pItem, aSel );
+ }
+ }
+}
+
+void SvTreeListBox::EditedText( const XubString& rStr )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Point aPos = GetEntryPos( pEdEntry );
+ if( EditedEntry( pEdEntry, rStr ) )
+ {
+ ((SvLBoxString*)pEdItem)->SetText( pEdEntry, rStr );
+ pModel->InvalidateEntry( pEdEntry );
+ }
+ //if( GetSelectionMode() == SINGLE_SELECTION )
+ //{
+ if( GetSelectionCount() == 0 )
+ Select( pEdEntry );
+ if( GetSelectionMode() == MULTIPLE_SELECTION && !GetCurEntry() )
+ SetCurEntry( pEdEntry );
+ //}
+}
+
+void SvTreeListBox::EditingRequest( SvLBoxEntry* pEntry, SvLBoxItem* pItem,
+ const Point& )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( IsEditingActive() )
+ EndEditing();
+ if( pItem->IsA() == SV_ITEM_ID_LBOXSTRING )
+ {
+ Selection aSel( SELECTION_MIN, SELECTION_MAX );
+ if( EditingEntry( pEntry, aSel ) )
+ {
+ SelectAll( FALSE );
+ EditItemText( pEntry, (SvLBoxString*)pItem, aSel );
+ }
+ }
+}
+
+
+
+SvLBoxEntry* SvTreeListBox::GetDropTarget( const Point& rPos )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ // Scrollen
+ if( rPos.Y() < 12 )
+ {
+ SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE );
+ ScrollOutputArea( +1 );
+ }
+ else
+ {
+ Size aSize( pImp->GetOutputSize() );
+ if( rPos.Y() > aSize.Height() - 12 )
+ {
+ SvLBox::ImplShowTargetEmphasis( SvLBox::pTargetEntry, FALSE );
+ ScrollOutputArea( -1 );
+ }
+ }
+
+ SvLBoxEntry* pTarget = pImp->GetEntry( rPos );
+ // bei Droppen in leere Flaeche -> den letzten Eintrag nehmen
+ if( !pTarget )
+ return (SvLBoxEntry*)LastVisible();
+ else if( (GetDragDropMode() & SV_DRAGDROP_ENABLE_TOP) &&
+ pTarget == First() && rPos.Y() < 6 )
+ return 0;
+
+ return pTarget;
+}
+
+
+SvLBoxEntry* SvTreeListBox::GetEntry( const Point& rPos, BOOL bHit ) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxEntry* pEntry = pImp->GetEntry( rPos );
+ if( pEntry && bHit )
+ {
+ long nLine = pImp->GetEntryLine( pEntry );
+ if( !(pImp->EntryReallyHit( pEntry, rPos, nLine)) )
+ return 0;
+ }
+ return pEntry;
+}
+
+SvLBoxEntry* SvTreeListBox::GetCurEntry() const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return pImp->GetCurEntry();
+}
+
+void SvTreeListBox::SetWindowBits( WinBits nWinStyle )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nWindowStyle = nWinStyle;
+ nTreeFlags |= TREEFLAG_RECALCTABS;
+ if( nWinStyle & WB_SORT )
+ {
+ GetModel()->SetSortMode( SortAscending );
+ GetModel()->SetCompareHdl( LINK(this,SvTreeListBox,DefaultCompare));
+ }
+ else
+ {
+ GetModel()->SetSortMode( SortNone );
+ GetModel()->SetCompareHdl( Link() );
+ }
+#ifdef OS2
+ nWinStyle |= WB_VSCROLL;
+#endif
+ pImp->SetWindowBits( nWinStyle );
+ pImp->Resize();
+ Invalidate();
+}
+
+void SvTreeListBox::PaintEntry( SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pEntry,"PaintEntry:No Entry")
+ if( pEntry )
+ pImp->PaintEntry( pEntry );
+}
+
+void SvTreeListBox::InvalidateEntry( SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pEntry,"InvalidateEntry:No Entry")
+ if( pEntry )
+ {
+ GetModel()->InvalidateEntry( pEntry );
+ // pImp->InvalidateEntry( pEntry );
+ }
+}
+
+
+long SvTreeListBox::PaintEntry(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags)
+{
+ return PaintEntry1(pEntry,nLine,nTabFlags);
+}
+
+#define SV_TAB_BORDER 8
+
+long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,USHORT nTabFlags,
+ BOOL bHasClipRegion )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ Rectangle aRect; // multi purpose
+
+ BOOL bHorSBar = pImp->HasHorScrollBar();
+ PreparePaint( pEntry );
+
+ if( nTreeFlags & TREEFLAG_RECALCTABS )
+ SetTabs();
+
+ short nTempEntryHeight = GetEntryHeight();
+ long nWidth = pImp->GetOutputSize().Width();
+
+ // wurde innerhalb des PreparePaints die horizontale ScrollBar
+ // angeschaltet? Wenn ja, muss die ClipRegion neu gesetzt werden
+ if( !bHorSBar && pImp->HasHorScrollBar() )
+ SetClipRegion( Region(pImp->GetClipRegionRect()) );
+
+ Point aPos( GetMapMode().GetOrigin() );
+ aPos.X() *= -1; // Umrechnung Dokumentkoord.
+ long nMaxRight = nWidth + aPos.X() - 1;
+
+ Font aBackupFont( GetFont() );
+ Color aBackupColor = GetFillColor();
+
+ int bCurFontIsSel = FALSE;
+ BOOL bInUse = pEntry->HasInUseEmphasis();
+ // wenn eine ClipRegion von aussen gesetzt wird, dann
+ // diese nicht zuruecksetzen
+ BOOL bResetClipRegion = !bHasClipRegion;
+ BOOL bHideSelection = ((nWindowStyle & WB_HIDESELECTION) && !HasFocus())!=0;
+ const StyleSettings& rSettings = GetSettings().GetStyleSettings();
+ Font aHiliteFont( GetFont() );
+ aHiliteFont.SetColor( rSettings.GetHighlightTextColor() );
+
+ Size aRectSize( 0, nTempEntryHeight );
+
+ if( !bHasClipRegion && nWindowStyle & WB_HSCROLL )
+ {
+ SetClipRegion( Region(pImp->GetClipRegionRect()) );
+ bHasClipRegion = TRUE;
+ }
+
+ SvViewDataEntry* pViewDataEntry = GetViewDataEntry( pEntry );
+
+ USHORT nTabCount = aTabs.Count();
+ USHORT nItemCount = pEntry->ItemCount();
+ USHORT nCurTab = 0;
+ USHORT nCurItem = 0;
+
+ while( nCurTab < nTabCount && nCurItem < nItemCount )
+ {
+ SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nCurTab );
+ USHORT nNextTab = nCurTab + 1;
+ SvLBoxTab* pNextTab = nNextTab < nTabCount ? (SvLBoxTab*)aTabs.GetObject(nNextTab) : 0;
+ SvLBoxItem* pItem = nCurItem < nItemCount ? pEntry->GetItem(nCurItem) : 0;
+
+ USHORT nFlags = pTab->nFlags;
+ Size aSize( pItem->GetSize( pViewDataEntry, nCurItem ));
+ long nTabPos = GetTabPos( pEntry, pTab );
+
+ long nNextTabPos;
+ if( pNextTab )
+ nNextTabPos = GetTabPos( pEntry, pNextTab );
+ else
+ {
+ nNextTabPos = nMaxRight;
+ if( nTabPos > nMaxRight )
+ nNextTabPos += 50;
+ }
+
+ long nX;
+ if( pTab->nFlags & SV_LBOXTAB_ADJUST_RIGHT )
+ //verhindern, das rechter Rand von der Tabtrennung abgeschnitten wird
+ nX = nTabPos + pTab->CalcOffset(aSize.Width(), (nNextTabPos-SV_TAB_BORDER-1) -nTabPos);
+ else
+ nX = nTabPos + pTab->CalcOffset(aSize.Width(), nNextTabPos-nTabPos);
+
+ if( nFlags & nTabFlags )
+ {
+ if( !bHasClipRegion && nX + aSize.Width() >= nMaxRight )
+ {
+ SetClipRegion( Region(pImp->GetClipRegionRect()) );
+ bHasClipRegion = TRUE;
+ }
+ aPos.X() = nX;
+ aPos.Y() = nLine;
+
+ // Hintergrund-Muster & Farbe bestimmen
+
+ Wallpaper aWallpaper = GetBackground();
+
+ int bSelTab = nFlags & SV_LBOXTAB_SHOW_SELECTION;
+ USHORT nItemType = pItem->IsA();
+
+ if( pViewDataEntry->IsSelected() && bSelTab &&
+ !pViewDataEntry->IsCursored() )
+ {
+ if( !bInUse || nItemType != SV_ITEM_ID_LBOXCONTEXTBMP )
+ {
+ if( bHideSelection )
+ aWallpaper.SetColor( rSettings.GetDeactiveColor() );
+ else
+ aWallpaper.SetColor( rSettings.GetHighlightColor() );
+ // Font auf Hilite-Farbe setzen ?
+ if( !bCurFontIsSel && nItemType == SV_ITEM_ID_LBOXSTRING )
+ {
+ Control::SetFont( aHiliteFont );
+ bCurFontIsSel = TRUE;
+ }
+ }
+ else // ContextBitmap + InUse-Emphasis + Selektiert
+ aWallpaper.SetColor( rSettings.GetHighlightColor() );
+ }
+ else // keine Selektion
+ {
+ if( bInUse && nItemType == SV_ITEM_ID_LBOXCONTEXTBMP )
+ aWallpaper.SetColor( rSettings.GetFieldColor() );
+ else if( bCurFontIsSel && nItemType == SV_ITEM_ID_LBOXSTRING )
+ {
+ bCurFontIsSel = FALSE;
+ Control::SetFont( aBackupFont );
+ }
+ }
+
+ // Hintergrund zeichnen
+ if( !(nTreeFlags & TREEFLAG_USESEL))
+ {
+ // nur den Bereich zeichnen, den das Item einnimmt
+ aRectSize.Width() = aSize.Width();
+ aRect.SetPos( aPos );
+ aRect.SetSize( aRectSize );
+ }
+ else
+ {
+ // vom aktuellen bis zum naechsten Tab zeichnen
+ if( nCurTab != 0 )
+ aRect.Left() = nTabPos;
+ else
+ // beim nullten Tab immer ab Spalte 0 zeichnen
+ // (sonst Probleme bei Tabs mit Zentrierung)
+ aRect.Left() = 0;
+ aRect.Top() = nLine;
+ aRect.Bottom() = nLine + nTempEntryHeight - 1;
+ if( pNextTab )
+ {
+ long nRight;
+ nRight = GetTabPos(pEntry,pNextTab)-1;
+ if( nRight > nMaxRight )
+ nRight = nMaxRight;
+ aRect.Right() = nRight;
+ }
+ else
+ aRect.Right() = nMaxRight;
+ }
+ // bei anwenderdefinierter Selektion, die bei einer Tabposition
+ // groesser 0 beginnt den Hintergrund des 0.ten Items nicht
+ // fuellen, da sonst z.B. TablistBoxen mit Linien nicht
+ // realisiert werden koennen.
+ if( !(nCurTab==0 && (nTreeFlags & TREEFLAG_USESEL) && nFirstSelTab) )
+ {
+ SetFillColor( aWallpaper.GetColor() );
+ // Bei kleinen hor. Resizes tritt dieser Fall auf
+ if( aRect.Left() < aRect.Right() )
+ DrawRect( aRect );
+ }
+ // Item zeichnen
+ // vertikal zentrieren
+ aPos.Y() += ( nTempEntryHeight - aSize.Height() ) / 2;
+ pItem->Paint( aPos, *this, pViewDataEntry->GetFlags(), pEntry );
+
+ // Trennungslinie zwischen Tabs
+ if( pNextTab && pItem->IsA() == SV_ITEM_ID_LBOXSTRING &&
+ // nicht am rechten Fensterrand!
+ aRect.Right() < nMaxRight )
+ {
+ aRect.Left() = aRect.Right() - SV_TAB_BORDER;
+ DrawRect( aRect );
+ }
+
+ SetFillColor( aBackupColor );
+ }
+ nCurItem++;
+ nCurTab++;
+ }
+ if( pViewDataEntry->IsCursored() && !HasFocus() )
+ {
+ // Cursor-Emphasis
+ SetFillColor();
+ Color aOldLineColor = GetLineColor();
+ SetLineColor( Color( COL_BLACK ) );
+ aRect = GetFocusRect( pEntry, nLine );
+ aRect.Top()++;
+ aRect.Bottom()--;
+ DrawRect( aRect );
+ SetLineColor( aOldLineColor );
+ SetFillColor( aBackupColor );
+ }
+
+ if( bCurFontIsSel )
+ Control::SetFont( aBackupFont );
+
+ USHORT nFirstDynTabPos;
+ SvLBoxTab* pFirstDynamicTab = GetFirstDynamicTab( nFirstDynTabPos );
+ long nDynTabPos = GetTabPos( pEntry, pFirstDynamicTab );
+ nDynTabPos += pImp->nNodeBmpTabDistance;
+ nDynTabPos += pImp->nNodeBmpWidth / 2;
+ nDynTabPos += 4; // 4 Pixel Reserve, damit die Node-Bitmap
+ // nicht zu nah am naechsten Tab steht
+
+ if( (!(pEntry->GetFlags() & SV_ENTRYFLAG_NO_NODEBMP)) &&
+ (nWindowStyle & WB_HASBUTTONS) && pFirstDynamicTab &&
+ ( pEntry->HasChilds() || pEntry->HasChildsOnDemand() ) )
+ {
+ // ersten festen Tab suchen, und pruefen ob die Node-Bitmap
+ // in ihn hineinragt
+ USHORT nNextTab = nFirstDynTabPos;
+ SvLBoxTab* pNextTab;
+ do
+ {
+ nNextTab++;
+ pNextTab = nNextTab < nTabCount ? (SvLBoxTab*)aTabs.GetObject(nNextTab) : 0;
+ } while( pNextTab && pNextTab->IsDynamic() );
+
+ if( !pNextTab || (GetTabPos( pEntry, pNextTab ) > nDynTabPos) )
+ {
+ if((nWindowStyle & WB_HASBUTTONSATROOT) || pModel->GetDepth(pEntry) > 0)
+ {
+ Point aPos( GetTabPos(pEntry,pFirstDynamicTab), nLine );
+ aPos.X() += pImp->nNodeBmpTabDistance;
+ const Image* pImg = 0;
+ if( IsExpanded(pEntry) )
+ pImg = &pImp->GetExpandedNodeBmp();
+ else
+ {
+ if( (!pEntry->HasChilds()) && pEntry->HasChildsOnDemand() &&
+ (!(pEntry->GetFlags() & SV_ENTRYFLAG_HAD_CHILDREN)) &&
+ pImp->GetDontKnowNodeBmp().GetSizePixel().Width() )
+ pImg = &pImp->GetDontKnowNodeBmp();
+ else
+ pImg = &pImp->GetCollapsedNodeBmp();
+ }
+ aPos.Y() += (nTempEntryHeight - pImg->GetSizePixel().Height()) / 2;
+ DrawImage( aPos, *pImg );
+ }
+ }
+ }
+
+
+ if( bHasClipRegion && bResetClipRegion )
+ SetClipRegion();
+ return 0; // nRowLen;
+}
+
+void SvTreeListBox::PreparePaint( SvLBoxEntry* )
+{
+}
+
+Rectangle SvTreeListBox::GetFocusRect( SvLBoxEntry* pEntry, long nLine )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Size aSize;
+ Rectangle aRect;
+ aRect.Top() = nLine;
+ aSize.Height() = GetEntryHeight();
+
+ long nRealWidth = pImp->GetOutputSize().Width();
+ nRealWidth -= GetMapMode().GetOrigin().X();
+
+ USHORT nCurTab;
+ SvLBoxTab* pTab = GetFirstTab( SV_LBOXTAB_SHOW_SELECTION, nCurTab );
+ long nTabPos = 0;
+ if( pTab )
+ nTabPos = GetTabPos( pEntry, pTab );
+ long nNextTabPos;
+ if( pTab && nCurTab < aTabs.Count() - 1 )
+ {
+ SvLBoxTab* pNextTab = (SvLBoxTab*)aTabs.GetObject( nCurTab + 1 );
+ nNextTabPos = GetTabPos( pEntry, pNextTab );
+ }
+ else
+ {
+ nNextTabPos = nRealWidth;
+ if( nTabPos > nRealWidth )
+ nNextTabPos += 50;
+ }
+
+ BOOL bUserSelection = (BOOL)( nTreeFlags & TREEFLAG_USESEL ) != 0;
+ if( !bUserSelection )
+ {
+ if( pTab && nCurTab < pEntry->ItemCount() )
+ {
+ SvLBoxItem* pItem = pEntry->GetItem( nCurTab );
+ aSize.Width() = pItem->GetSize( this, pEntry ).Width();
+ if( !aSize.Width() )
+ aSize.Width() = 15;
+ long nX = nTabPos; //GetTabPos( pEntry, pTab );
+ // Ausrichtung
+ nX += pTab->CalcOffset( aSize.Width(), nNextTabPos - nTabPos );
+ aRect.Left() = nX;
+ // damit erster & letzter Buchstabe nicht angeknabbert werden
+ aRect.SetSize( aSize );
+ if( aRect.Left() > 0 )
+ aRect.Left()--;
+ aRect.Right()++;
+ }
+ }
+ else
+ {
+ // wenn erster SelTab != 0, dann muessen wir auch rechnen
+ if( nFocusWidth == -1 || nFirstSelTab )
+ {
+ USHORT nLastTab;
+ SvLBoxTab* pLastTab = GetLastTab(SV_LBOXTAB_SHOW_SELECTION,nLastTab);
+ nLastTab++;
+ if( nLastTab < aTabs.Count() ) // gibts noch einen ?
+ pLastTab = (SvLBoxTab*)aTabs.GetObject( nLastTab );
+ else
+ pLastTab = 0; // ueber gesamte Breite selektieren
+ aSize.Width() = pLastTab ? pLastTab->GetPos() : 0x0fffffff;
+ nFocusWidth = (short)aSize.Width();
+ if( pTab )
+ nFocusWidth -= (short)nTabPos; //pTab->GetPos();
+ }
+ else
+ {
+ aSize.Width() = nFocusWidth;
+ if( pTab )
+ {
+ if( nCurTab )
+ aSize.Width() += nTabPos;
+ else
+ aSize.Width() += pTab->GetPos(); // Tab0 immer ab ganz links
+ }
+ }
+ // wenn Sel. beim nullten Tab anfaengt, dann ab Spalte 0 sel. zeichnen
+ if( nCurTab != 0 )
+ {
+ aRect.Left() = nTabPos;
+ aSize.Width() -= nTabPos;
+ }
+ aRect.SetSize( aSize );
+ }
+ // rechten Rand anpassen wg. Clipping
+ if( aRect.Right() >= nRealWidth )
+ {
+ aRect.Right() = nRealWidth-1;
+ nFocusWidth = (short)aRect.GetWidth();
+ }
+ return aRect;
+}
+
+
+long SvTreeListBox::GetTabPos( SvLBoxEntry* pEntry, SvLBoxTab* pTab)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pTab,"No Tab")
+ long nPos = pTab->GetPos();
+ if( pTab->IsDynamic() )
+ {
+ USHORT nDepth = pModel->GetDepth( pEntry );
+ nDepth *= (USHORT)nIndent;
+ nPos += (long)nDepth;
+ }
+ return nPos;
+}
+
+SvLBoxItem* SvTreeListBox::GetItem_Impl( SvLBoxEntry* pEntry, long nX,
+ SvLBoxTab** ppTab, USHORT nEmptyWidth )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxItem* pItemClicked = 0;
+ USHORT nTabCount = aTabs.Count();
+ USHORT nItemCount = pEntry->ItemCount();
+ SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
+ SvLBoxItem* pItem = pEntry->GetItem(0);
+ USHORT nNextItem = 1;
+ nX -= GetMapMode().GetOrigin().X();
+ long nRealWidth = pImp->GetOutputSize().Width();
+ nRealWidth -= GetMapMode().GetOrigin().X();
+
+ while( 1 )
+ {
+ SvLBoxTab* pNextTab=nNextItem<nTabCount ? (SvLBoxTab*)aTabs.GetObject(nNextItem) : 0;
+ long nStart = GetTabPos( pEntry, pTab );
+
+ long nNextTabPos;
+ if( pNextTab )
+ nNextTabPos = GetTabPos( pEntry, pNextTab );
+ else
+ {
+ nNextTabPos = nRealWidth;
+ if( nStart > nRealWidth )
+ nNextTabPos += 50;
+ }
+
+ Size aItemSize( pItem->GetSize(this, pEntry));
+ nStart += pTab->CalcOffset( aItemSize.Width(), nNextTabPos - nStart );
+ long nLen = aItemSize.Width();
+ if( pNextTab )
+ {
+ long nTabWidth = GetTabPos( pEntry, pNextTab ) - nStart;
+ if( nTabWidth < nLen )
+ nLen = nTabWidth;
+ }
+
+ if( !nLen )
+ nLen = nEmptyWidth;
+
+ if( nX >= nStart && nX < (nStart+nLen ) )
+ {
+ pItemClicked = pItem;
+ if( ppTab )
+ {
+ *ppTab = pTab;
+ break;
+ }
+ }
+ if( nNextItem >= nItemCount || nNextItem >= nTabCount)
+ break;
+ pTab = (SvLBoxTab*)aTabs.GetObject( nNextItem );
+ pItem = pEntry->GetItem( nNextItem );
+ nNextItem++;
+ }
+ return pItemClicked;
+}
+
+SvLBoxItem* SvTreeListBox::GetItem(SvLBoxEntry* pEntry,long nX,SvLBoxTab** ppTab)
+{
+ return GetItem_Impl( pEntry, nX, ppTab, 0 );
+}
+
+SvLBoxItem* SvTreeListBox::GetItem(SvLBoxEntry* pEntry,long nX )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ SvLBoxTab* pDummyTab;
+ return GetItem_Impl( pEntry, nX, &pDummyTab, 0 );
+}
+
+SvLBoxItem* SvTreeListBox::GetFirstDynamicItem( SvLBoxEntry* pEntry )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(0);
+ SvLBoxItem* pItem = pEntry->GetItem(0);
+ USHORT nTabCount = aTabs.Count();
+
+ USHORT nNext = 1;
+ while ( !pTab->IsDynamic() && nNext < nTabCount )
+ {
+ pItem = pEntry->GetItem( nNext );
+ pTab = (SvLBoxTab*)aTabs.GetObject( nNext );
+ nNext++;
+ }
+ return pItem;
+}
+
+void SvTreeListBox::AddTab(long nPos,USHORT nFlags,void* pUserData )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nFocusWidth = -1;
+ SvLBoxTab* pTab = new SvLBoxTab( nPos, nFlags );
+ pTab->SetUserData( pUserData );
+ aTabs.Insert( pTab, aTabs.Count() );
+ if( nTreeFlags & TREEFLAG_USESEL )
+ {
+ USHORT nPos = aTabs.Count() - 1;
+ if( nPos >= nFirstSelTab && nPos <= nLastSelTab )
+ pTab->nFlags |= SV_LBOXTAB_SHOW_SELECTION;
+ else
+ // String-Items werden normalerweise immer selektiert
+ // deshalb explizit ausschalten
+ pTab->nFlags &= ~SV_LBOXTAB_SHOW_SELECTION;
+ }
+}
+
+
+
+SvLBoxTab* SvTreeListBox::GetFirstDynamicTab( USHORT& rPos ) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ USHORT nCurTab = 0;
+ USHORT nTabCount = aTabs.Count();
+ while( nCurTab < nTabCount )
+ {
+ SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject(nCurTab);
+ if( pTab->nFlags & SV_LBOXTAB_DYNAMIC )
+ {
+ rPos = nCurTab;
+ return pTab;
+ }
+ nCurTab++;
+ }
+ return 0;
+}
+
+SvLBoxTab* SvTreeListBox::GetFirstDynamicTab() const
+{
+ USHORT nDummy;
+ return GetFirstDynamicTab( nDummy );
+}
+
+SvLBoxTab* SvTreeListBox::GetTab( SvLBoxEntry* pEntry, SvLBoxItem* pItem) const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ USHORT nPos = pEntry->GetPos( pItem );
+ return (SvLBoxTab*)aTabs.GetObject( nPos );
+}
+
+void SvTreeListBox::ClearTabList()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ USHORT nTabCount = aTabs.Count();
+ while( nTabCount )
+ {
+ nTabCount--;
+ SvLBoxTab* pDelTab = (SvLBoxTab*)aTabs.GetObject( nTabCount );
+ delete pDelTab;
+ }
+ aTabs.Remove(0,aTabs.Count());
+}
+
+
+Size SvTreeListBox::GetOutputSizePixel() const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Size aSize = pImp->GetOutputSize();
+ return aSize;
+}
+
+void SvTreeListBox::NotifyBeginScroll()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+}
+
+void SvTreeListBox::NotifyEndScroll()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+}
+
+void SvTreeListBox::NotifyScrolling( long nCount )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+}
+
+void SvTreeListBox::NotifyScrolled()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ aScrolledHdl.Call( this );
+}
+
+void SvTreeListBox::NotifyInvalidating()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+}
+
+void SvTreeListBox::Invalidate()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( nFocusWidth == -1 )
+ // damit Control nicht nach dem Paint ein falsches FocusRect anzeigt
+ pImp->RecalcFocusRect();
+ NotifyInvalidating();
+ SvLBox::Invalidate();
+ pImp->Invalidate();
+}
+
+void SvTreeListBox::Invalidate( const Rectangle& rRect )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( nFocusWidth == -1 )
+ // damit Control nicht nach dem Paint ein falsches FocusRect anzeigt
+ pImp->RecalcFocusRect();
+ NotifyInvalidating();
+ SvLBox::Invalidate( rRect );
+}
+
+
+void SvTreeListBox::SetHighlightRange( USHORT nStart, USHORT nEnd)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+
+ USHORT nTemp;
+ nTreeFlags |= TREEFLAG_USESEL;
+ if( nStart > nEnd )
+ {
+ nTemp = nStart;
+ nStart = nEnd;
+ nEnd = nTemp;
+ }
+ // alle Tabs markieren, die im Bereich liegen
+ nTreeFlags |= TREEFLAG_RECALCTABS;
+ nFirstSelTab = nStart;
+ nLastSelTab = nEnd;
+ pImp->RecalcFocusRect();
+}
+
+void SvTreeListBox::RemoveHighlightRange()
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ nTreeFlags &= (~TREEFLAG_USESEL);
+ if( IsUpdateMode() )
+ Invalidate();
+}
+
+ULONG SvTreeListBox::GetAscInsertionPos(SvLBoxEntry* pEntry,SvLBoxEntry* pParent)
+{
+ return LIST_APPEND;
+}
+
+ULONG SvTreeListBox::GetDescInsertionPos(SvLBoxEntry* pEntry,SvLBoxEntry* pParent)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ return LIST_APPEND;
+}
+
+Region SvTreeListBox::GetDragRegion() const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ Rectangle aRect;
+ SvLBoxEntry* pEntry = GetCurEntry();
+ if( pEntry )
+ {
+ Point aPos = GetEntryPos( pEntry );
+ aRect = ((SvTreeListBox*)this)->GetFocusRect( pEntry, aPos.Y() );
+ }
+ Region aRegion( aRect );
+ return aRegion;
+}
+
+
+void SvTreeListBox::Command( const CommandEvent& rCEvt )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ pImp->Command( rCEvt );
+}
+
+
+void SvTreeListBox::RemoveParentKeepChilds( SvLBoxEntry* pParent )
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ DBG_ASSERT(pParent,"RemoveParentKeepChilds:No Parent");
+ SvLBoxEntry* pNewParent = GetParent( pParent );
+ if( pParent->HasChilds())
+ {
+ SvLBoxEntry* pChild = FirstChild( pParent );
+ while( pChild )
+ {
+ pModel->Move( pChild, pNewParent, LIST_APPEND );
+ pChild = FirstChild( pParent );
+ }
+ }
+ pModel->Remove( pParent );
+}
+
+SvLBoxTab* SvTreeListBox::GetFirstTab( USHORT nFlagMask, USHORT& rPos )
+{
+ USHORT nTabCount = aTabs.Count();
+ for( USHORT nPos = 0; nPos < nTabCount; nPos++ )
+ {
+ SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( nPos );
+ if( (pTab->nFlags & nFlagMask) )
+ {
+ rPos = nPos;
+ return pTab;
+ }
+ }
+ rPos = 0xffff;
+ return 0;
+}
+
+SvLBoxTab* SvTreeListBox::GetLastTab( USHORT nFlagMask, USHORT& rTabPos )
+{
+ short nTabCount = (short)aTabs.Count();
+ if( nTabCount )
+ {
+ for( short nPos = nTabCount-1; nPos >= 0; nPos-- )
+ {
+ SvLBoxTab* pTab = (SvLBoxTab*)aTabs.GetObject( (USHORT)nPos );
+ if( (pTab->nFlags & nFlagMask) )
+ {
+ rTabPos = (USHORT)nPos;
+ return pTab;
+ }
+ }
+ }
+ rTabPos = 0xffff;
+ return 0;
+}
+
+void SvTreeListBox::SetAddMode( BOOL bAdd )
+{
+ pImp->SetAddMode( bAdd );
+}
+
+BOOL SvTreeListBox::IsAddMode() const
+{
+ return pImp->IsAddMode();
+}
+
+void SvTreeListBox::RequestHelp( const HelpEvent& rHEvt )
+{
+ if( !pImp->RequestHelp( rHEvt ) )
+ SvLBox::RequestHelp( rHEvt );
+}
+
+void SvTreeListBox::CursorMoved( SvLBoxEntry* )
+{
+}
+
+IMPL_LINK( SvTreeListBox, DefaultCompare, SvSortData*, pData )
+{
+ SvLBoxEntry* pLeft = (SvLBoxEntry*)(pData->pLeft );
+ SvLBoxEntry* pRight = (SvLBoxEntry*)(pData->pRight );
+ String aLeft( ((SvLBoxString*)(pLeft->GetFirstItem(SV_ITEM_ID_LBOXSTRING)))->GetText());
+ String aRight( ((SvLBoxString*)(pRight->GetFirstItem(SV_ITEM_ID_LBOXSTRING)))->GetText());
+ // Intntl: Compare(a,b) ==> b.Compare(a) ==> strcmp(a,b)
+ const International& rInter = Application::GetAppInternational();
+ StringCompare eCompare = rInter.Compare( aLeft, aRight );
+ return (long)eCompare;
+}
+
+void SvTreeListBox::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, ULONG nPos )
+{
+ if( nActionId == LISTACTION_CLEARING )
+ CancelTextEditing();
+
+ SvLBox::ModelNotification( nActionId, pEntry1, pEntry2, nPos );
+ switch( nActionId )
+ {
+ case LISTACTION_RESORTING:
+ SetUpdateMode( FALSE );
+ break;
+
+ case LISTACTION_RESORTED:
+ // nach Sortierung den ersten Eintrag anzeigen, dabei die
+ // Selektion erhalten.
+ MakeVisible( (SvLBoxEntry*)pModel->First(), TRUE );
+ SetUpdateMode( TRUE );
+ break;
+
+ case LISTACTION_CLEARED:
+ if( IsUpdateMode() )
+ Update();
+ break;
+ }
+}
+
+// bei Aenderungen SetTabs beruecksichtigen
+long SvTreeListBox::GetTextOffset() const
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ BOOL bHasButtons = (nWindowStyle & WB_HASBUTTONS)!=0;
+ BOOL bHasButtonsAtRoot = (nWindowStyle & (WB_HASLINESATROOT |
+ WB_HASBUTTONSATROOT))!=0;
+ long nStartPos = TAB_STARTPOS;
+ long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
+
+ long nCheckWidth = 0;
+ if( nTreeFlags & TREEFLAG_CHKBTN )
+ nCheckWidth = pCheckButtonData->aBmps[0].GetSizePixel().Width();
+ long nCheckWidthDIV2 = nCheckWidth / 2;
+
+ long nContextWidth = nContextBmpWidthMax;
+ long nContextWidthDIV2 = nContextWidth / 2;
+
+ int nCase = NO_BUTTONS;
+ if( !(nTreeFlags & TREEFLAG_CHKBTN) )
+ {
+ if( bHasButtons )
+ nCase = NODE_BUTTONS;
+ }
+ else
+ {
+ if( bHasButtons )
+ nCase = NODE_AND_CHECK_BUTTONS;
+ else
+ nCase = CHECK_BUTTONS;
+ }
+
+ switch( nCase )
+ {
+ case NO_BUTTONS :
+ nStartPos += nContextWidthDIV2; // wg. Zentrierung
+ nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp
+ if( nContextBmpWidthMax )
+ nStartPos += 5; // Abstand Context-Bmp - Text
+ break;
+
+ case NODE_BUTTONS :
+ if( bHasButtonsAtRoot )
+ nStartPos += ( nIndent + (nNodeWidthPixel/2) );
+ else
+ nStartPos += nContextWidthDIV2;
+ nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp
+ if( nContextBmpWidthMax )
+ nStartPos += 5; // Abstand Context-Bmp - Text
+ break;
+
+ case NODE_AND_CHECK_BUTTONS :
+ if( bHasButtonsAtRoot )
+ nStartPos += ( nIndent + nNodeWidthPixel );
+ else
+ nStartPos += nCheckWidthDIV2;
+ nStartPos += nCheckWidthDIV2; // rechter Rand des CheckButtons
+ nStartPos += 3; // Abstand CheckButton Context-Bmp
+ nStartPos += nContextWidthDIV2; // Mitte der Context-Bmp
+ nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp
+ // Abstand setzen nur wenn Bitmaps da
+ if( nContextBmpWidthMax )
+ nStartPos += 5; // Abstand Context-Bmp - Text
+ break;
+
+ case CHECK_BUTTONS :
+ nStartPos += nCheckWidthDIV2;
+ nStartPos += nCheckWidthDIV2; // rechter Rand CheckButton
+ nStartPos += 3; // Abstand CheckButton Context-Bmp
+ nStartPos += nContextWidthDIV2; // Mitte der Context-Bmp
+ nStartPos += nContextWidthDIV2; // rechter Rand der Context-Bmp
+ if( nContextBmpWidthMax )
+ nStartPos += 5; // Abstand Context-Bmp - Text
+ break;
+ }
+ return nStartPos;
+}
+
+void SvTreeListBox::EndSelection()
+{
+ pImp->EndSelection();
+}
+
+BOOL SvTreeListBox::IsNodeButton( const Point& rPos ) const
+{
+ SvLBoxEntry* pEntry = GetEntry( rPos );
+ if( pEntry )
+ return pImp->IsNodeButton( rPos, pEntry );
+ return FALSE;
+}
+
+void SvTreeListBox::RepaintScrollBars() const
+{
+ ((SvTreeListBox*)this)->pImp->RepaintScrollBars();
+}
+
+ScrollBar *SvTreeListBox::GetVScroll()
+{
+ return &((SvTreeListBox*)this)->pImp->aVerSBar;
+}
+
+ScrollBar *SvTreeListBox::GetHScroll()
+{
+ return &((SvTreeListBox*)this)->pImp->aHorSBar;
+}
+
+void SvTreeListBox::EnableAsyncDrag( BOOL b )
+{
+ pImp->EnableAsyncDrag( b );
+}
+
+void SvTreeListBox::SetDontKnowNodeBitmap( const Image& rCollapsedNodeBmp )
+{
+ pImp->SetDontKnowNodeBmp( rCollapsedNodeBmp );
+}
+
+SvLBoxEntry* SvTreeListBox::GetFirstEntryInView() const
+{
+ Point aPos;
+ return GetEntry( aPos );
+}
+
+SvLBoxEntry* SvTreeListBox::GetNextEntryInView(SvLBoxEntry* pEntry ) const
+{
+ SvLBoxEntry* pNext = (SvLBoxEntry*)NextVisible( pEntry );
+ if( pNext )
+ {
+ Point aPos( GetEntryPos(pNext) );
+ const Size& rSize = pImp->GetOutputSize();
+ if( aPos.Y() < 0 || aPos.Y() >= rSize.Height() )
+ return 0;
+ }
+ return pNext;
+}
+
+void SvTreeListBox::ShowFocusRect( const SvLBoxEntry* pEntry )
+{
+ pImp->ShowFocusRect( pEntry );
+}
+
+void SvTreeListBox::SetTabBar( TabBar* pTabBar )
+{
+ pImp->SetTabBar( pTabBar );
+}
+
+void SvTreeListBox::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if( (rDCEvt.GetType()==DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ InitSettings( TRUE, TRUE, TRUE );
+ Invalidate();
+ }
+ else
+ Control::DataChanged( rDCEvt );
+}
+
+void SvTreeListBox::InitSettings(BOOL bFont,BOOL bForeground,BOOL bBackground)
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ if( bFont )
+ {
+ Font aFont;
+ aFont = rStyleSettings.GetFieldFont();
+ SetPointFont( aFont );
+ }
+
+ if( bForeground || bFont )
+ {
+ SetTextColor( rStyleSettings.GetFieldTextColor() );
+ SetTextFillColor();
+ }
+
+ if( bBackground )
+ SetBackground( rStyleSettings.GetFieldColor() );
+}
+
+void SvTreeListBox::InitStartEntry()
+{
+ if( !pImp->pStartEntry )
+ pImp->pStartEntry = GetModel()->First();
+}
+
+
diff --git a/svtools/source/contnr/treelist.cxx b/svtools/source/contnr/treelist.cxx
new file mode 100644
index 000000000000..04255804df22
--- /dev/null
+++ b/svtools/source/contnr/treelist.cxx
@@ -0,0 +1,2146 @@
+/*************************************************************************
+ *
+ * $RCSfile: treelist.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _TREELIST_CXX
+
+#pragma hdrstop
+
+#include <treelist.hxx>
+
+#ifndef PRODUCT
+// Prueft Integritaet der Liste nach jeder Operation
+//#define CHECK_INTEGRITY
+#endif
+
+
+DBG_NAME(SvListEntry);
+
+SvListEntry::SvListEntry()
+{
+ DBG_CTOR(SvListEntry,0);
+ pChilds = 0;
+ pParent = 0;
+ nListPos = 0;
+ nAbsPos = 0;
+}
+
+SvListEntry::SvListEntry( const SvListEntry& rEntry )
+{
+ DBG_CTOR(SvListEntry,0);
+ pChilds = 0;
+ pParent = 0;
+ nListPos &= 0x80000000;
+ nListPos |= ( rEntry.nListPos & 0x7fffffff);
+ nAbsPos = rEntry.nAbsPos;
+}
+
+SvListEntry::~SvListEntry()
+{
+ DBG_DTOR(SvListEntry,0);
+ if ( pChilds )
+ {
+ pChilds->DestroyAll();
+ delete pChilds;
+ }
+#ifdef DBG_UTIL
+ pChilds = 0;
+ pParent = 0;
+#endif
+}
+
+void SvListEntry::Clone( SvListEntry* pSource)
+{
+ DBG_CHKTHIS(SvListEntry,0);
+ nListPos &= 0x80000000;
+ nListPos |= ( pSource->nListPos & 0x7fffffff);
+ nAbsPos = pSource->nAbsPos;
+}
+
+void SvListEntry::SetListPositions()
+{
+ if( pChilds )
+ {
+ SvListEntry *pEntry = (SvListEntry*)pChilds->First();
+ ULONG nCur = 0;
+ while ( pEntry )
+ {
+ pEntry->nListPos &= 0x80000000;
+ pEntry->nListPos |= nCur;
+ nCur++;
+ pEntry = (SvListEntry*)pChilds->Next();
+ }
+ }
+ nListPos &= (~0x80000000);
+}
+
+
+DBG_NAME(SvViewData);
+
+SvViewData::SvViewData()
+{
+ DBG_CTOR(SvViewData,0);
+ nFlags = 0;
+ nVisPos = 0;
+}
+
+SvViewData::SvViewData( const SvViewData& rData )
+{
+ DBG_CTOR(SvViewData,0);
+ nFlags = rData.nFlags;
+ nFlags &= ~( SVLISTENTRYFLAG_SELECTED | SVLISTENTRYFLAG_FOCUSED );
+ nVisPos = rData.nVisPos;
+}
+
+SvViewData::~SvViewData()
+{
+ DBG_DTOR(SvViewData,0);
+#ifdef DBG_UTIL
+ nVisPos = 0x12345678;
+ nFlags = 0x1234;
+#endif
+}
+
+void SvTreeEntryList::DestroyAll()
+{
+ SvListEntry* pPtr = (SvListEntry*)First();
+ while( pPtr )
+ {
+ delete pPtr;
+ pPtr = (SvListEntry*)Next();
+ }
+}
+
+
+
+
+#if defined (WIN) && defined (MSC)
+// siehe BugId 42896: Die Funktionen Prev, PrevVisible, Next, NextVisible
+// (andere?) funktionieren nicht mit Optimierung.
+#pragma optimize ("", off)
+#endif
+
+
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvTreeList::SvTreeList()
+{
+ nEntryCount = 0;
+ bAbsPositionsValid = FALSE;
+ nRefCount = 1;
+ pRootItem = new SvListEntry;
+ eSortMode = SortNone;
+}
+
+
+/*************************************************************************
+|*
+|* SvTreeList::~SvTreeList
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvTreeList::~SvTreeList()
+{
+ Clear();
+ delete pRootItem;
+#ifdef DBG_UTIL
+ pRootItem = 0;
+#endif
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::Broadcast
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+void SvTreeList::Broadcast( USHORT nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, ULONG nPos )
+{
+ ULONG nViewCount = aViewList.Count();
+ for( ULONG nCurView = 0; nCurView < nViewCount; nCurView++ )
+ {
+ SvListView* pView = (SvListView*)aViewList.GetObject( nCurView );
+ if( pView )
+ pView->ModelNotification( nActionId, pEntry1, pEntry2, nPos );
+ }
+}
+
+void SvTreeList::InsertView( SvListView* pView)
+{
+ ULONG nPos = aViewList.GetPos( pView );
+ if ( nPos == LIST_ENTRY_NOTFOUND )
+ {
+ aViewList.Insert( pView, LIST_APPEND );
+ nRefCount++;
+ }
+}
+
+void SvTreeList::RemoveView( SvListView* pView )
+{
+ ULONG nPos = aViewList.GetPos( pView );
+ if ( nPos != LIST_ENTRY_NOTFOUND )
+ {
+ aViewList.Remove( pView );
+ nRefCount--;
+ }
+}
+
+
+// Ein Entry ist sichtbar, wenn alle Parents expandiert sind
+BOOL SvTreeList::IsEntryVisible( const SvListView* pView, SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pView&&pEntry,"IsVisible:Invalid Params")
+ BOOL bRetVal=FALSE;
+ do
+ {
+ if ( pEntry == pRootItem )
+ {
+ bRetVal=TRUE;
+ break;
+ }
+ pEntry = pEntry->pParent;
+ } while( pView->IsExpanded( pEntry ) );
+ return bRetVal;
+}
+
+USHORT SvTreeList::GetDepth( SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pEntry&&pEntry!=pRootItem,"GetDepth:Bad Entry")
+ USHORT nDepth = 0;
+ while( pEntry->pParent != pRootItem )
+ {
+ nDepth++;
+ pEntry = pEntry->pParent;
+ }
+ return nDepth;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+void SvTreeList::Clear()
+{
+ Broadcast( LISTACTION_CLEARING );
+ SvTreeEntryList* pRootList = pRootItem->pChilds;
+ if ( pRootList )
+ {
+ SvListEntry* pEntry = (SvListEntry*)(pRootList->First());
+ while( pEntry )
+ {
+ delete pEntry;
+ pEntry = (SvListEntry*)(pRootList->Next());
+ }
+ delete pRootItem->pChilds;
+ pRootItem->pChilds = 0;
+ }
+ nEntryCount = 0;
+ Broadcast( LISTACTION_CLEARED );
+}
+
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+BOOL SvTreeList::IsChild( SvListEntry* pParent, SvListEntry* pChild ) const
+{
+ if ( !pParent )
+ pParent = pRootItem;
+
+ BOOL bIsChild = FALSE;
+ SvTreeEntryList* pList = pParent->pChilds;
+ if ( !pList )
+ return FALSE;
+ SvListEntry* pActualChild = (SvListEntry*)(pList->First());
+ while( !bIsChild && pActualChild )
+ {
+ if ( pActualChild == pChild )
+ bIsChild = TRUE;
+ else
+ {
+ if ( pActualChild->pChilds )
+ bIsChild = IsChild( pActualChild, pChild );
+ pActualChild = (SvListEntry*)(pList->Next());
+ }
+ }
+ return bIsChild;
+}
+
+ULONG SvTreeList::Move(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos)
+{
+ // pDest darf Null sein!
+ DBG_ASSERT(pSrcEntry,"Entry?")
+ if ( !pTargetParent )
+ pTargetParent = pRootItem;
+ DBG_ASSERT(pSrcEntry!=pTargetParent,"Move:Source=Target")
+
+ Broadcast( LISTACTION_MOVING, pSrcEntry, pTargetParent, nListPos );
+
+ if ( !pTargetParent->pChilds )
+ pTargetParent->pChilds = new SvTreeEntryList;
+ if ( pSrcEntry == pTargetParent )
+ return pSrcEntry->GetChildListPos();
+
+ bAbsPositionsValid = FALSE;
+
+ SvTreeEntryList* pDstList = pTargetParent->pChilds;
+ SvTreeEntryList* pSrcList = pSrcEntry->pParent->pChilds;
+
+ // Dummy-Ptr einfuegen, weil nListPos durch das
+ // folgende Remove ungueltig werden koennte
+ SvListEntry* pDummy = 0; pDstList->Insert( pDummy, nListPos );
+
+ // loeschen
+ pSrcList->Remove( pSrcEntry );
+ // Hat Parent noch Childs ?
+ if ( pSrcList->Count() == 0 )
+ {
+ // Keine Childs, deshalb Child-List loeschen
+ SvListEntry* pParent = pSrcEntry->pParent;
+ pParent->pChilds = 0;
+ delete pSrcList;
+ pSrcList = 0;
+ }
+
+ // Parent umsetzen (erst hier, weil wir zum Loeschen
+ // der ChildList den alten Parent noch benoetigen!)
+ pSrcEntry->pParent = pTargetParent;
+
+ pDstList->Replace( pSrcEntry, pDummy );
+
+ // Listenpositionen in Zielliste korrigieren
+ SetListPositions( pDstList );
+ if ( pSrcList && (ULONG)pSrcList != (ULONG)pDstList )
+ SetListPositions( pSrcList );
+
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+
+ ULONG nRetVal = pDstList->GetPos( pSrcEntry );
+ DBG_ASSERT(nRetVal==pSrcEntry->GetChildListPos(),"ListPos not valid")
+ Broadcast( LISTACTION_MOVED,pSrcEntry,pTargetParent,nRetVal);
+ return nRetVal;
+}
+
+ULONG SvTreeList::Copy(SvListEntry* pSrcEntry,SvListEntry* pTargetParent,ULONG nListPos)
+{
+ // pDest darf Null sein!
+ DBG_ASSERT(pSrcEntry,"Entry?")
+ if ( !pTargetParent )
+ pTargetParent = pRootItem;
+ if ( !pTargetParent->pChilds )
+ pTargetParent->pChilds = new SvTreeEntryList;
+
+ bAbsPositionsValid = FALSE;
+
+ ULONG nCloneCount = 0;
+ SvListEntry* pClonedEntry = Clone( pSrcEntry, nCloneCount );
+ nEntryCount += nCloneCount;
+
+ SvTreeEntryList* pDstList = pTargetParent->pChilds;
+ pClonedEntry->pParent = pTargetParent; // Parent umsetzen
+ pDstList->Insert( pClonedEntry, nListPos ); // Einfuegen
+ SetListPositions( pDstList ); // Listenpositionen in Zielliste korrigieren
+
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+ Broadcast( LISTACTION_INSERTED_TREE, pClonedEntry );
+ ULONG nRetVal = pDstList->GetPos( pClonedEntry );
+ return nRetVal;
+}
+
+
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+void SvTreeList::Move( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
+{
+ SvListEntry* pParent;
+ ULONG nPos;
+
+ if ( !pDstEntry )
+ {
+ pParent = pRootItem;
+ nPos = 0UL;
+ }
+ else
+ {
+ pParent = pDstEntry->pParent;
+ nPos = pDstEntry->GetChildListPos();
+ nPos++; // UNTER (Bildschirm) pDstEntry einfuegen
+ }
+ Move( pSrcEntry, pParent, nPos );
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+void SvTreeList::Copy( SvListEntry* pSrcEntry, SvListEntry* pDstEntry )
+{
+ SvListEntry* pParent;
+ ULONG nPos;
+
+ if ( !pDstEntry )
+ {
+ pParent = pRootItem;
+ nPos = 0UL;
+ }
+ else
+ {
+ pParent = pDstEntry->pParent;
+ nPos = pDstEntry->GetChildListPos()+1;
+ }
+ Copy( pSrcEntry, pParent, nPos );
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+void SvTreeList::InsertTree( SvListEntry* pSrcEntry, SvListEntry* pDstEntry)
+{
+ SvListEntry* pParent;
+ ULONG nPos;
+
+ if ( !pDstEntry )
+ {
+ pParent = pRootItem;
+ nPos = 0UL;
+ }
+ else
+ {
+ pParent = pDstEntry->pParent;
+ nPos = pDstEntry->GetChildListPos()+1;
+ }
+ InsertTree( pSrcEntry, pParent, nPos );
+}
+
+
+void SvTreeList::InsertTree(SvListEntry* pSrcEntry,
+ SvListEntry* pTargetParent,ULONG nListPos)
+{
+ DBG_ASSERT(pSrcEntry,"InsertTree:Entry?")
+ if ( !pSrcEntry )
+ return;
+
+ if ( !pTargetParent )
+ pTargetParent = pRootItem;
+ if ( !pTargetParent->pChilds )
+ pTargetParent->pChilds = new SvTreeEntryList;
+
+ // Sortierung beruecksichtigen
+ GetInsertionPos( pSrcEntry, pTargetParent, nListPos );
+
+ bAbsPositionsValid = FALSE;
+
+ pSrcEntry->pParent = pTargetParent; // Parent umsetzen
+ SvTreeEntryList* pDstList = pTargetParent->pChilds;
+ pDstList->Insert( pSrcEntry, nListPos ); // einfuegen
+ SetListPositions(pDstList); // Listenpositionen in Zielliste korrigieren
+ nEntryCount += GetChildCount( pSrcEntry );
+ nEntryCount++; // der Parent ist ja auch neu
+
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+ Broadcast(LISTACTION_INSERTED_TREE, pSrcEntry );
+}
+
+SvListEntry* SvTreeList::CloneEntry( SvListEntry* pSource ) const
+{
+ if( aCloneLink.IsSet() )
+ return (SvListEntry*)aCloneLink.Call( pSource );
+ SvListEntry* pEntry = CreateEntry();
+ pSource->Clone( pEntry );
+ return pSource;
+}
+
+SvListEntry* SvTreeList::CreateEntry() const
+{
+ return new SvListEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::Clone( SvListEntry* pEntry, ULONG& nCloneCount ) const
+{
+ SvListEntry* pClonedEntry = CloneEntry( pEntry );
+ nCloneCount = 1;
+ SvTreeEntryList* pChilds = pEntry->pChilds;
+ if ( pChilds )
+ pClonedEntry->pChilds=CloneChilds(pChilds,pClonedEntry,nCloneCount);
+ return pClonedEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvTreeEntryList* SvTreeList::CloneChilds( SvTreeEntryList* pChilds,
+ SvListEntry* pNewParent,
+ ULONG& nCloneCount ) const
+{
+ DBG_ASSERT(pChilds->Count(),"Childs?")
+ SvTreeEntryList* pClonedChilds = new SvTreeEntryList;
+ SvListEntry* pChild = (SvListEntry*)pChilds->First();
+ while ( pChild )
+ {
+ SvListEntry* pNewChild = CloneEntry( pChild );
+ nCloneCount++;
+ pNewChild->pParent = pNewParent;
+ SvTreeEntryList* pSubChilds = pChild->pChilds;
+ if ( pSubChilds )
+ {
+ pSubChilds = CloneChilds( pSubChilds, pNewChild, nCloneCount );
+ pNewChild->pChilds = pSubChilds;
+ }
+
+ pClonedChilds->Insert( pNewChild, LIST_APPEND );
+ pChild = (SvListEntry*)pChilds->Next();
+ }
+ return pClonedChilds;
+}
+
+
+/*************************************************************************
+|*
+|* SvTreeList::GetChildCount
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+ULONG SvTreeList::GetChildCount( SvListEntry* pParent ) const
+{
+ if ( !pParent )
+ return GetEntryCount();
+
+ if ( !pParent || !pParent->pChilds)
+ return 0;
+ ULONG nCount = 0;
+ USHORT nRefDepth = GetDepth( pParent );
+ USHORT nActDepth = nRefDepth;
+ do
+ {
+ pParent = Next( pParent, &nActDepth );
+ nCount++;
+ } while( pParent && nRefDepth < nActDepth );
+ nCount--;
+ return nCount;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+ULONG SvTreeList::GetVisibleChildCount(const SvListView* pView, SvListEntry* pParent) const
+{
+ DBG_ASSERT(pView,"GetVisChildCount:No View")
+ if ( !pParent )
+ pParent = pRootItem;
+ if ( !pParent || !pView->IsExpanded(pParent) || !pParent->pChilds )
+ return 0;
+ ULONG nCount = 0;
+ USHORT nRefDepth = GetDepth( pParent );
+ USHORT nActDepth = nRefDepth;
+ do
+ {
+ pParent = NextVisible( pView, pParent, &nActDepth );
+ nCount++;
+ } while( pParent && nRefDepth < nActDepth );
+ nCount--;
+ return nCount;
+}
+
+ULONG SvTreeList::GetChildSelectionCount(const SvListView* pView,SvListEntry* pParent) const
+{
+ DBG_ASSERT(pView,"GetChildSelCount:No View")
+ if ( !pParent )
+ pParent = pRootItem;
+ if ( !pParent || !pParent->pChilds)
+ return 0;
+ ULONG nCount = 0;
+ USHORT nRefDepth = GetDepth( pParent );
+ USHORT nActDepth = nRefDepth;
+ do
+ {
+ pParent = Next( pParent, &nActDepth );
+ if( pParent && pView->IsSelected( pParent ) && nRefDepth < nActDepth)
+ nCount++;
+ } while( pParent && nRefDepth < nActDepth );
+// nCount--;
+ return nCount;
+}
+
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::First() const
+{
+ if ( nEntryCount )
+ return (SvListEntry*)(pRootItem->pChilds->GetObject(0));
+ else
+ return 0;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::Next
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+SvListEntry* SvTreeList::Next( SvListEntry* pActEntry, USHORT* pDepth ) const
+{
+ DBG_ASSERT(pActEntry,"Entry?")
+ USHORT nDepth = 0;
+ int bWithDepth = FALSE;
+ if ( pDepth )
+ {
+ nDepth = *pDepth;
+ bWithDepth = TRUE;
+ }
+
+ SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
+ ULONG nActualPos = pActEntry->GetChildListPos();
+
+ if ( pActEntry->pChilds /* && pActEntry->pChilds->Count() */ )
+ {
+ nDepth++;
+ pActEntry = (SvListEntry*)(pActEntry->pChilds->GetObject(0));
+ if ( bWithDepth )
+ *pDepth = nDepth;
+ return pActEntry;
+ }
+
+ if ( pActualList->Count() > ( nActualPos + 1 ) )
+ {
+ pActEntry = (SvListEntry*)(pActualList->GetObject( nActualPos + 1 ));
+ if ( bWithDepth )
+ *pDepth = nDepth;
+ return pActEntry;
+ }
+
+ SvListEntry* pParent = pActEntry->pParent;
+ nDepth--;
+ while( pParent != pRootItem && pParent != 0 )
+ {
+ DBG_ASSERT(pParent!=0,"TreeData corrupt!");
+ pActualList = pParent->pParent->pChilds;
+ DBG_ASSERT(pActualList,"TreeData corrupt!")
+ nActualPos = pParent->GetChildListPos();
+ if ( pActualList->Count() > ( nActualPos + 1 ) )
+ {
+ pActEntry = (SvListEntry*)(pActualList->GetObject( nActualPos + 1 ));
+ if ( bWithDepth )
+ *pDepth = nDepth;
+ return pActEntry;
+ }
+ pParent = pParent->pParent;
+ nDepth--;
+ }
+ return 0;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::Prev
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+SvListEntry* SvTreeList::Prev( SvListEntry* pActEntry, USHORT* pDepth ) const
+{
+ DBG_ASSERT(pActEntry!=0,"Entry?")
+
+ USHORT nDepth = 0;
+ int bWithDepth = FALSE;
+ if ( pDepth )
+ {
+ nDepth = *pDepth;
+ bWithDepth = TRUE;
+ }
+
+ SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
+ ULONG nActualPos = pActEntry->GetChildListPos();
+
+ if ( nActualPos > 0 )
+ {
+ pActEntry = (SvListEntry*)(pActualList->GetObject( nActualPos - 1 ));
+ while( pActEntry->pChilds /* && pActEntry->pChilds->Count() */ )
+ {
+ pActualList = pActEntry->pChilds;
+ nDepth++;
+ pActEntry = (SvListEntry*)(pActualList->Last());
+ }
+ if ( bWithDepth )
+ *pDepth = nDepth;
+ return pActEntry;
+ }
+ if ( pActEntry->pParent == pRootItem )
+ return 0;
+
+ pActEntry = pActEntry->pParent;
+
+ if ( pActEntry )
+ {
+ nDepth--;
+ if ( bWithDepth )
+ *pDepth = nDepth;
+ return pActEntry;
+ }
+ return 0;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::Last( USHORT* /* nDepth */ ) const
+{
+ SvTreeEntryList* pActList = pRootItem->pChilds;
+// if ( pActList->Count() == 0 )
+// return 0;
+ SvListEntry* pEntry = 0;
+ while( pActList )
+ {
+ pEntry = (SvListEntry*)(pActList->Last());
+ pActList = pEntry->pChilds;
+// if ( pActList->Count() == 0 )
+// pActList = 0;
+ }
+ return pEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+ULONG SvTreeList::GetVisiblePos( const SvListView* pView, SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pView&&pEntry,"View/Entry?")
+
+ if ( !pView->bVisPositionsValid )
+ {
+ // damit GetVisibleCount die Positionen aktualisiert
+ ((SvListView*)pView)->nVisibleCount = 0;
+ GetVisibleCount( pView );
+ }
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ return pViewData->nVisPos;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+ULONG SvTreeList::GetVisibleCount( const SvListView* pView ) const
+{
+ DBG_ASSERT(pView,"GetVisCount:No View")
+ if( !pView->HasViewData() )
+ return 0;
+ if ( pView->nVisibleCount )
+ return pView->nVisibleCount;
+
+ ULONG nPos = 0;
+ SvListEntry* pEntry = First(); // erster Eintrag immer sichtbar
+ while ( pEntry )
+ {
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ pViewData->nVisPos = nPos;
+ nPos++;
+ pEntry = NextVisible( pView, pEntry );
+ }
+#ifdef DBG_UTIL
+ if( nPos > 10000000 )
+ {
+ DBG_ERROR("nVisibleCount bad");
+ }
+#endif
+ ((SvListView*)pView)->nVisibleCount = nPos;
+ ((SvListView*)pView)->bVisPositionsValid = TRUE;
+ return nPos;
+}
+
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+// Funktion geht aus Geschwindigkeitsgruenden davon aus,
+// das der uebergebene Eintrag bereits sichtbar ist
+
+SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pActEntry,USHORT* pActDepth) const
+{
+ DBG_ASSERT(pView,"NextVisible:No View")
+ if ( !pActEntry )
+ return 0;
+
+ USHORT nDepth = 0;
+ int bWithDepth = FALSE;
+ if ( pActDepth )
+ {
+ nDepth = *pActDepth;
+ bWithDepth = TRUE;
+ }
+
+ SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
+ ULONG nActualPos = pActEntry->GetChildListPos();
+
+ if ( pView->IsExpanded(pActEntry) )
+ {
+ DBG_ASSERT(pActEntry->pChilds,"Childs?")
+ nDepth++;
+ pActEntry = (SvListEntry*)(pActEntry->pChilds->GetObject(0));
+ if ( bWithDepth )
+ *pActDepth = nDepth;
+ return pActEntry;
+ }
+
+ nActualPos++;
+ if ( pActualList->Count() > nActualPos )
+ {
+ pActEntry = (SvListEntry*)(pActualList->GetObject( nActualPos ));
+ if ( bWithDepth )
+ *pActDepth = nDepth;
+ return pActEntry;
+ }
+
+ SvListEntry* pParent = pActEntry->pParent;
+ nDepth--;
+ while( pParent != pRootItem )
+ {
+ pActualList = pParent->pParent->pChilds;
+ nActualPos = pParent->GetChildListPos();
+ nActualPos++;
+ if ( pActualList->Count() > nActualPos )
+ {
+ pActEntry = (SvListEntry*)(pActualList->GetObject( nActualPos ));
+ if ( bWithDepth )
+ *pActDepth = nDepth;
+ return pActEntry;
+ }
+ pParent = pParent->pParent;
+ nDepth--;
+ }
+ return 0;
+}
+
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+// Funktion geht aus Geschwindigkeitsgruenden davon aus,
+// das der uebergebene Eintrag bereits sichtbar ist
+
+SvListEntry* SvTreeList::PrevVisible(const SvListView* pView, SvListEntry* pActEntry, USHORT* pActDepth) const
+{
+ DBG_ASSERT(pView&&pActEntry,"PrevVis:View/Entry?")
+
+ USHORT nDepth = 0;
+ int bWithDepth = FALSE;
+ if ( pActDepth )
+ {
+ nDepth = *pActDepth;
+ bWithDepth = TRUE;
+ }
+
+ SvTreeEntryList* pActualList = pActEntry->pParent->pChilds;
+ ULONG nActualPos = pActEntry->GetChildListPos();
+
+ if ( nActualPos > 0 )
+ {
+ pActEntry = (SvListEntry*)(pActualList->GetObject( nActualPos - 1 ));
+ while( pView->IsExpanded(pActEntry) )
+ {
+ pActualList = pActEntry->pChilds;
+ nDepth++;
+ pActEntry = (SvListEntry*)(pActualList->Last());
+ }
+ if ( bWithDepth )
+ *pActDepth = nDepth;
+ return pActEntry;
+ }
+
+ if ( pActEntry->pParent == pRootItem )
+ return 0;
+
+ pActEntry = pActEntry->pParent;
+ if ( pActEntry )
+ {
+ nDepth--;
+ if ( bWithDepth )
+ *pActDepth = nDepth;
+ return pActEntry;
+ }
+ return 0;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::LastVisible( const SvListView* pView, USHORT* pDepth) const
+{
+ DBG_ASSERT(pView,"LastVis:No View")
+ SvListEntry* pEntry = Last();
+ while( pEntry && !IsEntryVisible( pView, pEntry ) )
+ pEntry = PrevVisible( pView, pEntry );
+ if ( pEntry && pDepth )
+ *pDepth = GetDepth( pEntry );
+ return pEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::NextVisible(const SvListView* pView,SvListEntry* pEntry,USHORT& nDelta) const
+{
+ DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"NextVis:Wrong Prms/!Vis")
+
+ ULONG nVisPos = GetVisiblePos( pView, pEntry );
+ // nDelta Eintraege vorhanden ?
+ // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=5 nDelta=7
+ // nNewDelta = 10-nVisPos-1 == 4
+ if ( nVisPos+nDelta >= pView->nVisibleCount )
+ {
+ nDelta = (USHORT)(pView->nVisibleCount-nVisPos);
+ nDelta--;
+ }
+ USHORT nDeltaTmp = nDelta;
+ while( nDeltaTmp )
+ {
+ pEntry = NextVisible( pView, pEntry );
+ nDeltaTmp--;
+ DBG_ASSERT(pEntry,"Entry?")
+ }
+ return pEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::PrevVisible( const SvListView* pView, SvListEntry* pEntry, USHORT& nDelta ) const
+{
+ DBG_ASSERT(pView&&pEntry&&IsEntryVisible(pView,pEntry),"PrevVis:Parms/!Vis")
+
+ ULONG nVisPos = GetVisiblePos( pView, pEntry );
+ // nDelta Eintraege vorhanden ?
+ // Beispiel: 0,1,2,3,4,5,6,7,8,9 nVisPos=8 nDelta=20
+ // nNewDelta = nNewVisPos
+ if ( nDelta > nVisPos )
+ nDelta = (USHORT)nVisPos;
+ USHORT nDeltaTmp = nDelta;
+ while( nDeltaTmp )
+ {
+ pEntry = PrevVisible( pView, pEntry );
+ nDeltaTmp--;
+ DBG_ASSERT(pEntry,"Entry?")
+ }
+ return pEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::FirstSelected( const SvListView* pView) const
+{
+ DBG_ASSERT(pView,"FirstSel:No View")
+ if( !pView )
+ return 0;
+ SvListEntry* pActSelEntry = First();
+ while( pActSelEntry && !pView->IsSelected(pActSelEntry) )
+ pActSelEntry = NextVisible( pView, pActSelEntry );
+ return pActSelEntry;
+}
+
+
+SvListEntry* SvTreeList::FirstChild( SvListEntry* pParent ) const
+{
+ if ( !pParent )
+ pParent = pRootItem;
+ SvListEntry* pResult;
+ if ( pParent->pChilds )
+ pResult = (SvListEntry*)(pParent->pChilds->GetObject( 0 ));
+ else
+ pResult = 0;
+ return pResult;
+}
+
+SvListEntry* SvTreeList::NextSibling( SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pEntry,"Entry?")
+ if( !pEntry )
+ return 0;
+ SvTreeEntryList* pList = pEntry->pParent->pChilds;
+// ULONG nPos = pList->GetPos( pEntry );
+ ULONG nPos = pEntry->GetChildListPos();
+ nPos++;
+ pEntry = (SvListEntry*)(pList->GetObject( nPos ));
+ return pEntry;
+}
+
+SvListEntry* SvTreeList::PrevSibling( SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pEntry,"Entry?")
+ if( !pEntry )
+ return 0;
+
+ SvTreeEntryList* pList = pEntry->pParent->pChilds;
+ // ULONG nPos = pList->GetPos( pEntry );
+ ULONG nPos = pEntry->GetChildListPos();
+ if ( nPos == 0 )
+ return 0;
+ nPos--;
+ pEntry = (SvListEntry*)(pList->GetObject( nPos ));
+ return pEntry;
+}
+
+
+SvListEntry* SvTreeList::LastSibling( SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pEntry,"LastSibling:Entry?");
+ if( !pEntry )
+ return 0;
+ SvListEntry* pSib = 0;
+ SvTreeEntryList* pSibs = pEntry->pParent->pChilds;
+ if ( pSibs )
+ pSib = (SvListEntry*)(pSibs->Last());
+ return pSib;
+}
+
+
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::NextSelected( const SvListView* pView, SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pView&&pEntry,"NextSel:View/Entry?")
+ pEntry = Next( pEntry );
+ while( pEntry && !pView->IsSelected(pEntry) )
+ pEntry = Next( pEntry );
+ return pEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::PrevSelected( const SvListView* pView, SvListEntry* pEntry) const
+{
+ DBG_ASSERT(pView&&pEntry,"PrevSel:View/Entry?")
+ pEntry = Prev( pEntry );
+ while( pEntry && !pView->IsSelected(pEntry) )
+ pEntry = Prev( pEntry );
+
+ return pEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+SvListEntry* SvTreeList::LastSelected( const SvListView* pView ) const
+{
+ DBG_ASSERT(pView,"LastSel:No View")
+ SvListEntry* pEntry = Last();
+ while( pEntry && !pView->IsSelected(pEntry) )
+ pEntry = Prev( pEntry );
+ return pEntry;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::Insert
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+ULONG SvTreeList::Insert( SvListEntry* pEntry,SvListEntry* pParent,ULONG nPos )
+{
+ DBG_ASSERT( pEntry,"Entry?")
+
+ if ( !pParent )
+ pParent = pRootItem;
+
+
+ SvTreeEntryList* pList = pParent->pChilds;
+ if ( !pList )
+ {
+ // Parent bekommt zum erstenmal ein Kind
+ pList = new SvTreeEntryList;
+ pParent->pChilds = pList;
+ }
+
+ // Sortierung beruecksichtigen
+ GetInsertionPos( pEntry, pParent, nPos );
+
+ bAbsPositionsValid = FALSE;
+ pEntry->pParent = pParent;
+
+ pList->Insert( pEntry, nPos );
+ nEntryCount++;
+ if( nPos != LIST_APPEND && (nPos != (pList->Count()-1)) )
+ SetListPositions( pList );
+ else
+ pEntry->nListPos = pList->Count()-1;
+
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+ Broadcast( LISTACTION_INSERTED, pEntry );
+ return nPos; // pEntry->nListPos;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+ULONG SvTreeList::GetAbsPos( SvListEntry* pEntry) const
+{
+ if ( !bAbsPositionsValid )
+ ((SvTreeList*)this)->SetAbsolutePositions();
+ return pEntry->nAbsPos;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+void SvTreeList::SetAbsolutePositions()
+{
+ ULONG nPos = 0;
+ SvListEntry* pEntry = First();
+ while ( pEntry )
+ {
+ pEntry->nAbsPos = nPos;
+ nPos++;
+ pEntry = Next( pEntry );
+ }
+ bAbsPositionsValid = TRUE;
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+}
+
+
+/*************************************************************************
+|*
+|* SvTreeList::Expand
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+void SvTreeList::Expand( SvListView* pView, SvListEntry* pEntry )
+{
+ DBG_ASSERT(pEntry&&pView,"Expand:View/Entry?")
+ if ( pView->IsExpanded(pEntry) )
+ return;
+
+ DBG_ASSERT(pEntry->pChilds,"Expand:No Childs!")
+
+ SvViewData* pViewData = pView->GetViewData(pEntry);
+ pViewData->nFlags |= SVLISTENTRYFLAG_EXPANDED;
+ SvListEntry* pParent = pEntry->pParent;
+ // wenn Parent sichtbar dann Statusdaten invalidieren
+ if ( pView->IsExpanded( pParent ) )
+ {
+ pView->bVisPositionsValid = FALSE;
+ pView->nVisibleCount = 0;
+ }
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::Collapse
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+void SvTreeList::Collapse( SvListView* pView, SvListEntry* pEntry )
+{
+ DBG_ASSERT(pView&&pEntry,"Collapse:View/Entry?")
+ if ( !pView->IsExpanded(pEntry) )
+ return;
+
+ DBG_ASSERT(pEntry->pChilds,"Collapse:No Childs!")
+
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ pViewData->nFlags &=(~SVLISTENTRYFLAG_EXPANDED);
+
+ SvListEntry* pParent = pEntry->pParent;
+ if ( pView->IsExpanded(pParent) )
+ {
+ pView->nVisibleCount = 0;
+ pView->bVisPositionsValid = FALSE;
+ }
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+}
+
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+BOOL SvTreeList::Select( SvListView* pView, SvListEntry* pEntry, BOOL bSelect )
+{
+ DBG_ASSERT(pView&&pEntry,"Select:View/Entry?")
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ if ( bSelect )
+ {
+ if ( pViewData->IsSelected() )
+ return FALSE;
+ else
+ {
+ pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED;
+ pView->nSelectionCount++;
+ }
+ }
+ else
+ {
+ if ( !pViewData->IsSelected() )
+ return FALSE;
+ else
+ {
+ pViewData->nFlags &= ~( SVLISTENTRYFLAG_SELECTED );
+ pView->nSelectionCount--;
+ }
+ }
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+ return TRUE;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::Remove
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 24.06.97
+|*
+*************************************************************************/
+BOOL SvTreeList::Remove( SvListEntry* pEntry )
+{
+ DBG_ASSERT(pEntry,"Cannot remove root, use clear")
+
+ if( !pEntry->pParent )
+ {
+ DBG_ERROR("Removing entry not in model!");
+ // unter gewissen Umstaenden (welche?) loescht der
+ // Explorer aus der View Eintraege, die er nicht in die View
+ // eingefuegt hat. Da sich der Kunde fuer ein platzendes
+ // Office nichts kaufen kann, fange ich diesen Fall ab.
+ return FALSE;
+ }
+
+ Broadcast( LISTACTION_REMOVING, pEntry );
+ ULONG nRemoved = 1 + GetChildCount(pEntry);
+ bAbsPositionsValid = FALSE;
+
+ SvListEntry* pParent = pEntry->pParent;
+ SvTreeEntryList* pList = pParent->pChilds;
+ DBG_ASSERT(pList,"Remove:No Childlist")
+ BOOL bLastEntry = FALSE;
+
+ if ( pEntry->HasChildListPos() )
+ {
+ ULONG nListPos = pEntry->GetChildListPos();
+ bLastEntry = (nListPos == (pList->Count()-1) ) ? TRUE : FALSE;
+ pList->Remove( nListPos );
+ }
+ else
+ {
+ pList->Remove( (void*) pEntry );
+ }
+
+ delete pEntry; // loescht auch alle Childs
+
+ if ( pList->Count() == 0 )
+ {
+ pParent->pChilds = 0;
+ delete pList;
+ }
+ else
+ {
+ if( !bLastEntry )
+ SetListPositions( pList );
+ }
+ nEntryCount -= nRemoved;
+
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+ Broadcast( LISTACTION_REMOVED, pEntry );
+ return TRUE;
+}
+
+/*************************************************************************
+|*
+|* SvTreeList::
+|*
+|* Beschreibung
+|* Ersterstellung 17.08.94
+|* Letzte Aenderung 17.08.94
+|*
+*************************************************************************/
+
+ULONG SvTreeList::SelectChilds(SvListView* pView, SvListEntry* pParent,BOOL bSelect )
+{
+ DBG_ASSERT(pView&&pParent,"SelChilds:View/Parent?")
+ if ( !pParent->pChilds )
+ return 0;
+ if ( pParent->pChilds->Count() == 0 )
+ return 0;
+
+ USHORT nRefDepth = GetDepth( pParent );
+ USHORT nDepth = nRefDepth;
+ ULONG nCount = 0;
+ pParent = Next( pParent );
+ do
+ {
+ if ( Select( pView, pParent, bSelect ) )
+ nCount++; // nur die tatsaechlichen Selektierungen zaehlen
+ pParent = Next( pParent, &nDepth );
+ }
+ while( pParent && nDepth > nRefDepth );
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+ return nCount;
+}
+
+void SvTreeList::SelectAll( SvListView* pView, BOOL bSelect )
+{
+ DBG_ASSERT(pView,"SelectAll:NoView")
+ SvListEntry* pEntry = First();
+ while ( pEntry )
+ {
+ SvViewData* pViewData = pView->GetViewData( pEntry );
+ if ( bSelect )
+ pViewData->nFlags |= SVLISTENTRYFLAG_SELECTED;
+ else
+ pViewData->nFlags &= (~SVLISTENTRYFLAG_SELECTED);
+
+ pEntry = Next( pEntry );
+ }
+ if ( bSelect )
+ pView->nSelectionCount = nEntryCount;
+ else
+ pView->nSelectionCount = 0;
+#ifdef CHECK_INTEGRITY
+CheckIntegrity();
+#endif
+}
+
+
+SvListEntry* SvTreeList::GetEntryAtAbsPos( ULONG nAbsPos ) const
+{
+ SvListEntry* pEntry = First();
+ while ( nAbsPos && pEntry )
+ {
+ pEntry = Next( pEntry );
+ nAbsPos--;
+ }
+ return pEntry;
+}
+
+SvListEntry* SvTreeList::GetEntryAtVisPos( const SvListView* pView, ULONG nVisPos ) const
+{
+ DBG_ASSERT(pView,"GetEntryAtVisPos:No View")
+ SvListEntry* pEntry = First();
+ while ( nVisPos && pEntry )
+ {
+ pEntry = NextVisible( pView, pEntry );
+ nVisPos--;
+ }
+ return pEntry;
+}
+
+void SvTreeList::SetListPositions( SvTreeEntryList* pList )
+{
+ if( pList->Count() )
+ {
+ SvListEntry* pEntry = (SvListEntry*)(pList->GetObject(0));
+ if( pEntry->pParent )
+ pEntry->pParent->InvalidateChildrensListPositions();
+ }
+ /*
+ ULONG nListPos = 0;
+ SvListEntry* pEntry = (SvListEntry*)(pList->First());
+ while( pEntry )
+ {
+ pEntry->nListPos = nListPos;
+ nListPos++;
+ pEntry = (SvListEntry*)(pList->Next());
+ }
+ */
+}
+
+
+void SvTreeList::InvalidateEntry( SvListEntry* pEntry )
+{
+ Broadcast( LISTACTION_INVALIDATE_ENTRY, pEntry );
+}
+
+BOOL SvTreeList::IsInChildList( SvListEntry* pParent, SvListEntry* pChild) const
+{
+ if ( !pParent )
+ pParent = pRootItem;
+ BOOL bIsChild = FALSE;
+ if ( pParent->pChilds )
+ bIsChild = (BOOL)(pParent->pChilds->GetPos(pChild) != LIST_ENTRY_NOTFOUND);
+ return bIsChild;
+}
+
+
+void lcl_CheckList( SvTreeEntryList* pList )
+{
+ SvListEntry* pEntry = (SvListEntry*)(pList->First());
+ ULONG nPos = 0;
+ while ( pEntry )
+ {
+ DBG_ASSERT(pEntry->GetChildListPos()==nPos,"Wrong ListPos")
+ pEntry = (SvListEntry*)(pList->Next());
+ nPos++;
+ }
+}
+
+void SvTreeList::CheckIntegrity() const
+{
+ ULONG nMyEntryCount = 0;
+ if ( pRootItem->pChilds )
+ {
+ lcl_CheckList( pRootItem->pChilds );
+ SvListEntry* pEntry = First();
+ while( pEntry )
+ {
+ nMyEntryCount++;
+ if ( pEntry->pChilds )
+ lcl_CheckList( pEntry->pChilds );
+ pEntry = Next( pEntry );
+ }
+ }
+ DBG_ASSERT(nMyEntryCount==GetEntryCount(),"Entry count invalid")
+}
+
+SvListEntry* SvTreeList::GetRootLevelParent( SvListEntry* pEntry ) const
+{
+ DBG_ASSERT(pEntry,"GetRootLevelParent:No Entry")
+ SvListEntry* pCurParent = 0;
+ if ( pEntry )
+ {
+ pCurParent = pEntry->pParent;
+ if ( pCurParent == pRootItem )
+ return pEntry; // ist sein eigener Parent
+ while( pCurParent->pParent != pRootItem )
+ pCurParent = pCurParent->pParent;
+ }
+ return pCurParent;
+}
+
+
+
+
+//*************************************************************************
+//*************************************************************************
+//*************************************************************************
+//*************************************************************************
+//*************************************************************************
+//*************************************************************************
+//*************************************************************************
+//*************************************************************************
+
+DBG_NAME(SvListView);
+
+SvListView::SvListView( SvTreeList* pModell )
+{
+ DBG_CTOR(SvListView,0);
+ pModel = 0;
+ nSelectionCount = 0;
+ nVisibleCount = 0;
+ bVisPositionsValid = FALSE;
+ SetModel( pModell );
+}
+
+SvListView::SvListView()
+{
+ DBG_CTOR(SvListView,0);
+ pModel = 0;
+ nSelectionCount = 0;
+ nVisibleCount = 0;
+ bVisPositionsValid = FALSE;
+}
+
+
+SvListView::~SvListView()
+{
+ DBG_DTOR(SvListView,0);
+ ClearTable();
+}
+
+void SvListView::InitTable()
+{
+ DBG_CHKTHIS(SvListView,0);
+ DBG_ASSERT(pModel,"InitTable:No Model")
+ DBG_ASSERT(!nSelectionCount&&!nVisibleCount&&!bVisPositionsValid,"InitTable: Not cleared!");
+
+ if( aDataTable.Count() )
+ {
+ DBG_ASSERT(aDataTable.Count()==1,"InitTable: TableCount != 1");
+ // die im Clear fuer die Root allozierten View-Daten loeschen
+ // Achtung: Das zu dem RootEntry (und damit auch der Entry)
+ // gehoerende Model kann bereits geloescht sein!
+ SvViewData* pViewData = (SvViewData*)aDataTable.GetObject( 0 );
+ delete pViewData;
+ aDataTable.Clear();
+ }
+
+ SvListEntry* pEntry;
+ SvViewData* pViewData;
+
+ // RootEntry einfuegen
+ pEntry = pModel->pRootItem;
+ pViewData = new SvViewData;
+ pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED;
+ aDataTable.Insert( (ULONG)pEntry, pViewData );
+ // Jetzt alle anderen Entries
+ pEntry = pModel->First();
+ while( pEntry )
+ {
+ pViewData = CreateViewData( pEntry );
+ DBG_ASSERT(pViewData,"InitTable:No ViewData")
+ InitViewData( pViewData, pEntry );
+ aDataTable.Insert( (ULONG)pEntry, pViewData );
+ pEntry = pModel->Next( pEntry );
+ }
+}
+
+SvViewData* SvListView::CreateViewData( SvListEntry* )
+{
+ DBG_CHKTHIS(SvListView,0);
+ return new SvViewData;
+}
+
+void SvListView::ClearTable()
+{
+ DBG_CHKTHIS(SvListView,0);
+ SvViewData* pViewData = (SvViewData*)aDataTable.First();
+ while( pViewData )
+ {
+ delete pViewData;
+ pViewData = (SvViewData*)aDataTable.Next();
+ }
+ aDataTable.Clear();
+}
+
+void SvListView::Clear()
+{
+ ClearTable();
+ nSelectionCount = 0;
+ nVisibleCount = 0;
+ bVisPositionsValid = FALSE;
+ if( pModel )
+ {
+ // RootEntry einfuegen
+ SvListEntry* pEntry = pModel->pRootItem;
+ SvViewData* pViewData = new SvViewData;
+ pViewData->nFlags = SVLISTENTRYFLAG_EXPANDED;
+ aDataTable.Insert( (ULONG)pEntry, pViewData );
+ }
+}
+
+void SvListView::SetModel( SvTreeList* pNewModel )
+{
+ DBG_CHKTHIS(SvListView,0);
+ BOOL bBroadcastCleared = FALSE;
+ if ( pModel )
+ {
+ pModel->RemoveView( this );
+ bBroadcastCleared = TRUE;
+ ModelNotification( LISTACTION_CLEARING,0,0,0 );
+ if ( pModel->GetRefCount() == 0 )
+ delete pModel;
+ }
+ pModel = pNewModel;
+ InitTable();
+ pNewModel->InsertView( this );
+ if( bBroadcastCleared )
+ ModelNotification( LISTACTION_CLEARED,0,0,0 );
+}
+
+
+void SvListView::ModelHasCleared()
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+void SvListView::ModelHasInserted( SvListEntry* )
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+void SvListView::ModelHasInsertedTree( SvListEntry* )
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+void SvListView::ModelIsMoving( SvListEntry* /* pSource */ ,
+ SvListEntry* /* pTargetParent */ , ULONG /* nPos */ )
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+
+void SvListView::ModelHasMoved( SvListEntry* )
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+void SvListView::ModelIsRemoving( SvListEntry* )
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+void SvListView::ModelHasRemoved( SvListEntry* )
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+void SvListView::ModelHasEntryInvalidated( SvListEntry*)
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+void SvListView::ActionMoving( SvListEntry* pEntry,SvListEntry* pTargetPrnt,ULONG nChildPos)
+{
+ DBG_CHKTHIS(SvListView,0);
+ SvListEntry* pParent = pEntry->pParent;
+ DBG_ASSERT(pParent,"Model not consistent")
+ if( pParent != pModel->pRootItem && pParent->pChilds->Count() == 1 )
+ {
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pParent );
+ pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED);
+ }
+ // vorlaeufig
+ nVisibleCount = 0;
+ bVisPositionsValid = FALSE;
+}
+
+void SvListView::ActionMoved( SvListEntry* /* pEntry */ ,
+ SvListEntry* /* pTargetPrnt */ ,
+ ULONG /* nChildPos */ )
+{
+ DBG_CHKTHIS(SvListView,0);
+ nVisibleCount = 0;
+ bVisPositionsValid = FALSE;
+}
+
+void SvListView::ActionInserted( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvListView,0);
+ DBG_ASSERT(pEntry,"Insert:No Entry")
+ SvViewData* pData = CreateViewData( pEntry );
+ InitViewData( pData, pEntry );
+ BOOL bSuccess = aDataTable.Insert( (ULONG)pEntry, pData );
+ DBG_ASSERT(bSuccess,"Entry already in View")
+ if ( nVisibleCount && pModel->IsEntryVisible( this, pEntry ))
+ {
+ nVisibleCount = 0;
+ bVisPositionsValid = FALSE;
+ }
+}
+
+void SvListView::ActionInsertedTree( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvListView,0);
+ if ( pModel->IsEntryVisible( this, pEntry ))
+ {
+ nVisibleCount = 0;
+ bVisPositionsValid = FALSE;
+ }
+ // ueber Entry und seine Childs iterieren
+ SvListEntry* pCurEntry = pEntry;
+ USHORT nRefDepth = pModel->GetDepth( pCurEntry );
+ while( pCurEntry )
+ {
+ DBG_ASSERT(aDataTable.Get((ULONG)pCurEntry)==0,"Entry already in Table")
+ SvViewData* pViewData = CreateViewData( pCurEntry );
+ DBG_ASSERT(pViewData,"No ViewData")
+ InitViewData( pViewData, pEntry );
+ aDataTable.Insert( (ULONG)pCurEntry, pViewData );
+ pCurEntry = pModel->Next( pCurEntry );
+ if ( pCurEntry && pModel->GetDepth(pCurEntry) <= nRefDepth)
+ pCurEntry = 0;
+ }
+}
+
+void SvListView::RemoveViewData( SvListEntry* pParent )
+{
+ SvTreeEntryList* pChilds = pParent->pChilds;
+ if( pChilds )
+ {
+ SvListEntry* pCur = (SvListEntry*)pChilds->First();
+ while( pCur )
+ {
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get((ULONG)pCur);
+ delete pViewData;
+ aDataTable.Remove( (ULONG)pCur );
+ if( pCur->HasChilds())
+ RemoveViewData( pCur );
+ pCur = (SvListEntry*)pChilds->Next();
+ }
+ }
+}
+
+
+
+void SvListView::ActionRemoving( SvListEntry* pEntry )
+{
+ DBG_CHKTHIS(SvListView,0);
+ DBG_ASSERT(pEntry,"Remove:No Entry")
+
+ SvViewData* pViewData = (SvViewData*)aDataTable.Get( (ULONG)pEntry );
+ ULONG nSelRemoved = 0;
+ if ( pViewData->IsSelected() )
+ nSelRemoved = 1 + pModel->GetChildSelectionCount( this, pEntry );
+ nSelectionCount -= nSelRemoved;
+ ULONG nVisibleRemoved = 0;
+ if ( pModel->IsEntryVisible( this, pEntry ) )
+ nVisibleRemoved = 1 + pModel->GetVisibleChildCount( this, pEntry );
+ if( nVisibleCount )
+ {
+#ifdef DBG_UTIL
+ if( nVisibleCount < nVisibleRemoved )
+ {
+ DBG_ERROR("nVisibleRemoved bad");
+ }
+#endif
+ nVisibleCount -= nVisibleRemoved;
+ }
+ bVisPositionsValid = FALSE;
+
+ pViewData = (SvViewData*)aDataTable.Get((ULONG)pEntry);
+ delete pViewData;
+ aDataTable.Remove( (ULONG)pEntry );
+ RemoveViewData( pEntry );
+
+ SvListEntry* pCurEntry = pEntry->pParent;
+ if ( pCurEntry && pCurEntry != pModel->pRootItem &&
+ pCurEntry->pChilds->Count() == 1 )
+ {
+ pViewData = (SvViewData*)aDataTable.Get((ULONG)pCurEntry);
+ pViewData->nFlags &= (~SVLISTENTRYFLAG_EXPANDED);
+ }
+}
+
+void SvListView::ActionRemoved( SvListEntry* /* pEntry */ )
+{
+ DBG_CHKTHIS(SvListView,0);
+}
+
+void SvListView::ActionClear()
+{
+ DBG_CHKTHIS(SvListView,0);
+ Clear();
+}
+
+void SvListView::ModelNotification( USHORT nActionId, SvListEntry* pEntry1,
+ SvListEntry* pEntry2, ULONG nPos )
+{
+ DBG_CHKTHIS(SvListView,0);
+ switch( nActionId )
+ {
+ case LISTACTION_INSERTED:
+ ActionInserted( pEntry1 );
+ ModelHasInserted( pEntry1 );
+ break;
+ case LISTACTION_INSERTED_TREE:
+ ActionInsertedTree( pEntry1 );
+ ModelHasInsertedTree( pEntry1 );
+ break;
+ case LISTACTION_REMOVING:
+ ModelIsRemoving( pEntry1 );
+ ActionRemoving( pEntry1 );
+ break;
+ case LISTACTION_REMOVED:
+ ActionRemoved( pEntry1 );
+ ModelHasRemoved( pEntry1 );
+ break;
+ case LISTACTION_MOVING:
+ ModelIsMoving( pEntry1, pEntry2, nPos );
+ ActionMoving( pEntry1, pEntry2, nPos );
+ break;
+ case LISTACTION_MOVED:
+ ActionMoved( pEntry1, pEntry2, nPos );
+ ModelHasMoved( pEntry1 );
+ break;
+ case LISTACTION_CLEARING:
+ ActionClear();
+ ModelHasCleared(); //sic! wg. Kompatibilitaet!
+ break;
+ case LISTACTION_CLEARED:
+ break;
+ case LISTACTION_INVALIDATE_ENTRY:
+ // keine Action fuer die Basisklasse
+ ModelHasEntryInvalidated( pEntry1 );
+ break;
+ case LISTACTION_RESORTED:
+ bVisPositionsValid = FALSE;
+ break;
+ case LISTACTION_RESORTING:
+ break;
+ default:
+ DBG_ERROR("unknown ActionId");
+ }
+}
+
+void SvListView::InitViewData( SvViewData*, SvListEntry* )
+{
+}
+
+StringCompare SvTreeList::Compare( SvListEntry* pLeft, SvListEntry* pRight) const
+{
+ if( aCompareLink.IsSet())
+ {
+ SvSortData aSortData;
+ aSortData.pLeft = pLeft;
+ aSortData.pRight = pRight;
+ return (StringCompare)aCompareLink.Call( &aSortData );
+ }
+ return COMPARE_EQUAL;
+}
+
+void SvTreeList::Resort()
+{
+ Broadcast( LISTACTION_RESORTING );
+ bAbsPositionsValid = FALSE;
+ ResortChilds( pRootItem );
+ Broadcast( LISTACTION_RESORTED );
+}
+
+void SvTreeList::ResortChilds( SvListEntry* pParent )
+{
+ DBG_ASSERT(pParent,"Parent not set");
+ List* pChildList = pParent->pChilds;
+ if( !pChildList )
+ return;
+ List aList( *pChildList );
+ pChildList->Clear();
+
+ ULONG nCount = aList.Count();
+ for( ULONG nCur = 0; nCur < nCount; nCur++ )
+ {
+ SvListEntry* pCurEntry = (SvListEntry*)aList.GetObject( nCur );
+ ULONG nListPos = LIST_APPEND;
+ GetInsertionPos( pCurEntry, pParent, nListPos );
+ pChildList->Insert( pCurEntry, nListPos );
+ if( pCurEntry->pChilds )
+ ResortChilds( pCurEntry );
+ }
+ SetListPositions( (SvTreeEntryList*)pChildList );
+}
+
+void SvTreeList::GetInsertionPos( SvListEntry* pEntry, SvListEntry* pParent,
+ ULONG& rPos )
+{
+ DBG_ASSERT(pEntry,"No Entry")
+
+ if( eSortMode == SortNone )
+ return;
+
+ rPos = LIST_APPEND;
+ SvTreeEntryList* pChildList = GetChildList( pParent );
+
+ if( pChildList && pChildList->Count() )
+ {
+ long i = 0;
+ long j = pChildList->Count()-1;
+ long k;
+ StringCompare eCompare = COMPARE_GREATER;
+
+ do
+ {
+ k = (i+j)/2;
+ SvListEntry* pTempEntry = (SvListEntry*)(pChildList->GetObject(k));
+ eCompare = Compare( pEntry, pTempEntry );
+ if( eSortMode == SortDescending && eCompare != COMPARE_EQUAL )
+ {
+ if( eCompare == COMPARE_LESS )
+ eCompare = COMPARE_GREATER;
+ else
+ eCompare = COMPARE_LESS;
+ }
+ if( eCompare == COMPARE_GREATER )
+ i = k + 1;
+ else
+ j = k - 1;
+ } while( (eCompare != COMPARE_EQUAL) && (i <= j) );
+
+ if( eCompare != COMPARE_EQUAL )
+ {
+ if(i > ((long)pChildList->Count() - 1)) // nicht gefunden, Ende der Liste
+ rPos = LIST_APPEND;
+ else
+ rPos = i; // nicht gefunden, Mitte
+ }
+ else
+ rPos = k;
+ }
+}
+
+
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
new file mode 100644
index 000000000000..bc85863fb7b3
--- /dev/null
+++ b/svtools/source/control/calendar.cxx
@@ -0,0 +1,2963 @@
+/*************************************************************************
+ *
+ * $RCSfile: calendar.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _APP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _TABLE_HXX
+#include <tools/table.hxx>
+#endif
+#ifndef _HELP_HXX
+#include <vcl/help.hxx>
+#endif
+#ifndef _MENU_HXX
+#include <vcl/menu.hxx>
+#endif
+#ifndef _DECOVIEW_HXX
+#include <vcl/decoview.hxx>
+#endif
+#ifndef _FLOATWIN_HXX
+#include <vcl/floatwin.hxx>
+#endif
+#ifndef _BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+
+#define _SV_CALENDAR_CXX
+#include <svtools.hrc>
+#include <svtdata.hxx>
+#include <calendar.hxx>
+
+// =======================================================================
+
+#define DAY_OFFX 4
+#define DAY_OFFY 2
+#define MONTH_BORDERX 4
+#define MONTH_OFFY 3
+#define WEEKNUMBER_OFFX 4
+#define WEEKDAY_OFFY 3
+#define TITLE_OFFY 3
+#define TITLE_BORDERY 2
+#define SPIN_OFFX 4
+#define SPIN_OFFY TITLE_BORDERY
+
+#define WEEKNUMBER_HEIGHT 85
+
+#define CALENDAR_HITTEST_DAY ((USHORT)0x0001)
+#define CALENDAR_HITTEST_WEEK ((USHORT)0x0002)
+#define CALENDAR_HITTEST_MONTHTITLE ((USHORT)0x0004)
+#define CALENDAR_HITTEST_PREV ((USHORT)0x0008)
+#define CALENDAR_HITTEST_NEXT ((USHORT)0x0010)
+#define CALENDAR_HITTEST_OUTSIDE ((USHORT)0x1000)
+
+#define MENU_YEAR_COUNT 3
+
+#define TABLE_DATE_SELECTED ((void*)0x00000001)
+
+// =======================================================================
+
+struct ImplDateInfo
+{
+ XubString maText;
+ Color* mpTextColor;
+ Color* mpFrameColor;
+ USHORT mnFlags;
+
+ ImplDateInfo( const XubString& rText ) :
+ maText( rText )
+ { mpTextColor = mpFrameColor = NULL; mnFlags = 0; }
+ ~ImplDateInfo() { delete mpTextColor; delete mpFrameColor; }
+};
+
+DECLARE_TABLE( ImplDateTable, ImplDateInfo* );
+
+// =======================================================================
+
+static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, BOOL bSelect )
+{
+ if ( bSelect )
+ pTable->Insert( rDate.GetDate(), TABLE_DATE_SELECTED );
+ else
+ pTable->Remove( rDate.GetDate() );
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplCalendarSelectDateRange( Table* pTable,
+ const Date& rStartDate,
+ const Date& rEndDate,
+ BOOL bSelect )
+{
+ Date aStartDate = rStartDate;
+ Date aEndDate = rEndDate;
+ if ( aStartDate > aEndDate )
+ {
+ Date aTempDate = aStartDate;
+ aStartDate = aEndDate;
+ aEndDate = aTempDate;
+ }
+
+ if ( bSelect )
+ {
+ while ( aStartDate <= aEndDate )
+ {
+ pTable->Insert( aStartDate.GetDate(), TABLE_DATE_SELECTED );
+ aStartDate++;
+ }
+ }
+ else
+ {
+ void* p = pTable->First();
+ while ( p )
+ {
+ Date aDate( pTable->GetCurKey() );
+ if ( aDate > aEndDate )
+ break;
+
+ if ( aDate >= aStartDate )
+ pTable->Remove( aDate.GetDate() );
+ else
+ p = pTable->Next();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplCalendarUnSelectDateRange( Table* pTable,
+ Table* pOldTable,
+ const Date& rStartDate,
+ const Date& rEndDate )
+{
+ Date aStartDate = rStartDate;
+ Date aEndDate = rEndDate;
+ if ( aStartDate > aEndDate )
+ {
+ Date aTempDate = aStartDate;
+ aStartDate = aEndDate;
+ aEndDate = aTempDate;
+ }
+
+ void* p = pTable->First();
+ while ( p )
+ {
+ Date aDate( pTable->GetCurKey() );
+ if ( aDate > aEndDate )
+ break;
+
+ if ( aDate >= aStartDate )
+ pTable->Remove( aDate.GetDate() );
+ else
+ p = pTable->Next();
+ }
+
+ p = pOldTable->First();
+ while ( p )
+ {
+ Date aDate( pOldTable->GetCurKey() );
+ if ( aDate > aEndDate )
+ break;
+ if ( aDate >= aStartDate )
+ pTable->Insert( aDate.GetDate(), TABLE_DATE_SELECTED );
+
+ p = pOldTable->Next();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+inline void ImplCalendarClearSelectDate( Table* pTable )
+{
+ pTable->Clear();
+}
+
+// =======================================================================
+
+void Calendar::ImplInit( WinBits nWinStyle )
+{
+ mpDateTable = NULL;
+ mpSelectTable = new Table;
+ mpOldSelectTable = NULL;
+ mpRestoreSelectTable = NULL;
+ mpStandardColor = NULL;
+ mpSaturdayColor = NULL;
+ mpSundayColor = NULL;
+ mnDayCount = 0;
+ mnWinStyle = nWinStyle;
+ mnFirstYear = 0;
+ mnLastYear = 0;
+ mnRequestYear = 0;
+ mbCalc = TRUE;
+ mbFormat = TRUE;
+ mbDrag = FALSE;
+ mbSelection = FALSE;
+ mbMultiSelection = FALSE;
+ mbWeekSel = FALSE;
+ mbUnSel = FALSE;
+ mbMenuDown = FALSE;
+ mbSpinDown = FALSE;
+ mbPrevIn = FALSE;
+ mbNextIn = FALSE;
+ mbDirect = FALSE;
+ mbInSelChange = FALSE;
+ mbTravelSelect = FALSE;
+ mbScrollDateRange = FALSE;
+ mbSelLeft = FALSE;
+ mbAllSel = FALSE;
+ mbDropPos = FALSE;
+ SetFirstDate( maCurDate );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+
+ // Sonstige Strings erzeugen
+ maDayText = XubString( SvtResId( STR_SVT_CALENDAR_DAY ) );
+ maWeekText = XubString( SvtResId( STR_SVT_CALENDAR_WEEK ) );
+
+ // Tagestexte anlegen
+ for ( USHORT i = 0; i < 31; i++ )
+ mpDayText[i] = new UniString( UniString::CreateFromInt32( i+1 ) );
+
+ maDragScrollTimer.SetTimeoutHdl( STATIC_LINK( this, Calendar, ScrollHdl ) );
+ maDragScrollTimer.SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() );
+ mnDragScrollHitTest = 0;
+
+ ImplInitSettings();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplInitSettings()
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ maSelColor = rStyleSettings.GetHighlightTextColor();
+ SetPointFont( rStyleSettings.GetToolFont() );
+ SetTextColor( rStyleSettings.GetFieldTextColor() );
+ SetBackground( Wallpaper( rStyleSettings.GetFieldColor() ) );
+}
+
+// -----------------------------------------------------------------------
+
+Calendar::Calendar( Window* pParent, WinBits nWinStyle ) :
+ Control( pParent, nWinStyle & (WB_TABSTOP | WB_GROUP | WB_BORDER | WB_3DLOOK | WB_RANGESELECT | WB_MULTISELECT) ),
+ maIntn( Application::GetAppInternational() ),
+ maOldFormatFirstDate( 0, 0, 1900 ),
+ maOldFormatLastDate( 0, 0, 1900 ),
+ maFirstDate( 0, 0, 1900 ),
+ maOldFirstDate( 0, 0, 1900 ),
+ maOldCurDate( 0, 0, 1900 ),
+ maAnchorDate( maCurDate ),
+ maDropDate( 0, 0, 1900 )
+{
+ ImplInit( nWinStyle );
+}
+
+// -----------------------------------------------------------------------
+
+Calendar::Calendar( Window* pParent, const ResId& rResId ) :
+ Control( pParent, rResId ),
+ maIntn( Application::GetAppInternational() ),
+ maOldFormatFirstDate( 0, 0, 1900 ),
+ maOldFormatLastDate( 0, 0, 1900 ),
+ maFirstDate( 0, 0, 1900 ),
+ maOldFirstDate( 0, 0, 1900 ),
+ maOldCurDate( 0, 0, 1900 ),
+ maAnchorDate( maCurDate ),
+ maDropDate( 0, 0, 1900 )
+{
+ ImplInit( rResId.aWinBits );
+}
+
+// -----------------------------------------------------------------------
+
+Calendar::~Calendar()
+{
+ delete mpStandardColor;
+ delete mpSaturdayColor;
+ delete mpSundayColor;
+
+ if ( mpDateTable )
+ {
+ ImplDateInfo* pDateInfo = mpDateTable->First();
+ while ( pDateInfo )
+ {
+ delete pDateInfo;
+ pDateInfo = mpDateTable->Next();
+ }
+
+ delete mpDateTable;
+ }
+
+ delete mpSelectTable;
+ if ( mpOldSelectTable )
+ delete mpOldSelectTable;
+ if ( mpRestoreSelectTable )
+ delete mpRestoreSelectTable;
+
+ for ( USHORT i = 0; i < 31; i++ )
+ delete mpDayText[i];
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplGetWeekFont( Font& rFont ) const
+{
+ // Wochennummer geben wir in WEEKNUMBER_HEIGHT%-Fonthoehe aus
+ Size aFontSize = rFont.GetSize();
+ aFontSize.Height() *= WEEKNUMBER_HEIGHT;
+ aFontSize.Height() /= 100;
+ rFont.SetSize( aFontSize );
+ rFont.SetWeight( WEIGHT_NORMAL );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplFormat()
+{
+ if ( !mbFormat )
+ return;
+
+ DayOfWeek eStartDay = maIntn.GetWeekStart();
+
+ if ( mbCalc )
+ {
+ Size aOutSize = GetOutputSizePixel();
+
+ if ( (aOutSize.Width() <= 1) || (aOutSize.Height() <= 1) )
+ return;
+
+ XubString a99Text( XubString( RTL_CONSTASCII_USTRINGPARAM( "99" ) ) );
+
+ Font aOldFont = GetFont();
+
+ // Wochenanzeige beruecksichtigen
+ if ( mnWinStyle & WB_WEEKNUMBER )
+ {
+ Font aTempFont = aOldFont;
+ ImplGetWeekFont( aTempFont );
+ SetFont( aTempFont );
+ mnWeekWidth = GetTextWidth( a99Text )+WEEKNUMBER_OFFX;
+ SetFont( aOldFont );
+ }
+ else
+ mnWeekWidth = 0;
+
+ if ( mnWinStyle & WB_BOLDTEXT )
+ {
+ Font aFont = aOldFont;
+ if ( aFont.GetWeight() < WEIGHT_BOLD )
+ aFont.SetWeight( WEIGHT_BOLD );
+ else
+ aFont.SetWeight( WEIGHT_NORMAL );
+ SetFont( aFont );
+ }
+
+ long n99TextWidth = GetTextWidth( a99Text );
+ long nTextHeight = GetTextHeight();
+
+ // Breiten und X-Positionen berechnen
+ mnDayWidth = n99TextWidth+DAY_OFFX;
+ mnMonthWidth = mnDayWidth*7;
+ mnMonthWidth += mnWeekWidth;
+ mnMonthWidth += MONTH_BORDERX*2;
+ mnMonthPerLine = aOutSize.Width() / mnMonthWidth;
+ if ( !mnMonthPerLine )
+ mnMonthPerLine = 1;
+ long nOver = ((aOutSize.Width()-(mnMonthPerLine*mnMonthWidth)) / mnMonthPerLine);
+ mnMonthWidth += nOver;
+ mnDaysOffX = MONTH_BORDERX;
+ mnDaysOffX += nOver/2;
+ mnDaysOffX += mnWeekWidth;
+
+ // Hoehen und Y-Positionen berechnen
+ mnDayHeight = nTextHeight + DAY_OFFY;
+ mnWeekDayOffY = nTextHeight + TITLE_OFFY + (TITLE_BORDERY*2);
+ mnDaysOffY = mnWeekDayOffY + nTextHeight + WEEKDAY_OFFY;
+ mnMonthHeight = (mnDayHeight*6) + mnDaysOffY;
+ mnMonthHeight += MONTH_OFFY;
+ mnLines = aOutSize.Height() / mnMonthHeight;
+ if ( !mnLines )
+ mnLines = 1;
+ mnMonthHeight += (aOutSize.Height()-(mnLines*mnMonthHeight)) / mnLines;
+
+ // Spinfelder berechnen
+ long nSpinSize = nTextHeight+TITLE_BORDERY-SPIN_OFFY;
+ maPrevRect.Left() = SPIN_OFFX;
+ maPrevRect.Top() = SPIN_OFFY;
+ maPrevRect.Right() = maPrevRect.Left()+nSpinSize;
+ maPrevRect.Bottom() = maPrevRect.Top()+nSpinSize;
+ maNextRect.Left() = aOutSize.Width()-SPIN_OFFX-nSpinSize-1;
+ maNextRect.Top() = SPIN_OFFY;
+ maNextRect.Right() = maNextRect.Left()+nSpinSize;
+ maNextRect.Bottom() = maNextRect.Top()+nSpinSize;
+
+ if ( mnWinStyle & WB_BOLDTEXT )
+ SetFont( aOldFont );
+
+ // DayOffWeekText berechnen (werden im schmalen Font ausgegeben)
+ maDayOfWeekText.Erase();
+ long nStartOffX = 0;
+ USHORT eDay = (USHORT)eStartDay;
+ for ( USHORT nDayOfWeek = 0; nDayOfWeek < 7; nDayOfWeek++ )
+ {
+ String aDayOfWeek( maIntn.GetAbbrevDayText( (DayOfWeek)eDay ).GetChar( 0 ) );
+ long nOffX = (mnDayWidth-GetTextWidth( aDayOfWeek ))/2;
+ if ( mnWinStyle & WB_BOLDTEXT )
+ nOffX++;
+ if ( !nDayOfWeek )
+ nStartOffX = nOffX;
+ else
+ nOffX -= nStartOffX;
+ nOffX += nDayOfWeek * mnDayWidth;
+ mnDayOfWeekAry[nDayOfWeek] = nOffX;
+ maDayOfWeekText += aDayOfWeek;
+ eDay++;
+ eDay %= 7;
+ }
+
+ mbCalc = FALSE;
+ }
+
+ // Anzahl Tage berechnen
+ USHORT nWeekDay;
+ Date aTempDate = GetFirstMonth();
+ maFirstDate = aTempDate;
+ nWeekDay = (USHORT)aTempDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
+ maFirstDate -= (ULONG)nWeekDay;
+ mnDayCount = nWeekDay;
+ USHORT nDaysInMonth;
+ USHORT nMonthCount = (USHORT)(mnMonthPerLine*mnLines);
+ for ( USHORT i = 0; i < nMonthCount; i++ )
+ {
+ nDaysInMonth = aTempDate.GetDaysInMonth();
+ mnDayCount += nDaysInMonth;
+ aTempDate += nDaysInMonth;
+ }
+ Date aTempDate2 = aTempDate;
+ aTempDate2--;
+ nDaysInMonth = aTempDate2.GetDaysInMonth();
+ aTempDate2 -= nDaysInMonth-1;
+ nWeekDay = (USHORT)aTempDate2.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
+ mnDayCount += 42-nDaysInMonth-nWeekDay;
+
+ // Farben festlegen
+ maOtherColor = Color( COL_LIGHTGRAY );
+ if ( maOtherColor.IsRGBEqual( GetBackground().GetColor() ) )
+ maOtherColor.SetColor( COL_GRAY );
+
+ Date aLastDate = GetLastDate();
+ if ( (maOldFormatLastDate != aLastDate) ||
+ (maOldFormatFirstDate != maFirstDate) )
+ {
+ maOldFormatFirstDate = maFirstDate;
+ maOldFormatLastDate = aLastDate;
+ DateRangeChanged();
+ }
+
+ // DateInfo besorgen
+ USHORT nNewFirstYear = maFirstDate.GetYear();
+ USHORT nNewLastYear = GetLastDate().GetYear();
+ if ( mnFirstYear )
+ {
+ if ( nNewFirstYear < mnFirstYear )
+ {
+ for ( mnRequestYear = nNewFirstYear; mnRequestYear < mnFirstYear; mnRequestYear++ )
+ RequestDateInfo();
+ mnFirstYear = nNewFirstYear;
+ }
+ if ( nNewLastYear > mnLastYear )
+ {
+ for ( mnRequestYear = mnLastYear; mnRequestYear < nNewLastYear; mnRequestYear++ )
+ RequestDateInfo();
+ mnLastYear = nNewLastYear;
+ }
+ }
+ else
+ {
+ for ( mnRequestYear = nNewFirstYear; mnRequestYear < nNewLastYear; mnRequestYear++ )
+ RequestDateInfo();
+ mnFirstYear = nNewFirstYear;
+ mnLastYear = nNewLastYear;
+ }
+ mnRequestYear = 0;
+
+ mbFormat = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT Calendar::ImplHitTest( const Point& rPos, Date& rDate ) const
+{
+ if ( mbFormat )
+ return 0;
+
+ if ( maPrevRect.IsInside( rPos ) )
+ return CALENDAR_HITTEST_PREV;
+ else if ( maNextRect.IsInside( rPos ) )
+ return CALENDAR_HITTEST_NEXT;
+
+ long nX;
+ long nY;
+ long nOffX;
+ long nYMonth;
+ USHORT nDay;
+ DayOfWeek eStartDay = maIntn.GetWeekStart();
+
+ rDate = GetFirstMonth();
+ nY = 0;
+ for ( long i = 0; i < mnLines; i++ )
+ {
+ if ( rPos.Y() < nY )
+ return 0;
+
+ nX = 0;
+ nYMonth = nY+mnMonthHeight;
+ for ( long j = 0; j < mnMonthPerLine; j++ )
+ {
+ if ( (rPos.X() < nX) && (rPos.Y() < nYMonth) )
+ return 0;
+
+ USHORT nDaysInMonth = rDate.GetDaysInMonth();
+
+ // Entsprechender Monat gefunden
+ if ( (rPos.X() > nX) && (rPos.Y() < nYMonth) &&
+ (rPos.X() < nX+mnMonthWidth) )
+ {
+ if ( rPos.Y() < (nY+(TITLE_BORDERY*2)+mnDayHeight))
+ return CALENDAR_HITTEST_MONTHTITLE;
+ else
+ {
+ long nDayX = nX+mnDaysOffX;
+ long nDayY = nY+mnDaysOffY;
+ if ( rPos.Y() < nDayY )
+ return 0;
+ USHORT nDayIndex = (USHORT)rDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7;
+ if ( (i == 0) && (j == 0) )
+ {
+ Date aTempDate = rDate;
+ aTempDate -= nDayIndex;
+ for ( nDay = 0; nDay < nDayIndex; nDay++ )
+ {
+ nOffX = nDayX + (nDay*mnDayWidth);
+ if ( (rPos.Y() >= nDayY) && (rPos.Y() < nDayY+mnDayHeight) &&
+ (rPos.X() >= nOffX) && (rPos.X() < nOffX+mnDayWidth) )
+ {
+ rDate = aTempDate;
+ rDate += nDay;
+ return CALENDAR_HITTEST_DAY;
+ }
+ }
+ }
+ for ( nDay = 1; nDay <= nDaysInMonth; nDay++ )
+ {
+ if ( rPos.Y() < nDayY )
+ {
+ rDate += nDayIndex;
+ return 0;
+ }
+ nOffX = nDayX + (nDayIndex*mnDayWidth);
+ if ( (rPos.Y() >= nDayY) && (rPos.Y() < nDayY+mnDayHeight) &&
+ (rPos.X() >= nOffX) && (rPos.X() < nOffX+mnDayWidth) )
+ {
+ rDate += nDay-1;
+ return CALENDAR_HITTEST_DAY;
+ }
+ if ( nDayIndex == 6 )
+ {
+ nDayIndex = 0;
+ nDayY += mnDayHeight;
+ }
+ else
+ nDayIndex++;
+ }
+ if ( (i == mnLines-1) && (j == mnMonthPerLine-1) )
+ {
+ USHORT nWeekDay = (USHORT)rDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
+ USHORT nDayCount = 42-nDaysInMonth-nWeekDay;
+ Date aTempDate = rDate;
+ aTempDate += nDaysInMonth;
+ for ( nDay = 1; nDay <= nDayCount; nDay++ )
+ {
+ if ( rPos.Y() < nDayY )
+ {
+ rDate += nDayIndex;
+ return 0;
+ }
+ nOffX = nDayX + (nDayIndex*mnDayWidth);
+ if ( (rPos.Y() >= nDayY) && (rPos.Y() < nDayY+mnDayHeight) &&
+ (rPos.X() >= nOffX) && (rPos.X() < nOffX+mnDayWidth) )
+ {
+ rDate = aTempDate;
+ rDate += nDay-1;
+ return CALENDAR_HITTEST_DAY;
+ }
+ if ( nDayIndex == 6 )
+ {
+ nDayIndex = 0;
+ nDayY += mnDayHeight;
+ }
+ else
+ nDayIndex++;
+ }
+ }
+ }
+ }
+
+ rDate += nDaysInMonth;
+ nX += mnMonthWidth;
+ }
+
+ nY += mnMonthHeight;
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplDrawSpinArrow( OutputDevice* pDev, const Rectangle& rRect,
+ BOOL bPrev )
+{
+ long i;
+ long n;
+ long nLines;
+ long nHeight = rRect.GetHeight();
+ long nWidth = rRect.GetWidth();
+ if ( nWidth < nHeight )
+ n = nWidth;
+ else
+ n = nHeight;
+ if ( !(n & 0x01) )
+ n--;
+ nLines = n/2;
+
+ Rectangle aRect( Point( rRect.Left()+(nWidth/2)-(nLines/2),
+ rRect.Top()+(nHeight/2) ),
+ Size( 1, 1 ) );
+ if ( !bPrev )
+ {
+ aRect.Left() += nLines;
+ aRect.Right() += nLines;
+ }
+
+ pDev->DrawRect( aRect );
+ for ( i = 0; i < nLines; i++ )
+ {
+ if ( bPrev )
+ {
+ aRect.Left()++;
+ aRect.Right()++;
+ }
+ else
+ {
+ aRect.Left()--;
+ aRect.Right()--;
+ }
+ aRect.Top()--;
+ aRect.Bottom()++;
+ pDev->DrawRect( aRect );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplDrawSpin( BOOL bDrawPrev, BOOL bDrawNext )
+{
+ if ( !bDrawPrev && !bDrawNext )
+ return;
+
+ SetLineColor();
+ SetFillColor( GetSettings().GetStyleSettings().GetButtonTextColor() );
+ if ( bDrawPrev )
+ {
+ Rectangle aOutRect = maPrevRect;
+ aOutRect.Left() += 3;
+ aOutRect.Top() += 3;
+ aOutRect.Right() -= 3;
+ aOutRect.Bottom() -= 3;
+ ImplDrawSpinArrow( this, aOutRect, TRUE );
+ }
+ if ( bDrawNext )
+ {
+ Rectangle aOutRect = maNextRect;
+ aOutRect.Left() += 3;
+ aOutRect.Top() += 3;
+ aOutRect.Right() -= 3;
+ aOutRect.Bottom() -= 3;
+ ImplDrawSpinArrow( this, aOutRect, FALSE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplDrawDate( long nX, long nY,
+ USHORT nDay, USHORT nMonth, USHORT nYear,
+ DayOfWeek eDayOfWeek,
+ BOOL bBack, BOOL bOther, ULONG nToday )
+{
+ ImplDateInfo* pDateInfo;
+ Color* pTextColor = NULL;
+ const String& rDay = *(mpDayText[nDay-1]);
+ Rectangle aDateRect( nX, nY, nX+mnDayWidth-1, nY+mnDayHeight-1 );
+
+ BOOL bSel = FALSE;
+ BOOL bFocus = FALSE;
+ // Aktueller Tag
+ if ( (nDay == maCurDate.GetDay()) &&
+ (nMonth == maCurDate.GetMonth()) &&
+ (nYear == maCurDate.GetYear()) )
+ bFocus = TRUE;
+ if ( mpSelectTable )
+ {
+ if ( mpSelectTable->IsKeyValid( Date( nDay, nMonth, nYear ).GetDate() ) )
+ bSel = TRUE;
+ }
+
+ // Dateinfo ermitteln
+ if ( mpDateTable )
+ {
+ pDateInfo = mpDateTable->Get( Date( nDay, nMonth, nYear ).GetDate() );
+ if ( !pDateInfo )
+ pDateInfo = mpDateTable->Get( Date( nDay, nMonth, 0 ).GetDate() );
+ }
+ else
+ pDateInfo = NULL;
+
+ // Textfarbe ermitteln
+ if ( bSel )
+ pTextColor = &maSelColor;
+ else if ( bOther )
+ pTextColor = &maOtherColor;
+ else
+ {
+ if ( pDateInfo && pDateInfo->mpTextColor )
+ pTextColor = pDateInfo->mpTextColor;
+ else
+ {
+ if ( eDayOfWeek == SATURDAY )
+ pTextColor = mpSaturdayColor;
+ else if ( eDayOfWeek == SUNDAY )
+ pTextColor = mpSundayColor;
+ if ( !pTextColor )
+ pTextColor = mpStandardColor;
+ }
+ }
+
+ if ( bFocus )
+ HideFocus();
+
+ // Font ermitteln
+ Font aOldFont = GetFont();
+ BOOL bBoldFont = FALSE;
+ if ( (mnWinStyle & WB_BOLDTEXT) &&
+ pDateInfo && (pDateInfo->mnFlags & DIB_BOLD) )
+ {
+ bBoldFont = TRUE;
+ Font aFont = aOldFont;
+ if ( aFont.GetWeight() < WEIGHT_BOLD )
+ aFont.SetWeight( WEIGHT_BOLD );
+ else
+ aFont.SetWeight( WEIGHT_NORMAL );
+ SetFont( aFont );
+ }
+
+ // Hintergrund ausgeben
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ if ( bSel || bBack )
+ {
+ if ( bSel )
+ {
+ SetLineColor();
+ SetFillColor( rStyleSettings.GetHighlightColor() );
+ DrawRect( aDateRect );
+ }
+ else
+ Erase( aDateRect );
+ }
+
+ // Text ausgeben
+ long nTextX = nX+(mnDayWidth-GetTextWidth( rDay ))-(DAY_OFFX/2);
+ long nTextY = nY+(mnDayHeight-GetTextHeight())/2;
+ if ( pTextColor )
+ {
+ Color aOldColor = GetTextColor();
+ SetTextColor( *pTextColor );
+ DrawText( Point( nTextX, nTextY ), rDay );
+ SetTextColor( aOldColor );
+ }
+ else
+ DrawText( Point( nTextX, nTextY ), rDay );
+
+ // Heute
+ Date aTodayDate( maCurDate );
+ if ( nToday )
+ aTodayDate.SetDate( nToday );
+ else
+ aTodayDate = Date();
+ if ( (nDay == aTodayDate.GetDay()) &&
+ (nMonth == aTodayDate.GetMonth()) &&
+ (nYear == aTodayDate.GetYear()) )
+ {
+ SetLineColor( rStyleSettings.GetWindowTextColor() );
+ SetFillColor();
+ DrawRect( aDateRect );
+ }
+
+ // Evt. DateInfo ausgeben
+ if ( (mnWinStyle & WB_FRAMEINFO) && pDateInfo && pDateInfo->mpFrameColor )
+ {
+ SetLineColor( *(pDateInfo->mpFrameColor) );
+ SetFillColor();
+ Rectangle aFrameRect( aDateRect );
+ aFrameRect.Left()++;
+ aFrameRect.Top()++;
+ long nFrameWidth = aFrameRect.GetWidth();
+ long nFrameHeight = aFrameRect.GetHeight();
+ long nFrameOff;
+ if ( nFrameWidth < nFrameHeight )
+ {
+ nFrameOff = nFrameHeight-nFrameWidth;
+ aFrameRect.Top() += nFrameOff/2;
+ nFrameOff %= 2;
+ aFrameRect.Bottom() -= nFrameOff;
+ }
+ else if ( nFrameWidth > nFrameHeight )
+ {
+ nFrameOff = nFrameWidth-nFrameHeight;
+ aFrameRect.Left() += nFrameOff/2;
+ nFrameOff %= 2;
+ aFrameRect.Right() -= nFrameOff;
+ }
+ DrawEllipse( aFrameRect );
+ }
+
+ // Evt. noch FocusRect
+ if ( bFocus && HasFocus() )
+ ShowFocus( aDateRect );
+
+ if( mbDropPos && maDropDate == Date( nDay, nMonth, nYear ) )
+ ImplInvertDropPos();
+
+ if ( bBoldFont )
+ SetFont( aOldFont );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplDraw( BOOL bPaint )
+{
+ ImplFormat();
+
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ Size aOutSize = GetOutputSizePixel();
+ long i;
+ long j;
+ long nX;
+ long nY;
+ long nOffX;
+ long nOffY;
+ long nDayX;
+ long nDayY;
+ ULONG nToday = Date().GetDate();
+ USHORT nDay;
+ USHORT nMonth;
+ USHORT nYear;
+ Date aDate = GetFirstMonth();
+ DayOfWeek eStartDay = maIntn.GetWeekStart();
+
+ HideFocus();
+
+ nY = 0;
+ for ( i = 0; i < mnLines; i++ )
+ {
+ // Titleleiste ausgeben
+ SetLineColor();
+ SetFillColor( rStyleSettings.GetFaceColor() );
+ Rectangle aTitleRect( 0, nY, aOutSize.Width()-1, nY+mnDayHeight-DAY_OFFY+TITLE_BORDERY*2 );
+ if ( !bPaint )
+ {
+ Rectangle aTempRect( 1, aTitleRect.Top()+TITLE_BORDERY,
+ aOutSize.Width()-2,
+ aTitleRect.Bottom()-TITLE_BORDERY );
+ if ( !i )
+ {
+ aTempRect.Left() = maPrevRect.Right()+1;
+ aTempRect.Right() = maNextRect.Left()-1;
+ }
+ DrawRect( aTempRect );
+ }
+ else
+ {
+ DrawRect( aTitleRect );
+ Point aTopLeft1( aTitleRect.Left(), aTitleRect.Top() );
+ Point aTopLeft2( aTitleRect.Left(), aTitleRect.Top()+1 );
+ Point aBottomRight1( aTitleRect.Right(), aTitleRect.Bottom() );
+ Point aBottomRight2( aTitleRect.Right(), aTitleRect.Bottom()-1 );
+ SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ DrawLine( aTopLeft1, Point( aBottomRight1.X(), aTopLeft1.Y() ) );
+ SetLineColor( rStyleSettings.GetLightColor() );
+ DrawLine( aTopLeft2, Point( aBottomRight2.X(), aTopLeft2.Y() ) );
+ DrawLine( aTopLeft2, Point( aTopLeft2.X(), aBottomRight2.Y() ) );
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( Point( aTopLeft2.X(), aBottomRight2.Y() ), aBottomRight2 );
+ DrawLine( Point( aBottomRight2.X(), aTopLeft2.Y() ), aBottomRight2 );
+ SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ DrawLine( Point( aTopLeft1.X(), aBottomRight1.Y() ), aBottomRight1 );
+ }
+ Point aSepPos1( 0, aTitleRect.Top()+TITLE_BORDERY );
+ Point aSepPos2( 0, aTitleRect.Bottom()-TITLE_BORDERY );
+ for ( j = 0; j < mnMonthPerLine-1; j++ )
+ {
+ aSepPos1.X() += mnMonthWidth-1;
+ aSepPos2.X() = aSepPos1.X();
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( aSepPos1, aSepPos2 );
+ aSepPos1.X()++;
+ aSepPos2.X() = aSepPos1.X();
+ SetLineColor( rStyleSettings.GetLightColor() );
+ DrawLine( aSepPos1, aSepPos2 );
+ }
+
+ nX = 0;
+ for ( j = 0; j < mnMonthPerLine; j++ )
+ {
+ nMonth = aDate.GetMonth();
+ nYear = aDate.GetYear();
+
+ // Monat in der Titleleiste ausgeben
+ nOffX = nX;
+ nOffY = nY+TITLE_BORDERY;
+ String aMonthText( maIntn.GetMonthText( nMonth ) );
+ aMonthText += ' ';
+ aMonthText += nYear;
+ long nMonthTextWidth = GetTextWidth( aMonthText );
+ long nMonthOffX1 = 0;
+ long nMonthOffX2 = 0;
+ if ( i == 0 )
+ {
+ if ( j == 0 )
+ nMonthOffX1 = maPrevRect.Right()+1;
+ if ( j == mnMonthPerLine-1 )
+ nMonthOffX2 = aOutSize.Width()-maNextRect.Left()+1;
+ }
+ long nMaxMonthWidth = mnMonthWidth-nMonthOffX1-nMonthOffX2-4;
+ if ( nMonthTextWidth > nMaxMonthWidth )
+ {
+ aMonthText = maIntn.GetAbbrevMonthText( nMonth );
+ aMonthText += ' ';
+ aMonthText += nYear;
+ nMonthTextWidth = GetTextWidth( aMonthText );
+ }
+ long nTempOff = (mnMonthWidth-nMonthTextWidth+1)/2;
+ if ( nTempOff < nMonthOffX1 )
+ nOffX += nMonthOffX1+1;
+ else
+ {
+ if ( nTempOff+nMonthTextWidth > mnMonthWidth-nMonthOffX2 )
+ nOffX += mnMonthWidth-nMonthOffX2-nMonthTextWidth;
+ else
+ nOffX += nTempOff;
+ }
+ SetTextColor( rStyleSettings.GetButtonTextColor() );
+ DrawText( Point( nOffX, nOffY ), aMonthText );
+ SetTextColor( rStyleSettings.GetWindowTextColor() );
+
+ // Weekleiste ausgeben
+ if ( bPaint )
+ {
+ nDayX = nX+mnDaysOffX;
+ nDayY = nY+mnWeekDayOffY;
+ nOffY = nDayY + mnDayHeight;
+ SetLineColor( rStyleSettings.GetWindowTextColor() );
+ Point aStartPos( nDayX, nOffY );
+ if ( mnWinStyle & WB_WEEKNUMBER )
+ aStartPos.X() -= WEEKNUMBER_OFFX-2;
+ DrawLine( aStartPos, Point( nDayX+(7*mnDayWidth), nOffY ) );
+ DrawTextArray( Point( nDayX+mnDayOfWeekAry[0], nDayY ), maDayOfWeekText, &(mnDayOfWeekAry[1]) );
+ }
+
+ // Week-Numbers ausgeben
+ if ( mnWinStyle & WB_WEEKNUMBER )
+ {
+ nDayX = nX+mnDaysOffX;
+ nDayY = nY+mnWeekDayOffY;
+ nOffY = nDayY + mnDayHeight;
+ long nMonthHeight = mnDayHeight*6;
+ if ( bPaint )
+ DrawLine( Point( nDayX-WEEKNUMBER_OFFX+2, nOffY ), Point( nDayX-WEEKNUMBER_OFFX+2, nOffY+nMonthHeight ) );
+ else
+ Erase( Rectangle( nDayX-mnWeekWidth-WEEKNUMBER_OFFX, nOffY, nDayX-WEEKNUMBER_OFFX-1, nOffY+nMonthHeight ) );
+
+ Font aOldFont = GetFont();
+ Font aTempFont = aOldFont;
+ ImplGetWeekFont( aTempFont );
+ SetFont( aTempFont );
+ nDayX -= mnWeekWidth;
+ nDayY = nY+mnDaysOffY;
+ Date aTempDate = aDate;
+ for ( USHORT nWeekCount = 0; nWeekCount < 6; nWeekCount++ )
+ {
+ String aWeekText( aTempDate.GetWeekOfYear( eStartDay, maIntn.GetWeekCountStart() ) );
+ long nOffX = (mnWeekWidth-WEEKNUMBER_OFFX)-GetTextWidth( aWeekText );
+ long nOffY = (mnDayHeight-GetTextHeight())/2;
+ DrawText( Point( nDayX+nOffX, nDayY+nOffY ), aWeekText );
+ nDayY += mnDayHeight;
+ aTempDate += 7;
+ }
+ SetFont( aOldFont );
+ }
+
+ // Tage ausgeben
+ USHORT nDaysInMonth = aDate.GetDaysInMonth();
+ nDayX = nX+mnDaysOffX;
+ nDayY = nY+mnDaysOffY;
+ if ( !bPaint )
+ {
+ Rectangle aClearRect( nDayX, nDayY,
+ nDayX+(7*mnDayWidth)-1, nDayY+(6*mnDayHeight)-1 );
+ Erase( aClearRect );
+ }
+ USHORT nDayIndex = (USHORT)aDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(USHORT)eStartDay)) % 7;
+ if ( (i == 0) && (j == 0) )
+ {
+ Date aTempDate = aDate;
+ aTempDate -= nDayIndex;
+ for ( nDay = 0; nDay < nDayIndex; nDay++ )
+ {
+ nOffX = nDayX + (nDay*mnDayWidth);
+ ImplDrawDate( nOffX, nDayY, nDay+aTempDate.GetDay(),
+ aTempDate.GetMonth(), aTempDate.GetYear(),
+ (DayOfWeek)((nDay+(USHORT)eStartDay)%7), FALSE, TRUE, nToday );
+ }
+ }
+ for ( nDay = 1; nDay <= nDaysInMonth; nDay++ )
+ {
+ nOffX = nDayX + (nDayIndex*mnDayWidth);
+ ImplDrawDate( nOffX, nDayY, nDay, nMonth, nYear,
+ (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7),
+ FALSE, FALSE, nToday );
+ if ( nDayIndex == 6 )
+ {
+ nDayIndex = 0;
+ nDayY += mnDayHeight;
+ }
+ else
+ nDayIndex++;
+ }
+ if ( (i == mnLines-1) && (j == mnMonthPerLine-1) )
+ {
+ USHORT nWeekDay = (USHORT)aDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(USHORT)eStartDay)) % 7;
+ USHORT nDayCount = 42-nDaysInMonth-nWeekDay;
+ Date aTempDate = aDate;
+ aTempDate += nDaysInMonth;
+ for ( nDay = 1; nDay <= nDayCount; nDay++ )
+ {
+ nOffX = nDayX + (nDayIndex*mnDayWidth);
+ ImplDrawDate( nOffX, nDayY, nDay,
+ aTempDate.GetMonth(), aTempDate.GetYear(),
+ (DayOfWeek)((nDayIndex+(USHORT)eStartDay)%7),
+ FALSE, TRUE, nToday );
+ if ( nDayIndex == 6 )
+ {
+ nDayIndex = 0;
+ nDayY += mnDayHeight;
+ }
+ else
+ nDayIndex++;
+ }
+ }
+
+ aDate += nDaysInMonth;
+ nX += mnMonthWidth;
+ }
+
+ nY += mnMonthHeight;
+ }
+
+ // Spin-Buttons zeichnen
+ if ( bPaint )
+ ImplDrawSpin();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplUpdateDate( const Date& rDate )
+{
+ if ( IsReallyVisible() && IsUpdateMode() )
+ {
+ Rectangle aDateRect( GetDateRect( rDate ) );
+ if ( !aDateRect.IsEmpty() )
+ {
+ BOOL bOther = (rDate < GetFirstMonth()) || (rDate > GetLastMonth());
+ ImplDrawDate( aDateRect.Left(), aDateRect.Top(),
+ rDate.GetDay(), rDate.GetMonth(), rDate.GetYear(),
+ rDate.GetDayOfWeek(), TRUE, bOther );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplUpdateSelection( Table* pOld )
+{
+ Table* pNew = mpSelectTable;
+ void* p;
+ ULONG nKey;
+
+ p = pOld->First();
+ while ( p )
+ {
+ nKey = pOld->GetCurKey();
+ if ( !pNew->Get( nKey ) )
+ {
+ Date aTempDate( nKey );
+ ImplUpdateDate( aTempDate );
+ }
+
+ p = pOld->Next();
+ }
+
+ p = pNew->First();
+ while ( p )
+ {
+ nKey = pNew->GetCurKey();
+ if ( !pOld->Get( nKey ) )
+ {
+ Date aTempDate( nKey );
+ ImplUpdateDate( aTempDate );
+ }
+
+ p = pNew->Next();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplMouseSelect( const Date& rDate, USHORT nHitTest,
+ BOOL bMove, BOOL bExpand, BOOL bExtended )
+{
+ Table* pOldSel = new Table( *mpSelectTable );
+ Date aOldDate = maCurDate;
+ Date aTempDate = rDate;
+
+ if ( !(nHitTest & CALENDAR_HITTEST_DAY) )
+ aTempDate--;
+
+ if ( mbMultiSelection )
+ {
+ maCurDate = aTempDate;
+ mbSelLeft = aTempDate < maAnchorDate;
+
+ if ( bMove )
+ {
+ if ( mbSelLeft )
+ {
+ ImplCalendarUnSelectDateRange( mpSelectTable, mpRestoreSelectTable, Date( 1, 1, 0 ), aTempDate );
+ ImplCalendarUnSelectDateRange( mpSelectTable, mpRestoreSelectTable, maAnchorDate, Date( 31, 12, 9999 ) );
+ }
+ else
+ {
+ ImplCalendarUnSelectDateRange( mpSelectTable, mpRestoreSelectTable, Date( 1, 1, 0 ), maAnchorDate );
+ ImplCalendarUnSelectDateRange( mpSelectTable, mpRestoreSelectTable, aTempDate, Date( 31, 12, 9999 ) );
+ }
+ ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, !mbUnSel );
+ }
+ else
+ {
+ if ( bExpand )
+ {
+ if ( !bExtended )
+ {
+ if ( mbSelLeft )
+ {
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE );
+ }
+ else
+ {
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), FALSE );
+ }
+ }
+ ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, TRUE );
+ }
+ else if ( bExtended && !(mnWinStyle & WB_RANGESELECT) )
+ {
+ maAnchorDate = aTempDate;
+ if ( IsDateSelected( aTempDate ) )
+ {
+ mbUnSel = TRUE;
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, FALSE );
+ }
+ else
+ {
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE );
+ }
+ }
+ else
+ {
+ maAnchorDate = aTempDate;
+ ImplCalendarClearSelectDate( mpSelectTable );
+ ImplCalendarSelectDate( mpSelectTable, aTempDate, TRUE );
+ }
+
+ mpRestoreSelectTable = new Table( *mpSelectTable );
+ }
+ }
+ else
+ {
+ if ( aTempDate < maCurDate )
+ mbSelLeft = TRUE;
+ else
+ mbSelLeft = FALSE;
+ if ( !(nHitTest & CALENDAR_HITTEST_DAY) )
+ aTempDate = maOldCurDate;
+ if ( !bMove )
+ maAnchorDate = aTempDate;
+ if ( aTempDate != maCurDate )
+ {
+ maCurDate = aTempDate;
+ ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+ }
+ }
+
+ BOOL bNewSel = *pOldSel != *mpSelectTable;
+ if ( (maCurDate != aOldDate) || bNewSel )
+ {
+ if ( bNewSel )
+ {
+ mbInSelChange = TRUE;
+ SelectionChanging();
+ mbInSelChange = FALSE;
+ }
+ HideFocus();
+ if ( bNewSel )
+ ImplUpdateSelection( pOldSel );
+ if ( !bNewSel || !pOldSel->Get( aOldDate.GetDate() ) )
+ ImplUpdateDate( aOldDate );
+ // Damit Focus-Rechteck auch wieder neu ausgegeben wird
+ if ( HasFocus() || !bNewSel || !mpSelectTable->Get( maCurDate.GetDate() ) )
+ ImplUpdateDate( maCurDate );
+ }
+ delete pOldSel;
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplUpdate( BOOL bCalcNew )
+{
+ if ( IsReallyVisible() && IsUpdateMode() )
+ {
+ if ( bCalcNew && !mbCalc )
+ Invalidate();
+ else if ( !mbFormat && !mbCalc )
+ {
+ if ( mbDirect )
+ {
+ mbFormat = TRUE;
+ ImplDraw( FALSE );
+ return;
+ }
+ else
+ Invalidate();
+ }
+ }
+
+ if ( bCalcNew )
+ mbCalc = TRUE;
+ mbFormat = TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplInvertDropPos()
+{
+ Rectangle aRect = GetDateRect( maDropDate );//this is one Pixel to width and one to heigh
+ aRect.Bottom() = aRect.Top()+mnDayHeight-1;
+ aRect.Right() = aRect.Left()+mnDayWidth-1;
+ Invert( aRect );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplScroll( BOOL bPrev )
+{
+ Date aNewFirstMonth = GetFirstMonth();
+ if ( bPrev )
+ {
+ aNewFirstMonth--;
+ aNewFirstMonth -= aNewFirstMonth.GetDaysInMonth()-1;
+ }
+ else
+ aNewFirstMonth += aNewFirstMonth.GetDaysInMonth();
+ mbDirect = TRUE;
+ SetFirstDate( aNewFirstMonth );
+ mbDirect = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplShowMenu( const Point& rPos, const Date& rDate )
+{
+ EndSelection();
+
+ Date aOldFirstDate = GetFirstMonth();
+ PopupMenu aPopupMenu;
+ PopupMenu* pYearPopupMenus[MENU_YEAR_COUNT];
+ USHORT nMonthOff;
+ USHORT nCurItemId;
+ USHORT nYear = rDate.GetYear()-1;
+ USHORT i;
+ USHORT j;
+ USHORT nYearIdCount = 1000;
+
+ nMonthOff = (rDate.GetYear()-aOldFirstDate.GetYear())*12;
+ if ( aOldFirstDate.GetMonth() < rDate.GetMonth() )
+ nMonthOff += rDate.GetMonth()-aOldFirstDate.GetMonth();
+ else
+ nMonthOff -= aOldFirstDate.GetMonth()-rDate.GetMonth();
+
+ // Menu aufbauen (Jahre mit verschiedenen Monaten aufnehmen)
+ for ( i = 0; i < MENU_YEAR_COUNT; i++ )
+ {
+ pYearPopupMenus[i] = new PopupMenu;
+ for ( j = 1; j <= 12; j++ )
+ pYearPopupMenus[i]->InsertItem( nYearIdCount+j, maIntn.GetMonthText( j ) );
+ aPopupMenu.InsertItem( 10+i, UniString::CreateFromInt32( nYear+i ) );
+ aPopupMenu.SetPopupMenu( 10+i, pYearPopupMenus[i] );
+ nYearIdCount += 1000;
+ }
+
+ mbMenuDown = TRUE;
+ nCurItemId = aPopupMenu.Execute( this, rPos );
+ mbMenuDown = FALSE;
+
+ // Menu zerstoeren
+ aPopupMenu.SetPopupMenu( 2, NULL );
+ for ( i = 0; i < MENU_YEAR_COUNT; i++ )
+ {
+ aPopupMenu.SetPopupMenu( 10+i, NULL );
+ delete pYearPopupMenus[i];
+ }
+
+ if ( nCurItemId )
+ {
+ USHORT nTempMonthOff = nMonthOff % 12;
+ USHORT nTempYearOff = nMonthOff / 12;
+ USHORT nNewMonth = nCurItemId % 1000;
+ USHORT nNewYear = nYear+((nCurItemId-1000)/1000);
+ if ( nTempMonthOff < nNewMonth )
+ nNewMonth -= nTempMonthOff;
+ else
+ {
+ nNewYear--;
+ nNewMonth = 12-(nTempMonthOff-nNewMonth);
+ }
+ nNewYear -= nTempYearOff;
+ SetFirstDate( Date( 1, nNewMonth, nNewYear ) );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplTracking( const Point& rPos, BOOL bRepeat )
+{
+ Date aTempDate = maCurDate;
+ USHORT nHitTest = ImplHitTest( rPos, aTempDate );
+
+ if ( mbSpinDown )
+ {
+ mbPrevIn = (nHitTest & CALENDAR_HITTEST_PREV) != 0;
+ mbNextIn = (nHitTest & CALENDAR_HITTEST_NEXT) != 0;
+
+ if ( bRepeat && (mbPrevIn || mbNextIn) )
+ {
+ mbScrollDateRange = TRUE;
+ ImplScroll( mbPrevIn );
+ mbScrollDateRange = FALSE;
+ }
+ }
+ else
+ ImplMouseSelect( aTempDate, nHitTest, TRUE, FALSE, FALSE );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ImplEndTracking( const Point& rPos, BOOL bCancel )
+{
+ BOOL bSelection = mbSelection;
+ BOOL bSpinDown = mbSpinDown;
+
+ mbDrag = FALSE;
+ mbSelection = FALSE;
+ mbMultiSelection = FALSE;
+ mbUnSel = FALSE;
+ mbSpinDown = FALSE;
+ mbPrevIn = FALSE;
+ mbNextIn = FALSE;
+
+ if ( bCancel )
+ {
+ if ( maOldFirstDate != maFirstDate )
+ SetFirstDate( maOldFirstDate );
+
+ if ( !bSpinDown )
+ {
+ Table* pOldSel = new Table( *mpSelectTable );
+ Date aOldDate = maCurDate;
+ maCurDate = maOldCurDate;
+ *mpSelectTable = *mpOldSelectTable;
+ HideFocus();
+ ImplUpdateSelection( pOldSel );
+ if ( !pOldSel->Get( aOldDate.GetDate() ) )
+ ImplUpdateDate( aOldDate );
+ // Damit Focus-Rechteck auch wieder neu ausgegeben wird
+ if ( HasFocus() || !mpSelectTable->Get( maCurDate.GetDate() ) )
+ ImplUpdateDate( maCurDate );
+ delete pOldSel;
+ }
+ }
+
+ if ( !bSpinDown )
+ {
+ if ( !bCancel )
+ {
+ // Feststellen, ob wir sichtbaren Bereich scrollen sollen
+ ULONG nSelCount = mpSelectTable->Count();
+ if ( nSelCount )
+ {
+ Date aFirstSelDate( mpSelectTable->GetObjectKey( 0 ) );
+ Date aLastSelDate( mpSelectTable->GetObjectKey( nSelCount-1 ) );
+ if ( aLastSelDate < GetFirstMonth() )
+ ImplScroll( TRUE );
+ else if ( GetLastMonth() < aFirstSelDate )
+ ImplScroll( FALSE );
+ }
+ }
+
+ if ( mbAllSel ||
+ (!bCancel && ((maCurDate != maOldCurDate) || (*mpOldSelectTable != *mpSelectTable))) )
+ Select();
+
+ if ( !bSelection && (mnWinStyle & WB_TABSTOP) && !bCancel )
+ GrabFocus();
+
+ delete mpOldSelectTable;
+ mpOldSelectTable = NULL;
+ delete mpRestoreSelectTable;
+ mpRestoreSelectTable = NULL;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_STATIC_LINK( Calendar, ScrollHdl, Timer*, pTimer )
+{
+ BOOL bPrevIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_PREV) != 0;
+ BOOL bNextIn = (pThis->mnDragScrollHitTest & CALENDAR_HITTEST_NEXT) != 0;
+ if( bNextIn || bPrevIn )
+ {
+ pThis->mbScrollDateRange = TRUE;
+ pThis->ImplScroll( bPrevIn );
+ pThis->mbScrollDateRange = FALSE;
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() && !mbMenuDown )
+ {
+ Date aTempDate = maCurDate;
+ USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), aTempDate );
+ if ( nHitTest )
+ {
+ if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE )
+ ImplShowMenu( rMEvt.GetPosPixel(), aTempDate );
+ else
+ {
+ maOldFirstDate = maFirstDate;
+
+ mbPrevIn = (nHitTest & CALENDAR_HITTEST_PREV) != 0;
+ mbNextIn = (nHitTest & CALENDAR_HITTEST_NEXT) != 0;
+ if ( mbPrevIn || mbNextIn )
+ {
+ mbSpinDown = TRUE;
+ mbScrollDateRange = TRUE;
+ ImplScroll( mbPrevIn );
+ mbScrollDateRange = FALSE;
+ // Hier muss BUTTONREPEAT stehen, also nicht wieder
+ // auf SCROLLREPEAT aendern, sondern mit TH abklaeren,
+ // warum es evtl. anders sein sollte (71775)
+ StartTracking( STARTTRACK_BUTTONREPEAT );
+ }
+ else
+ {
+ if ( (rMEvt.GetClicks() == 2) && (nHitTest & CALENDAR_HITTEST_DAY) )
+ DoubleClick();
+ else
+ {
+ if ( mpOldSelectTable )
+ delete mpOldSelectTable;
+ maOldCurDate = maCurDate;
+ mpOldSelectTable = new Table( *mpSelectTable );
+
+ if ( !mbSelection )
+ {
+ mbDrag = TRUE;
+ StartTracking();
+ }
+
+ mbMultiSelection = (mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT)) != 0;
+ if ( (nHitTest & CALENDAR_HITTEST_DAY) && mbMultiSelection )
+ mbWeekSel = TRUE;
+ else
+ mbWeekSel = FALSE;
+ ImplMouseSelect( aTempDate, nHitTest, FALSE, rMEvt.IsShift(), rMEvt.IsMod1() );
+ }
+ }
+ }
+ }
+
+ return;
+ }
+
+ Control::MouseButtonDown( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() && mbSelection )
+ ImplEndTracking( rMEvt.GetPosPixel(), FALSE );
+ else
+ Control::MouseButtonUp( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::MouseMove( const MouseEvent& rMEvt )
+{
+ if ( mbSelection && rMEvt.GetButtons() )
+ ImplTracking( rMEvt.GetPosPixel(), FALSE );
+ else
+ Control::MouseMove( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::Tracking( const TrackingEvent& rTEvt )
+{
+ Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel();
+
+ if ( rTEvt.IsTrackingEnded() )
+ ImplEndTracking( aMousePos, rTEvt.IsTrackingCanceled() );
+ else
+ ImplTracking( aMousePos, rTEvt.IsTrackingRepeat() );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::KeyInput( const KeyEvent& rKEvt )
+{
+ Date aNewDate = maCurDate;
+ BOOL bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0;
+ BOOL bExpand = rKEvt.GetKeyCode().IsShift();
+ BOOL bExtended = rKEvt.GetKeyCode().IsMod1();
+
+ switch ( rKEvt.GetKeyCode().GetCode() )
+ {
+ case KEY_HOME:
+ aNewDate.SetDay( 1 );
+ break;
+
+ case KEY_END:
+ aNewDate.SetDay( aNewDate.GetDaysInMonth() );
+ break;
+
+ case KEY_LEFT:
+ aNewDate--;
+ break;
+
+ case KEY_RIGHT:
+ aNewDate++;
+ break;
+
+ case KEY_UP:
+ aNewDate -= 7;
+ break;
+
+ case KEY_DOWN:
+ aNewDate += 7;
+ break;
+
+ case KEY_PAGEUP:
+ {
+ Date aTempDate = aNewDate;
+ aTempDate -= aNewDate.GetDay()+1;
+ aNewDate -= aTempDate.GetDaysInMonth();
+ }
+ break;
+
+ case KEY_PAGEDOWN:
+ aNewDate += aNewDate.GetDaysInMonth();
+ break;
+
+ case KEY_SPACE:
+ if ( bMultiSel && !(mnWinStyle & WB_RANGESELECT) )
+ {
+ if ( !bExpand )
+ {
+ BOOL bDateSel = IsDateSelected( maCurDate );
+ SelectDate( maCurDate, !bDateSel );
+ mbSelLeft = FALSE;
+ SelectionChanging();
+ mbTravelSelect = TRUE;
+ Select();
+ mbTravelSelect = FALSE;
+ }
+ }
+ else
+ Control::KeyInput( rKEvt );
+ break;
+
+ default:
+ Control::KeyInput( rKEvt );
+ break;
+ }
+
+ if ( aNewDate != maCurDate )
+ {
+ if ( bMultiSel && bExpand )
+ {
+ Table* pOldSel = new Table( *mpSelectTable );
+ Date aOldAnchorDate = maAnchorDate;
+ mbSelLeft = aNewDate < maAnchorDate;
+ if ( !bExtended )
+ {
+ if ( mbSelLeft )
+ {
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), FALSE );
+ }
+ else
+ {
+ ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, FALSE );
+ ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), FALSE );
+ }
+ }
+ ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, TRUE );
+ mbDirect = TRUE;
+ SetCurDate( aNewDate );
+ mbDirect = FALSE;
+ maAnchorDate = aOldAnchorDate;
+ mbInSelChange = TRUE;
+ SelectionChanging();
+ mbInSelChange = FALSE;
+ ImplUpdateSelection( pOldSel );
+ }
+ else
+ {
+ if ( mnWinStyle & WB_RANGESELECT )
+ {
+ SetNoSelection();
+ SelectDate( aNewDate, TRUE );
+ }
+ mbDirect = TRUE;
+ SetCurDate( aNewDate );
+ mbDirect = FALSE;
+ }
+ mbTravelSelect = TRUE;
+ Select();
+ mbTravelSelect = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::Paint( const Rectangle& rRect )
+{
+ ImplDraw( TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::GetFocus()
+{
+ ImplUpdateDate( maCurDate );
+ Control::GetFocus();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::LoseFocus()
+{
+ HideFocus();
+ Control::LoseFocus();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::Resize()
+{
+ ImplUpdate( TRUE );
+ Control::Resize();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::RequestHelp( const HelpEvent& rHEvt )
+{
+ if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) )
+ {
+ Date aDate = maCurDate;
+ if ( GetDate( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ), aDate ) )
+ {
+ Rectangle aDateRect = GetDateRect( aDate );
+ Point aPt = OutputToScreenPixel( aDateRect.TopLeft() );
+ aDateRect.Left() = aPt.X();
+ aDateRect.Top() = aPt.Y();
+ aPt = OutputToScreenPixel( aDateRect.BottomRight() );
+ aDateRect.Right() = aPt.X();
+ aDateRect.Bottom() = aPt.Y();
+
+ if ( (rHEvt.GetMode() & HELPMODE_BALLOON) || (mnWinStyle & WB_QUICKHELPSHOWSDATEINFO) )
+ {
+ ImplDateInfo* pInfo;
+ if ( mpDateTable )
+ {
+ pInfo = mpDateTable->Get( aDate.GetDate() );
+ if ( !pInfo )
+ pInfo = mpDateTable->Get( Date( aDate.GetDay(), aDate.GetMonth(), 0 ).GetDate() );
+ }
+ else
+ pInfo = NULL;
+ if ( pInfo )
+ {
+ XubString aStr = pInfo->maText;
+ if ( aStr.Len() )
+ {
+ Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aDateRect, aStr );
+ return;
+ }
+ }
+ }
+
+ if ( rHEvt.GetMode() & HELPMODE_QUICK )
+ {
+ USHORT nWeek = aDate.GetWeekOfYear( maIntn.GetWeekStart(), maIntn.GetWeekCountStart() );
+ USHORT nMonth = aDate.GetMonth();
+ XubString aStr( maDayText );
+ aStr.AppendAscii( ": " );
+ aStr.Append( XubString::CreateFromInt32( aDate.GetDayOfYear() ) );
+ aStr.AppendAscii( " / " );
+ aStr.Append( maWeekText );
+ aStr.AppendAscii( ": " );
+ aStr.Append( XubString::CreateFromInt32( nWeek ) );
+ // Evt. noch Jahr hinzufuegen, wenn es nicht das gleiche ist
+ if ( (nMonth == 12) && (nWeek == 1) )
+ {
+ aStr.AppendAscii( ", " );
+ aStr.Append( XubString::CreateFromInt32( aDate.GetYear()+1 ) );
+ }
+ else if ( (nMonth == 1) && (nWeek > 50) )
+ {
+ aStr.AppendAscii( ", " );
+ aStr.Append( XubString::CreateFromInt32( aDate.GetYear()-1 ) );
+ }
+ Help::ShowQuickHelp( this, aDateRect, aStr );
+ return;
+ }
+ }
+ }
+
+ Control::RequestHelp( rHEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+ {
+ if ( !mbSelection && rCEvt.IsMouseEvent() )
+ {
+ Date aTempDate = maCurDate;
+ USHORT nHitTest = ImplHitTest( rCEvt.GetMousePosPixel(), aTempDate );
+ if ( nHitTest & CALENDAR_HITTEST_MONTHTITLE )
+ {
+ ImplShowMenu( rCEvt.GetMousePosPixel(), aTempDate );
+ return;
+ }
+ }
+ }
+ else if ( rCEvt.GetCommand() == COMMAND_WHEEL )
+ {
+ const CommandWheelData* pData = rCEvt.GetWheelData();
+ if ( pData->GetMode() == COMMAND_WHEEL_SCROLL )
+ {
+ long nNotchDelta = pData->GetNotchDelta();
+ if ( nNotchDelta < 0 )
+ {
+ while ( nNotchDelta < 0 )
+ {
+ ImplScroll( TRUE );
+ nNotchDelta++;
+ }
+ }
+ else
+ {
+ while ( nNotchDelta > 0 )
+ {
+ ImplScroll( FALSE );
+ nNotchDelta--;
+ }
+ }
+
+ return;
+ }
+ }
+
+ Control::Command( rCEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::StateChanged( StateChangedType nType )
+{
+ Control::StateChanged( nType );
+
+ if ( nType == STATE_CHANGE_INITSHOW )
+ ImplFormat();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Control::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
+ (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
+ ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SelectionChanging()
+{
+ maSelectionChangingHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::DateRangeChanged()
+{
+ maDateRangeChangedHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::RequestDateInfo()
+{
+ maRequestDateInfoHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::DoubleClick()
+{
+ maDoubleClickHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::Select()
+{
+ maSelectHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SetInternational( const International& rIntn )
+{
+ ImplUpdate( TRUE );
+
+ maIntn = rIntn;
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SelectDate( const Date& rDate, BOOL bSelect )
+{
+ if ( !rDate.IsValid() )
+ return;
+
+ Table* pOldSel;
+
+ if ( !mbInSelChange )
+ pOldSel = new Table( *mpSelectTable );
+ else
+ pOldSel = NULL;
+
+ ImplCalendarSelectDate( mpSelectTable, rDate, bSelect );
+
+ if ( pOldSel )
+ {
+ ImplUpdateSelection( pOldSel );
+ delete pOldSel;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SelectDateRange( const Date& rStartDate, const Date& rEndDate,
+ BOOL bSelect )
+{
+ if ( !rStartDate.IsValid() || !rEndDate.IsValid() )
+ return;
+
+ Table* pOldSel;
+
+ if ( !mbInSelChange )
+ pOldSel = new Table( *mpSelectTable );
+ else
+ pOldSel = NULL;
+
+ ImplCalendarSelectDateRange( mpSelectTable, rStartDate, rEndDate, bSelect );
+
+ if ( pOldSel )
+ {
+ ImplUpdateSelection( pOldSel );
+ delete pOldSel;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SetNoSelection()
+{
+ Table* pOldSel;
+
+ if ( !mbInSelChange )
+ pOldSel = new Table( *mpSelectTable );
+ else
+ pOldSel = NULL;
+
+ ImplCalendarClearSelectDate( mpSelectTable );
+
+ if ( pOldSel )
+ {
+ ImplUpdateSelection( pOldSel );
+ delete pOldSel;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+BOOL Calendar::IsDateSelected( const Date& rDate ) const
+{
+ return mpSelectTable->IsKeyValid( rDate.GetDate() );
+}
+
+// -----------------------------------------------------------------------
+
+ULONG Calendar::GetSelectDateCount() const
+{
+ return mpSelectTable->Count();
+}
+
+// -----------------------------------------------------------------------
+
+Date Calendar::GetSelectDate( ULONG nIndex ) const
+{
+ if ( nIndex < mpSelectTable->Count() )
+ return Date( mpSelectTable->GetObjectKey( nIndex ) );
+ else
+ {
+ Date aDate( 0, 0, 0 );
+ return aDate;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SetCurDate( const Date& rNewDate )
+{
+ if ( !rNewDate.IsValid() )
+ return;
+
+ if ( maCurDate != rNewDate )
+ {
+ BOOL bUpdate = IsVisible() && IsUpdateMode();
+ Date aOldDate = maCurDate;
+ maCurDate = rNewDate;
+ maAnchorDate = maCurDate;
+
+ if ( !(mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) )
+ {
+ ImplCalendarSelectDate( mpSelectTable, aOldDate, FALSE );
+ ImplCalendarSelectDate( mpSelectTable, maCurDate, TRUE );
+ }
+ else if ( !HasFocus() )
+ bUpdate = FALSE;
+
+ // Aktuelles Datum noch in den sichtbaren Bereich verschieben
+ if ( mbFormat || (maCurDate < GetFirstMonth()) )
+ SetFirstDate( maCurDate );
+ else if ( maCurDate > GetLastMonth() )
+ {
+ Date aTempDate = GetLastMonth();
+ long nDateOff = maCurDate-aTempDate;
+ if ( nDateOff < 365 )
+ {
+ Date maFirstDate = GetFirstMonth();
+ maFirstDate += maFirstDate.GetDaysInMonth();
+ aTempDate++;
+ while ( nDateOff > aTempDate.GetDaysInMonth() )
+ {
+ maFirstDate += maFirstDate.GetDaysInMonth();
+ long nDaysInMonth = aTempDate.GetDaysInMonth();
+ aTempDate += nDaysInMonth;
+ nDateOff -= nDaysInMonth;
+ }
+ SetFirstDate( maFirstDate );
+ }
+ else
+ SetFirstDate( maCurDate );
+ }
+ else
+ {
+ if ( bUpdate )
+ {
+ HideFocus();
+ ImplUpdateDate( aOldDate );
+ ImplUpdateDate( maCurDate );
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SetFirstDate( const Date& rNewFirstDate )
+{
+ if ( maFirstDate != rNewFirstDate )
+ {
+ maFirstDate = Date( 1, rNewFirstDate.GetMonth(), rNewFirstDate.GetYear() );
+ mbDropPos = FALSE;
+ ImplUpdate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+Date Calendar::GetFirstMonth() const
+{
+ if ( maFirstDate.GetDay() > 1 )
+ {
+ if ( maFirstDate.GetMonth() == 12 )
+ return Date( 1, 1, maFirstDate.GetYear()+1 );
+ else
+ return Date( 1, maFirstDate.GetMonth()+1, maFirstDate.GetYear() );
+ }
+ else
+ return maFirstDate;
+}
+
+// -----------------------------------------------------------------------
+
+Date Calendar::GetLastMonth() const
+{
+ Date aDate = GetFirstMonth();
+ USHORT nMonthCount = GetMonthCount();
+ for ( USHORT i = 0; i < nMonthCount; i++ )
+ aDate += aDate.GetDaysInMonth();
+ aDate--;
+ return aDate;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT Calendar::GetMonthCount() const
+{
+ if ( mbFormat )
+ return 1;
+ else
+ return (USHORT)(mnMonthPerLine*mnLines);
+}
+
+// -----------------------------------------------------------------------
+
+BOOL Calendar::GetDropDate( Date& rDate ) const
+{
+ if( mbDropPos )
+ {
+ rDate = maDropDate;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL Calendar::GetDate( const Point& rPos, Date& rDate ) const
+{
+ Date aDate = maCurDate;
+ USHORT nHitTest = ImplHitTest( rPos, aDate );
+ if ( nHitTest & CALENDAR_HITTEST_DAY )
+ {
+ rDate = aDate;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+Rectangle Calendar::GetDateRect( const Date& rDate ) const
+{
+ Rectangle aRect;
+
+ if ( mbFormat || (rDate < maFirstDate) || (rDate > (maFirstDate+mnDayCount)) )
+ return aRect;
+
+ long nX;
+ long nY;
+ ULONG nDaysOff;
+ USHORT nDayIndex;
+ Date aDate = GetFirstMonth();
+
+ if ( rDate < aDate )
+ {
+ aRect = GetDateRect( aDate );
+ nDaysOff = aDate-rDate;
+ nX = (long)(nDaysOff*mnDayWidth);
+ aRect.Left() -= nX;
+ aRect.Right() -= nX;
+ return aRect;
+ }
+ else
+ {
+ Date aLastDate = GetLastMonth();
+ if ( rDate > aLastDate )
+ {
+ USHORT nWeekDay = (USHORT)aLastDate.GetDayOfWeek();
+ nWeekDay = (nWeekDay+(7-(USHORT)maIntn.GetWeekStart())) % 7;
+ aLastDate -= nWeekDay;
+ aRect = GetDateRect( aLastDate );
+ nDaysOff = rDate-aLastDate;
+ nDayIndex = 0;
+ for ( USHORT i = 0; i <= nDaysOff; i++ )
+ {
+ if ( aLastDate == rDate )
+ {
+ aRect.Left() += nDayIndex*mnDayWidth;
+ aRect.Right() = aRect.Left()+mnDayWidth;
+ return aRect;
+ }
+ if ( nDayIndex == 6 )
+ {
+ nDayIndex = 0;
+ aRect.Top() += mnDayHeight;
+ aRect.Bottom() += mnDayHeight;
+ }
+ else
+ nDayIndex++;
+ aLastDate++;
+ }
+ }
+ }
+
+ nY = 0;
+ for ( long i = 0; i < mnLines; i++ )
+ {
+ nX = 0;
+ for ( long j = 0; j < mnMonthPerLine; j++ )
+ {
+ USHORT nDaysInMonth = aDate.GetDaysInMonth();
+
+ // Monat gerufen
+ if ( (aDate.GetMonth() == rDate.GetMonth()) &&
+ (aDate.GetYear() == rDate.GetYear()) )
+ {
+ long nDayX = nX+mnDaysOffX;
+ long nDayY = nY+mnDaysOffY;
+ nDayIndex = (USHORT)aDate.GetDayOfWeek();
+ nDayIndex = (nDayIndex+(7-(USHORT)maIntn.GetWeekStart())) % 7;
+ for ( USHORT nDay = 1; nDay <= nDaysInMonth; nDay++ )
+ {
+ if ( nDay == rDate.GetDay() )
+ {
+ aRect.Left() = nDayX + (nDayIndex*mnDayWidth);
+ aRect.Top() = nDayY;
+ aRect.Right() = aRect.Left()+mnDayWidth;
+ aRect.Bottom() = aRect.Top()+mnDayHeight;
+ break;
+ }
+ if ( nDayIndex == 6 )
+ {
+ nDayIndex = 0;
+ nDayY += mnDayHeight;
+ }
+ else
+ nDayIndex++;
+ }
+ }
+
+ aDate += nDaysInMonth;
+ nX += mnMonthWidth;
+ }
+
+ nY += mnMonthHeight;
+ }
+
+ return aRect;
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SetStandardColor( const Color& rColor )
+{
+ if ( mpStandardColor )
+ *mpStandardColor = rColor;
+ else
+ mpStandardColor = new Color( rColor );
+ ImplUpdate();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SetSaturdayColor( const Color& rColor )
+{
+ if ( mpSaturdayColor )
+ *mpSaturdayColor = rColor;
+ else
+ mpSaturdayColor = new Color( rColor );
+ ImplUpdate();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::SetSundayColor( const Color& rColor )
+{
+ if ( mpSundayColor )
+ *mpSundayColor = rColor;
+ else
+ mpSundayColor = new Color( rColor );
+ ImplUpdate();
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::AddDateInfo( const Date& rDate, const String& rText,
+ const Color* pTextColor, const Color* pFrameColor,
+ USHORT nFlags )
+{
+ if ( !mpDateTable )
+ mpDateTable = new ImplDateTable( 256, 256 );
+
+ BOOL bChanged = FALSE;
+ ULONG nKey = rDate.GetDate();
+ ImplDateInfo* pDateInfo = mpDateTable->Get( nKey );
+ if ( pDateInfo )
+ pDateInfo->maText = rText;
+ else
+ {
+ pDateInfo = new ImplDateInfo( rText );
+ mpDateTable->Insert( nKey, pDateInfo );
+ }
+ if ( pTextColor )
+ {
+ if ( pDateInfo->mpTextColor )
+ {
+ if ( *(pDateInfo->mpTextColor) != *pTextColor )
+ {
+ *(pDateInfo->mpTextColor) = *pTextColor;
+ bChanged = TRUE;
+ }
+ }
+ else
+ {
+ pDateInfo->mpTextColor = new Color( *pTextColor );
+ bChanged = TRUE;
+ }
+ }
+ else
+ {
+ if ( pDateInfo->mpTextColor )
+ {
+ delete pDateInfo->mpTextColor;
+ pDateInfo->mpTextColor = NULL;
+ bChanged = TRUE;
+ }
+ }
+ if ( pFrameColor )
+ {
+ if ( pDateInfo->mpFrameColor )
+ {
+ if ( *(pDateInfo->mpFrameColor) != *pFrameColor )
+ {
+ *(pDateInfo->mpFrameColor) = *pFrameColor;
+ bChanged = TRUE;
+ }
+ }
+ else
+ {
+ pDateInfo->mpFrameColor = new Color( *pFrameColor );
+ bChanged = TRUE;
+ }
+ }
+ else
+ {
+ if ( pDateInfo->mpFrameColor )
+ {
+ delete pDateInfo->mpFrameColor;
+ pDateInfo->mpFrameColor = NULL;
+ bChanged = TRUE;
+ }
+ }
+ if ( pDateInfo->mnFlags != nFlags )
+ {
+ pDateInfo->mnFlags = nFlags;
+ bChanged = TRUE;
+ }
+
+ if ( bChanged )
+ ImplUpdateDate( rDate );
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::RemoveDateInfo( const Date& rDate )
+{
+ if ( mpDateTable )
+ {
+ ImplDateInfo* pDateInfo = mpDateTable->Remove( rDate.GetDate() );
+ if ( pDateInfo )
+ {
+ delete pDateInfo;
+ ImplUpdateDate( rDate );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::ClearDateInfo()
+{
+ if ( mpDateTable )
+ {
+ ImplDateInfo* pDateInfo = mpDateTable->First();
+ while ( pDateInfo )
+ {
+ ULONG nKey = mpDateTable->GetCurKey();
+ mpDateTable->Remove( nKey );
+ Date aDate( nKey );
+ ImplUpdateDate( aDate );
+ delete pDateInfo;
+ pDateInfo = mpDateTable->First();
+ }
+ delete mpDateTable;
+ mpDateTable = NULL;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+XubString Calendar::GetDateInfoText( const Date& rDate )
+{
+ XubString aRet;
+ if ( mpDateTable )
+ {
+ ULONG nKey = rDate.GetDate();
+ ImplDateInfo* pDateInfo = mpDateTable->Get( nKey );
+ if ( pDateInfo )
+ aRet = pDateInfo->maText;
+ }
+ return aRet;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL Calendar::ShowDropPos( const Point& rPos, Date& rDate )
+{
+ Date aTempDate = maCurDate;
+ mnDragScrollHitTest = ImplHitTest( rPos, aTempDate );
+
+ if ( mnDragScrollHitTest )
+ {
+ if ( mnDragScrollHitTest & (CALENDAR_HITTEST_PREV | CALENDAR_HITTEST_NEXT) )
+ {
+ if ( !maDragScrollTimer.IsActive() )
+ maDragScrollTimer.Start();
+ }
+ else
+ {
+ maDragScrollTimer.Stop();
+ if ( mnDragScrollHitTest & CALENDAR_HITTEST_DAY )
+ {
+ if ( !mbDropPos || (aTempDate != maDropDate) )
+ {
+ if( mbDropPos )
+ ImplInvertDropPos();
+ maDropDate = aTempDate;
+ mbDropPos = TRUE;
+ ImplInvertDropPos();
+ }
+
+ rDate = maDropDate;
+ return TRUE;
+ }
+ }
+ }
+ else
+ maDragScrollTimer.Stop();
+
+ HideDropPos();
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::HideDropPos()
+{
+ if ( mbDropPos )
+ {
+ ImplInvertDropPos();
+ mbDropPos = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::StartSelection()
+{
+ if ( mpOldSelectTable )
+ delete mpOldSelectTable;
+ maOldCurDate = maCurDate;
+ mpOldSelectTable = new Table( *mpSelectTable );
+
+ mbSelection = TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+void Calendar::EndSelection()
+{
+ if ( mbDrag || mbSpinDown || mbSelection )
+ {
+ if ( !mbSelection )
+ ReleaseMouse();
+
+ mbDrag = FALSE;
+ mbSelection = FALSE;
+ mbMultiSelection = FALSE;
+ mbSpinDown = FALSE;
+ mbPrevIn = FALSE;
+ mbNextIn = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+Size Calendar::CalcWindowSizePixel( long nCalcMonthPerLine,
+ long nCalcLines ) const
+{
+ XubString a99Text( XubString( RTL_CONSTASCII_USTRINGPARAM( "99" ) ) );
+ Font aOldFont = GetFont();
+
+ // Wochenanzeige beruecksichtigen
+ long nWeekWidth;
+ if ( mnWinStyle & WB_WEEKNUMBER )
+ {
+ Font aTempFont = aOldFont;
+ ImplGetWeekFont( aTempFont );
+ ((Calendar*)this)->SetFont( aTempFont );
+ nWeekWidth = GetTextWidth( a99Text )+WEEKNUMBER_OFFX;
+ ((Calendar*)this)->SetFont( aOldFont );
+ }
+ else
+ nWeekWidth = 0;
+
+ if ( mnWinStyle & WB_BOLDTEXT )
+ {
+ Font aFont = aOldFont;
+ if ( aFont.GetWeight() < WEIGHT_BOLD )
+ aFont.SetWeight( WEIGHT_BOLD );
+ else
+ aFont.SetWeight( WEIGHT_NORMAL );
+ ((Calendar*)this)->SetFont( aFont );
+ }
+
+ Size aSize;
+ long n99TextWidth = GetTextWidth( a99Text );
+ long nTextHeight = GetTextHeight();
+
+ if ( mnWinStyle & WB_BOLDTEXT )
+ ((Calendar*)this)->SetFont( aOldFont );
+
+ aSize.Width() += ((n99TextWidth+DAY_OFFX)*7) + nWeekWidth;
+ aSize.Width() += MONTH_BORDERX*2;
+ aSize.Width() *= nCalcMonthPerLine;
+
+ aSize.Height() = nTextHeight + TITLE_OFFY + (TITLE_BORDERY*2);
+ aSize.Height() += nTextHeight + WEEKDAY_OFFY;
+ aSize.Height() += ((nTextHeight+DAY_OFFY)*6);
+ aSize.Height() += MONTH_OFFY;
+ aSize.Height() *= nCalcLines;
+
+ return aSize;
+}
+
+// =======================================================================
+
+#define CALFIELD_EXTRA_BUTTON_WIDTH 14
+#define CALFIELD_EXTRA_BUTTON_HEIGHT 8
+#define CALFIELD_SEP_X 6
+#define CALFIELD_BORDERLINE_X 5
+#define CALFIELD_BORDER_YTOP 4
+#define CALFIELD_BORDER_Y 5
+
+// =======================================================================
+
+class ImplCFieldFloatWin : public FloatingWindow
+{
+private:
+ Calendar* mpCalendar;
+ PushButton* mpTodayBtn;
+ PushButton* mpNoneBtn;
+ FixedLine* mpFixedLine;
+
+public:
+ ImplCFieldFloatWin( Window* pParent );
+ ~ImplCFieldFloatWin();
+
+ void SetCalendar( Calendar* pCalendar )
+ { mpCalendar = pCalendar; }
+
+ PushButton* EnableTodayBtn( BOOL bEnable );
+ PushButton* EnableNoneBtn( BOOL bEnable );
+ void ArrangeButtons();
+
+ long Notify( NotifyEvent& rNEvt );
+};
+
+// -----------------------------------------------------------------------
+
+ImplCFieldFloatWin::ImplCFieldFloatWin( Window* pParent ) :
+ FloatingWindow( pParent )
+{
+ mpCalendar = NULL;
+ mpTodayBtn = NULL;
+ mpNoneBtn = NULL;
+ mpFixedLine = NULL;
+}
+
+// -----------------------------------------------------------------------
+
+ImplCFieldFloatWin::~ImplCFieldFloatWin()
+{
+ delete mpTodayBtn;
+ delete mpNoneBtn;
+ delete mpFixedLine;
+}
+
+// -----------------------------------------------------------------------
+
+PushButton* ImplCFieldFloatWin::EnableTodayBtn( BOOL bEnable )
+{
+ if ( bEnable )
+ {
+ if ( !mpTodayBtn )
+ {
+ mpTodayBtn = new PushButton( this, WB_NOPOINTERFOCUS );
+ XubString aTodayText( SvtResId( STR_SVT_CALENDAR_TODAY ) );
+ mpTodayBtn->SetText( aTodayText );
+ Size aSize;
+ aSize.Width() = mpTodayBtn->GetCtrlTextWidth( mpTodayBtn->GetText() );
+ aSize.Height() = mpTodayBtn->GetTextHeight();
+ aSize.Width() += CALFIELD_EXTRA_BUTTON_WIDTH;
+ aSize.Height() += CALFIELD_EXTRA_BUTTON_HEIGHT;
+ mpTodayBtn->SetSizePixel( aSize );
+ mpTodayBtn->Show();
+ }
+ }
+ else
+ {
+ if ( mpTodayBtn )
+ {
+ delete mpTodayBtn;
+ mpTodayBtn = NULL;
+ }
+ }
+
+ return mpTodayBtn;
+}
+
+// -----------------------------------------------------------------------
+
+PushButton* ImplCFieldFloatWin::EnableNoneBtn( BOOL bEnable )
+{
+ if ( bEnable )
+ {
+ if ( !mpNoneBtn )
+ {
+ mpNoneBtn = new PushButton( this, WB_NOPOINTERFOCUS );
+ XubString aNoneText( SvtResId( STR_SVT_CALENDAR_NONE ) );
+ mpNoneBtn->SetText( aNoneText );
+ Size aSize;
+ aSize.Width() = mpNoneBtn->GetCtrlTextWidth( mpNoneBtn->GetText() );
+ aSize.Height() = mpNoneBtn->GetTextHeight();
+ aSize.Width() += CALFIELD_EXTRA_BUTTON_WIDTH;
+ aSize.Height() += CALFIELD_EXTRA_BUTTON_HEIGHT;
+ mpNoneBtn->SetSizePixel( aSize );
+ mpNoneBtn->Show();
+ }
+ }
+ else
+ {
+ if ( mpNoneBtn )
+ {
+ delete mpNoneBtn;
+ mpNoneBtn = NULL;
+ }
+ }
+
+ return mpNoneBtn;
+}
+
+// -----------------------------------------------------------------------
+
+void ImplCFieldFloatWin::ArrangeButtons()
+{
+ long nBtnHeight = 0;
+ long nBtnWidth = 0;
+ Size aOutSize = GetOutputSizePixel();
+ if ( mpTodayBtn && mpNoneBtn )
+ {
+ Size aTodayBtnSize = mpTodayBtn->GetSizePixel();
+ Size aNoneBtnSize = mpNoneBtn->GetSizePixel();
+ if ( aTodayBtnSize.Width() < aNoneBtnSize.Width() )
+ aTodayBtnSize.Width() = aNoneBtnSize.Width();
+ else
+ aNoneBtnSize.Width() = aTodayBtnSize.Width();
+ if ( aTodayBtnSize.Height() < aNoneBtnSize.Height() )
+ aTodayBtnSize.Height() = aNoneBtnSize.Height();
+ else
+ aNoneBtnSize.Height() = aTodayBtnSize.Height();
+
+ nBtnWidth = aTodayBtnSize.Width() + aNoneBtnSize.Width() + CALFIELD_SEP_X;
+ nBtnHeight = aTodayBtnSize.Height();
+ long nX = (aOutSize.Width()-nBtnWidth)/2;
+ long nY = aOutSize.Height()+CALFIELD_BORDER_Y+CALFIELD_BORDER_YTOP;
+ mpTodayBtn->SetPosSizePixel( Point( nX, nY ), aTodayBtnSize );
+ nX += aTodayBtnSize.Width() + CALFIELD_SEP_X;
+ mpNoneBtn->SetPosSizePixel( Point( nX, nY ), aNoneBtnSize );
+ }
+ else if ( mpTodayBtn )
+ {
+ Size aTodayBtnSize = mpTodayBtn->GetSizePixel();
+ nBtnWidth = aTodayBtnSize.Width();
+ nBtnHeight = aTodayBtnSize.Height();
+ mpTodayBtn->SetPosPixel( Point( (aOutSize.Width()-nBtnWidth)/2, aOutSize.Height()+CALFIELD_BORDER_Y+CALFIELD_BORDER_YTOP ) );
+ }
+ else if ( mpNoneBtn )
+ {
+ Size aNoneBtnSize = mpNoneBtn->GetSizePixel();
+ nBtnWidth = aNoneBtnSize.Width();
+ nBtnHeight = aNoneBtnSize.Height();
+ mpNoneBtn->SetPosPixel( Point( (aOutSize.Width()-nBtnWidth)/2, aOutSize.Height()+CALFIELD_BORDER_Y+CALFIELD_BORDER_YTOP ) );
+ }
+
+ if ( nBtnHeight )
+ {
+ if ( !mpFixedLine )
+ {
+ mpFixedLine = new FixedLine( this );
+ mpFixedLine->Show();
+ }
+ long nLineWidth = aOutSize.Width()-(CALFIELD_BORDERLINE_X*2);
+ mpFixedLine->SetPosSizePixel( (aOutSize.Width()-nLineWidth)/2, aOutSize.Height()+((CALFIELD_BORDER_YTOP-2)/2),
+ nLineWidth, 2, WINDOW_POSSIZE_POSSIZE );
+ aOutSize.Height() += nBtnHeight + (CALFIELD_BORDER_Y*2) + CALFIELD_BORDER_YTOP;
+ SetOutputSizePixel( aOutSize );
+ }
+ else
+ {
+ if ( mpFixedLine )
+ {
+ delete mpFixedLine;
+ mpFixedLine = NULL;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+long ImplCFieldFloatWin::Notify( NotifyEvent& rNEvt )
+{
+ if ( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
+ if ( pKEvt->GetKeyCode().GetCode() == KEY_RETURN )
+ mpCalendar->Select();
+ }
+
+ return FloatingWindow::Notify( rNEvt );
+}
+
+// =======================================================================
+
+CalendarField::CalendarField( Window* pParent, WinBits nWinStyle ) :
+ DateField( pParent, nWinStyle ),
+ maDefaultDate( 0, 0, 0 )
+{
+ mpFloatWin = NULL;
+ mpCalendar = NULL;
+ mnCalendarStyle = 0;
+ mbToday = FALSE;
+ mbNone = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+CalendarField::CalendarField( Window* pParent, const ResId& rResId ) :
+ DateField( pParent, rResId ),
+ maDefaultDate( 0, 0, 0 )
+{
+ mpFloatWin = NULL;
+ mpCalendar = NULL;
+ mnCalendarStyle = 0;
+ mbToday = FALSE;
+ mbNone = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+CalendarField::~CalendarField()
+{
+ if ( mpFloatWin )
+ {
+ delete mpCalendar;
+ delete mpFloatWin;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( CalendarField, ImplSelectHdl, Calendar*, pCalendar )
+{
+ if ( !pCalendar->IsTravelSelect() )
+ {
+ mpFloatWin->EndPopupMode();
+ EndDropDown();
+ GrabFocus();
+ Date aNewDate = mpCalendar->GetSelectDate( 0 );
+ if ( IsEmptyDate() || ( aNewDate != GetDate() ) )
+ {
+ SetDate( aNewDate );
+ SetModifyFlag();
+ Modify();
+ }
+ Select();
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( CalendarField, ImplClickHdl, PushButton*, pBtn )
+{
+ mpFloatWin->EndPopupMode();
+ EndDropDown();
+ GrabFocus();
+
+ if ( pBtn == mpTodayBtn )
+ {
+ Date aToday;
+ if ( (aToday != GetDate()) || IsEmptyDate() )
+ {
+ SetDate( aToday );
+ SetModifyFlag();
+ Modify();
+ }
+ }
+ else if ( pBtn == mpNoneBtn )
+ {
+ if ( !IsEmptyDate() )
+ {
+ SetEmptyDate();
+ SetModifyFlag();
+ Modify();
+ }
+ }
+ Select();
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( CalendarField, ImplPopupModeEndHdl, FloatingWindow*, EMPTYARG )
+{
+ EndDropDown();
+ GrabFocus();
+ mpCalendar->EndSelection();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void CalendarField::Select()
+{
+ maSelectHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL CalendarField::ShowDropDown( BOOL bShow )
+{
+ if ( bShow )
+ {
+ Calendar* pCalendar = GetCalendar();
+
+ Date aDate = GetDate();
+ if ( IsEmptyDate() || !aDate.IsValid() )
+ {
+ if ( maDefaultDate.IsValid() )
+ aDate = maDefaultDate;
+ else
+ aDate = Date();
+ }
+ if ( pCalendar->GetStyle() & (WB_RANGESELECT | WB_MULTISELECT) )
+ {
+ pCalendar->SetNoSelection();
+ pCalendar->SelectDate( aDate );
+ }
+ pCalendar->SetCurDate( aDate );
+ Point aPos( GetParent()->OutputToScreenPixel( GetPosPixel() ) );
+ Rectangle aRect( aPos, GetSizePixel() );
+ aRect.Bottom() -= 1;
+ mpCalendar->SetOutputSizePixel( mpCalendar->CalcWindowSizePixel() );
+ mpFloatWin->SetOutputSizePixel( mpCalendar->GetSizePixel() );
+ mpFloatWin->SetCalendar( mpCalendar );
+ mpTodayBtn = mpFloatWin->EnableTodayBtn( mbToday );
+ mpNoneBtn = mpFloatWin->EnableNoneBtn( mbNone );
+ if ( mpTodayBtn )
+ mpTodayBtn->SetClickHdl( LINK( this, CalendarField, ImplClickHdl ) );
+ if ( mpNoneBtn )
+ mpNoneBtn->SetClickHdl( LINK( this, CalendarField, ImplClickHdl ) );
+ mpFloatWin->ArrangeButtons();
+ mpCalendar->EnableCallEverySelect();
+ mpCalendar->StartSelection();
+ mpCalendar->GrabFocus();
+ mpCalendar->Show();
+ mpFloatWin->StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN );
+ }
+ else
+ {
+ mpFloatWin->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
+ mpCalendar->EndSelection();
+ EndDropDown();
+ }
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+Calendar* CalendarField::CreateCalendar( Window* pParent )
+{
+ return new Calendar( pParent, mnCalendarStyle | WB_TABSTOP );
+}
+
+// -----------------------------------------------------------------------
+
+Calendar* CalendarField::GetCalendar()
+{
+ if ( !mpFloatWin )
+ {
+ mpFloatWin = new ImplCFieldFloatWin( this );
+ mpFloatWin->SetPopupModeEndHdl( LINK( this, CalendarField, ImplPopupModeEndHdl ) );
+ mpCalendar = CreateCalendar( mpFloatWin );
+ mpCalendar->SetPosPixel( Point() );
+ mpCalendar->SetSelectHdl( LINK( this, CalendarField, ImplSelectHdl ) );
+ }
+
+ return mpCalendar;
+}
diff --git a/svtools/source/control/calendar.src b/svtools/source/control/calendar.src
new file mode 100644
index 000000000000..2919e3d55148
--- /dev/null
+++ b/svtools/source/control/calendar.src
@@ -0,0 +1,166 @@
+/*************************************************************************
+ *
+ * $RCSfile: calendar.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "svtools.hrc"
+String STR_SVT_CALENDAR_DAY
+{
+ Text = "Tag" ;
+ Text [ ENGLISH ] = "Day" ;
+ Text [ english_us ] = "Day" ;
+ Text [ italian ] = "Giorno" ;
+ Text [ spanish ] = "Día" ;
+ Text [ french ] = "Jour" ;
+ Text [ dutch ] = "Dag" ;
+ Text [ swedish ] = "Dag" ;
+ Text [ danish ] = "Dag" ;
+ Text [ portuguese_brazilian ] = "Tag" ;
+ Text [ portuguese ] = "Dia" ;
+ Text[ chinese_simplified ] = "Ìì";
+ Text[ russian ] = "Äåíü";
+ Text[ polish ] = "dzieñ";
+ Text[ japanese ] = "“ú";
+ Text[ chinese_traditional ] = "¤Ñ";
+ Text[ arabic ] = "íæã";
+ Text[ dutch ] = "Dag";
+ Text[ chinese_simplified ] = "Ìì";
+ Text[ greek ] = "ÇìÝñá";
+ Text[ korean ] = "ÀÏÀÚ";
+ Text[ turkish ] = "Gün";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_CALENDAR_WEEK
+{
+ Text = "Woche" ;
+ Text [ ENGLISH ] = "Week" ;
+ Text [ dutch ] = "Week" ;
+ Text [ english_us ] = "Week" ;
+ Text [ italian ] = "Settim." ;
+ Text [ spanish ] = "Semana" ;
+ Text [ french ] = "Semaine" ;
+ Text [ swedish ] = "Vecka" ;
+ Text [ danish ] = "Uge" ;
+ Text [ portuguese ] = "Semana" ;
+ Text [ portuguese_brazilian ] = "Woche" ;
+ Text[ chinese_simplified ] = "ÖÜ";
+ Text[ russian ] = "Íåäåëÿ";
+ Text[ polish ] = "tydzieñ";
+ Text[ japanese ] = "T";
+ Text[ chinese_traditional ] = "©P";
+ Text[ arabic ] = "ÃÓÈæÚ";
+ Text[ dutch ] = "Week";
+ Text[ chinese_simplified ] = "ÖÜ";
+ Text[ greek ] = "ÅâäïìÜäá";
+ Text[ korean ] = "ÁÖ";
+ Text[ turkish ] = "Hafta";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_CALENDAR_TODAY
+{
+ Text = "Heute" ;
+ Text [ ENGLISH ] = "Today" ;
+ Text [ portuguese ] = "Hoje" ;
+ Text [ english_us ] = "Today" ;
+ Text [ portuguese_brazilian ] = "Heute" ;
+ Text [ swedish ] = "Idag" ;
+ Text [ danish ] = "I dag" ;
+ Text [ italian ] = "Oggi" ;
+ Text [ spanish ] = "Hoy" ;
+ Text [ french ] = "Aujourd'hui" ;
+ Text [ dutch ] = "Vandaag" ;
+ Text[ chinese_simplified ] = "½ñÌì";
+ Text[ russian ] = "Ñåãîäíÿ";
+ Text[ polish ] = "dzisiaj";
+ Text[ japanese ] = "¡“ú";
+ Text[ chinese_traditional ] = "¤µ¤Ñ";
+ Text[ arabic ] = "Çáíæã";
+ Text[ dutch ] = "Vandaag";
+ Text[ chinese_simplified ] = "½ñÌì";
+ Text[ greek ] = "ÓÞìåñá";
+ Text[ korean ] = "¿À´Ã";
+ Text[ turkish ] = "Bugün";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_CALENDAR_NONE
+{
+ Text = "Keines" ;
+ Text [ ENGLISH ] = "None" ;
+ Text [ portuguese ] = "Nenhum" ;
+ Text [ english_us ] = "None" ;
+ Text [ portuguese_brazilian ] = "Keines" ;
+ Text [ swedish ] = "Ingen" ;
+ Text [ danish ] = "Ingen" ;
+ Text [ italian ] = "Senza" ;
+ Text [ spanish ] = "Ninguno" ;
+ Text [ french ] = "Aucun(e)" ;
+ Text [ dutch ] = "Geen" ;
+ Text[ chinese_simplified ] = "ÎÞ";
+ Text[ russian ] = "Áåç";
+ Text[ polish ] = "brak";
+ Text[ japanese ] = "‚È‚µ";
+ Text[ chinese_traditional ] = "µL";
+ Text[ arabic ] = "ÈÏæä";
+ Text[ dutch ] = "Geen";
+ Text[ chinese_simplified ] = "ÎÞ";
+ Text[ greek ] = "ÊáíÝíá";
+ Text[ korean ] = "¾øÀ½";
+ Text[ turkish ] = "Yok";
+ Text[ language_user1 ] = " ";
+};
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
new file mode 100644
index 000000000000..2af1f99aeadf
--- /dev/null
+++ b/svtools/source/control/ctrlbox.cxx
@@ -0,0 +1,1227 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrlbox.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _CTRLBOX_CXX
+
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _APP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _FIELD_HXX
+#include <vcl/field.hxx>
+#endif
+
+#include <svtdata.hxx>
+#include <svtools.hrc>
+#include <ctrlbox.hxx>
+#include <ctrltool.hxx>
+
+#define IMGTEXTSPACE 2
+#define SYMBOLFONTTEXT "AbCdEfGhIj"
+#define EXTRAFONTSIZE 5
+
+// ========================================================================
+// ColorListBox
+// ========================================================================
+
+// --------------------
+// - ImplColorListData -
+// --------------------
+
+struct ImplColorListData
+{
+ Color aColor;
+ BOOL bColor;
+
+ ImplColorListData() : aColor( COL_BLACK ) { bColor = FALSE; }
+ ImplColorListData( const Color& rColor ) : aColor( rColor ) { bColor = TRUE; }
+};
+
+DECLARE_LIST( ImpColorList, ImplColorListData* );
+
+// -----------------------------------------------------------------------
+
+void ColorListBox::ImplInit()
+{
+ pColorList = new ImpColorList( 256, 64 );
+ aImageSize.Width() = GetTextWidth( XubString( RTL_CONSTASCII_USTRINGPARAM( "xxx" ) ) );
+ aImageSize.Height() = GetTextHeight();
+ aImageSize.Height() -= 2;
+
+ EnableUserDraw( TRUE );
+ SetUserItemSize( aImageSize );
+}
+
+// -----------------------------------------------------------------------
+
+void ColorListBox::ImplDestroyColorEntries()
+{
+ for ( USHORT n = (USHORT) pColorList->Count(); n; )
+ {
+ ImplColorListData* pData = pColorList->GetObject( --n );
+ delete pData;
+ }
+ pColorList->Clear();
+}
+
+// -----------------------------------------------------------------------
+
+ColorListBox::ColorListBox( Window* pParent, WinBits nWinStyle ) :
+ ListBox( pParent, nWinStyle )
+{
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+ColorListBox::ColorListBox( Window* pParent, const ResId& rResId ) :
+ ListBox( pParent, rResId )
+{
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+ColorListBox::~ColorListBox()
+{
+ ImplDestroyColorEntries();
+ delete pColorList;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ColorListBox::InsertEntry( const XubString& rStr, USHORT nPos )
+{
+ nPos = ListBox::InsertEntry( rStr, nPos );
+ if ( nPos != LISTBOX_ERROR )
+ {
+ ImplColorListData* pData = new ImplColorListData;
+ pColorList->Insert( pData, nPos );
+ }
+ return nPos;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ColorListBox::InsertEntry( const Color& rColor, const XubString& rStr,
+ USHORT nPos )
+{
+ nPos = ListBox::InsertEntry( rStr, nPos );
+ if ( nPos != LISTBOX_ERROR )
+ {
+ ImplColorListData* pData = new ImplColorListData( rColor );
+ pColorList->Insert( pData, nPos );
+ }
+ return nPos;
+}
+
+// -----------------------------------------------------------------------
+
+void ColorListBox::RemoveEntry( USHORT nPos )
+{
+ ListBox::RemoveEntry( nPos );
+ delete pColorList->Remove( nPos );
+}
+
+// -----------------------------------------------------------------------
+
+void ColorListBox::Clear()
+{
+ ImplDestroyColorEntries();
+ ListBox::Clear();
+}
+
+// -----------------------------------------------------------------------
+
+void ColorListBox::CopyEntries( const ColorListBox& rBox )
+{
+ // Liste leeren
+ ImplDestroyColorEntries();
+
+ // Daten kopieren
+ USHORT nCount = (USHORT) rBox.pColorList->Count();
+ for ( USHORT n = 0; n < nCount; n++ )
+ {
+ ImplColorListData* pData = rBox.pColorList->GetObject( n );
+ USHORT nPos = InsertEntry( rBox.GetEntry( n ), LISTBOX_APPEND );
+ if ( nPos != LISTBOX_ERROR )
+ pColorList->Insert( new ImplColorListData( *pData ), nPos );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ColorListBox::GetEntryPos( const Color& rColor ) const
+{
+ for( USHORT n = (USHORT) pColorList->Count(); n; )
+ {
+ ImplColorListData* pData = pColorList->GetObject( --n );
+ if ( pData->bColor && ( pData->aColor == rColor ) )
+ {
+ return n;
+ }
+ }
+ return LISTBOX_ENTRY_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+Color ColorListBox::GetEntryColor( USHORT nPos ) const
+{
+ Color aColor;
+ ImplColorListData* pData = pColorList->GetObject( nPos );
+ if ( pData && pData->bColor )
+ aColor = pData->aColor;
+ return aColor;
+}
+
+// -----------------------------------------------------------------------
+
+void ColorListBox::UserDraw( const UserDrawEvent& rUDEvt )
+{
+ ImplColorListData* pData = pColorList->GetObject( rUDEvt.GetItemId() );
+ if ( pData )
+ {
+ if ( pData->bColor )
+ {
+ Point aPos( rUDEvt.GetRect().TopLeft() );
+ aPos.X() += 2;
+ aPos.Y() += ( rUDEvt.GetRect().GetHeight() - aImageSize.Height() ) / 2;
+ rUDEvt.GetDevice()->Push();
+ rUDEvt.GetDevice()->SetFillColor( pData->aColor );
+ rUDEvt.GetDevice()->SetLineColor( COL_BLACK );
+ rUDEvt.GetDevice()->DrawRect( Rectangle( aPos, aImageSize ) );
+ rUDEvt.GetDevice()->Pop();
+ ListBox::DrawEntry( rUDEvt, FALSE, TRUE, FALSE );
+ }
+ else
+ {
+ ListBox::DrawEntry( rUDEvt, FALSE, TRUE, TRUE );
+ }
+ }
+ else
+ {
+ ListBox::DrawEntry( rUDEvt, TRUE, TRUE, FALSE );
+ }
+}
+
+// =======================================================================
+// LineListBox
+// =======================================================================
+
+// -------------------
+// - ImpListListData -
+// -------------------
+
+struct ImpLineListData
+{
+ long nLine1;
+ long nLine2;
+ long nDistance;
+};
+
+DECLARE_LIST( ImpLineList, ImpLineListData* );
+
+// -----------------------------------------------------------------------
+
+void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance,
+ Bitmap& rBmp, XubString& rStr )
+{
+ Size aSize = GetOutputSizePixel();
+ aSize.Width() -= 20;
+ aSize.Width() -= aTxtSize.Width();
+ aSize.Height() = aTxtSize.Height();
+
+ // SourceUnit nach Twips
+ if ( eSourceUnit == FUNIT_POINT )
+ {
+ nLine1 *= 20;
+ nLine2 *= 20;
+ nDistance *= 20;
+ }
+ else if ( eSourceUnit == FUNIT_MM )
+ {
+ nLine1 *= 14440;
+ nLine1 /= 254;
+ nLine2 *= 14440;
+ nLine2 /= 254;
+ nDistance *= 14440;
+ nDistance /= 254;
+ }
+
+ // Linien malen
+ aSize = aVirDev.PixelToLogic( aSize );
+ long nPix = aVirDev.PixelToLogic( Size( 0, 1 ) ).Height();
+ long n1 = nLine1 / 100;
+ long n2 = nLine2 / 100;
+ long nDist = nDistance / 100;
+ n1 += nPix-1;
+ n1 -= n1%nPix;
+ if ( n2 )
+ {
+ nDist += nPix-1;
+ nDist -= nDist%nPix;
+ n2 += nPix-1;
+ n2 -= n2%nPix;
+ }
+ long nVirHeight = n1+nDist+n2;
+ if ( nVirHeight > aSize.Height() )
+ aSize.Height() = nVirHeight;
+ // negative Breiten muss und darf man nicht painten
+ if ( aSize.Width() > 0 )
+ {
+ Size aVirSize = aVirDev.LogicToPixel( aSize );
+ if ( aVirDev.GetOutputSizePixel() != aVirSize )
+ aVirDev.SetOutputSizePixel( aVirSize );
+ aVirDev.SetFillColor( GetSettings().GetStyleSettings().GetFieldColor() );
+ aVirDev.DrawRect( Rectangle( Point(), aSize ) );
+ aVirDev.SetFillColor( aColor );
+ aVirDev.DrawRect( Rectangle( 0, 0, aSize.Width(), n1-nPix ) );
+ if ( n2 )
+ {
+ aVirDev.DrawRect( Rectangle( 0, n1+nDist,
+ aSize.Width(), n1+nDist+n2-nPix ) );
+ }
+ rBmp = aVirDev.GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) );
+ }
+ // Twips nach Unit
+ if ( eUnit == FUNIT_POINT )
+ {
+ nLine1 /= 20;
+ nLine2 /= 20;
+ nDistance /= 20;
+ rStr.AssignAscii( " pt" );
+ }
+ else if ( eUnit == FUNIT_MM )
+ {
+ nLine1 *= 254;
+ nLine1 /= 14400;
+ nLine2 *= 254;
+ nLine2 /= 14400;
+ nDistance *= 254;
+ nDistance /= 14400;
+ rStr.AssignAscii( " mm" );
+ }
+
+ rStr.Insert( aIntn.GetNum( nLine1+nLine2+nDistance, 2 ), 0 );
+}
+
+// -----------------------------------------------------------------------
+
+void LineListBox::ImplInit()
+{
+ aTxtSize.Width() = GetTextWidth( XubString( RTL_CONSTASCII_USTRINGPARAM( "99,99 mm" ) ) );
+ aTxtSize.Height() = GetTextHeight();
+ pLineList = new ImpLineList;
+ eUnit = FUNIT_POINT;
+ eSourceUnit = FUNIT_POINT;
+
+ aVirDev.SetLineColor();
+ aVirDev.SetMapMode( MapMode( MAP_TWIP ) );
+}
+
+// -----------------------------------------------------------------------
+
+LineListBox::LineListBox( Window* pParent, WinBits nWinStyle ) :
+ ListBox( pParent, nWinStyle ),
+ aIntn( Application::GetAppInternational() ),
+ aColor( COL_BLACK )
+{
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+LineListBox::LineListBox( Window* pParent, const ResId& rResId ) :
+ ListBox( pParent, rResId ),
+ aIntn( Application::GetAppInternational() ),
+ aColor( COL_BLACK )
+{
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+LineListBox::~LineListBox()
+{
+ ULONG n = 0;
+ ULONG nCount = pLineList->Count();
+ while ( n < nCount )
+ {
+ ImpLineListData* pData = pLineList->GetObject( n );
+ if ( pData )
+ delete pData;
+ n++;
+ }
+ delete pLineList;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT LineListBox::InsertEntry( const XubString& rStr, USHORT nPos )
+{
+ nPos = ListBox::InsertEntry( rStr, nPos );
+ if ( nPos != LISTBOX_ERROR )
+ pLineList->Insert( NULL, nPos );
+ return nPos;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT LineListBox::InsertEntry( long nLine1, long nLine2, long nDistance,
+ USHORT nPos )
+{
+ XubString aStr;
+ Bitmap aBmp;
+ ImpGetLine( nLine1, nLine2, nDistance, aBmp, aStr );
+ nPos = ListBox::InsertEntry( aStr, aBmp, nPos );
+ if ( nPos != LISTBOX_ERROR )
+ {
+ ImpLineListData* pData = new ImpLineListData;
+ pData->nLine1 = nLine1;
+ pData->nLine2 = nLine2;
+ pData->nDistance = nDistance;
+ pLineList->Insert( pData, nPos );
+ }
+
+ return nPos;
+}
+
+// -----------------------------------------------------------------------
+
+void LineListBox::RemoveEntry( USHORT nPos )
+{
+ ListBox::RemoveEntry( nPos );
+ ImpLineListData* pData = pLineList->Remove( nPos );
+ if ( pData )
+ delete pData;
+}
+
+// -----------------------------------------------------------------------
+
+void LineListBox::Clear()
+{
+ ULONG n = 0;
+ ULONG nCount = pLineList->Count();
+ while ( n < nCount )
+ {
+ ImpLineListData* pData = pLineList->GetObject( n );
+ if ( pData )
+ delete pData;
+ n++;
+ }
+
+ pLineList->Clear();
+ ListBox::Clear();
+}
+
+// -----------------------------------------------------------------------
+
+USHORT LineListBox::GetEntryPos( long nLine1, long nLine2,
+ long nDistance ) const
+{
+ ULONG n = 0;
+ ULONG nCount = pLineList->Count();
+ while ( n < nCount )
+ {
+ ImpLineListData* pData = pLineList->GetObject( n );
+ if ( pData )
+ {
+ if ( (pData->nLine1 == nLine1) &&
+ (pData->nLine2 == nLine2) &&
+ (pData->nDistance == nDistance) )
+ return (USHORT)n;
+ }
+
+ n++;
+ }
+
+ return LISTBOX_ENTRY_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+long LineListBox::GetEntryLine1( USHORT nPos ) const
+{
+ ImpLineListData* pData = pLineList->GetObject( nPos );
+ if ( pData )
+ return pData->nLine1;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+long LineListBox::GetEntryLine2( USHORT nPos ) const
+{
+ ImpLineListData* pData = pLineList->GetObject( nPos );
+ if ( pData )
+ return pData->nLine2;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+long LineListBox::GetEntryDistance( USHORT nPos ) const
+{
+ ImpLineListData* pData = pLineList->GetObject( nPos );
+ if ( pData )
+ return pData->nDistance;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void LineListBox::SetColor( const Color& rColor )
+{
+ // Farben austauschen
+ aColor = rColor;
+
+ // Variablen anlegen
+ ULONG n = 0;
+ ULONG nCount = pLineList->Count();
+ if ( !nCount )
+ return;
+
+ XubString aStr;
+ Bitmap aBmp;
+
+ // Eintrage mit Linien austauschen
+ SetUpdateMode( FALSE );
+ USHORT nSelEntry = GetSelectEntryPos();
+ while ( n < nCount )
+ {
+ ImpLineListData* pData = pLineList->GetObject( n );
+ if ( pData )
+ {
+ // ListBox-Daten austauschen
+ ListBox::RemoveEntry( (USHORT)n );
+ ImpGetLine( pData->nLine1, pData->nLine2, pData->nDistance,
+ aBmp, aStr );
+ ListBox::InsertEntry( aStr, aBmp, (USHORT)n );
+ }
+
+ n++;
+ }
+
+ if ( nSelEntry != LISTBOX_ENTRY_NOTFOUND )
+ SelectEntryPos( nSelEntry );
+
+ SetUpdateMode( TRUE );
+ Invalidate();
+}
+
+// ===================================================================
+// FontNameBox
+// ===================================================================
+
+struct ImplFontNameListData
+{
+ FontInfo maInfo;
+ USHORT mnType;
+
+ ImplFontNameListData( const FontInfo& rInfo,
+ USHORT nType ) :
+ maInfo( rInfo ),
+ mnType( nType )
+ {}
+};
+
+DECLARE_LIST( ImplFontList, ImplFontNameListData* );
+
+// -------------------------------------------------------------------
+
+FontNameBox::FontNameBox( Window* pParent, WinBits nWinStyle ) :
+ ComboBox( pParent, nWinStyle ),
+ maImagePrinterFont( SvtResId( RID_IMG_PRINTERFONT ) ),
+ maImageBitmapFont( SvtResId( RID_IMG_BITMAPFONT ) ),
+ maImageScalableFont( SvtResId( RID_IMG_SCALABLEFONT ) )
+{
+ mpFontList = NULL;
+ mbWYSIWYG = FALSE;
+ mbSymbols = FALSE;
+}
+
+// -------------------------------------------------------------------
+
+FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) :
+ ComboBox( pParent, rResId ),
+ maImagePrinterFont( SvtResId( RID_IMG_PRINTERFONT ) ),
+ maImageBitmapFont( SvtResId( RID_IMG_BITMAPFONT ) ),
+ maImageScalableFont( SvtResId( RID_IMG_SCALABLEFONT ) )
+{
+ mpFontList = NULL;
+ mbWYSIWYG = FALSE;
+ mbSymbols = FALSE;
+}
+
+// -------------------------------------------------------------------
+
+FontNameBox::~FontNameBox()
+{
+ ImplDestroyFontList();
+}
+
+// -------------------------------------------------------------------
+
+void FontNameBox::ImplDestroyFontList()
+{
+ if ( mpFontList )
+ {
+ ImplFontNameListData* pInfo = mpFontList->First();
+ while ( pInfo )
+ {
+ delete pInfo;
+ pInfo = mpFontList->Next();
+ }
+ delete mpFontList;
+ }
+}
+
+// -------------------------------------------------------------------
+
+void FontNameBox::Fill( const FontList* pList )
+{
+ // Vorherigen Namen merken und Box loeschen
+ XubString aOldText = GetText();
+ Clear();
+
+ ImplDestroyFontList();
+ mpFontList = new ImplFontList;
+
+ // Fonts eintragen
+ USHORT nFontCount = pList->GetFontNameCount();
+ for ( USHORT i = 0; i < nFontCount; i++ )
+ {
+ const FontInfo& rFontInfo = pList->GetFontName( i );
+ ULONG nIndex = InsertEntry( rFontInfo.GetName() );
+ if ( nIndex != LISTBOX_ERROR )
+ {
+ USHORT nType = pList->GetFontNameType( i );
+ ImplFontNameListData* pData = new ImplFontNameListData( rFontInfo, nType );
+ mpFontList->Insert( pData, nIndex );
+ }
+ }
+
+ ImplCalcUserItemSize();
+
+ // Text wieder setzen
+ if ( aOldText.Len() )
+ SetText( aOldText );
+}
+
+// -------------------------------------------------------------------
+
+void FontNameBox::EnableWYSIWYG( BOOL bEnable )
+{
+ if ( bEnable != mbWYSIWYG )
+ {
+ mbWYSIWYG = bEnable;
+ EnableUserDraw( mbWYSIWYG | mbSymbols );
+ ImplCalcUserItemSize();
+ }
+}
+
+// -------------------------------------------------------------------
+
+void FontNameBox::EnableSymbols( BOOL bEnable )
+{
+ if ( bEnable != mbSymbols )
+ {
+ mbSymbols = bEnable;
+ EnableUserDraw( mbWYSIWYG | mbSymbols );
+ ImplCalcUserItemSize();
+ }
+}
+
+// -------------------------------------------------------------------
+
+void FontNameBox::ImplCalcUserItemSize()
+{
+ Size aUserItemSz;
+ if ( mbWYSIWYG && mpFontList )
+ {
+ USHORT nMaxLen = 0;
+ BOOL bSymbolFont = FALSE;
+ for ( USHORT n = GetEntryCount(); n; )
+ {
+ ImplFontNameListData* pData = mpFontList->GetObject( --n );
+ XubString aFontName = pData->maInfo.GetName();
+ if ( aFontName.Len() > nMaxLen )
+ nMaxLen = aFontName.Len();
+ if ( pData->maInfo.GetCharSet() == RTL_TEXTENCODING_SYMBOL )
+ bSymbolFont = TRUE;
+ }
+
+ // Maximale Breite schaetzen
+ Size aOneCharSz( GetTextWidth( XubString( 'X' ) ), GetTextHeight() );
+ Size aSz( aOneCharSz );
+ aSz.Width() *= nMaxLen;
+ // Nur XX% der Breite, weil die ListBox die normalen Breiten berechnet...
+ aSz.Width() *= 1;
+ aSz.Width() /= 10;
+ if ( bSymbolFont )
+ aSz.Width() += (sizeof( SYMBOLFONTTEXT )-1) * aOneCharSz.Width();
+ aSz.Height() *= 14;
+ aSz.Height() /= 10;
+ aUserItemSz = aSz;
+ }
+ if ( mbSymbols )
+ {
+ Size aSz = maImageScalableFont.GetSizePixel();
+ aUserItemSz.Width() += aSz.Width() + IMGTEXTSPACE;
+ if ( aSz.Height() > aUserItemSz.Height() )
+ aUserItemSz.Height() = aSz.Height();
+ }
+ SetUserItemSize( aUserItemSz );
+}
+
+// -------------------------------------------------------------------
+
+void FontNameBox::UserDraw( const UserDrawEvent& rUDEvt )
+{
+ ImplFontNameListData* pData = mpFontList->GetObject( rUDEvt.GetItemId() );
+ const FontInfo& rInfo = pData->maInfo;
+ USHORT nType = pData->mnType;
+ Point aTopLeft = rUDEvt.GetRect().TopLeft();
+ long nX = aTopLeft.X();
+ long nH = rUDEvt.GetRect().GetHeight();
+
+ if ( mbSymbols )
+ {
+ nX += IMGTEXTSPACE;
+ Image* pImg = NULL;
+ if ( (nType & (FONTLIST_FONTNAMETYPE_PRINTER | FONTLIST_FONTNAMETYPE_SCREEN)) == FONTLIST_FONTNAMETYPE_PRINTER )
+ pImg = &maImagePrinterFont;
+ else if ( nType & FONTLIST_FONTNAMETYPE_SCALABLE )
+ pImg = &maImageScalableFont;
+ else
+ pImg = &maImageBitmapFont;
+
+ if ( pImg )
+ {
+ Point aPos( nX, aTopLeft.Y() + (nH-pImg->GetSizePixel().Height())/2 );
+ rUDEvt.GetDevice()->DrawImage( aPos, *pImg );
+ }
+
+ // X immer um gleiche Breite aendern, auch wenn kein Image ausgegeben.
+ nX += maImagePrinterFont.GetSizePixel().Width();
+ }
+
+ if ( mbWYSIWYG && mpFontList )
+ {
+ nX += IMGTEXTSPACE;
+ BOOL bSymbolFont = rInfo.GetCharSet() == RTL_TEXTENCODING_SYMBOL;
+ if ( bSymbolFont )
+ {
+ XubString aText( rInfo.GetName() );
+ aText.AppendAscii( " " );
+ Point aPos( nX, aTopLeft.Y() + (nH-rUDEvt.GetDevice()->GetTextHeight())/2 );
+ rUDEvt.GetDevice()->DrawText( aPos, aText );
+ nX += rUDEvt.GetDevice()->GetTextWidth( aText );
+ }
+
+ Color aTextColor = rUDEvt.GetDevice()->GetTextColor();
+ Font aOldFont( rUDEvt.GetDevice()->GetFont() );
+ Size aSz( aOldFont.GetSize() );
+ aSz.Height() += EXTRAFONTSIZE;
+ Font aFont( rInfo );
+ aFont.SetSize( aSz );
+ rUDEvt.GetDevice()->SetFont( aFont );
+ rUDEvt.GetDevice()->SetTextColor( aTextColor );
+ long nTextHeight = rUDEvt.GetDevice()->GetTextHeight();
+ Point aPos( nX, aTopLeft.Y() + (nH-nTextHeight)/2 );
+ if ( bSymbolFont )
+ rUDEvt.GetDevice()->DrawText( aPos, XubString( RTL_CONSTASCII_USTRINGPARAM( SYMBOLFONTTEXT ) ) );
+ else
+ rUDEvt.GetDevice()->DrawText( aPos, rInfo.GetName() );
+ rUDEvt.GetDevice()->SetFont( aOldFont );
+ DrawEntry( rUDEvt, FALSE, FALSE); // Separator
+ }
+ else
+ {
+ DrawEntry( rUDEvt, TRUE, TRUE );
+ }
+}
+
+// ===================================================================
+// FontStyleBox
+// ===================================================================
+
+FontStyleBox::FontStyleBox( Window* pParent, WinBits nWinStyle ) :
+ ComboBox( pParent, nWinStyle )
+{
+}
+
+// -------------------------------------------------------------------
+
+FontStyleBox::FontStyleBox( Window* pParent, const ResId& rResId ) :
+ ComboBox( pParent, rResId )
+{
+ aLastStyle = GetText();
+}
+
+// -------------------------------------------------------------------
+
+FontStyleBox::~FontStyleBox()
+{
+}
+
+// -------------------------------------------------------------------
+
+void FontStyleBox::Select()
+{
+ // Damit Text nach einem Fill erhalten bleibt
+ aLastStyle = GetText();
+ ComboBox::Select();
+}
+
+// -------------------------------------------------------------------
+
+void FontStyleBox::LoseFocus()
+{
+ // Damit Text nach einem Fill erhalten bleibt
+ aLastStyle = GetText();
+ ComboBox::LoseFocus();
+}
+
+// -------------------------------------------------------------------
+
+void FontStyleBox::Modify()
+{
+ International aIntn = Application::GetAppInternational();
+ XubString aStr = GetText();
+ USHORT nEntryCount = GetEntryCount();
+
+ if ( GetEntryPos( aStr ) == COMBOBOX_ENTRY_NOTFOUND )
+ {
+ aIntn.ToUpper( aStr );
+ for ( USHORT i = 0; i < nEntryCount; i++ )
+ {
+ XubString aEntryText = GetEntry( i );
+ aIntn.ToUpper( aEntryText );
+
+ if ( aStr == aEntryText )
+ {
+ SetText( GetEntry( i ) );
+ break;
+ }
+ }
+ }
+
+ ComboBox::Modify();
+}
+
+// -------------------------------------------------------------------
+
+void FontStyleBox::Fill( const XubString& rName, const FontList* pList )
+{
+ // Achtung: In dieser Methode muss ComboBox::SetText() aufgerufen werden,
+ // da sonst aLastStyle ueberschrieben wird
+ // Vorherige Position merken und Box loeschen
+ XubString aOldText = GetText();
+ USHORT nPos = GetEntryPos( aOldText );
+ Clear();
+
+ // Existiert ein Font mit diesem Namen
+ sal_Handle hFontInfo = pList->GetFirstFontInfo( rName );
+ if ( hFontInfo )
+ {
+ BOOL bFound = FALSE;
+ BOOL bNormal = FALSE;
+ BOOL bItalic = FALSE;
+ BOOL bBold = FALSE;
+ BOOL bBoldItalic = FALSE;
+ FontInfo aInfo;
+ while ( hFontInfo )
+ {
+ aInfo = pList->GetFontInfo( hFontInfo );
+
+ XubString aStyleText = pList->GetStyleName( aInfo );
+ FontWeight eWeight = aInfo.GetWeight();
+ FontItalic eItalic = aInfo.GetItalic();
+ if ( eWeight <= WEIGHT_NORMAL )
+ {
+ bNormal = TRUE;
+ if ( eItalic != ITALIC_NONE )
+ bItalic = TRUE;
+ }
+ else
+ {
+ if ( eItalic != ITALIC_NONE )
+ bBoldItalic = TRUE;
+ else
+ bBold = TRUE;
+ }
+ if ( aStyleText == pList->GetItalicStr() )
+ bItalic = TRUE;
+ else if ( aStyleText == pList->GetBoldStr() )
+ bBold = TRUE;
+ else if ( aStyleText == pList->GetBoldItalicStr() )
+ bBoldItalic = TRUE;
+ if ( !bFound && (aStyleText == aLastStyle) )
+ bFound = TRUE;
+
+ // Falls doch mal doppelte Strings kommen, dann
+ // nach Moeglichkeit abfangen
+ if ( GetEntryPos( aStyleText ) == LISTBOX_ENTRY_NOTFOUND )
+ InsertEntry( aStyleText );
+
+ hFontInfo = pList->GetNextFontInfo( hFontInfo );
+ }
+
+ // Bestimmte Styles als Nachbildung
+ if ( bNormal )
+ {
+ if ( !bItalic )
+ {
+ if ( !bFound && (aLastStyle == pList->GetItalicStr()) )
+ bFound = TRUE;
+ InsertEntry( pList->GetItalicStr() );
+ }
+ if ( !bBold )
+ {
+ if ( !bFound && (aLastStyle == pList->GetBoldStr()) )
+ bFound = TRUE;
+ InsertEntry( pList->GetBoldStr() );
+ }
+ }
+ if ( !bBoldItalic )
+ {
+ if ( bNormal || bItalic || bBold )
+ {
+ if ( !bFound && (aLastStyle == pList->GetBoldItalicStr()) )
+ bFound = TRUE;
+ InsertEntry( pList->GetBoldItalicStr() );
+ }
+ }
+ if ( aOldText.Len() )
+ {
+ if ( bFound )
+ ComboBox::SetText( aLastStyle );
+ else
+ {
+ if ( nPos >= GetEntryCount() )
+ ComboBox::SetText( GetEntry( 0 ) );
+ else
+ ComboBox::SetText( GetEntry( nPos ) );
+ }
+ }
+ }
+ else
+ {
+ // Wenn Font nicht, dann Standard-Styles einfuegen
+ InsertEntry( pList->GetNormalStr() );
+ InsertEntry( pList->GetItalicStr() );
+ InsertEntry( pList->GetBoldStr() );
+ InsertEntry( pList->GetBoldItalicStr() );
+ if ( aOldText.Len() )
+ {
+ if ( nPos > GetEntryCount() )
+ ComboBox::SetText( GetEntry( 0 ) );
+ else
+ ComboBox::SetText( GetEntry( nPos ) );
+ }
+ }
+}
+
+// ===================================================================
+// FontSizeBox
+// ===================================================================
+
+FontSizeBox::FontSizeBox( Window* pParent, WinBits nWinSize ) :
+ MetricBox( pParent, nWinSize )
+{
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+FontSizeBox::FontSizeBox( Window* pParent, const ResId& rResId ) :
+ MetricBox( pParent, rResId )
+{
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+FontSizeBox::~FontSizeBox()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeBox::ImplInit()
+{
+ EnableAutocomplete( FALSE );
+
+ bRelativeMode = FALSE;
+ bPtRelative = FALSE;
+ bRelative = FALSE;
+ bStdSize = FALSE;
+ pFontList = NULL;
+
+ International aIntn = GetInternational();
+ aIntn.SetNumTrailingZeros( FALSE );
+ SetInternational( aIntn );
+
+ SetDecimalDigits( 1 );
+ SetMin( 20 );
+ SetMax( 9999 );
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeBox::Modify()
+{
+ MetricBox::Modify();
+
+ if ( bRelativeMode )
+ {
+ XubString aStr = GetText();
+ aStr.EraseLeadingChars();
+
+ BOOL bNewMode = bRelative;
+ BOOL bOldPtRelMode = bPtRelative;
+
+ if ( bRelative )
+ {
+ bPtRelative = FALSE;
+ const xub_Unicode* pStr = aStr.GetBuffer();
+ while ( *pStr )
+ {
+ if ( ((*pStr < '0') || (*pStr > '9')) && (*pStr != '%') )
+ {
+ if ( ('-' == *pStr || '+' == *pStr) && !bPtRelative )
+ bPtRelative = TRUE;
+ else if ( bPtRelative && 'p' == *pStr && 't' == *++pStr )
+ ;
+ else
+ {
+ bNewMode = FALSE;
+ break;
+ }
+ }
+ pStr++;
+ }
+ }
+ else
+ {
+ if ( STRING_NOTFOUND != aStr.Search( '%' ) )
+ {
+ bNewMode = TRUE;
+ bPtRelative = FALSE;
+ }
+
+ if ( '-' == aStr.GetChar( 0 ) || '+' == aStr.GetChar( 0 ) )
+ {
+ bNewMode = TRUE;
+ bPtRelative = TRUE;
+ }
+ }
+
+ if ( bNewMode != bRelative || bPtRelative != bOldPtRelMode )
+ SetRelative( bNewMode );
+
+ MetricBox::Modify();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeBox::Fill( const FontInfo& rInfo, const FontList* pList )
+{
+ // Merken fuer Relative-Mode
+ aFontInfo = rInfo;
+ pFontList = pList;
+
+ // Im Relative-Mode, muessen keine Fontgroessen gesetzt werden
+ if ( bRelative )
+ return;
+
+ // Fontgroessen abfragen
+ const long* pAry = pList->GetSizeAry( rInfo );
+
+ // Wenn es das Array mit den Standardgroessen ist, muessen wir im
+ // Normalfall die ListBox nicht neu fuellen
+ if ( (pAry == pList->GetStdSizeAry()) && GetEntryCount() )
+ {
+ if ( bStdSize )
+ return;
+ bStdSize = TRUE;
+ }
+ else
+ bStdSize = FALSE;
+
+ Selection aSelection = GetSelection();
+ XubString aStr = GetText();
+
+ Clear();
+
+ while ( *pAry )
+ {
+ InsertValue( *pAry );
+ pAry++;
+ }
+
+ SetText( aStr );
+ SetSelection( aSelection );
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeBox::EnableRelativeMode( USHORT nMin, USHORT nMax, USHORT nStep )
+{
+ bRelativeMode = TRUE;
+ nRelMin = nMin;
+ nRelMax = nMax;
+ nRelStep = nStep;
+ SetUnit( FUNIT_POINT );
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeBox::EnablePtRelativeMode( short nMin, short nMax, short nStep )
+{
+ bRelativeMode = TRUE;
+ nPtRelMin = nMin;
+ nPtRelMax = nMax;
+ nPtRelStep = nStep;
+ SetUnit( FUNIT_POINT );
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeBox::SetRelative( BOOL bNewRelative )
+{
+ if ( bRelativeMode )
+ {
+ Selection aSelection = GetSelection();
+ XubString aStr = GetText();
+ aStr.EraseLeadingChars();
+
+ if ( bNewRelative )
+ {
+ bRelative = TRUE;
+ bStdSize = FALSE;
+
+ if ( bPtRelative )
+ {
+ SetDecimalDigits( 1 );
+ SetMin( nPtRelMin );
+ SetMax( nPtRelMax );
+ SetUnit( FUNIT_POINT );
+
+ Clear();
+ short i = nPtRelMin, n = 0;
+ // JP 30.06.98: mehr als 100 Werte machen keinen Sinn
+ while ( i <= nPtRelMax && n++ < 100 )
+ {
+ InsertValue( i );
+ i += nPtRelStep;
+ }
+ }
+ else
+ {
+ SetDecimalDigits( 0 );
+ SetMin( nRelMin );
+ SetMax( nRelMax );
+ SetCustomUnitText( '%' );
+ SetUnit( FUNIT_CUSTOM );
+
+ Clear();
+ USHORT i = nRelMin;
+ while ( i <= nRelMax )
+ {
+ InsertValue( i );
+ i += nRelStep;
+ }
+ }
+ }
+ else
+ {
+ bRelative = bPtRelative = FALSE;
+ SetDecimalDigits( 1 );
+ SetMin( 20 );
+ SetMax( 9999 );
+ SetUnit( FUNIT_POINT );
+ if ( pFontList )
+ Fill( aFontInfo, pFontList );
+ }
+
+ SetText( aStr );
+ SetSelection( aSelection );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+XubString FontSizeBox::CreateFieldText( long nValue ) const
+{
+ XubString sRet( MetricBox::CreateFieldText( nValue ) );
+ if ( bRelativeMode && bPtRelative && (0 <= nValue) && sRet.Len() )
+ sRet.Insert( '+', 0 );
+ return sRet;
+}
diff --git a/svtools/source/control/ctrlbox.src b/svtools/source/control/ctrlbox.src
new file mode 100644
index 000000000000..db8eb8810ec7
--- /dev/null
+++ b/svtools/source/control/ctrlbox.src
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrlbox.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "svtools.hrc"
+
+#ifndef IMAGE_STDBTN_COLOR
+#define IMAGE_STDBTN_COLOR Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }
+#endif
+
+
+IMAGE RID_IMG_SCALABLEFONT
+{
+ ImageBitmap = Bitmap { File = "scalfont.bmp" ; };
+ MaskColor = IMAGE_STDBTN_COLOR ;
+};
+
+IMAGE RID_IMG_PRINTERFONT
+{
+ ImageBitmap = Bitmap { File = "prnfont.bmp" ; };
+ MaskColor = IMAGE_STDBTN_COLOR ;
+};
+
+IMAGE RID_IMG_BITMAPFONT
+{
+ ImageBitmap = Bitmap { File = "bmpfont.bmp" ; };
+ MaskColor = IMAGE_STDBTN_COLOR ;
+};
+
diff --git a/svtools/source/control/ctrldll.cxx b/svtools/source/control/ctrldll.cxx
new file mode 100644
index 000000000000..19c26d4e80cf
--- /dev/null
+++ b/svtools/source/control/ctrldll.cxx
@@ -0,0 +1,112 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrldll.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef WIN
+
+#ifndef _SVWIN_H
+#include <svwin.h>
+#endif
+
+#ifndef _SYSDEP_HXX
+#include <sysdep.hxx>
+#endif
+
+// Statische DLL-Verwaltungs-Variablen
+static HINSTANCE hDLLInst = 0; // HANDLE der DLL
+
+/***************************************************************************
+|*
+|* LibMain()
+|*
+|* Beschreibung Initialisierungsfunktion der DLL
+|* Ersterstellung TH 05.05.93
+|* Letzte Aenderung TH 05.05.93
+|*
+***************************************************************************/
+
+extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
+{
+#ifndef WNT
+ if ( nHeap )
+ UnlockData( 0 );
+#endif
+
+ hDLLInst = hDLL;
+
+ return TRUE;
+}
+
+/***************************************************************************
+|*
+|* WEP()
+|*
+|* Beschreibung DLL-Deinitialisierung
+|* Ersterstellung TH 05.05.93
+|* Letzte Aenderung TH 05.05.93
+|*
+***************************************************************************/
+
+extern "C" int CALLBACK WEP( int )
+{
+ return 1;
+}
+
+#endif
diff --git a/svtools/source/control/ctrltool.cxx b/svtools/source/control/ctrltool.cxx
new file mode 100644
index 000000000000..ed38c9cc7a93
--- /dev/null
+++ b/svtools/source/control/ctrltool.cxx
@@ -0,0 +1,865 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrltool.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define CTRLTOOL_CXX
+
+#include <string.h>
+
+#ifndef TOOLS_INTN_HXX
+#include <tools/intn.hxx>
+#endif
+#ifndef TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _VCL_WINDOW_HXX
+#include <vcl/window.hxx>
+#endif
+#ifndef _VCL_SYSTEM_HXX
+#include <vcl/system.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_WRKWIN_HXX
+#include <vcl/wrkwin.hxx>
+#endif
+
+#define private public
+
+#include <svtools.hrc>
+#include <svtdata.hxx>
+#include <ctrltool.hxx>
+
+// =======================================================================
+
+// Standard Fontgroessen fuer scalierbare Fonts
+static long aStdSizeAry[] =
+{
+ 60,
+ 70,
+ 80,
+ 90,
+ 100,
+ 110,
+ 120,
+ 140,
+ 160,
+ 180,
+ 200,
+ 220,
+ 240,
+ 260,
+ 280,
+ 320,
+ 360,
+ 400,
+ 440,
+ 480,
+ 540,
+ 600,
+ 660,
+ 720,
+ 800,
+ 880,
+ 960,
+ 0
+};
+
+// =======================================================================
+
+// -----------------------------
+// - class ImplFontListFonInfo -
+// -----------------------------
+
+class ImplFontListFontInfo : public FontInfo
+{
+ friend class FontList;
+
+private:
+ OutputDevice* mpDevice;
+ ImplFontListFontInfo* mpNext;
+
+public:
+ ImplFontListFontInfo( const FontInfo& rInfo,
+ OutputDevice* pDev ) :
+ FontInfo( rInfo )
+ {
+ mpDevice = pDev;
+ }
+
+ OutputDevice* GetDevice() const { return mpDevice; }
+};
+
+// ------------------------------
+// - class ImplFontListNameInfo -
+// ------------------------------
+
+class ImplFontListNameInfo
+{
+ friend class FontList;
+
+private:
+ XubString maSearchName;
+ ImplFontListFontInfo* mpFirst;
+ USHORT mnType;
+
+ ImplFontListNameInfo( const XubString& rSearchName ) :
+ maSearchName( rSearchName )
+ {}
+
+ const XubString& GetSearchName() const { return maSearchName; }
+};
+
+// =======================================================================
+
+static StringCompare ImplCompareFontInfo( ImplFontListFontInfo* pInfo1,
+ ImplFontListFontInfo* pInfo2 )
+{
+ if ( pInfo1->GetWeight() < pInfo2->GetWeight() )
+ return COMPARE_LESS;
+ else if ( pInfo1->GetWeight() > pInfo2->GetWeight() )
+ return COMPARE_GREATER;
+
+ if ( pInfo1->GetItalic() < pInfo2->GetItalic() )
+ return COMPARE_LESS;
+ else if ( pInfo1->GetItalic() > pInfo2->GetItalic() )
+ return COMPARE_GREATER;
+
+ return pInfo1->GetStyleName().CompareTo( pInfo2->GetStyleName() );
+}
+
+// =======================================================================
+
+static void ImplMakeSearchString( XubString& rStr )
+{
+ rStr.ToLowerAscii();
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplMakeSearchStringFromName( XubString& rStr )
+{
+ rStr = rStr.GetToken( 0, ';' );
+ ImplMakeSearchString( rStr );
+}
+
+// -----------------------------------------------------------------------
+
+ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, ULONG* pIndex ) const
+{
+ // Wenn kein Eintrag in der Liste oder der Eintrag groesser ist als
+ // der Letzte, dann hinten dranhaengen. Wir vergleichen erst mit dem
+ // letzten Eintrag, da die Liste von VCL auch sortiert zurueckkommt
+ // und somit die Wahrscheinlichkeit das hinten angehaengt werden muss
+ // sehr gross ist.
+ StringCompare eComp;
+ ULONG nCount = Count();
+ if ( !nCount )
+ {
+ if ( pIndex )
+ *pIndex = LIST_APPEND;
+ return NULL;
+ }
+ else
+ {
+ ImplFontListNameInfo* pCmpData = (ImplFontListNameInfo*)List::GetObject( nCount-1 );
+ eComp = rSearchName.CompareTo( pCmpData->maSearchName );
+ if ( eComp == COMPARE_GREATER )
+ {
+ if ( pIndex )
+ *pIndex = LIST_APPEND;
+ return NULL;
+ }
+ else if ( eComp == COMPARE_EQUAL )
+ return pCmpData;
+ }
+
+ // Fonts in der Liste suchen
+ ImplFontListNameInfo* pCompareData;
+ ImplFontListNameInfo* pFoundData = NULL;
+ ULONG nLow = 0;
+ ULONG nHigh = nCount-1;
+ ULONG nMid;
+
+ do
+ {
+ nMid = (nLow + nHigh) / 2;
+ pCompareData = (ImplFontListNameInfo*)List::GetObject( nMid );
+ eComp = rSearchName.CompareTo( pCompareData->maSearchName );
+ if ( eComp == COMPARE_LESS )
+ {
+ if ( !nMid )
+ break;
+ nHigh = nMid-1;
+ }
+ else
+ {
+ if ( eComp == COMPARE_GREATER )
+ nLow = nMid + 1;
+ else
+ {
+ pFoundData = pCompareData;
+ break;
+ }
+ }
+ }
+ while ( nLow <= nHigh );
+
+ if ( pIndex )
+ {
+ eComp = rSearchName.CompareTo( pCompareData->maSearchName );
+ if ( eComp == COMPARE_GREATER )
+ *pIndex = (nMid+1);
+ else
+ *pIndex = nMid;
+ }
+
+ return pFoundData;
+}
+
+// -----------------------------------------------------------------------
+
+ImplFontListNameInfo* FontList::ImplFindByName( const XubString& rStr ) const
+{
+ XubString aSearchName = rStr;
+ ImplMakeSearchStringFromName( aSearchName );
+ return ImplFind( aSearchName, NULL );
+}
+
+// -----------------------------------------------------------------------
+
+void FontList::ImplInsertFonts( OutputDevice* pDevice, BOOL bAll,
+ BOOL bInsertData )
+{
+ rtl_TextEncoding eSystemEncoding = gsl_getSystemTextEncoding();
+
+ USHORT nType;
+ if ( pDevice->GetOutDevType() != OUTDEV_PRINTER )
+ nType = FONTLIST_FONTNAMETYPE_SCREEN;
+ else
+ nType = FONTLIST_FONTNAMETYPE_PRINTER;
+
+ // Alle Fonts vom Device abfragen
+ USHORT n = pDevice->GetDevFontCount();
+ USHORT i;
+ for( i = 0; i < n; i++ )
+ {
+ FontInfo aFontInfo = pDevice->GetDevFont( i );
+
+ // Wenn keine Raster-Schriften angezeigt werden sollen,
+ // dann diese ignorieren
+ if ( !bAll && (aFontInfo.GetType() == TYPE_RASTER) )
+ continue;
+
+ XubString aSearchName = aFontInfo.GetName();
+ ImplFontListNameInfo* pData;
+ ULONG nIndex;
+ ImplMakeSearchString( aSearchName );
+ pData = ImplFind( aSearchName, &nIndex );
+
+ if ( !pData )
+ {
+ if ( bInsertData )
+ {
+ ImplFontListFontInfo* pNewInfo = new ImplFontListFontInfo( aFontInfo, pDevice );
+ pData = new ImplFontListNameInfo( aSearchName );
+ pData->mpFirst = pNewInfo;
+ pNewInfo->mpNext = NULL;
+ pData->mnType = 0;
+ Insert( (void*)pData, nIndex );
+ }
+ }
+ else
+ {
+ if ( bInsertData )
+ {
+ BOOL bInsert = TRUE;
+ ImplFontListFontInfo* pPrev = NULL;
+ ImplFontListFontInfo* pTemp = pData->mpFirst;
+ ImplFontListFontInfo* pNewInfo = new ImplFontListFontInfo( aFontInfo, pDevice );
+ while ( pTemp )
+ {
+ StringCompare eComp = ImplCompareFontInfo( pNewInfo, pTemp );
+ if ( (eComp == COMPARE_LESS) || (eComp == COMPARE_EQUAL) )
+ {
+ if ( eComp == COMPARE_EQUAL )
+ {
+ // Overwrite charset, because charset should match
+ // with the system charset
+ if ( (pTemp->GetCharSet() != eSystemEncoding) &&
+ (pNewInfo->GetCharSet() == eSystemEncoding) )
+ {
+ ImplFontListFontInfo* pTemp2 = pTemp->mpNext;
+ *((FontInfo*)pTemp) = *((FontInfo*)pNewInfo);
+ pTemp->mpNext = pTemp2;
+ }
+ delete pNewInfo;
+ bInsert = FALSE;
+ }
+
+ break;
+ }
+
+ pPrev = pTemp;
+ pTemp = pTemp->mpNext;
+ }
+
+ if ( bInsert )
+ {
+ pNewInfo->mpNext = pTemp;
+ if ( pPrev )
+ pPrev->mpNext = pNewInfo;
+ else
+ pData->mpFirst = pNewInfo;
+ }
+ }
+ }
+
+ if ( pData )
+ {
+ pData->mnType |= nType;
+ if ( aFontInfo.GetType() != TYPE_RASTER )
+ pData->mnType |= FONTLIST_FONTNAMETYPE_SCALABLE;
+ }
+ }
+}
+
+// =======================================================================
+
+FontList::FontList( OutputDevice* pDevice, OutputDevice* pDevice2, BOOL bAll ) :
+ List( 4096, pDevice->GetDevFontCount(), 32 )
+{
+ // Variablen initialisieren
+ mpDev = pDevice;
+ mpDev2 = pDevice2;
+ mpSizeAry = NULL;
+
+ // Stylenamen festlegen
+ maLight = XubString( SvtResId( STR_SVT_STYLE_LIGHT ) );
+ maLightItalic = XubString( SvtResId( STR_SVT_STYLE_LIGHT_ITALIC ) );
+ maNormal = XubString( SvtResId( STR_SVT_STYLE_NORMAL ) );
+ maNormalItalic = XubString( SvtResId( STR_SVT_STYLE_NORMAL_ITALIC ) );
+ maBold = XubString( SvtResId( STR_SVT_STYLE_BOLD ) );
+ maBoldItalic = XubString( SvtResId( STR_SVT_STYLE_BOLD_ITALIC ) );
+ maBlack = XubString( SvtResId( STR_SVT_STYLE_BLACK ) );
+ maBlackItalic = XubString( SvtResId( STR_SVT_STYLE_BLACK_ITALIC ) );
+
+ ImplInsertFonts( pDevice, bAll, TRUE );
+
+ // Gegebenenfalls muessen wir mit den Bildschirmfonts vergleichen,
+ // damit dort die eigentlich doppelten auf Equal mappen koennen
+ BOOL bCompareWindow = FALSE;
+ if ( !pDevice2 && (pDevice->GetOutDevType() == OUTDEV_PRINTER) )
+ {
+ bCompareWindow = TRUE;
+ pDevice2 = Application::GetDefaultDevice();
+ }
+
+ if ( pDevice2 &&
+ (pDevice2->GetOutDevType() != pDevice->GetOutDevType()) )
+ ImplInsertFonts( pDevice2, bAll, !bCompareWindow );
+}
+
+// -----------------------------------------------------------------------
+
+FontList::~FontList()
+{
+ // Gegebenenfalls SizeArray loeschen
+ if ( mpSizeAry )
+ delete mpSizeAry;
+
+ // FontInfos loeschen
+ ImplFontListNameInfo* pData = (ImplFontListNameInfo*)First();
+ while ( pData )
+ {
+ ImplFontListFontInfo* pTemp;
+ ImplFontListFontInfo* pInfo = pData->mpFirst;
+ while ( pInfo )
+ {
+ pTemp = pInfo->mpNext;
+ delete pInfo;
+ pInfo = pTemp;
+ }
+ ImplFontListNameInfo* pNext = (ImplFontListNameInfo*)Next();
+ delete pData;
+ pData = pNext;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+XubString FontList::GetStyleName( const FontInfo& rInfo ) const
+{
+ XubString aStyleName = rInfo.GetStyleName();
+
+ // Nur wenn kein StyleName gesetzt ist, geben wir einen syntetischen
+ // Namen zurueck
+ if ( !aStyleName.Len() )
+ {
+ FontWeight eWeight = rInfo.GetWeight();
+ FontItalic eItalic = rInfo.GetItalic();
+ if ( eWeight > WEIGHT_BOLD )
+ {
+ if ( eItalic > ITALIC_NONE )
+ aStyleName = maBlackItalic;
+ else
+ aStyleName = maBlack;
+ }
+ else if ( eWeight > WEIGHT_MEDIUM )
+ {
+ if ( eItalic > ITALIC_NONE )
+ aStyleName = maBoldItalic;
+ else
+ aStyleName = maBold;
+ }
+ else if ( eWeight > WEIGHT_LIGHT )
+ {
+ if ( eItalic > ITALIC_NONE )
+ aStyleName = maNormalItalic;
+ else
+ aStyleName = maNormal;
+ }
+ else if ( eWeight != WEIGHT_DONTKNOW )
+ {
+ if ( eItalic > ITALIC_NONE )
+ aStyleName = maLightItalic;
+ else
+ aStyleName = maLight;
+ }
+ else
+ {
+ if ( eItalic > ITALIC_NONE )
+ aStyleName = maNormalItalic;
+ else
+ aStyleName = maNormal;
+ }
+ }
+
+ return aStyleName;
+}
+
+// -----------------------------------------------------------------------
+
+XubString FontList::GetFontMapText( const FontInfo& rInfo ) const
+{
+ if ( !rInfo.GetName().Len() )
+ {
+ XubString aEmptryStr;
+ return aEmptryStr;
+ }
+
+ ImplFontListNameInfo* pData = ImplFindByName( rInfo.GetName() );
+ if ( !pData )
+ {
+ if ( !maMapNotAvailable.Len() )
+ ((FontList*)this)->maMapNotAvailable = XubString( SvtResId( STR_SVT_FONTMAP_NOTAVAILABLE ) );
+ return maMapNotAvailable;
+ }
+
+ USHORT nType = pData->mnType;
+ if ( (nType & (FONTLIST_FONTNAMETYPE_PRINTER | FONTLIST_FONTNAMETYPE_SCREEN)) == FONTLIST_FONTNAMETYPE_PRINTER )
+ {
+ if ( !maMapPrinterOnly.Len() )
+ ((FontList*)this)->maMapPrinterOnly = XubString( SvtResId( STR_SVT_FONTMAP_PRINTERONLY ) );
+ return maMapPrinterOnly;
+ }
+ else if ( (nType & (FONTLIST_FONTNAMETYPE_PRINTER | FONTLIST_FONTNAMETYPE_SCREEN)) == FONTLIST_FONTNAMETYPE_SCREEN )
+ {
+ if ( !maMapScreenOnly.Len() )
+ ((FontList*)this)->maMapScreenOnly = XubString( SvtResId( STR_SVT_FONTMAP_SCREENONLY ) );
+ return maMapScreenOnly;
+ }
+ else
+ {
+ BOOL bNotSynthetic = FALSE;
+ BOOL bNoneAvailable = FALSE;
+ const XubString& rStyleName = rInfo.GetStyleName();
+ FontWeight eMinWeight = pData->mpFirst->GetWeight();
+ FontWeight eWeight = rInfo.GetWeight();
+ FontItalic eItalic = rInfo.GetItalic();
+ ImplFontListFontInfo* pFontInfo = pData->mpFirst;
+ if ( rStyleName.Len() )
+ {
+ while ( pFontInfo )
+ {
+ if ( (eWeight == pFontInfo->GetWeight()) &&
+ (eItalic == pFontInfo->GetItalic()) )
+ {
+ bNotSynthetic = TRUE;
+ break;
+ }
+
+ pFontInfo = pFontInfo->mpNext;
+ }
+
+ if ( !bNotSynthetic )
+ {
+ bNoneAvailable = TRUE;
+
+ // Testen, ob es ein syntetischer Style ist
+ if ( eMinWeight <= WEIGHT_NORMAL )
+ {
+ if ( (rStyleName == maNormal) || (rStyleName == maLight) ||
+ (rStyleName == maNormalItalic) || (rStyleName == maLightItalic) )
+ bNoneAvailable = FALSE;
+ }
+
+ if ( (rStyleName == maBold) || (rStyleName == maBlack) ||
+ (rStyleName == maBoldItalic) || (rStyleName == maBlackItalic) )
+ bNoneAvailable = FALSE;
+ }
+ }
+ else
+ bNotSynthetic = TRUE;
+
+ if ( bNoneAvailable )
+ {
+ XubString aEmptryStr;
+ return aEmptryStr;
+ }
+ else if ( !bNotSynthetic )
+ {
+ if ( !maMapStyleNotAvailable.Len() )
+ ((FontList*)this)->maMapStyleNotAvailable = XubString( SvtResId( STR_SVT_FONTMAP_STYLENOTAVAILABLE ) );
+ return maMapStyleNotAvailable;
+ }
+ else
+ {
+ /* Size not available not implemented yet
+ if ( !(nType & FONTLIST_FONTNAMETYPE_SCALABLE) )
+ {
+ ...
+ {
+ if ( !maMapSizeNotAvailable.Len() )
+ ((FontList*)this)->maMapSizeNotAvailable = XubString( SvtResId( STR_SVT_FONTMAP_SIZENOTAVAILABLE ) );
+ return maMapSizeNotAvailable;
+ }
+ }
+ */
+
+
+ if ( !maMapBoth.Len() )
+ ((FontList*)this)->maMapBoth = XubString( SvtResId( STR_SVT_FONTMAP_BOTH ) );
+ return maMapBoth;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+USHORT FontList::GetFontNameType( const XubString& rFontName ) const
+{
+ ImplFontListNameInfo* pData = ImplFindByName( rFontName );
+ if ( pData )
+ return pData->mnType;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+FontInfo FontList::Get( const XubString& rName, const XubString& rStyleName ) const
+{
+ ImplFontListNameInfo* pData = ImplFindByName( rName );
+ ImplFontListFontInfo* pFontInfo = NULL;
+ ImplFontListFontInfo* pFontNameInfo = NULL;
+ if ( pData )
+ {
+ ImplFontListFontInfo* pSearchInfo = pData->mpFirst;
+ pFontNameInfo = pSearchInfo;
+ while ( pSearchInfo )
+ {
+ if ( rStyleName == GetStyleName( *pSearchInfo ) )
+ {
+ pFontInfo = pSearchInfo;
+ break;
+ }
+
+ pSearchInfo = pSearchInfo->mpNext;
+ }
+ }
+
+ // Konnten die Daten nicht gefunden werden, dann muessen bestimmte
+ // Attribute nachgebildet werden
+ if ( !pFontInfo )
+ {
+ FontInfo aInfo;
+
+ // Falls der Fontname stimmt, uebernehmen wir soviel wie moeglich
+ if ( pFontNameInfo )
+ aInfo = *pFontNameInfo;
+ else
+ aInfo.SetName( rName );
+ aInfo.SetStyleName( rStyleName );
+
+ if ( rStyleName == maNormal )
+ {
+ aInfo.SetItalic( ITALIC_NONE );
+ aInfo.SetWeight( WEIGHT_NORMAL );
+ }
+ else if ( rStyleName == maNormalItalic )
+ {
+ aInfo.SetItalic( ITALIC_NORMAL );
+ aInfo.SetWeight( WEIGHT_NORMAL );
+ }
+ else if ( rStyleName == maBold )
+ {
+ aInfo.SetItalic( ITALIC_NONE );
+ aInfo.SetWeight( WEIGHT_BOLD );
+ }
+ else if ( rStyleName == maBoldItalic )
+ {
+ aInfo.SetItalic( ITALIC_NORMAL );
+ aInfo.SetWeight( WEIGHT_BOLD );
+ }
+ else if ( rStyleName == maLight )
+ {
+ aInfo.SetItalic( ITALIC_NONE );
+ aInfo.SetWeight( WEIGHT_LIGHT );
+ }
+ else if ( rStyleName == maLightItalic )
+ {
+ aInfo.SetItalic( ITALIC_NORMAL );
+ aInfo.SetWeight( WEIGHT_LIGHT );
+ }
+ else if ( rStyleName == maBlack )
+ {
+ aInfo.SetItalic( ITALIC_NONE );
+ aInfo.SetWeight( WEIGHT_BLACK );
+ }
+ else if ( rStyleName == maBlackItalic )
+ {
+ aInfo.SetItalic( ITALIC_NORMAL );
+ aInfo.SetWeight( WEIGHT_BLACK );
+ }
+ else
+ {
+ aInfo.SetItalic( ITALIC_NONE );
+ aInfo.SetWeight( WEIGHT_DONTKNOW );
+ }
+
+ return aInfo;
+ }
+ else
+ return *pFontInfo;
+}
+
+// -----------------------------------------------------------------------
+
+FontInfo FontList::Get( const XubString& rName,
+ FontWeight eWeight, FontItalic eItalic ) const
+{
+ ImplFontListNameInfo* pData = ImplFindByName( rName );
+ ImplFontListFontInfo* pFontInfo = NULL;
+ ImplFontListFontInfo* pFontNameInfo = NULL;
+ if ( pData )
+ {
+ ImplFontListFontInfo* pSearchInfo = pData->mpFirst;
+ pFontNameInfo = pSearchInfo;
+ while ( pSearchInfo )
+ {
+ if ( (eWeight == pSearchInfo->GetWeight()) &&
+ (eItalic == pSearchInfo->GetItalic()) )
+ {
+ pFontInfo = pSearchInfo;
+ break;
+ }
+
+ pSearchInfo = pSearchInfo->mpNext;
+ }
+ }
+
+ // Konnten die Daten nicht gefunden werden, dann muessen bestimmte
+ // Attribute nachgebildet werden
+ if ( !pFontInfo )
+ {
+ FontInfo aInfo;
+
+ // Falls der Fontname stimmt, uebernehmen wir soviel wie moeglich
+ if ( pFontNameInfo )
+ {
+ aInfo = *pFontNameInfo;
+ aInfo.SetStyleName( XubString() );
+ }
+ else
+ aInfo.SetName( rName );
+
+ aInfo.SetWeight( eWeight );
+ aInfo.SetItalic( eItalic );
+ return aInfo;
+ }
+ else
+ return *pFontInfo;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL FontList::IsAvailable( const XubString& rName ) const
+{
+ return (ImplFindByName( rName ) != 0);
+}
+
+// -----------------------------------------------------------------------
+
+const FontInfo& FontList::GetFontName( USHORT nFont ) const
+{
+ DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontName(): nFont >= Count" );
+
+ ImplFontListNameInfo* pData = (ImplFontListNameInfo*)List::GetObject( nFont );
+ return *(pData->mpFirst);
+}
+
+// -----------------------------------------------------------------------
+
+USHORT FontList::GetFontNameType( USHORT nFont ) const
+{
+ DBG_ASSERT( nFont < GetFontNameCount(), "FontList::GetFontNameType(): nFont >= Count" );
+
+ ImplFontListNameInfo* pData = (ImplFontListNameInfo*)List::GetObject( nFont );
+ return pData->mnType;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Handle FontList::GetFirstFontInfo( const XubString& rName ) const
+{
+ ImplFontListNameInfo* pData = ImplFindByName( rName );
+ if ( !pData )
+ return (sal_Handle)NULL;
+ else
+ return (sal_Handle)pData->mpFirst;
+}
+
+// -----------------------------------------------------------------------
+
+sal_Handle FontList::GetNextFontInfo( sal_Handle hFontInfo ) const
+{
+ ImplFontListFontInfo* pInfo = (ImplFontListFontInfo*)(void*)hFontInfo;
+ return (sal_Handle)(pInfo->mpNext);
+}
+
+// -----------------------------------------------------------------------
+
+const FontInfo& FontList::GetFontInfo( sal_Handle hFontInfo ) const
+{
+ ImplFontListFontInfo* pInfo = (ImplFontListFontInfo*)(void*)hFontInfo;
+ return *pInfo;
+}
+
+// -----------------------------------------------------------------------
+
+const long* FontList::GetSizeAry( const FontInfo& rInfo ) const
+{
+ // Size-Array vorher loeschen
+ if ( mpSizeAry )
+ {
+ delete ((FontList*)this)->mpSizeAry;
+ ((FontList*)this)->mpSizeAry = NULL;
+ }
+
+ // Falls kein Name, dann Standardgroessen
+ if ( !rInfo.GetName().Len() )
+ return aStdSizeAry;
+
+ // Zuerst nach dem Fontnamen suchen um das Device dann von dem
+ // entsprechenden Font zu nehmen
+ OutputDevice* pDevice = mpDev;
+ ImplFontListNameInfo* pData = ImplFindByName( rInfo.GetName() );
+ if ( pData )
+ pDevice = pData->mpFirst->GetDevice();
+
+ USHORT nDevSizeCount = pDevice->GetDevFontSizeCount( rInfo );
+ if ( !nDevSizeCount ||
+ (pDevice->GetDevFontSize( rInfo, 0 ).Height() == 0) )
+ return aStdSizeAry;
+
+ MapMode aOldMapMode = pDevice->GetMapMode();
+ MapMode aMap( MAP_10TH_INCH, Point(), Fraction( 1, 72 ), Fraction( 1, 72 ) );
+ pDevice->SetMapMode( aMap );
+
+ USHORT i;
+ USHORT nRealCount = 0;
+ long nOldHeight = 0;
+ ((FontList*)this)->mpSizeAry = new long[nDevSizeCount+1];
+ for ( i = 0; i < nDevSizeCount; i++ )
+ {
+ Size aSize = pDevice->GetDevFontSize( rInfo, i );
+ if ( aSize.Height() != nOldHeight )
+ {
+ nOldHeight = aSize.Height();
+ ((FontList*)this)->mpSizeAry[nRealCount] = nOldHeight;
+ nRealCount++;
+ }
+ }
+ ((FontList*)this)->mpSizeAry[nRealCount] = 0;
+
+ pDevice->SetMapMode( aOldMapMode );
+ return mpSizeAry;
+}
+
+// -----------------------------------------------------------------------
+
+const long* FontList::GetStdSizeAry()
+{
+ return aStdSizeAry;
+}
+
+
diff --git a/svtools/source/control/ctrltool.src b/svtools/source/control/ctrltool.src
new file mode 100644
index 000000000000..2ae746c57295
--- /dev/null
+++ b/svtools/source/control/ctrltool.src
@@ -0,0 +1,425 @@
+/*************************************************************************
+ *
+ * $RCSfile: ctrltool.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "svtools.hrc"
+
+String STR_SVT_STYLE_LIGHT
+{
+ Text = "Light" ;
+ Text [ ENGLISH ] = "Light" ;
+ Text [ english_us ] = "Light" ;
+ Text [ italian ] = "Light" ;
+ Text [ spanish ] = "Light" ;
+ Text [ french ] = "Estompé" ;
+ Text [ dutch ] = "Light" ;
+ Text [ swedish ] = "Ljus" ;
+ Text [ danish ] = "Light" ;
+ Text [ portuguese_brazilian ] = "Light" ;
+ Text [ portuguese ] = "Claro" ;
+ Text[ russian ] = "Òîíêèé";
+ Text[ polish ] = "Light";
+ Text[ japanese ] = "׎š";
+ Text[ chinese_simplified ] = "ϸ";
+ Text[ chinese_traditional ] = "²Ó";
+ Text[ arabic ] = "ÝÇÊÍ";
+ Text[ greek ] = "Áðáëü";
+ Text[ korean ] = "Light";
+ Text[ turkish ] = "Ýnce";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_SVT_STYLE_LIGHT_ITALIC
+{
+ Text = "Light Kursiv" ;
+ Text [ ENGLISH ] = "Light Italic" ;
+ Text [ english_us ] = "Light Italic" ;
+ Text [ italian ] = "Corsivo Light" ;
+ Text [ spanish ] = "Cursiva light" ;
+ Text [ french ] = "Italique estompé" ;
+ Text [ dutch ] = "Light Cursief" ;
+ Text [ swedish ] = "Ljus kursiv" ;
+ Text [ danish ] = "Light kursiv" ;
+ Text [ portuguese_brazilian ] = "Light Italic" ;
+ Text [ portuguese ] = "Itálico claro" ;
+ Text[ russian ] = "Òîíêèé êóðñèâ";
+ Text[ polish ] = "Kursywa light";
+ Text[ japanese ] = "׎š ŽÎ‘Ì";
+ Text[ chinese_simplified ] = "ϸбÌå";
+ Text[ chinese_traditional ] = "²Ó±×Åé";
+ Text[ arabic ] = "ÝÇÊÍ ãÇÆá";
+ Text[ greek ] = "ÐëÜãéá ÁðáëÜ";
+ Text[ korean ] = "°¡º­¿î ÀÌÅŸ¯Ã¼";
+ Text[ turkish ] = "Ýnce italik";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_SVT_STYLE_NORMAL
+{
+ Text = "Standard" ;
+ Text [ ENGLISH ] = "Regular" ;
+ Text [ english_us ] = "Regular" ;
+ Text [ italian ] = "Standard" ;
+ Text [ spanish ] = "Predeterminado" ;
+ Text [ french ] = "Normal" ;
+ Text [ dutch ] = "Normaal" ;
+ Text [ swedish ] = "Normal" ;
+ Text [ danish ] = "Normal" ;
+ Text [ portuguese_brazilian ] = "Normal" ;
+ Text [ portuguese ] = "Padrão" ;
+ Text[ russian ] = "Ñòàíäàðò";
+ Text[ polish ] = "Standard";
+ Text[ japanese ] = "•W€";
+ Text[ chinese_simplified ] = "±ê×¼";
+ Text[ chinese_traditional ] = "¼Ð·Ç";
+ Text[ arabic ] = "ÞíÇÓí";
+ Text[ greek ] = "ÐñïåðéëïãÞ";
+ Text[ korean ] = "º¸Åë";
+ Text[ turkish ] = "Normal";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_SVT_STYLE_NORMAL_ITALIC
+{
+ Text = "Kursiv" ;
+ Text [ ENGLISH ] = "Italic" ;
+ Text [ english_us ] = "Italic" ;
+ Text [ italian ] = "Corsivo" ;
+ Text [ spanish ] = "Cursiva" ;
+ Text [ french ] = "Italique" ;
+ Text [ dutch ] = "Cursief" ;
+ Text [ swedish ] = "Kursiv" ;
+ Text [ danish ] = "Kursiv" ;
+ Text [ portuguese_brazilian ] = "Italic" ;
+ Text [ portuguese ] = "Itálico" ;
+ Text[ russian ] = "Êóðñèâ";
+ Text[ polish ] = "Kursywa";
+ Text[ japanese ] = "ŽÎ‘Ì";
+ Text[ chinese_simplified ] = "бÌå";
+ Text[ chinese_traditional ] = "±×Åé";
+ Text[ arabic ] = "ãÇÆá";
+ Text[ greek ] = "ÐëÜãéá";
+ Text[ korean ] = "±â¿ïÀÓ²Ã";
+ Text[ turkish ] = "Ýtalik";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_SVT_STYLE_BOLD
+{
+ Text = "Fett" ;
+ Text [ ENGLISH ] = "Bold" ;
+ Text [ english_us ] = "Bold" ;
+ Text [ italian ] = "Grassetto" ;
+ Text [ spanish ] = "Negrita" ;
+ Text [ french ] = "Gras" ;
+ Text [ dutch ] = "Vet" ;
+ Text [ swedish ] = "Fet" ;
+ Text [ danish ] = "Fed" ;
+ Text [ portuguese_brazilian ] = "Bold" ;
+ Text [ portuguese ] = "Negrito" ;
+ Text[ russian ] = "Æèðíûé";
+ Text[ polish ] = "Pogrubienie";
+ Text[ japanese ] = "‘¾Žš";
+ Text[ chinese_simplified ] = "´ÖÌå";
+ Text[ chinese_traditional ] = "²ÊÅé";
+ Text[ arabic ] = "ÚÑíÖ";
+ Text[ greek ] = "¸íôïíï";
+ Text[ korean ] = "±½°Ô";
+ Text[ turkish ] = "Kalýn";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_SVT_STYLE_BOLD_ITALIC
+{
+ Text = "Fett Kursiv" ;
+ Text [ ENGLISH ] = "Bold Italic" ;
+ Text [ english_us ] = "Bold Italic" ;
+ Text [ italian ] = "Corsivo Grassetto" ;
+ Text [ spanish ] = "Cursiva negrita" ;
+ Text [ french ] = "Italique gras" ;
+ Text [ dutch ] = "Vet Cursief" ;
+ Text [ swedish ] = "Fet kursiv" ;
+ Text [ danish ] = "Fed kursiv" ;
+ Text [ portuguese_brazilian ] = "Bold Italic" ;
+ Text [ portuguese ] = "Negrito itálico" ;
+ Text[ russian ] = "Æèðíûé êóðñèâ";
+ Text[ polish ] = "Pogrubiona kursywa";
+ Text[ japanese ] = "‘¾Žš‚̎ΑÌ";
+ Text[ chinese_simplified ] = "´ÖбÌå";
+ Text[ chinese_traditional ] = "²Ê±×Åé";
+ Text[ arabic ] = "ÚÑíÖ ãÇÆá";
+ Text[ greek ] = "ÐëÜãéá ¸íôïíá";
+ Text[ korean ] = "±½Àº ÀÌÅŸ¯Ã¼";
+ Text[ turkish ] = "Kalýn italik";
+ Text[ language_user1 ] = " ";
+};
+
+String STR_SVT_STYLE_BLACK
+{
+ Text = "Black" ;
+ Text [ ENGLISH ] = "Black" ;
+ Text [ english_us ] = "Black" ;
+ Text [ italian ] = "Black" ;
+ Text [ spanish ] = "Black" ;
+ Text [ french ] = "Extra gras" ;
+ Text [ dutch ] = "Black" ;
+ Text [ swedish ] = "Svart" ;
+ Text [ danish ] = "Black" ;
+ Text [ portuguese_brazilian ] = "Black" ;
+ Text [ portuguese ] = "Preto" ;
+ Text[ russian ] = "×åðíûé";
+ Text[ polish ] = "Czarny";
+ Text[ japanese ] = "•";
+ Text[ chinese_simplified ] = "ºÚÌå";
+ Text[ language_user1 ] = " ";
+ Text[ chinese_traditional ] = "¶ÂÅé";
+ Text[ arabic ] = "ÃÓæÏ";
+ Text[ greek ] = "Ìáýñï";
+ Text[ korean ] = "°Ë°Ô";
+ Text[ turkish ] = "Siyah";
+};
+
+String STR_SVT_STYLE_BLACK_ITALIC
+{
+ Text = "Black Kursiv" ;
+ Text [ ENGLISH ] = "Black Italic" ;
+ Text [ english_us ] = "Black Italic" ;
+ Text [ italian ] = "Corsivo Black" ;
+ Text [ spanish ] = "Cursiva black" ;
+ Text [ french ] = "Italique extra gras" ;
+ Text [ dutch ] = "Black Cursief" ;
+ Text [ swedish ] = "Svart kursiv" ;
+ Text [ danish ] = "Black kursiv" ;
+ Text [ portuguese_brazilian ] = "Black Italic" ;
+ Text [ portuguese ] = "Preto itálico" ;
+ Text[ russian ] = "×åðíûé êóðñèâ";
+ Text[ polish ] = "Czarna kursywa";
+ Text[ japanese ] = "•‚̎ΑÌ";
+ Text[ chinese_simplified ] = "ºÚбÌå";
+ Text[ language_user1 ] = " ";
+ Text[ chinese_traditional ] = "¶Â±×Åé";
+ Text[ arabic ] = "ÃÓæÏ ãÇÆá";
+ Text[ greek ] = "ÐëÜãéá Ìáýñï";
+ Text[ korean ] = "°ËÁ¤ ÀÌÅŸ¯Ã¼";
+ Text[ turkish ] = "Siyah italik";
+};
+
+/*
+Finnische Texte:
+ "Light",
+ "Light Kursivoitu",
+ "Normaali",
+ "Kursivoitu",
+ "Lihavoitu",
+ "Lihavoitu Kursivoitu",
+ "Black",
+ "Black Kursivoitu"
+*/
+
+String STR_SVT_FONTMAP_BOTH
+{
+ TEXT = "Für Ausdruck und Anzeige am Bildschirm wird die gleiche Schriftart verwendet." ;
+ TEXT [ English ] = "The same font will be used on both your printer and your screen." ;
+ TEXT [ norwegian ] = "The same font will be used on both your printer and your screen." ;
+ TEXT [ italian ] = "Questo tipo di carattere verrà utilizzato sia per lo schermo che per la stampante." ;
+ TEXT [ portuguese_brazilian ] = "Esta mesma fonte ser utilizada na impressora e na tela." ;
+ TEXT [ portuguese ] = "O tipo de letra utilizado para a impressora e para o ecrã é o mesmo." ;
+ TEXT [ finnish ] = "Tätä fonttia voidaan käyttää kirjoittimessa ja näytössä." ;
+ TEXT [ danish ] = "Denne skrifttype vil blive brugt både på skærmen og på printeren." ;
+ TEXT [ french ] = "La même police est utilisée pour l'impression et l'affichage à l'écran." ;
+ TEXT [ swedish ] = "Samma teckensnitt används för både skrivare och bildskärm." ;
+ TEXT [ dutch ] = "Dit lettertype wordt voor zowel de printer als het scherm gebruikt." ;
+ TEXT [ spanish ] = "Se usará la misma fuente en la impresora y en pantalla" ;
+ TEXT [ english_us ] = "The same font will be used on both your printer and your screen." ;
+ TEXT[ chinese_simplified ] = "ÆÁÄ»ÏÔʾºÍ´òӡʹÓÃͬһÖÖ×ÖÌå¡£";
+ TEXT[ russian ] = "Äëÿ ïå÷àòè è âûâîäà íà ýêðàí èñïîëüçóåòñÿ îäèí è òîò æå øðèôò";
+ TEXT[ polish ] = "U¿yj tej samej czcionki dla wydruku i ekranu";
+ TEXT[ japanese ] = "ˆóü‚Ɖæ–Ê•\\Ž¦‚É‚Í“¯‚¶Ì«ÝÄ‚ÌŽí—Þ‚ªŽg—p‚³‚ê‚Ä‚¢‚Ü‚·B";
+ TEXT[ chinese_traditional ] = "¿Ã¹õÅã¥Ü©M¦C¦L¨Ï¥Î²Î¤@ªº¦r«¬";
+ TEXT[ arabic ] = "ÓæÝ íÊã ÇÓÊÎÏÇã äÝÓ ÇáÎØ ááØÇÈÚÉ æÇáÔÇÔÉ.";
+ TEXT[ greek ] = "Ç ãñáììáôïóåéñÜ áõôÞ èá ÷ñçóéìïðïéçèåß ãéá ôçí ïèüíç êáé ãéá ôïí åêôõðùôÞ.";
+ TEXT[ korean ] = "´ç½ÅÀÇ ½Ã½ºÅÛ°ú È­¸é¿¡´Â °°Àº ±Û²ÃÀÌ »ç¿ëµÉ °Í ÀÔ´Ï´Ù.";
+ TEXT[ turkish ] = "Yazdýrma ve ekranda görüntüleme için ayný yazýtipi kullanýlacak.";
+ TEXT[ language_user1 ] = " ";
+};
+
+String STR_SVT_FONTMAP_PRINTERONLY
+{
+ TEXT = "Druckerschrift. Die Bildschirmanzeige kann etwas abweichen." ;
+ TEXT [ English ] = "This is a printer font. The screen image may not exactly match." ;
+ TEXT [ norwegian ] = "This is a printer font. The screen image may not exactly match." ;
+ TEXT [ italian ] = "Il tipo di carattere visualizzato differisce da quello stampato." ;
+ TEXT [ portuguese_brazilian ] = "Esta é uma fonte de impressora. A imagem na tela pode não corresponder exatamente." ;
+ TEXT [ portuguese ] = "Letra de impressora. A letra vista no ecrã pode apresentar um pequeno desvio." ;
+ TEXT [ finnish ] = "Tämä on kirjoitinfontti. Näytön sisältö ei ehkä ole aivan samanlainen." ;
+ TEXT [ danish ] = "Dette er en printerskrifttype. Skærmbilledet svarer muligvis ikke helt til printerskrifttypen." ;
+ TEXT [ french ] = "Police d'imprimante. L'affichage et l'impression ne seront pas toujours identiques." ;
+ TEXT [ swedish ] = "Detta är ett skrivarteckensnitt. Visningen på skärmbilden kan avvika något." ;
+ TEXT [ dutch ] = "Dit is een printerlettertype. De weergave op het scherm kan iets afwijken." ;
+ TEXT [ spanish ] = "Fuente de impresora. La imagen en pantalla podría ser diferente." ;
+ TEXT [ english_us ] = "This is a printer font. The screen image may differ." ;
+ TEXT[ chinese_simplified ] = "ÕâÊÇ´òÓ¡×ÖÌå¡£ÆÁÄ»ÏÔʾµÄ×ÖÌåÓëÆä¿ÉÄÜ»áÓÐЩƫ²î¡£";
+ TEXT[ russian ] = "Øðèôò ïå÷àòè. Íà ýêðàíå ìîæåò íåìíîãî îòëè÷àòüñÿ.";
+ TEXT[ polish ] = "Czcionka drukarkowa. Obraz czcionek na ekranie mo¿e siê trochê ró¿niæ.";
+ TEXT[ japanese ] = "ÌßØÝÀ—p‚ÌÌ«ÝÄ‚Å‚·B‰æ–Ê•\\Ž¦‚Æ‚Í­‚µˆÙ‚È‚è‚Ü‚·B";
+ TEXT[ chinese_traditional ] = "¦C¦L¦r«¬¡C¿Ã¹õÅã¥Ü¦r«¬¥i¯à²¤·L¦³¨Ç°¾®t¡C";
+ TEXT[ arabic ] = "åÐÇ ÎØ ÇáØÇÈÚÉ. ÞÏ íÎÊáÝ ÇáãÙåÑ Úáì ÇáÔÇÔÉ ÈÚÖ ÇáÔÆ.";
+ TEXT[ greek ] = "ÃñáììáôïóåéñÜ åêôõðùôÞ. Ç åìöÜíéóç ôçò óôçí ïèüíç åßíáé äõíáôüí íá äéáöÝñåé.";
+ TEXT[ korean ] = "ÀÌ°ÍÀº Àμ⠱۲ÃÀÔ´Ï´Ù. È­¸éÀÇ À̹ÌÁö¿Í´Â ´Ù¸¦°Í ÀÔ´Ï´Ù.";
+ TEXT[ turkish ] = "Yazýcý yazýtipi. Ekrandaki görüntü biraz farklý olabilir.";
+};
+
+String STR_SVT_FONTMAP_SCREENONLY
+{
+ TEXT = "Bildschirmschrift. Der Ausdruck kann etwas abweichen." ;
+ TEXT [ English ] = "This is a screen font. The printer image may not exactly match." ;
+ TEXT [ norwegian ] = "This is a screen font. The printer image may not exactly match." ;
+ TEXT [ italian ] = "Questo è un carattere per lo schermo. La stampa può essere leggermente diversa." ;
+ TEXT [ portuguese_brazilian ] = "Esta é uma fonte de tela. A imagem impressa pode não corresponder exatamente." ;
+ TEXT [ portuguese ] = "Letra de ecrã. A letra impressa pode apresentar um pequeno desvio." ;
+ TEXT [ finnish ] = "Tämä on näyttöfontti. Tulosteen sisältö ei ehkä ole aivan samanlainen." ;
+ TEXT [ danish ] = "Dette er en skærmskrifttype. Udskriften kan muligvis afvige lidt." ;
+ TEXT [ french ] = "Police d'écran. L'impression et l'affichage ne seront pas toujours identiques." ;
+ TEXT [ swedish ] = "Detta är ett skärmteckensnitt. Utskriften kan vara lätt avvikande." ;
+ TEXT [ dutch ] = "Dit is een schermlettertype. De afdruk kan iets afwijken." ;
+ TEXT [ spanish ] = "Fuente de pantalla. La imagen en la impresora podría ser diferente." ;
+ TEXT [ english_us ] = "This is a screen font. The printer image may differ." ;
+ TEXT[ chinese_simplified ] = "ÕâÊÇÆÁÄ»×ÖÌå¡£´òÓ¡³öÀ´µÄ×ÖÌåÓëÆä¿ÉÄÜ»áÓÐһЩƫ²î¡£";
+ TEXT[ russian ] = "Øðèôò ýêðàíà.  ïå÷àòè ìîãóò áûòü îòêëîíåíèÿ.";
+ TEXT[ polish ] = "To jest czcionka ekranowa. Wydruk bêdzie siê trochê ró¿ni³.";
+ TEXT[ japanese ] = "‰æ–Ê—p‚ÌÌ«ÝÄ‚Å‚·Bˆóü²Ò°¼Þ‚Æ‚Í­‚µˆÙ‚È‚è‚Ü‚·B";
+ TEXT[ chinese_traditional ] = "¿Ã¹õ¦r«¬¡C¦C¦L¥X¥i¯à·|¦³¤@¨Ç°¾®t¡C";
+ TEXT[ arabic ] = "åÐÇ ÎØ ÔÇÔÉ. ÞÏ íÎÊáÝ ÇáãÙåÑ Úáì ÇáæÑÞ ÇáãØÈæÚ ÈÚÖ ÇáÔÆ.";
+ TEXT[ greek ] = "ÃñáììáôïóåéñÜ ïèüíçò. Ç åìöÜíéóç ôçò óôçí åêôýðùóç åßíáé äõíáôüí íá äéáöÝñåé.";
+ TEXT[ korean ] = "ÀÌ°ÍÀº È­¸é ÆùÆ® ÀÔ´Ï´Ù. Àμâ À̹ÌÁö¿Í´Â ´Ù¸¦ °Í ÀÔ´Ï´Ù.";
+ TEXT[ turkish ] = "Ekran yazýtipi. Yazdýrma biraz farklý olabilir.";
+};
+
+String STR_SVT_FONTMAP_SIZENOTAVAILABLE
+{
+ TEXT = "Diese Schriftgröße ist nicht installiert. Die am besten passende vorhandene Größe wird benutzt." ;
+ TEXT [ English ] = "This font size is not installed. The closest available size will be used." ;
+ TEXT[ english_us ] = "This font size has not been installed. The closest available size will be used.";
+ TEXT[ portuguese ] = "Este tamanho de letra não está instalado. Será utilizado o tamanho disponível mais adequado.";
+ TEXT[ russian ] = "Òàêîé ðàçìåð øðèôòà íå èíñòàëëèðîâàí. Ïîýòîìó áóäåò èñïîëüçîâàí íàèáîëåå ïîäõîäÿùèé ðàçìåð.";
+ TEXT[ greek ] = "Ôï ìÝãåèïò ôçò ãñáììáôïóåéñÜò äåí Ý÷åé åãêáôáóôáèåß. ×ñçóéìïðïéåßôáé ôï ðëçóéÝóôåñï ìÝãåèïò.";
+ TEXT[ dutch ] = "Deze schriftgrootte is niet geïnstalleerd. De meest passende voorhanden zijnde grootte wordt toegepast.";
+ TEXT[ french ] = "Cette taille de police n'a pas été installée. La taille disponible la plus appropriée va être utilisée.";
+ TEXT[ spanish ] = "Este tamaño de fuente no está instalado. Se usará el tamaño disponible más adecuado.";
+ TEXT[ italian ] = "Il font delle dimensioni indicate non è installato. Il programma utilizzerà le dimensioni disponibili.";
+ TEXT[ danish ] = "Denne skriftstørrelse er ikke installeret. Den tilgængelige størrelse, som passer bedst, vil blive brugt i stedet.";
+ TEXT[ swedish ] = "Den här teckenstorleken är inte installerad. Den tillgängliga storlek som passar bäst används.";
+ TEXT[ polish ] = "Dany rozmiar czcionki nie jest zaistalowany. U¿yty zostanie najbardziej pasuj¹cy, ju¿ istniej¹ca rozmiar.";
+ TEXT[ portuguese_brazilian ] = "This font size is not installed. The closest available size will be used.";
+ TEXT[ japanese ] = "‚±‚ÌÌ«ÝÄ»²½Þ‚Ͳݽİق³‚ê‚Ä‚¢‚Ü‚¹‚ñBÅ‚à“KØ‚È»²½Þ‚ª‘I‚΂ê‚Ü‚·B";
+ TEXT[ korean ] = "ÀÌ ±Û²ÃÀÇ Å©±â´Â ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù. À¯È¿ÇÑ °¡Àå À¯»çÇÑ Å©±â°¡ »ç¿ëµÉ°Í ÀÔ´Ï´Ù.";
+ TEXT[ chinese_simplified ] = "ûÓа²×°ÕâÖÖ×ÖÌå´óС¡£Ê¹ÓõÄÊÇÏÖÓеÄ×î½Ó½üµÄ×ÖÌå´óС¡£";
+ TEXT[ chinese_traditional ] = "¨S¦³¦w¸Ë³o­Ó¦r«¬¡C±Ä¥Î³Ìªñ¦üªº¦r«¬¡C";
+ TEXT[ arabic ] = "ÍÌã ÇáÎØ åÐÇ ÛíÑ ãËÈÊ. ÓæÝ íÊã ÇÓÊÎÏÇã ÃßËÑ ÇáÃÍÌÇã ÇáãæÌæÏÉ ÞÑÈÇð áå.";
+ TEXT[ turkish ] = "Bu yazýtipi boyu yüklenmedi. Mevcut boylardan en uygun olaný kullanýlacak.";
+};
+
+String STR_SVT_FONTMAP_STYLENOTAVAILABLE
+{
+ TEXT = "Dieser Schriftstil wird nachgebildet oder der am besten passende Stil wird verwendet." ;
+ TEXT [ English ] = "This font style will be generated or the closest matching style will be used." ;
+ TEXT[ english_us ] = "This font style will be simulated or the closest matching style will be used.";
+ TEXT[ portuguese ] = "Este estilo de letra será simulado ou será utilizado o estilo disponível mais adequado.";
+ TEXT[ russian ] = "Áóäåò ñîçäàí ëèáî òàêîé ñòèëü øðèôòà, ëèáî áóäåò èñïîëüçîâàí íàèáîëåå ïîõîæèé.";
+ TEXT[ greek ] = "Ôï óôõë áõôü ãñáììáôïóåéñÜò èá áíôéãñáöåß Þ èá ÷ñçóéìïðïéçèåß ôï ðëçóéÝóôåñï óôõë..";
+ TEXT[ dutch ] = "Dit lettertype wordt nagebootst of het meest overeenkomende voorhanden zijnde type wordt gebruikt.";
+ TEXT[ french ] = "Ce style de police sera imité ou le style le plus approprié sera utilisé.";
+ TEXT[ spanish ] = "Se imitará este estilo de fuente o se usará el más adecuado.";
+ TEXT[ italian ] = "Verrà riprodotto lo stile di questo font oppure verrà utilizzato quello che gli è più simile.";
+ TEXT[ danish ] = "Denne skrifttype bliver reproduceret eller den type, som passer bedst, vil blive brugt istedet.";
+ TEXT[ swedish ] = "Det här teckensnittet efterbildas eller närmast motsvarande teckensnitt används.";
+ TEXT[ polish ] = "Dany styl czcionki zostanie skopiowany lub zostanie u¿yty najlepiej pasuj¹cy styl.";
+ TEXT[ portuguese_brazilian ] = "This font style will be generated or the closest matching style will be used.";
+ TEXT[ japanese ] = "‚±‚ÌÌ«ÝĽÀ²Ù‚ÍC³‚³‚ê‚é‚©A‚Ü‚½‚ÍÅ‚à“K؂ȽÀ²Ù‚ªŽg—p‚³‚ê‚Ü‚·B";
+ TEXT[ korean ] = "ÀÌ ±Û²Ãü¿¡ °¡Àå À¯»çÇÑ ±Û²Ãü°¡ »ç¿ëµÉ°Í ÀÔ´Ï´Ù.";
+ TEXT[ chinese_simplified ] = "Éú³ÉÕâÖÖ×ÖÌå»òʹÓÃ×î½Ó½üµÄ×ÖÌå¡£";
+ TEXT[ chinese_traditional ] = "¼Ò¥é³o­Ó¦r«¬©Î±Ä¥Î³Ìªñ¦üªº¦r«¬¡C";
+ TEXT[ arabic ] = "ÓæÝ íÊã ÊÞáíÏ äãØ ÇáÎØ åÐÇ¡ Ãæ ÓæÝ íÊã ÇÓÊÎÏÇã ÃÞÑÈ äãØð áå.";
+ TEXT[ turkish ] = "Bu yazýtipi taklit edilecek ya da en uygun olan biçim kullanýlacak.";
+ TEXT[ language_user1 ] = " ";
+};
+
+String STR_SVT_FONTMAP_NOTAVAILABLE
+{
+ TEXT = "Diese Schriftart ist nicht installiert. Die am besten passende vorhandene Schriftart wird benutzt." ;
+ TEXT [ English ] = "This font is not installed. The closest available font will be used." ;
+ TEXT[ english_us ] = "This font has not been installed. The closest available font will be used.";
+ TEXT[ portuguese ] = "Este tipo de letra não está instalado. Será utilizado o tipo de letra disponível mais adequado.";
+ TEXT[ russian ] = "Ýòîò òèï øðèôòà íå èíñòàëëèðîâàí. Ïîýòîìó áóäåò èñïîëüçîâàí îäèí èç íàèáîëåå ïîäõîäÿùèõ.";
+ TEXT[ greek ] = "Ç ãñáììáôïóåéñÜ äåí Ý÷åé åãêáôáóôáèåß. ×ñçóéìïðïéåßôáé ç ðëçóéÝóôåñç (áðü Üðïøç ÷áñáêôçñéóôéêþí) ãñáììáôïóåéñÜ.";
+ TEXT[ dutch ] = "Dit lettertype is niet geïnstalleerd. Het meest overeenkomende voorhanden zijnde type wordt gebruikt.";
+ TEXT[ french ] = "Ce type de police n'a pas été installé. Le type de police le plus approprié va être utilisé.";
+ TEXT[ spanish ] = "Esta fuente no está instalada. Se usará la fuente existente más adecuada.";
+ TEXT[ italian ] = "Questo font non è installato. Il programma utilizzerà il font che gli è più simile.";
+ TEXT[ danish ] = "Denne skrifttype er ikke installeret. Den tilgængelige skrifttype, som passer bedst, vil blive brugt i stedet.";
+ TEXT[ swedish ] = "Det här teckensnittet är inte installerat. Det tillgängliga teckensnitt som passar bäst används.";
+ TEXT[ polish ] = "Dana czcionka nie jest zainstalowana.U¿yta zostanie najbardziej pasuj¹ca, ju¿ istniej¹ca czcionka.";
+ TEXT[ portuguese_brazilian ] = "This font is not installed. The closest available font will be used.";
+ TEXT[ japanese ] = "‚±‚ÌÌ«ÝĂͲݽİق³‚ê‚Ä‚¢‚Ü‚¹‚ñBÅ‚à“KØ‚ÈÌ«ÝÄ‚ª‘I‚΂ê‚Ü‚·B";
+ TEXT[ korean ] = "ÀÌ ±Û²ÃÀº ¼³Ä¡µÇÁö ¾Ê¾Ò½À´Ï´Ù. À¯È¿ÇÑ °¡Àå À¯»çÇÑ ±Û²ÃÀÌ »ç¿ëµÉ°Í ÀÔ´Ï´Ù.";
+ TEXT[ chinese_simplified ] = "ûÓа²×°ÕâÖÖ×ÖÌ塣ʹÓõÄÊÇÏÖÓеÄ×î½Ó½üµÄ×ÖÌå¡£";
+ TEXT[ chinese_traditional ] = "¨S¦³¦w¸Ë³o­Ó¦r«¬¡C±Ä¥Î³Ìªñ¦üªº¦r«¬¡C";
+ TEXT[ arabic ] = "åÐÇ ÇáÎØ ÛíÑ ãËÈÊ. ÓæÝ íÊã ÇÓÊÎÏÇã ÃßËÑ ÇáÎØæØ ÇáãæÌæÏÉ ÞÑÈÇð áå.";
+ TEXT[ turkish ] = "Bu yazýtipi yüklenmedi. Mevcut yazýtiplerinden en uygun olaný kullanýlacak.";
+};
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
new file mode 100644
index 000000000000..e52b4107c3d4
--- /dev/null
+++ b/svtools/source/control/filectrl.cxx
@@ -0,0 +1,307 @@
+/*************************************************************************
+ *
+ * $RCSfile: filectrl.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SV_FIELCTRL_CXX
+
+#ifndef _URLOBJ_HXX //autogen wg. INetURLObject
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _VCL_FILEDLG_HXX
+#include <vcl/filedlg.hxx>
+#endif
+
+#include <filedlg.hxx>
+#include <svtdata.hxx>
+
+#include <filectrl.hxx>
+#include <filectrl.hrc>
+
+#pragma hdrstop
+
+// =======================================================================
+
+FileControl::FileControl( Window* pParent, WinBits nStyle, FileControlMode nFlags ) :
+ Window( pParent, nStyle|WB_DIALOGCONTROL ),
+ maEdit( this, (nStyle&(~WB_BORDER))|WB_NOTABSTOP ),
+ maButton( this, nStyle&(~WB_BORDER)|WB_NOLIGHTBORDER|WB_NOPOINTERFOCUS|WB_NOTABSTOP ),
+ maButtonText( SvtResId( STR_FILECTRL_BUTTONTEXT ) ),
+ mnFlags( nFlags ),
+ mnInternalFlags( FILECTRL_ORIGINALBUTTONTEXT ),
+ mpVclDlg( 0 ),
+ mpFDlg( 0 )
+{
+ maButton.SetClickHdl( LINK( this, FileControl, ButtonHdl ) );
+ mbOpenDlg = TRUE;
+
+ maButton.Show();
+ maEdit.Show();
+
+ SetCompoundControl( TRUE );
+
+ SetStyle( ImplInitStyle( GetStyle() ) );
+}
+
+// -----------------------------------------------------------------------
+
+WinBits FileControl::ImplInitStyle( WinBits nStyle )
+{
+ if ( !( nStyle & WB_NOTABSTOP ) )
+ {
+ maEdit.SetStyle( (maEdit.GetStyle()|WB_TABSTOP)&(~WB_NOTABSTOP) );
+ maButton.SetStyle( (maButton.GetStyle()|WB_TABSTOP)&(~WB_NOTABSTOP) );
+ }
+ else
+ {
+ maEdit.SetStyle( (maEdit.GetStyle()|WB_NOTABSTOP)&(~WB_TABSTOP) );
+ maButton.SetStyle( (maButton.GetStyle()|WB_NOTABSTOP)&(~WB_TABSTOP) );
+ }
+
+ if ( !(nStyle & WB_NOGROUP) )
+ nStyle |= WB_GROUP;
+
+ if ( !(nStyle & WB_NOBORDER ) )
+ nStyle |= WB_BORDER;
+
+ nStyle &= ~WB_TABSTOP;
+
+ return nStyle;
+}
+
+// -----------------------------------------------------------------------
+
+FileControl::~FileControl()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void FileControl::SetText( const XubString& rStr )
+{
+ maEdit.SetText( rStr );
+ if ( mnFlags & FILECTRL_RESIZEBUTTONBYPATHLEN )
+ Resize();
+}
+
+// -----------------------------------------------------------------------
+
+XubString FileControl::GetText() const
+{
+ return maEdit.GetText();
+}
+
+// -----------------------------------------------------------------------
+
+void FileControl::StateChanged( StateChangedType nType )
+{
+ if ( nType == STATE_CHANGE_ENABLE )
+ {
+ maEdit.Enable( IsEnabled() );
+ maButton.Enable( IsEnabled() );
+ }
+ else if ( nType == STATE_CHANGE_ZOOM )
+ {
+ GetEdit().SetZoom( GetZoom() );
+ GetButton().SetZoom( GetZoom() );
+ }
+ else if ( nType == STATE_CHANGE_STYLE )
+ {
+ SetStyle( ImplInitStyle( GetStyle() ) );
+ }
+ else if ( nType == STATE_CHANGE_CONTROLFONT )
+ {
+ GetEdit().SetControlFont( GetControlFont() );
+ // Fuer den Button nur die Hoehe uebernehmen, weil in
+ // HTML immer Courier eingestellt wird.
+ Font aFont = GetButton().GetControlFont();
+ aFont.SetSize( GetControlFont().GetSize() );
+ GetButton().SetControlFont( aFont );
+ }
+ else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ {
+ GetEdit().SetControlForeground( GetControlForeground() );
+ GetButton().SetControlForeground( GetControlForeground() );
+ }
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ GetEdit().SetControlBackground( GetControlBackground() );
+ GetButton().SetControlBackground( GetControlBackground() );
+ }
+ Window::StateChanged( nType );
+}
+
+// -----------------------------------------------------------------------
+
+void FileControl::Resize()
+{
+ static long ButtonBorder = 10;
+
+ if( mnInternalFlags & FILECTRL_INRESIZE )
+ return;
+ mnInternalFlags |= FILECTRL_INRESIZE;//InResize = TRUE
+
+ Size aOutSz = GetOutputSizePixel();
+ long nButtonTextWidth = maButton.GetTextWidth( maButtonText );
+ if ( (mnInternalFlags & FILECTRL_ORIGINALBUTTONTEXT == 0) ||
+ nButtonTextWidth < aOutSz.Width()/3 &&
+ ( mnFlags & FILECTRL_RESIZEBUTTONBYPATHLEN
+ ? ( maEdit.GetTextWidth( maEdit.GetText() )
+ <= aOutSz.Width() - nButtonTextWidth - ButtonBorder )
+ : TRUE )
+ )
+ {
+ maButton.SetText( maButtonText );
+ }
+ else
+ {
+ XubString aSmallText( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
+ maButton.SetText( aSmallText );
+ nButtonTextWidth = maButton.GetTextWidth( aSmallText );
+ }
+
+ long nButtonWidth = nButtonTextWidth+ButtonBorder;
+ maEdit.SetPosSizePixel( 0, 0, aOutSz.Width()-nButtonWidth, aOutSz.Height() );
+ maButton.SetPosSizePixel( aOutSz.Width()-nButtonWidth, 0, nButtonWidth, aOutSz.Height() );
+
+ mnInternalFlags &= ~FILECTRL_INRESIZE; //InResize = FALSE
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( FileControl, ButtonHdl, PushButton*, EMPTYARG )
+{
+ XubString aNewText;
+ mpVclDlg = GetpApp()->CreateFileDialog( this, mbOpenDlg ? WB_OPEN : WB_SAVEAS );
+
+ if ( mpVclDlg )
+ {
+ mpVclDlg->SetPath( maEdit.GetText() );
+
+ maDialogCreatedHdl.Call( this );
+
+ if ( mpVclDlg->Execute() )
+ aNewText = mpVclDlg->GetPath();
+ DELETEZ( mpVclDlg );
+ }
+ else
+ {
+ mpFDlg = new FileDialog( this, mbOpenDlg ? WB_OPEN : WB_SAVEAS );
+ mpFDlg->SetPath( maEdit.GetText() );
+
+ maDialogCreatedHdl.Call( this );
+
+ if ( mpFDlg->Execute() )
+ aNewText = mpFDlg->GetPath();
+ DELETEZ( mpFDlg );
+ }
+
+ if ( aNewText.Len() )
+ {
+ INetURLObject aObj( aNewText );
+ if ( aObj.GetProtocol() == INET_PROT_FILE )
+ aNewText = aObj.PathToFileName();
+ SetText( aNewText );
+ maEdit.GetModifyHdl().Call( &maEdit );
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void FileControl::GetFocus()
+{
+ maEdit.GrabFocus();
+}
+
+// -----------------------------------------------------------------------
+
+void FileControl::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+{
+ WinBits nOldEditStyle = GetEdit().GetStyle();
+ if ( GetStyle() & WB_BORDER )
+ GetEdit().SetStyle( nOldEditStyle|WB_BORDER );
+ GetEdit().Draw( pDev, rPos, rSize, nFlags );
+ if ( GetStyle() & WB_BORDER )
+ GetEdit().SetStyle( nOldEditStyle );
+}
+
+// -----------------------------------------------------------------------
+
+void FileControl::SetButtonText( const XubString& rStr )
+{
+ mnInternalFlags &= ~FILECTRL_ORIGINALBUTTONTEXT;
+ maButtonText = rStr;
+ Resize();
+}
+
+// -----------------------------------------------------------------------
+
+void FileControl::ResetButtonText()
+{
+ mnInternalFlags |= FILECTRL_ORIGINALBUTTONTEXT;
+ maButtonText = XubString( SvtResId( STR_FILECTRL_BUTTONTEXT ) );
+ Resize();
+}
+
+
diff --git a/svtools/source/control/filectrl.src b/svtools/source/control/filectrl.src
new file mode 100644
index 000000000000..2f56127d657d
--- /dev/null
+++ b/svtools/source/control/filectrl.src
@@ -0,0 +1,85 @@
+/*************************************************************************
+ *
+ * $RCSfile: filectrl.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "filectrl.hrc"
+String STR_FILECTRL_BUTTONTEXT
+{
+ Text = "Durchsuchen..." ;
+ Text [ ENGLISH ] = "Browse..." ;
+ Text [ english_us ] = "Browse..." ;
+ Text [ portuguese_brazilian ] = "Durchsuchen..." ;
+ Text [ swedish ] = "Genomsök..." ;
+ Text [ danish ] = "Gennemse..." ;
+ Text [ italian ] = "Sfoglia..." ;
+ Text [ spanish ] = "Examinar..." ;
+ Text [ french ] = "Parcourir..." ;
+ Text [ dutch ] = "Bladeren..." ;
+ Text [ portuguese ] = "Pesquisar..." ;
+ Text[ chinese_simplified ] = "ä¯ÀÀ...";
+ Text[ russian ] = "Îáçîð...";
+ Text[ polish ] = "Przegl¹daj...";
+ Text[ japanese ] = "ŒŸõ...";
+ Text[ chinese_traditional ] = "ÂsÄý...";
+ Text[ arabic ] = "ÇÓÊÚÑÇÖ...";
+ Text[ greek ] = "ÁíáæÞôçóç...";
+ Text[ korean ] = "ã¾Æº¸±â...";
+ Text[ turkish ] = "Tara...";
+};
diff --git a/svtools/source/control/fmtfield.cxx b/svtools/source/control/fmtfield.cxx
new file mode 100644
index 000000000000..6ddf7ee51eb6
--- /dev/null
+++ b/svtools/source/control/fmtfield.cxx
@@ -0,0 +1,1017 @@
+/*************************************************************************
+ *
+ * $RCSfile: fmtfield.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <stdio.h>
+
+#ifndef _TOOLS_DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+
+#ifndef _ZFORMAT_HXX //autogen
+#include "zformat.hxx"
+#endif
+
+#ifndef _FMTFIELD_HXX_
+#include "fmtfield.hxx"
+#endif // _FMTFIELD_HXX_
+
+//==============================================================================
+// regulaerer Ausdruck, um komplette Zahlen und alles, was waehrend der Eingabe einer kompletten Zahl als Fragment vorkommt,
+// abzudecken :
+// [+/-][{ziffer}*.]*{ziffer}*[,{ziffer}*][e[+/-]{ziffer}*]
+const char __FAR_DATA szNumericInput[] = "_[\\x2D\\x2B]?([0-9]*\\x++)*[0-9]*(\\x##[0-9]*)?(e[\\x2D\\x2B]?[0-9]*)?_";
+ // (die beiden _ sind fuer die Normierung, damit kann ich erzwingen, dass nie ein Teilstring gefunden wird)
+
+//==============================================================================
+SvNumberFormatter* FormattedField::StaticFormatter::s_cFormatter = NULL;
+ULONG FormattedField::StaticFormatter::s_nReferences = 0;
+
+//------------------------------------------------------------------------------
+SvNumberFormatter* FormattedField::StaticFormatter::GetFormatter()
+{
+ if (!s_cFormatter)
+ s_cFormatter = new SvNumberFormatter(Application::GetAppInternational().GetLanguage());
+ return s_cFormatter;
+}
+
+//------------------------------------------------------------------------------
+FormattedField::StaticFormatter::StaticFormatter()
+{
+ ++s_nReferences;
+}
+
+//------------------------------------------------------------------------------
+FormattedField::StaticFormatter::~StaticFormatter()
+{
+ if (--s_nReferences == 0)
+ {
+ delete s_cFormatter;
+ s_cFormatter = NULL;
+ }
+}
+
+//==============================================================================
+DBG_NAME(FormattedField);
+
+#define INIT_MEMBERS() \
+ m_aLastSelection(0,0) \
+ ,m_bStrictFormat(TRUE) \
+ ,m_nFormatKey(0) \
+ ,m_pFormatter(NULL) \
+ ,m_dMinValue(0) \
+ ,m_dMaxValue(0) \
+ ,m_bHasMin(FALSE) \
+ ,m_bHasMax(FALSE) \
+ ,m_dCurrentValue(0) \
+ ,m_bValueDirty(TRUE) \
+ ,m_bEnableEmptyField(TRUE) \
+ ,m_dDefaultValue(0) \
+ ,m_dSpinSize(1) \
+ ,m_dSpinFirst(-1000000) \
+ ,m_dSpinLast(1000000) \
+ ,m_bTreatAsNumber(TRUE) \
+ ,m_pLastOutputColor(NULL)
+
+//------------------------------------------------------------------------------
+FormattedField::FormattedField(Window* pParent, WinBits nStyle, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey)
+ :SpinField(pParent, nStyle)
+ ,INIT_MEMBERS()
+{
+ DBG_CTOR(FormattedField, NULL);
+
+ if (pInitialFormatter)
+ {
+ m_pFormatter = pInitialFormatter;
+ m_nFormatKey = nFormatKey;
+ }
+}
+
+//------------------------------------------------------------------------------
+FormattedField::FormattedField(Window* pParent, const ResId& rResId, SvNumberFormatter* pInitialFormatter, INT32 nFormatKey)
+ :SpinField(pParent, rResId)
+ ,INIT_MEMBERS()
+{
+ DBG_CTOR(FormattedField, NULL);
+
+ if (pInitialFormatter)
+ {
+ m_pFormatter = pInitialFormatter;
+ m_nFormatKey = nFormatKey;
+ }
+}
+
+//------------------------------------------------------------------------------
+FormattedField::~FormattedField()
+{
+ DBG_DTOR(FormattedField, NULL);
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetValidateText(const XubString& rText, const String* pErrorText)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ if (CheckText(rText))
+ SetText(rText);
+ else
+ if (pErrorText)
+ ImplSetText(*pErrorText, NULL);
+ else
+ ImplSetValue(m_dDefaultValue, TRUE);
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetText(const XubString& rStr)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ SpinField::SetText(rStr);
+ m_bValueDirty = TRUE;
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetTextFormatted(const XubString& rStr)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+#if DBG_UTIL
+ if (ImplGetFormatter()->IsTextFormat(m_nFormatKey))
+ DBG_WARNING("FormattedField::SetTextFormatted : valid only with text formats !");
+#endif
+
+ m_sCurrentTextValue = rStr;
+
+ String sFormatted;
+ ImplGetFormatter()->GetOutputString(m_sCurrentTextValue, m_nFormatKey, sFormatted, &m_pLastOutputColor);
+
+ // calculate the new selection
+ Selection aSel(GetSelection());
+ Selection aNewSel(aSel);
+ aNewSel.Justify();
+ USHORT nNewLen = sFormatted.Len();
+ USHORT nCurrentLen = GetText().Len();
+ if ((nNewLen > nCurrentLen) && (aNewSel.Max() == nCurrentLen))
+ { // the new text is longer and the cursor was behind the last char (of the old text)
+ if (aNewSel.Min() == 0)
+ { // the whole text was selected -> select the new text on the whole, too
+ aNewSel.Max() = nNewLen;
+ if (!nCurrentLen)
+ { // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options
+ ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ if (nSelOptions & SELECTION_OPTION_SHOWFIRST)
+ { // selection should be from right to left -> swap min and max
+ aNewSel.Min() = aNewSel.Max();
+ aNewSel.Max() = 0;
+ }
+ }
+ }
+ else if (aNewSel.Max() == aNewSel.Min())
+ { // there was no selection -> set the cursor behind the new last char
+ aNewSel.Max() = nNewLen;
+ aNewSel.Min() = nNewLen;
+ }
+ }
+ else if (aNewSel.Max() > nNewLen)
+ aNewSel.Max() = nNewLen;
+ else
+ aNewSel = aSel; // don't use the justified version
+ SpinField::SetText(sFormatted, aNewSel);
+ m_bValueDirty = FALSE;
+}
+
+//------------------------------------------------------------------------------
+String FormattedField::GetTextValue() const
+{
+ if (m_bValueDirty)
+ {
+ ((FormattedField*)this)->m_sCurrentTextValue = GetText();
+ ((FormattedField*)this)->m_bValueDirty = FALSE;
+ }
+ return m_sCurrentTextValue;
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::Modify()
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ if (!IsStrictFormat())
+ {
+ m_bValueDirty = TRUE;
+ SpinField::Modify();
+ return;
+ }
+
+ String sCheck = GetText();
+ if (CheckText(sCheck))
+ {
+ m_sLastValidText = sCheck;
+ m_aLastSelection = GetSelection();
+ m_bValueDirty = TRUE;
+ }
+ else
+ {
+ ImplSetText(m_sLastValidText, &m_aLastSelection);
+ }
+
+ SpinField::Modify();
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::ImplSetText(const XubString& rNew, Selection* pNewSel)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ if (pNewSel)
+ SpinField::SetText(rNew, *pNewSel);
+ else
+ {
+ Selection aSel(GetSelection());
+ aSel.Justify();
+
+ USHORT nNewLen = rNew.Len();
+ USHORT nCurrentLen = GetText().Len();
+
+ if ((nNewLen > nCurrentLen) && (aSel.Max() == nCurrentLen))
+ { // new new text is longer and the cursor is behind the last char
+ if (aSel.Min() == 0)
+ { // the whole text was selected -> select the new text on the whole, too
+ aSel.Max() = nNewLen;
+ if (!nCurrentLen)
+ { // there wasn't really a previous selection (as there was no previous text), we're setting a new one -> check the selection options
+ ULONG nSelOptions = GetSettings().GetStyleSettings().GetSelectionOptions();
+ if (nSelOptions & SELECTION_OPTION_SHOWFIRST)
+ { // selection should be from right to left -> swap min and max
+ aSel.Min() = aSel.Max();
+ aSel.Max() = 0;
+ }
+ }
+ }
+ else if (aSel.Max() == aSel.Min())
+ { // there was no selection -> set the cursor behind the new last char
+ aSel.Max() = nNewLen;
+ aSel.Min() = nNewLen;
+ }
+ }
+ else if (aSel.Max() > nNewLen)
+ aSel.Max() = nNewLen;
+ SpinField::SetText(rNew, aSel);
+ }
+
+ m_bValueDirty = TRUE;
+ // muss nicht stimmen, aber sicherheitshalber ...
+}
+
+//------------------------------------------------------------------------------
+long FormattedField::PreNotify(NotifyEvent& rNEvt)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ if (rNEvt.GetType() == EVENT_KEYINPUT)
+ m_aLastSelection = GetSelection();
+ return SpinField::PreNotify(rNEvt);
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::ImplSetFormatKey(ULONG nFormatKey)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ m_nFormatKey = nFormatKey;
+ BOOL bNeedFormatter = (m_pFormatter == NULL) && (nFormatKey != 0);
+ if (bNeedFormatter)
+ {
+ ImplGetFormatter(); // damit wird ein Standard-Formatter angelegt
+
+ m_nFormatKey = nFormatKey;
+ // kann sein, dass das in dem Standard-Formatter keinen Sinn macht, aber der nimmt dann ein Default-Format an.
+ // Auf diese Weise kann ich einfach einen der - formatteruebergreifended gleichen - Standard-Keys setzen.
+ DBG_ASSERT(m_pFormatter->GetEntry(nFormatKey) != NULL, "FormattedField::ImplSetFormatKey : invalid format key !");
+ // Wenn SetFormatKey aufgerufen wird, ohne dass ein Formatter existiert, muss der Key einer der Standard-Werte
+ // sein, der in allen Formattern (also auch in meinem neu angelegten) vorhanden ist.
+ }
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetFormatKey(ULONG nFormatKey)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ BOOL bNoFormatter = (m_pFormatter == NULL);
+ ImplSetFormatKey(nFormatKey);
+ FormatChanged((bNoFormatter && (m_pFormatter != NULL)) ? FCT_FORMATTER : FCT_KEYONLY);
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetFormatter(SvNumberFormatter* pFormatter, BOOL bResetFormat)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ if (bResetFormat)
+ {
+ m_pFormatter = pFormatter;
+ m_nFormatKey = 0;
+ }
+ else
+ {
+ XubString sOldFormat;
+ LanguageType aOldLang;
+ GetFormat(sOldFormat, aOldLang);
+
+ ULONG nDestKey = pFormatter->TestNewString(sOldFormat);
+ if (nDestKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
+ {
+ // die Sprache des neuen Formatters
+ const SvNumberformat* pDefaultEntry = pFormatter->GetEntry(0);
+ LanguageType aNewLang = pDefaultEntry ? pDefaultEntry->GetLanguage() : LANGUAGE_DONTKNOW;
+
+ // den alten Format-String in die neue Sprache konvertieren
+ USHORT nCheckPos;
+ short nType;
+ pFormatter->PutandConvertEntry(sOldFormat, nCheckPos, nType, nDestKey, aOldLang, aNewLang);
+ m_nFormatKey = nDestKey;
+ }
+ m_pFormatter = pFormatter;
+ }
+
+ FormatChanged(FCT_FORMATTER);
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::GetFormat(XubString& rFormatString, LanguageType& eLang) const
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ const SvNumberformat* pFormatEntry = ImplGetFormatter()->GetEntry(m_nFormatKey);
+ DBG_ASSERT(pFormatEntry != NULL, "FormattedField::ResetConformanceTester : no number format for the given format key.");
+ rFormatString = pFormatEntry ? pFormatEntry->GetFormatstring() : XubString();
+ eLang = pFormatEntry ? pFormatEntry->GetLanguage() : LANGUAGE_DONTKNOW;
+}
+
+//------------------------------------------------------------------------------
+BOOL FormattedField::SetFormat(const XubString& rFormatString, LanguageType eLang)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ ULONG nNewKey = ImplGetFormatter()->TestNewString(rFormatString, eLang);
+ if (nNewKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
+ {
+ USHORT nCheckPos;
+ short nType;
+ XubString rFormat(rFormatString);
+ if (!ImplGetFormatter()->PutEntry(rFormat, nCheckPos, nType, nNewKey))
+ return FALSE;
+ DBG_ASSERT(nNewKey != NUMBERFORMAT_ENTRY_NOT_FOUND, "FormattedField::SetFormatString : PutEntry returned an invalid key !");
+ }
+
+ if (nNewKey != m_nFormatKey)
+ SetFormatKey(nNewKey);
+ return TRUE;
+}
+
+//------------------------------------------------------------------------------
+BOOL FormattedField::GetThousandsSep() const
+{
+ DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
+ "FormattedField::GetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?");
+
+ BOOL bThousand, IsRed;
+ USHORT nPrecision, nAnzLeading;
+ ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
+
+ return bThousand;
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetThousandsSep(BOOL _bUseSeparator)
+{
+ DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
+ "FormattedField::SetThousandsSep : your'e sure what your'e doing when setting the precision of a text format ?");
+
+ // get the current settings
+ BOOL bThousand, IsRed;
+ USHORT nPrecision, nAnzLeading;
+ ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
+ if (bThousand == _bUseSeparator)
+ return;
+
+ // we need the language for the following
+ LanguageType eLang;
+ String sFmtDescription;
+ GetFormat(sFmtDescription, eLang);
+
+ // generate a new format ...
+ ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, _bUseSeparator, IsRed, nPrecision, nAnzLeading);
+ // ... and introduce it to the formatter
+ USHORT nCheckPos;
+ ULONG nNewKey;
+ short nType;
+ ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang);
+
+ // set the new key
+ ImplSetFormatKey(nNewKey);
+ FormatChanged(FCT_THOUSANDSSEP);
+}
+
+//------------------------------------------------------------------------------
+USHORT FormattedField::GetDecimalDigits() const
+{
+ DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
+ "FormattedField::GetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?");
+
+ BOOL bThousand, IsRed;
+ USHORT nPrecision, nAnzLeading;
+ ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
+
+ return nPrecision;
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetDecimalDigits(USHORT _nPrecision)
+{
+ DBG_ASSERT(!ImplGetFormatter()->IsTextFormat(m_nFormatKey),
+ "FormattedField::SetDecimalDigits : your'e sure what your'e doing when setting the precision of a text format ?");
+
+ // get the current settings
+ BOOL bThousand, IsRed;
+ USHORT nPrecision, nAnzLeading;
+ ImplGetFormatter()->GetFormatSpecialInfo(m_nFormatKey, bThousand, IsRed, nPrecision, nAnzLeading);
+ if (nPrecision == _nPrecision)
+ return;
+
+ // we need the language for the following
+ LanguageType eLang;
+ String sFmtDescription;
+ GetFormat(sFmtDescription, eLang);
+
+ // generate a new format ...
+ ImplGetFormatter()->GenerateFormat(sFmtDescription, m_nFormatKey, eLang, bThousand, IsRed, _nPrecision, nAnzLeading);
+ // ... and introduce it to the formatter
+ USHORT nCheckPos;
+ ULONG nNewKey;
+ short nType;
+ ImplGetFormatter()->PutEntry(sFmtDescription, nCheckPos, nType, nNewKey, eLang);
+
+ // set the new key
+ ImplSetFormatKey(nNewKey);
+ FormatChanged(FCT_PRECISION);
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::FormatChanged(FORMAT_CHANGE_TYPE /*nWhat*/)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ m_pLastOutputColor = NULL;
+ ReFormat();
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::ReFormat()
+{
+ if (!IsEmptyFieldEnabled() || GetText().Len())
+ if (TreatingAsNumber())
+ ImplSetValue(GetValue(), TRUE);
+ else
+ SetTextFormatted(GetTextValue());
+}
+
+//------------------------------------------------------------------------------
+long FormattedField::Notify(NotifyEvent& rNEvt)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ if ((rNEvt.GetType() == EVENT_KEYINPUT) && !IsReadOnly())
+ {
+ const KeyEvent& rKEvt = *rNEvt.GetKeyEvent();
+ USHORT nMod = rKEvt.GetKeyCode().GetModifier();
+ switch ( rKEvt.GetKeyCode().GetCode() )
+ {
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_PAGEUP:
+ case KEY_PAGEDOWN:
+ if (!nMod && ImplGetFormatter()->IsTextFormat(m_nFormatKey))
+ {
+ // the base class would translate this into calls to Up/Down/First/Last,
+ // but we don't want this if we are text-formatted
+ return 1;
+ }
+ }
+ }
+
+ if ((rNEvt.GetType() == EVENT_COMMAND) && !IsReadOnly())
+ {
+ const CommandEvent* pCommand = rNEvt.GetCommandEvent();
+ if (pCommand->GetCommand() == COMMAND_WHEEL)
+ {
+ const CommandWheelData* pData = rNEvt.GetCommandEvent()->GetWheelData();
+ if ((pData->GetMode() == COMMAND_WHEEL_SCROLL) && ImplGetFormatter()->IsTextFormat(m_nFormatKey))
+ {
+ // same as above : prevent the base class from doing Up/Down-calls
+ // (normally I should put this test into the Up/Down methods itself, shouldn't I ?)
+ // FS - 71553 - 19.01.00
+ return 1;
+ }
+ }
+ }
+
+ if (rNEvt.GetType() == EVENT_LOSEFOCUS)
+ {
+ // Sonderbehandlung fuer leere Texte
+ if (GetText().Len() == 0)
+ {
+ if (!IsEmptyFieldEnabled())
+ {
+ if (TreatingAsNumber())
+ {
+ ImplSetValue(m_dCurrentValue, TRUE);
+ Modify();
+ }
+ else
+ {
+ String sNew = GetTextValue();
+ if (sNew.Len())
+ SetTextFormatted(sNew);
+ else
+ SetTextFormatted(m_sDefaultText);
+ }
+ m_bValueDirty = FALSE;
+ }
+ }
+ else
+ {
+ String sOld = GetText();
+ ReFormat();
+ if (GetText() != sOld)
+ Modify();
+ }
+ }
+
+ return SpinField::Notify( rNEvt );
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetMinValue(double dMin)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMinValue : only to be used in numeric mode !");
+
+ m_dMinValue = dMin;
+ m_bHasMin = TRUE;
+ // fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue
+ ReFormat();
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetMaxValue(double dMax)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ DBG_ASSERT(m_bTreatAsNumber, "FormattedField::SetMaxValue : only to be used in numeric mode !");
+
+ m_dMaxValue = dMax;
+ m_bHasMax = TRUE;
+ // fuer die Ueberpruefung des aktuellen Wertes an der neuen Grenze -> ImplSetValue
+ ReFormat();
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetTextValue(const XubString& rText)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ SetText(rText);
+ ReFormat();
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::EnableEmptyField(BOOL bEnable)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ if (bEnable == m_bEnableEmptyField)
+ return;
+
+ m_bEnableEmptyField = bEnable;
+ if (!m_bEnableEmptyField && GetText().Len()==0)
+ ImplSetValue(m_dCurrentValue, TRUE);
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::ImplSetValue(double dVal, BOOL bForce)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ if (m_bHasMin && (dVal<m_dMinValue))
+ dVal = m_dMinValue;
+ if (m_bHasMax && (dVal>m_dMaxValue))
+ dVal = m_dMaxValue;
+ if (!bForce && (dVal == GetValue()))
+ return;
+
+ DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplSetValue : can't set a value without a formatter !");
+
+ m_bValueDirty = FALSE;
+ m_dCurrentValue = dVal;
+
+ String sNewText;
+ if (ImplGetFormatter()->IsTextFormat(m_nFormatKey))
+ {
+ // zuerst die Zahl als String im Standard-Format
+ String sTemp;
+ ImplGetFormatter()->GetOutputString(dVal, 0, sTemp, &m_pLastOutputColor);
+ // dann den String entsprechend dem Text-Format
+ ImplGetFormatter()->GetOutputString(sTemp, m_nFormatKey, sNewText, &m_pLastOutputColor);
+ }
+ else
+ {
+ ImplGetFormatter()->GetOutputString(dVal, m_nFormatKey, sNewText, &m_pLastOutputColor);
+ }
+
+ ImplSetText(sNewText, NULL);
+ m_bValueDirty = FALSE;
+ DBG_ASSERT(CheckText(sNewText), "FormattedField::ImplSetValue : formatted string doesn't match the criteria !");
+}
+
+//------------------------------------------------------------------------------
+BOOL FormattedField::ImplGetValue(double& dNewVal)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ dNewVal = m_dCurrentValue;
+ if (!m_bValueDirty)
+ return TRUE;
+
+ dNewVal = m_dDefaultValue;
+ String sText(GetText());
+ if (!sText.Len())
+ return TRUE;
+
+ DBG_ASSERT(ImplGetFormatter() != NULL, "FormattedField::ImplGetValue : can't give you a current value without a formatter !");
+
+ ULONG nFormatKey = m_nFormatKey; // IsNumberFormat veraendert den FormatKey ...
+
+ if (ImplGetFormatter()->IsTextFormat(nFormatKey) && m_bTreatAsNumber)
+ // damit wir in einem als Text formatierten Feld trotzdem eine Eingabe wie '1,1' erkennen ...
+ nFormatKey = 0;
+
+ // Sonderbehandlung fuer %-Formatierung
+ if (ImplGetFormatter()->GetType(m_nFormatKey) == NUMBERFORMAT_PERCENT)
+ {
+ ULONG nTempFormat = 0;
+ double dTemp;
+ if (m_pFormatter->IsNumberFormat(sText, nTempFormat, dTemp) &&
+ NUMBERFORMAT_NUMBER == m_pFormatter->GetType(nTempFormat))
+ // der String entspricht einer Number-Formatierung, hat also nur kein %
+ // -> dranhaengen
+ sText += '%';
+ // (damit wird aus einer Eingabe '3' ein '3%', und der Formatter macht dann daraus
+ // ein double 0.03. Ansonsten wuerden wir hier bei einer Eingabe von '3' ein double
+ // 3 zurueckliefern, was 300 Prozent entspricht ...
+ }
+ if (!ImplGetFormatter()->IsNumberFormat(sText, nFormatKey, dNewVal))
+ return FALSE;
+
+
+ if (m_bHasMin && (dNewVal<m_dMinValue))
+ dNewVal = m_dMinValue;
+ if (m_bHasMax && (dNewVal>m_dMaxValue))
+ dNewVal = m_dMaxValue;
+ return TRUE;
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::SetValue(double dVal)
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ ImplSetValue(dVal, m_bValueDirty);
+}
+
+//------------------------------------------------------------------------------
+double FormattedField::GetValue()
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+
+ if (!ImplGetValue(m_dCurrentValue))
+ m_dCurrentValue = m_dDefaultValue;
+
+ m_bValueDirty = FALSE;
+ return m_dCurrentValue;
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::Up()
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ SetValue(GetValue() + m_dSpinSize);
+ // das setValue handelt Bereichsueberschreitungen (min/max) automatisch
+ SetModifyFlag();
+ Modify();
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::Down()
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ SetValue(GetValue() - m_dSpinSize);
+ SetModifyFlag();
+ Modify();
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::First()
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ if (m_bHasMin)
+ {
+ SetValue(m_dMinValue);
+ SetModifyFlag();
+ Modify();
+ }
+}
+
+//------------------------------------------------------------------------------
+void FormattedField::Last()
+{
+ DBG_CHKTHIS(FormattedField, NULL);
+ if (m_bHasMax)
+ {
+ SetValue(m_dMaxValue);
+ SetModifyFlag();
+ Modify();
+ }
+}
+
+//==============================================================================
+//------------------------------------------------------------------------------
+DoubleNumericField::~DoubleNumericField()
+{
+ delete m_pConformanceTester;
+}
+
+//------------------------------------------------------------------------------
+void DoubleNumericField::FormatChanged(FORMAT_CHANGE_TYPE nWhat)
+{
+ ResetConformanceTester();
+ FormattedField::FormatChanged(nWhat);
+}
+
+//------------------------------------------------------------------------------
+BOOL DoubleNumericField::CheckText(const XubString& sText) const
+{
+ // Ich wuerde das CheckText gern ueber den NumberFormatter laufen lassen (da gibt es schliesslich ein IsNumberFormat),
+ // aber der erkennt leider keine Fragmente (also zum Beispiel '1e', was waehrend der Eingabe zwangslaeufig irgendwann mal
+ // vorkommt), also dieser Umweg ueber einen SearchText.
+
+ if (!sText.Len())
+ return TRUE;
+
+ String sForceComplete = '_';
+ sForceComplete += sText;
+ sForceComplete += '_';
+
+ USHORT nStart = 0, nEnd = sForceComplete.Len();
+ BOOL bFound = m_pConformanceTester->SearchFrwrd(sForceComplete, &nStart, &nEnd);
+
+ if (bFound && (nStart == 0) && (nEnd == sForceComplete.Len() - 1))
+ return TRUE;
+
+ return FALSE;
+}
+
+//------------------------------------------------------------------------------
+void DoubleNumericField::ResetConformanceTester()
+{
+ String sDescription = String::CreateFromAscii(szNumericInput);
+ // the thousands and the decimal separator are language dependent
+ const SvNumberformat* pFormatEntry = ImplGetFormatter()->GetEntry(m_nFormatKey);
+ char cSepHexCode[3];
+
+ unsigned char cSeparator = pFormatEntry ? International(pFormatEntry->GetLanguage()).GetNumThousandSep() : ',';
+ sprintf(cSepHexCode, "%0X", cSeparator);
+ sDescription.SearchAndReplaceAscii("++", String::CreateFromAscii(cSepHexCode));
+
+ cSeparator = pFormatEntry ? International(pFormatEntry->GetLanguage()).GetNumDecimalSep() : '.';
+ sprintf(cSepHexCode, "%0X", cSeparator);
+ sDescription.SearchAndReplaceAscii("##", String::CreateFromAscii(cSepHexCode));
+
+ delete m_pConformanceTester;
+ m_pConformanceTester = new SearchText(SearchParam(sDescription, SearchParam::SRCH_REGEXP, FALSE), GetpApp()->GetAppInternational());
+}
+
+
+//==============================================================================
+
+//------------------------------------------------------------------------------
+DoubleCurrencyField::DoubleCurrencyField(Window* pParent, WinBits nStyle)
+ :FormattedField(pParent, nStyle)
+ ,m_bChangingFormat(FALSE)
+{
+ m_bPrependCurrSym = FALSE;
+
+ // initialize with a system currency format
+ SvNumberFormatter* pFormatter = StandardFormatter();
+ const NfCurrencyEntry* pSystemCurrency = pFormatter->MatchSystemCurrency();
+ if (!pSystemCurrency)
+ pSystemCurrency = &pFormatter->GetCurrencyEntry(LANGUAGE_SYSTEM);
+ if (pSystemCurrency)
+ m_sCurrencySymbol = pSystemCurrency->GetSymbol();
+ else
+ // no more options ...
+ m_sCurrencySymbol.AssignAscii("DM");
+ UpdateCurrencyFormat();
+}
+
+//------------------------------------------------------------------------------
+DoubleCurrencyField::DoubleCurrencyField(Window* pParent, const ResId& rResId)
+ :FormattedField(pParent, rResId)
+ ,m_bChangingFormat(FALSE)
+{
+ m_bPrependCurrSym = FALSE;
+
+ // initialize with a system currency format
+ SvNumberFormatter* pFormatter = StandardFormatter();
+ const NfCurrencyEntry* pSystemCurrency = pFormatter->MatchSystemCurrency();
+ if (!pSystemCurrency)
+ pSystemCurrency = &pFormatter->GetCurrencyEntry(LANGUAGE_SYSTEM);
+ if (pSystemCurrency)
+ m_sCurrencySymbol = pSystemCurrency->GetSymbol();
+ else
+ // no more options ...
+ m_sCurrencySymbol.AssignAscii("DM");
+ UpdateCurrencyFormat();
+}
+
+//------------------------------------------------------------------------------
+void DoubleCurrencyField::FormatChanged(FORMAT_CHANGE_TYPE nWhat)
+{
+ if (m_bChangingFormat)
+ {
+ FormattedField::FormatChanged(nWhat);
+ return;
+ }
+
+ switch (nWhat)
+ {
+ case FCT_FORMATTER:
+ case FCT_PRECISION:
+ case FCT_THOUSANDSSEP:
+ // the aspects which changed don't take our currency settings into account (in fact, they most probably
+ // destroyed them)
+ UpdateCurrencyFormat();
+ break;
+ case FCT_KEYONLY:
+ DBG_ERROR("DoubleCurrencyField::FormatChanged : somebody modified my key !");
+ // We always build our own format from the settings we get via special methods (setCurrencySymbol etc.).
+ // Nobody but ourself should modifiy the format key directly !
+ break;
+ }
+
+ FormattedField::FormatChanged(nWhat);
+}
+
+//------------------------------------------------------------------------------
+void DoubleCurrencyField::setCurrencySymbol(const String& _sSymbol)
+{
+ if (m_sCurrencySymbol == _sSymbol)
+ return;
+
+ m_sCurrencySymbol = _sSymbol;
+ UpdateCurrencyFormat();
+ FormatChanged(FCT_CURRENCY_SYMBOL);
+}
+
+//------------------------------------------------------------------------------
+void DoubleCurrencyField::setPrependCurrSym(BOOL _bPrepend)
+{
+ if (m_bPrependCurrSym == _bPrepend)
+ return;
+
+ m_bPrependCurrSym = _bPrepend;
+ UpdateCurrencyFormat();
+ FormatChanged(FCT_CURRSYM_POSITION);
+}
+
+//------------------------------------------------------------------------------
+void DoubleCurrencyField::UpdateCurrencyFormat()
+{
+ // the old settings
+ XubString sOldFormat;
+ LanguageType eLanguage;
+ GetFormat(sOldFormat, eLanguage);
+ BOOL bThSep = GetThousandsSep();
+ USHORT nDigits = GetDecimalDigits();
+
+ // build a new format string with the base class' and my own settings
+ International aIntl(eLanguage);
+ XubString sNewFormat;
+ if (bThSep)
+ {
+ sNewFormat = '#';
+ sNewFormat += aIntl.GetNumThousandSep();
+ sNewFormat.AppendAscii("##0");
+ }
+ else
+ sNewFormat = '0';
+
+ if (nDigits)
+ {
+ sNewFormat += aIntl.GetNumDecimalSep();
+
+ XubString sTemp;
+ sTemp.Fill(nDigits, '0');
+ sNewFormat += sTemp;
+ }
+
+ if (getPrependCurrSym())
+ {
+ XubString sSymbol = getCurrencySymbol();
+ sSymbol.EraseLeadingChars(' ');
+ sSymbol.EraseTrailingChars(' ');
+
+ XubString sTemp = sSymbol;
+ sTemp += ' ';
+ sTemp += sNewFormat;
+
+ // for negative values : $ -0.00, not -$ 0.00 ...
+ // (the real solution would be a possibility to choose a "positive currency format" and a "negative currency format" ...
+ // But not now ... (and hey, you could take a formatted field for this ....))
+ // FS - 31.03.00 74642
+ sTemp += ';';
+ sTemp += sSymbol;
+ sTemp.AppendAscii(" -");
+ sTemp += sNewFormat;
+
+ sNewFormat = sTemp;
+ }
+ else
+ {
+ XubString sTemp = getCurrencySymbol();
+ sTemp.EraseLeadingChars(' ');
+ sTemp.EraseTrailingChars(' ');
+
+ sNewFormat += ' ';
+ sNewFormat += sTemp;
+ }
+
+ // set this new basic format
+ m_bChangingFormat = TRUE;
+ SetFormat(sNewFormat, eLanguage);
+ m_bChangingFormat = FALSE;
+}
+
diff --git a/svtools/source/control/headbar.cxx b/svtools/source/control/headbar.cxx
new file mode 100644
index 000000000000..7bde8d02b60a
--- /dev/null
+++ b/svtools/source/control/headbar.cxx
@@ -0,0 +1,1673 @@
+/*************************************************************************
+ *
+ * $RCSfile: headbar.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SV_HEADBAR_CXX
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _TOOLS_LIST_HXX
+#include <tools/list.hxx>
+#endif
+
+#ifndef _VCL_APP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _VCL_HELP_HXX
+#include <vcl/help.hxx>
+#endif
+#ifndef _VCL_IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+
+#ifndef _HEADBAR_HXX
+#include <headbar.hxx>
+#endif
+
+// =======================================================================
+
+struct ImplHeadItem
+{
+ USHORT mnId;
+ HeaderBarItemBits mnBits;
+ long mnSize;
+ ULONG mnHelpId;
+ Image maImage;
+ XubString maOutText;
+ XubString maText;
+ XubString maHelpText;
+ void* mpUserData;
+};
+
+DECLARE_LIST( ImplHeadItemList, ImplHeadItem* );
+
+// =======================================================================
+
+#define HEAD_ARROWSIZE1 4
+#define HEAD_ARROWSIZE2 7
+
+#define HEADERBAR_TEXTOFF 2
+#define HEADERBAR_ARROWOFF 5
+#define HEADERBAR_SPLITOFF 3
+
+#define HEADERBAR_DRAGOFF 4
+#define HEADERBAR_DRAGOUTOFF 15
+
+#define HEAD_HITTEST_ITEM ((USHORT)0x0001)
+#define HEAD_HITTEST_DIVIDER ((USHORT)0x0002)
+
+// =======================================================================
+
+void HeaderBar::ImplInit( WinBits nWinStyle )
+{
+ mpItemList = new ImplHeadItemList;
+ mnBorderOff1 = 0;
+ mnBorderOff2 = 0;
+ mnOffset = 0;
+ mnDX = 0;
+ mnDY = 0;
+ mnDragSize = 0;
+ mnStartPos = 0;
+ mnDragPos = 0;
+ mnMouseOff = 0;
+ mnCurItemId = 0;
+ mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
+ mbDrag = FALSE;
+ mbItemDrag = FALSE;
+ mbOutDrag = FALSE;
+ mbItemMode = FALSE;
+
+ // StyleBits auswerten
+ if ( nWinStyle & WB_DRAG )
+ mbDragable = TRUE;
+ else
+ mbDragable = FALSE;
+ if ( nWinStyle & WB_BUTTONSTYLE )
+ mbButtonStyle = TRUE;
+ else
+ mbButtonStyle = FALSE;
+ if ( nWinStyle & WB_BORDER )
+ {
+ mnBorderOff1 = 1;
+ mnBorderOff2 = 1;
+ }
+ else
+ {
+ if ( nWinStyle & WB_BOTTOMBORDER )
+ mnBorderOff2 = 1;
+ }
+
+ ImplInitSettings( TRUE, TRUE, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+HeaderBar::HeaderBar( Window* pParent, WinBits nWinStyle ) :
+ Window( pParent, nWinStyle & WB_3DLOOK )
+{
+ ImplInit( nWinStyle );
+ SetSizePixel( CalcWindowSizePixel() );
+}
+
+// -----------------------------------------------------------------------
+
+HeaderBar::HeaderBar( Window* pParent, const ResId& rResId ) :
+ Window( pParent, rResId )
+{
+ ImplInit( rResId.aWinBits );
+}
+
+// -----------------------------------------------------------------------
+
+HeaderBar::~HeaderBar()
+{
+ // Alle Items loeschen
+ ImplHeadItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
+ }
+
+ delete mpItemList;
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ if ( bFont )
+ {
+ Font aFont;
+ aFont = rStyleSettings.GetToolFont();
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ SetZoomedPointFont( aFont );
+ }
+
+ if ( bForeground || bFont )
+ {
+ Color aColor;
+ if ( IsControlForeground() )
+ aColor = GetControlForeground();
+ else
+ aColor = rStyleSettings.GetButtonTextColor();
+ SetTextColor( aColor );
+ SetTextFillColor();
+ }
+
+ if ( bBackground )
+ {
+ Color aColor;
+ if ( IsControlBackground() )
+ aColor = GetControlBackground();
+ else
+ aColor = rStyleSettings.GetFaceColor();
+ SetBackground( aColor );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+long HeaderBar::ImplGetItemPos( USHORT nPos ) const
+{
+ long nX = -mnOffset;
+ for ( USHORT i = 0; i < nPos; i++ )
+ nX += mpItemList->GetObject( i )->mnSize;
+ return nX;
+}
+
+// -----------------------------------------------------------------------
+
+Rectangle HeaderBar::ImplGetItemRect( USHORT nPos ) const
+{
+ Rectangle aRect( ImplGetItemPos( nPos ), 0, 0, mnDY-1 );
+ aRect.Right() = aRect.Left() + mpItemList->GetObject( nPos )->mnSize - 1;
+ // Gegen Ueberlauf auf einigen Systemen testen
+ if ( aRect.Right() > 16000 )
+ aRect.Right() = 16000;
+ return aRect;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT HeaderBar::ImplHitTest( const Point& rPos,
+ long& nMouseOff, USHORT& nPos ) const
+{
+ ImplHeadItem* pItem;
+ USHORT nCount = (USHORT)mpItemList->Count();
+ BOOL bLastFixed = TRUE;
+ long nX = -mnOffset;
+
+ for ( USHORT i = 0; i < nCount; i++ )
+ {
+ pItem = mpItemList->GetObject( i );
+
+ if ( rPos.X() < (nX+pItem->mnSize) )
+ {
+ USHORT nMode;
+
+ if ( !bLastFixed && (rPos.X() < (nX+HEADERBAR_SPLITOFF)) )
+ {
+ nMode = HEAD_HITTEST_DIVIDER;
+ nPos = i-1;
+ nMouseOff = rPos.X()-nX+1;
+ }
+ else
+ {
+ nPos = i;
+
+ if ( !(pItem->mnBits & HIB_FIXED) && (rPos.X() >= (nX+pItem->mnSize-HEADERBAR_SPLITOFF)) )
+ {
+ nMode = HEAD_HITTEST_DIVIDER;
+ nMouseOff = rPos.X()-(nX+pItem->mnSize);
+ }
+ else
+ {
+ nMode = HEAD_HITTEST_ITEM;
+ nMouseOff = rPos.X()-nX;
+ }
+ }
+
+ return nMode;
+ }
+
+ if ( pItem->mnBits & HIB_FIXED )
+ bLastFixed = TRUE;
+ else
+ bLastFixed = FALSE;
+
+ nX += pItem->mnSize;
+ }
+
+ if ( !bLastFixed )
+ {
+ pItem = mpItemList->GetObject( nCount-1 );
+ if ( (pItem->mnSize < 4) && (rPos.X() < (nX+HEADERBAR_SPLITOFF)) )
+ {
+ nPos = nCount-1;
+ nMouseOff = rPos.X()-nX+1;
+ return HEAD_HITTEST_DIVIDER;
+ }
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::ImplInvertDrag( USHORT nStartPos, USHORT nEndPos )
+{
+ Rectangle aRect1 = ImplGetItemRect( nStartPos );
+ Rectangle aRect2 = ImplGetItemRect( nEndPos );
+ Point aStartPos = aRect1.Center();
+ Point aEndPos = aStartPos;
+ Rectangle aStartRect( aStartPos.X()-2, aStartPos.Y()-2,
+ aStartPos.X()+2, aStartPos.Y()+2 );
+
+ if ( nEndPos > nStartPos )
+ {
+ aStartPos.X() += 3;
+ aEndPos.X() = aRect2.Right()-6;
+ }
+ else
+ {
+ aStartPos.X() -= 3;
+ aEndPos.X() = aRect2.Left()+6;
+ }
+
+ SetRasterOp( ROP_INVERT );
+ DrawRect( aStartRect );
+ DrawLine( aStartPos, aEndPos );
+ if ( nEndPos > nStartPos )
+ {
+ DrawLine( Point( aEndPos.X()+1, aEndPos.Y()-3 ),
+ Point( aEndPos.X()+1, aEndPos.Y()+3 ) );
+ DrawLine( Point( aEndPos.X()+2, aEndPos.Y()-2 ),
+ Point( aEndPos.X()+2, aEndPos.Y()+2 ) );
+ DrawLine( Point( aEndPos.X()+3, aEndPos.Y()-1 ),
+ Point( aEndPos.X()+3, aEndPos.Y()+1 ) );
+ DrawPixel( Point( aEndPos.X()+4, aEndPos.Y() ) );
+ }
+ else
+ {
+ DrawLine( Point( aEndPos.X()-1, aEndPos.Y()-3 ),
+ Point( aEndPos.X()-1, aEndPos.Y()+3 ) );
+ DrawLine( Point( aEndPos.X()-2, aEndPos.Y()-2 ),
+ Point( aEndPos.X()-2, aEndPos.Y()+2 ) );
+ DrawLine( Point( aEndPos.X()-3, aEndPos.Y()-1 ),
+ Point( aEndPos.X()-3, aEndPos.Y()+1 ) );
+ DrawPixel( Point( aEndPos.X()-4, aEndPos.Y() ) );
+ }
+ SetRasterOp( ROP_OVERPAINT );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::ImplDrawItem( OutputDevice* pDev,
+ USHORT nPos, BOOL bHigh, BOOL bDrag,
+ const Rectangle& rItemRect,
+ const Rectangle* pRect,
+ ULONG nFlags )
+{
+ Rectangle aRect = rItemRect;
+
+ // Wenn kein Platz, dann brauchen wir auch nichts ausgeben
+ if ( aRect.GetWidth() <= 1 )
+ return;
+
+ // Feststellen, ob Rectangle ueberhaupt sichtbar
+ if ( pRect )
+ {
+ if ( aRect.Right() < pRect->Left() )
+ return;
+ else if ( aRect.Left() > pRect->Right() )
+ return;
+ }
+ else
+ {
+ if ( aRect.Right() < 0 )
+ return;
+ else if ( aRect.Left() > mnDX )
+ return;
+ }
+
+ ImplHeadItem* pItem = mpItemList->GetObject( nPos );
+ HeaderBarItemBits nBits = pItem->mnBits;
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ // Border muss nicht gemalt werden
+ aRect.Top() += mnBorderOff1;
+ aRect.Bottom() -= mnBorderOff2;
+
+ // Hintergrund loeschen
+ if ( !pRect || bDrag )
+ {
+ if ( bDrag )
+ {
+ pDev->SetLineColor();
+ pDev->SetFillColor( rStyleSettings.GetCheckedColor() );
+ pDev->DrawRect( aRect );
+ }
+ else
+ pDev->DrawWallpaper( aRect, GetBackground() );
+ }
+
+ // Trennlinie malen
+ pDev->SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ pDev->DrawLine( Point( aRect.Right(), aRect.Top() ),
+ Point( aRect.Right(), aRect.Bottom() ) );
+
+ // ButtonStyle malen
+ if ( mbButtonStyle && !(nBits & HIB_FLAT) )
+ {
+ if ( aRect.GetWidth() >= 2 )
+ {
+ if ( bHigh )
+ pDev->SetLineColor( rStyleSettings.GetShadowColor() );
+ else
+ pDev->SetLineColor( rStyleSettings.GetLightColor() );
+ pDev->DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom() ) );
+ pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-1, aRect.Top() ) );
+ if ( !bHigh )
+ {
+ pDev->SetLineColor( rStyleSettings.GetShadowColor() );
+ pDev->DrawLine( Point( aRect.Right()-1, aRect.Top()+1 ),
+ Point( aRect.Right()-1, aRect.Bottom() ) );
+ pDev->DrawLine( Point( aRect.Left()+1, aRect.Bottom() ),
+ Point( aRect.Right()-1, aRect.Bottom() ) );
+ }
+ }
+
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+
+ // Wenn selektiert, verschiebt sich das Rechteck um 1 Pixel
+ if ( bHigh )
+ aRect.Move( 1, 1 );
+ }
+
+ // Wenn kein Platz, dann brauchen wir auch nichts ausgeben
+ if ( aRect.GetWidth() < 1 )
+ return;
+
+ // Positionen und Groessen berechnen und Inhalt ausgeben
+ pItem->maOutText = pItem->maText;
+ Size aImageSize = pItem->maImage.GetSizePixel();
+ Size aTxtSize( pDev->GetTextWidth( pItem->maOutText ), 0 );
+ if ( pItem->maOutText.Len() )
+ aTxtSize.Height() = pDev->GetTextHeight();
+ long nArrowWidth = 0;
+ if ( nBits & (HIB_UPARROW | HIB_DOWNARROW) )
+ nArrowWidth = HEAD_ARROWSIZE2+HEADERBAR_ARROWOFF;
+
+ // Wenn kein Platz fuer Image, dann nicht ausgeben
+ long nTestHeight = aImageSize.Height();
+ if ( !(nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE)) )
+ nTestHeight += aTxtSize.Height();
+ if ( (aImageSize.Width() > aRect.GetWidth()) || (nTestHeight > aRect.GetHeight()) )
+ {
+ aImageSize.Width() = 0;
+ aImageSize.Height() = 0;
+ }
+
+ // Text auf entsprechende Laenge kuerzen
+ BOOL bLeftText = FALSE;
+ long nMaxTxtWidth = aRect.GetWidth()-(HEADERBAR_TEXTOFF*2)-nArrowWidth;
+ if ( nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE) )
+ nMaxTxtWidth -= aImageSize.Width();
+ long nTxtWidth = aTxtSize.Width();
+ if ( nTxtWidth > nMaxTxtWidth )
+ {
+ bLeftText = TRUE;
+ // 3 == Len of "..."
+ pItem->maOutText.AppendAscii( "..." );
+ do
+ {
+ pItem->maOutText.Erase( pItem->maOutText.Len()-3-1, 1 );
+ nTxtWidth = pDev->GetTextWidth( pItem->maOutText );
+ }
+ while ( (nTxtWidth > nMaxTxtWidth) && (pItem->maOutText.Len() > 3) );
+ if ( pItem->maOutText.Len() == 3 )
+ {
+ nTxtWidth = 0;
+ pItem->maOutText.Erase();
+ }
+ }
+
+ // Text/Imageposition berechnen
+ long nTxtPos;
+ if ( !bLeftText && (nBits & HIB_RIGHT) )
+ {
+ nTxtPos = aRect.Right()-nTxtWidth-HEADERBAR_TEXTOFF;
+ if ( nBits & HIB_RIGHTIMAGE )
+ nTxtPos -= aImageSize.Width();
+ }
+ else if ( !bLeftText && (nBits & HIB_CENTER) )
+ {
+ long nTempWidth = nTxtWidth;
+ if ( nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE) )
+ nTempWidth += aImageSize.Width();
+ nTxtPos = aRect.Left()+(aRect.GetWidth()-nTempWidth)/2;
+ if ( nBits & HIB_LEFTIMAGE )
+ nTxtPos += aImageSize.Width();
+ if ( nArrowWidth )
+ {
+ if ( nTxtPos+nTxtWidth+nArrowWidth >= aRect.Right() )
+ {
+ nTxtPos = aRect.Left()+HEADERBAR_TEXTOFF;
+ if ( nBits & HIB_LEFTIMAGE )
+ nTxtPos += aImageSize.Width();
+ }
+ }
+ }
+ else
+ {
+ nTxtPos = aRect.Left()+HEADERBAR_TEXTOFF;
+ if ( nBits & HIB_LEFTIMAGE )
+ nTxtPos += aImageSize.Width();
+ if ( nBits & HIB_RIGHT )
+ nTxtPos += nArrowWidth;
+ }
+
+ // TextPosition berechnen
+ long nTxtPosY;
+ if ( pItem->maOutText.Len() || (nArrowWidth && aTxtSize.Height()) )
+ {
+ if ( nBits & HIB_TOP )
+ {
+ nTxtPosY = aRect.Top();
+ if ( !(nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE)) )
+ nTxtPosY += aImageSize.Height();
+ }
+ else if ( nBits & HIB_BOTTOM )
+ nTxtPosY = aRect.Bottom()-aTxtSize.Height();
+ else
+ {
+ long nTempHeight = aTxtSize.Height();
+ if ( !(nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE)) )
+ nTempHeight += aImageSize.Height();
+ nTxtPosY = aRect.Top()+((aRect.GetHeight()-nTempHeight)/2);
+ if ( !(nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE)) )
+ nTxtPosY += aImageSize.Height();
+ }
+ }
+
+ // Text ausgebeben
+ if ( pItem->maOutText.Len() )
+ {
+ if ( IsEnabled() )
+ pDev->DrawText( Point( nTxtPos, nTxtPosY ), pItem->maOutText );
+ else
+ pDev->DrawCtrlText( Point( nTxtPos, nTxtPosY ), pItem->maOutText, 0, STRING_LEN, TEXT_DRAW_DISABLE );
+ }
+
+ // Wenn Image vorhanden, Position berechnen und ausgeben
+ long nImagePosY;
+ if ( aImageSize.Width() && aImageSize.Height() )
+ {
+ long nImagePos = nTxtPos;
+ if ( nBits & HIB_LEFTIMAGE )
+ {
+ nImagePos -= aImageSize.Width();
+ if ( nBits & HIB_RIGHT )
+ nImagePos -= nArrowWidth;
+ }
+ else if ( nBits & HIB_RIGHTIMAGE )
+ {
+ nImagePos += nTxtWidth;
+ if ( !(nBits & HIB_RIGHT) )
+ nImagePos += nArrowWidth;
+ }
+ else
+ {
+ if ( nBits & HIB_RIGHT )
+ nImagePos = aRect.Right()-aImageSize.Width();
+ else if ( nBits & HIB_CENTER )
+ nImagePos = aRect.Left()+(aRect.GetWidth()-aImageSize.Width())/2;
+ else
+ nImagePos = aRect.Left()+HEADERBAR_TEXTOFF;
+ }
+
+ if ( nBits & HIB_TOP )
+ nImagePosY = aRect.Top();
+ else if ( nBits & HIB_BOTTOM )
+ {
+ nImagePosY = aRect.Bottom()-aImageSize.Height();
+ if ( !(nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE)) )
+ nImagePosY -= aTxtSize.Height();
+ }
+ else
+ {
+ long nTempHeight = aImageSize.Height();
+ if ( !(nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE)) )
+ nTempHeight += aTxtSize.Height();
+ nImagePosY = aRect.Top()+((aRect.GetHeight()-nTempHeight)/2);
+ }
+ if ( nImagePos+aImageSize.Width() <= aRect.Right() )
+ {
+ USHORT nStyle = 0;
+ if ( !IsEnabled() )
+ nStyle |= IMAGE_DRAW_DISABLE;
+ pDev->DrawImage( Point( nImagePos, nImagePosY ), pItem->maImage, nStyle );
+ }
+ }
+
+ if ( nBits & (HIB_UPARROW | HIB_DOWNARROW) )
+ {
+ long nArrowX = nTxtPos;
+ if ( nBits & HIB_RIGHT )
+ nArrowX -= nArrowWidth;
+ else
+ nArrowX += nTxtWidth+HEADERBAR_ARROWOFF;
+ if ( !(nBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE)) && !pItem->maText.Len() )
+ {
+ if ( nBits & HIB_RIGHT )
+ nArrowX -= aImageSize.Width();
+ else
+ nArrowX += aImageSize.Width();
+ }
+
+ // Feststellen, ob Platz genug ist, das Item zu malen
+ BOOL bDraw = TRUE;
+ if ( nArrowX < aRect.Left()+HEADERBAR_TEXTOFF )
+ bDraw = FALSE;
+ else if ( nArrowX+HEAD_ARROWSIZE2 > aRect.Right() )
+ bDraw = FALSE;
+
+ if ( bDraw )
+ {
+ long nArrowY;
+ if ( aTxtSize.Height() )
+ nArrowY = nTxtPosY+(aTxtSize.Height()/2);
+ else if ( aImageSize.Width() && aImageSize.Height() )
+ nArrowY = nImagePosY+(aImageSize.Height()/2);
+ else
+ {
+ if ( nBits & HIB_TOP )
+ nArrowY = aRect.Top()+1;
+ else if ( nBits & HIB_BOTTOM )
+ nArrowY = aRect.Bottom()-HEAD_ARROWSIZE2-1;
+ else
+ nArrowY = aRect.Top()+((aRect.GetHeight()-HEAD_ARROWSIZE2)/2);;
+ }
+ nArrowY -= HEAD_ARROWSIZE1-1;
+ if ( nBits & HIB_DOWNARROW )
+ {
+ pDev->SetLineColor( rStyleSettings.GetLightColor() );
+ pDev->DrawLine( Point( nArrowX, nArrowY ),
+ Point( nArrowX+HEAD_ARROWSIZE2, nArrowY ) );
+ pDev->DrawLine( Point( nArrowX, nArrowY ),
+ Point( nArrowX+HEAD_ARROWSIZE1, nArrowY+HEAD_ARROWSIZE2 ) );
+ pDev->SetLineColor( rStyleSettings.GetShadowColor() );
+ pDev->DrawLine( Point( nArrowX+HEAD_ARROWSIZE1, nArrowY+HEAD_ARROWSIZE2 ),
+ Point( nArrowX+HEAD_ARROWSIZE2, nArrowY ) );
+ }
+ else
+ {
+ pDev->SetLineColor( rStyleSettings.GetLightColor() );
+ pDev->DrawLine( Point( nArrowX, nArrowY+HEAD_ARROWSIZE2 ),
+ Point( nArrowX+HEAD_ARROWSIZE1, nArrowY ) );
+ pDev->SetLineColor( rStyleSettings.GetShadowColor() );
+ pDev->DrawLine( Point( nArrowX, nArrowY+HEAD_ARROWSIZE2 ),
+ Point( nArrowX+HEAD_ARROWSIZE2, nArrowY+HEAD_ARROWSIZE2 ) );
+ pDev->DrawLine( Point( nArrowX+HEAD_ARROWSIZE2, nArrowY+HEAD_ARROWSIZE2 ),
+ Point( nArrowX+HEAD_ARROWSIZE1, nArrowY ) );
+ }
+ }
+ }
+
+ // Gegebenenfalls auch UserDraw aufrufen
+ if ( nBits & HIB_USERDRAW )
+ {
+ Region aRegion( aRect );
+ if ( pRect )
+ aRegion.Intersect( *pRect );
+ pDev->SetClipRegion( aRegion );
+ UserDrawEvent aODEvt( pDev, aRect, pItem->mnId );
+ UserDraw( aODEvt );
+ pDev->SetClipRegion();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::ImplDrawItem( USHORT nPos, BOOL bHigh, BOOL bDrag,
+ const Rectangle* pRect )
+{
+ Rectangle aRect = ImplGetItemRect( nPos );
+ ImplDrawItem( this, nPos, bHigh, bDrag, aRect, pRect, 0 );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::ImplUpdate( USHORT nPos, BOOL bEnd, BOOL bDirect )
+{
+ if ( IsVisible() && IsUpdateMode() )
+ {
+ if ( !bDirect )
+ {
+ Rectangle aRect;
+ USHORT nItemCount = (USHORT)(mpItemList->Count());
+ if ( nPos < nItemCount )
+ aRect = ImplGetItemRect( nPos );
+ else
+ {
+ aRect.Bottom() = mnDY-1;
+ if ( nItemCount )
+ aRect.Left() = ImplGetItemRect( nItemCount-1 ).Right();
+ }
+ if ( bEnd )
+ aRect.Right() = mnDX-1;
+ aRect.Top() += mnBorderOff1;
+ aRect.Bottom() -= mnBorderOff2;
+ Invalidate( aRect );
+ }
+ else
+ {
+ for ( USHORT i = nPos; i < mpItemList->Count(); i++ )
+ ImplDrawItem( i );
+ if ( bEnd )
+ {
+ Rectangle aRect = ImplGetItemRect( (USHORT)mpItemList->Count() );
+ aRect.Left() = aRect.Right();
+ aRect.Right() = mnDX-1;
+ if ( aRect.Left() < aRect.Right() )
+ {
+ aRect.Top() += mnBorderOff1;
+ aRect.Bottom() -= mnBorderOff2;
+ Erase( aRect );
+ }
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::ImplStartDrag( const Point& rMousePos, BOOL bCommand )
+{
+ USHORT nPos;
+ USHORT nHitTest = ImplHitTest( rMousePos, mnMouseOff, nPos );
+ if ( nHitTest )
+ {
+ mbDrag = FALSE;
+ ImplHeadItem* pItem = mpItemList->GetObject( nPos );
+ if ( nHitTest & HEAD_HITTEST_DIVIDER )
+ mbDrag = TRUE;
+ else
+ {
+ if ( ((pItem->mnBits & HIB_CLICKABLE) && !(pItem->mnBits & HIB_FLAT)) ||
+ (mbDragable && !(pItem->mnBits & HIB_FIXEDPOS)) )
+ {
+ mbItemMode = TRUE;
+ mbDrag = TRUE;
+ if ( bCommand )
+ {
+ if ( mbDragable )
+ mbItemDrag = TRUE;
+ else
+ {
+ mbItemMode = FALSE;
+ mbDrag = FALSE;
+ }
+ }
+ }
+ else
+ {
+ if ( !bCommand )
+ {
+ mnCurItemId = pItem->mnId;
+ Select();
+ mnCurItemId = 0;
+ }
+ }
+ }
+
+ if ( mbDrag )
+ {
+ mbOutDrag = FALSE;
+ mnCurItemId = pItem->mnId;
+ mnItemDragPos = nPos;
+ StartTracking();
+ mnStartPos = rMousePos.X()-mnMouseOff;
+ mnDragPos = mnStartPos;
+ StartDrag();
+ if ( mbItemMode )
+ ImplDrawItem( nPos, TRUE, mbItemDrag );
+ else
+ {
+ Rectangle aSizeRect( mnDragPos, 0, mnDragPos, mnDragSize+mnDY );
+ ShowTracking( aSizeRect, SHOWTRACK_SPLIT );
+ }
+ }
+ else
+ mnMouseOff = 0;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::ImplDrag( const Point& rMousePos )
+{
+ BOOL bNewOutDrag;
+ USHORT nPos = GetItemPos( mnCurItemId );
+
+ mnDragPos = rMousePos.X()-mnMouseOff;
+ if ( mbItemMode )
+ {
+ Rectangle aItemRect = ImplGetItemRect( nPos );
+ if ( aItemRect.IsInside( rMousePos ) )
+ bNewOutDrag = FALSE;
+ else
+ bNewOutDrag = TRUE;
+
+ // Evt. ItemDrag anschalten
+ if ( bNewOutDrag && mbDragable && !mbItemDrag &&
+ !(mpItemList->GetObject(nPos)->mnBits & HIB_FIXEDPOS) )
+ {
+ if ( (rMousePos.Y() >= aItemRect.Top()) && (rMousePos.Y() <= aItemRect.Bottom()) )
+ {
+ mbItemDrag = TRUE;
+ ImplDrawItem( nPos, TRUE, mbItemDrag );
+ }
+ }
+
+ USHORT nOldItemDragPos = mnItemDragPos;
+ if ( mbItemDrag )
+ {
+ if ( (rMousePos.Y() < -HEADERBAR_DRAGOUTOFF) || (rMousePos.Y() > mnDY+HEADERBAR_DRAGOUTOFF) )
+ bNewOutDrag = TRUE;
+ else
+ bNewOutDrag = FALSE;
+
+ if ( bNewOutDrag )
+ mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
+ else
+ {
+ USHORT nTempId = GetItemId( Point( rMousePos.X(), 2 ) );
+ if ( nTempId )
+ mnItemDragPos = GetItemPos( nTempId );
+ else
+ {
+ if ( rMousePos.X() <= 0 )
+ mnItemDragPos = 0;
+ else
+ mnItemDragPos = GetItemCount()-1;
+ }
+
+ // Nicht verschiebbare Items aussparen
+ if ( mnItemDragPos < nPos )
+ {
+ while ( (mpItemList->GetObject(mnItemDragPos)->mnBits & HIB_FIXEDPOS) &&
+ (mnItemDragPos < nPos) )
+ mnItemDragPos++;
+ }
+ else if ( mnItemDragPos > nPos )
+ {
+ while ( (mpItemList->GetObject(mnItemDragPos)->mnBits & HIB_FIXEDPOS) &&
+ (mnItemDragPos > nPos) )
+ mnItemDragPos--;
+ }
+ }
+
+ if ( (mnItemDragPos != nOldItemDragPos) &&
+ (nOldItemDragPos != nPos) &&
+ (nOldItemDragPos != HEADERBAR_ITEM_NOTFOUND) )
+ {
+ ImplInvertDrag( nPos, nOldItemDragPos );
+ ImplDrawItem( nOldItemDragPos );
+ }
+ }
+
+ if ( bNewOutDrag != mbOutDrag )
+ ImplDrawItem( nPos, !bNewOutDrag, mbItemDrag );
+
+ if ( mbItemDrag )
+ {
+ if ( (mnItemDragPos != nOldItemDragPos) &&
+ (mnItemDragPos != nPos) &&
+ (mnItemDragPos != HEADERBAR_ITEM_NOTFOUND) )
+ {
+ ImplDrawItem( mnItemDragPos, FALSE, TRUE );
+ ImplInvertDrag( nPos, mnItemDragPos );
+ }
+ }
+
+ mbOutDrag = bNewOutDrag;
+ }
+ else
+ {
+ Rectangle aItemRect = ImplGetItemRect( nPos );
+ if ( mnDragPos < aItemRect.Left() )
+ mnDragPos = aItemRect.Left();
+ if ( (mnDragPos < 0) || (mnDragPos > mnDX-1) )
+ HideTracking();
+ else
+ {
+ Rectangle aSizeRect( mnDragPos, 0, mnDragPos, mnDragSize+mnDY );
+ ShowTracking( aSizeRect, SHOWTRACK_SPLIT );
+ }
+ }
+
+ Drag();
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::ImplEndDrag( BOOL bCancel )
+{
+ HideTracking();
+
+ if ( bCancel || mbOutDrag )
+ {
+ if ( mbItemMode && (!mbOutDrag || mbItemDrag) )
+ {
+ USHORT nPos = GetItemPos( mnCurItemId );
+ ImplDrawItem( nPos );
+ }
+
+ mnCurItemId = 0;
+ }
+ else
+ {
+ USHORT nPos = GetItemPos( mnCurItemId );
+ if ( mbItemMode )
+ {
+ if ( mbItemDrag )
+ {
+ Pointer aPointer( POINTER_ARROW );
+ SetPointer( aPointer );
+ if ( (mnItemDragPos != nPos) &&
+ (mnItemDragPos != HEADERBAR_ITEM_NOTFOUND) )
+ {
+ ImplInvertDrag( nPos, mnItemDragPos );
+ MoveItem( mnCurItemId, mnItemDragPos );
+ }
+ else
+ ImplDrawItem( nPos );
+ }
+ else
+ {
+ Select();
+ ImplUpdate( nPos );
+ }
+ }
+ else
+ {
+ long nDelta = mnDragPos - mnStartPos;
+ if ( nDelta )
+ {
+ ImplHeadItem* pItem = mpItemList->GetObject( nPos );
+ pItem->mnSize += nDelta;
+ ImplUpdate( nPos, TRUE );
+ }
+ }
+ }
+
+ mbDrag = FALSE;
+ EndDrag();
+ mnCurItemId = 0;
+ mnItemDragPos = HEADERBAR_ITEM_NOTFOUND;
+ mbOutDrag = FALSE;
+ mbItemMode = FALSE;
+ mbItemDrag = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() )
+ {
+ if ( rMEvt.GetClicks() == 2 )
+ {
+ long nTemp;
+ USHORT nPos;
+ USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp, nPos );
+ if ( nHitTest )
+ {
+ ImplHeadItem* pItem = mpItemList->GetObject( nPos );
+ if ( nHitTest & HEAD_HITTEST_DIVIDER )
+ mbItemMode = FALSE;
+ else
+ mbItemMode = TRUE;
+ mnCurItemId = pItem->mnId;
+ DoubleClick();
+ mbItemMode = FALSE;
+ mnCurItemId = 0;
+ }
+ }
+ else
+ ImplStartDrag( rMEvt.GetPosPixel(), FALSE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::MouseMove( const MouseEvent& rMEvt )
+{
+ long nTemp1;
+ USHORT nTemp2;
+ PointerStyle eStyle = POINTER_ARROW;
+ USHORT nHitTest = ImplHitTest( rMEvt.GetPosPixel(), nTemp1, nTemp2 );
+
+ if ( nHitTest & HEAD_HITTEST_DIVIDER )
+ eStyle = POINTER_HSIZEBAR;
+ Pointer aPtr( eStyle );
+ SetPointer( aPtr );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::Tracking( const TrackingEvent& rTEvt )
+{
+ Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel();
+
+ if ( rTEvt.IsTrackingEnded() )
+ ImplEndDrag( rTEvt.IsTrackingCanceled() );
+ else
+ ImplDrag( aMousePos );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::Paint( const Rectangle& rRect )
+{
+ if ( mnBorderOff1 || mnBorderOff2 )
+ {
+ SetLineColor( GetSettings().GetStyleSettings().GetDarkShadowColor() );
+ if ( mnBorderOff1 )
+ DrawLine( Point( 0, 0 ), Point( mnDX-1, 0 ) );
+ if ( mnBorderOff2 )
+ DrawLine( Point( 0, mnDY-1 ), Point( mnDX-1, mnDY-1 ) );
+ }
+
+ USHORT nCurItemPos;
+ if ( mbDrag )
+ nCurItemPos = GetItemPos( mnCurItemId );
+ else
+ nCurItemPos = HEADERBAR_ITEM_NOTFOUND;
+ USHORT nItemCount = (USHORT)mpItemList->Count();
+ for ( USHORT i = 0; i < nItemCount; i++ )
+ ImplDrawItem( i, (i == nCurItemPos) ? TRUE : FALSE, FALSE, &rRect );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize,
+ ULONG nFlags )
+{
+ Point aPos = pDev->LogicToPixel( rPos );
+ Size aSize = pDev->LogicToPixel( rSize );
+ Rectangle aRect( aPos, aSize );
+ Font aFont = GetDrawPixelFont( pDev );
+
+ pDev->Push();
+ pDev->SetMapMode();
+ pDev->SetFont( aFont );
+ if ( nFlags & WINDOW_DRAW_MONO )
+ pDev->SetTextColor( Color( COL_BLACK ) );
+ else
+ pDev->SetTextColor( GetTextColor() );
+ pDev->SetTextFillColor();
+
+ if ( !(nFlags & WINDOW_DRAW_NOBACKGROUND) )
+ {
+ pDev->DrawWallpaper( aRect, GetBackground() );
+ if ( mnBorderOff1 || mnBorderOff2 )
+ {
+ pDev->SetLineColor( GetSettings().GetStyleSettings().GetDarkShadowColor() );
+ if ( mnBorderOff1 )
+ pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right(), aRect.Top() ) );
+ if ( mnBorderOff2 )
+ pDev->DrawLine( Point( aRect.Left(), aRect.Bottom() ), Point( aRect.Right(), aRect.Bottom() ) );
+ }
+ }
+
+ Rectangle aItemRect( aRect );
+// aItemRect.Bottom()--;
+ USHORT nItemCount = (USHORT)mpItemList->Count();
+ for ( USHORT i = 0; i < nItemCount; i++ )
+ {
+ aItemRect.Left() = aRect.Left()+ImplGetItemPos( i );
+ aItemRect.Right() = aItemRect.Left() + mpItemList->GetObject( i )->mnSize - 1;
+ // Gegen Ueberlauf auf einigen Systemen testen
+ if ( aItemRect.Right() > 16000 )
+ aItemRect.Right() = 16000;
+ Region aRegion( aRect );
+ pDev->SetClipRegion( aRegion );
+ ImplDrawItem( pDev, i, FALSE, FALSE, aItemRect, &aRect, nFlags );
+ pDev->SetClipRegion();
+ }
+
+ pDev->Pop();
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::Resize()
+{
+ Size aSize = GetOutputSizePixel();
+ if ( IsVisible() && (mnDY != aSize.Height()) )
+ Invalidate();
+ mnDX = aSize.Width();
+ mnDY = aSize.Height();
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.IsMouseEvent() && (rCEvt.GetCommand() == COMMAND_STARTDRAG) && !mbDrag )
+ {
+ ImplStartDrag( rCEvt.GetMousePosPixel(), TRUE );
+ return;
+ }
+
+ Window::Command( rCEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::RequestHelp( const HelpEvent& rHEvt )
+{
+ USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ if ( nItemId )
+ {
+ if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) )
+ {
+ Rectangle aItemRect = GetItemRect( nItemId );
+ Point aPt = OutputToScreenPixel( aItemRect.TopLeft() );
+ aItemRect.Left() = aPt.X();
+ aItemRect.Top() = aPt.Y();
+ aPt = OutputToScreenPixel( aItemRect.BottomRight() );
+ aItemRect.Right() = aPt.X();
+ aItemRect.Bottom() = aPt.Y();
+
+ XubString aStr = GetHelpText( nItemId );
+ if ( !aStr.Len() || !(rHEvt.GetMode() & HELPMODE_BALLOON) )
+ {
+ ImplHeadItem* pItem = mpItemList->GetObject( GetItemPos( nItemId ) );
+ // Wir zeigen die Quick-Hilfe nur an, wenn Text nicht
+ // vollstaendig sichtbar, ansonsten zeigen wir den Hilfetext
+ // an, wenn das Item keinen Text besitzt
+ if ( pItem->maOutText != pItem->maText )
+ aStr = pItem->maText;
+ else if ( pItem->maText.Len() )
+ aStr.Erase();
+ }
+
+ if ( aStr.Len() )
+ {
+ if ( rHEvt.GetMode() & HELPMODE_BALLOON )
+ Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr );
+ else
+ Help::ShowQuickHelp( this, aItemRect, aStr );
+ return;
+ }
+ }
+ else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
+ {
+ ULONG nHelpId = GetHelpId( nItemId );
+ if ( nHelpId )
+ {
+ // Wenn eine Hilfe existiert, dann ausloesen
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ pHelp->Start( nHelpId );
+ return;
+ }
+ }
+ }
+
+ Window::RequestHelp( rHEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::StateChanged( StateChangedType nType )
+{
+ Window::StateChanged( nType );
+
+ if ( nType == STATE_CHANGE_ENABLE )
+ Invalidate();
+ else if ( (nType == STATE_CHANGE_ZOOM) ||
+ (nType == STATE_CHANGE_CONTROLFONT) )
+ {
+ ImplInitSettings( TRUE, FALSE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ {
+ ImplInitSettings( FALSE, TRUE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ ImplInitSettings( FALSE, FALSE, TRUE );
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
+ (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
+ ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+ {
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::UserDraw( const UserDrawEvent& )
+{
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::StartDrag()
+{
+ maStartDragHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::Drag()
+{
+ maDragHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::EndDrag()
+{
+ maEndDragHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::Select()
+{
+ maSelectHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::DoubleClick()
+{
+ maDoubleClickHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::InsertItem( USHORT nItemId, const Image& rImage,
+ long nSize, HeaderBarItemBits nBits, USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
+ "HeaderBar::InsertItem(): ItemId already exists" );
+
+ // Item anlegen und in die Liste einfuegen
+ ImplHeadItem* pItem = new ImplHeadItem;
+ pItem->mnId = nItemId;
+ pItem->mnBits = nBits;
+ pItem->mnSize = nSize;
+ pItem->maImage = rImage;
+ pItem->mpUserData = 0;
+ mpItemList->Insert( pItem, nPos );
+
+ // Ausgabe updaten
+ ImplUpdate( nPos, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::InsertItem( USHORT nItemId, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits, USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
+ "HeaderBar::InsertItem(): ItemId already exists" );
+
+ // Item anlegen und in die Liste einfuegen
+ ImplHeadItem* pItem = new ImplHeadItem;
+ pItem->mnId = nItemId;
+ pItem->mnBits = nBits;
+ pItem->mnSize = nSize;
+ pItem->mnHelpId = 0;
+ pItem->maText = rText;
+ pItem->mpUserData = 0;
+ mpItemList->Insert( pItem, nPos );
+
+ // Ausgabe updaten
+ ImplUpdate( nPos, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::InsertItem( USHORT nItemId,
+ const Image& rImage, const XubString& rText,
+ long nSize, HeaderBarItemBits nBits,
+ USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "HeaderBar::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == HEADERBAR_ITEM_NOTFOUND,
+ "HeaderBar::InsertItem(): ItemId already exists" );
+
+ // Item anlegen und in die Liste einfuegen
+ ImplHeadItem* pItem = new ImplHeadItem;
+ pItem->mnId = nItemId;
+ pItem->mnBits = nBits;
+ pItem->mnSize = nSize;
+ pItem->mnHelpId = 0;
+ pItem->maImage = rImage;
+ pItem->maText = rText;
+ pItem->mpUserData = 0;
+ mpItemList->Insert( pItem, nPos );
+
+ // Ausgabe updaten
+ ImplUpdate( nPos, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::RemoveItem( USHORT nItemId )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ {
+ ImplHeadItem* pItem = mpItemList->Remove( nPos );
+ delete pItem;
+ ImplUpdate( nPos, TRUE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::MoveItem( USHORT nItemId, USHORT nNewPos )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ {
+ if ( nPos != nNewPos )
+ {
+ ImplHeadItem* pItem = mpItemList->Remove( nPos );
+ if ( nNewPos < nPos )
+ nPos = nNewPos;
+ mpItemList->Insert( pItem, nNewPos );
+ ImplUpdate( nPos, TRUE );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::Clear()
+{
+ // Alle Items loeschen
+ ImplHeadItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
+ }
+ mpItemList->Clear();
+
+ ImplUpdate( 0, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::SetOffset( long nNewOffset )
+{
+ // Hier erstmal neu zeichnen, damit mit alten Offset noch das
+ // richtige gemalt wird
+ //Update();
+
+ // Bereich verschieben
+ Rectangle aRect( 0, mnBorderOff1, mnDX-1, mnDY-mnBorderOff1-mnBorderOff2-1 );
+ long nDelta = mnOffset-nNewOffset;
+ mnOffset = nNewOffset;
+ Scroll( nDelta, 0, aRect );
+}
+
+// -----------------------------------------------------------------------
+
+USHORT HeaderBar::GetItemCount() const
+{
+ return (USHORT)mpItemList->Count();
+}
+
+// -----------------------------------------------------------------------
+
+USHORT HeaderBar::GetItemPos( USHORT nItemId ) const
+{
+ ImplHeadItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mnId == nItemId )
+ return (USHORT)mpItemList->GetCurPos();
+ pItem = mpItemList->Next();
+ }
+
+ return HEADERBAR_ITEM_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT HeaderBar::GetItemId( USHORT nPos ) const
+{
+ ImplHeadItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem )
+ return pItem->mnId;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT HeaderBar::GetItemId( const Point& rPos ) const
+{
+ USHORT nPos = 0;
+ while ( nPos < mpItemList->Count() )
+ {
+ if ( ImplGetItemRect( nPos ).IsInside( rPos ) )
+ return GetItemId( nPos );
+
+ nPos++;
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+Rectangle HeaderBar::GetItemRect( USHORT nItemId ) const
+{
+ Rectangle aRect;
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ aRect = ImplGetItemRect( nPos );
+ return aRect;
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::SetItemSize( USHORT nItemId, long nNewSize )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ {
+ ImplHeadItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem->mnSize != nNewSize )
+ {
+ pItem->mnSize = nNewSize;
+ ImplUpdate( nPos, TRUE );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+long HeaderBar::GetItemSize( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mnSize;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::SetItemBits( USHORT nItemId, HeaderBarItemBits nNewBits )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ {
+ ImplHeadItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem->mnBits != nNewBits )
+ {
+ pItem->mnBits = nNewBits;
+ ImplUpdate( nPos );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+HeaderBarItemBits HeaderBar::GetItemBits( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mnBits;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::SetItemData( USHORT nItemId, void* pNewData )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ {
+ mpItemList->GetObject( nPos )->mpUserData = pNewData;
+ ImplUpdate( nPos );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void* HeaderBar::GetItemData( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mpUserData;
+ else
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::SetItemImage( USHORT nItemId, const Image& rImage )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ {
+ mpItemList->GetObject( nPos )->maImage = rImage;
+ ImplUpdate( nPos );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+Image HeaderBar::GetItemImage( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maImage;
+ else
+ return Image();
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::SetItemText( USHORT nItemId, const XubString& rText )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ {
+ mpItemList->GetObject( nPos )->maText = rText;
+ ImplUpdate( nPos );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+XubString HeaderBar::GetItemText( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maText;
+ else
+ return String();
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::SetHelpText( USHORT nItemId, const XubString& rText )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ mpItemList->GetObject( nPos )->maHelpText = rText;
+}
+
+// -----------------------------------------------------------------------
+
+XubString HeaderBar::GetHelpText( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ {
+ ImplHeadItem* pItem = mpItemList->GetObject( nPos );
+ if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ {
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId );
+ }
+
+ return pItem->maHelpText;
+ }
+ else
+ return XubString();
+}
+
+// -----------------------------------------------------------------------
+
+void HeaderBar::SetHelpId( USHORT nItemId, ULONG nHelpId )
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+}
+
+// -----------------------------------------------------------------------
+
+ULONG HeaderBar::GetHelpId( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+ if ( nPos != HEADERBAR_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mnHelpId;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+Size HeaderBar::CalcWindowSizePixel() const
+{
+ long nMaxImageSize = 0;
+ Size aSize( 0, GetTextHeight() );
+
+ ImplHeadItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ // Image-Groessen beruecksichtigen
+ long nImageHeight = pItem->maImage.GetSizePixel().Height();
+ if ( !(pItem->mnBits & (HIB_LEFTIMAGE | HIB_RIGHTIMAGE)) && pItem->maText.Len() )
+ nImageHeight += aSize.Height();
+ if ( nImageHeight > nMaxImageSize )
+ nMaxImageSize = nImageHeight;
+
+ // Breite aufaddieren
+ aSize.Width() += pItem->mnSize;
+
+ pItem = mpItemList->Next();
+ }
+
+ if ( nMaxImageSize > aSize.Height() )
+ aSize.Height() = nMaxImageSize;
+
+ // Border aufaddieren
+ if ( mbButtonStyle )
+ aSize.Height() += 4;
+ else
+ aSize.Height() += 2;
+ aSize.Height() += mnBorderOff1+mnBorderOff2;
+
+ return aSize;
+}
diff --git a/svtools/source/control/makefile.mk b/svtools/source/control/makefile.mk
new file mode 100644
index 000000000000..f3f0e97e9b47
--- /dev/null
+++ b/svtools/source/control/makefile.mk
@@ -0,0 +1,141 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=ctrl
+TARGETSTAT=_ctrl
+LIBTARGET=NO
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES= ctrltool.cxx \
+ ctrlbox.cxx \
+ stdctrl.cxx \
+ stdmenu.cxx \
+ valueset.cxx \
+ tabbar.cxx \
+ headbar.cxx \
+ prgsbar.cxx \
+ ruler.cxx \
+ taskbar.cxx \
+ taskbox.cxx \
+ taskstat.cxx \
+ taskmisc.cxx \
+ calendar.cxx \
+ filectrl.cxx \
+ scrwin.cxx \
+ reginfo.cxx \
+ groupset.cxx \
+ fmtfield.cxx
+
+.IF "$(GUI)"!="DOS"
+SRCFILES= ctrltool.src \
+ ctrlbox.src \
+ calendar.src \
+ filectrl.src
+.ENDIF
+
+SLOFILES= $(SLO)$/ctrltool.obj \
+ $(SLO)$/ctrlbox.obj \
+ $(SLO)$/stdctrl.obj \
+ $(SLO)$/stdmenu.obj \
+ $(SLO)$/valueset.obj \
+ $(SLO)$/tabbar.obj \
+ $(SLO)$/headbar.obj \
+ $(SLO)$/prgsbar.obj \
+ $(SLO)$/ruler.obj \
+ $(SLO)$/taskbar.obj \
+ $(SLO)$/taskbox.obj \
+ $(SLO)$/taskstat.obj \
+ $(SLO)$/taskmisc.obj \
+ $(SLO)$/calendar.obj \
+ $(SLO)$/filectrl.obj \
+ $(SLO)$/scrwin.obj \
+ $(SLO)$/reginfo.obj \
+ $(SLO)$/groupset.obj \
+ $(SLO)$/fmtfield.obj
+
+# statisch fuer setup
+
+OBJFILES= $(OBJ)$/prgsbar.obj \
+ $(OBJ)$/stdctrl.obj \
+ $(OBJ)$/reginfo.obj \
+ $(OBJ)$/tabbar.obj
+
+
+LIB1TARGET= $(SLB)$/$(TARGET).lib
+LIB1OBJFILES= $(SLOFILES)
+
+LIB2TARGET= $(LB)$/$(TARGETSTAT).lib
+LIB2OBJFILES= $(OBJFILES)
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/control/prgsbar.cxx b/svtools/source/control/prgsbar.cxx
new file mode 100644
index 000000000000..e370d9d87c22
--- /dev/null
+++ b/svtools/source/control/prgsbar.cxx
@@ -0,0 +1,270 @@
+/*************************************************************************
+ *
+ * $RCSfile: prgsbar.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SV_PRGSBAR_CXX
+
+#ifndef _TOOLS_DEBUGS_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _VCL_STATUS_HXX
+#include <vcl/status.hxx>
+#endif
+#ifndef _PRGSBAR_HXX
+#include <prgsbar.hxx>
+#endif
+
+// =======================================================================
+
+#define PROGRESSBAR_OFFSET 3
+#define PROGRESSBAR_WIN_OFFSET 2
+
+// =======================================================================
+
+void ProgressBar::ImplInit()
+{
+ mnPercent = 0;
+ mbCalcNew = TRUE;
+
+ ImplInitSettings( TRUE, TRUE, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+ProgressBar::ProgressBar( Window* pParent, WinBits nWinStyle ) :
+ Window( pParent, nWinStyle )
+{
+ SetOutputSizePixel( Size( 150, 20 ) );
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+ProgressBar::ProgressBar( Window* pParent, const ResId& rResId ) :
+ Window( pParent, rResId )
+{
+ ImplInit();
+}
+
+// -----------------------------------------------------------------------
+
+ProgressBar::~ProgressBar()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+/* !!! Derzeit unterstuetzen wir keine Textausgaben
+ if ( bFont )
+ {
+ Font aFont;
+ aFont = rStyleSettings.GetAppFont();
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ SetZoomedPointFont( aFont );
+ }
+*/
+
+ if ( bBackground )
+ {
+ Color aColor;
+ if ( IsControlBackground() )
+ aColor = GetControlBackground();
+ else
+ aColor = rStyleSettings.GetFaceColor();
+ SetBackground( aColor );
+ }
+
+ if ( bForeground || bFont )
+ {
+ Color aColor = rStyleSettings.GetHighlightColor();
+ if ( IsControlForeground() )
+ aColor = GetControlForeground();
+ if ( aColor.IsRGBEqual( GetBackground().GetColor() ) )
+ {
+ if ( aColor.GetLuminance() > 100 )
+ aColor.DecreaseLuminance( 64 );
+ else
+ aColor.IncreaseLuminance( 64 );
+ }
+ SetLineColor();
+ SetFillColor( aColor );
+/* !!! Derzeit unterstuetzen wir keine Textausgaben
+ SetTextColor( aColor );
+ SetTextFillColor();
+*/
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::ImplDrawProgress( USHORT nOldPerc, USHORT nNewPerc )
+{
+ if ( mbCalcNew )
+ {
+ mbCalcNew = FALSE;
+
+ Size aSize = GetOutputSizePixel();
+ mnPrgsHeight = aSize.Height()-(PROGRESSBAR_WIN_OFFSET*2);
+ mnPrgsWidth = (mnPrgsHeight*2)/3;
+ maPos.Y() = PROGRESSBAR_WIN_OFFSET;
+ long nMaxWidth = (aSize.Width()-(PROGRESSBAR_WIN_OFFSET*2)+PROGRESSBAR_OFFSET);
+ USHORT nMaxCount = (USHORT)(nMaxWidth / (mnPrgsWidth+PROGRESSBAR_OFFSET));
+ if ( nMaxCount <= 1 )
+ nMaxCount = 1;
+ else
+ {
+ while ( ((10000/(10000/nMaxCount))*(mnPrgsWidth+PROGRESSBAR_OFFSET)) > nMaxWidth )
+ nMaxCount--;
+ }
+ mnPercentCount = 10000/nMaxCount;
+ nMaxWidth = ((10000/(10000/nMaxCount))*(mnPrgsWidth+PROGRESSBAR_OFFSET))-PROGRESSBAR_OFFSET;
+ maPos.X() = (aSize.Width()-nMaxWidth)/2;
+ }
+
+ ::DrawProgress( this, maPos, PROGRESSBAR_OFFSET, mnPrgsWidth, mnPrgsHeight,
+ nOldPerc*100, nNewPerc*100, mnPercentCount );
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::Paint( const Rectangle& )
+{
+ ImplDrawProgress( 0, mnPercent );
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::Resize()
+{
+ mbCalcNew = TRUE;
+ if ( IsReallyVisible() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::SetValue( USHORT nNewPercent )
+{
+ DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" );
+
+ if ( nNewPercent < mnPercent )
+ {
+ mbCalcNew = TRUE;
+ mnPercent = nNewPercent;
+ if ( IsReallyVisible() )
+ {
+ Invalidate();
+ Update();
+ }
+ }
+ else
+ {
+ ImplDrawProgress( mnPercent, nNewPercent );
+ mnPercent = nNewPercent;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::StateChanged( StateChangedType nType )
+{
+/* !!! Derzeit unterstuetzen wir keine Textausgaben
+ if ( (nType == STATE_CHANGE_ZOOM) ||
+ (nType == STATE_CHANGE_CONTROLFONT) )
+ {
+ ImplInitSettings( TRUE, FALSE, FALSE );
+ Invalidate();
+ }
+ else
+*/
+ if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ {
+ ImplInitSettings( FALSE, TRUE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ ImplInitSettings( FALSE, FALSE, TRUE );
+ Invalidate();
+ }
+
+ Window::StateChanged( nType );
+}
+
+// -----------------------------------------------------------------------
+
+void ProgressBar::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ Invalidate();
+ }
+
+ Window::DataChanged( rDCEvt );
+}
+
diff --git a/svtools/source/control/reginfo.cxx b/svtools/source/control/reginfo.cxx
new file mode 100644
index 000000000000..40c76ca1f9fe
--- /dev/null
+++ b/svtools/source/control/reginfo.cxx
@@ -0,0 +1,785 @@
+/*************************************************************************
+ *
+ * $RCSfile: reginfo.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifdef MAC
+#include "mac_start.h"
+
+#ifndef __TYPES__
+ #include <Types.h>
+#endif
+
+#ifndef __RESOURCES__
+ #include <Resources.h>
+#endif
+
+#ifndef __FILES__
+ #include <Files.h>
+#endif
+
+#ifndef __ERRORS__
+ #include <Errors.h>
+#endif
+
+#ifndef __FOLDERS__
+ #include <Folders.h>
+#endif
+
+#ifndef __SCRIPT__
+ #include <script.h>
+#endif
+
+#ifndef __FINDER__
+ #include <finder.h>
+#endif
+#include "mac_end.h"
+#endif
+
+#include "reginfo.hxx"
+
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _OSL_THREAD_H_
+#include <osl/thread.h>
+#endif
+
+String aEmptyString;
+
+#define MAXREGVALUE 200
+
+#if defined(WIN) || defined(WNT)
+
+#include <tools/svwin.h>
+
+#define DBG_HDL DBG_ASSERT(pImp->bValidGroup, "Keine Gruppe gesetzt"); \
+ if( !pImp->bValidGroup ) return
+
+struct RegInfo_Impl
+{
+ HKEY aGroupHdl;
+ BOOL bValidGroup;
+};
+
+RegInfo::RegInfo()
+{
+ pImp=new RegInfo_Impl;
+ pImp->bValidGroup = FALSE;
+}
+
+RegInfo::~RegInfo()
+{
+ if(pImp->bValidGroup)
+ RegCloseKey( pImp->aGroupHdl );
+ delete pImp;
+}
+
+String RegInfo::GetKeyName( USHORT nKey ) const
+{
+ DBG_HDL aEmptyString;
+ char aBuffer[MAXREGVALUE];
+ RegEnumKey( pImp->aGroupHdl, nKey, aBuffer, MAXREGVALUE );
+ return String( UniString::CreateFromAscii(aBuffer) );
+}
+
+USHORT RegInfo::GetKeyCount() const
+{
+ DBG_HDL 0;
+#ifdef WNT
+ DWORD nKeys;
+ DWORD Dum1=10, Dum2, Dum3, Dum4, Dum5, Dum6, Dum7;
+ char s[10];
+ FILETIME aDumFileTime;
+ RegQueryInfoKey( pImp->aGroupHdl, s, &Dum1, 0, &nKeys, &Dum2, &Dum3,
+ &Dum4, &Dum5, &Dum6, &Dum7, &aDumFileTime );
+ return (USHORT) nKeys;
+#else
+ char aBuffer[MAXREGVALUE];
+ USHORT n=0;
+ while(RegEnumKey(
+ pImp->aGroupHdl, n, aBuffer, MAXREGVALUE) == ERROR_SUCCESS)
+ n++;
+ return n;
+#endif
+}
+
+inline String MakeAppGroupString_Impl( const String &rGroup )
+{
+ String aGroup( UniString::CreateFromAscii("SvAppGroups\\") );
+ aGroup+=rGroup;
+ return aGroup;
+}
+
+void RegInfo::SetAppGroup( const String& rGroup )
+{
+ aCurrentGroup = MakeAppGroupString_Impl(rGroup);
+ if( pImp->bValidGroup )
+ {
+ RegCloseKey( pImp->aGroupHdl );
+ pImp->bValidGroup = FALSE;
+ }
+ ByteString aBStr( aCurrentGroup, osl_getThreadTextEncoding() );
+ RegCreateKey( HKEY_CLASSES_ROOT, aBStr.GetBuffer(), &pImp->aGroupHdl );
+ pImp->bValidGroup = TRUE;
+}
+
+void RegInfo::DeleteAppGroup( const String &rGroup )
+{
+ String aOldGroup = aCurrentGroup;
+ SetAppGroup( rGroup );
+ DBG_HDL;
+ USHORT nMax = GetKeyCount();
+ for( USHORT n = nMax; n--; )
+ {
+ String aKey( GetKeyName( n ));
+ DeleteKey( aKey );
+ }
+ RegCloseKey( pImp->aGroupHdl );
+
+ ByteString aBStr( rGroup, osl_getThreadTextEncoding() );
+ RegDeleteKey( HKEY_CLASSES_ROOT, aBStr.GetBuffer() );
+ pImp->bValidGroup = FALSE;
+ if( rGroup != aOldGroup )
+ SetAppGroup( aOldGroup );
+}
+
+BOOL ReadKey_Impl( const String& rKey,
+ HKEY aHdl, String& rResult )
+{
+ char s[MAXREGVALUE];
+ LONG aLen=MAXREGVALUE;
+
+ ByteString aBStr( rKey, osl_getThreadTextEncoding() );
+ LONG nRes = RegQueryValue( aHdl, aBStr.GetBuffer(), s, &aLen);
+ if(nRes == ERROR_SUCCESS)
+ {
+ rResult = UniString::CreateFromAscii(s);
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+String RegInfo::ReadKey( const String& rKey ) const
+{
+ DBG_HDL aEmptyString;
+ String aRes;
+ if(ReadKey_Impl( rKey, pImp->aGroupHdl, aRes))
+ return aRes;
+ else
+ return aEmptyString;
+}
+
+String RegInfo::ReadKey( const String& rKey, const String &rDefault ) const
+{
+ DBG_HDL aEmptyString;
+ String aRes;
+ if(ReadKey_Impl( rKey, pImp->aGroupHdl, aRes))
+ return aRes;
+ else
+ return rDefault;
+}
+
+void RegInfo::WriteKey( const String& rKey, const String& rValue )
+{
+ DBG_HDL;
+ ByteString aBStr( rKey, osl_getThreadTextEncoding() );
+ ByteString aBStr1( rValue, osl_getThreadTextEncoding() );
+ RegSetValue( pImp->aGroupHdl, aBStr.GetBuffer(), REG_SZ, aBStr1.GetBuffer(), 0);
+}
+
+
+void RegInfo::DeleteKey( const String& rKey )
+{
+ DBG_HDL;
+ ByteString aBStr( rKey, osl_getThreadTextEncoding() );
+ RegDeleteKey( pImp->aGroupHdl, aBStr.GetBuffer() );
+}
+
+#elif defined(OS2)
+
+#define INCL_WINSHELLDATA
+#include <tools/svpm.h>
+
+struct RegInfo_Impl
+{
+ char *pKeyList;
+ String aCurrentApp;
+ void BuildKeyList( const String &rGroup );
+};
+
+void RegInfo_Impl::BuildKeyList( const String &rGroup )
+{
+ USHORT nLen = 0;
+ do
+ {
+ nLen+=1000;
+ delete[] pKeyList;
+ pKeyList = new char[nLen];
+ *(int *)pKeyList = 0;
+ }
+ while( PrfQueryProfileString(
+ HINI_USERPROFILE, rGroup,
+ 0, 0, pKeyList, nLen) == nLen);
+}
+
+
+RegInfo::RegInfo()
+{
+ pImp=new RegInfo_Impl;
+ pImp->pKeyList = 0;
+}
+
+RegInfo::~RegInfo()
+{
+ delete[] pImp->pKeyList;
+ delete pImp;
+}
+
+inline String MakeAppGroupString_Impl( const String &rGroup )
+{
+ String aGroup("SvAppGroups:");
+ aGroup+=rGroup;
+ return aGroup;
+}
+
+String RegInfo::GetKeyName( USHORT nKey ) const
+{
+ if( !pImp->pKeyList )
+ pImp->BuildKeyList(pImp->aCurrentApp);
+
+ const char *pc=pImp->pKeyList;
+ for( USHORT n=0; n<nKey; n++ )
+ while(*pc++);
+
+ return String(pc);
+}
+
+USHORT RegInfo::GetKeyCount() const
+{
+ if( !pImp->pKeyList )
+ pImp->BuildKeyList( pImp->aCurrentApp);
+
+ const char *pc=pImp->pKeyList;
+ USHORT nRet=0;
+ while(*pc)
+ {
+ while(*pc++);
+ nRet++;
+ }
+ return nRet;
+}
+
+void RegInfo::SetAppGroup( const String& rGroup )
+{
+ delete[] pImp->pKeyList;
+ pImp->pKeyList = 0;
+ aCurrentGroup = rGroup;
+ pImp->aCurrentApp = MakeAppGroupString_Impl( rGroup );
+}
+
+void RegInfo::DeleteAppGroup( const String &rGroup )
+{
+ PrfWriteProfileString(
+ HINI_USERPROFILE, MakeAppGroupString_Impl( rGroup ), 0, 0);
+}
+
+
+String RegInfo::ReadKey( const String& rKey ) const
+{
+ char *pBuffer= new char[MAXREGVALUE];
+ *pBuffer=0;
+ PrfQueryProfileString(
+ HINI_USERPROFILE, pImp->aCurrentApp, rKey, 0, pBuffer, MAXREGVALUE);
+ String aRet(pBuffer);
+ delete[] pBuffer;
+ return aRet;
+}
+
+
+String RegInfo::ReadKey( const String& rKey, const String &rDefault ) const
+{
+ char *pBuffer= new char[MAXREGVALUE];
+ *pBuffer=0;
+ PrfQueryProfileString(
+ HINI_USERPROFILE, pImp->aCurrentApp, rKey, rDefault, pBuffer, MAXREGVALUE);
+ String aRet(pBuffer);
+ delete[] pBuffer;
+ return aRet;
+}
+
+
+void RegInfo::WriteKey( const String& rKey, const String& rValue )
+{
+ PrfWriteProfileString(
+ HINI_USERPROFILE, pImp->aCurrentApp, rKey, rValue);
+}
+
+void RegInfo::DeleteKey( const String& rKey )
+{
+ PrfWriteProfileString(
+ HINI_USERPROFILE, pImp->aCurrentApp, rKey, 0);
+}
+
+#elif defined(MAC)
+
+/* Idee:
+
+ In eine Resource SVðð (SV<Apfel><Apfel>) sind die Resource IDs
+ der Gruppen Ÿber den Namen der Resource zugŠnglich.
+
+ †ber die aktuelle Gruppe sind die Values Ÿber den Namen der Resource
+ als Key zugŠnglich ...
+*/
+
+// Wir tuen so, als wŠren es "normale" SV-Resourcen
+
+#define kAPPInfo 'SVðð'
+
+//****************************************************
+
+#pragma options align=mac68k
+
+typedef struct
+{
+ OSType nResType; // kAPPInfo + k
+}
+ SVGroupInfo, *SVGroupInfoPtr, **SVGroupInfoHdl;
+
+//****************************************************
+
+typedef struct
+{
+ USHORT nValueLen;
+ char aValue[1]; // LŠnge wie in nLen
+}
+ SVKeyInfo, *SVKeyInfoPtr, **SVKeyInfoHdl;
+
+//****************************************************
+
+#pragma options align=reset
+
+//****************************************************
+
+struct RegInfo_Impl
+{
+ short nResFile;
+ OSType nCurrentGroup;
+ String aCurrentName;
+
+ SVGroupInfoHdl GetNamedInfo(const String& rName);
+
+ BOOL FindInfoFile( const String& rName, FSSpec *pResult );
+};
+
+//****************************************************
+
+SVGroupInfoHdl RegInfo_Impl::GetNamedInfo(const String& rName)
+{
+ String aName(rName);
+ short nOldRes = CurResFile();
+ UseResFile(nResFile);
+
+ SVGroupInfoHdl hResult = (SVGroupInfoHdl) Get1NamedResource(kAPPInfo,rName.GetPascalStr());
+
+ UseResFile(nOldRes);
+
+ return hResult;
+}
+
+//****************************************************
+
+BOOL RegInfo_Impl::FindInfoFile( const String& rName, FSSpec *pResult )
+{
+ OSErr nErr;
+ long nDirID;
+ short nVRefNum;
+ BOOL bResult = FALSE;
+
+ nErr = FindFolder( kOnSystemDisk, kPreferencesFolderType,
+ kCreateFolder, &nVRefNum, &nDirID );
+
+ if ( nErr == noErr )
+ {
+ nErr = FSMakeFSSpec( nVRefNum, nDirID, rName.GetPascalStr(), pResult );
+ if ( nErr == fnfErr )
+ {
+ FSpCreateResFile( pResult, 'SDsv', 'DATA', smRoman );
+ nErr = FSMakeFSSpec( nVRefNum, nDirID, rName.GetPascalStr(), pResult );
+ }
+ if ( nErr == noErr )
+ {
+ FInfo aInfo;
+ nErr = FSpGetFInfo( pResult, &aInfo );
+ if ( ( nErr == noErr ) && ! ( aInfo.fdFlags & kIsInvisible ) )
+ {
+ aInfo.fdFlags |= kIsInvisible;
+ nErr = FSpSetFInfo( pResult, &aInfo );
+ }
+ bResult = TRUE;
+ }
+ }
+
+ return bResult;
+}
+
+//****************************************************
+
+RegInfo::RegInfo()
+{
+ FSSpec aFile;
+
+ if ( !pImp->FindInfoFile( "svdbt.dll", &aFile ) )
+ {
+ pImp = NULL;
+ return;
+ }
+
+ pImp=new RegInfo_Impl;
+
+ short nOldRes = CurResFile();
+ pImp->nResFile = FSpOpenResFile( &aFile, fsRdWrPerm );
+ pImp->nCurrentGroup = 0L;
+ UseResFile( nOldRes );
+
+ if ( pImp->nResFile < 0 )
+ {
+ delete pImp;
+ pImp = NULL;
+ }
+}
+
+//****************************************************
+
+RegInfo::~RegInfo()
+{
+ if (pImp)
+ {
+ CloseResFile( pImp->nResFile );
+ delete pImp;
+ }
+}
+
+//****************************************************
+
+String RegInfo::GetKeyName( USHORT nKey ) const
+{
+ String aResult;
+
+ if (!pImp || !pImp -> nCurrentGroup)
+ return aResult;
+
+ short nOldRes = CurResFile();
+ UseResFile(pImp -> nResFile);
+
+ SVKeyInfoHdl hKeyInfo = (SVKeyInfoHdl) Get1IndResource(pImp -> nCurrentGroup,nKey + 1);
+
+ if (hKeyInfo)
+ {
+ Str255 aName;
+ ResType nType;
+ short nMacKey;
+
+ GetResInfo((Handle) hKeyInfo,&nMacKey,&nType,aName);
+ if (ResError() == noErr)
+ aResult = String((char*) &aName[1], aName[0]);
+ }
+
+ UseResFile(nOldRes);
+ return aResult;
+}
+
+//****************************************************
+
+USHORT RegInfo::GetKeyCount() const
+{
+ USHORT nResult = 0;
+
+ if (pImp -> nCurrentGroup)
+ {
+ short nOldRes = CurResFile();
+ UseResFile(pImp -> nResFile);
+
+ nResult = Count1Resources(pImp -> nCurrentGroup);
+ UseResFile(nOldRes);
+ }
+ return nResult;
+}
+
+//****************************************************
+
+void RegInfo::SetAppGroup( const String& rGroup )
+{
+ if (!pImp)
+ return;
+
+ pImp->aCurrentName = rGroup;
+ SVGroupInfoHdl hGroup = pImp -> GetNamedInfo(rGroup);
+ if (hGroup)
+ {
+ pImp->nCurrentGroup = (*hGroup)-> nResType;
+ ReleaseResource((Handle) hGroup);
+ }
+ else
+ pImp->nCurrentGroup = 0L;
+}
+
+//****************************************************
+
+void RegInfo::DeleteAppGroup( const String &rGroup )
+{
+ SVGroupInfoHdl hToDelete = pImp -> GetNamedInfo(rGroup);
+ if (hToDelete)
+ {
+ if ((*hToDelete)-> nResType == pImp->nCurrentGroup)
+ {
+ pImp->nCurrentGroup = 0L;
+ pImp->aCurrentName.Erase();
+ }
+ RemoveResource((Handle) hToDelete);
+ }
+}
+
+//****************************************************
+
+String RegInfo::ReadKey( const String& rKey ) const
+{
+ String aResult;
+
+ if (!pImp || !pImp -> nCurrentGroup)
+ return aResult;
+
+ short nOldRes = CurResFile();
+ UseResFile(pImp -> nResFile);
+
+ SVKeyInfoHdl hKeyInfo = (SVKeyInfoHdl) Get1NamedResource(pImp->nCurrentGroup,rKey.GetPascalStr());
+
+ if (hKeyInfo)
+ {
+ HLock((Handle) hKeyInfo);
+ aResult = String((*hKeyInfo)->aValue, (*hKeyInfo)->nValueLen);
+ HUnlock((Handle) hKeyInfo);
+
+ ReleaseResource((Handle) hKeyInfo);
+ }
+
+ UseResFile(nOldRes);
+ return aResult;
+}
+
+//****************************************************
+
+String RegInfo::ReadKey( const String& rKey, const String &rDefault ) const
+{
+ String aResult = ReadKey(rKey);
+ if (!aResult.Len())
+ return rDefault;
+ else
+ return aResult;
+}
+
+//****************************************************
+
+void RegInfo::WriteKey( const String& rKey, const String& rValue )
+{
+ if (!pImp)
+ return;
+
+ short nOldRes = CurResFile();
+ UseResFile(pImp -> nResFile);
+
+ // Wenn wir noch keine Resource zur aktuellen Gruppe haben ...
+ if (!pImp -> nCurrentGroup)
+ {
+ // ... dann muessen wir hier eine Anlegen
+
+ if (!pImp -> aCurrentName.Len())
+ return; // Kein aktueller Name ???
+
+ short nNewId = Unique1ID(kAPPInfo);
+
+ SVGroupInfoHdl hNewInfo = (SVGroupInfoHdl) NewHandle(sizeof(SVGroupInfo));
+
+ // Die Neue Resource liegt im Bereich Ÿber "SVðð"
+ pImp -> nCurrentGroup = kAPPInfo + nNewId;
+
+ (*(hNewInfo))-> nResType = pImp -> nCurrentGroup;
+ DBG_ASSERT(CurResFile() == pImp -> nResFile,"wrong ResFile");
+ AddResource((Handle) hNewInfo ,kAPPInfo, nNewId, pImp -> aCurrentName.GetPascalStr());
+ ReleaseResource((Handle) hNewInfo);
+ }
+
+ SVKeyInfoHdl hKeyInfo = (SVKeyInfoHdl) Get1NamedResource(pImp -> nCurrentGroup,rKey.GetPascalStr());
+ int nNewSize = rValue.Len() + sizeof(USHORT);
+
+ // Haben wir zu diesem Key schon eine Resource ?
+ if (hKeyInfo)
+ {
+ int nSize = GetHandleSize((Handle) hKeyInfo);
+ OSErr nMemErr = noErr;
+ if (nSize < nNewSize)
+ {
+ SetHandleSize((Handle) hKeyInfo,nNewSize);
+ nMemErr = MemError();
+ }
+
+ if (nMemErr == noErr)
+ {
+ (*hKeyInfo)->nValueLen = rValue.Len();
+ BlockMoveData(rValue.GetStr(), (*hKeyInfo)->aValue, rValue.Len());
+ ChangedResource((Handle) hKeyInfo);
+ }
+ else // Handle konnte nicht groesser werden
+ RemoveResource((Handle) hKeyInfo);
+ }
+ else
+ {
+ // Resource zu diesemm Key neu anlegen
+
+ hKeyInfo = (SVKeyInfoHdl) NewHandle(nNewSize);
+ if (hKeyInfo)
+ {
+ short nNewId = Unique1ID(pImp -> nCurrentGroup);
+
+ (*hKeyInfo)->nValueLen = rValue.Len();
+ BlockMoveData(rValue.GetStr(), (*hKeyInfo)->aValue, rValue.Len());
+
+ AddResource((Handle) hKeyInfo ,pImp -> nCurrentGroup, nNewId, rKey.GetPascalStr());
+ }
+ }
+
+ UseResFile(nOldRes);
+}
+
+//****************************************************
+
+void RegInfo::DeleteKey( const String& rKey )
+{
+ // Wenn wir noch keine aktuellen Gruppe haben ...
+ if (!pImp -> nCurrentGroup)
+ return;
+
+ String aKey(rKey);
+
+ short nOldRes = CurResFile();
+ UseResFile(pImp -> nResFile);
+
+ SVKeyInfoHdl hKeyInfo = (SVKeyInfoHdl) Get1NamedResource(pImp -> nCurrentGroup,rKey.GetPascalStr());
+
+ if (hKeyInfo)
+ RemoveResource((Handle) hKeyInfo);
+
+ UseResFile(nOldRes);
+}
+
+//****************************************************
+
+#else
+
+RegInfo::RegInfo()
+{
+}
+
+
+RegInfo::~RegInfo()
+{
+}
+
+String RegInfo::GetKeyName( USHORT nKey ) const
+{
+ return aEmptyString;
+}
+
+USHORT RegInfo::GetKeyCount() const
+{
+ return 0;
+}
+
+void RegInfo::SetAppGroup( const String& rGroup )
+{
+ return ;
+}
+
+void RegInfo::DeleteAppGroup( const String &rGroup )
+{
+ return;
+}
+
+String RegInfo::ReadKey( const String& rKey ) const
+{
+ return aEmptyString;
+}
+
+String RegInfo::ReadKey( const String& rKey, const String &rDefault ) const
+{
+ return aEmptyString;
+}
+
+void RegInfo::WriteKey( const String& rKey, const String& rValue )
+{
+ return;
+}
+
+void RegInfo::DeleteKey( const String& rKey )
+{
+ return;
+}
+
+#endif
diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx
new file mode 100644
index 000000000000..6124f5f8b042
--- /dev/null
+++ b/svtools/source/control/ruler.cxx
@@ -0,0 +1,3064 @@
+/*************************************************************************
+ *
+ * $RCSfile: ruler.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string.h>
+
+#ifndef _INTN_HXX
+#include <tools/intn.hxx>
+#endif
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _SV_SVAPP_HXX
+#ifdef VCL
+#include <vcl/svapp.hxx>
+#else
+#include <vcl/svapp.hxx>
+#endif
+#endif
+#ifndef _POLY_HXX
+#include <vcl/poly.hxx>
+#endif
+
+#define _SV_RULER_CXX
+#define private public
+#include <ruler.hxx>
+
+// =======================================================================
+
+#define RULER_OFF 2
+#define RULER_TEXTOFF 2
+#define RULER_RESIZE_OFF 4
+#define RULER_LINE_WIDTH 7
+#define RULER_MIN_SIZE 3
+
+#define RULER_TICK1_WIDTH 1
+#define RULER_TICK2_WIDTH 3
+#define RULER_TICK3_WIDTH 5
+
+#define RULER_VAR_SIZE 8
+
+#define RULER_TAB_HEIGHT2 2
+#define RULER_TAB_WIDTH2 2
+#define RULER_TAB_CWIDTH 8
+#define RULER_TAB_CWIDTH2 4
+#define RULER_TAB_CWIDTH3 4
+#define RULER_TAB_CWIDTH4 2
+#define RULER_TAB_DHEIGHT 4
+#define RULER_TAB_DHEIGHT2 1
+#define RULER_TAB_DWIDTH 5
+#define RULER_TAB_DWIDTH2 3
+#define RULER_TAB_DWIDTH3 3
+#define RULER_TAB_DWIDTH4 1
+
+#define RULER_UPDATE_LINES 0x01
+#define RULER_UPDATE_DRAW 0x02
+
+#define RULER_CLIP 150
+
+// =======================================================================
+
+#define RULER_UNIT_MM 0
+#define RULER_UNIT_CM 1
+#define RULER_UNIT_M 2
+#define RULER_UNIT_KM 3
+#define RULER_UNIT_INCH 4
+#define RULER_UNIT_FOOT 5
+#define RULER_UNIT_MILE 6
+#define RULER_UNIT_POINT 7
+#define RULER_UNIT_PICA 8
+#define RULER_UNIT_COUNT 9
+
+struct ImplRulerUnitData
+{
+ MapUnit eMapUnit; // MAP_UNIT zum Umrechnen
+ long nTickUnit; // Teiler fuer Einheit
+ long nTick1; // Schrittweite
+ long nTick2; // Tick fuer halbe Werte
+ long nTick3; // Tick fuer Zahlenausgabe
+ long n100THMM; // Teiler fuer Einheit
+ USHORT nUnitDigits; // Anzahl Nachkommastellen
+ sal_Char aUnitStr[8]; // Einheiten-String
+};
+
+static ImplRulerUnitData aImplRulerUnitTab[RULER_UNIT_COUNT] =
+{
+{ MAP_100TH_MM, 100, 25, 50, 100, 100, 3, " mm" }, // MM
+{ MAP_100TH_MM, 1000, 250, 500, 1000, 1000, 3, " cm" }, // CM
+{ MAP_MM, 1000, 250, 500, 1000, 10000, 4, " m" }, // M
+{ MAP_CM, 100000, 25000, 50000, 100000, 100000, 6, " km" }, // KM
+{ MAP_100TH_INCH, 100, 10, 50, 100, 2540, 3, "\"" }, // INCH
+{ MAP_100TH_INCH, 1200, 120, 600, 1200, 30480, 3, "'" }, // FOOT
+{ MAP_10TH_INCH, 633600, 63360, 316800, 633600, 1609344, 4, " miles" }, // MILE
+{ MAP_POINT, 1, 12, 12, 36, 353, 2, " pt" }, // POINT
+{ MAP_100TH_MM, 423, 423, 423, 846, 423, 3, " pi" } // PICA
+};
+
+// =======================================================================
+
+struct ImplRulerHitTest
+{
+ long nPos;
+ RulerType eType;
+ USHORT nAryPos;
+ USHORT mnDragSize;
+ BOOL bSize;
+ BOOL bSizeBar;
+};
+
+// =======================================================================
+
+ImplRulerData::ImplRulerData()
+{
+ memset( this, 0, sizeof( ImplRulerData ) );
+
+ // PageBreite == EditWinBreite
+ bAutoPageWidth = TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+ImplRulerData::~ImplRulerData()
+{
+ if ( pLines )
+ delete pLines;
+
+ if ( pArrows )
+ delete pArrows;
+
+ if ( pBorders )
+ delete pBorders;
+
+ if ( pIndents )
+ delete pIndents;
+
+ if ( pTabs )
+ delete pTabs;
+}
+
+// -----------------------------------------------------------------------
+
+ImplRulerData& ImplRulerData::operator=( const ImplRulerData& rData )
+{
+ if ( pLines )
+ delete pLines;
+
+ if ( pArrows )
+ delete pArrows;
+
+ if ( pBorders )
+ delete pBorders;
+
+ if ( pIndents )
+ delete pIndents;
+
+ if ( pTabs )
+ delete pTabs;
+
+ memcpy( this, &rData, sizeof( ImplRulerData ) );
+
+ if ( rData.pLines )
+ {
+ pLines = new RulerLine[nLines];
+ memcpy( pLines, rData.pLines, nLines*sizeof( RulerLine ) );
+ }
+
+ if ( rData.pArrows )
+ {
+ pArrows = new RulerArrow[nArrows];
+ memcpy( pArrows, rData.pArrows, nArrows*sizeof( RulerArrow ) );
+ }
+
+ if ( rData.pBorders )
+ {
+ pBorders = new RulerBorder[nBorders];
+ memcpy( pBorders, rData.pBorders, nBorders*sizeof( RulerBorder ) );
+ }
+
+ if ( rData.pIndents )
+ {
+ pIndents = new RulerIndent[nIndents];
+ memcpy( pIndents, rData.pIndents, nIndents*sizeof( RulerIndent ) );
+ }
+
+ if ( rData.pTabs )
+ {
+ pTabs = new RulerTab[nTabs];
+ memcpy( pTabs, rData.pTabs, nTabs*sizeof( RulerTab ) );
+ }
+
+ return *this;
+}
+
+// =======================================================================
+
+void Ruler::ImplInit( WinBits nWinBits )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ // Default WinBits setzen
+ if ( !(nWinBits & WB_VERT) )
+ nWinBits |= WB_HORZ;
+
+ // Variablen initialisieren
+ mnWinStyle = nWinBits; // Window-Style
+ mnBorderOff = 0; // Border-Offset
+ mnWinOff = 0; // EditWinOffset
+ mnWinWidth = 0; // EditWinWidth
+ mnWidth = 0; // Fensterbreite
+ mnHeight = 0; // Fensterhoehe
+ mnVirOff = 0; // Offset des VirtualDeice vom linke/oberen Rand
+ mnVirWidth = 0; // Breite bzw. Hoehe vom VirtualDevice
+ mnVirHeight = 0; // Hoehe bzw. Breite vom VirtualDevice
+ mnDragPos = 0; // Drag-Position (NullPunkt)
+ mnUpdateEvtId = 0; // Noch kein Update-Event verschickt
+ mnDragAryPos = 0; // Drag-Array-Index
+ mnDragSize = 0; // Wird beim Draggen die Groesse geaendert
+ mnDragScroll = 0; // Soll beim Draggen gescrollt werden
+ mnDragModifier = 0; // Modifier-Tasten beim Draggen
+ mnExtraStyle = 0; // Style des Extra-Feldes
+ mnExtraClicks = 0; // Click-Anzahl fuer Extra-Feld
+ mnExtraModifier = 0; // Modifier-Tasten beim Click im Extrafeld
+ mbCalc = TRUE; // Muessen Pagebreiten neu berechnet werden
+ mbFormat = TRUE; // Muss neu ausgegeben werden
+ mbDrag = FALSE; // Sind wir im Drag-Modus
+ mbDragDelete = FALSE; // Wird Maus beim Draggen unten rausgezogen
+ mbDragCanceled = FALSE; // Wurde Dragging abgebrochen
+ mbAutoWinWidth = TRUE; // EditWinBreite == RulerBreite
+ mbActive = TRUE; // Ist Lineal aktiv
+ mnUpdateFlags = 0; // Was soll im Update-Handler upgedatet werden
+ mpData = &maData; // Wir zeigen auf die normalen Daten
+ meExtraType = RULER_EXTRA_DONTKNOW; // Was im ExtraFeld dargestellt wird
+ meDragType = RULER_TYPE_DONTKNOW; // Gibt an, was gedragt wird
+
+ // Units initialisieren
+ mnUnitIndex = RULER_UNIT_CM;
+ meUnit = FUNIT_CM;
+ maZoom = Fraction( 1, 1 );
+ meSourceUnit = MAP_100TH_MM;
+
+ // Border-Breiten berechnen
+ if ( nWinBits & WB_BORDER )
+ {
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ mnBorderWidth = 2;
+ else
+ mnBorderWidth = 1;
+ }
+ else
+ mnBorderWidth = 0;
+
+ // Einstellungen setzen
+ ImplInitSettings( TRUE, TRUE, TRUE );
+
+ // Default-Groesse setzen
+ long nDefHeight = GetTextHeight() + RULER_OFF*2 + RULER_TEXTOFF*2 + mnBorderWidth;
+ Size aDefSize;
+ if ( nWinBits & WB_HORZ )
+ aDefSize.Height() = nDefHeight;
+ else
+ aDefSize.Width() = nDefHeight;
+ SetOutputSizePixel( aDefSize );
+}
+
+// -----------------------------------------------------------------------
+
+Ruler::Ruler( Window* pParent, WinBits nWinStyle ) :
+ Window( pParent, nWinStyle & WB_3DLOOK ),
+ maVirDev( *this ),
+ maMapMode( MAP_100TH_MM )
+{
+ ImplInit( nWinStyle );
+}
+
+// -----------------------------------------------------------------------
+
+Ruler::~Ruler()
+{
+ if ( mnUpdateEvtId )
+ Application::RemoveUserEvent( mnUpdateEvtId );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplVDrawLine( long nX1, long nY1, long nX2, long nY2 )
+{
+ if ( nX1 < -RULER_CLIP )
+ {
+ nX1 = -RULER_CLIP;
+ if ( nX2 < -RULER_CLIP )
+ return;
+ }
+ long nClip = mnVirWidth+RULER_CLIP;
+ if ( nX2 > nClip )
+ {
+ nX2 = nClip;
+ if ( nX1 > nClip )
+ return;
+ }
+
+ if ( mnWinStyle & WB_HORZ )
+ maVirDev.DrawLine( Point( nX1, nY1 ), Point( nX2, nY2 ) );
+ else
+ maVirDev.DrawLine( Point( nY1, nX1 ), Point( nY2, nX2 ) );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplVDrawRect( long nX1, long nY1, long nX2, long nY2 )
+{
+ if ( nX1 < -RULER_CLIP )
+ {
+ nX1 = -RULER_CLIP;
+ if ( nX2 < -RULER_CLIP )
+ return;
+ }
+ long nClip = mnVirWidth+RULER_CLIP;
+ if ( nX2 > nClip )
+ {
+ nX2 = nClip;
+ if ( nX1 > nClip )
+ return;
+ }
+
+ if ( mnWinStyle & WB_HORZ )
+ maVirDev.DrawRect( Rectangle( nX1, nY1, nX2, nY2 ) );
+ else
+ maVirDev.DrawRect( Rectangle( nY1, nX1, nY2, nX2 ) );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplVDrawText( long nX, long nY, const String& rText )
+{
+ if ( (nX > -RULER_CLIP) && (nX < mnVirWidth+RULER_CLIP) )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ maVirDev.DrawText( Point( nX, nY ), rText );
+ else
+ maVirDev.DrawText( Point( nY, nX ), rText );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplInvertLines( BOOL bErase )
+{
+ // Positionslinien
+ if ( mpData->nLines && mbActive && !mbDrag && !mbFormat &&
+ !(mnUpdateFlags & RULER_UPDATE_LINES) )
+ {
+ long n;
+ long nNullWinOff = mpData->nNullVirOff+mnVirOff;
+ long nRulX1 = mpData->nRulVirOff+mnVirOff;
+ long nRulX2 = nRulX1+mpData->nRulWidth;
+ long nY = (RULER_OFF*2)+mnVirHeight-1;
+
+ // Rectangle berechnen
+ Rectangle aRect;
+ if ( mnWinStyle & WB_HORZ )
+ aRect.Bottom() = nY;
+ else
+ aRect.Right() = nY;
+
+ // Linien ausgeben
+ for ( USHORT i = 0; i < mpData->nLines; i++ )
+ {
+ n = mpData->pLines[i].nPos+nNullWinOff;
+ if ( (n >= nRulX1) && (n < nRulX2) )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ {
+ aRect.Left() = n;
+ aRect.Right() = n;
+ }
+ else
+ {
+ aRect.Top() = n;
+ aRect.Bottom() = n;
+ }
+ if ( bErase )
+ {
+ Rectangle aTempRect = aRect;
+ if ( mnWinStyle & WB_HORZ )
+ aTempRect.Bottom() = RULER_OFF-1;
+ else
+ aTempRect.Right() = RULER_OFF-1;
+ Erase( aTempRect );
+ if ( mnWinStyle & WB_HORZ )
+ {
+ aTempRect.Bottom() = aRect.Bottom();
+ aTempRect.Top() = aTempRect.Bottom()-RULER_OFF+1;
+ }
+ else
+ {
+ aTempRect.Right() = aRect.Right();
+ aTempRect.Left() = aTempRect.Right()-RULER_OFF+1;
+ }
+ Erase( aTempRect );
+ }
+ Invert( aRect );
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrawTicks( long nMin, long nMax, long nStart, long nCenter )
+{
+ long n = 0;
+ long nTick = 0;
+ long nTick3 = aImplRulerUnitTab[mnUnitIndex].nTick3;
+ long nTickCount = aImplRulerUnitTab[mnUnitIndex].nTick1;
+ Size aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode );
+ long nTickWidth;
+ long nX;
+ long nY;
+ BOOL bNoTicks = FALSE;
+
+ // Groessenvorberechnung
+ if ( mnWinStyle & WB_HORZ )
+ nTickWidth = aPixSize.Width();
+ else
+ nTickWidth = aPixSize.Height();
+ long nMaxWidth = maVirDev.PixelToLogic( Size( mpData->nPageWidth, 0 ), maMapMode ).Width();
+ if ( nMaxWidth < 0 )
+ nMaxWidth *= -1;
+ nMaxWidth /= aImplRulerUnitTab[mnUnitIndex].nTickUnit;
+ UniString aNumStr( UniString::CreateFromInt32( nMaxWidth ) );
+ long nTxtWidth = GetTextWidth( aNumStr );
+ if ( (nTxtWidth*2) > nTickWidth )
+ {
+ long nMulti = 1;
+ long nOrgTick3 = nTick3;
+ long nTextOff = 2;
+ while ( nTickWidth < nTxtWidth+nTextOff )
+ {
+ long nOldMulti = nMulti;
+ if ( !nTickWidth )
+ nMulti *= 10;
+ else if ( nMulti < 10 )
+ nMulti++;
+ else if ( nMulti < 100 )
+ nMulti += 10;
+ else if ( nMulti < 1000 )
+ nMulti += 100;
+ else
+ nMulti += 1000;
+ // Ueberlauf, dann geben wir nichts aus, da wir bei so einem
+ // unsinnigen Massstab sowieso nichts vernuenftiges anzeigen
+ // koennen
+ if ( nMulti < nOldMulti )
+ {
+ bNoTicks = TRUE;
+ break;
+ }
+ if ( nMulti >= 100 )
+ nTextOff = 4;
+ nTick3 = nOrgTick3 * nMulti;
+ aPixSize = maVirDev.LogicToPixel( Size( nTick3, nTick3 ), maMapMode );
+ if ( mnWinStyle & WB_HORZ )
+ nTickWidth = aPixSize.Width();
+ else
+ nTickWidth = aPixSize.Height();
+ }
+ nTickCount = nTick3;
+ }
+ else
+ maVirDev.SetLineColor( GetSettings().GetStyleSettings().GetWindowTextColor() );
+
+ if ( !bNoTicks )
+ {
+ long nTxtWidth2;
+ long nTxtHeight2 = GetTextHeight()/2;
+ while ( ((nStart-n) >= nMin) || ((nStart+n) <= nMax) )
+ {
+ // Null-Punkt
+ if ( !nTick )
+ {
+ if ( nStart > nMin )
+ {
+ // Nur 0 malen, wenn Margin1 nicht gleich dem NullPunkt ist
+ if ( (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) || (mpData->nMargin1 != 0) )
+ {
+ aNumStr = (sal_Unicode)'0';
+ nTxtWidth2 = maVirDev.GetTextWidth( aNumStr )/2;
+ if ( mnWinStyle & WB_HORZ )
+ nX = nStart-nTxtWidth2;
+ else
+ nX = nStart+nTxtWidth2;
+ ImplVDrawText( nX, nCenter-nTxtHeight2, aNumStr );
+ }
+ }
+ }
+ else
+ {
+ aPixSize = maVirDev.LogicToPixel( Size( nTick, nTick ), maMapMode );
+
+ if ( mnWinStyle & WB_HORZ )
+ n = aPixSize.Width();
+ else
+ n = aPixSize.Height();
+
+ // Tick3 - Ausgabe (Text)
+ if ( !(nTick % nTick3) )
+ {
+ aNumStr = UniString::CreateFromInt32( nTick / aImplRulerUnitTab[mnUnitIndex].nTickUnit );
+ nTxtWidth2 = GetTextWidth( aNumStr )/2;
+
+ nX = nStart+n;
+ nY = nCenter-nTxtHeight2;
+ if ( nX < nMax )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ nX -= nTxtWidth2;
+ else
+ nX += nTxtWidth2;
+ ImplVDrawText( nX, nY, aNumStr );
+ }
+ nX = nStart-n;
+ if ( nX > nMin )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ nX -= nTxtWidth2;
+ else
+ nX += nTxtWidth2;
+ ImplVDrawText( nX, nY, aNumStr );
+ }
+ }
+ // Tick/Tick2 - Ausgabe (Striche)
+ else
+ {
+ if ( !(nTick % aImplRulerUnitTab[mnUnitIndex].nTick2) )
+ nTickWidth = RULER_TICK2_WIDTH;
+ else
+ nTickWidth = RULER_TICK1_WIDTH;
+ long nT1 = nCenter-(nTickWidth/2);
+ long nT2 = nT1+nTickWidth-1;
+ long nT;
+
+ nT = nStart+n;
+ if ( nT < nMax )
+ ImplVDrawLine( nT, nT1, nT, nT2 );
+ nT = nStart-n;
+ if ( nT > nMin )
+ ImplVDrawLine( nT, nT1, nT, nT2 );
+ }
+ }
+
+ nTick += nTickCount;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrawArrows( long nCenter )
+{
+ USHORT i;
+ long n1;
+ long n2;
+ long n3;
+ long n4;
+ long nLogWidth;
+ String aStr;
+ String aStr2;
+ BOOL bDrawUnit;
+ long nTxtWidth;
+ long nTxtHeight2 = GetTextHeight()/2;
+ International aIntn = Application::GetAppInternational();
+
+ aIntn.SetNumTrailingZeros( FALSE );
+ maVirDev.SetLineColor( GetSettings().GetStyleSettings().GetWindowTextColor() );
+ for ( i = 0; i < mpData->nArrows; i++ )
+ {
+ n1 = mpData->pArrows[i].nPos+mpData->nNullVirOff+1;
+ n2 = n1+mpData->pArrows[i].nWidth-2;
+
+ // Einheit umrechnen
+ nLogWidth = mpData->pArrows[i].nLogWidth;
+ if ( meSourceUnit == MAP_TWIP )
+ {
+ if ( nLogWidth >= 100000 )
+ nLogWidth = (nLogWidth*254)/144;
+ else
+ nLogWidth = (nLogWidth*2540)/1440;
+ }
+ if ( nLogWidth >= 1000000 )
+ nLogWidth = (nLogWidth / aImplRulerUnitTab[mnUnitIndex].n100THMM) * 1000;
+ else
+ nLogWidth = (nLogWidth*1000) / aImplRulerUnitTab[mnUnitIndex].n100THMM;
+ aStr = aIntn.GetNum( nLogWidth, aImplRulerUnitTab[mnUnitIndex].nUnitDigits );
+
+ // Einheit an den String haengen
+ aStr2 = aStr;
+ aStr2.AppendAscii( aImplRulerUnitTab[mnUnitIndex].aUnitStr );
+
+ // Textbreite ermitteln
+ bDrawUnit = TRUE;
+ nTxtWidth = GetTextWidth( aStr2 );
+ if ( nTxtWidth < mpData->pArrows[i].nWidth-10 )
+ aStr = aStr2;
+ else
+ {
+ nTxtWidth = GetTextWidth( aStr );
+ if ( nTxtWidth > mpData->pArrows[i].nWidth-10 )
+ bDrawUnit = FALSE;
+ }
+
+ // Ist genuegen Platz fuer Einheiten-String vorhanden
+ if ( bDrawUnit )
+ {
+ n3 = n1 + ((n2-n1)/2) - 1;
+ if ( mnWinStyle & WB_HORZ )
+ n3 -= nTxtWidth/2;
+ else
+ n3 += nTxtWidth/2;
+ if ( mnWinStyle & WB_HORZ )
+ {
+ n4 = n3 + nTxtWidth + 2;
+ ImplVDrawLine( n1, nCenter, n3, nCenter );
+ ImplVDrawLine( n4, nCenter, n2, nCenter );
+ }
+ else
+ {
+ n4 = n3 - nTxtWidth - 2;
+ ImplVDrawLine( n1, nCenter, n4, nCenter );
+ ImplVDrawLine( n3, nCenter, n2, nCenter );
+ }
+ ImplVDrawText( n3, nCenter-nTxtHeight2, aStr );
+ }
+ else
+ ImplVDrawLine( n1, nCenter, n2, nCenter );
+ ImplVDrawLine( n1+1, nCenter-1, n1+1, nCenter+1 );
+ ImplVDrawLine( n1+2, nCenter-2, n1+2, nCenter+2 );
+ ImplVDrawLine( n2-1, nCenter-1, n2-1, nCenter+1 );
+ ImplVDrawLine( n2-2, nCenter-2, n2-2, nCenter+2 );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrawBorders( long nMin, long nMax, long nVirTop, long nVirBottom )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ long n;
+ long n1;
+ long n2;
+ long nTemp1;
+ long nTemp2;
+ USHORT i;
+
+ for ( i = 0; i < mpData->nBorders; i++ )
+ {
+ if ( mpData->pBorders[i].nStyle & RULER_STYLE_INVISIBLE )
+ continue;
+
+ n1 = mpData->pBorders[i].nPos+mpData->nNullVirOff;
+ n2 = n1+mpData->pBorders[i].nWidth;
+
+ if ( ((n1 >= nMin) && (n1 <= nMax)) || ((n2 >= nMin) && (n2 <= nMax)) )
+ {
+ if ( (n2-n1) > 3 )
+ {
+ maVirDev.SetLineColor();
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );
+ else
+ maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
+ ImplVDrawRect( n1, nVirTop, n2, nVirBottom );
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
+ ImplVDrawLine( n1+1, nVirTop, n1+1, nVirBottom );
+ ImplVDrawLine( n1, nVirTop, n2, nVirTop );
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ ImplVDrawLine( n1, nVirTop, n1, nVirBottom );
+ ImplVDrawLine( n1, nVirBottom, n2, nVirBottom );
+ ImplVDrawLine( n2-1, nVirTop, n2-1, nVirBottom );
+ maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
+ ImplVDrawLine( n2, nVirTop, n2, nVirBottom );
+ }
+ else
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
+ ImplVDrawLine( n1, nVirTop, n1, nVirBottom );
+ ImplVDrawLine( n2, nVirTop, n2, nVirBottom );
+ }
+
+ if ( mpData->pBorders[i].nStyle & RULER_BORDER_VARIABLE )
+ {
+ if ( n2-n1 > RULER_VAR_SIZE+4 )
+ {
+ nTemp1 = n1 + (((n2-n1+1)-RULER_VAR_SIZE) / 2);
+ nTemp2 = nVirTop + (((nVirBottom-nVirTop+1)-RULER_VAR_SIZE) / 2);
+ long nTemp3 = nTemp1+RULER_VAR_SIZE-1;
+ long nTemp4 = nTemp2+RULER_VAR_SIZE-1;
+ long nTempY = nTemp2;
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
+ else
+ maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
+ while ( nTempY <= nTemp4 )
+ {
+ ImplVDrawLine( nTemp1, nTempY, nTemp3, nTempY );
+ nTempY += 2;
+ }
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ nTempY = nTemp2+1;
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ while ( nTempY <= nTemp4 )
+ {
+ ImplVDrawLine( nTemp1, nTempY, nTemp3, nTempY );
+ nTempY += 2;
+ }
+ }
+ }
+ }
+
+ if ( mpData->pBorders[i].nStyle & RULER_BORDER_SIZEABLE )
+ {
+ if ( n2-n1 > RULER_VAR_SIZE+10 )
+ {
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ ImplVDrawLine( n1+4, nVirTop+3, n1+4, nVirBottom-3 );
+ ImplVDrawLine( n2-5, nVirTop+3, n2-5, nVirBottom-3 );
+ maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
+ ImplVDrawLine( n1+5, nVirTop+3, n1+5, nVirBottom-3 );
+ ImplVDrawLine( n2-4, nVirTop+3, n2-4, nVirBottom-3 );
+ }
+ else
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
+ ImplVDrawLine( n1+4, nVirTop+3, n1+4, nVirBottom-3 );
+ ImplVDrawLine( n2-4, nVirTop+3, n2-4, nVirBottom-3 );
+ }
+ }
+ }
+ }
+ else
+ {
+ n = n1+((n2-n1)/2);
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ else
+ maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
+ if ( mpData->pBorders[i].nStyle & RULER_BORDER_SNAP )
+ ImplVDrawLine( n, nVirTop, n, nVirBottom );
+ else
+ {
+ ImplVDrawLine( n-1, nVirTop, n-1, nVirBottom );
+ ImplVDrawLine( n+1, nVirTop, n+1, nVirBottom );
+ maVirDev.SetLineColor();
+ maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
+ ImplVDrawRect( n, nVirTop, n, nVirBottom );
+ }
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrawIndent( const Polygon& rPoly, USHORT nStyle )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ Point aPos1;
+ Point aPos2;
+ USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE;
+
+ if ( nStyle & RULER_STYLE_INVISIBLE )
+ return;
+
+ if ( nStyle & RULER_STYLE_DONTKNOW )
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );
+ }
+ else
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );
+ }
+
+ maVirDev.DrawPolygon( rPoly );
+
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && !(nStyle & RULER_STYLE_DONTKNOW) )
+ {
+ if ( nIndentStyle == RULER_INDENT_BOTTOM )
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
+ aPos1 = rPoly.GetPoint( 2 );
+ aPos1.X()++;
+ aPos2 = rPoly.GetPoint( 1 );
+ aPos2.X()++;
+ maVirDev.DrawLine( aPos2, aPos1 );
+ aPos2.X()--;
+ aPos2.Y()++;
+ aPos1 = rPoly.GetPoint( 0 );
+ aPos1.Y()++;
+ maVirDev.DrawLine( aPos2, aPos1 );
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ aPos2 = rPoly.GetPoint( 4 );
+ aPos2.Y()++;
+ maVirDev.DrawLine( aPos1, aPos2 );
+ aPos2.X()--;
+ aPos1 = rPoly.GetPoint( 3 );
+ aPos1.X()--;
+ maVirDev.DrawLine( aPos2, aPos1 );
+ aPos1.Y()--;
+ aPos2 = rPoly.GetPoint( 2 );
+ aPos2.X()++;
+ aPos2.Y()--;
+ maVirDev.DrawLine( aPos2, aPos1 );
+ }
+ else
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
+ aPos1 = rPoly.GetPoint( 2 );
+ aPos1.X()++;
+ aPos1.Y()++;
+ aPos2 = rPoly.GetPoint( 3 );
+ aPos2.Y()++;
+ maVirDev.DrawLine( aPos1, aPos2 );
+ aPos2 = rPoly.GetPoint( 1 );
+ aPos2.X()++;
+ maVirDev.DrawLine( aPos1, aPos2 );
+ aPos2.X()--;
+ aPos2.Y()--;
+ aPos1 = rPoly.GetPoint( 0 );
+ aPos1.Y()--;
+ maVirDev.DrawLine( aPos2, aPos1 );
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ aPos2 = rPoly.GetPoint( 4 );
+ aPos2.Y()--;
+ maVirDev.DrawLine( aPos1, aPos2 );
+ aPos2.X()--;
+ aPos1 = rPoly.GetPoint( 3 );
+ aPos1.X()--;
+ maVirDev.DrawLine( aPos2, aPos1 );
+ }
+
+ maVirDev.SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ maVirDev.SetFillColor();
+ maVirDev.DrawPolygon( rPoly );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrawIndents( long nMin, long nMax, long nVirTop, long nVirBottom )
+{
+ USHORT i;
+ long n;
+ long nIndentHeight = (mnVirHeight/2) - 1;
+ long nIndentWidth2 = nIndentHeight-3;
+ Polygon aPoly( 5 );
+
+ for ( i = 0; i < mpData->nIndents; i++ )
+ {
+ if ( mpData->pIndents[i].nStyle & RULER_STYLE_INVISIBLE )
+ continue;
+
+ USHORT nStyle = mpData->pIndents[i].nStyle;
+ USHORT nIndentStyle = nStyle & RULER_INDENT_STYLE;
+
+ n = mpData->pIndents[i].nPos+mpData->nNullVirOff;
+
+ if ( (n >= nMin) && (n <= nMax) )
+ {
+ if ( nIndentStyle == RULER_INDENT_BOTTOM )
+ {
+ aPoly.SetPoint( Point( n+0, nVirBottom-nIndentHeight ), 0 );
+ aPoly.SetPoint( Point( n-nIndentWidth2, nVirBottom-3 ), 1 );
+ aPoly.SetPoint( Point( n-nIndentWidth2, nVirBottom ), 2 );
+ aPoly.SetPoint( Point( n+nIndentWidth2, nVirBottom ), 3 );
+ aPoly.SetPoint( Point( n+nIndentWidth2, nVirBottom-3 ), 4 );
+ }
+ else
+ {
+ aPoly.SetPoint( Point( n+0, nVirTop+nIndentHeight ), 0 );
+ aPoly.SetPoint( Point( n-nIndentWidth2, nVirTop+3 ), 1 );
+ aPoly.SetPoint( Point( n-nIndentWidth2, nVirTop ), 2 );
+ aPoly.SetPoint( Point( n+nIndentWidth2, nVirTop ), 3 );
+ aPoly.SetPoint( Point( n+nIndentWidth2, nVirTop+3 ), 4 );
+ }
+
+ ImplDrawIndent( aPoly, nStyle );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplCenterTabPos( Point& rPos, USHORT nStyle )
+{
+ rPos.Y() += RULER_TAB_HEIGHT/2;
+ if ( nStyle == RULER_TAB_LEFT )
+ rPos.X() -= RULER_TAB_WIDTH/2;
+ else if ( nStyle == RULER_TAB_RIGHT )
+ rPos.X() += RULER_TAB_WIDTH/2;
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplDrawRulerTab( OutputDevice* pDevice,
+ const Point& rPos, USHORT nStyle )
+{
+ if ( nStyle & RULER_STYLE_INVISIBLE )
+ return;
+
+ USHORT nTabStyle = nStyle & RULER_TAB_STYLE;
+
+ if ( nTabStyle == RULER_TAB_DEFAULT )
+ {
+ pDevice->DrawRect( Rectangle( rPos.X() - RULER_TAB_DWIDTH2 + 1,
+ rPos.Y() - RULER_TAB_DHEIGHT2 + 1,
+ rPos.X() - RULER_TAB_DWIDTH2 + RULER_TAB_DWIDTH,
+ rPos.Y() ) );
+ pDevice->DrawRect( Rectangle( rPos.X() - RULER_TAB_DWIDTH2 + RULER_TAB_DWIDTH3,
+ rPos.Y() - RULER_TAB_DHEIGHT + 1,
+ rPos.X() - RULER_TAB_DWIDTH2 + RULER_TAB_DWIDTH3 + RULER_TAB_DWIDTH4 - 1,
+ rPos.Y() ) );
+
+ }
+ else if ( nTabStyle == RULER_TAB_LEFT )
+ {
+ pDevice->DrawRect( Rectangle( rPos.X(),
+ rPos.Y() - RULER_TAB_HEIGHT2 + 1,
+ rPos.X() + RULER_TAB_WIDTH - 1,
+ rPos.Y() ) );
+ pDevice->DrawRect( Rectangle( rPos.X(),
+ rPos.Y() - RULER_TAB_HEIGHT + 1,
+ rPos.X() + RULER_TAB_WIDTH2 - 1,
+ rPos.Y() ) );
+ }
+ else if ( nTabStyle == RULER_TAB_RIGHT )
+ {
+ pDevice->DrawRect( Rectangle( rPos.X() - RULER_TAB_WIDTH + 1,
+ rPos.Y() - RULER_TAB_HEIGHT2 + 1,
+ rPos.X(),
+ rPos.Y() ) );
+ pDevice->DrawRect( Rectangle( rPos.X() - RULER_TAB_WIDTH2 + 1,
+ rPos.Y() - RULER_TAB_HEIGHT + 1,
+ rPos.X(),
+ rPos.Y() ) );
+ }
+ else
+ {
+ pDevice->DrawRect( Rectangle( rPos.X() - RULER_TAB_CWIDTH2 + 1,
+ rPos.Y() - RULER_TAB_HEIGHT2 + 1,
+ rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH,
+ rPos.Y() ) );
+ pDevice->DrawRect( Rectangle( rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH3,
+ rPos.Y() - RULER_TAB_HEIGHT + 1,
+ rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH3 + RULER_TAB_CWIDTH4 - 1,
+ rPos.Y() ) );
+
+ if ( nTabStyle == RULER_TAB_DECIMAL )
+ {
+ pDevice->DrawRect( Rectangle( rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH - 1,
+ rPos.Y() - RULER_TAB_HEIGHT + 1 + 1,
+ rPos.X() - RULER_TAB_CWIDTH2 + RULER_TAB_CWIDTH,
+ rPos.Y() - RULER_TAB_HEIGHT + 1 + 2 ) );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle )
+{
+ if ( nStyle & RULER_STYLE_INVISIBLE )
+ return;
+
+ pDevice->SetLineColor();
+ if ( nStyle & RULER_STYLE_DONTKNOW )
+ pDevice->SetFillColor( GetSettings().GetStyleSettings().GetFaceColor() );
+ else
+ pDevice->SetFillColor( GetSettings().GetStyleSettings().GetWindowTextColor() );
+
+ ImplDrawRulerTab( pDevice, rPos, nStyle );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrawTabs( long nMin, long nMax, long nVirBottom )
+{
+ for ( USHORT i = 0; i < mpData->nTabs; i++ )
+ {
+ if ( mpData->pTabs[i].nStyle & RULER_STYLE_INVISIBLE )
+ continue;
+
+ long n = mpData->pTabs[i].nPos+mpData->nNullVirOff;
+ if ( (n >= nMin) && (n <= nMax) )
+ ImplDrawTab( &maVirDev, Point( n, nVirBottom ), mpData->pTabs[i].nStyle );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ if ( bFont )
+ {
+ Font aFont;
+ aFont = rStyleSettings.GetToolFont();
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ SetZoomedPointFont( aFont );
+ }
+
+ if ( bForeground || bFont )
+ {
+ Color aColor;
+ if ( IsControlForeground() )
+ aColor = GetControlForeground();
+ else
+ aColor = rStyleSettings.GetButtonTextColor();
+ SetTextColor( aColor );
+ SetTextFillColor();
+ }
+
+ if ( bBackground )
+ {
+ Color aColor;
+ if ( IsControlBackground() )
+ aColor = GetControlBackground();
+ else
+ aColor = rStyleSettings.GetFaceColor();
+ SetBackground( aColor );
+ }
+
+ maVirDev.SetSettings( GetSettings() );
+ maVirDev.SetBackground( GetBackground() );
+ Font aFont = GetFont();
+ if ( mnWinStyle & WB_VERT )
+ aFont.SetOrientation( 900 );
+ maVirDev.SetFont( aFont );
+ maVirDev.SetTextColor( GetTextColor() );
+ maVirDev.SetTextFillColor( GetTextFillColor() );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplCalc()
+{
+ // Offset berechnen
+ mpData->nRulVirOff = mnWinOff + mpData->nPageOff;
+ if ( mpData->nRulVirOff > mnVirOff )
+ mpData->nRulVirOff -= mnVirOff;
+ else
+ mpData->nRulVirOff = 0;
+ long nRulWinOff = mpData->nRulVirOff+mnVirOff;
+
+ // Nicht sichtbaren Bereich der Page berechnen
+ long nNotVisPageWidth;
+ if ( mpData->nPageOff < 0 )
+ {
+ nNotVisPageWidth = -(mpData->nPageOff);
+ if ( nRulWinOff < mnWinOff )
+ nNotVisPageWidth -= mnWinOff-nRulWinOff;
+ }
+ else
+ nNotVisPageWidth = 0;
+
+ // Breite berechnen
+ if ( mnWinStyle & WB_HORZ )
+ {
+ if ( mbAutoWinWidth )
+ mnWinWidth = mnWidth - mnVirOff;
+ if ( mpData->bAutoPageWidth )
+ mpData->nPageWidth = mnWinWidth;
+ mpData->nRulWidth = Min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth );
+ if ( nRulWinOff+mpData->nRulWidth > mnWidth )
+ mpData->nRulWidth = mnWidth-nRulWinOff;
+ }
+ else
+ {
+ if ( mbAutoWinWidth )
+ mnWinWidth = mnHeight - mnVirOff;
+ if ( mpData->bAutoPageWidth )
+ mpData->nPageWidth = mnWinWidth;
+ mpData->nRulWidth = Min( mnWinWidth, mpData->nPageWidth-nNotVisPageWidth );
+ if ( nRulWinOff+mpData->nRulWidth > mnHeight )
+ mpData->nRulWidth = mnHeight-nRulWinOff;
+ }
+
+ mbCalc = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplFormat()
+{
+ // Wenn schon formatiert ist, brauchen wir es nicht nochmal
+ if ( !mbFormat )
+ return;
+
+ // Wenn Fenster noch keine Groesse hat, brauchen wir noch nichts machen
+ if ( !mnVirWidth )
+ return;
+
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ long nP1; // Pixel-Position von Page1
+ long nP2; // Pixel-Position von Page2
+ long nM1; // Pixel-Position von Margin1
+ long nM2; // Pixel-Position von Margin2
+ long nVirTop; // Obere/Linke-Kante bei Ausgabe
+ long nVirBottom; // Untere/Rechte-Kante bei Ausgabe
+ long nVirLeft; // Linke/Obere-Kante bei Ausgabe
+ long nVirRight; // Rechte/Untere-Kante bei Ausgabe
+ long nNullVirOff; // Fuer schnellere Berechnung
+
+ // Werte berechnen
+ if ( mbCalc )
+ ImplCalc();
+ mpData->nNullVirOff = mnWinOff+mpData->nPageOff+mpData->nNullOff-mnVirOff;
+ nNullVirOff = mpData->nNullVirOff;
+ nVirLeft = mpData->nRulVirOff;
+ nVirRight = nVirLeft+mpData->nRulWidth-1;
+ nVirTop = 0;
+ nVirBottom = mnVirHeight-1;
+
+ if ( !IsReallyVisible() )
+ return;
+
+ Size aVirDevSize;
+ BOOL b3DLook = !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO);
+
+ // VirtualDevice initialisieren
+ if ( mnWinStyle & WB_HORZ )
+ {
+ aVirDevSize.Width() = mnVirWidth;
+ aVirDevSize.Height() = mnVirHeight;
+ }
+ else
+ {
+ aVirDevSize.Height() = mnVirWidth;
+ aVirDevSize.Width() = mnVirHeight;
+ }
+ if ( aVirDevSize != maVirDev.GetOutputSizePixel() )
+ maVirDev.SetOutputSizePixel( aVirDevSize, TRUE );
+ else
+ maVirDev.Erase();
+
+ // Raender berechnen
+ if ( !(mpData->nMargin1Style & RULER_STYLE_INVISIBLE) )
+ {
+ nM1 = mpData->nMargin1+nNullVirOff;
+ if ( mpData->bAutoPageWidth )
+ {
+ nP1 = nVirLeft;
+ if ( nM1 < nVirLeft )
+ nP1--;
+ }
+ else
+ nP1 = nNullVirOff-mpData->nNullOff;
+ }
+ else
+ {
+ nM1 = nVirLeft-1;
+ nP1 = nM1;
+ }
+ if ( !(mpData->nMargin2Style & RULER_STYLE_INVISIBLE) )
+ {
+ nM2 = mpData->nMargin2+nNullVirOff;
+ if ( mpData->bAutoPageWidth )
+ {
+ nP2 = nVirRight;
+ if ( nM2 > nVirRight )
+ nP2++;
+ }
+ else
+ nP2 = nNullVirOff-mpData->nNullOff+mpData->nPageWidth;
+ if ( nM2 > nP2 )
+ nM2 = nP2;
+ }
+ else
+ {
+ nM2 = nVirRight+1;
+ nP2 = nM2;
+ }
+
+ // Obere/untere Kante ausgeben
+ if ( b3DLook )
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ else
+ maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
+ ImplVDrawLine( nVirLeft, nVirTop, nP2, nVirTop );
+ if ( b3DLook )
+ maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
+ ImplVDrawLine( nVirLeft, nVirBottom, nP2, nVirBottom );
+
+ // Jetzt wird zwischen dem Schatten ausgegeben
+ nVirTop++;
+ nVirBottom--;
+
+ // Margin1, Margin2 und Zwischenraum ausgeben
+ maVirDev.SetLineColor();
+ if ( b3DLook )
+ maVirDev.SetFillColor( rStyleSettings.GetFaceColor() );
+ else
+ maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
+ if ( nM1 > nVirLeft )
+ ImplVDrawRect( nP1, nVirTop, nM1-1, nVirBottom );
+ if ( nM2 < nP2 )
+ ImplVDrawRect( nM2+1, nVirTop, nP2, nVirBottom );
+ if ( nM2-nM1 > 0 )
+ {
+ maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
+ ImplVDrawRect( nM1, nVirTop, nM2-1, nVirBottom );
+ }
+ if ( b3DLook )
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
+ if ( nM1 > nVirLeft )
+ {
+ ImplVDrawLine( nP1+1, nVirTop, nM1-1, nVirTop );
+ if ( nP1 >= nVirLeft )
+ {
+ ImplVDrawLine( nP1+1, nVirTop, nP1+1, nVirBottom );
+ ImplVDrawLine( nP1, nVirBottom+1, nP1+1, nVirBottom+1 );
+ }
+ }
+ if ( nM2 < nP2 )
+ {
+ ImplVDrawLine( nM2+1, nVirTop, nM2+1, nVirBottom );
+ ImplVDrawLine( nM2+1, nVirTop, nP2, nVirTop );
+ if ( nP2 <= nVirRight+1 )
+ {
+ ImplVDrawLine( nP2, nVirTop-1, nP2, nVirBottom );
+ ImplVDrawLine( nP2-1, nVirBottom+1, nP2, nVirBottom+1 );
+ }
+ }
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ if ( nM1 > nVirLeft )
+ {
+ ImplVDrawLine( nM1-1, nVirTop, nM1-1, nVirBottom );
+ ImplVDrawLine( nP1, nVirBottom, nM1-1, nVirBottom );
+ if ( nP1 >= nVirLeft )
+ {
+ ImplVDrawLine( nP1, nVirTop, nP1, nVirBottom );
+ ImplVDrawLine( nP1, nVirBottom, nP1+1, nVirBottom );
+ }
+ }
+ if ( nM2 < nP2 )
+ {
+ ImplVDrawLine( nM2+1, nVirBottom, nP2-1, nVirBottom );
+ if ( nP2 <= nVirRight+1 )
+ ImplVDrawLine( nP2-1, nVirTop, nP2-1, nVirBottom );
+ }
+ if ( nM2-nM1 > 0 )
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ if ( nM1 >= nVirLeft )
+ ImplVDrawLine( nM1, nVirTop, nM1, nVirBottom );
+ ImplVDrawLine( nM1, nVirTop, nM2-1, nVirTop );
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ ImplVDrawLine( nM1, nVirBottom, nM2-1, nVirBottom );
+ if ( nM2 <= nVirRight )
+ ImplVDrawLine( nM2, nVirTop, nM2, nVirBottom );
+ }
+ }
+ else
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
+ if ( nP1 >= nVirLeft )
+ ImplVDrawLine( nP1, nVirTop, nP1, nVirBottom+1 );
+ if ( nM1 > nP1 )
+ ImplVDrawLine( nM1, nVirTop, nM1, nVirBottom );
+ if ( nM2 < nP2 )
+ ImplVDrawLine( nM2, nVirTop, nM2, nVirBottom );
+ if ( nP2 <= nVirRight+1 )
+ ImplVDrawLine( nP2, nVirTop, nP2, nVirBottom+1 );
+ }
+
+ // Lineal-Beschriftung (nur wenn keine Bemassungspfeile)
+ if ( !mpData->pArrows )
+ {
+ long nMin = nVirLeft;
+ long nMax = nP2;
+ long nStart = nNullVirOff;
+ long nCenter = nVirTop+((nVirBottom-nVirTop)/2);
+
+ // Nicht Schatten uebermalen
+ if ( nP1 > nVirLeft )
+ nMin++;
+ if ( nP2 < nVirRight )
+ nMax--;
+
+ // Beschriftung ausgeben
+ ImplDrawTicks( nMin, nMax, nStart, nCenter );
+ }
+
+ // Spalten ausgeben
+ if ( mpData->pBorders )
+ ImplDrawBorders( nVirLeft, nP2, nVirTop, nVirBottom );
+
+ // Einzuege ausgeben
+ if ( mpData->pIndents )
+ ImplDrawIndents( nVirLeft, nP2, nVirTop-1, nVirBottom+1 );
+
+ // Tabs
+ if ( mpData->pTabs )
+ ImplDrawTabs( nVirLeft, nP2, nVirBottom+1 );
+
+ // Bemassungspfeile
+ if ( mpData->pArrows )
+ ImplDrawArrows( nVirTop+((nVirBottom-nVirTop)/2) );
+
+ // Wir haben formatiert
+ mbFormat = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplInitExtraField( BOOL bUpdate )
+{
+ // Extra-Field beruecksichtigen
+ if ( mnWinStyle & WB_EXTRAFIELD )
+ {
+ maExtraRect.Left() = RULER_OFF;
+ maExtraRect.Top() = RULER_OFF;
+ maExtraRect.Right() = RULER_OFF+mnVirHeight-1;
+ maExtraRect.Bottom() = RULER_OFF+mnVirHeight-1;
+ mnVirOff = maExtraRect.Right()+1;
+ }
+ else
+ {
+ maExtraRect.SetEmpty();
+ mnVirOff = 0;
+ }
+
+ if ( bUpdate )
+ {
+ mbCalc = TRUE;
+ mbFormat = TRUE;
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDraw()
+{
+ if ( mbFormat )
+ ImplFormat();
+
+ if ( IsReallyVisible() )
+ {
+ // Lineal ueber das VirtualDevice ausgeben
+ Point aOffPos;
+ Size aVirDevSize = maVirDev.GetOutputSizePixel();
+ if ( mnWinStyle & WB_HORZ )
+ {
+ aOffPos.X() = mnVirOff;
+ aOffPos.Y() = RULER_OFF;
+ }
+ else
+ {
+ aOffPos.X() = RULER_OFF;
+ aOffPos.Y() = mnVirOff;
+ }
+ DrawOutDev( aOffPos, aVirDevSize, Point(), aVirDevSize, maVirDev );
+
+ // Positionslinien neu malen
+ ImplInvertLines( TRUE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrawExtra( BOOL bPaint )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ Rectangle aRect = maExtraRect;
+ BOOL bEraseRect = FALSE;
+
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ aRect.Left() += 2;
+ aRect.Top() += 2;
+ aRect.Right() -= 2;
+ aRect.Bottom() -= 2;
+ }
+ else
+ {
+ aRect.Left() += 1;
+ aRect.Top() += 1;
+ aRect.Right() -= 1;
+ aRect.Bottom() -= 1;
+ }
+
+ if ( !bPaint && !(mnExtraStyle & RULER_STYLE_HIGHLIGHT) )
+ {
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ SetFillColor( rStyleSettings.GetFaceColor() );
+ else
+ SetFillColor( rStyleSettings.GetWindowColor() );
+ bEraseRect = TRUE;
+ }
+ else
+ {
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) )
+ {
+ SetFillColor( rStyleSettings.GetCheckedColor() );
+ bEraseRect = TRUE;
+ }
+ }
+
+ if ( bEraseRect )
+ {
+ SetLineColor();
+ DrawRect( aRect );
+ }
+
+ // Inhalt ausgeben
+ if ( meExtraType == RULER_EXTRA_NULLOFFSET )
+ {
+ SetLineColor( rStyleSettings.GetWindowTextColor() );
+ DrawLine( Point( aRect.Left()+1, aRect.Top()+4 ),
+ Point( aRect.Right()-1, aRect.Top()+4 ) );
+ DrawLine( Point( aRect.Left()+4, aRect.Top()+1 ),
+ Point( aRect.Left()+4, aRect.Bottom()-1 ) );
+ }
+ else if ( meExtraType == RULER_EXTRA_TAB )
+ {
+ USHORT nTabStyle = mnExtraStyle & RULER_TAB_STYLE;
+ Point aCenter = aRect.Center();
+ ImplCenterTabPos( aCenter, nTabStyle );
+ ImplDrawTab( this, aCenter, nTabStyle );
+ }
+
+ if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) && (mnExtraStyle & RULER_STYLE_HIGHLIGHT) )
+ Invert( aRect );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplUpdate( BOOL bMustCalc )
+{
+ // Hier schon Linien loeschen, damit Sie vor dem Neuberechnen schon
+ // geloscht sind, da danach die alten Positionen nicht mehr bestimmt
+ // werden koennen
+ if ( !mbFormat )
+ ImplInvertLines();
+
+ // Flags setzen
+ if ( bMustCalc )
+ mbCalc = TRUE;
+ mbFormat = TRUE;
+
+ // Wenn wir am Draggen sind, wird nach dem Drag-Handler automatisch
+ // das Lineal neu upgedatet
+ if ( mbDrag )
+ return;
+
+ // Gegebenenfalls Update ausloesen
+ if ( IsReallyVisible() && IsUpdateMode() )
+ {
+ mnUpdateFlags |= RULER_UPDATE_DRAW;
+ if ( !mnUpdateEvtId )
+ mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+BOOL Ruler::ImplHitTest( const Point& rPos, ImplRulerHitTest* pHitTest ) const
+{
+ USHORT i;
+ USHORT nStyle;
+ long nHitBottom;
+ long nX;
+ long nY;
+ long n1;
+ long n2;
+
+ if ( !mbActive )
+ return FALSE;
+
+ // Position ermitteln
+ if ( mnWinStyle & WB_HORZ )
+ {
+ nX = rPos.X();
+ nY = rPos.Y();
+ }
+ else
+ {
+ nX = rPos.Y();
+ nY = rPos.X();
+ }
+ nHitBottom = mnVirHeight+(RULER_OFF*2);
+
+ // Initialisieren
+ memset( pHitTest, 0, sizeof( ImplRulerHitTest ) );
+
+ // Damit ueberstehende Tabs und Einzuege mit beruecksichtigt werden
+ long nXExtraOff;
+ if ( mpData->pTabs || mpData->pIndents )
+ nXExtraOff = (mnVirHeight/2) - 4;
+ else
+ nXExtraOff = 0;
+
+ // Test auf ausserhalb
+ nX -= mnVirOff;
+ long nXTemp = nX;
+ if ( (nX < mpData->nRulVirOff-nXExtraOff) || (nX > mpData->nRulVirOff+mpData->nRulWidth+nXExtraOff) ||
+ (nY < 0) || (nY > nHitBottom) )
+ {
+ pHitTest->nPos = 0;
+ pHitTest->eType = RULER_TYPE_OUTSIDE;
+ return FALSE;
+ }
+
+ nX -= mpData->nNullVirOff;
+ pHitTest->nPos = nX;
+ pHitTest->eType = RULER_TYPE_DONTKNOW;
+
+ // Zuerst die Tabs testen
+ Rectangle aRect;
+ if ( mpData->pTabs )
+ {
+ aRect.Bottom() = nHitBottom;
+ aRect.Top() = aRect.Bottom()-RULER_TAB_HEIGHT-RULER_OFF;
+
+ for ( i = mpData->nTabs; i; i-- )
+ {
+ nStyle = mpData->pTabs[i-1].nStyle;
+ if ( !(nStyle & RULER_STYLE_INVISIBLE) )
+ {
+ nStyle &= RULER_TAB_STYLE;
+
+ // Default-Tabs werden nur angezeigt
+ if ( nStyle != RULER_TAB_DEFAULT )
+ {
+ n1 = mpData->pTabs[i-1].nPos;
+
+ if ( nStyle == RULER_TAB_LEFT )
+ {
+ aRect.Left() = n1;
+ aRect.Right() = n1+RULER_TAB_WIDTH-1;
+ }
+ else if ( nStyle == RULER_TAB_RIGHT )
+ {
+ aRect.Right() = n1;
+ aRect.Left() = n1-RULER_TAB_WIDTH-1;
+ }
+ else
+ {
+ aRect.Left() = n1-RULER_TAB_CWIDTH2+1;
+ aRect.Right() = n1-RULER_TAB_CWIDTH2+RULER_TAB_CWIDTH;
+ }
+
+ if ( aRect.IsInside( Point( nX, nY ) ) )
+ {
+ pHitTest->eType = RULER_TYPE_TAB;
+ pHitTest->nAryPos = i-1;
+ return TRUE;
+ }
+ }
+ }
+ }
+ }
+
+ // Dann die Einzuege
+ if ( mpData->pIndents )
+ {
+ long nIndentHeight = (mnVirHeight/2) - 1;
+ long nIndentWidth2 = nIndentHeight-3;
+
+ for ( i = mpData->nIndents; i; i-- )
+ {
+ nStyle = mpData->pIndents[i-1].nStyle;
+ if ( !(nStyle & RULER_STYLE_INVISIBLE) )
+ {
+ nStyle &= RULER_INDENT_STYLE;
+ n1 = mpData->pIndents[i-1].nPos;
+
+ if ( nStyle == RULER_INDENT_BOTTOM )
+ {
+ aRect.Left() = n1-nIndentWidth2;
+ aRect.Right() = n1+nIndentWidth2;
+ aRect.Top() = nHitBottom-nIndentHeight-RULER_OFF+1;
+ aRect.Bottom() = nHitBottom;
+ }
+ else
+ {
+ aRect.Left() = n1-nIndentWidth2;
+ aRect.Right() = n1+nIndentWidth2;
+ aRect.Top() = 0;
+ aRect.Bottom() = nIndentHeight+RULER_OFF-1;
+ }
+
+ if ( aRect.IsInside( Point( nX, nY ) ) )
+ {
+ pHitTest->eType = RULER_TYPE_INDENT;
+ pHitTest->nAryPos = i-1;
+ return TRUE;
+ }
+ }
+ }
+ }
+
+ // Jetzt zaehlt nichts mehr, was links oder rechts uebersteht
+ if ( (nXTemp < mpData->nRulVirOff) || (nXTemp > mpData->nRulVirOff+mpData->nRulWidth) )
+ {
+ pHitTest->nPos = 0;
+ pHitTest->eType = RULER_TYPE_OUTSIDE;
+ return FALSE;
+ }
+
+ // Danach die Spalten testen
+ for ( i = mpData->nBorders; i; i-- )
+ {
+ n1 = mpData->pBorders[i-1].nPos;
+ n2 = n1 + mpData->pBorders[i-1].nWidth;
+
+ // Spalten werden mit mindestens 3 Pixel breite gezeichnet
+ if ( !mpData->pBorders[i-1].nWidth )
+ {
+ n1--;
+ n2++;
+ }
+
+ if ( (nX >= n1) && (nX <= n2) )
+ {
+ nStyle = mpData->pBorders[i-1].nStyle;
+ if ( !(nStyle & RULER_STYLE_INVISIBLE) )
+ {
+ pHitTest->eType = RULER_TYPE_BORDER;
+ pHitTest->nAryPos = i-1;
+
+ if ( !(nStyle & RULER_BORDER_SIZEABLE) )
+ {
+ if ( nStyle & RULER_BORDER_MOVEABLE )
+ {
+ pHitTest->bSizeBar = TRUE;
+ pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE;
+ }
+ }
+ else
+ {
+ long nMOff = RULER_MOUSE_BORDERWIDTH;
+ while ( nMOff*2 >= (n2-n1-RULER_MOUSE_BORDERMOVE) )
+ {
+ if ( nMOff < 2 )
+ {
+ nMOff = 0;
+ break;
+ }
+ else
+ nMOff--;
+ }
+
+ if ( nX <= n1+nMOff )
+ {
+ pHitTest->bSize = TRUE;
+ pHitTest->mnDragSize = RULER_DRAGSIZE_1;
+ }
+ else if ( nX >= n2-nMOff )
+ {
+ pHitTest->bSize = TRUE;
+ pHitTest->mnDragSize = RULER_DRAGSIZE_2;
+ }
+ else
+ {
+ if ( nStyle & RULER_BORDER_MOVEABLE )
+ {
+ pHitTest->bSizeBar = TRUE;
+ pHitTest->mnDragSize = RULER_DRAGSIZE_MOVE;
+ }
+ }
+ }
+
+ return TRUE;
+ }
+ }
+ }
+
+ // Und zum Schluss die Raender
+ if ( (mpData->nMargin1Style & (RULER_MARGIN_SIZEABLE | RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE )
+ {
+ n1 = mpData->nMargin1;
+ if ( (nX >= n1-RULER_MOUSE_MARGINWIDTH) && (nX <= n1+RULER_MOUSE_MARGINWIDTH) )
+ {
+ pHitTest->eType = RULER_TYPE_MARGIN1;
+ pHitTest->bSize = TRUE;
+ return TRUE;
+ }
+ }
+ if ( (mpData->nMargin2Style & (RULER_MARGIN_SIZEABLE | RULER_STYLE_INVISIBLE)) == RULER_MARGIN_SIZEABLE )
+ {
+ n1 = mpData->nMargin2;
+ if ( (nX >= n1-RULER_MOUSE_MARGINWIDTH) && (nX <= n1+RULER_MOUSE_MARGINWIDTH) )
+ {
+ pHitTest->eType = RULER_TYPE_MARGIN2;
+ pHitTest->bSize = TRUE;
+ return TRUE;
+ }
+ }
+
+ // Jetzt nocheinmal die Tabs testen, nur mit etwas mehr spielraum
+ if ( mpData->pTabs )
+ {
+ aRect.Top() = RULER_OFF;
+ aRect.Bottom() = nHitBottom;
+
+ for ( i = mpData->nTabs; i; i-- )
+ {
+ nStyle = mpData->pTabs[i-1].nStyle;
+ if ( !(nStyle & RULER_STYLE_INVISIBLE) )
+ {
+ nStyle &= RULER_TAB_STYLE;
+
+ // Default-Tabs werden nur angezeigt
+ if ( nStyle != RULER_TAB_DEFAULT )
+ {
+ n1 = mpData->pTabs[i-1].nPos;
+
+ if ( nStyle == RULER_TAB_LEFT )
+ {
+ aRect.Left() = n1;
+ aRect.Right() = n1+RULER_TAB_WIDTH-1;
+ }
+ else if ( nStyle == RULER_TAB_RIGHT )
+ {
+ aRect.Right() = n1;
+ aRect.Left() = n1-RULER_TAB_WIDTH-1;
+ }
+ else
+ {
+ aRect.Left() = n1-RULER_TAB_CWIDTH2+1;
+ aRect.Right() = n1-RULER_TAB_CWIDTH2+RULER_TAB_CWIDTH;
+ }
+
+ aRect.Left()--;
+ aRect.Right()++;
+
+ if ( aRect.IsInside( Point( nX, nY ) ) )
+ {
+ pHitTest->eType = RULER_TYPE_TAB;
+ pHitTest->nAryPos = i-1;
+ return TRUE;
+ }
+ }
+ }
+ }
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL Ruler::ImplDocHitTest( const Point& rPos, RulerType eDragType,
+ ImplRulerHitTest* pHitTest ) const
+{
+ Point aPos = rPos;
+
+ if ( mnWinStyle & WB_HORZ )
+ aPos.X() += mnWinOff;
+ else
+ aPos.Y() += mnWinOff;
+
+ if ( (eDragType == RULER_TYPE_INDENT) || (eDragType == RULER_TYPE_DONTKNOW) )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ aPos.Y() = RULER_OFF+1;
+ else
+ aPos.X() = RULER_OFF+1;
+
+ // HitTest durchfuehren
+ if ( ImplHitTest( aPos, pHitTest ) )
+ {
+ if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
+ return TRUE;
+ }
+ }
+
+ if ( (eDragType == RULER_TYPE_INDENT) || (eDragType == RULER_TYPE_TAB) ||
+ (eDragType == RULER_TYPE_DONTKNOW) )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ aPos.Y() = mnHeight-RULER_OFF-1;
+ else
+ aPos.X() = mnWidth-RULER_OFF-1;
+
+ // HitTest durchfuehren
+ if ( ImplHitTest( aPos, pHitTest ) )
+ {
+ if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
+ return TRUE;
+ }
+ }
+
+ if ( (eDragType == RULER_TYPE_MARGIN1) || (eDragType == RULER_TYPE_MARGIN2) ||
+ (eDragType == RULER_TYPE_BORDER) || (eDragType == RULER_TYPE_DONTKNOW) )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ aPos.Y() = RULER_OFF + (mnVirHeight/2);
+ else
+ aPos.X() = RULER_OFF + (mnVirHeight/2);
+
+ // HitTest durchfuehren
+ if ( ImplHitTest( aPos, pHitTest ) )
+ {
+ if ( (pHitTest->eType == eDragType) || (eDragType == RULER_TYPE_DONTKNOW) )
+ return TRUE;
+ }
+ }
+
+ // Auf DontKnow setzen
+ pHitTest->eType = RULER_TYPE_DONTKNOW;
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL Ruler::ImplStartDrag( ImplRulerHitTest* pHitTest, USHORT nModifier )
+{
+ // Wenn eine Spalte angeklick wurde, die weder verschiebar noch
+ // in der Groesse aenderbar ist, brauchen wir auch kein Drag ausloesen
+ if ( (pHitTest->eType == RULER_TYPE_BORDER) &&
+ !pHitTest->bSize && !pHitTest->bSizeBar )
+ return FALSE;
+
+ // Dragdaten setzen
+ meDragType = pHitTest->eType;
+ mnDragPos = pHitTest->nPos;
+ mnDragAryPos = pHitTest->nAryPos;
+ mnDragSize = pHitTest->mnDragSize;
+ mnDragModifier = nModifier;
+ maDragData = maData;
+ mpData = &maDragData;
+
+ // Handler rufen
+ if ( StartDrag() )
+ {
+ // Wenn der Handler das Draggen erlaubt, dann das Draggen
+ // initialisieren
+ ImplInvertLines();
+ mbDrag = TRUE;
+ mnStartDragPos = mnDragPos;
+ StartTracking();
+ return TRUE;
+ }
+ else
+ {
+ // Ansonsten muessen wir die Daten zuruecksetzen
+ meDragType = RULER_TYPE_DONTKNOW;
+ mnDragPos = 0;
+ mnDragAryPos = 0;
+ mnDragSize = 0;
+ mnDragModifier = 0;
+ mpData = &maData;
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplDrag( const Point& rPos )
+{
+ long nX;
+ long nY;
+ long nOutHeight;
+
+ if ( mnWinStyle & WB_HORZ )
+ {
+ nX = rPos.X();
+ nY = rPos.Y();
+ nOutHeight = mnHeight;
+ }
+ else
+ {
+ nX = rPos.Y();
+ nY = rPos.X();
+ nOutHeight = mnWidth;
+ }
+
+ // X berechnen und einpassen
+ nX -= mnVirOff;
+ if ( nX < mpData->nRulVirOff )
+ {
+ nX = mpData->nRulVirOff;
+ mnDragScroll = RULER_SCROLL_1;
+ }
+ else if ( nX > mpData->nRulVirOff+mpData->nRulWidth )
+ {
+ nX = mpData->nRulVirOff+mpData->nRulWidth;
+ mnDragScroll = RULER_SCROLL_2;
+ }
+ nX -= mpData->nNullVirOff;
+
+ // Wenn oberhalb oder links vom Lineal, dann alte Werte
+ mbDragDelete = FALSE;
+ if ( nY < 0 )
+ {
+ if ( !mbDragCanceled )
+ {
+ // Daten wiederherstellen
+ mbDragCanceled = TRUE;
+ ImplRulerData aTempData;
+ aTempData = maDragData;
+ maDragData = maData;
+ mbCalc = TRUE;
+ mbFormat = TRUE;
+
+ // Handler rufen
+ mnDragPos = mnStartDragPos;
+ Drag();
+
+ // Und neu ausgeben (zeitverzoegert)
+/*
+ mnUpdateFlags |= RULER_UPDATE_DRAW;
+ if ( mnUpdateEvtId )
+ Application::RemoveUserEvent( mnUpdateEvtId );
+ mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL );
+*/
+ ImplDraw();
+
+ // Daten wieder wie vor dem Cancel herstellen
+ maDragData = aTempData;
+ }
+ }
+ else
+ {
+ mbDragCanceled = FALSE;
+
+ // +2, damit nicht so schnell die Tabs geloescht werden
+ if ( nY > nOutHeight+2 )
+ mbDragDelete = TRUE;
+
+ mnDragPos = nX;
+
+ // Handler rufen
+ Drag();
+
+ // Und neu ausgeben
+ if ( mbFormat )
+ ImplDraw();
+ }
+
+ mnDragScroll = 0;
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ImplEndDrag()
+{
+ // Werte uebernehmen
+ if ( mbDragCanceled )
+ maDragData = maData;
+ else
+ maData = maDragData;
+ mpData = &maData;
+ mbDrag = FALSE;
+
+ // Handler rufen
+ EndDrag();
+
+ // Drag-Werte zuruecksetzen
+ meDragType = RULER_TYPE_DONTKNOW;
+ mnDragPos = 0;
+ mnDragAryPos = 0;
+ mnDragSize = 0;
+ mbDragCanceled = FALSE;
+ mbDragDelete = FALSE;
+ mnDragModifier = 0;
+ mnDragScroll = 0;
+ mnStartDragPos = 0;
+
+ // Und neu ausgeben
+ ImplDraw();
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( Ruler, ImplUpdateHdl, void*, EMPTYARG )
+{
+ mnUpdateEvtId = 0;
+
+ // Feststellen, was upgedatet werden muss
+ if ( mnUpdateFlags & RULER_UPDATE_DRAW )
+ {
+ mnUpdateFlags = 0;
+ ImplDraw();
+ }
+ else if ( mnUpdateFlags & RULER_UPDATE_LINES )
+ {
+ mnUpdateFlags = 0;
+ ImplInvertLines();
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() && !IsTracking() )
+ {
+ Point aMousePos = rMEvt.GetPosPixel();
+ USHORT nMouseClicks = rMEvt.GetClicks();
+ USHORT nMouseModifier = rMEvt.GetModifier();
+
+ // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
+ // gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
+ if ( mbFormat )
+ {
+ ImplDraw();
+ mnUpdateFlags &= ~RULER_UPDATE_DRAW;
+ }
+
+ if ( maExtraRect.IsInside( aMousePos ) )
+ {
+ mnExtraClicks = nMouseClicks;
+ mnExtraModifier = nMouseModifier;
+ ExtraDown();
+ mnExtraClicks = 0;
+ mnExtraModifier = 0;
+ }
+ else
+ {
+ ImplRulerHitTest aHitTest;
+
+ if ( nMouseClicks == 1 )
+ {
+ if ( ImplHitTest( aMousePos, &aHitTest ) )
+ ImplStartDrag( &aHitTest, nMouseModifier );
+ else
+ {
+ // Position innerhalb des Lineal-Bereiches
+ if ( aHitTest.eType == RULER_TYPE_DONTKNOW )
+ {
+ mnDragPos = aHitTest.nPos;
+ Click();
+ mnDragPos = 0;
+
+ // Nocheinmal HitTest durchfuehren, da durch den Click
+ // zum Beispiel ein neuer Tab gesetzt werden konnte
+ if ( ImplHitTest( aMousePos, &aHitTest ) )
+ ImplStartDrag( &aHitTest, nMouseModifier );
+ }
+ }
+ }
+ else
+ {
+ if ( ImplHitTest( aMousePos, &aHitTest ) )
+ {
+ mnDragPos = aHitTest.nPos;
+ mnDragAryPos = aHitTest.nAryPos;
+ }
+ meDragType = aHitTest.eType;
+
+ DoubleClick();
+
+ meDragType = RULER_TYPE_DONTKNOW;
+ mnDragPos = 0;
+ mnDragAryPos = 0;
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::MouseMove( const MouseEvent& rMEvt )
+{
+ PointerStyle ePtrStyle = POINTER_ARROW;
+
+ // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
+ // gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
+ if ( mbFormat )
+ {
+ ImplDraw();
+ mnUpdateFlags &= ~RULER_UPDATE_DRAW;
+ }
+
+ ImplRulerHitTest aHitTest;
+ if ( ImplHitTest( rMEvt.GetPosPixel(), &aHitTest ) )
+ {
+ if ( aHitTest.bSize )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ ePtrStyle = POINTER_ESIZE;
+ else
+ ePtrStyle = POINTER_SSIZE;
+ }
+ else if ( aHitTest.bSizeBar )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ ePtrStyle = POINTER_HSIZEBAR;
+ else
+ ePtrStyle = POINTER_VSIZEBAR;
+ }
+ }
+
+ SetPointer( Pointer( ePtrStyle ) );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::Tracking( const TrackingEvent& rTEvt )
+{
+ if ( rTEvt.IsTrackingEnded() )
+ {
+ // Bei Abbruch, den alten Status wieder herstellen
+ if ( rTEvt.IsTrackingCanceled() )
+ {
+ mbDragCanceled = TRUE;
+ mbFormat = TRUE;
+ }
+
+ ImplEndDrag();
+ }
+ else
+ ImplDrag( rTEvt.GetMouseEvent().GetPosPixel() );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::Paint( const Rectangle& )
+{
+ ImplDraw();
+
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ // Extra-Field beruecksichtigen
+ if ( mnWinStyle & WB_EXTRAFIELD )
+ {
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( Point( maExtraRect.Left(), maExtraRect.Top() ),
+ Point( maExtraRect.Right()-1, maExtraRect.Top() ) );
+ DrawLine( Point( maExtraRect.Left(), maExtraRect.Top() ),
+ Point( maExtraRect.Left(), maExtraRect.Bottom()-1 ) );
+ DrawLine( Point( maExtraRect.Left(), maExtraRect.Bottom()-1 ),
+ Point( maExtraRect.Right()-1, maExtraRect.Bottom()-1 ) );
+ DrawLine( Point( maExtraRect.Right()-1, maExtraRect.Top() ),
+ Point( maExtraRect.Right()-1, maExtraRect.Bottom()-1 ) );
+ SetLineColor( rStyleSettings.GetLightColor() );
+ DrawLine( Point( maExtraRect.Left()+1, maExtraRect.Top()+1 ),
+ Point( maExtraRect.Right()-2, maExtraRect.Top()+1 ) );
+ DrawLine( Point( maExtraRect.Left()+1, maExtraRect.Top()+1 ),
+ Point( maExtraRect.Left()+1, maExtraRect.Bottom()-2 ) );
+ DrawLine( Point( maExtraRect.Left(), maExtraRect.Bottom() ),
+ Point( maExtraRect.Right(), maExtraRect.Bottom() ) );
+ DrawLine( Point( maExtraRect.Right(), maExtraRect.Top() ),
+ Point( maExtraRect.Right(), maExtraRect.Bottom() ) );
+ }
+ else
+ {
+ SetLineColor( rStyleSettings.GetWindowTextColor() );
+ SetFillColor( rStyleSettings.GetWindowColor() );
+ DrawRect( maExtraRect );
+ }
+
+ // Imhalt vom Extrafeld ausgeben
+ ImplDrawExtra( TRUE );
+ }
+
+ if ( mnWinStyle & WB_BORDER )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ {
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( Point( mnBorderOff, mnHeight-2 ),
+ Point( mnWidth, mnHeight-2 ) );
+ if ( mnBorderOff )
+ {
+ DrawLine( Point( mnBorderOff-1, mnHeight-2 ),
+ Point( mnBorderOff-1, mnHeight-1 ) );
+ }
+ }
+ SetLineColor( rStyleSettings.GetWindowTextColor() );
+ DrawLine( Point( mnBorderOff, mnHeight-1 ),
+ Point( mnWidth, mnHeight-1 ) );
+ }
+ else
+ {
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( Point( mnWidth-2, mnBorderOff ),
+ Point( mnWidth-2, mnHeight ) );
+ if ( mnBorderOff )
+ {
+ DrawLine( Point( mnWidth-2, mnBorderOff-1 ),
+ Point( mnWidth-1, mnBorderOff-1 ) );
+ }
+ }
+ SetLineColor( rStyleSettings.GetWindowTextColor() );
+ DrawLine( Point( mnWidth-1, mnBorderOff ),
+ Point( mnWidth-1, mnHeight ) );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::Resize()
+{
+ Size aWinSize = GetOutputSizePixel();
+
+ long nNewHeight;
+ if ( mnWinStyle & WB_HORZ )
+ {
+ if ( aWinSize.Height() != mnHeight )
+ nNewHeight = aWinSize.Height();
+ else
+ nNewHeight = 0;
+ }
+ else
+ {
+ if ( aWinSize.Width() != mnWidth )
+ nNewHeight = aWinSize.Width();
+ else
+ nNewHeight = 0;
+ }
+
+ // Hier schon Linien loeschen
+ BOOL bVisible = IsReallyVisible();
+ if ( bVisible && mpData->nLines )
+ {
+ ImplInvertLines();
+ mnUpdateFlags |= RULER_UPDATE_LINES;
+ if ( !mnUpdateEvtId )
+ mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL );
+ }
+ mbFormat = TRUE;
+
+ // Wenn sich die Hoehe bzw. Breite aendert, dann muessen besimmte Werte
+ // neu berechnet werden
+ if ( nNewHeight )
+ {
+ mbCalc = TRUE;
+ mnVirHeight = nNewHeight - mnBorderWidth - (RULER_OFF*2);
+ ImplInitExtraField( FALSE );
+ }
+ else
+ {
+ if ( mpData->bAutoPageWidth )
+ ImplUpdate( TRUE );
+ else if ( mbAutoWinWidth )
+ mbCalc = TRUE;
+ }
+
+ // Wenn Ruler eine Groesse hat, dann Groesse vom VirtualDevice setzen
+ if ( (mnVirWidth > RULER_MIN_SIZE) ||
+ ((aWinSize.Width() > RULER_MIN_SIZE) && (aWinSize.Height() > RULER_MIN_SIZE)) )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ mnVirWidth = aWinSize.Width()-mnVirOff;
+ else
+ mnVirWidth = aWinSize.Height()-mnVirOff;
+ if ( mnVirWidth < RULER_MIN_SIZE )
+ mnVirWidth = 0;
+ }
+
+ // Gegebenenfalls ein Teil vom Rand loeschen, da 3D-Effekt/Trennlinie am
+ // Fensterrand
+ if ( bVisible )
+ {
+ if ( nNewHeight )
+ Invalidate();
+ else if ( mpData->bAutoPageWidth )
+ {
+ // Nur bei AutoPageWidth haben wir rechts einen 3D-Effekt,
+ // der sich der Fensterbreite anpasst und deshalb neu gezeichnet
+ // werden muss
+ Rectangle aRect;
+
+ if ( mnWinStyle & WB_HORZ )
+ {
+ if ( mnWidth < aWinSize.Width() )
+ aRect.Left() = mnWidth-RULER_RESIZE_OFF;
+ else
+ aRect.Left() = aWinSize.Width()-RULER_RESIZE_OFF;
+ aRect.Right() = aRect.Left()+RULER_RESIZE_OFF;
+ aRect.Top() = RULER_OFF;
+ aRect.Bottom() = RULER_OFF+mnVirHeight;
+ }
+ else
+ {
+ if ( mnHeight < aWinSize.Height() )
+ aRect.Top() = mnHeight-RULER_RESIZE_OFF;
+ else
+ aRect.Top() = aWinSize.Height()-RULER_RESIZE_OFF;
+ aRect.Bottom() = aRect.Top()+RULER_RESIZE_OFF;
+ aRect.Left() = RULER_OFF;
+ aRect.Right() = RULER_OFF+mnVirHeight;
+ }
+
+ Invalidate( aRect );
+ }
+ }
+
+ // Neue Groesse merken
+ mnWidth = aWinSize.Width();
+ mnHeight = aWinSize.Height();
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::StateChanged( StateChangedType nType )
+{
+ Window::StateChanged( nType );
+
+ if ( nType == STATE_CHANGE_INITSHOW )
+ ImplFormat();
+ else if ( nType == STATE_CHANGE_UPDATEMODE )
+ {
+ if ( IsReallyVisible() && IsUpdateMode() )
+ ImplDraw();
+ }
+ else if ( (nType == STATE_CHANGE_ZOOM) ||
+ (nType == STATE_CHANGE_CONTROLFONT) )
+ {
+ ImplInitSettings( TRUE, FALSE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ {
+ ImplInitSettings( FALSE, TRUE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ ImplInitSettings( FALSE, FALSE, TRUE );
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
+ (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
+ (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
+ ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+ {
+ mbFormat = TRUE;
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+long Ruler::StartDrag()
+{
+ if ( maStartDragHdl.IsSet() )
+ return maStartDragHdl.Call( this );
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::Drag()
+{
+ maDragHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::EndDrag()
+{
+ maEndDragHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::Click()
+{
+ maClickHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::DoubleClick()
+{
+ maDoubleClickHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::ExtraDown()
+{
+ maExtraDownHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::Activate()
+{
+ mbActive = TRUE;
+
+ // Positionslinien wieder anzeigen (erst hinter mbActive=TRUE rufen, da
+ // von ImplInvertLines() ausgewertet wird). Das Zeichnen der Linien
+ // wird verzoegert, damit im vermutlich noch nicht gepainteten Zustand
+ // Linien gezeichnet werden.
+ mnUpdateFlags |= RULER_UPDATE_LINES;
+ if ( !mnUpdateEvtId )
+ mnUpdateEvtId = Application::PostUserEvent( LINK( this, Ruler, ImplUpdateHdl ), NULL );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::Deactivate()
+{
+ // Positionslinien loeschen (schon vor mbActive=FALSE rufen, da
+ // von ImplInvertLines() ausgewertet wird)
+ ImplInvertLines();
+
+ mbActive = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL Ruler::StartDocDrag( const MouseEvent& rMEvt, RulerType eDragType )
+{
+ if ( !mbDrag )
+ {
+ Point aMousePos = rMEvt.GetPosPixel();
+ USHORT nMouseClicks = rMEvt.GetClicks();
+ USHORT nMouseModifier = rMEvt.GetModifier();
+ ImplRulerHitTest aHitTest;
+
+ // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
+ // gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
+ if ( mbFormat )
+ {
+ ImplDraw();
+ mnUpdateFlags &= ~RULER_UPDATE_DRAW;
+ }
+
+ if ( nMouseClicks == 1 )
+ {
+ if ( ImplDocHitTest( aMousePos, eDragType, &aHitTest ) )
+ {
+ Pointer aPtr;
+
+ if ( aHitTest.bSize )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ aPtr = Pointer( POINTER_ESIZE );
+ else
+ aPtr = Pointer( POINTER_SSIZE );
+ }
+ else if ( aHitTest.bSizeBar )
+ {
+ if ( mnWinStyle & WB_HORZ )
+ aPtr = Pointer( POINTER_HSIZEBAR );
+ else
+ aPtr = Pointer( POINTER_VSIZEBAR );
+ }
+ SetPointer( aPtr );
+ return ImplStartDrag( &aHitTest, nMouseModifier );
+ }
+ }
+ else if ( nMouseClicks == 2 )
+ {
+ if ( ImplDocHitTest( aMousePos, eDragType, &aHitTest ) )
+ {
+ mnDragPos = aHitTest.nPos;
+ mnDragAryPos = aHitTest.nAryPos;
+ }
+ eDragType = aHitTest.eType;
+
+ DoubleClick();
+
+ eDragType = RULER_TYPE_DONTKNOW;
+ mnDragPos = 0;
+ mnDragAryPos = 0;
+
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+RulerType Ruler::GetDocType( const Point& rPos, RulerType eDragType,
+ USHORT* pAryPos ) const
+{
+ ImplRulerHitTest aHitTest;
+
+ // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
+ // gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
+ if ( IsReallyVisible() && mbFormat )
+ {
+ ((Ruler*)this)->ImplDraw();
+ ((Ruler*)this)->mnUpdateFlags &= ~RULER_UPDATE_DRAW;
+ }
+
+ // HitTest durchfuehren
+ ImplDocHitTest( rPos, eDragType, &aHitTest );
+
+ // Werte zurueckgeben
+ if ( pAryPos )
+ *pAryPos = aHitTest.nAryPos;
+ return aHitTest.eType;
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::CancelDrag()
+{
+ if ( mbDrag )
+ {
+ ImplDrag( Point( -1, -1 ) );
+ ImplEndDrag();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+RulerType Ruler::GetType( const Point& rPos, USHORT* pAryPos ) const
+{
+ ImplRulerHitTest aHitTest;
+
+ // Gegebenenfalls Lineal updaten (damit mit den richtigen Daten
+ // gearbeitet wird und die Anzeige auch zur Bearbeitung passt)
+ if ( IsReallyVisible() && mbFormat )
+ {
+ ((Ruler*)this)->ImplDraw();
+ ((Ruler*)this)->mnUpdateFlags &= ~RULER_UPDATE_DRAW;
+ }
+
+ // HitTest durchfuehren
+ ImplHitTest( rPos, &aHitTest );
+
+ // Werte zurueckgeben
+ if ( pAryPos )
+ *pAryPos = aHitTest.nAryPos;
+ return aHitTest.eType;
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetWinPos( long nNewOff, long nNewWidth )
+{
+ // Gegebenenfalls werden die Breiten automatisch berechnet
+ if ( !nNewWidth )
+ mbAutoWinWidth = TRUE;
+ else
+ mbAutoWinWidth = FALSE;
+
+ // Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet)
+ mnWinOff = nNewOff;
+ mnWinWidth = nNewWidth;
+ ImplUpdate( TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetPagePos( long nNewOff, long nNewWidth )
+{
+ // Muessen wir ueberhaupt was machen
+ if ( (mpData->nPageOff == nNewOff) && (mpData->nPageWidth == nNewWidth) )
+ return;
+
+ // Gegebenenfalls werden die Breiten automatisch berechnet
+ if ( !nNewWidth )
+ mpData->bAutoPageWidth = TRUE;
+ else
+ mpData->bAutoPageWidth = FALSE;
+
+ // Werte setzen (werden in ImplFormat gegebenenfalls mitberechnet)
+ mpData->nPageOff = nNewOff;
+ mpData->nPageWidth = nNewWidth;
+ ImplUpdate( TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetBorderPos( long nOff )
+{
+ if ( mnWinStyle & WB_BORDER )
+ {
+ if ( mnBorderOff != nOff )
+ {
+ mnBorderOff = nOff;
+
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetUnit( FieldUnit eNewUnit )
+{
+ if ( meUnit != eNewUnit )
+ {
+ meUnit = eNewUnit;
+ switch ( meUnit )
+ {
+ case FUNIT_MM:
+ mnUnitIndex = RULER_UNIT_MM;
+ break;
+ case FUNIT_CM:
+ mnUnitIndex = RULER_UNIT_CM;
+ break;
+ case FUNIT_M:
+ mnUnitIndex = RULER_UNIT_M;
+ break;
+ case FUNIT_KM:
+ mnUnitIndex = RULER_UNIT_KM;
+ break;
+ case FUNIT_INCH:
+ mnUnitIndex = RULER_UNIT_INCH;
+ break;
+ case FUNIT_FOOT:
+ mnUnitIndex = RULER_UNIT_FOOT;
+ break;
+ case FUNIT_MILE:
+ mnUnitIndex = RULER_UNIT_MILE;
+ break;
+ case FUNIT_POINT:
+ mnUnitIndex = RULER_UNIT_POINT;
+ break;
+ case FUNIT_PICA:
+ mnUnitIndex = RULER_UNIT_PICA;
+ break;
+
+#ifdef DBG_UTIL
+ default:
+ DBG_ERRORFILE( "Ruler::SetUnit() - Wrong Unit" );
+ break;
+#endif
+ }
+
+ maMapMode.SetMapUnit( aImplRulerUnitTab[mnUnitIndex].eMapUnit );
+ ImplUpdate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetZoom( const Fraction& rNewZoom )
+{
+ DBG_ASSERT( rNewZoom.GetNumerator(), "Ruler::SetZoom() with scale 0 is not allowed" );
+
+ if ( maZoom != rNewZoom )
+ {
+ maZoom = rNewZoom;
+ maMapMode.SetScaleX( maZoom );
+ maMapMode.SetScaleY( maZoom );
+ ImplUpdate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetExtraType( RulerExtra eNewExtraType, USHORT nStyle )
+{
+ if ( mnWinStyle & WB_EXTRAFIELD )
+ {
+ meExtraType = eNewExtraType;
+ mnExtraStyle = nStyle;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ ImplDrawExtra( FALSE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetNullOffset( long nPos )
+{
+ if ( mpData->nNullOff != nPos )
+ {
+ mpData->nNullOff = nPos;
+ ImplUpdate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetMargin1( long nPos, USHORT nMarginStyle )
+{
+ if ( (mpData->nMargin1 != nPos) || (mpData->nMargin1Style != nMarginStyle) )
+ {
+ mpData->nMargin1 = nPos;
+ mpData->nMargin1Style = nMarginStyle;
+ ImplUpdate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetMargin2( long nPos, USHORT nMarginStyle )
+{
+ DBG_ASSERT( (nPos >= mpData->nMargin1) ||
+ (mpData->nMargin1Style & RULER_STYLE_INVISIBLE) ||
+ (mpData->nMargin2Style & RULER_STYLE_INVISIBLE),
+ "Ruler::SetMargin2() - Margin2 < Margin1" );
+
+ if ( (mpData->nMargin2 != nPos) || (mpData->nMargin2Style != nMarginStyle) )
+ {
+ mpData->nMargin2 = nPos;
+ mpData->nMargin2Style = nMarginStyle;
+ ImplUpdate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetLines( USHORT n, const RulerLine* pLineAry )
+{
+ // Testen, ob sich was geaendert hat
+ if ( mpData->nLines == n )
+ {
+ USHORT i = n;
+ const RulerLine* pAry1 = mpData->pLines;
+ const RulerLine* pAry2 = pLineAry;
+ while ( i )
+ {
+ if ( (pAry1->nPos != pAry2->nPos) ||
+ (pAry1->nStyle != pAry2->nStyle) )
+ break;
+ pAry1++;
+ pAry2++;
+ i--;
+ }
+ if ( !i )
+ return;
+ }
+
+ // Neue Werte setzen und neu ausgeben
+ BOOL bMustUpdate;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ bMustUpdate = TRUE;
+ else
+ bMustUpdate = FALSE;
+
+ // Alte Linien loeschen
+ if ( bMustUpdate )
+ ImplInvertLines();
+
+ // Neue Daten setzen
+ if ( !n || !pLineAry )
+ {
+ if ( !mpData->pLines )
+ return;
+ delete mpData->pLines;
+ mpData->nLines = 0;
+ mpData->pLines = NULL;
+ }
+ else
+ {
+ if ( mpData->nLines != n )
+ {
+ if ( mpData->pLines )
+ delete mpData->pLines;
+ mpData->nLines = n;
+ mpData->pLines = new RulerLine[n];
+ }
+
+ memcpy( mpData->pLines, pLineAry, n*sizeof( RulerLine ) );
+
+ // Linien neu ausgeben
+ if ( bMustUpdate )
+ ImplInvertLines();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetArrows( USHORT n, const RulerArrow* pArrowAry )
+{
+ if ( !n || !pArrowAry )
+ {
+ if ( !mpData->pArrows )
+ return;
+ delete mpData->pArrows;
+ mpData->nArrows = 0;
+ mpData->pArrows = NULL;
+ }
+ else
+ {
+ if ( mpData->nArrows != n )
+ {
+ if ( mpData->pArrows )
+ delete mpData->pArrows;
+ mpData->nArrows = n;
+ mpData->pArrows = new RulerArrow[n];
+ }
+ else
+ {
+ USHORT i = n;
+ const RulerArrow* pAry1 = mpData->pArrows;
+ const RulerArrow* pAry2 = pArrowAry;
+ while ( i )
+ {
+ if ( (pAry1->nPos != pAry2->nPos) ||
+ (pAry1->nWidth != pAry2->nWidth) ||
+ (pAry1->nLogWidth != pAry2->nLogWidth) ||
+ (pAry1->nStyle != pAry2->nStyle) )
+ break;
+ pAry1++;
+ pAry2++;
+ i--;
+ }
+ if ( !i )
+ return;
+ }
+
+ memcpy( mpData->pArrows, pArrowAry, n*sizeof( RulerArrow ) );
+ }
+
+ ImplUpdate();
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetBorders( USHORT n, const RulerBorder* pBrdAry )
+{
+ if ( !n || !pBrdAry )
+ {
+ if ( !mpData->pBorders )
+ return;
+ delete mpData->pBorders;
+ mpData->nBorders = 0;
+ mpData->pBorders = NULL;
+ }
+ else
+ {
+ if ( mpData->nBorders != n )
+ {
+ if ( mpData->pBorders )
+ delete mpData->pBorders;
+ mpData->nBorders = n;
+ mpData->pBorders = new RulerBorder[n];
+ }
+ else
+ {
+ USHORT i = n;
+ const RulerBorder* pAry1 = mpData->pBorders;
+ const RulerBorder* pAry2 = pBrdAry;
+ while ( i )
+ {
+ if ( (pAry1->nPos != pAry2->nPos) ||
+ (pAry1->nWidth != pAry2->nWidth) ||
+ (pAry1->nStyle != pAry2->nStyle) )
+ break;
+ pAry1++;
+ pAry2++;
+ i--;
+ }
+ if ( !i )
+ return;
+ }
+
+ memcpy( mpData->pBorders, pBrdAry, n*sizeof( RulerBorder ) );
+ }
+
+ ImplUpdate();
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetIndents( USHORT n, const RulerIndent* pIndentAry )
+{
+ DBG_ASSERT( mnWinStyle & WB_HORZ,
+ "Ruler::SetIndents() not allowed when WB_VERT" );
+
+ if ( !n || !pIndentAry )
+ {
+ if ( !mpData->pIndents )
+ return;
+ delete mpData->pIndents;
+ mpData->nIndents = 0;
+ mpData->pIndents = NULL;
+ }
+ else
+ {
+ if ( mpData->nIndents != n )
+ {
+ if ( mpData->pIndents )
+ delete mpData->pIndents;
+ mpData->nIndents = n;
+ mpData->pIndents = new RulerIndent[n];
+ }
+ else
+ {
+ USHORT i = n;
+ const RulerIndent* pAry1 = mpData->pIndents;
+ const RulerIndent* pAry2 = pIndentAry;
+ while ( i )
+ {
+ if ( (pAry1->nPos != pAry2->nPos) ||
+ (pAry1->nStyle != pAry2->nStyle) )
+ break;
+ pAry1++;
+ pAry2++;
+ i--;
+ }
+ if ( !i )
+ return;
+ }
+
+ memcpy( mpData->pIndents, pIndentAry, n*sizeof( RulerIndent ) );
+ }
+
+ ImplUpdate();
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetTabs( USHORT n, const RulerTab* pTabAry )
+{
+ DBG_ASSERT( mnWinStyle & WB_HORZ,
+ "Ruler::SetTabs() not allowed when WB_VERT" );
+
+ if ( !n || !pTabAry )
+ {
+ if ( !mpData->pTabs )
+ return;
+ delete mpData->pTabs;
+ mpData->nTabs = 0;
+ mpData->pTabs = NULL;
+ }
+ else
+ {
+ if ( mpData->nTabs != n )
+ {
+ if ( mpData->pTabs )
+ delete mpData->pTabs;
+ mpData->nTabs = n;
+ mpData->pTabs = new RulerTab[n];
+ }
+ else
+ {
+ USHORT i = n;
+ const RulerTab* pAry1 = mpData->pTabs;
+ const RulerTab* pAry2 = pTabAry;
+ while ( i )
+ {
+ if ( (pAry1->nPos != pAry2->nPos) ||
+ (pAry1->nStyle != pAry2->nStyle) )
+ break;
+ pAry1++;
+ pAry2++;
+ i--;
+ }
+ if ( !i )
+ return;
+ }
+
+ memcpy( mpData->pTabs, pTabAry, n*sizeof( RulerTab ) );
+ }
+
+ ImplUpdate();
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::SetStyle( WinBits nStyle )
+{
+ if ( mnWinStyle != nStyle )
+ {
+ mnWinStyle = nStyle;
+ ImplInitExtraField( TRUE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void Ruler::DrawTab( OutputDevice* pDevice, const Point& rPos, USHORT nStyle )
+{
+ const StyleSettings& rStyleSettings = pDevice->GetSettings().GetStyleSettings();
+ Point aPos( rPos );
+ USHORT nTabStyle = nStyle & RULER_TAB_STYLE;
+
+ pDevice->Push( PUSH_LINECOLOR | PUSH_FILLCOLOR );
+ pDevice->SetLineColor();
+ pDevice->SetFillColor( pDevice->GetSettings().GetStyleSettings().GetWindowTextColor() );
+ ImplCenterTabPos( aPos, nTabStyle );
+ ImplDrawRulerTab( pDevice, aPos, nTabStyle );
+ pDevice->Pop();
+}
diff --git a/svtools/source/control/scrwin.cxx b/svtools/source/control/scrwin.cxx
new file mode 100644
index 000000000000..10ef086ed9fd
--- /dev/null
+++ b/svtools/source/control/scrwin.cxx
@@ -0,0 +1,603 @@
+/*************************************************************************
+ *
+ * $RCSfile: scrwin.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SVT_SCRWIN_CXX
+#include <scrwin.hxx>
+
+//===================================================================
+
+void ScrollableWindow::ImpInitialize( ScrollableWindowFlags nFlags )
+{
+ bHandleDragging = (BOOL) ( nFlags & SCRWIN_THUMBDRAGGING );
+ bVCenter = (nFlags & SCRWIN_VCENTER) == SCRWIN_VCENTER;
+ bHCenter = (nFlags & SCRWIN_HCENTER) == SCRWIN_HCENTER;
+ bScrolling = FALSE;
+
+ // set the handlers for the scrollbars
+ aVScroll.SetScrollHdl( LINK(this, ScrollableWindow, ScrollHdl) );
+ aHScroll.SetScrollHdl( LINK(this, ScrollableWindow, ScrollHdl) );
+ aVScroll.SetEndScrollHdl( LINK(this, ScrollableWindow, EndScrollHdl) );
+ aHScroll.SetEndScrollHdl( LINK(this, ScrollableWindow, EndScrollHdl) );
+
+ nColumnPixW = nLinePixH = GetSettings().GetStyleSettings().GetScrollBarSize();
+}
+
+//-------------------------------------------------------------------
+
+ScrollableWindow::ScrollableWindow( Window* pParent, WinBits nBits,
+ ScrollableWindowFlags nFlags ) :
+ Window( pParent, WinBits(nBits|WB_CLIPCHILDREN) ),
+ aVScroll( this, WinBits(WB_VSCROLL | WB_DRAG) ),
+ aHScroll( this, WinBits(WB_HSCROLL | WB_DRAG) ),
+ aCornerWin( this )
+{
+ ImpInitialize( nFlags );
+}
+
+//-------------------------------------------------------------------
+
+ScrollableWindow::ScrollableWindow( Window* pParent, const ResId& rId,
+ ScrollableWindowFlags nFlags ) :
+ Window( pParent, rId ),
+ aVScroll( this, WinBits(WB_VSCROLL | WB_DRAG) ),
+ aHScroll( this, WinBits(WB_HSCROLL | WB_DRAG) ),
+ aCornerWin( this )
+{
+ ImpInitialize( nFlags );
+}
+
+// -----------------------------------------------------------------------
+
+void ScrollableWindow::Command( const CommandEvent& rCEvt )
+{
+ if ( (rCEvt.GetCommand() == COMMAND_WHEEL) ||
+ (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
+ (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) )
+ {
+ ScrollBar* pHScrBar;
+ ScrollBar* pVScrBar;
+ if ( aHScroll.IsVisible() )
+ pHScrBar = &aHScroll;
+ else
+ pHScrBar = NULL;
+ if ( aVScroll.IsVisible() )
+ pVScrBar = &aVScroll;
+ else
+ pVScrBar = NULL;
+ if ( HandleScrollCommand( rCEvt, pHScrBar, pVScrBar ) )
+ return;
+ }
+
+ Window::Command( rCEvt );
+}
+
+//-------------------------------------------------------------------
+
+void ScrollableWindow::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ Resize();
+ Invalidate();
+ }
+
+ Window::DataChanged( rDCEvt );
+}
+
+//-------------------------------------------------------------------
+
+Size __EXPORT ScrollableWindow::GetOutputSizePixel() const
+{
+ Size aSz( Window::GetOutputSizePixel() );
+
+ long nTmp = GetSettings().GetStyleSettings().GetScrollBarSize();
+ if ( aHScroll.IsVisible() )
+ aSz.Height() -= nTmp;
+ if ( aVScroll.IsVisible() )
+ aSz.Width() -= nTmp;
+ return aSz;
+}
+
+//-------------------------------------------------------------------
+
+Size ScrollableWindow::GetOutputSize() const
+{
+ return PixelToLogic( GetOutputSizePixel() );
+}
+
+//-------------------------------------------------------------------
+
+IMPL_LINK( ScrollableWindow, EndScrollHdl, ScrollBar *, pScroll )
+{
+ // notify the start of scrolling, if not already scrolling
+ if ( !bScrolling )
+ StartScroll(), bScrolling = TRUE;
+
+ // get the delta in logic coordinates
+ Size aDelta( PixelToLogic( Size( aHScroll.GetDelta(), aVScroll.GetDelta() ) ) );
+
+ // scroll the window, if this is not already done
+ if ( !bHandleDragging )
+ {
+ if ( pScroll == &aHScroll )
+ Scroll( aDelta.Width(), 0 );
+ else
+ Scroll( 0, aDelta.Height() );
+ }
+
+ // notify the end of scrolling
+ bScrolling = FALSE;
+ EndScroll( aDelta.Width(), aDelta.Height() );
+ return 0;
+}
+
+//-------------------------------------------------------------------
+
+IMPL_LINK( ScrollableWindow, ScrollHdl, ScrollBar *, pScroll )
+{
+ // notify the start of scrolling, if not already scrolling
+ if ( !bScrolling )
+ StartScroll(), bScrolling = TRUE;
+
+ if ( bHandleDragging )
+ {
+ // get the delta in logic coordinates
+ Size aDelta( PixelToLogic(
+ Size( aHScroll.GetDelta(), aVScroll.GetDelta() ) ) );
+ if ( pScroll == &aHScroll )
+ Scroll( aDelta.Width(), 0 );
+ else
+ Scroll( 0, aDelta.Height() );
+ }
+ return 0;
+}
+
+//-------------------------------------------------------------------
+
+void __EXPORT ScrollableWindow::Resize()
+{
+ // get the new output-size in pixel
+ Size aOutPixSz = Window::GetOutputSizePixel();
+
+ // determine the size of the output-area and if we need scrollbars
+ const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ BOOL bVVisible = FALSE; // by default no vertical-ScrollBar
+ BOOL bHVisible = FALSE; // by default no horizontal-ScrollBar
+ BOOL bChanged; // determines if a visiblility was changed
+ do
+ {
+ bChanged = FALSE;
+
+ // does we need a vertical ScrollBar
+ if ( aOutPixSz.Width() < aTotPixSz.Width() && !bHVisible )
+ { bHVisible = TRUE;
+ aOutPixSz.Height() -= nScrSize;
+ bChanged = TRUE;
+ }
+
+ // does we need a horizontal ScrollBar
+ if ( aOutPixSz.Height() < aTotPixSz.Height() && !bVVisible )
+ { bVVisible = TRUE;
+ aOutPixSz.Width() -= nScrSize;
+ bChanged = TRUE;
+ }
+
+ }
+ while ( bChanged ); // until no visibility has changed
+
+ // store the old offset and map-mode
+ MapMode aMap( GetMapMode() );
+ Point aOldPixOffset( aPixOffset );
+
+ // justify (right/bottom borders should never exceed the virtual window)
+ Size aPixDelta;
+ if ( aPixOffset.X() < 0 &&
+ aPixOffset.X() + aTotPixSz.Width() < aOutPixSz.Width() )
+ aPixDelta.Width() =
+ aOutPixSz.Width() - ( aPixOffset.X() + aTotPixSz.Width() );
+ if ( aPixOffset.Y() < 0 &&
+ aPixOffset.Y() + aTotPixSz.Height() < aOutPixSz.Height() )
+ aPixDelta.Height() =
+ aOutPixSz.Height() - ( aPixOffset.Y() + aTotPixSz.Height() );
+ if ( aPixDelta.Width() || aPixDelta.Height() )
+ {
+ aPixOffset.X() += aPixDelta.Width();
+ aPixOffset.Y() += aPixDelta.Height();
+ }
+
+ // for axis without scrollbar restore the origin
+ if ( !bVVisible || !bHVisible )
+ {
+ aPixOffset = Point(
+ bHVisible
+ ? aPixOffset.X()
+ : ( bHCenter
+ ? (aOutPixSz.Width()-aTotPixSz.Width()) / 2
+ : 0 ),
+ bVVisible
+ ? aPixOffset.Y()
+ : ( bVCenter
+ ? (aOutPixSz.Height()-aTotPixSz.Height()) / 2
+ : 0 ) );
+ }
+ if ( bHVisible && !aHScroll.IsVisible() )
+ aPixOffset.X() = 0;
+ if ( bVVisible && !aVScroll.IsVisible() )
+ aPixOffset.Y() = 0;
+
+ // select the shifted map-mode
+ if ( aPixOffset != aOldPixOffset )
+ {
+ Window::SetMapMode( MapMode( MAP_PIXEL ) );
+ Window::Scroll(
+ aPixOffset.X() - aOldPixOffset.X(),
+ aPixOffset.Y() - aOldPixOffset.Y() );
+ SetMapMode( aMap );
+ }
+
+ // show or hide scrollbars
+ aVScroll.Show( bVVisible );
+ aHScroll.Show( bHVisible );
+
+ // disable painting in the corner between the scrollbars
+ if ( bVVisible && bHVisible )
+ {
+ aCornerWin.SetPosSizePixel(
+ *((Point*) &aOutPixSz), Size(nScrSize, nScrSize) );
+ aCornerWin.Show();
+ }
+ else
+ aCornerWin.Hide();
+
+ // resize scrollbars and set their ranges
+ if ( bHVisible )
+ {
+ aHScroll.SetPosSizePixel(
+ Point( 0, aOutPixSz.Height() ),
+ Size( aOutPixSz.Width(), nScrSize ) );
+ aHScroll.SetRange( Range( 0, aTotPixSz.Width() ) );
+ aHScroll.SetPageSize( aOutPixSz.Width() );
+ aHScroll.SetVisibleSize( aOutPixSz.Width() );
+ aHScroll.SetLineSize( nColumnPixW );
+ aHScroll.SetThumbPos( -aPixOffset.X() );
+ }
+ if ( bVVisible )
+ {
+ aVScroll.SetPosSizePixel(
+ Point( aOutPixSz.Width(), 0 ),
+ Size( nScrSize,aOutPixSz.Height() ) );
+ aVScroll.SetRange( Range( 0, aTotPixSz.Height() ) );
+ aVScroll.SetPageSize( aOutPixSz.Height() );
+ aVScroll.SetVisibleSize( aOutPixSz.Height() );
+ aVScroll.SetLineSize( nLinePixH );
+ aVScroll.SetThumbPos( -aPixOffset.Y() );
+ }
+}
+
+//-------------------------------------------------------------------
+
+void __EXPORT ScrollableWindow::StartScroll()
+{
+}
+
+//-------------------------------------------------------------------
+
+void __EXPORT ScrollableWindow::EndScroll( long nDeltaX, long nDeltaY )
+{
+}
+
+//-------------------------------------------------------------------
+
+void ScrollableWindow::SetMapMode( const MapMode& rNewMapMode )
+{
+ MapMode aMap( rNewMapMode );
+ aMap.SetOrigin( aMap.GetOrigin() + PixelToLogic( aPixOffset, aMap ) );
+ Window::SetMapMode( aMap );
+}
+
+//-------------------------------------------------------------------
+
+MapMode ScrollableWindow::GetMapMode() const
+{
+ MapMode aMap( Window::GetMapMode() );
+ aMap.SetOrigin( aMap.GetOrigin() - PixelToLogic( aPixOffset ) );
+ return aMap;
+}
+
+//-------------------------------------------------------------------
+
+void ScrollableWindow::SetTotalSize( const Size& rNewSize )
+{
+ aTotPixSz = LogicToPixel( rNewSize );
+ ScrollableWindow::Resize();
+}
+
+//-------------------------------------------------------------------
+
+void ScrollableWindow::SetVisibleSize( const Size& rNewSize )
+{
+ // get the rectangle, we wish to view
+ Rectangle aWish( Point(0, 0), LogicToPixel(rNewSize) );
+
+ // get maximum rectangle for us from our parent-window (subst our border!)
+ Rectangle aMax( Point(0, 0), GetParent()->GetOutputSizePixel() );
+ aMax.Left() -= ( Window::GetSizePixel().Width() -
+ Window::GetOutputSizePixel().Width() );
+ aMax.Bottom() -= (Window::GetSizePixel().Height() -
+ Window::GetOutputSizePixel().Height());
+
+ Size aWill( aWish.GetIntersection(aMax).GetSize() );
+ BOOL bHScroll = FALSE;
+ const long nScrSize = GetSettings().GetStyleSettings().GetScrollBarSize();
+ if ( aWill.Width() < aWish.GetSize().Width() )
+ { bHScroll = TRUE;
+ aWill.Height() =
+ Min( aWill.Height()+nScrSize, aMax.GetSize().Height() );
+ }
+ if ( aWill.Height() < aWish.GetSize().Height() )
+ aWill.Width() =
+ Min( aWill.Width()+nScrSize, aMax.GetSize().Width() );
+ if ( !bHScroll && (aWill.Width() < aWish.GetSize().Width()) )
+ aWill.Height() =
+ Min( aWill.Height()+nScrSize, aMax.GetSize().Height() );
+ Window::SetOutputSizePixel( aWill );
+}
+
+//-------------------------------------------------------------------
+
+BOOL ScrollableWindow::MakeVisible( const Rectangle& rTarget, BOOL bSloppy )
+{
+ Rectangle aTarget;
+ Rectangle aTotRect( Point(0, 0), PixelToLogic( aTotPixSz ) );
+
+ if ( bSloppy )
+ {
+ aTarget = rTarget;
+
+ // at maximum to right border
+ if ( aTarget.Right() > aTotRect.Right() )
+ {
+ long nDelta = aTarget.Right() - aTotRect.Right();
+ aTarget.Left() -= nDelta;
+ aTarget.Right() -= nDelta;
+
+ // too wide?
+ if ( aTarget.Left() < aTotRect.Left() )
+ aTarget.Left() = aTotRect.Left();
+ }
+
+ // at maximum to bottom border
+ if ( aTarget.Bottom() > aTotRect.Bottom() )
+ {
+ long nDelta = aTarget.Bottom() - aTotRect.Bottom();
+ aTarget.Top() -= nDelta;
+ aTarget.Bottom() -= nDelta;
+
+ // too high?
+ if ( aTarget.Top() < aTotRect.Top() )
+ aTarget.Top() = aTotRect.Top();
+ }
+
+ // at maximum to left border
+ if ( aTarget.Left() < aTotRect.Left() )
+ {
+ long nDelta = aTarget.Left() - aTotRect.Left();
+ aTarget.Right() -= nDelta;
+ aTarget.Left() -= nDelta;
+
+ // too wide?
+ if ( aTarget.Right() > aTotRect.Right() )
+ aTarget.Right() = aTotRect.Right();
+ }
+
+ // at maximum to top border
+ if ( aTarget.Top() < aTotRect.Top() )
+ {
+ long nDelta = aTarget.Top() - aTotRect.Top();
+ aTarget.Bottom() -= nDelta;
+ aTarget.Top() -= nDelta;
+
+ // too high?
+ if ( aTarget.Bottom() > aTotRect.Bottom() )
+ aTarget.Bottom() = aTotRect.Bottom();
+ }
+ }
+ else
+ aTarget = rTarget.GetIntersection( aTotRect );
+
+ // is the area already visible?
+ Rectangle aVisArea( GetVisibleArea() );
+ if ( aVisArea.IsInside(rTarget) )
+ return TRUE;
+
+ // is there somewhat to scroll?
+ if ( aVisArea.TopLeft() != aTarget.TopLeft() )
+ {
+ Rectangle aBox( aTarget.GetUnion(aVisArea) );
+ long nDeltaX = ( aBox.Right() - aVisArea.Right() ) +
+ ( aBox.Left() - aVisArea.Left() );
+ long nDeltaY = ( aBox.Top() - aVisArea.Top() ) +
+ ( aBox.Bottom() - aVisArea.Bottom() );
+ Scroll( nDeltaX, nDeltaY );
+ }
+
+ // determine if the target is completely visible
+ return aVisArea.GetWidth() >= aTarget.GetWidth() &&
+ aVisArea.GetHeight() >= aTarget.GetHeight();
+}
+
+//-------------------------------------------------------------------
+
+Rectangle ScrollableWindow::GetVisibleArea() const
+{
+ Point aTopLeft( PixelToLogic( Point() ) );
+ Size aSz( GetOutputSize() );
+ return Rectangle( aTopLeft, aSz );
+}
+
+//-------------------------------------------------------------------
+
+void ScrollableWindow::SetLineSize( ULONG nHorz, ULONG nVert )
+{
+ Size aPixSz( LogicToPixel( Size(nHorz, nVert) ) );
+ nColumnPixW = aPixSz.Width();
+ nLinePixH = aPixSz.Height();
+ aVScroll.SetLineSize( nLinePixH );
+ aHScroll.SetLineSize( nColumnPixW );
+}
+
+//-------------------------------------------------------------------
+
+void ScrollableWindow::Scroll( long nDeltaX, long nDeltaY )
+{
+ if ( !bScrolling )
+ StartScroll();
+
+ // get the delta in pixel
+ Size aDeltaPix( LogicToPixel( Size(nDeltaX, nDeltaY) ) );
+ Size aOutPixSz( GetOutputSizePixel() );
+ MapMode aMap( GetMapMode() );
+ Point aNewPixOffset( aPixOffset );
+
+ // scrolling horizontally?
+ if ( nDeltaX != 0 )
+ {
+ aNewPixOffset.X() -= aDeltaPix.Width();
+ if ( ( aOutPixSz.Width() - aNewPixOffset.X() ) > aTotPixSz.Width() )
+ aNewPixOffset.X() = - ( aTotPixSz.Width() - aOutPixSz.Width() );
+ else if ( aNewPixOffset.X() > 0 )
+ aNewPixOffset.X() = 0;
+ }
+
+ // scrolling vertically?
+ if ( nDeltaY != 0 )
+ {
+ aNewPixOffset.Y() -= aDeltaPix.Height();
+ if ( ( aOutPixSz.Height() - aNewPixOffset.Y() ) > aTotPixSz.Height() )
+ aNewPixOffset.Y() = - ( aTotPixSz.Height() - aOutPixSz.Height() );
+ else if ( aNewPixOffset.Y() > 0 )
+ aNewPixOffset.Y() = 0;
+ }
+
+ // recompute the logical scroll units
+ aDeltaPix.Width() = aPixOffset.X() - aNewPixOffset.X();
+ aDeltaPix.Height() = aPixOffset.Y() - aNewPixOffset.Y();
+ Size aDelta( PixelToLogic(aDeltaPix) );
+ nDeltaX = aDelta.Width();
+ nDeltaY = aDelta.Height();
+ aPixOffset = aNewPixOffset;
+
+ // scrolling?
+ if ( nDeltaX != 0 || nDeltaY != 0 )
+ {
+ Update();
+
+ // does the new area overlap the old one?
+ if ( Abs( (int)aDeltaPix.Height() ) < aOutPixSz.Height() ||
+ Abs( (int)aDeltaPix.Width() ) < aOutPixSz.Width() )
+ {
+ // scroll the overlapping area
+ SetMapMode( aMap );
+
+ // never scroll the scrollbars itself!
+ Window::Scroll(-nDeltaX, -nDeltaY,
+ PixelToLogic( Rectangle( Point(0, 0), aOutPixSz ) ) );
+ }
+ else
+ {
+ // repaint all
+ SetMapMode( aMap );
+ Invalidate();
+ }
+
+ Update();
+ }
+
+ if ( !bScrolling )
+ {
+ EndScroll( nDeltaX, nDeltaY );
+ if ( nDeltaX )
+ aHScroll.SetThumbPos( -aPixOffset.X() );
+ if ( nDeltaY )
+ aVScroll.SetThumbPos( -aPixOffset.Y() );
+ }
+}
+
+//-------------------------------------------------------------------
+
+void ScrollableWindow::ScrollLines( long nLinesX, long nLinesY )
+{
+ Size aDelta( PixelToLogic( Size( nColumnPixW, nLinePixH ) ) );
+ Scroll( aDelta.Width()*nLinesX, aDelta.Height()*nLinesY );
+}
+
+//-------------------------------------------------------------------
+
+void ScrollableWindow::ScrollPages( long nPagesX, ULONG nOverlapX,
+ long nPagesY, ULONG nOverlapY )
+{
+ Size aOutSz( GetVisibleArea().GetSize() );
+ Scroll( nPagesX * aOutSz.Width() + (nPagesX>0 ? 1 : -1) * nOverlapX,
+ nPagesY * aOutSz.Height() + (nPagesY>0 ? 1 : -1) * nOverlapY );
+}
+
+
diff --git a/svtools/source/control/stdctrl.cxx b/svtools/source/control/stdctrl.cxx
new file mode 100644
index 000000000000..026a6642d209
--- /dev/null
+++ b/svtools/source/control/stdctrl.cxx
@@ -0,0 +1,77 @@
+/*************************************************************************
+ *
+ * $RCSfile: stdctrl.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <stdctrl.hxx>
+
+// =======================================================================
+
+FixedInfo::FixedInfo( Window* pParent, WinBits nWinStyle ) :
+ FixedText( pParent, nWinStyle | WB_INFO )
+{
+}
+
+// -----------------------------------------------------------------------
+
+FixedInfo::FixedInfo( Window* pParent, const ResId& rResId ) :
+ FixedText( pParent, rResId )
+{
+ SetStyle( GetStyle() | WB_INFO );
+}
diff --git a/svtools/source/control/stdmenu.cxx b/svtools/source/control/stdmenu.cxx
new file mode 100644
index 000000000000..46707d960e3d
--- /dev/null
+++ b/svtools/source/control/stdmenu.cxx
@@ -0,0 +1,446 @@
+/*************************************************************************
+ *
+ * $RCSfile: stdmenu.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string.h>
+
+#ifndef _INTN_HXX
+#include <tools/intn.hxx>
+#endif
+#ifndef _APP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
+#include <ctrltool.hxx>
+#include <stdmenu.hxx>
+
+// ========================================================================
+
+FontNameMenu::FontNameMenu()
+{
+ SetMenuFlags( GetMenuFlags() | MENU_FLAG_NOAUTOMNEMONICS );
+}
+
+// -----------------------------------------------------------------------
+
+FontNameMenu::~FontNameMenu()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void FontNameMenu::Select()
+{
+ maCurName = GetItemText( GetCurItemId() );
+ maSelectHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void FontNameMenu::Highlight()
+{
+ XubString aTempName = maCurName;
+ maCurName = GetItemText( GetCurItemId() );
+ maHighlightHdl.Call( this );
+ maCurName = aTempName;
+}
+
+// -----------------------------------------------------------------------
+
+void FontNameMenu::Fill( const FontList* pList )
+{
+ // Menu loeschen
+ Clear();
+
+ // Fonts eintragen
+ International aIntn = Application::GetAppInternational();
+ USHORT nFontCount = pList->GetFontNameCount();
+ for ( USHORT i = 0; i < nFontCount; i++ )
+ {
+ const XubString& rName = pList->GetFontName( i ).GetName();
+
+ // Sortieren, nach der in der Applikation eingestellten
+ // International-Klasse
+ USHORT j = GetItemCount();
+ while ( j )
+ {
+ XubString aText = GetItemText( GetItemId( j-1 ) );
+ if ( aIntn.Compare( rName, aText ) == COMPARE_GREATER )
+ break;
+ j--;
+ }
+
+ InsertItem( i+1, rName, MIB_RADIOCHECK | MIB_AUTOCHECK, j );
+ }
+
+ SetCurName( maCurName );
+}
+
+// -----------------------------------------------------------------------
+
+void FontNameMenu::SetCurName( const XubString& rName )
+{
+ maCurName = rName;
+
+ // Menueintrag checken
+ USHORT nChecked = 0;
+ USHORT nItemCount = GetItemCount();
+ for( USHORT i = 0; i < nItemCount; i++ )
+ {
+ USHORT nItemId = GetItemId( i );
+
+ if ( IsItemChecked( nItemId ) )
+ nChecked = nItemId;
+
+ XubString aText = GetItemText( nItemId );
+ if ( aText == maCurName )
+ {
+ CheckItem( nItemId, TRUE );
+ return;
+ }
+ }
+
+ if ( nChecked )
+ CheckItem( nChecked, FALSE );
+}
+
+// ========================================================================
+
+FontStyleMenu::FontStyleMenu()
+{
+ SetMenuFlags( GetMenuFlags() | MENU_FLAG_NOAUTOMNEMONICS );
+}
+
+// -----------------------------------------------------------------------
+
+FontStyleMenu::~FontStyleMenu()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void FontStyleMenu::Select()
+{
+ USHORT nCurId = GetCurItemId();
+
+ if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) )
+ {
+ maCurStyle = GetItemText( nCurId );
+ maSelectHdl.Call( this );
+ }
+ else
+ PopupMenu::Select();
+}
+
+// -----------------------------------------------------------------------
+
+void FontStyleMenu::Highlight()
+{
+ USHORT nCurId = GetCurItemId();
+
+ if ( (nCurId >= FONTSTYLEMENU_FIRSTID) && (nCurId <= FONTSTYLEMENU_LASTID) )
+ {
+ XubString aTempName = maCurStyle;
+ maCurStyle = GetItemText( nCurId );
+ maHighlightHdl.Call( this );
+ maCurStyle = aTempName;
+ }
+ else
+ PopupMenu::Highlight();
+}
+
+// -----------------------------------------------------------------------
+
+void FontStyleMenu::Fill( const XubString& rName, const FontList* pList )
+{
+ USHORT nItemId = GetItemId( 0 );
+ while ( (nItemId >= FONTSTYLEMENU_FIRSTID) &&
+ (nItemId <= FONTSTYLEMENU_LASTID) )
+ {
+ RemoveItem( 0 );
+ nItemId = GetItemId( 0 );
+ }
+
+ // Existiert ein Font mit diesem Namen
+ sal_Handle hFontInfo = pList->GetFirstFontInfo( rName );
+ if ( hFontInfo )
+ {
+ USHORT nPos = 0;
+ USHORT nId = FONTSTYLEMENU_FIRSTID;
+ BOOL bNormal = FALSE;
+ BOOL bItalic = FALSE;
+ BOOL bBold = FALSE;
+ BOOL bBoldItalic = FALSE;
+ FontInfo aInfo;
+ while ( hFontInfo )
+ {
+ aInfo = pList->GetFontInfo( hFontInfo );
+
+ XubString aStyleText = pList->GetStyleName( aInfo );
+ FontWeight eWeight = aInfo.GetWeight();
+ FontItalic eItalic = aInfo.GetItalic();
+ if ( eWeight <= WEIGHT_NORMAL )
+ {
+ bNormal = TRUE;
+ if ( eItalic != ITALIC_NONE )
+ bItalic = TRUE;
+ }
+ else
+ {
+ if ( eItalic != ITALIC_NONE )
+ bBoldItalic = TRUE;
+ else
+ bBold = TRUE;
+ }
+ if ( aStyleText == pList->GetItalicStr() )
+ bItalic = TRUE;
+ else if ( aStyleText == pList->GetBoldStr() )
+ bBold = TRUE;
+ else if ( aStyleText == pList->GetBoldItalicStr() )
+ bBoldItalic = TRUE;
+
+ InsertItem( nId, aStyleText,
+ MIB_RADIOCHECK | MIB_AUTOCHECK, nPos );
+ nPos++;
+ nId++;
+
+ hFontInfo = pList->GetNextFontInfo( hFontInfo );
+ }
+
+ // Bestimmte Styles als Nachbildung
+ if ( bNormal )
+ {
+ if ( !bItalic )
+ {
+ InsertItem( nId, pList->GetItalicStr(),
+ MIB_RADIOCHECK | MIB_AUTOCHECK, nPos );
+ nPos++;
+ nId++;
+ }
+ if ( !bBold )
+ {
+ InsertItem( nId, pList->GetBoldStr(),
+ MIB_RADIOCHECK | MIB_AUTOCHECK, nPos );
+ nPos++;
+ nId++;
+ }
+ }
+ if ( !bBoldItalic )
+ {
+ if ( bNormal || bItalic || bBold )
+ {
+ InsertItem( nId, pList->GetBoldItalicStr(),
+ MIB_RADIOCHECK | MIB_AUTOCHECK, nPos );
+ nPos++;
+ nId++;
+ }
+ }
+ }
+ else
+ {
+ // Wenn Font nicht, dann Standard-Styles einfuegen
+ InsertItem( FONTSTYLEMENU_FIRSTID, pList->GetNormalStr(),
+ MIB_RADIOCHECK | MIB_AUTOCHECK, 0 );
+ InsertItem( FONTSTYLEMENU_FIRSTID+1, pList->GetItalicStr(),
+ MIB_RADIOCHECK | MIB_AUTOCHECK, 0 );
+ InsertItem( FONTSTYLEMENU_FIRSTID+2, pList->GetBoldStr(),
+ MIB_RADIOCHECK | MIB_AUTOCHECK, 0 );
+ InsertItem( FONTSTYLEMENU_FIRSTID+3, pList->GetBoldItalicStr(),
+ MIB_RADIOCHECK | MIB_AUTOCHECK, 0 );
+ }
+
+ SetCurStyle( maCurStyle );
+}
+
+// -----------------------------------------------------------------------
+
+void FontStyleMenu::SetCurStyle( const XubString& rStyle )
+{
+ maCurStyle = rStyle;
+
+ // Menueintrag checken
+ USHORT nChecked = 0;
+ USHORT nItemCount = GetItemCount();
+ for( USHORT i = 0; i < nItemCount; i++ )
+ {
+ USHORT nItemId = GetItemId( i );
+
+ if ( (nItemId < FONTSTYLEMENU_FIRSTID) ||
+ (nItemId > FONTSTYLEMENU_LASTID) )
+ break;
+
+ if ( IsItemChecked( nItemId ) )
+ nChecked = nItemId;
+
+ XubString aText = GetItemText( nItemId );
+ if ( aText == maCurStyle )
+ {
+ CheckItem( nItemId, TRUE );
+ return;
+ }
+ }
+
+ if ( nChecked )
+ CheckItem( nChecked, FALSE );
+}
+
+// ========================================================================
+
+FontSizeMenu::FontSizeMenu() :
+ maIntn( Application::GetAppInternational() )
+{
+ mpHeightAry = NULL;
+
+ maIntn.SetNumTrailingZeros( FALSE );
+ maIntn.SetNumDigits( 1 );
+
+ SetMenuFlags( GetMenuFlags() | MENU_FLAG_NOAUTOMNEMONICS );
+}
+
+// -----------------------------------------------------------------------
+
+FontSizeMenu::~FontSizeMenu()
+{
+ if ( mpHeightAry )
+ delete mpHeightAry;
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeMenu::Select()
+{
+ mnCurHeight = mpHeightAry[GetCurItemId()-1];
+ maSelectHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeMenu::Highlight()
+{
+ long nTempHeight = mnCurHeight;
+ USHORT nCurItemId = GetCurItemId();
+ if ( !nCurItemId )
+ mnCurHeight = 0;
+ else
+ mnCurHeight = mpHeightAry[nCurItemId-1];
+ maHighlightHdl.Call( this );
+ mnCurHeight = nTempHeight;
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeMenu::Fill( const FontInfo& rInfo, const FontList* pList )
+{
+ // Menu loeschen
+ Clear();
+
+ // Groessen ermitteln
+ const long* pAry = pList->GetSizeAry( rInfo );
+
+ // Array kopieren
+ if ( mpHeightAry )
+ delete mpHeightAry;
+ USHORT n = 0;
+ while ( pAry[n] )
+ n++;
+ mpHeightAry = new long[n];
+ memcpy( mpHeightAry, pAry, n*sizeof(long) );
+
+ // Groessen einfuegen
+ USHORT nId = 1;
+ while ( *pAry )
+ {
+ InsertItem( nId, maIntn.GetNum( *pAry ),
+ MIB_RADIOCHECK | MIB_AUTOCHECK );
+ nId++;
+ pAry++;
+ }
+
+ SetCurHeight( mnCurHeight );
+}
+
+// -----------------------------------------------------------------------
+
+void FontSizeMenu::SetCurHeight( long nHeight )
+{
+ mnCurHeight = nHeight;
+
+ // Menueintrag checken
+ XubString aHeight = maIntn.GetNum( nHeight );
+ USHORT nChecked = 0;
+ USHORT nItemCount = GetItemCount();
+ for( USHORT i = 0; i < nItemCount; i++ )
+ {
+ USHORT nItemId = GetItemId( i );
+
+ if ( IsItemChecked( nItemId ) )
+ nChecked = nItemId;
+
+ XubString aText = GetItemText( nItemId );
+ if ( aText == aHeight )
+ {
+ CheckItem( nItemId, TRUE );
+ return;
+ }
+ }
+
+ if ( nChecked )
+ CheckItem( nChecked, FALSE );
+}
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
new file mode 100644
index 000000000000..eaa4fee223e8
--- /dev/null
+++ b/svtools/source/control/tabbar.cxx
@@ -0,0 +1,2588 @@
+/*************************************************************************
+ *
+ * $RCSfile: tabbar.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_TIME_HXX
+#include <tools/time.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _VCL_POLY_HXX
+#include <vcl/poly.hxx>
+#endif
+#ifndef _VCL_APP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _VCL_HELP_HXX
+#include <vcl/help.hxx>
+#endif
+#ifndef _VCL_DECOVIEW_HXX
+#include <vcl/decoview.hxx>
+#endif
+#ifndef _VCL_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _VCL_EDIT_HXX
+#include <vcl/edit.hxx>
+#endif
+
+#define _SV_TABBAR_CXX
+#define private public
+#include <tabbar.hxx>
+
+// =======================================================================
+
+#define TABBAR_OFFSET_X 7
+#define TABBAR_OFFSET_X2 2
+#define TABBAR_DRAG_SCROLLOFF 5
+#define TABBAR_MINSIZE 5
+
+// =======================================================================
+
+struct ImplTabBarItem
+{
+ USHORT mnId;
+ TabBarPageBits mnBits;
+ XubString maText;
+ XubString maHelpText;
+ Rectangle maRect;
+ long mnWidth;
+ ULONG mnHelpId;
+ BOOL mbShort;
+ BOOL mbSelect;
+ BOOL mbEnable;
+
+ ImplTabBarItem( USHORT nItemId, const XubString& rText,
+ TabBarPageBits nPageBits ) :
+ maText( rText )
+ {
+ mnId = nItemId;
+ mnBits = nPageBits;
+ mnWidth = 0;
+ mnHelpId = 0;
+ mbShort = FALSE;
+ mbSelect = FALSE;
+ mbEnable = TRUE;
+ }
+};
+
+DECLARE_LIST( ImplTabBarList, ImplTabBarItem* );
+
+// =======================================================================
+
+// -----------------
+// - ImplTabButton -
+// -----------------
+
+class ImplTabButton : public PushButton
+{
+public:
+ ImplTabButton( TabBar* pParent, WinBits nWinStyle = 0 ) :
+ PushButton( pParent, nWinStyle | WB_RECTSTYLE | WB_SMALLSTYLE | WB_NOLIGHTBORDER | WB_NOPOINTERFOCUS ) {}
+
+ TabBar* GetParent() const { return (TabBar*)Window::GetParent(); }
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual BOOL QueryDrop( const DropEvent& rDEvt );
+ virtual BOOL Drop( const DropEvent& rEvt );
+};
+
+// =======================================================================
+
+long ImplTabButton::PreNotify( NotifyEvent& rNEvt )
+{
+ if ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN )
+ {
+ if ( GetParent()->IsInEditMode() )
+ {
+ GetParent()->EndEditMode();
+ return TRUE;
+ }
+ }
+
+ return PushButton::PreNotify( rNEvt );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ImplTabButton::QueryDrop( const DropEvent& rDEvt )
+{
+ TabBar* pParent = GetParent();
+ Point aPos = OutputToScreenPixel( rDEvt.GetPosPixel() );
+ aPos = pParent->ScreenToOutputPixel( aPos );
+ BYTE nWindowType = rDEvt.GetWindowType();
+ if ( rDEvt.IsLeaveWindow() )
+ {
+ Size aWinSize = pParent->GetSizePixel();
+ if ( ((aPos.X() >= 0) && (aPos.X() < aWinSize.Width())) &&
+ ((aPos.Y() >= 0) && (aPos.Y() < aWinSize.Height())) )
+ nWindowType = 0;
+ }
+ DropEvent aNewDEvt( aPos, rDEvt.GetData(), rDEvt.GetAction(), nWindowType );
+ return pParent->QueryDrop( aNewDEvt );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ImplTabButton::Drop( const DropEvent& rDEvt )
+{
+ TabBar* pParent = GetParent();
+ Point aPos = OutputToScreenPixel( rDEvt.GetPosPixel() );
+ aPos = pParent->ScreenToOutputPixel( aPos );
+ DropEvent aNewDEvt( aPos, rDEvt.GetData(), rDEvt.GetAction(), rDEvt.GetWindowType() );
+ return pParent->Drop( aNewDEvt );
+}
+
+// =======================================================================
+
+// ----------------
+// - ImplTabSizer -
+// ----------------
+
+class ImplTabSizer : public Window
+{
+private:
+ Point maStartPos;
+ long mnOff;
+
+public:
+ ImplTabSizer( TabBar* pParent, WinBits nWinStyle = 0 );
+
+ TabBar* GetParent() const { return (TabBar*)Window::GetParent(); }
+ void ImplTrack( const Point& rMousePos );
+
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void Tracking( const TrackingEvent& rTEvt );
+ virtual void Paint( const Rectangle& rRect );
+ virtual BOOL QueryDrop( const DropEvent& rDEvt );
+ virtual BOOL Drop( const DropEvent& rEvt );
+};
+
+// -----------------------------------------------------------------------
+
+ImplTabSizer::ImplTabSizer( TabBar* pParent, WinBits nWinStyle ) :
+ Window( pParent, nWinStyle & WB_3DLOOK )
+{
+ SetPointer( Pointer( POINTER_HSIZEBAR ) );
+ SetSizePixel( Size( 7, 0 ) );
+}
+
+// -----------------------------------------------------------------------
+
+void ImplTabSizer::ImplTrack( const Point& rMousePos )
+{
+ TabBar* pParent = GetParent();
+ Point aWinPos = pParent->GetPosPixel();
+ Size aWinSize = GetSizePixel();
+
+ aWinPos = pParent->GetParent()->OutputToScreenPixel( aWinPos );
+ pParent->mnSplitSize = rMousePos.X() - aWinPos.X() + (aWinSize.Width()-mnOff);
+ if ( pParent->mnSplitSize < TABBAR_MINSIZE )
+ pParent->mnSplitSize = TABBAR_MINSIZE;
+ pParent->Split();
+ pParent->Update();
+}
+
+// -----------------------------------------------------------------------
+
+void ImplTabSizer::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( GetParent()->IsInEditMode() )
+ {
+ GetParent()->EndEditMode();
+ return;
+ }
+
+ if ( rMEvt.IsLeft() )
+ {
+ Point aMousePos = rMEvt.GetPosPixel();
+ maStartPos = OutputToScreenPixel( aMousePos );
+ mnOff = aMousePos.X();
+ StartTracking();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ImplTabSizer::Tracking( const TrackingEvent& rTEvt )
+{
+ if ( rTEvt.IsTrackingEnded() )
+ {
+ if ( rTEvt.IsTrackingCanceled() )
+ ImplTrack( maStartPos );
+ GetParent()->mnSplitSize = 0;
+ }
+ else
+ ImplTrack( OutputToScreenPixel( rTEvt.GetMouseEvent().GetPosPixel() ) );
+}
+
+// -----------------------------------------------------------------------
+
+void ImplTabSizer::Paint( const Rectangle& )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ DecorationView aDecoView( this );
+ long nOffX = 0;
+ Size aOutputSize = GetOutputSizePixel();
+
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ DrawLine( Point( 0, 0 ), Point( 0, aOutputSize.Height()-1 ) );
+ nOffX++;
+ aOutputSize.Width()--;
+ }
+ aDecoView.DrawButton( Rectangle( Point( nOffX, 0 ), aOutputSize ), BUTTON_DRAW_NOLIGHTBORDER );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ImplTabSizer::QueryDrop( const DropEvent& rDEvt )
+{
+ TabBar* pParent = GetParent();
+ Point aPos = OutputToScreenPixel( rDEvt.GetPosPixel() );
+ aPos = pParent->ScreenToOutputPixel( aPos );
+ BYTE nWindowType = rDEvt.GetWindowType();
+ if ( rDEvt.IsLeaveWindow() )
+ {
+ Size aWinSize = pParent->GetSizePixel();
+ if ( ((aPos.X() >= 0) && (aPos.X() < aWinSize.Width())) &&
+ ((aPos.Y() >= 0) && (aPos.Y() < aWinSize.Height())) )
+ nWindowType = 0;
+ }
+ DropEvent aNewDEvt( aPos, rDEvt.GetData(), rDEvt.GetAction(), nWindowType );
+ return pParent->QueryDrop( aNewDEvt );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ImplTabSizer::Drop( const DropEvent& rDEvt )
+{
+ TabBar* pParent = GetParent();
+ Point aPos = OutputToScreenPixel( rDEvt.GetPosPixel() );
+ aPos = pParent->ScreenToOutputPixel( aPos );
+ DropEvent aNewDEvt( aPos, rDEvt.GetData(), rDEvt.GetAction(), rDEvt.GetWindowType() );
+ return pParent->Drop( aNewDEvt );
+}
+
+// =======================================================================
+
+// Heisst nicht Impl, da evtl. mal von aussen benutz- und ueberladbar
+
+// --------------
+// - TabBarEdit -
+// --------------
+
+class TabBarEdit : public Edit
+{
+private:
+ Timer maLoseFocusTimer;
+ BOOL mbPostEvt;
+
+ DECL_LINK( ImplEndEditHdl, void* );
+ DECL_LINK( ImplEndTimerHdl, void* );
+
+public:
+ TabBarEdit( TabBar* pParent, WinBits nWinStyle = 0 );
+
+ TabBar* GetParent() const { return (TabBar*)Window::GetParent(); }
+
+ void SetPostEvent() { mbPostEvt = TRUE; }
+ void ResetPostEvent() { mbPostEvt = FALSE; }
+
+ virtual long PreNotify( NotifyEvent& rNEvt );
+ virtual void LoseFocus();
+};
+
+// -----------------------------------------------------------------------
+
+TabBarEdit::TabBarEdit( TabBar* pParent, WinBits nWinStyle ) :
+ Edit( pParent, nWinStyle )
+{
+ mbPostEvt = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+long TabBarEdit::PreNotify( NotifyEvent& rNEvt )
+{
+ if ( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
+ if ( !pKEvt->GetKeyCode().GetModifier() )
+ {
+ if ( pKEvt->GetKeyCode().GetCode() == KEY_RETURN )
+ {
+ if ( !mbPostEvt )
+ {
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) )
+ mbPostEvt = TRUE;
+ }
+ return TRUE;
+ }
+ else if ( pKEvt->GetKeyCode().GetCode() == KEY_ESCAPE )
+ {
+ if ( !mbPostEvt )
+ {
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)TRUE ) )
+ mbPostEvt = TRUE;
+ }
+ return TRUE;
+ }
+ }
+ }
+
+ return Edit::PreNotify( rNEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBarEdit::LoseFocus()
+{
+ if ( !mbPostEvt )
+ {
+ if ( PostUserEvent( LINK( this, TabBarEdit, ImplEndEditHdl ), (void*)FALSE ) )
+ mbPostEvt = TRUE;
+ }
+
+ Edit::LoseFocus();
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel )
+{
+ ResetPostEvent();
+ maLoseFocusTimer.Stop();
+
+ // We need this query, because the edit get a losefous event,
+ // when it shows the context menu or the insert symbol dialog
+ if ( !HasFocus() && HasChildPathFocus( TRUE ) )
+ {
+ maLoseFocusTimer.SetTimeout( 30 );
+ maLoseFocusTimer.SetTimeoutHdl( LINK( this, TabBarEdit, ImplEndTimerHdl ) );
+ maLoseFocusTimer.Start();
+ }
+ else
+ GetParent()->EndEditMode( pCancel != 0 );
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( TabBarEdit, ImplEndTimerHdl, void*, pCancel )
+{
+ if ( HasFocus() )
+ return 0;
+
+ // We need this query, because the edit get a losefous event,
+ // when it shows the context menu or the insert symbol dialog
+ if ( HasChildPathFocus( TRUE ) )
+ maLoseFocusTimer.Start();
+ else
+ GetParent()->EndEditMode( TRUE );
+
+ return 0;
+}
+
+// =======================================================================
+
+void TabBar::ImplInit( WinBits nWinStyle )
+{
+ mpItemList = new ImplTabBarList;
+ mpFirstBtn = NULL;
+ mpPrevBtn = NULL;
+ mpNextBtn = NULL;
+ mpLastBtn = NULL;
+ mpSizer = NULL;
+ mpEdit = NULL;
+ mnMaxPageWidth = 0;
+ mnCurMaxWidth = 0;
+ mnOffX = 0;
+ mnOffY = 0;
+ mnOutWidth = 0;
+ mnSplitSize = 0;
+ mnSwitchTime = 0;
+ mnWinStyle = nWinStyle;
+ mnCurPageId = 0;
+ mnFirstPos = 0;
+ mnDropPos = 0;
+ mnSwitchId = 0;
+ mnEditId = 0;
+ mbFormat = TRUE;
+ mbFirstFormat = TRUE;
+ mbSizeFormat = TRUE;
+ mbAutoMaxWidth = TRUE;
+ mbInSwitching = FALSE;
+ mbAutoEditMode = FALSE;
+ mbEditCanceled = FALSE;
+ mbDropPos = FALSE;
+ mbInSelect = FALSE;
+ mbSelColor = FALSE;
+ mbSelTextColor = FALSE;
+
+ if ( nWinStyle & WB_3DTAB )
+ mnOffY++;
+
+ if ( nWinStyle & WB_DRAG )
+ EnableDrop();
+
+ ImplInitControls();
+ ImplInitSettings( TRUE, TRUE );
+ SetSizePixel( Size( 100, CalcWindowSizePixel().Height() ) );
+}
+
+// -----------------------------------------------------------------------
+
+TabBar::TabBar( Window* pParent, WinBits nWinStyle ) :
+ Window( pParent, (nWinStyle & WB_3DLOOK) | WB_CLIPCHILDREN )
+{
+ ImplInit( nWinStyle );
+}
+
+// -----------------------------------------------------------------------
+
+TabBar::~TabBar()
+{
+ EndEditMode( TRUE );
+
+ // Controls loeschen
+ if ( mpPrevBtn )
+ delete mpPrevBtn;
+ if ( mpNextBtn )
+ delete mpNextBtn;
+ if ( mpFirstBtn )
+ delete mpFirstBtn;
+ if ( mpLastBtn )
+ delete mpLastBtn;
+ if ( mpSizer )
+ delete mpSizer;
+
+ // Alle Items loeschen
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
+ }
+
+ // Itemlist loeschen
+ delete mpItemList;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::ImplInitSettings( BOOL bFont, BOOL bBackground )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ if ( bFont )
+ {
+ Font aFont;
+ aFont = rStyleSettings.GetToolFont();
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ aFont.SetWeight( WEIGHT_BOLD );
+ SetZoomedPointFont( aFont );
+ }
+
+ if ( bBackground )
+ {
+ Color aColor;
+ if ( IsControlBackground() )
+ aColor = GetControlBackground();
+ else
+ aColor = rStyleSettings.GetFaceColor();
+ SetBackground( aColor );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
+ Color& rSelectColor, Color& rSelectTextColor )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ if ( IsControlBackground() )
+ rFaceColor = GetControlBackground();
+ else
+ rFaceColor = rStyleSettings.GetFaceColor();
+ if ( IsControlForeground() )
+ rFaceTextColor = GetControlForeground();
+ else
+ rFaceTextColor = rStyleSettings.GetButtonTextColor();
+ if ( mbSelColor )
+ rSelectColor = maSelColor;
+ else
+ rSelectColor = rStyleSettings.GetWindowColor();
+ if ( mbSelTextColor )
+ rSelectTextColor = maSelTextColor;
+ else
+ rSelectTextColor = rStyleSettings.GetWindowTextColor();
+
+ // Bei 3D-Tabs wird Selektions- und Face-Farbe umgedreht, da die
+ // selektierten Tabs in 3D erscheinen sollen
+ if ( mnWinStyle & WB_3DTAB )
+ {
+ Color aTempColor = rFaceColor;
+ rFaceColor = rSelectColor;
+ rSelectColor = aTempColor;
+ aTempColor = rFaceTextColor;
+ rFaceTextColor = rSelectTextColor;
+ rSelectTextColor = rFaceTextColor;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TabBar::ImplCalcWidth()
+{
+ // Groessen muessen nur ermittelt werden, wenn sich Text aendert oder
+ // wenn der Font geaendert wurde
+ if ( !mbSizeFormat )
+ return FALSE;
+
+ // Breiten der Tabs mit dem fetten Font ermitteln
+ Font aFont = GetFont();
+ if ( aFont.GetWeight() != WEIGHT_BOLD )
+ {
+ aFont.SetWeight( WEIGHT_BOLD );
+ SetFont( aFont );
+ }
+
+ if ( mnMaxPageWidth )
+ mnCurMaxWidth = mnMaxPageWidth;
+ else if ( mbAutoMaxWidth )
+ {
+ mnCurMaxWidth = mnOutWidth-mnOffX-
+ TABBAR_OFFSET_X-TABBAR_OFFSET_X-
+ TABBAR_OFFSET_X2-TABBAR_OFFSET_X2-TABBAR_OFFSET_X2;
+ if ( mnCurMaxWidth < 1 )
+ mnCurMaxWidth = 1;
+ }
+ else
+ mnCurMaxWidth = 0;
+
+ BOOL bChanged = FALSE;
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ long nNewWidth = GetTextWidth( pItem->maText );
+ if ( mnCurMaxWidth && (nNewWidth > mnCurMaxWidth) )
+ {
+ pItem->mbShort = TRUE;
+ nNewWidth = mnCurMaxWidth;
+ }
+ else
+ pItem->mbShort = FALSE;
+ nNewWidth += TABBAR_OFFSET_X+TABBAR_OFFSET_X2;
+ if ( pItem->mnWidth != nNewWidth )
+ {
+ pItem->mnWidth = nNewWidth;
+ if ( !pItem->maRect.IsEmpty() )
+ bChanged = TRUE;
+ }
+ pItem = mpItemList->Next();
+ }
+ mbSizeFormat = FALSE;
+ mbFormat = TRUE;
+ return bChanged;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::ImplFormat()
+{
+ ImplCalcWidth();
+
+ if ( !mbFormat )
+ return;
+
+ USHORT n = 0;
+ long x = mnOffX;
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ // Bei allen nicht sichtbaren Tabs, wird ein leeres Rechteck
+ // gesetzt
+ if ( (n+1 < mnFirstPos) || (x > mnOutWidth) )
+ pItem->maRect.SetEmpty();
+ else
+ {
+ // Etwas von der Tab vor der ersten sichtbaren Page
+ // muss auch zu sehen sein
+ if ( n+1 == mnFirstPos )
+ pItem->maRect.Left() = x-pItem->mnWidth;
+ else
+ {
+ pItem->maRect.Left() = x;
+ x += pItem->mnWidth;
+ }
+ pItem->maRect.Right() = x+TABBAR_OFFSET_X+TABBAR_OFFSET_X2;
+ pItem->maRect.Bottom() = maWinSize.Height()-1;
+ }
+
+ n++;
+ pItem = mpItemList->Next();
+ }
+
+ mbFormat = FALSE;
+
+ // Button enablen/disablen
+ ImplEnableControls();
+}
+
+// -----------------------------------------------------------------------
+
+USHORT TabBar::ImplGetLastFirstPos()
+{
+ USHORT nCount = (USHORT)(mpItemList->Count());
+ if ( !nCount || mbSizeFormat || mbFormat )
+ return 0;
+
+ USHORT nLastFirstPos = nCount-1;
+ long nWinWidth = mnOutWidth-mnOffX-TABBAR_OFFSET_X;
+ long nWidth = mpItemList->GetObject( nLastFirstPos )->mnWidth;
+ while ( nLastFirstPos && (nWidth < nWinWidth) )
+ {
+ nLastFirstPos--;
+ nWidth += mpItemList->GetObject( nLastFirstPos )->mnWidth;
+ }
+ if ( (nLastFirstPos != (USHORT)(mpItemList->Count()-1)) &&
+ (nWidth > nWinWidth) )
+ nLastFirstPos++;
+ return nLastFirstPos;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::ImplInitControls()
+{
+ if ( mnWinStyle & WB_SIZEABLE )
+ {
+ if ( !mpSizer )
+ mpSizer = new ImplTabSizer( this, mnWinStyle & (WB_DRAG | WB_3DLOOK) );
+ mpSizer->Show();
+
+ if ( mnWinStyle & WB_DRAG )
+ mpSizer->EnableDrop();
+ }
+ else
+ {
+ if ( mpSizer )
+ {
+ delete mpSizer;
+ mpSizer = NULL;
+ }
+ }
+
+ Link aLink = LINK( this, TabBar, ImplClickHdl );
+
+ if ( mnWinStyle & (WB_MINSCROLL | WB_SCROLL) )
+ {
+ if ( !mpPrevBtn )
+ {
+ mpPrevBtn = new ImplTabButton( this, WB_REPEAT );
+ mpPrevBtn->SetSymbol( SYMBOL_PREV );
+ mpPrevBtn->SetClickHdl( aLink );
+ if ( mnWinStyle & WB_DRAG )
+ mpPrevBtn->EnableDrop();
+ }
+ mpPrevBtn->Show();
+
+ if ( !mpNextBtn )
+ {
+ mpNextBtn = new ImplTabButton( this, WB_REPEAT );
+ mpNextBtn->SetSymbol( SYMBOL_NEXT );
+ mpNextBtn->SetClickHdl( aLink );
+ if ( mnWinStyle & WB_DRAG )
+ mpNextBtn->EnableDrop();
+ }
+ mpNextBtn->Show();
+ }
+ else
+ {
+ if ( mpPrevBtn )
+ {
+ delete mpPrevBtn;
+ mpPrevBtn = NULL;
+ }
+ if ( mpNextBtn )
+ {
+ delete mpNextBtn;
+ mpNextBtn = NULL;
+ }
+ }
+
+ if ( mnWinStyle & WB_SCROLL )
+ {
+ if ( !mpFirstBtn )
+ {
+ mpFirstBtn = new ImplTabButton( this );
+ mpFirstBtn->SetSymbol( SYMBOL_FIRST );
+ mpFirstBtn->SetClickHdl( aLink );
+ if ( mnWinStyle & WB_DRAG )
+ mpFirstBtn->EnableDrop();
+ }
+ mpFirstBtn->Show();
+
+ if ( !mpLastBtn )
+ {
+ mpLastBtn = new ImplTabButton( this );
+ mpLastBtn->SetSymbol( SYMBOL_LAST );
+ mpLastBtn->SetClickHdl( aLink );
+ if ( mnWinStyle & WB_DRAG )
+ mpLastBtn->EnableDrop();
+ }
+ mpLastBtn->Show();
+ }
+ else
+ {
+ if ( mpFirstBtn )
+ {
+ delete mpFirstBtn;
+ mpFirstBtn = NULL;
+ }
+ if ( mpLastBtn )
+ {
+ delete mpLastBtn;
+ mpLastBtn = NULL;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::ImplEnableControls()
+{
+ if ( mbSizeFormat || mbFormat )
+ return;
+
+ // Buttons enablen/disblen
+ BOOL bEnableBtn = mnFirstPos > 0;
+ if ( mpFirstBtn )
+ mpFirstBtn->Enable( bEnableBtn );
+ if ( mpPrevBtn )
+ mpPrevBtn->Enable( bEnableBtn );
+
+ bEnableBtn = mnFirstPos < ImplGetLastFirstPos();
+ if ( mpNextBtn )
+ mpNextBtn->Enable( bEnableBtn );
+ if ( mpLastBtn )
+ mpLastBtn->Enable( bEnableBtn );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::ImplShowPage( USHORT nPos )
+{
+ // Breite berechnen
+ long nWidth = GetOutputSizePixel().Width();
+ if ( nWidth >= TABBAR_OFFSET_X )
+ nWidth -= TABBAR_OFFSET_X;
+ ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
+ if ( nPos < mnFirstPos )
+ SetFirstPageId( pItem->mnId );
+ else if ( pItem->maRect.Right() > nWidth )
+ {
+ while ( pItem->maRect.Right() > nWidth )
+ {
+ USHORT nNewPos = mnFirstPos+1;
+ SetFirstPageId( GetPageId( nNewPos ) );
+ ImplFormat();
+ if ( nNewPos != mnFirstPos )
+ break;
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
+{
+ EndEditMode();
+
+ USHORT nNewPos = mnFirstPos;
+
+ if ( pBtn == mpFirstBtn )
+ nNewPos = 0;
+ else if ( pBtn == mpPrevBtn )
+ {
+ if ( mnFirstPos )
+ nNewPos = mnFirstPos-1;
+ }
+ else if ( pBtn == mpNextBtn )
+ {
+ USHORT nCount = GetPageCount();
+ if ( mnFirstPos < nCount )
+ nNewPos = mnFirstPos+1;
+ }
+ else
+ {
+ USHORT nCount = GetPageCount();
+ if ( nCount )
+ nNewPos = nCount-1;
+ }
+
+ if ( nNewPos != mnFirstPos )
+ SetFirstPageId( GetPageId( nNewPos ) );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::MouseMove( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeaveWindow() )
+ mbInSelect = FALSE;
+
+ Window::MouseMove( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ // Bei Klick in unser Fenster EditModus nur beenden und Klick nicht
+ // ausfuehren
+ if ( IsInEditMode() )
+ {
+ EndEditMode();
+ return;
+ }
+
+ if ( !rMEvt.IsLeft() )
+ {
+ Window::MouseButtonDown( rMEvt );
+ return;
+ }
+
+ ImplTabBarItem* pItem;
+ USHORT nSelId = GetPageId( rMEvt.GetPosPixel() );
+
+ if ( rMEvt.IsMod2() && mbAutoEditMode && nSelId )
+ {
+ if ( StartEditMode( nSelId ) )
+ return;
+ }
+
+ if ( (rMEvt.GetMode() & (MOUSE_MULTISELECT | MOUSE_RANGESELECT)) && (rMEvt.GetClicks() == 1) )
+ {
+ if ( nSelId )
+ {
+ USHORT nPos = GetPagePos( nSelId );
+ BOOL bSelectTab = FALSE;
+ pItem = mpItemList->GetObject( nPos );
+
+ if ( pItem->mbEnable )
+ {
+ if ( (rMEvt.GetMode() & MOUSE_MULTISELECT) && (mnWinStyle & WB_MULTISELECT) )
+ {
+ if ( nSelId != mnCurPageId )
+ {
+ SelectPage( nSelId, !IsPageSelected( nSelId ) );
+ bSelectTab = TRUE;
+ }
+ }
+ else if ( mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT) )
+ {
+ bSelectTab = TRUE;
+ USHORT n;
+ BOOL bSelect;
+ USHORT nCurPos = GetPagePos( mnCurPageId );
+ if ( nPos <= nCurPos )
+ {
+ // Alle Tabs bis zur angeklickten Tab deselektieren
+ // und alle Tabs von der angeklickten Tab bis
+ // zur aktuellen Position selektieren
+ n = 0;
+ while ( n < nCurPos )
+ {
+ pItem = mpItemList->GetObject( n );
+ if ( n < nPos )
+ bSelect = FALSE;
+ else
+ bSelect = TRUE;
+
+ if ( pItem->mbSelect != bSelect )
+ {
+ pItem->mbSelect = bSelect;
+ if ( !pItem->maRect.IsEmpty() )
+ Invalidate( pItem->maRect );
+ }
+
+ n++;
+ }
+ }
+
+ if ( nPos >= nCurPos )
+ {
+ // Alle Tabs von der aktuellen bis zur angeklickten
+ // Tab selektieren und alle Tabs von der angeklickten
+ // Tab bis zur letzten Tab deselektieren
+ USHORT nCount = (USHORT)mpItemList->Count();
+ n = nCurPos;
+ while ( n < nCount )
+ {
+ pItem = mpItemList->GetObject( n );
+
+ if ( n <= nPos )
+ bSelect = TRUE;
+ else
+ bSelect = FALSE;
+
+ if ( pItem->mbSelect != bSelect )
+ {
+ pItem->mbSelect = bSelect;
+ if ( !pItem->maRect.IsEmpty() )
+ Invalidate( pItem->maRect );
+ }
+
+ n++;
+ }
+ }
+ }
+
+ // Gegebenenfalls muss die selektierte Tab gescrollt werden
+ if ( bSelectTab )
+ {
+ ImplShowPage( nPos );
+ Update();
+ Select();
+ }
+ }
+ else
+ ImplShowPage( nPos );
+ mbInSelect = TRUE;
+
+ return;
+ }
+ }
+ else if ( rMEvt.GetClicks() == 2 )
+ {
+ // Gegebenenfalls den Double-Click-Handler rufen
+ if ( !rMEvt.GetModifier() && (!nSelId || (nSelId == mnCurPageId)) )
+ {
+ USHORT nOldCurId = mnCurPageId;
+ mnCurPageId = nSelId;
+ DoubleClick();
+ // Abfrage, da im DoubleClick-Handler die aktuelle Seite
+ // umgeschaltet werden konnte
+ if ( mnCurPageId == nSelId )
+ mnCurPageId = nOldCurId;
+ }
+
+ return;
+ }
+ else
+ {
+ if ( nSelId )
+ {
+ // Nur Select ausfuehren, wenn noch nicht aktuelle Page
+ if ( nSelId != mnCurPageId )
+ {
+ USHORT nPos = GetPagePos( nSelId );
+ pItem = mpItemList->GetObject( nPos );
+
+ if ( pItem->mbEnable )
+ {
+ if ( !pItem->mbSelect )
+ {
+ // Muss invalidiert werden
+ BOOL bUpdate = FALSE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ bUpdate = TRUE;
+
+ // Alle selektierten Items deselektieren
+ pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) )
+ {
+ pItem->mbSelect = FALSE;
+ if ( bUpdate )
+ Invalidate( pItem->maRect );
+ }
+
+ pItem = mpItemList->Next();
+ }
+ }
+
+ if ( DeactivatePage() )
+ {
+ SetCurPageId( nSelId );
+ Update();
+ ActivatePage();
+ Select();
+ }
+ }
+ else
+ ImplShowPage( nPos );
+ mbInSelect = TRUE;
+ }
+
+ return;
+ }
+ }
+
+ Window::MouseButtonDown( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ mbInSelect = FALSE;
+ Window::MouseButtonUp( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::Paint( const Rectangle& )
+{
+ // Items berechnen und ausgeben
+ USHORT nItemCount = (USHORT)mpItemList->Count();
+ ImplTabBarItem* pItem;
+
+ // kein Item, dann auch nichts zu tun
+ if ( nItemCount )
+ {
+ // TabBar muss formatiert sein
+ ImplFormat();
+
+ // Beim ersten Format auch dafuer sorgen, das aktuelle TabPage
+ // sichtbar wird
+ if ( mbFirstFormat )
+ {
+ mbFirstFormat = FALSE;
+
+ if ( mnCurPageId && (mnFirstPos == 0) && !mbDropPos )
+ {
+ pItem = mpItemList->GetObject( GetPagePos( mnCurPageId ) );
+ if ( pItem->maRect.IsEmpty() )
+ {
+ // mbDropPos setzen (bzw. misbrauchen) um Invalidate()
+ // zu unterbinden
+ mbDropPos = TRUE;
+ SetFirstPageId( mnCurPageId );
+ mbDropPos = FALSE;
+ if ( mnFirstPos != 0 )
+ ImplFormat();
+ }
+ }
+ }
+ }
+
+ // Farben ermitteln
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ Color aFaceColor;
+ Color aSelectColor;
+ Color aFaceTextColor;
+ Color aSelectTextColor;
+ ImplGetColors( aFaceColor, aFaceTextColor, aSelectColor, aSelectTextColor );
+
+ // Font selektieren
+ Font aFont = GetFont();
+ Font aLightFont = aFont;
+ aLightFont.SetWeight( WEIGHT_LIGHT );
+
+ // Bei Border oben und unten einen Strich extra malen
+ if ( (mnWinStyle & WB_BORDER) || (mnWinStyle & WB_TOPBORDER) )
+ {
+ Size aOutputSize = GetOutputSizePixel();
+
+ // Bei 3D-Tabs wird auch der Border in 3D gemalt
+ if ( mnWinStyle & WB_3DTAB )
+ {
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( Point( mnOffX, 0 ), Point( aOutputSize.Width(), 0 ) );
+ }
+
+ // Border malen (Strich oben und Strich unten)
+ SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ DrawLine( Point( mnOffX, mnOffY ), Point( aOutputSize.Width()-1, mnOffY ) );
+ }
+ else
+ SetLineColor( rStyleSettings.GetDarkShadowColor() );
+
+ // Items ausgeben
+ if ( nItemCount )
+ {
+ // letzten sichtbaren Eintrag suchen
+ USHORT n = mnFirstPos+1;
+ if ( n >= nItemCount )
+ n = nItemCount-1;
+ pItem = mpItemList->Seek( n );
+ while ( pItem )
+ {
+ if ( !pItem->maRect.IsEmpty() )
+ {
+ n++;
+ pItem = mpItemList->Next();
+ }
+ else
+ break;
+ }
+
+ // Alle Tabs ausgeben (von hinten nach vorn und aktuellen zuletzt)
+ if ( pItem )
+ n--;
+ else if ( n >= nItemCount )
+ n = nItemCount-1;
+ pItem = mpItemList->Seek( n );
+ ImplTabBarItem* pCurItem = NULL;
+ while ( pItem )
+ {
+ // CurrentItem als letztes ausgeben, da es alle anderen ueberdeckt
+ if ( !pCurItem && (pItem->mnId == mnCurPageId) )
+ {
+ pCurItem = pItem;
+ pItem = mpItemList->Prev();
+ if ( !pItem )
+ pItem = pCurItem;
+ continue;
+ }
+
+ if ( !pItem->maRect.IsEmpty() )
+ {
+ Rectangle aRect = pItem->maRect;
+
+ // Aktuelle Page wird mit einem fetten Font ausgegeben
+ if ( pItem->mnId == mnCurPageId )
+ SetFont( aFont );
+ else
+ SetFont( aLightFont );
+
+ // Je nach Status die richtige FillInBrush setzen
+ if ( pItem->mbSelect || (pItem->mnId == mnCurPageId) )
+ {
+ SetFillColor( aSelectColor );
+ SetTextColor( aSelectTextColor );
+ }
+ else
+ {
+ SetFillColor( aFaceColor );
+ SetTextColor( aFaceTextColor );
+ }
+
+ // Muss Font Kursiv geschaltet werden
+ if ( pItem->mnBits & TPB_SPECIAL )
+ {
+ SetTextColor( Color( COL_LIGHTBLUE ) );
+ }
+
+ // Position der Page berechnen
+ Point aPos0 = Point( aRect.Left(), mnOffY );
+ Point aPos1 = Point( aRect.Left()+TABBAR_OFFSET_X, aRect.Bottom() );
+ Point aPos2 = Point( aRect.Right()-TABBAR_OFFSET_X, aRect.Bottom() );
+ Point aPos3 = Point( aRect.Right(), mnOffY );
+
+ // Zuerst geben wir das Polygon gefuellt aus
+ Polygon aPoly( 4 );
+ aPoly[0] = aPos0;
+ aPoly[1] = aPos1;
+ aPoly[2] = aPos2;
+ aPoly[3] = aPos3;
+ DrawPolygon( aPoly );
+
+ // Danach den Text zentiert ausgeben
+ XubString aText = pItem->maText;
+ if ( pItem->mbShort )
+ aText = GetEllipsisString( aText, mnCurMaxWidth, TEXT_DRAW_ENDELLIPSIS );
+ Size aRectSize = aRect.GetSize();
+ long nTextWidth = GetTextWidth( aText );
+ long nTextHeight = GetTextHeight();
+ Point aTxtPos( aRect.Left()+(aRectSize.Width()-nTextWidth)/2,
+ (aRectSize.Height()-nTextHeight)/2 );
+ if ( !pItem->mbEnable )
+ DrawCtrlText( aTxtPos, aText, 0, STRING_LEN, (TEXT_DRAW_DISABLE | TEXT_DRAW_MNEMONIC) );
+ else
+ DrawText( aTxtPos, aText );
+
+ // Jetzt im Inhalt den 3D-Effekt ausgeben
+ aPos0.X()++;
+ aPos1.X()++;
+ aPos2.X()--;
+ aPos3.X()--;
+ SetLineColor( rStyleSettings.GetLightColor() );
+ DrawLine( aPos0, aPos1 );
+
+ if ( !pItem->mbSelect && (pItem->mnId != mnCurPageId) )
+ {
+ DrawLine( Point( aPos0.X(), aPos0.Y()+1 ),
+ Point( aPos3.X(), aPos3.Y()+1 ) );
+ }
+
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( aPos2, aPos3 );
+ aPos1.X()--;
+ aPos1.Y()--;
+ aPos2.Y()--;
+ DrawLine( aPos1, aPos2 );
+
+ // Da etwas uebermalt werden konnte, muessen wir die Polygon-
+ // umrandung nocheinmal ausgeben
+ SetLineColor( rStyleSettings.GetDarkShadowColor() );
+ SetFillColor();
+ DrawPolygon( aPoly );
+
+ // Beim dem aktuellen Tab die restlichten Ausgaben vornehmen und
+ // die Schleife abbrechen, da die aktuelle Tab als letztes
+ // ausgegeben wird
+ if ( pItem == pCurItem )
+ {
+ // Beim aktuellen Item muss der oberstes Strich geloescht
+ // werden
+ SetLineColor();
+ SetFillColor( aSelectColor );
+ Rectangle aDelRect( aPos0, aPos3 );
+ DrawRect( aDelRect );
+ if ( mnWinStyle & WB_3DTAB )
+ {
+ aDelRect.Top()--;
+ DrawRect( aDelRect );
+ }
+
+ break;
+ }
+
+ pItem = mpItemList->Prev();
+ }
+ else
+ {
+ if ( pItem == pCurItem )
+ break;
+
+ pItem = NULL;
+ }
+
+ if ( !pItem )
+ pItem = pCurItem;
+ }
+ }
+
+ // Font wieder herstellen
+ SetFont( aFont );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::Resize()
+{
+ Size aNewSize = GetOutputSizePixel();
+
+ // Sizer anordnen
+ if ( mpSizer )
+ {
+ Size aSizerSize = mpSizer->GetSizePixel();
+ Point aNewSizerPos( aNewSize.Width()-aSizerSize.Width(), 0 );
+ Size aNewSizerSize( aSizerSize.Width(), aNewSize.Height() );
+ mpSizer->SetPosSizePixel( aNewSizerPos, aNewSizerSize );
+ mnOutWidth = aNewSize.Width() - aSizerSize.Width() - 1;
+ }
+ else
+ mnOutWidth = aNewSize.Width()-1;
+
+ // Scroll-Buttons anordnen
+ long nHeight = aNewSize.Height();
+ if ( nHeight != maWinSize.Height() )
+ {
+ long nX = 0;
+ Size aBtnSize( nHeight, nHeight );
+ if ( mpFirstBtn )
+ {
+ mpFirstBtn->SetPosSizePixel( Point( nX, 0 ), aBtnSize );
+ nX += nHeight;
+ }
+ if ( mpPrevBtn )
+ {
+ mpPrevBtn->SetPosSizePixel( Point( nX, 0 ), aBtnSize );
+ nX += nHeight;
+ }
+ if ( mpNextBtn )
+ {
+ mpNextBtn->SetPosSizePixel( Point( nX, 0 ), aBtnSize );
+ nX += nHeight;
+ }
+ if ( mpLastBtn )
+ {
+ mpLastBtn->SetPosSizePixel( Point( nX, 0 ), aBtnSize );
+ nX += nHeight;
+ }
+ mnOffX = nX;
+ }
+
+ // Groesse merken
+ maWinSize = aNewSize;
+
+ // Neu formatieren
+ mbSizeFormat = TRUE;
+ if ( IsReallyVisible() )
+ {
+ if ( ImplCalcWidth() )
+ Invalidate();
+ ImplFormat();
+ }
+
+ // Button enablen/disablen
+ ImplEnableControls();
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::RequestHelp( const HelpEvent& rHEvt )
+{
+ USHORT nItemId = GetPageId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+ if ( nItemId )
+ {
+ if ( rHEvt.GetMode() & HELPMODE_BALLOON )
+ {
+ XubString aStr = GetHelpText( nItemId );
+ if ( aStr.Len() )
+ {
+ Rectangle aItemRect = GetPageRect( nItemId );
+ Point aPt = OutputToScreenPixel( aItemRect.TopLeft() );
+ aItemRect.Left() = aPt.X();
+ aItemRect.Top() = aPt.Y();
+ aPt = OutputToScreenPixel( aItemRect.BottomRight() );
+ aItemRect.Right() = aPt.X();
+ aItemRect.Bottom() = aPt.Y();
+ Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr );
+ return;
+ }
+ }
+ else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
+ {
+ ULONG nHelpId = GetHelpId( nItemId );
+ if ( nHelpId )
+ {
+ // Wenn eine Hilfe existiert, dann ausloesen
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ pHelp->Start( nHelpId );
+ return;
+ }
+ }
+
+ // Bei Quick- oder Ballloon-Help zeigen wir den Text an,
+ // wenn dieser abgeschnitten oder nicht voll sichtbar ist
+ if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) )
+ {
+ USHORT nPos = GetPagePos( nItemId );
+ ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem->mbShort ||
+ (pItem->maRect.Right()-TABBAR_OFFSET_X-5 > mnOutWidth) )
+ {
+ Rectangle aItemRect = GetPageRect( nItemId );
+ Point aPt = OutputToScreenPixel( aItemRect.TopLeft() );
+ aItemRect.Left() = aPt.X();
+ aItemRect.Top() = aPt.Y();
+ aPt = OutputToScreenPixel( aItemRect.BottomRight() );
+ aItemRect.Right() = aPt.X();
+ aItemRect.Bottom() = aPt.Y();
+ XubString aStr = mpItemList->GetObject( nPos )->maText;
+ if ( aStr.Len() )
+ {
+ if ( rHEvt.GetMode() & HELPMODE_BALLOON )
+ Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr );
+ else
+ Help::ShowQuickHelp( this, aItemRect, aStr );
+ return;
+ }
+ }
+ }
+ }
+
+ Window::RequestHelp( rHEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::StateChanged( StateChangedType nType )
+{
+ Window::StateChanged( nType );
+
+ if ( nType == STATE_CHANGE_INITSHOW )
+ {
+ if ( (mbSizeFormat || mbFormat) && mpItemList->Count() )
+ ImplFormat();
+ }
+ else if ( (nType == STATE_CHANGE_ZOOM) ||
+ (nType == STATE_CHANGE_CONTROLFONT) )
+ {
+ ImplInitSettings( TRUE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ Invalidate();
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ ImplInitSettings( FALSE, TRUE );
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
+ (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
+ ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+ {
+ ImplInitSettings( TRUE, TRUE );
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::Select()
+{
+ maSelectHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::DoubleClick()
+{
+ maDoubleClickHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::Split()
+{
+ maSplitHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::ActivatePage()
+{
+ maActivatePageHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+long TabBar::DeactivatePage()
+{
+ if ( maDeactivatePageHdl.IsSet() )
+ return maDeactivatePageHdl.Call( this );
+ else
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+long TabBar::StartRenaming()
+{
+ if ( maStartRenamingHdl.IsSet() )
+ return maStartRenamingHdl.Call( this );
+ else
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+long TabBar::AllowRenaming()
+{
+ if ( maAllowRenamingHdl.IsSet() )
+ return maAllowRenamingHdl.Call( this );
+ else
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::EndRenaming()
+{
+ maEndRenamingHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::InsertPage( USHORT nPageId, const XubString& rText,
+ TabBarPageBits nBits, USHORT nPos )
+{
+ DBG_ASSERT( nPageId, "TabBar::InsertPage(): PageId == 0" );
+ DBG_ASSERT( GetPagePos( nPageId ) == TAB_PAGE_NOTFOUND,
+ "TabBar::InsertPage(): PageId already exists" );
+ DBG_ASSERT( nBits <= TPB_SPECIAL, "TabBar::InsertPage(): nBits is wrong" );
+
+ // PageItem anlegen und in die Item-Liste eintragen
+ ImplTabBarItem* pItem = new ImplTabBarItem( nPageId, rText, nBits );
+ mpItemList->Insert( pItem, nPos );
+ mbSizeFormat = TRUE;
+
+ // CurPageId gegebenenfalls setzen
+ if ( !mnCurPageId )
+ mnCurPageId = nPageId;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::RemovePage( USHORT nPageId )
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ // Existiert Item
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ if ( mnCurPageId == nPageId )
+ mnCurPageId = 0;
+
+ // Testen, ob erste sichtbare Seite verschoben werden muss
+ if ( mnFirstPos > nPos )
+ mnFirstPos--;
+
+ // Item-Daten loeschen
+ delete mpItemList->Remove( nPos );
+ mbFormat = TRUE;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::MovePage( USHORT nPageId, USHORT nNewPos )
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ if ( nPos < nNewPos )
+ nNewPos--;
+
+ if ( nPos == nNewPos )
+ return;
+
+ // Existiert Item
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ // TabBar-Item in der Liste verschieben
+ ImplTabBarItem* pItem = mpItemList->Remove( nPos );
+ mpItemList->Insert( pItem, nNewPos );
+ mbFormat = TRUE;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::Clear()
+{
+ // Alle Items loeschen
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ // Item-Daten loeschen
+ delete pItem;
+ pItem = mpItemList->Next();
+ }
+
+ // Items aus der Liste loeschen
+ mpItemList->Clear();
+ mbSizeFormat = TRUE;
+ mnCurPageId = 0;
+ mnFirstPos = 0;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::EnablePage( USHORT nPageId, BOOL bEnable )
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
+
+ if ( pItem->mbEnable != bEnable )
+ {
+ pItem->mbEnable = bEnable;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate( pItem->maRect );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TabBar::IsPageEnabled( USHORT nPageId ) const
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mbEnable;
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetPageBits( USHORT nPageId, TabBarPageBits nBits )
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
+
+ if ( pItem->mnBits != nBits )
+ {
+ pItem->mnBits = nBits;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate( pItem->maRect );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+TabBarPageBits TabBar::GetPageBits( USHORT nPageId ) const
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mnBits;
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT TabBar::GetPageCount() const
+{
+ return (USHORT)mpItemList->Count();
+}
+
+// -----------------------------------------------------------------------
+
+USHORT TabBar::GetPageId( USHORT nPos ) const
+{
+ ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
+ if ( pItem )
+ return pItem->mnId;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT TabBar::GetPagePos( USHORT nPageId ) const
+{
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mnId == nPageId )
+ return (USHORT)mpItemList->GetCurPos();
+
+ pItem = mpItemList->Next();
+ }
+
+ return TAB_PAGE_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT TabBar::GetPageId( const Point& rPos ) const
+{
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->maRect.IsInside( rPos ) )
+ return pItem->mnId;
+
+ pItem = mpItemList->Next();
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+Rectangle TabBar::GetPageRect( USHORT nPageId ) const
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maRect;
+ else
+ return Rectangle();
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetCurPageId( USHORT nPageId )
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ // Wenn Item nicht existiert, dann nichts machen
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ // Wenn sich aktuelle Page nicht geaendert hat, dann muessen wir
+ // jetzt nichts mehr machen
+ if ( nPageId == mnCurPageId )
+ return;
+
+ // Muss invalidiert werden
+ BOOL bUpdate = FALSE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ bUpdate = TRUE;
+
+ ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
+ ImplTabBarItem* pOldItem;
+
+ if ( mnCurPageId )
+ pOldItem = mpItemList->GetObject( GetPagePos( mnCurPageId ) );
+ else
+ pOldItem = NULL;
+
+ // Wenn Page nicht selektiert, dann vorher selektierte Seite
+ // deselktieren, wenn dies die einzige selektierte Seite ist
+ if ( !pItem->mbSelect && pOldItem )
+ {
+ USHORT nSelPageCount = GetSelectPageCount();
+ if ( nSelPageCount == 1 )
+ pOldItem->mbSelect = FALSE;
+ pItem->mbSelect = TRUE;
+ }
+
+ mnCurPageId = nPageId;
+ mbFormat = TRUE;
+
+ // Dafuer sorgen, das aktuelle Page sichtbar wird
+ if ( IsReallyVisible() )
+ {
+ if ( nPos < mnFirstPos )
+ SetFirstPageId( nPageId );
+ else
+ {
+ // sichtbare Breite berechnen
+ long nWidth = mnOutWidth;
+ if ( nWidth > TABBAR_OFFSET_X )
+ nWidth -= TABBAR_OFFSET_X;
+
+ if ( pItem->maRect.IsEmpty() )
+ ImplFormat();
+
+ while ( (pItem->maRect.Right() > nWidth) ||
+ pItem->maRect.IsEmpty() )
+ {
+ USHORT nNewPos = mnFirstPos+1;
+ // Dafuer sorgen, das min. die aktuelle TabPages als
+ // erste TabPage sichtbar ist
+ if ( nNewPos >= nPos )
+ {
+ SetFirstPageId( nPageId );
+ break;
+ }
+ else
+ SetFirstPageId( GetPageId( nNewPos ) );
+ ImplFormat();
+ // Falls erste Seite nicht weitergeschaltet wird, dann
+ // koennen wir abbrechen
+ if ( nNewPos != mnFirstPos )
+ break;
+ }
+ }
+ }
+
+ // Leiste neu ausgeben
+ if ( bUpdate )
+ {
+ Invalidate( pItem->maRect );
+ if ( pOldItem )
+ Invalidate( pOldItem->maRect );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetFirstPageId( USHORT nPageId )
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ // Wenn Item nicht existiert, dann FALSE zurueckgeben
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ if ( nPos != mnFirstPos )
+ {
+ // Dafuer sorgen, das nach Moeglichkteit soviele Pages wie
+ // moeglich sichtbar sind
+ ImplFormat();
+ USHORT nLastFirstPos = ImplGetLastFirstPos();
+ USHORT nNewPos;
+ if ( nPos > nLastFirstPos )
+ nNewPos = nLastFirstPos;
+ else
+ nNewPos = nPos;
+
+ if ( nNewPos != mnFirstPos )
+ {
+ mnFirstPos = nNewPos;
+ mbFormat = TRUE;
+
+ // Leiste neu ausgeben (Achtung: mbDropPos beachten, da wenn
+ // dieses Flag gesetzt ist, wird direkt gepaintet)
+ if ( IsReallyVisible() && IsUpdateMode() && !mbDropPos )
+ Invalidate();
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SelectPage( USHORT nPageId, BOOL bSelect )
+{
+ USHORT nPos = GetPagePos( nPageId );
+
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
+
+ if ( pItem->mbSelect != bSelect )
+ {
+ pItem->mbSelect = bSelect;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate( pItem->maRect );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SelectPageRange( BOOL bSelect, USHORT nStartPos, USHORT nEndPos )
+{
+ Rectangle aPaintRect;
+ USHORT nPos = nStartPos;
+ ImplTabBarItem* pItem = mpItemList->Seek( nPos );
+ while ( pItem && (nPos <= nEndPos) )
+ {
+ if ( (pItem->mbSelect != bSelect) && (pItem->mnId != mnCurPageId) )
+ {
+ pItem->mbSelect = bSelect;
+ aPaintRect.Union( pItem->maRect );
+ }
+
+ nPos++;
+ pItem = mpItemList->Next();
+ }
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() && !aPaintRect.IsEmpty() )
+ Invalidate( aPaintRect );
+}
+
+// -----------------------------------------------------------------------
+
+USHORT TabBar::GetSelectPage( USHORT nSelIndex ) const
+{
+ USHORT nSelected = 0;
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mbSelect )
+ nSelected++;
+
+ if ( nSelected == nSelIndex )
+ return pItem->mnId;
+
+ pItem = mpItemList->Next();
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT TabBar::GetSelectPageCount() const
+{
+ USHORT nSelected = 0;
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mbSelect )
+ nSelected++;
+
+ pItem = mpItemList->Next();
+ }
+
+ return nSelected;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TabBar::IsPageSelected( USHORT nPageId ) const
+{
+ USHORT nPos = GetPagePos( nPageId );
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mbSelect;
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TabBar::StartEditMode( USHORT nPageId )
+{
+ USHORT nPos = GetPagePos( nPageId );
+ if ( mpEdit || (nPos == TAB_PAGE_NOTFOUND) || (mnOutWidth < 8) )
+ return FALSE;
+
+ mnEditId = nPageId;
+ if ( StartRenaming() )
+ {
+ ImplShowPage( nPos );
+ ImplFormat();
+ Update();
+
+ mpEdit = new TabBarEdit( this, WB_CENTER );
+ Rectangle aRect = GetPageRect( mnEditId );
+ long nX = aRect.Left()+TABBAR_OFFSET_X+(TABBAR_OFFSET_X2/2);
+ long nWidth = aRect.GetWidth()-(TABBAR_OFFSET_X*2)-TABBAR_OFFSET_X2;
+ if ( mnEditId != GetCurPageId() )
+ nX += 1;
+ if ( nX+nWidth > mnOutWidth )
+ nWidth = mnOutWidth-nX;
+ if ( nWidth < 3 )
+ {
+ nX = aRect.Left();
+ nWidth = aRect.GetWidth();
+ }
+ mpEdit->SetText( GetPageText( mnEditId ) );
+ mpEdit->SetPosSizePixel( nX, aRect.Top()+mnOffY+1, nWidth, aRect.GetHeight()-3 );
+ Font aFont = GetPointFont();
+ Color aForegroundColor;
+ Color aBackgroundColor;
+ Color aFaceColor;
+ Color aSelectColor;
+ Color aFaceTextColor;
+ Color aSelectTextColor;
+ ImplGetColors( aFaceColor, aFaceTextColor, aSelectColor, aSelectTextColor );
+ if ( mnEditId != GetCurPageId() )
+ aFont.SetWeight( WEIGHT_LIGHT );
+ if ( IsPageSelected( mnEditId ) || (mnEditId == GetCurPageId()) )
+ {
+ aForegroundColor = aSelectTextColor;
+ aBackgroundColor = aSelectColor;
+ }
+ else
+ {
+ aForegroundColor = aFaceTextColor;
+ aBackgroundColor = aFaceColor;
+ }
+ if ( GetPageBits( mnEditId ) & TPB_SPECIAL )
+ aForegroundColor = Color( COL_LIGHTBLUE );
+ mpEdit->SetControlFont( aFont );
+ mpEdit->SetControlForeground( aForegroundColor );
+ mpEdit->SetControlBackground( aBackgroundColor );
+ mpEdit->GrabFocus();
+ mpEdit->SetSelection( Selection( 0, mpEdit->GetText().Len() ) );
+ mpEdit->Show();
+ return TRUE;
+ }
+ else
+ {
+ mnEditId = 0;
+ return FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::EndEditMode( BOOL bCancel )
+{
+ if ( mpEdit )
+ {
+ // call hdl
+ BOOL bEnd = TRUE;
+ mbEditCanceled = bCancel;
+ maEditText = mpEdit->GetText();
+ mpEdit->SetPostEvent();
+ if ( !bCancel )
+ {
+ long nAllowRenaming = AllowRenaming();
+ if ( nAllowRenaming == TAB_RENAMING_YES )
+ SetPageText( mnEditId, maEditText );
+ else if ( nAllowRenaming == TAB_RENAMING_NO )
+ bEnd = FALSE;
+ else // nAllowRenaming == TAB_RENAMING_CANCEL
+ mbEditCanceled = TRUE;
+ }
+
+ // renaming not allowed, than reset edit data
+ if ( !bEnd )
+ {
+ mpEdit->ResetPostEvent();
+ mpEdit->GrabFocus();
+ }
+ else
+ {
+ // close edit and call end hdl
+ delete mpEdit;
+ mpEdit = NULL;
+ EndRenaming();
+ mnEditId = 0;
+ }
+
+ // reset
+ maEditText.Erase();
+ mbEditCanceled = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetMaxPageWidth( long nMaxWidth )
+{
+ if ( mnMaxPageWidth != nMaxWidth )
+ {
+ mnMaxPageWidth = nMaxWidth;
+ mbSizeFormat = TRUE;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetSelectColor()
+{
+ if ( mbSelColor )
+ {
+ maSelColor = Color( COL_TRANSPARENT );
+ mbSelColor = FALSE;
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetSelectColor( const Color& rColor )
+{
+ if ( rColor.GetTransparency() )
+ {
+ if ( mbSelColor )
+ {
+ maSelColor = Color( COL_TRANSPARENT );
+ mbSelColor = FALSE;
+ Invalidate();
+ }
+ }
+ else
+ {
+ if ( maSelColor != rColor )
+ {
+ maSelColor = rColor;
+ mbSelColor = TRUE;
+ Invalidate();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetSelectTextColor()
+{
+ if ( mbSelTextColor )
+ {
+ maSelTextColor = Color( COL_TRANSPARENT );
+ mbSelTextColor = FALSE;
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetSelectTextColor( const Color& rColor )
+{
+ if ( rColor.GetTransparency() )
+ {
+ if ( mbSelTextColor )
+ {
+ maSelTextColor = Color( COL_TRANSPARENT );
+ mbSelTextColor = FALSE;
+ Invalidate();
+ }
+ }
+ else
+ {
+ if ( maSelTextColor != rColor )
+ {
+ maSelTextColor = rColor;
+ mbSelTextColor = TRUE;
+ Invalidate();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetPageText( USHORT nPageId, const XubString& rText )
+{
+ USHORT nPos = GetPagePos( nPageId );
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ mpItemList->GetObject( nPos )->maText = rText;
+ mbSizeFormat = TRUE;
+
+ // Leiste neu ausgeben
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+XubString TabBar::GetPageText( USHORT nPageId ) const
+{
+ USHORT nPos = GetPagePos( nPageId );
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maText;
+ else
+ return XubString();
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetHelpText( USHORT nPageId, const XubString& rText )
+{
+ USHORT nPos = GetPagePos( nPageId );
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ mpItemList->GetObject( nPos )->maHelpText = rText;
+}
+
+// -----------------------------------------------------------------------
+
+XubString TabBar::GetHelpText( USHORT nPageId ) const
+{
+ USHORT nPos = GetPagePos( nPageId );
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ {
+ ImplTabBarItem* pItem = mpItemList->GetObject( nPos );
+ if ( !pItem->maHelpText.Len() && pItem->mnHelpId )
+ {
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId );
+ }
+
+ return pItem->maHelpText;
+ }
+ else
+ return XubString();
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetHelpId( USHORT nPageId, ULONG nHelpId )
+{
+ USHORT nPos = GetPagePos( nPageId );
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ mpItemList->GetObject( nPos )->mnHelpId = nHelpId;
+}
+
+// -----------------------------------------------------------------------
+
+ULONG TabBar::GetHelpId( USHORT nPageId ) const
+{
+ USHORT nPos = GetPagePos( nPageId );
+ if ( nPos != TAB_PAGE_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mnHelpId;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+long TabBar::GetMinSize() const
+{
+ long nMinSize = TABBAR_MINSIZE + TABBAR_OFFSET_X;
+ if ( mnWinStyle & WB_MINSCROLL )
+ nMinSize += mpPrevBtn->GetSizePixel().Width()*2;
+ else if ( mnWinStyle & WB_SCROLL )
+ nMinSize += mpFirstBtn->GetSizePixel().Width()*4;
+ return nMinSize;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TabBar::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
+{
+ if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != COMMAND_STARTDRAG) )
+ return FALSE;
+
+ // Testen, ob angeklickte Seite selektiert ist. Falls dies nicht
+ // der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and
+ // Drop auch mal ueber Tastatur ausgeloest werden kann, testen wir
+ // dies nur bei einer Mausaktion.
+ // Ausserdem machen wir das nur, wenn kein Select() ausgeloest wurde,
+ // da der Select schon den Bereich gescrollt haben kann
+ if ( rCEvt.IsMouseEvent() && !mbInSelect )
+ {
+ USHORT nSelId = GetPageId( rCEvt.GetMousePosPixel() );
+
+ // Falls kein Eintrag angeklickt wurde, starten wir kein Dragging
+ if ( !nSelId )
+ return FALSE;
+
+ // Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle
+ // Seite setzen und Select rufen.
+ if ( !IsPageSelected( nSelId ) )
+ {
+ if ( DeactivatePage() )
+ {
+ SetCurPageId( nSelId );
+ Update();
+ ActivatePage();
+ Select();
+ }
+ else
+ return FALSE;
+ }
+ }
+ mbInSelect = FALSE;
+
+
+#ifdef MAC
+ PolyPolygon aPolyPoly;
+
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mbSelect && !pItem->maRect.IsEmpty() )
+ {
+ // Polygon fuer DragRegion aufbauen
+ Rectangle aRect = pItem->maRect;
+ Polygon aPoly( 4 );
+ aPoly[0] = Point( aRect.Left(), mnOffY );
+ aPoly[1] = Point( aRect.Left()+TABBAR_OFFSET_X, aRect.Bottom() );
+ aPoly[2] = Point( aRect.Right()-TABBAR_OFFSET_X, aRect.Bottom() );
+ aPoly[3] = Point( aRect.Right(), mnOffY );
+ aPolyPoly.Insert( aPoly );
+ }
+
+ pItem = mpItemList->Next();
+ }
+
+ Region aRegion( aPolyPoly );
+#else
+ Region aRegion;
+#endif
+
+ // Region zuweisen
+ rRegion = aRegion;
+
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT TabBar::ShowDropPos( const Point& rPos )
+{
+ ImplTabBarItem* pItem;
+ USHORT nDropId;
+ USHORT nNewDropPos;
+ USHORT nItemCount = (USHORT)mpItemList->Count();
+ short nScroll = 0;
+
+ if ( rPos.X() > mnOutWidth-TABBAR_DRAG_SCROLLOFF )
+ {
+ pItem = mpItemList->GetObject( mpItemList->Count()-1 );
+ if ( !pItem->maRect.IsEmpty() && (rPos.X() > pItem->maRect.Right()) )
+ nNewDropPos = (USHORT)mpItemList->Count();
+ else
+ {
+ nNewDropPos = mnFirstPos+1;
+ nScroll = 1;
+ }
+ }
+ else if ( (rPos.X() <= mnOffX) ||
+ (!mnOffX && (rPos.X() <= TABBAR_DRAG_SCROLLOFF)) )
+ {
+ if ( mnFirstPos )
+ {
+ nNewDropPos = mnFirstPos;
+ nScroll = -1;
+ }
+ else
+ nNewDropPos = 0;
+ }
+ else
+ {
+ nDropId = GetPageId( rPos );
+ if ( nDropId )
+ {
+ nNewDropPos = GetPagePos( nDropId );
+ if ( mnFirstPos && (nNewDropPos == mnFirstPos-1) )
+ nScroll = -1;
+ }
+ else
+ nNewDropPos = nItemCount;
+ }
+
+ if ( mbDropPos && (nNewDropPos == mnDropPos) && !nScroll )
+ return mnDropPos;
+
+ if ( mbDropPos )
+ HideDropPos();
+ mbDropPos = TRUE;
+ mnDropPos = nNewDropPos;
+
+ if ( nScroll )
+ {
+ USHORT nOldFirstPos = mnFirstPos;
+ SetFirstPageId( GetPageId( mnFirstPos+nScroll ) );
+
+ // Direkt ausgeben, da kein Paint bei Drag and Drop moeglich
+ if ( nOldFirstPos != mnFirstPos )
+ {
+ Rectangle aRect( mnOffX, 0, mnOutWidth, maWinSize.Height() );
+ SetFillColor();
+ DrawRect( aRect );
+ Paint( aRect );
+ }
+ }
+
+ // Drop-Position-Pfeile ausgeben
+ Color aBlackColor( COL_BLACK );
+ long nX;
+ long nY = (maWinSize.Height()/2)-1;
+ USHORT nCurPos = GetPagePos( mnCurPageId );
+
+ SetLineColor( aBlackColor );
+ if ( mnDropPos < nItemCount )
+ {
+ pItem = mpItemList->GetObject( mnDropPos );
+ nX = pItem->maRect.Left()+TABBAR_OFFSET_X;
+ if ( mnDropPos == nCurPos )
+ nX--;
+ else
+ nX++;
+ DrawLine( Point( nX, nY ), Point( nX, nY ) );
+ DrawLine( Point( nX+1, nY-1 ), Point( nX+1, nY+1 ) );
+ DrawLine( Point( nX+2, nY-2 ), Point( nX+2, nY+2 ) );
+ }
+ if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) )
+ {
+ pItem = mpItemList->GetObject( mnDropPos-1 );
+ nX = pItem->maRect.Right()-TABBAR_OFFSET_X;
+ if ( mnDropPos == nCurPos )
+ nX++;
+ DrawLine( Point( nX, nY ), Point( nX, nY ) );
+ DrawLine( Point( nX-1, nY-1 ), Point( nX-1, nY+1 ) );
+ DrawLine( Point( nX-2, nY-2 ), Point( nX-2, nY+2 ) );
+ }
+
+ return mnDropPos;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::HideDropPos()
+{
+ if ( mbDropPos )
+ {
+ ImplTabBarItem* pItem;
+ long nX;
+ long nY1 = (maWinSize.Height()/2)-3;
+ long nY2 = nY1 + 5;
+ USHORT nItemCount = (USHORT)mpItemList->Count();
+
+ if ( mnDropPos < nItemCount )
+ {
+ pItem = mpItemList->GetObject( mnDropPos );
+ nX = pItem->maRect.Left()+TABBAR_OFFSET_X;
+ // Paint direkt aufrufen, da bei Drag and Drop kein Paint
+ // moeglich
+ Rectangle aRect( nX-1, nY1, nX+3, nY2 );
+ Region aRegion( aRect );
+ SetClipRegion( aRegion );
+ Paint( aRect );
+ SetClipRegion();
+ }
+ if ( (mnDropPos > 0) && (mnDropPos < nItemCount+1) )
+ {
+ pItem = mpItemList->GetObject( mnDropPos-1 );
+ nX = pItem->maRect.Right()-TABBAR_OFFSET_X;
+ // Paint direkt aufrufen, da bei Drag and Drop kein Paint
+ // moeglich
+ Rectangle aRect( nX-2, nY1, nX+1, nY2 );
+ Region aRegion( aRect );
+ SetClipRegion( aRegion );
+ Paint( aRect );
+ SetClipRegion();
+ }
+
+ mbDropPos = FALSE;
+ mnDropPos = 0;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TabBar::SwitchPage( const Point& rPos )
+{
+ BOOL bSwitch = FALSE;
+ USHORT nSwitchId = GetPageId( rPos );
+ if ( !nSwitchId )
+ EndSwitchPage();
+ else
+ {
+ if ( nSwitchId != mnSwitchId )
+ {
+ mnSwitchId = nSwitchId;
+ mnSwitchTime = Time::GetSystemTicks();
+ }
+ else
+ {
+ // Erst nach 500 ms umschalten
+ if ( mnSwitchId != GetCurPageId() )
+ {
+ if ( Time::GetSystemTicks() > mnSwitchTime+500 )
+ {
+ mbInSwitching = TRUE;
+ if ( DeactivatePage() )
+ {
+ SetCurPageId( mnSwitchId );
+ Update();
+ ActivatePage();
+ Select();
+ bSwitch = TRUE;
+ }
+ mbInSwitching = FALSE;
+ }
+ }
+ }
+ }
+
+ return bSwitch;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::EndSwitchPage()
+{
+ mnSwitchTime = 0;
+ mnSwitchId = 0;
+}
+
+// -----------------------------------------------------------------------
+
+void TabBar::SetStyle( WinBits nStyle )
+{
+ mnWinStyle = nStyle;
+ ImplInitControls();
+ // Evt. Controls neu anordnen
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Resize();
+}
+
+// -----------------------------------------------------------------------
+
+Size TabBar::CalcWindowSizePixel() const
+{
+ long nWidth = 0;
+
+ if ( mpItemList->Count() )
+ {
+ ((TabBar*)this)->ImplCalcWidth();
+ ImplTabBarItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ nWidth += pItem->mnWidth;
+ pItem = mpItemList->Next();
+ }
+ nWidth += TABBAR_OFFSET_X+TABBAR_OFFSET_X2;
+ }
+
+ return Size( nWidth, GetTextHeight()+3 );
+}
diff --git a/svtools/source/control/taskbar.cxx b/svtools/source/control/taskbar.cxx
new file mode 100644
index 000000000000..131bede4df03
--- /dev/null
+++ b/svtools/source/control/taskbar.cxx
@@ -0,0 +1,645 @@
+/*************************************************************************
+ *
+ * $RCSfile: taskbar.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _TASKBAR_CXX
+
+#ifndef _TOOLS_LIST_HXX
+#include <tools/list.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _VCL_FLOATWIN_HXX
+#include <vcl/floatwin.hxx>
+#endif
+
+#include <taskbar.hxx>
+
+// =======================================================================
+
+class ImplTaskBarFloat : public FloatingWindow
+{
+public:
+ TaskBar* mpTaskBar;
+
+public:
+ ImplTaskBarFloat( TaskBar* pTaskBar );
+
+ void Paint();
+};
+
+// -----------------------------------------------------------------------
+
+ImplTaskBarFloat::ImplTaskBarFloat( TaskBar* pTaskBar ) :
+ FloatingWindow( pTaskBar, 0 )
+{
+ mpTaskBar = pTaskBar;
+}
+
+// -----------------------------------------------------------------------
+
+void ImplTaskBarFloat::Paint()
+{
+}
+
+// =======================================================================
+
+#define TASKBAR_BORDER 2
+#define TASKBAR_OFFSIZE 3
+#define TASKBAR_OFFX 2
+#define TASKBAR_OFFY 1
+#define TASKBAR_BUTTONOFF 5
+#define TASKBAR_AUTOHIDE_HEIGHT 2
+
+// =======================================================================
+
+TaskBar::TaskBar( Window* pParent, WinBits nWinStyle ) :
+ Window( pParent, WB_3DLOOK )
+{
+ mpButtonBar = NULL;
+ mpTaskToolBox = NULL;
+ mpStatusBar = NULL;
+ mnStatusWidth = 0;
+ mnOldStatusWidth = 0;
+ mnLines = 1;
+ mnWinBits = nWinStyle;
+ mbStatusText = FALSE;
+ mbShowItems = FALSE;
+ mbAutoHide = FALSE;
+
+ ImplInitSettings();
+}
+
+// -----------------------------------------------------------------------
+
+TaskBar::~TaskBar()
+{
+ if ( mpButtonBar )
+ delete mpButtonBar;
+ if ( mpTaskToolBox )
+ delete mpTaskToolBox;
+ if ( mpStatusBar )
+ delete mpStatusBar;
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::ImplInitSettings()
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ Color aColor;
+ if ( IsControlBackground() )
+ aColor = GetControlBackground();
+ else if ( Window::GetStyle() & WB_3DLOOK )
+ aColor = rStyleSettings.GetFaceColor();
+ else
+ aColor = rStyleSettings.GetWindowColor();
+ SetBackground( aColor );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::ImplNewHeight( long nNewHeight )
+{
+ long nOldHeight = GetSizePixel().Height();
+ if ( nNewHeight != nOldHeight )
+ {
+ long nY = GetPosPixel().Y()-(nNewHeight-nOldHeight);
+ SetPosSizePixel( 0, nY, 0, nNewHeight,
+ WINDOW_POSSIZE_Y | WINDOW_POSSIZE_HEIGHT );
+ TaskResize();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::TaskResize()
+{
+ maTaskResizeHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+TaskButtonBar* TaskBar::CreateButtonBar()
+{
+ return new TaskButtonBar( this );
+}
+
+// -----------------------------------------------------------------------
+
+TaskToolBox* TaskBar::CreateTaskToolBox()
+{
+ return new TaskToolBox( this );
+}
+
+// -----------------------------------------------------------------------
+
+TaskStatusBar* TaskBar::CreateTaskStatusBar()
+{
+ return new TaskStatusBar( this );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::MouseMove( const MouseEvent& rMEvt )
+{
+ if ( mnWinBits & WB_SIZEABLE )
+ {
+ TaskToolBox* pTempTaskToolBox = GetTaskToolBox();
+ TaskStatusBar* pTempStatusBar = GetStatusBar();
+
+ if ( pTempTaskToolBox && pTempStatusBar )
+ {
+ long nStatusX = pTempStatusBar->GetPosPixel().X()-TASKBAR_OFFSIZE-2;
+ long nMouseX = rMEvt.GetPosPixel().X();
+ PointerStyle ePtrStyle;
+ if ( (nMouseX >= nStatusX-1) && (nMouseX <= nStatusX+3) )
+ ePtrStyle = POINTER_HSIZEBAR;
+ else
+ ePtrStyle = POINTER_ARROW;
+ Pointer aPtr( ePtrStyle );
+ SetPointer( aPtr );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() && (mnWinBits & WB_SIZEABLE) )
+ {
+ TaskToolBox* pTempTaskToolBox = GetTaskToolBox();
+ TaskStatusBar* pTempStatusBar = GetStatusBar();
+
+ if ( pTempTaskToolBox && pTempStatusBar )
+ {
+ long nStatusX = pTempStatusBar->GetPosPixel().X()-TASKBAR_OFFSIZE-2;
+ long nMouseX = rMEvt.GetPosPixel().X();
+ if ( (nMouseX >= nStatusX-1) && (nMouseX <= nStatusX+3) )
+ {
+ if ( rMEvt.GetClicks() == 2 )
+ {
+ if ( mnStatusWidth )
+ {
+ mnStatusWidth = 0;
+ Resize();
+ }
+ }
+ else
+ {
+ StartTracking();
+ mnOldStatusWidth = mnStatusWidth;
+ mnMouseOff = nMouseX-nStatusX;
+ }
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::Tracking( const TrackingEvent& rTEvt )
+{
+ if ( rTEvt.IsTrackingEnded() )
+ {
+ if ( rTEvt.IsTrackingCanceled() )
+ {
+ mnStatusWidth = mnOldStatusWidth;
+ Resize();
+ Update();
+ }
+ }
+ else
+ {
+ Size aSize = GetOutputSizePixel();
+
+#ifdef MAC
+ if ( !Application::IsFullScreenMode() )
+ aSize.Width() -= 17;
+#endif
+
+ long nMouseX = rTEvt.GetMouseEvent().GetPosPixel().X()-mnMouseOff;
+ if ( nMouseX < 0 )
+ nMouseX = 0;
+ long nMaxX = aSize.Width()-TASKBAR_OFFX-TASKBAR_OFFSIZE-1;
+ if ( nMouseX > nMaxX )
+ nMouseX = nMaxX;
+ mnStatusWidth = aSize.Width()-nMouseX-TASKBAR_OFFX-TASKBAR_OFFSIZE;
+ Resize();
+ Update();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::Paint( const Rectangle& rRect )
+{
+ if ( mnWinBits & (WB_BORDER | WB_SIZEABLE) )
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ Size aSize = GetOutputSizePixel();
+ long nY = 0;
+
+ if ( mnWinBits & WB_BORDER )
+ {
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( Point( 0, 0 ), Point( aSize.Width()-1, 0 ) );
+ SetLineColor( rStyleSettings.GetLightColor() );
+ DrawLine( Point( 0, 1 ), Point( aSize.Width()-1, 1 ) );
+ nY += 2;
+ }
+
+ if ( (mnWinBits & WB_SIZEABLE) )
+ {
+ TaskButtonBar* pTempButtonBar = GetButtonBar();
+ TaskToolBox* pTempTaskToolBox = GetTaskToolBox();
+ TaskStatusBar* pTempStatusBar = GetStatusBar();
+
+ if ( pTempTaskToolBox && pTempStatusBar )
+ {
+ long nStatusX = pTempStatusBar->GetPosPixel().X()-TASKBAR_OFFSIZE-2;
+ if ( nStatusX > 0 )
+ {
+ SetLineColor( rStyleSettings.GetShadowColor() );
+ DrawLine( Point( nStatusX, nY ), Point( nStatusX, aSize.Height()-1 ) );
+ nStatusX++;
+ SetLineColor( rStyleSettings.GetLightColor() );
+ DrawLine( Point( nStatusX, nY ), Point( nStatusX, aSize.Height()-1 ) );
+ }
+ }
+ }
+ }
+
+ Window::Paint( rRect );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::Resize()
+{
+ if ( !IsReallyShown() )
+ return;
+
+ TaskButtonBar* pTempButtonBar = GetButtonBar();
+ TaskToolBox* pTempTaskToolBox = GetTaskToolBox();
+ TaskStatusBar* pTempStatusBar = GetStatusBar();
+ Point aToolPos( TASKBAR_OFFX, 0 );
+ Size aSize = GetOutputSizePixel();
+ Size aStatusSize;
+ Size aToolSize( aSize.Width()-(TASKBAR_OFFX*2), 0 );
+ long nOldStatusX = -1;
+ long nNewStatusX = -1;
+ long nTaskHeight = aSize.Height() - (TASKBAR_OFFY*2);
+
+#ifdef MAC
+ if ( !Application::IsFullScreenMode() )
+ aSize.Width() -= 17;
+#endif
+
+ if ( mnWinBits & WB_BORDER )
+ {
+ nTaskHeight -= TASKBAR_BORDER;
+ aToolPos.Y() += TASKBAR_BORDER;
+ }
+
+ if ( pTempButtonBar )
+ {
+ USHORT i = 0;
+ BOOL bVisibleItems = FALSE;
+ while ( i < pTempButtonBar->GetItemCount() )
+ {
+ if ( pTempButtonBar->IsItemVisible( pTempButtonBar->GetItemId( i ) ) )
+ {
+ bVisibleItems = TRUE;
+ break;
+ }
+ i++;
+ }
+ if ( mbStatusText || !bVisibleItems )
+ pTempButtonBar->Hide();
+ else
+ {
+ Size aButtonBarSize = pTempButtonBar->CalcWindowSizePixel();
+ if ( pTempButtonBar->GetItemCount() )
+ nTaskHeight = aButtonBarSize.Height();
+ else
+ aButtonBarSize.Height() = nTaskHeight;
+ Point aTempPos = aToolPos;
+ aTempPos.Y() += (aSize.Height()-aButtonBarSize.Height()-aTempPos.Y())/2;
+ pTempButtonBar->SetPosSizePixel( aTempPos, aButtonBarSize );
+ pTempButtonBar->Show();
+ aToolPos.X() += aButtonBarSize.Width()+TASKBAR_BUTTONOFF;
+ }
+ }
+
+ if ( pTempStatusBar )
+ {
+ aStatusSize = pTempStatusBar->CalcWindowSizePixel();
+ if ( mnStatusWidth )
+ aStatusSize.Width() = mnStatusWidth;
+ if ( !pTempTaskToolBox || mbStatusText )
+ aStatusSize.Width() = aSize.Width();
+ long nMaxHeight = aSize.Height()-(TASKBAR_OFFY*2);
+ if ( mnWinBits & WB_BORDER )
+ nMaxHeight -= TASKBAR_BORDER;
+ if ( nMaxHeight+2 > aStatusSize.Height() )
+ aStatusSize.Height() = nMaxHeight;
+ Point aPos( aSize.Width()-aStatusSize.Width(), 0 );
+ if ( pTempTaskToolBox && (mnWinBits & WB_SIZEABLE) && !mbStatusText )
+ {
+ long nMinToolWidth = aToolPos.X()+50;
+ if ( aPos.X() < nMinToolWidth )
+ {
+ aStatusSize.Width() -= nMinToolWidth-aPos.X();
+ aPos.X() = nMinToolWidth;
+ }
+ }
+ if ( aPos.X() < 0 )
+ {
+ aStatusSize.Width() = aSize.Width();
+ aPos.X() = 0;
+ }
+ if ( mnWinBits & WB_BORDER )
+ aPos.Y() += TASKBAR_BORDER;
+ aPos.Y() += (aSize.Height()-aStatusSize.Height()-aPos.Y())/2;
+ if ( mnWinBits & WB_SIZEABLE )
+ {
+ if ( pTempTaskToolBox )
+ {
+ nOldStatusX = pTempStatusBar->GetPosPixel().X()-TASKBAR_OFFSIZE-2;
+ nNewStatusX = aPos.X()-TASKBAR_OFFSIZE-2;
+ }
+ }
+ pTempStatusBar->SetPosSizePixel( aPos, aStatusSize );
+ pTempStatusBar->Show();
+ aToolSize.Width() = aPos.X()-aToolPos.X()-TASKBAR_OFFX;
+ if ( mnWinBits & WB_SIZEABLE )
+ aToolSize.Width() -= (TASKBAR_OFFSIZE*2)-2;
+ }
+
+ if ( pTempTaskToolBox )
+ {
+ if ( aToolSize.Width() <= 24 )
+ pTempTaskToolBox->Hide();
+ else
+ {
+ aToolSize.Height() = pTempTaskToolBox->CalcWindowSizePixel().Height();
+ if ( pTempTaskToolBox->GetItemCount() )
+ nTaskHeight = aToolSize.Height();
+ else
+ aToolSize.Height() = nTaskHeight;
+ aToolPos.Y() += (aSize.Height()-aToolSize.Height()-aToolPos.Y())/2;
+ pTempTaskToolBox->SetPosSizePixel( aToolPos, aToolSize );
+ pTempTaskToolBox->Show();
+ }
+ }
+
+ if ( nOldStatusX != nNewStatusX )
+ {
+ if ( nOldStatusX > 0 )
+ {
+ Rectangle aRect( nOldStatusX, 0, nOldStatusX+2, aSize.Height()-1 );
+ Invalidate( aRect );
+ }
+ if ( nNewStatusX > 0 )
+ {
+ Rectangle aRect( nNewStatusX, 0, nNewStatusX+2, aSize.Height()-1 );
+ Invalidate( aRect );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::StateChanged( StateChangedType nType )
+{
+ Window::StateChanged( nType );
+
+ if ( nType == STATE_CHANGE_INITSHOW )
+ Format();
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ ImplInitSettings();
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_FORMAT )
+ {
+ ImplInitSettings();
+ ImplNewHeight( CalcWindowSizePixel().Height() );
+ Format();
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Window::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
+ (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
+ ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+ {
+ // Asyncronen StateChanged ausloesen, damit sich die
+ // TaskBar an die neuen Groessen der Child-Fenster
+ // orientieren kann
+ PostStateChanged( STATE_CHANGE_FORMAT );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::Format()
+{
+ ImplNewHeight( CalcWindowSizePixel().Height() );
+ Resize();
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::SetLines( USHORT nLines )
+{
+ mnLines = nLines;
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::EnableAutoHide( BOOL bAutoHide )
+{
+ mbAutoHide = bAutoHide;
+
+ if ( mbAutoHide )
+ {
+ ImplNewHeight( TASKBAR_AUTOHIDE_HEIGHT );
+ }
+ else
+ {
+ ImplNewHeight( CalcWindowSizePixel().Height() );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::ShowStatusText( const String& rText )
+{
+ if ( mpStatusBar )
+ {
+ if ( !mbStatusText )
+ {
+ mbStatusText = TRUE;
+ if ( mpStatusBar->AreItemsVisible() )
+ {
+ mbShowItems = TRUE;
+ mpStatusBar->HideItems();
+ }
+ else
+ mbShowItems = TRUE;
+ maOldText = mpStatusBar->GetText();
+ Resize();
+ mpStatusBar->SetText( rText );
+ Update();
+ mpStatusBar->Update();
+ }
+ else
+ mpStatusBar->SetText( rText );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskBar::HideStatusText()
+{
+ if ( mbStatusText && mpStatusBar )
+ {
+ mbStatusText = FALSE;
+ mpStatusBar->SetText( maOldText );
+ Resize();
+ if ( mbShowItems )
+ mpStatusBar->ShowItems();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+Size TaskBar::CalcWindowSizePixel() const
+{
+ TaskButtonBar* pTempButtonBar = GetButtonBar();
+ TaskToolBox* pTempTaskToolBox = GetTaskToolBox();
+ TaskStatusBar* pTempStatusBar = GetStatusBar();
+ Size aSize;
+ long nTempHeight;
+
+ if ( pTempButtonBar && pTempButtonBar->GetItemCount() )
+ aSize.Height() = pTempButtonBar->CalcWindowSizePixel().Height()+(TASKBAR_OFFY*2);
+ if ( pTempTaskToolBox && pTempTaskToolBox->GetItemCount() )
+ {
+ nTempHeight = pTempTaskToolBox->CalcWindowSizePixel().Height()+(TASKBAR_OFFY*2);
+ if ( nTempHeight > aSize.Height() )
+ aSize.Height() = nTempHeight;
+ }
+ if ( pTempStatusBar )
+ {
+ nTempHeight = pTempStatusBar->GetSizePixel().Height();
+ if ( nTempHeight > aSize.Height() )
+ aSize.Height() = nTempHeight;
+ }
+
+ if ( mnWinBits & WB_BORDER )
+ aSize.Height() += TASKBAR_BORDER;
+
+ return aSize;
+}
+
+// -----------------------------------------------------------------------
+
+TaskButtonBar* TaskBar::GetButtonBar() const
+{
+ if ( !mpButtonBar )
+ ((TaskBar*)this)->mpButtonBar = ((TaskBar*)this)->CreateButtonBar();
+ return mpButtonBar;
+}
+
+// -----------------------------------------------------------------------
+
+TaskToolBox* TaskBar::GetTaskToolBox() const
+{
+ if ( !mpTaskToolBox )
+ ((TaskBar*)this)->mpTaskToolBox = ((TaskBar*)this)->CreateTaskToolBox();
+ return mpTaskToolBox;
+}
+
+// -----------------------------------------------------------------------
+
+TaskStatusBar* TaskBar::GetStatusBar() const
+{
+ if ( !mpStatusBar )
+ {
+ ((TaskBar*)this)->mpStatusBar = ((TaskBar*)this)->CreateTaskStatusBar();
+ if ( mpStatusBar )
+ mpStatusBar->mpNotifyTaskBar = (TaskBar*)this;
+ }
+ return mpStatusBar;
+}
diff --git a/svtools/source/control/taskbox.cxx b/svtools/source/control/taskbox.cxx
new file mode 100644
index 000000000000..73a9798a12ee
--- /dev/null
+++ b/svtools/source/control/taskbox.cxx
@@ -0,0 +1,406 @@
+/*************************************************************************
+ *
+ * $RCSfile: taskbox.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _TASKBAR_CXX
+
+#ifndef _TOOLS_LIST_HXX
+#include <tools/list.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _SV_IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+#ifndef _SV_SYSTEM_HXX
+#include <vcl/system.hxx>
+#endif
+#ifndef _SV_HELP_HXX
+#include <vcl/help.hxx>
+#endif
+
+#include <taskbar.hxx>
+
+// =======================================================================
+
+#define TASKBOX_TASKOFF 3
+
+// =======================================================================
+
+struct ImplTaskItem
+{
+ Image maImage;
+ XubString maText;
+};
+
+DECLARE_LIST( ImplTaskItemList, ImplTaskItem* );
+
+// =======================================================================
+
+TaskToolBox::TaskToolBox( Window* pParent, WinBits nWinStyle ) :
+ ToolBox( pParent, nWinStyle | WB_SCROLL | WB_3DLOOK )
+{
+ mpItemList = new ImplTaskItemList;
+ mnMaxTextWidth = 0;
+ mnActiveItemId = 0;
+ mnTaskItem = 0;
+ mnSmallItem = TOOLBOX_ITEM_NOTFOUND;
+ mbMinActivate = FALSE;
+
+ SetAlign( WINDOWALIGN_BOTTOM );
+ SetButtonType( BUTTON_SYMBOLTEXT );
+}
+
+// -----------------------------------------------------------------------
+
+TaskToolBox::~TaskToolBox()
+{
+ ImplTaskItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
+ }
+
+ delete mpItemList;
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::ActivateTaskItem( USHORT nItemId, BOOL bMinActivate )
+{
+ if ( nItemId )
+ {
+ if ( nItemId != mnActiveItemId )
+ {
+ if ( mnActiveItemId )
+ CheckItem( mnActiveItemId, FALSE );
+ CheckItem( nItemId );
+ mnActiveItemId = nItemId;
+ }
+ else
+ {
+ if ( !bMinActivate )
+ return;
+
+ mbMinActivate = TRUE;
+ }
+
+ mnTaskItem = nItemId-1;
+ ActivateTask();
+ mnTaskItem = 0;
+ mbMinActivate = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::ActivateTask()
+{
+ maActivateTaskHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::ContextMenu()
+{
+ maContextMenuHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( !rMEvt.IsRight() )
+ ToolBox::MouseButtonDown( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::Resize()
+{
+ mnOldItemCount = mpItemList->Count();
+ mnUpdatePos = (USHORT)mnOldItemCount;
+ mnUpdateNewPos = TOOLBOX_ITEM_NOTFOUND;
+ ImplFormat();
+ ToolBox::Resize();
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+ {
+ USHORT nItemId = GetItemId( rCEvt.GetMousePosPixel() );
+// Dies machen wir nicht mehr, da es von zu vielen als stoerend empfunden wurde
+// ActivateTaskItem( nItemId );
+ mnTaskItem = nItemId-1;
+
+ maContextMenuPos = OutputToScreenPixel( rCEvt.GetMousePosPixel() );
+ ContextMenu();
+ maContextMenuPos = Point();
+ mnTaskItem = 0;
+ }
+ else
+ ToolBox::Command( rCEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::RequestHelp( const HelpEvent& rHEvt )
+{
+ if ( rHEvt.GetMode() & (HELPMODE_BALLOON | HELPMODE_QUICK) )
+ {
+ USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
+
+ if ( nItemId )
+ {
+ ImplTaskItem* pItem = mpItemList->GetObject( nItemId-1 );
+ if ( pItem )
+ {
+ if ( pItem->maText != GetItemText( nItemId ) )
+ {
+ Rectangle aItemRect = GetItemRect( nItemId );
+ if ( rHEvt.GetMode() & HELPMODE_QUICK )
+ Help::ShowQuickHelp( this, aItemRect, pItem->maText );
+ else
+ Help::ShowBalloon( this, aItemRect.Center(), aItemRect, pItem->maText );
+ }
+ else
+ Help::ShowQuickHelp( this, Rectangle(), String() );
+ return;
+ }
+ }
+ }
+
+ ToolBox::RequestHelp( rHEvt );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TaskToolBox::QueryDrop( DropEvent& rDEvt )
+{
+ if ( !rDEvt.IsLeaveWindow() )
+ {
+ USHORT nItemId = GetItemId( rDEvt.GetPosPixel() );
+ if ( nItemId )
+ ActivateTaskItem( nItemId );
+ }
+ return ToolBox::QueryDrop( rDEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::Select()
+{
+ USHORT nItemId = GetCurItemId();
+ ActivateTaskItem( nItemId, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::ImplFormat()
+{
+ if ( mnUpdateNewPos == TOOLBOX_ITEM_NOTFOUND )
+ {
+ // Eintraege aus der Liste entfernen
+ while ( mpItemList->Count() > mnUpdatePos )
+ delete mpItemList->Remove( (ULONG)mnUpdatePos );
+ mnUpdateNewPos = mnUpdatePos;
+ }
+
+ // Maximale Itemgroesse berechnen
+ long nOldMaxTextWidth = mnMaxTextWidth;
+ mnMaxTextWidth = 70;
+ if ( mpItemList->Count() )
+ {
+ long nWinSize = GetOutputSizePixel().Width()-8;
+ long nItemSize = mpItemList->GetObject(0)->maImage.GetSizePixel().Width()+7+TASKBOX_TASKOFF+2;
+ nWinSize -= mpItemList->Count()*nItemSize;
+ if ( nWinSize > 0 )
+ nWinSize /= mpItemList->Count();
+ else
+ nWinSize = 0;
+ if ( nWinSize < mnMaxTextWidth )
+ mnMaxTextWidth = nWinSize;
+ if ( (mnMaxTextWidth < nOldMaxTextWidth) ||
+ ((mnMaxTextWidth-nOldMaxTextWidth > 3) &&
+ (mnSmallItem != TOOLBOX_ITEM_NOTFOUND)) )
+ {
+ mnSmallItem = TOOLBOX_ITEM_NOTFOUND;
+ mnUpdateNewPos = 0;
+ }
+ }
+
+ // Eintraege aus der ToolBox entfernen, die ersetzt werden
+ USHORT nBtnPos = (mnUpdateNewPos*2);
+ while ( nBtnPos < GetItemCount() )
+ RemoveItem( nBtnPos );
+ if ( mnUpdateNewPos <= (mnActiveItemId-1) )
+ mnActiveItemId = 0;
+
+ // Neue Eintrage einfuegen
+ USHORT i = mnUpdateNewPos;
+ while ( i < mpItemList->Count() )
+ {
+ ImplTaskItem* pItem = mpItemList->GetObject( i );
+
+ // Textlaenge berechnen
+ XubString aText = pItem->maText;
+ if ( !aText.Len() )
+ aText = ' ';
+ long nTxtWidth = GetTextWidth( aText );
+ if ( nTxtWidth > mnMaxTextWidth )
+ {
+ if ( mnSmallItem == TOOLBOX_ITEM_NOTFOUND )
+ mnSmallItem = i;
+ // 3 == Len of "..."
+ aText.AppendAscii( "..." );
+ do
+ {
+ aText.Erase( aText.Len()-3-1, 1 );
+ nTxtWidth = GetTextWidth( aText );
+ }
+ while ( (nTxtWidth > mnMaxTextWidth) && (aText.Len() > 3) );
+ }
+
+ USHORT nItemId = i+1;
+ if ( aText.EqualsAscii( "..." ) )
+ InsertItem( nItemId, pItem->maImage, TIB_LEFT );
+ else
+ InsertItem( nItemId, pItem->maImage, aText, TIB_LEFT );
+ InsertSeparator( TOOLBOX_APPEND, TASKBOX_TASKOFF );
+ i++;
+ }
+
+ if ( mnUpdateNewPos != 0 )
+ mnMaxTextWidth = nOldMaxTextWidth;
+
+ if ( mnNewActivePos+1 != mnActiveItemId )
+ {
+ if ( mnActiveItemId )
+ CheckItem( mnActiveItemId, FALSE );
+ mnActiveItemId = mnNewActivePos+1;
+ CheckItem( mnActiveItemId );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::StartUpdateTask()
+{
+ mnOldItemCount = mpItemList->Count();
+ mnUpdatePos = 0;
+ mnUpdateNewPos = TOOLBOX_ITEM_NOTFOUND;
+ mnNewActivePos = 0xFFFE;
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::UpdateTask( const Image& rImage, const String& rText,
+ BOOL bActive )
+{
+ ImplTaskItem* pItem = mpItemList->GetObject( mnUpdatePos );
+ if ( pItem )
+ {
+ if ( (pItem->maText != rText) || (pItem->maImage != rImage) )
+ {
+ // Eintraege aus der Liste entfernen
+ while ( mpItemList->Count() > mnUpdatePos )
+ delete mpItemList->Remove( (ULONG)mnUpdatePos );
+ pItem = NULL;
+ }
+ }
+
+ if ( !pItem )
+ {
+ if ( mnUpdatePos < mnUpdateNewPos )
+ mnUpdateNewPos = mnUpdatePos;
+
+ pItem = new ImplTaskItem;
+ pItem->maImage = rImage;
+ pItem->maText = rText;
+ mpItemList->Insert( pItem, LIST_APPEND );
+ }
+
+ if ( bActive )
+ mnNewActivePos = mnUpdatePos;
+
+ mnUpdatePos++;
+}
+
+// -----------------------------------------------------------------------
+
+void TaskToolBox::EndUpdateTask()
+{
+ if ( mnUpdateNewPos == TOOLBOX_ITEM_NOTFOUND )
+ {
+ // Eintraege aus der Liste entfernen
+ while ( mpItemList->Count() > mnUpdatePos )
+ delete mpItemList->Remove( (ULONG)mnUpdatePos );
+ mnUpdateNewPos = mnUpdatePos;
+ }
+
+ ImplFormat();
+}
+
diff --git a/svtools/source/control/taskmisc.cxx b/svtools/source/control/taskmisc.cxx
new file mode 100644
index 000000000000..1438417d2a88
--- /dev/null
+++ b/svtools/source/control/taskmisc.cxx
@@ -0,0 +1,416 @@
+/*************************************************************************
+ *
+ * $RCSfile: taskmisc.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _TASKBAR_CXX
+
+#ifndef _TOOLS_LIST_HXX
+#include <tools/list.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _SV_HELP_HXX
+#include <vcl/help.hxx>
+#endif
+
+#include <taskbar.hxx>
+
+// =======================================================================
+
+TaskButtonBar::TaskButtonBar( Window* pParent, WinBits nWinStyle ) :
+ ToolBox( pParent, nWinStyle | WB_3DLOOK )
+{
+ SetAlign( WINDOWALIGN_BOTTOM );
+ SetButtonType( BUTTON_SYMBOLTEXT );
+}
+
+// -----------------------------------------------------------------------
+
+TaskButtonBar::~TaskButtonBar()
+{
+}
+
+// -----------------------------------------------------------------------
+
+void TaskButtonBar::RequestHelp( const HelpEvent& rHEvt )
+{
+ ToolBox::RequestHelp( rHEvt );
+}
+
+// =======================================================================
+
+WindowArrange::WindowArrange()
+{
+ mpWinList = new List;
+}
+
+// -----------------------------------------------------------------------
+
+WindowArrange::~WindowArrange()
+{
+ delete mpWinList;
+}
+
+// -----------------------------------------------------------------------
+
+static USHORT ImplCeilSqareRoot( USHORT nVal )
+{
+ USHORT i;
+
+ // Ueberlauf verhindern
+ if ( nVal > 0xFE * 0xFE )
+ return 0xFE;
+
+ for ( i=0; i*i < nVal; i++ )
+ {}
+
+ return i;
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplPosSizeWindow( Window* pWindow,
+ long nX, long nY, long nWidth, long nHeight )
+{
+ if ( nWidth < 32 )
+ nWidth = 32;
+ if ( nHeight < 24 )
+ nHeight = 24;
+ pWindow->SetPosSizePixel( nX, nY, nWidth, nHeight );
+}
+
+// -----------------------------------------------------------------------
+
+void WindowArrange::ImplTile( const Rectangle& rRect )
+{
+ USHORT nCount = (USHORT)mpWinList->Count();
+ if ( nCount < 3 )
+ {
+ ImplVert( rRect );
+ return;
+ }
+
+ USHORT i;
+ USHORT j;
+ USHORT nCols;
+ USHORT nRows;
+ USHORT nActRows;
+ USHORT nOffset;
+ long nOverWidth;
+ long nOverHeight;
+ Window* pWindow;
+ long nX = rRect.Left();
+ long nY = rRect.Top();
+ long nWidth = rRect.GetWidth();
+ long nHeight = rRect.GetHeight();
+ long nRectY = nY;
+ long nRectWidth = nWidth;
+ long nRectHeight = nHeight;
+ long nTempWidth;
+ long nTempHeight;
+
+ nCols = ImplCeilSqareRoot( nCount );
+ nOffset = (nCols*nCols) - nCount;
+ if ( nOffset >= nCols )
+ {
+ nRows = nCols -1;
+ nOffset -= nCols;
+ }
+ else
+ nRows = nCols;
+
+ nWidth /= nCols;
+ if ( nWidth < 1 )
+ nWidth = 1;
+ nOverWidth = nRectWidth-(nWidth*nCols);
+
+ pWindow = (Window*)mpWinList->First();
+ for ( i = 0; i < nCols; i++ )
+ {
+ if ( i < nOffset )
+ nActRows = nRows - 1;
+ else
+ nActRows = nRows;
+
+ nTempWidth = nWidth;
+ if ( nOverWidth > 0 )
+ {
+ nTempWidth++;
+ nOverWidth--;
+ }
+
+ nHeight = nRectHeight / nActRows;
+ if ( nHeight < 1 )
+ nHeight = 1;
+ nOverHeight = nRectHeight-(nHeight*nActRows);
+ for ( j = 0; j < nActRows; j++ )
+ {
+ // Ueberhang verteilen
+ nTempHeight = nHeight;
+ if ( nOverHeight > 0 )
+ {
+ nTempHeight++;
+ nOverHeight--;
+ }
+ ImplPosSizeWindow( pWindow, nX, nY, nTempWidth, nTempHeight );
+ nY += nTempHeight;
+
+ pWindow = (Window*)mpWinList->Next();
+ if ( !pWindow )
+ break;
+ }
+
+ nX += nWidth;
+ nY = nRectY;
+
+ if ( !pWindow )
+ break;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void WindowArrange::ImplHorz( const Rectangle& rRect )
+{
+ long nCount = (long)mpWinList->Count();
+ long nX = rRect.Left();
+ long nY = rRect.Top();
+ long nWidth = rRect.GetWidth();
+ long nHeight = rRect.GetHeight();
+ long nRectHeight = nHeight;
+ long nOver;
+ long nTempHeight;
+ Window* pWindow;
+
+ nHeight /= nCount;
+ if ( nHeight < 1 )
+ nHeight = 1;
+ nOver = nRectHeight - (nCount*nHeight);
+ pWindow = (Window*)mpWinList->First();
+ while ( pWindow )
+ {
+ nTempHeight = nHeight;
+ if ( nOver > 0 )
+ {
+ nTempHeight++;
+ nOver--;
+ }
+ ImplPosSizeWindow( pWindow, nX, nY, nWidth, nTempHeight );
+ nY += nTempHeight;
+
+ pWindow = (Window*)mpWinList->Next();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void WindowArrange::ImplVert( const Rectangle& rRect )
+{
+ long nCount = (long)mpWinList->Count();
+ long nX = rRect.Left();
+ long nY = rRect.Top();
+ long nWidth = rRect.GetWidth();
+ long nHeight = rRect.GetHeight();
+ long nRectWidth = nWidth;
+ long nOver;
+ long nTempWidth;
+ Window* pWindow;
+
+ nWidth /= nCount;
+ if ( nWidth < 1 )
+ nWidth = 1;
+ nOver = nRectWidth - (nCount*nWidth);
+ pWindow = (Window*)mpWinList->First();
+ while ( pWindow )
+ {
+ nTempWidth = nWidth;
+ if ( nOver > 0 )
+ {
+ nTempWidth++;
+ nOver--;
+ }
+ ImplPosSizeWindow( pWindow, nX, nY, nTempWidth, nHeight );
+ nX += nTempWidth;
+
+ pWindow = (Window*)mpWinList->Next();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void WindowArrange::ImplCascade( const Rectangle& rRect )
+{
+ long nX = rRect.Left();
+ long nY = rRect.Top();
+ long nWidth = rRect.GetWidth();
+ long nHeight = rRect.GetHeight();
+ long nRectWidth = nWidth;
+ long nRectHeight = nHeight;
+ long nOff;
+ long nCascadeWins;
+ long nLeftBorder;
+ long nTopBorder;
+ long nRightBorder;
+ long nBottomBorder;
+ long nStartOverWidth;
+ long nStartOverHeight;
+ long nOverWidth;
+ long nOverHeight;
+ long nTempX;
+ long nTempY;
+ long nTempWidth;
+ long nTempHeight;
+ long i;
+ Window* pWindow;
+ Window* pTempWindow;
+
+ // Border-Fenster suchen um den Versatz zu ermitteln
+ pTempWindow = (Window*)mpWinList->First();
+ pTempWindow->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
+ while ( !nTopBorder )
+ {
+ Window* pBrdWin = pTempWindow->GetWindow( WINDOW_REALPARENT );
+ if ( !pBrdWin || (pBrdWin->GetWindow( WINDOW_CLIENT ) != pTempWindow) )
+ break;
+ pTempWindow = pBrdWin;
+ pTempWindow->GetBorder( nLeftBorder, nTopBorder, nRightBorder, nBottomBorder );
+ }
+ if ( !nTopBorder )
+ nTopBorder = 22;
+ nOff = nTopBorder;
+
+ nCascadeWins = nRectHeight / 3 / nOff;
+ if ( !nCascadeWins )
+ nCascadeWins = 1;
+ nWidth -= nCascadeWins*nOff;
+ nHeight -= nCascadeWins*nOff;
+ if ( nWidth < 1 )
+ nWidth = 1;
+ if ( nHeight < 1 )
+ nHeight = 1;
+
+ nStartOverWidth = nRectWidth-(nWidth+(nCascadeWins*nOff));
+ nStartOverHeight = nRectHeight-(nHeight+(nCascadeWins*nOff));
+
+ i = 0;
+ pWindow = (Window*)mpWinList->First();
+ while ( pWindow )
+ {
+ if ( !i )
+ {
+ nOverWidth = nStartOverWidth;
+ nOverHeight = nStartOverHeight;
+ }
+
+ // Position
+ nTempX = nX + (i*nOff);
+ nTempY = nY + (i*nOff);
+
+ // Ueberhang verteilen
+ nTempWidth = nWidth;
+ if ( nOverWidth > 0 )
+ {
+ nTempWidth++;
+ nOverWidth--;
+ }
+ nTempHeight = nHeight;
+ if ( nOverHeight > 0 )
+ {
+ nTempHeight++;
+ nOverHeight--;
+ }
+
+ ImplPosSizeWindow( pWindow, nTempX, nTempY, nTempWidth, nTempHeight );
+
+ if ( i < nCascadeWins )
+ i++;
+ else
+ i = 0;
+
+ pWindow = (Window*)mpWinList->Next();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void WindowArrange::Arrange( USHORT nType, const Rectangle& rRect )
+{
+ if ( !mpWinList->Count() )
+ return;
+
+ switch ( nType )
+ {
+ case WINDOWARRANGE_TILE:
+ ImplTile( rRect );
+ break;
+ case WINDOWARRANGE_HORZ:
+ ImplHorz( rRect );
+ break;
+ case WINDOWARRANGE_VERT:
+ ImplVert( rRect );
+ break;
+ case WINDOWARRANGE_CASCADE:
+ ImplCascade( rRect );
+ break;
+ }
+}
+
diff --git a/svtools/source/control/taskstat.cxx b/svtools/source/control/taskstat.cxx
new file mode 100644
index 000000000000..4c83b4bd09e9
--- /dev/null
+++ b/svtools/source/control/taskstat.cxx
@@ -0,0 +1,769 @@
+/*************************************************************************
+ *
+ * $RCSfile: taskstat.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _TASKBAR_CXX
+
+#ifndef _TOOLS_LIST_HXX
+#include <tools/list.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _SV_IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+#ifndef _SV_SYSTEM_HXX
+#include <vcl/system.hxx>
+#endif
+#ifndef _SV_HELP_HXX
+#include <vcl/help.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
+#include <taskbar.hxx>
+
+// =======================================================================
+
+#define TASKSTATUSBAR_CLOCXOFFX 3
+#define TASKSTATUSBAR_IMAGEOFFX 1
+
+// =======================================================================
+
+struct ImplTaskSBFldItem
+{
+ TaskStatusFieldItem maItem;
+ USHORT mnId;
+ long mnOffX;
+};
+
+DECLARE_LIST( ImplTaskSBItemList, ImplTaskSBFldItem* );
+
+// =======================================================================
+
+BOOL ITaskStatusNotify::MouseButtonDown( USHORT nItemd, const MouseEvent& rMEvt )
+{
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ITaskStatusNotify::MouseButtonUp( USHORT nItemd, const MouseEvent& rMEvt )
+{
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ITaskStatusNotify::MouseMove( USHORT nItemd, const MouseEvent& rMEvt )
+{
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ITaskStatusNotify::Command( USHORT nItemd, const CommandEvent& rCEvt )
+{
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ITaskStatusNotify::QueryDrop( USHORT nItemd, DropEvent& rDEvt, BOOL& bRet )
+{
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ITaskStatusNotify::Drop( USHORT nItemd, const DropEvent& rDEvt, BOOL& bRet )
+{
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ITaskStatusNotify::UpdateHelp( USHORT nItemd )
+{
+ return FALSE;
+}
+
+// =======================================================================
+
+TaskStatusFieldItem::TaskStatusFieldItem()
+{
+ mpNotify = NULL;
+ mnFlags = 0;
+}
+
+// -----------------------------------------------------------------------
+
+TaskStatusFieldItem::TaskStatusFieldItem( const TaskStatusFieldItem& rItem ) :
+ mpNotify( rItem.mpNotify ),
+ maImage( rItem.maImage ),
+ maQuickHelpText( rItem.maQuickHelpText ),
+ maHelpText( rItem.maHelpText ),
+ mnFlags( rItem.mnFlags )
+{
+}
+
+// -----------------------------------------------------------------------
+
+TaskStatusFieldItem::TaskStatusFieldItem( ITaskStatusNotify* pNotify,
+ const Image& rImage,
+ const XubString& rQuickHelpText,
+ const XubString& rHelpText,
+ USHORT nFlags ) :
+ mpNotify( pNotify ),
+ maImage( rImage ),
+ maQuickHelpText( rQuickHelpText ),
+ maHelpText( rHelpText ),
+ mnFlags( nFlags )
+{
+}
+
+// -----------------------------------------------------------------------
+
+TaskStatusFieldItem::~TaskStatusFieldItem()
+{
+}
+
+// -----------------------------------------------------------------------
+
+const TaskStatusFieldItem& TaskStatusFieldItem::operator=( const TaskStatusFieldItem& rItem )
+{
+ mpNotify = rItem.mpNotify;
+ maImage = rItem.maImage;
+ maQuickHelpText = rItem.maQuickHelpText;
+ maHelpText = rItem.maHelpText;
+ mnFlags = rItem.mnFlags;
+ return *this;
+}
+
+// =======================================================================
+
+TaskStatusBar::TaskStatusBar( Window* pParent, WinBits nWinStyle ) :
+ StatusBar( pParent, nWinStyle | WB_3DLOOK ),
+ maTime( 0, 0, 0 )
+{
+ mpFieldItemList = NULL;
+ mpNotifyTaskBar = NULL;
+ mpNotify = NULL;
+ mnClockWidth = 0;
+ mnItemWidth = 0;
+ mnFieldWidth = 0;
+ mnFieldFlags = 0;
+ mbFlashItems = FALSE;
+ mbOutInterval = FALSE;
+
+ maTimer.SetTimeoutHdl( LINK( this, TaskStatusBar, ImplTimerHdl ) );
+}
+
+// -----------------------------------------------------------------------
+
+TaskStatusBar::~TaskStatusBar()
+{
+ if ( mpFieldItemList )
+ {
+ ImplTaskSBFldItem* pItem = mpFieldItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpFieldItemList->Next();
+ }
+
+ delete mpFieldItemList;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( TaskStatusBar, ImplTimerHdl, Timer*, EMPTYARG )
+{
+ BOOL bUpdate = ImplUpdateClock();
+ if ( ImplUpdateFlashItems() )
+ bUpdate = TRUE;
+ if ( bUpdate )
+ SetItemData( TASKSTATUSBAR_STATUSFIELDID, NULL );
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( USHORT nItemId ) const
+{
+ if ( !mpFieldItemList )
+ return NULL;
+
+ ImplTaskSBFldItem* pItem = mpFieldItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mnId == nItemId )
+ return pItem;
+
+ pItem = mpFieldItemList->Next();
+ }
+
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+ImplTaskSBFldItem* TaskStatusBar::ImplGetFieldItem( const Point& rPos, BOOL& rFieldRect ) const
+{
+ if ( GetItemId( rPos ) == TASKSTATUSBAR_STATUSFIELDID )
+ {
+ rFieldRect = TRUE;
+
+ if ( mpFieldItemList )
+ {
+ long nX = rPos.X()-GetItemRect( TASKSTATUSBAR_STATUSFIELDID ).Left();
+ ImplTaskSBFldItem* pItem = mpFieldItemList->First();
+ while ( pItem )
+ {
+ if ( nX < pItem->mnOffX+pItem->maItem.GetImage().GetSizePixel().Width() )
+ return pItem;
+
+ pItem = mpFieldItemList->Next();
+ }
+ }
+ }
+ else
+ rFieldRect = FALSE;
+
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TaskStatusBar::ImplUpdateClock()
+{
+ if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK )
+ {
+ Time aTime;
+ maTimer.SetTimeout( ((long)60000)-((aTime.GetSec()*1000)+(aTime.Get100Sec()*10)) );
+ if ( (aTime.GetMin() != maTime.GetMin()) ||
+ (aTime.GetHour() != maTime.GetHour()) )
+ {
+ maTime = aTime;
+ maTimeText = maIntn.GetTime( aTime, FALSE, FALSE );
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TaskStatusBar::ImplUpdateFlashItems()
+{
+ if ( mbFlashItems )
+ {
+ if ( mbOutInterval )
+ {
+ maTimer.SetTimeout( 900 );
+ mbOutInterval = FALSE;
+ }
+ else
+ {
+ maTimer.SetTimeout( 700 );
+ mbOutInterval = TRUE;
+ }
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::ImplUpdateField( BOOL bItems )
+{
+ maTimer.Stop();
+
+ if ( bItems )
+ {
+ ImplTaskSBFldItem* pItem = mpFieldItemList->First();
+ mnItemWidth = 0;
+ mbFlashItems = FALSE;
+ mbOutInterval = FALSE;
+ while ( pItem )
+ {
+ mnItemWidth += TASKSTATUSBAR_IMAGEOFFX;
+ pItem->mnOffX = mnItemWidth;
+ mnItemWidth += pItem->maItem.GetImage().GetSizePixel().Width();
+ if ( pItem->maItem.GetFlags() & TASKSTATUSFIELDITEM_FLASH )
+ mbFlashItems = TRUE;
+
+ pItem = mpFieldItemList->Next();
+ }
+ }
+ else
+ {
+ if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK )
+ {
+ XubString aStr = maIntn.GetTime( Time( 23, 59, 59 ), FALSE, FALSE );
+ mnClockWidth = GetTextWidth( aStr )+(TASKSTATUSBAR_CLOCXOFFX*2);
+ }
+ else
+ mnClockWidth = 0;
+ }
+
+ long nNewWidth = mnItemWidth+mnClockWidth;
+ if ( mnItemWidth && !mnClockWidth )
+ nNewWidth += TASKSTATUSBAR_IMAGEOFFX;
+ if ( nNewWidth != mnFieldWidth )
+ {
+ RemoveItem( TASKSTATUSBAR_STATUSFIELDID );
+
+ if ( mnItemWidth || mnClockWidth )
+ {
+ mnFieldWidth = nNewWidth;
+ long nOffset = GetItemOffset( TASKSTATUSBAR_STATUSFIELDID );
+ USHORT nItemPos = GetItemPos( TASKSTATUSBAR_STATUSFIELDID );
+ InsertItem( TASKSTATUSBAR_STATUSFIELDID, nNewWidth, SIB_RIGHT | SIB_IN | SIB_USERDRAW, nOffset, nItemPos );
+ }
+ else
+ mnFieldWidth = 0;
+
+ if ( mpNotifyTaskBar )
+ mpNotifyTaskBar->Resize();
+ }
+ else
+ SetItemData( TASKSTATUSBAR_STATUSFIELDID, NULL );
+
+ if ( mbFlashItems || (mnFieldFlags & TASKSTATUSFIELD_CLOCK) )
+ {
+ ImplUpdateClock();
+ mbOutInterval = TRUE;
+ ImplUpdateFlashItems();
+ maTimer.Start();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ BOOL bFieldRect;
+ BOOL bBaseClass = FALSE;
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
+
+ ITaskStatusNotify* pNotify = mpNotify;
+ USHORT nItemId = 0;
+
+ if ( bFieldRect )
+ nItemId = TASKSTATUSBAR_CLOCKID;
+
+ if ( pItem )
+ {
+ pNotify = pItem->maItem.GetNotifyObject();
+ nItemId = pItem->mnId;
+ }
+
+ if ( pNotify )
+ bBaseClass = pNotify->MouseButtonDown( nItemId, rMEvt );
+
+ if ( bBaseClass )
+ StatusBar::MouseButtonDown( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ BOOL bFieldRect;
+ BOOL bBaseClass = FALSE;
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
+
+ ITaskStatusNotify* pNotify = mpNotify;
+ USHORT nItemId = 0;
+
+ if ( bFieldRect )
+ nItemId = TASKSTATUSBAR_CLOCKID;
+
+ if ( pItem )
+ {
+ pNotify = pItem->maItem.GetNotifyObject();
+ nItemId = pItem->mnId;
+ }
+
+ if ( pNotify )
+ bBaseClass = pNotify->MouseButtonUp( nItemId, rMEvt );
+
+ if ( bBaseClass )
+ StatusBar::MouseButtonUp( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::MouseMove( const MouseEvent& rMEvt )
+{
+ BOOL bFieldRect;
+ BOOL bBaseClass = FALSE;
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( rMEvt.GetPosPixel(), bFieldRect );
+
+ ITaskStatusNotify* pNotify = mpNotify;
+ USHORT nItemId = 0;
+
+ if ( bFieldRect )
+ nItemId = TASKSTATUSBAR_CLOCKID;
+
+ if ( pItem )
+ {
+ pNotify = pItem->maItem.GetNotifyObject();
+ nItemId = pItem->mnId;
+ }
+
+ if ( pNotify )
+ bBaseClass = pNotify->MouseMove( nItemId, rMEvt );
+
+ if ( bBaseClass )
+ StatusBar::MouseMove( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::Command( const CommandEvent& rCEvt )
+{
+ BOOL bFieldRect;
+ BOOL bBaseClass = FALSE;
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( rCEvt.GetMousePosPixel(), bFieldRect );
+
+ ITaskStatusNotify* pNotify = mpNotify;
+ USHORT nItemId = 0;
+
+ if ( bFieldRect )
+ nItemId = TASKSTATUSBAR_CLOCKID;
+
+ if ( pItem )
+ {
+ pNotify = pItem->maItem.GetNotifyObject();
+ nItemId = pItem->mnId;
+ }
+
+ if ( pNotify )
+ bBaseClass = pNotify->Command( nItemId, rCEvt );
+
+ if ( bBaseClass )
+ StatusBar::Command( rCEvt );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TaskStatusBar::QueryDrop( DropEvent& rDEvt )
+{
+ BOOL bFieldRect;
+ BOOL bBaseClass = FALSE;
+ BOOL bRet = FALSE;
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( rDEvt.GetPosPixel(), bFieldRect );
+
+ ITaskStatusNotify* pNotify = mpNotify;
+ USHORT nItemId = 0;
+
+ if ( bFieldRect )
+ nItemId = TASKSTATUSBAR_CLOCKID;
+
+ if ( pItem )
+ {
+ pNotify = pItem->maItem.GetNotifyObject();
+ nItemId = pItem->mnId;
+ }
+
+ if ( pNotify )
+ bBaseClass = pNotify->QueryDrop( nItemId, rDEvt, bRet );
+
+ if ( bBaseClass )
+ {
+ StatusBar::QueryDrop( rDEvt );
+ return TRUE;
+ }
+ else
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TaskStatusBar::Drop( const DropEvent& rDEvt )
+{
+ BOOL bFieldRect;
+ BOOL bBaseClass = FALSE;
+ BOOL bRet = FALSE;
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( rDEvt.GetPosPixel(), bFieldRect );
+
+ ITaskStatusNotify* pNotify = mpNotify;
+ USHORT nItemId = 0;
+
+ if ( bFieldRect )
+ nItemId = TASKSTATUSBAR_CLOCKID;
+
+ if ( pItem )
+ {
+ pNotify = pItem->maItem.GetNotifyObject();
+ nItemId = pItem->mnId;
+ }
+
+ if ( pNotify )
+ bBaseClass = pNotify->Drop( nItemId, rDEvt, bRet );
+
+ if ( bBaseClass )
+ return StatusBar::Drop( rDEvt );
+ else
+ return bRet;
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::RequestHelp( const HelpEvent& rHEvt )
+{
+ BOOL bFieldRect;
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ), bFieldRect );
+ if ( bFieldRect )
+ {
+ ITaskStatusNotify* pNotify = mpNotify;
+ USHORT nItemId = 0;
+
+ if ( pItem )
+ {
+ pNotify = pItem->maItem.GetNotifyObject();
+ nItemId = pItem->mnId;
+ }
+
+ if ( pNotify )
+ pNotify->UpdateHelp( nItemId );
+
+ if ( rHEvt.GetMode() & (HELPMODE_BALLOON | HELPMODE_QUICK) )
+ {
+ Rectangle aItemRect = GetItemRect( TASKSTATUSBAR_STATUSFIELDID );
+ Point aPt = OutputToScreenPixel( aItemRect.TopLeft() );
+ aItemRect.Left() = aPt.X();
+ aItemRect.Top() = aPt.Y();
+ aPt = OutputToScreenPixel( aItemRect.BottomRight() );
+ aItemRect.Right() = aPt.X();
+ aItemRect.Bottom() = aPt.Y();
+ if ( pItem )
+ {
+ if ( rHEvt.GetMode() & HELPMODE_BALLOON )
+ {
+ XubString aStr = pItem->maItem.GetHelpText();
+ if ( !aStr.Len() )
+ aStr = pItem->maItem.GetQuickHelpText();
+ Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr );
+ }
+ else
+ Help::ShowQuickHelp( this, aItemRect, pItem->maItem.GetQuickHelpText() );
+ }
+ else
+ {
+ XubString aStr = maIntn.GetLongDate( Date() );
+ if ( rHEvt.GetMode() & HELPMODE_BALLOON )
+ Help::ShowBalloon( this, aItemRect.Center(), aItemRect, aStr );
+ else
+ Help::ShowQuickHelp( this, aItemRect, aStr );
+ }
+ return;
+ }
+ else if ( rHEvt.GetMode() & HELPMODE_EXTENDED )
+ {
+ if ( pItem )
+ {
+ ULONG nHelpId = pItem->maItem.GetHelpId();
+ if ( nHelpId )
+ {
+ // Wenn eine Hilfe existiert, dann ausloesen
+ Help* pHelp = Application::GetHelp();
+ if ( pHelp )
+ pHelp->Start( nHelpId );
+ return;
+ }
+ }
+ }
+ }
+
+ StatusBar::RequestHelp( rHEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::UserDraw( const UserDrawEvent& rUDEvt )
+{
+ if ( rUDEvt.GetItemId() == TASKSTATUSBAR_STATUSFIELDID )
+ {
+ OutputDevice* pDev = rUDEvt.GetDevice();
+ Rectangle aRect = rUDEvt.GetRect();
+
+ if ( mpFieldItemList )
+ {
+ ImplTaskSBFldItem* pItem = mpFieldItemList->First();
+ while ( pItem )
+ {
+ if ( !mbOutInterval || !(pItem->maItem.GetFlags() & TASKSTATUSFIELDITEM_FLASH) )
+ {
+ const Image& rImage = pItem->maItem.GetImage();
+ Size aImgSize = rImage.GetSizePixel();
+ pDev->DrawImage( Point( aRect.Left()+pItem->mnOffX,
+ aRect.Top()+((aRect.GetHeight()-aImgSize.Width())/2) ),
+ rImage );
+ }
+
+ pItem = mpFieldItemList->Next();
+ }
+ }
+
+ if ( mnFieldFlags & TASKSTATUSFIELD_CLOCK )
+ {
+ long nX = mnItemWidth+TASKSTATUSBAR_CLOCXOFFX;
+ Point aPos = GetItemTextPos( TASKSTATUSBAR_STATUSFIELDID );
+ aPos.X() = aRect.Left()+nX;
+ pDev->DrawText( aPos, maTimeText );
+ }
+ }
+ else
+ StatusBar::UserDraw( rUDEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::InsertStatusField( long nOffset, USHORT nPos,
+ USHORT nFlags )
+{
+ mnFieldFlags = nFlags;
+ ImplUpdateField( FALSE );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::SetFieldFlags( USHORT nFlags )
+{
+ if ( mnFieldFlags != nFlags )
+ {
+ mnFieldFlags = nFlags;
+ ImplUpdateField( FALSE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::AddStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem,
+ USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "TaskStatusBar::AddStatusFieldItem() - Item is 0" );
+ DBG_ASSERT( !ImplGetFieldItem( nItemId ), "TaskStatusBar::AddStatusFieldItem() - Item-Id already exist" );
+
+ if ( !mpFieldItemList )
+ mpFieldItemList = new ImplTaskSBItemList;
+
+ ImplTaskSBFldItem* pItem = new ImplTaskSBFldItem;
+ pItem->maItem = rItem;
+ pItem->mnId = nItemId;
+ pItem->mnOffX = 0;
+ mpFieldItemList->Insert( pItem, (ULONG)nPos );
+
+ ImplUpdateField( TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::ModifyStatusFieldItem( USHORT nItemId, const TaskStatusFieldItem& rItem )
+{
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
+ if ( pItem )
+ {
+ BOOL bUpdate = (pItem->maItem.GetImage() != rItem.GetImage()) ||
+ (pItem->maItem.GetFlags() != rItem.GetFlags());
+ pItem->maItem = rItem;
+ if ( bUpdate )
+ ImplUpdateField( TRUE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TaskStatusBar::RemoveStatusFieldItem( USHORT nItemId )
+{
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
+ if ( pItem )
+ {
+ mpFieldItemList->Remove( pItem );
+ delete pItem;
+ ImplUpdateField( TRUE );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+BOOL TaskStatusBar::GetStatusFieldItem( USHORT nItemId, TaskStatusFieldItem& rItem ) const
+{
+ ImplTaskSBFldItem* pItem = ImplGetFieldItem( nItemId );
+ if ( pItem )
+ {
+ rItem = pItem->maItem;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
diff --git a/svtools/source/control/valueset.cxx b/svtools/source/control/valueset.cxx
new file mode 100644
index 000000000000..79f0acb6a098
--- /dev/null
+++ b/svtools/source/control/valueset.cxx
@@ -0,0 +1,2461 @@
+/*************************************************************************
+ *
+ * $RCSfile: valueset.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _LIST_HXX
+#include <tools/list.hxx>
+#endif
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifdef VCL
+#ifndef _SV_DECOVIEW_HXX
+#include <vcl/decoview.hxx>
+#endif
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _IMAGE_HXX
+#include <vcl/image.hxx>
+#endif
+#ifndef _SCRBAR_HXX
+#include <vcl/scrbar.hxx>
+#endif
+#ifndef _HELP_HXX
+#include <vcl/help.hxx>
+#endif
+
+#define _SV_VALUESET_CXX
+#define private public
+#include <valueset.hxx>
+
+// =======================================================================
+
+#define ITEM_OFFSET 4
+#define ITEM_OFFSET_DOUBLE 6
+#define NAME_OFFSET 2
+#define NAME_OFFSET_FLAT 1
+#define SCRBAR_OFFSET 2
+#define VALUESET_ITEM_NONEITEM 0xFFFE
+
+#define VALUESET_SCROLL_OFFSET 4
+
+enum ValueSetItemType { VALUESETITEM_NONE, VALUESETITEM_IMAGE,
+ VALUESETITEM_COLOR, VALUESETITEM_USERDRAW,
+ VALUESETITEM_SPACE };
+
+struct ValueSetItem
+{
+ USHORT mnId;
+ USHORT mnBits;
+ ValueSetItemType meType;
+ Image maImage;
+ Color maColor;
+ XubString maText;
+ void* mpData;
+ Rectangle maRect;
+
+ ValueSetItem();
+ ~ValueSetItem();
+};
+
+DECLARE_LIST( ValueItemList, ValueSetItem* );
+
+// =======================================================================
+
+ValueSetItem::ValueSetItem()
+{
+ mnBits = 0;
+ mpData = NULL;
+}
+
+// -----------------------------------------------------------------------
+
+ValueSetItem::~ValueSetItem()
+{
+}
+
+// =======================================================================
+
+void ValueSet::ImplInit( WinBits nWinStyle )
+{
+ Size aWinSize = GetSizePixel();
+ mpItemList = new ValueItemList;
+ mpNoneItem = NULL;
+ mpScrBar = NULL;
+ mnTextOffset = 0;
+ mnVisLines = 0;
+ mnLines = 0;
+ mnUserItemWidth = 0;
+ mnUserItemHeight = 0;
+ mnFirstLine = 0;
+ mnOldItemId = 0;
+ mnSelItemId = 0;
+ mnHighItemId = 0;
+ mnDropPos = VALUESET_ITEM_NOTFOUND;
+ mnCols = 0;
+ mnCurCol = 0;
+ mnUserCols = 0;
+ mnUserVisLines = 0;
+ mnSpacing = 0;
+ mnFrameStyle = 0;
+ mbFormat = TRUE;
+ mbHighlight = FALSE;
+ mbSelection = FALSE;
+ mbNoSelection = TRUE;
+ mbDrawSelection = TRUE;
+ mbBlackSel = FALSE;
+ mbDoubleSel = FALSE;
+ mbScroll = FALSE;
+ mbDropPos = FALSE;
+
+ ImplInitSettings( TRUE, TRUE, TRUE );
+}
+
+// -----------------------------------------------------------------------
+
+ValueSet::ValueSet( Window* pParent, WinBits nWinStyle ) :
+ Control( pParent, nWinStyle ),
+ maVirDev( *this ),
+ maColor( COL_TRANSPARENT )
+{
+ ImplInit( nWinStyle );
+}
+
+// -----------------------------------------------------------------------
+
+ValueSet::ValueSet( Window* pParent, const ResId& rResId ) :
+ Control( pParent, rResId ),
+ maVirDev( *this ),
+ maColor( COL_TRANSPARENT )
+{
+ ImplInit( rResId.aWinBits );
+}
+
+// -----------------------------------------------------------------------
+
+ValueSet::~ValueSet()
+{
+ if ( mpScrBar )
+ delete mpScrBar;
+
+ if ( mpNoneItem )
+ delete mpNoneItem;
+
+ ValueSetItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
+ }
+ delete mpItemList;
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplInitSettings( BOOL bFont,
+ BOOL bForeground, BOOL bBackground )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ if ( bFont )
+ {
+ Font aFont;
+ aFont = rStyleSettings.GetAppFont();
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ SetZoomedPointFont( aFont );
+ }
+
+ if ( bForeground || bFont )
+ {
+ Color aColor;
+ if ( IsControlForeground() )
+ aColor = GetControlForeground();
+ else
+ aColor = rStyleSettings.GetButtonTextColor();
+ SetTextColor( aColor );
+ SetTextFillColor();
+ }
+
+ if ( bBackground )
+ {
+ Color aColor;
+ if ( IsControlBackground() )
+ aColor = GetControlBackground();
+ else if ( GetStyle() & WB_FLATVALUESET )
+ aColor = rStyleSettings.GetWindowColor();
+ else
+ aColor = rStyleSettings.GetFaceColor();
+ SetBackground( aColor );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplInitScrollBar()
+{
+ if ( GetStyle() & WB_VSCROLL )
+ {
+ if ( !mpScrBar )
+ {
+ mpScrBar = new ScrollBar( this, WB_VSCROLL | WB_DRAG );
+ mpScrBar->SetScrollHdl( LINK( this, ValueSet, ImplScrollHdl ) );
+ }
+ else
+ {
+ // Wegen Einstellungsaenderungen passen wir hier die Breite an
+ long nScrBarWidth = GetSettings().GetStyleSettings().GetScrollBarSize();
+ mpScrBar->SetPosSizePixel( 0, 0, nScrBarWidth, 0, WINDOW_POSSIZE_WIDTH );
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplFormatItem( ValueSetItem* pItem )
+{
+ if ( pItem->meType == VALUESETITEM_SPACE )
+ return;
+
+ Rectangle aRect = pItem->maRect;
+ WinBits nStyle = GetStyle();
+ if ( nStyle & WB_ITEMBORDER )
+ {
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ if ( nStyle & WB_FLATVALUESET )
+ {
+ if ( nStyle & WB_DOUBLEBORDER )
+ {
+ aRect.Left() += 2;
+ aRect.Top() += 2;
+ aRect.Right() -= 2;
+ aRect.Bottom() -= 2;
+ }
+ else
+ {
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ }
+ }
+ else
+ {
+ DecorationView aView( &maVirDev );
+ aRect = aView.DrawFrame( aRect, mnFrameStyle );
+ }
+ }
+
+ if ( pItem == mpNoneItem )
+ pItem->maText = GetText();
+
+ if ( (aRect.GetHeight() > 0) && (aRect.GetWidth() > 0) )
+ {
+ if ( pItem == mpNoneItem )
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ maVirDev.SetFont( GetFont() );
+ maVirDev.SetTextColor( rStyleSettings.GetWindowTextColor() );
+ maVirDev.SetTextFillColor();
+ maVirDev.SetFillColor( rStyleSettings.GetWindowColor() );
+ maVirDev.DrawRect( aRect );
+ Point aTxtPos( aRect.Left()+2, aRect.Top() );
+ long nTxtWidth = GetTextWidth( pItem->maText );
+ if ( nStyle & WB_RADIOSEL )
+ {
+ aTxtPos.X() += 4;
+ aTxtPos.Y() += 4;
+ }
+ if ( (aTxtPos.X()+nTxtWidth) > aRect.Right() )
+ {
+ maVirDev.SetClipRegion( Region( aRect ) );
+ maVirDev.DrawText( aTxtPos, pItem->maText );
+ maVirDev.SetClipRegion();
+ }
+ else
+ maVirDev.DrawText( aTxtPos, pItem->maText );
+ }
+ else if ( pItem->meType == VALUESETITEM_COLOR )
+ {
+ maVirDev.SetFillColor( pItem->maColor );
+ maVirDev.DrawRect( aRect );
+ }
+ else
+ {
+ if ( IsColor() )
+ maVirDev.SetFillColor( maColor );
+ else
+ maVirDev.SetFillColor( GetSettings().GetStyleSettings().GetWindowColor() );
+ maVirDev.DrawRect( aRect );
+
+ if ( pItem->meType == VALUESETITEM_USERDRAW )
+ {
+ UserDrawEvent aUDEvt( &maVirDev, aRect, pItem->mnId );
+ UserDraw( aUDEvt );
+ }
+ else
+ {
+ Size aImageSize = pItem->maImage.GetSizePixel();
+ Size aRectSize = aRect.GetSize();
+ Point aPos( aRect.Left(), aRect.Top() );
+ aPos.X() += (aRectSize.Width()-aImageSize.Width())/2;
+ aPos.Y() += (aRectSize.Height()-aImageSize.Height())/2;
+ if ( (aImageSize.Width() > aRectSize.Width()) ||
+ (aImageSize.Height() > aRectSize.Height()) )
+ {
+ maVirDev.SetClipRegion( Region( aRect ) );
+ maVirDev.DrawImage( aPos, pItem->maImage );
+ maVirDev.SetClipRegion();
+ }
+ else
+ maVirDev.DrawImage( aPos, pItem->maImage );
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::Format()
+{
+ Size aWinSize = GetOutputSizePixel();
+ Size aOrgWinSize = aWinSize;
+ ULONG nItemCount = mpItemList->Count();
+ WinBits nStyle = GetStyle();
+ long nTxtHeight = GetTextHeight();
+ long nStartX;
+ long nY;
+ long nNameOff;
+ long nOff;
+ long nSpace;
+ long nNoneSpace;
+ ScrollBar* pDelScrBar = NULL;
+
+ // Scrolling beruecksichtigen
+ if ( nStyle & WB_VSCROLL )
+ ImplInitScrollBar();
+ else
+ {
+ if ( mpScrBar )
+ {
+ // ScrollBar erst spaeter zerstoeren, damit keine rekursiven
+ // Aufrufe entstehen koennen
+ pDelScrBar = mpScrBar;
+ mpScrBar = NULL;
+ }
+ }
+
+ // Item-Offset berechnen
+ if ( nStyle & WB_ITEMBORDER )
+ {
+ if ( nStyle & WB_DOUBLEBORDER )
+ nOff = ITEM_OFFSET_DOUBLE;
+ else
+ nOff = ITEM_OFFSET;
+ }
+ else
+ nOff = 0;
+ nSpace = mnSpacing;
+
+ // Groesse beruecksichtigen, wenn NameField vorhanden
+ if ( nStyle & WB_NAMEFIELD )
+ {
+ long nNameOffset = (nStyle & WB_FLATVALUESET) ? NAME_OFFSET_FLAT : NAME_OFFSET;
+ aWinSize.Height() -= nTxtHeight+(nNameOffset*2);
+ nNameOff = nNameOffset+2+nSpace;
+ }
+ else
+ nNameOff = 0;
+
+ // Offset und Groesse beruecksichtigen, wenn NoneField vorhanden
+ if ( nStyle & WB_NONEFIELD )
+ {
+ nY = nTxtHeight+nOff;
+ nNoneSpace = nSpace;
+ if ( nStyle & WB_RADIOSEL )
+ nY += 8;
+ }
+ else
+ {
+ nY = 0;
+ nNoneSpace = 0;
+ }
+
+ // Breite vom ScrollBar berechnen
+ long nScrBarWidth = 0;
+ if ( mpScrBar )
+ nScrBarWidth = mpScrBar->GetSizePixel().Width()+SCRBAR_OFFSET;
+
+ // Spaltenanzahl berechnen
+ if ( !mnUserCols )
+ {
+ if ( mnUserItemWidth )
+ {
+ mnCols = (USHORT)((aWinSize.Width()-nScrBarWidth+nSpace) / (mnUserItemWidth+nSpace));
+ if ( !mnCols )
+ mnCols = 1;
+ }
+ else
+ mnCols = 1;
+ }
+ else
+ mnCols = mnUserCols;
+
+ // Zeilenanzahl berechnen
+ mbScroll = FALSE;
+ mnLines = (long)mpItemList->Count() / mnCols;
+ if ( mpItemList->Count() % mnCols )
+ mnLines++;
+ else if ( !mnLines )
+ mnLines = 1;
+
+ long nCalcHeight = aWinSize.Height()-nY-nNameOff;
+ if ( mnUserVisLines )
+ mnVisLines = mnUserVisLines;
+ else if ( mnUserItemHeight )
+ {
+ mnVisLines = (nCalcHeight-nNoneSpace+nSpace) / (mnUserItemHeight+nSpace);
+ if ( !mnVisLines )
+ mnVisLines = 1;
+ }
+ else
+ mnVisLines = mnLines;
+ if ( mnLines > mnVisLines )
+ mbScroll = TRUE;
+ if ( mnLines <= mnVisLines )
+ mnFirstLine = 0;
+ else
+ {
+ if ( mnFirstLine > (USHORT)(mnLines-mnVisLines) )
+ mnFirstLine = (USHORT)(mnLines-mnVisLines);
+ }
+
+ // Itemgroessen berechnen
+ long nColSpace = (mnCols-1)*nSpace;
+ long nLineSpace = ((mnVisLines-1)*nSpace)+nNoneSpace;
+ long nItemWidth;
+ long nItemHeight;
+ if ( mnUserItemWidth && !mnUserCols )
+ {
+ nItemWidth = mnUserItemWidth;
+ if ( nItemWidth > aWinSize.Width()-nScrBarWidth-nColSpace )
+ nItemWidth = aWinSize.Width()-nScrBarWidth-nColSpace;
+ }
+ else
+ nItemWidth = (aWinSize.Width()-nScrBarWidth-nColSpace) / mnCols;
+ if ( mnUserItemHeight && !mnUserVisLines )
+ {
+ nItemHeight = mnUserItemHeight;
+ if ( nItemHeight > nCalcHeight-nNoneSpace )
+ nItemHeight = nCalcHeight-nNoneSpace;
+ }
+ else
+ {
+ nCalcHeight -= nLineSpace;
+ nItemHeight = nCalcHeight / mnVisLines;
+ }
+
+ // Windowgroessen runden und virtuelles Device anlegen
+ aWinSize.Width() = (nItemWidth*mnCols)+nColSpace+nScrBarWidth;
+ aWinSize.Height() = (nItemHeight*mnVisLines)+nY+nNameOff+nLineSpace;
+ nStartX = (aOrgWinSize.Width()-aWinSize.Width())/2;
+ maVirDev.SetSettings( GetSettings() );
+ maVirDev.SetBackground( GetBackground() );
+ maVirDev.SetOutputSizePixel( Size( aOrgWinSize.Width(),
+ aWinSize.Height() ), TRUE );
+
+ // Bei zu kleinen Items machen wir nichts
+ long nMinHeight = 2;
+ if ( nStyle & WB_ITEMBORDER )
+ nMinHeight = 4;
+ if ( (nItemWidth <= 0) || (nItemHeight <= nMinHeight) || !nItemCount )
+ {
+ for ( ULONG i = 0; i < nItemCount; i++ )
+ {
+ ValueSetItem* pItem = mpItemList->GetObject( i );
+ pItem->maRect.SetEmpty();
+ }
+
+ if ( nStyle & WB_NONEFIELD )
+ {
+ if ( mpNoneItem )
+ {
+ mpNoneItem->maRect.SetEmpty();
+ mpNoneItem->maText = GetText();
+ }
+ }
+ else
+ {
+ if ( mpNoneItem )
+ {
+ delete mpNoneItem;
+ mpNoneItem = NULL;
+ }
+ }
+
+ if ( mpScrBar )
+ mpScrBar->Hide();
+ }
+ else
+ {
+ // Frame-Style ermitteln
+ if ( nStyle & WB_DOUBLEBORDER )
+ mnFrameStyle = FRAME_DRAW_DOUBLEIN;
+ else
+ mnFrameStyle = FRAME_DRAW_IN;
+
+ // Selektionsfarben und -breiten ermitteln
+ // Gegebenenfalls die Farben anpassen, damit man die Selektion besser
+ // erkennen kann
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ Color aHighColor( rStyleSettings.GetHighlightColor() );
+ if ( ((aHighColor.GetRed() > 0x80) || (aHighColor.GetGreen() > 0x80) ||
+ (aHighColor.GetBlue() > 0x80)) ||
+ ((aHighColor.GetRed() == 0x80) && (aHighColor.GetGreen() == 0x80) &&
+ (aHighColor.GetBlue() == 0x80)) )
+ mbBlackSel = TRUE;
+ else
+ mbBlackSel = FALSE;
+
+ // Wenn die Items groesser sind, dann die Selektion doppelt so breit
+ // zeichnen
+ if ( (nStyle & WB_DOUBLEBORDER) &&
+ ((nItemWidth >= 25) && (nItemHeight >= 20)) )
+ mbDoubleSel = TRUE;
+ else
+ mbDoubleSel = FALSE;
+
+ // Trennlinie zum Namefield zeichnen
+ if ( nStyle & WB_NAMEFIELD )
+ {
+ if ( !(nStyle & WB_FLATVALUESET) )
+ {
+ Point aPos1( nStartX+ITEM_OFFSET, aWinSize.Height()-2 );
+ Point aPos2( nStartX+aWinSize.Width()-ITEM_OFFSET-1,
+ aWinSize.Height()-2 );
+ if ( !(rStyleSettings.GetOptions() & STYLE_OPTION_MONO) )
+ {
+ maVirDev.SetLineColor( rStyleSettings.GetShadowColor() );
+ maVirDev.DrawLine( aPos1, aPos2 );
+ aPos1.Y()++;
+ aPos2.Y()++;
+ maVirDev.SetLineColor( rStyleSettings.GetLightColor() );
+ }
+ else
+ maVirDev.SetLineColor( rStyleSettings.GetWindowTextColor() );
+ maVirDev.DrawLine( aPos1, aPos2 );
+ }
+
+ // TextOffset befindet sich unter der Kante
+ long nNameOffset = (nStyle & WB_FLATVALUESET) ? NAME_OFFSET_FLAT : NAME_OFFSET;
+ mnTextOffset = aWinSize.Height()+nNameOffset;
+ }
+
+ // Items berechnen und zeichnen
+ maVirDev.SetLineColor();
+ long x = nStartX;
+ long y = nY+nNoneSpace;
+ ULONG nFirstItem = mnFirstLine * mnCols;
+ ULONG nLastItem = nFirstItem + (mnVisLines * mnCols);
+ for ( ULONG i = 0; i < nItemCount; i++ )
+ {
+ ValueSetItem* pItem = mpItemList->GetObject( i );
+
+ if ( (i >= nFirstItem) && (i < nLastItem) )
+ {
+ pItem->maRect.Left() = x;
+ pItem->maRect.Top() = y;
+ pItem->maRect.Right() = pItem->maRect.Left()+nItemWidth-1;
+ pItem->maRect.Bottom() = pItem->maRect.Top()+nItemHeight-1;
+
+ ImplFormatItem( pItem );
+
+ if ( !((i+1) % mnCols) )
+ {
+ x = nStartX;
+ y += nItemHeight+nSpace;
+ }
+ else
+ x += nItemWidth+nSpace;
+ }
+ else
+ pItem->maRect.SetEmpty();
+ }
+
+ // NoSelection-Field erzeugen und anzeigen
+ if ( nStyle & WB_NONEFIELD )
+ {
+ if ( !mpNoneItem )
+ mpNoneItem = new ValueSetItem;
+
+ mpNoneItem->mnId = 0;
+ mpNoneItem->meType = VALUESETITEM_NONE;
+ mpNoneItem->maRect.Left() = nStartX;
+ mpNoneItem->maRect.Right() = mpNoneItem->maRect.Left()+aWinSize.Width()-1;
+ mpNoneItem->maRect.Bottom() = nY-1;
+
+ ImplFormatItem( mpNoneItem );
+ }
+ else
+ {
+ if ( mpNoneItem )
+ {
+ delete mpNoneItem;
+ mpNoneItem = NULL;
+ }
+ }
+
+ // ScrollBar anordnen, Werte setzen und anzeigen
+ if ( mpScrBar )
+ {
+ Point aPos( nStartX+(nItemWidth*mnCols)+nColSpace+SCRBAR_OFFSET,
+ nY+nNoneSpace+1 );
+ Size aSize( nScrBarWidth-SCRBAR_OFFSET,
+ ((nItemHeight+nSpace)*mnVisLines)-2-nSpace );
+ mpScrBar->SetPosSizePixel( aPos, aSize );
+ mpScrBar->SetRangeMax( mnLines );
+ mpScrBar->SetVisibleSize( mnVisLines );
+ mpScrBar->SetThumbPos( (long)mnFirstLine );
+ long nPageSize = mnVisLines;
+ if ( nPageSize < 1 )
+ nPageSize = 1;
+ mpScrBar->SetPageSize( nPageSize );
+ mpScrBar->Show();
+ }
+ }
+
+ // Jetzt haben wir formatiert und warten auf das naechste
+ mbFormat = FALSE;
+
+ // ScrollBar loeschen
+ if ( pDelScrBar )
+ delete pDelScrBar;
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplDrawItemText( const XubString& rText )
+{
+ if ( !(GetStyle() & WB_NAMEFIELD) )
+ return;
+
+ Size aWinSize = GetOutputSizePixel();
+ long nTxtWidth = GetTextWidth( rText );
+
+ // Rechteck loeschen und Text ausgeben
+ if ( GetStyle() & WB_FLATVALUESET )
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ SetLineColor();
+ SetFillColor( rStyleSettings.GetFaceColor() );
+ DrawRect( Rectangle( Point( 0, mnTextOffset ), Point( aWinSize.Width(), aWinSize.Height() ) ) );
+ SetTextColor( rStyleSettings.GetButtonTextColor() );
+ }
+ else
+ Erase( Rectangle( Point( 0, mnTextOffset ), Point( aWinSize.Width(), aWinSize.Height() ) ) );
+ DrawText( Point( (aWinSize.Width()-nTxtWidth) / 2, mnTextOffset ), rText );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplDrawSelect()
+{
+ if ( !IsReallyVisible() )
+ return;
+
+ BOOL bFocus = HasFocus();
+ BOOL bDrawSel;
+
+ if ( (mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight) )
+ bDrawSel = FALSE;
+ else
+ bDrawSel = TRUE;
+
+ if ( !bFocus &&
+ ((mbNoSelection && !mbHighlight) || (!mbDrawSelection && mbHighlight)) )
+ {
+ XubString aEmptyStr;
+ ImplDrawItemText( aEmptyStr );
+ return;
+ }
+
+ USHORT nItemId = mnSelItemId;
+
+ if ( mbHighlight )
+ nItemId = mnHighItemId;
+
+ ValueSetItem* pItem;
+ if ( nItemId )
+ pItem = mpItemList->GetObject( GetItemPos( nItemId ) );
+ else
+ {
+ if ( mpNoneItem )
+ pItem = mpNoneItem;
+ else
+ {
+ pItem = ImplGetFirstItem();
+ if ( !bFocus || !pItem )
+ return;
+ }
+ }
+
+ if ( pItem->maRect.IsEmpty() )
+ return;
+
+ // Selection malen
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ Rectangle aRect = pItem->maRect;
+ Control::SetFillColor();
+
+ // Selectionsausgabe festlegen
+ WinBits nStyle = GetStyle();
+ if ( nStyle & WB_RADIOSEL )
+ {
+ aRect.Left() += 3;
+ aRect.Top() += 3;
+ aRect.Right() -= 3;
+ aRect.Bottom() -= 3;
+ if ( nStyle & WB_DOUBLEBORDER )
+ {
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ }
+
+ if ( bFocus )
+ ShowFocus( aRect );
+
+ if ( bDrawSel )
+ {
+ SetLineColor( rStyleSettings.GetHighlightColor() );
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ DrawRect( aRect );
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ DrawRect( aRect );
+ }
+ }
+ else
+ {
+ if ( bDrawSel )
+ {
+ if ( mbBlackSel )
+ SetLineColor( Color( COL_BLACK ) );
+ else
+ SetLineColor( rStyleSettings.GetHighlightColor() );
+ DrawRect( aRect );
+ }
+ if ( mbDoubleSel )
+ {
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ if ( bDrawSel )
+ DrawRect( aRect );
+ }
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ Rectangle aRect2 = aRect;
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ if ( bDrawSel )
+ DrawRect( aRect );
+ if ( mbDoubleSel )
+ {
+ aRect.Left()++;
+ aRect.Top()++;
+ aRect.Right()--;
+ aRect.Bottom()--;
+ if ( bDrawSel )
+ DrawRect( aRect );
+ }
+
+ if ( bDrawSel )
+ {
+ if ( mbBlackSel )
+ SetLineColor( Color( COL_WHITE ) );
+ else
+ SetLineColor( rStyleSettings.GetHighlightTextColor() );
+ }
+ else
+ SetLineColor( Color( COL_LIGHTGRAY ) );
+ DrawRect( aRect2 );
+
+ if ( bFocus )
+ ShowFocus( aRect2 );
+ }
+
+ ImplDrawItemText( pItem->maText );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplHideSelect( USHORT nItemId )
+{
+ Rectangle aRect;
+
+ if ( nItemId )
+ aRect = mpItemList->GetObject( GetItemPos( nItemId ) )->maRect;
+ else
+ {
+ if ( mpNoneItem )
+ aRect = mpNoneItem->maRect;
+ }
+
+ if ( !aRect.IsEmpty() )
+ {
+ HideFocus();
+ Point aPos = aRect.TopLeft();
+ Size aSize = aRect.GetSize();
+ DrawOutDev( aPos, aSize, aPos, aSize, maVirDev );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplHighlightItem( USHORT nItemId, BOOL bIsSelection )
+{
+ if ( mnHighItemId != nItemId )
+ {
+ // Alten merken, um vorherige Selektion zu entfernen
+ USHORT nOldItem = mnHighItemId;
+ mnHighItemId = nItemId;
+
+ // Wenn keiner selektiert ist, dann Selektion nicht malen
+ if ( !bIsSelection && mbNoSelection )
+ mbDrawSelection = FALSE;
+
+ // Neu ausgeben und alte Selection wegnehmen
+ ImplHideSelect( nOldItem );
+ ImplDrawSelect();
+ mbDrawSelection = TRUE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplDrawDropPos( BOOL bShow )
+{
+ if ( (mnDropPos != VALUESET_ITEM_NOTFOUND) && mpItemList->Count() )
+ {
+ USHORT nItemPos = mnDropPos;
+ USHORT nItemId1;
+ USHORT nItemId2 = 0;
+ BOOL bRight;
+ if ( nItemPos >= mpItemList->Count() )
+ {
+ nItemPos = (USHORT)(mpItemList->Count()-1);
+ bRight = TRUE;
+ }
+ else
+ bRight = FALSE;
+
+ nItemId1 = GetItemId( nItemPos );
+ if ( (nItemId1 != mnSelItemId) && (nItemId1 != mnHighItemId) )
+ nItemId1 = 0;
+ Rectangle aRect2 = mpItemList->GetObject( nItemPos )->maRect;
+ Rectangle aRect1;
+ if ( bRight )
+ {
+ aRect1 = aRect2;
+ aRect2.SetEmpty();
+ }
+ else if ( nItemPos > 0 )
+ {
+ aRect1 = mpItemList->GetObject( nItemPos-1 )->maRect;
+ nItemId2 = GetItemId( nItemPos-1 );
+ if ( (nItemId2 != mnSelItemId) && (nItemId2 != mnHighItemId) )
+ nItemId2 = 0;
+ }
+
+ // Items ueberhaupt sichtbar (nur Erstes/Letztes)
+ if ( !aRect1.IsEmpty() || !aRect2.IsEmpty() )
+ {
+ if ( nItemId1 )
+ ImplHideSelect( nItemId1 );
+ if ( nItemId2 )
+ ImplHideSelect( nItemId2 );
+
+ if ( bShow )
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ long nX;
+ long nY;
+ SetLineColor( rStyleSettings.GetButtonTextColor() );
+ if ( !aRect1.IsEmpty() )
+ {
+ Point aPos = aRect1.RightCenter();
+ nX = aPos.X()-2;
+ nY = aPos.Y();
+ for ( USHORT i = 0; i < 4; i++ )
+ DrawLine( Point( nX-i, nY-i ), Point( nX-i, nY+i ) );
+ }
+ if ( !aRect2.IsEmpty() )
+ {
+ Point aPos = aRect2.LeftCenter();
+ nX = aPos.X()+2;
+ nY = aPos.Y();
+ for ( USHORT i = 0; i < 4; i++ )
+ DrawLine( Point( nX+i, nY-i ), Point( nX+i, nY+i ) );
+ }
+ }
+ else
+ {
+ if ( !aRect1.IsEmpty() )
+ {
+ Point aPos = aRect1.TopLeft();
+ Size aSize = aRect1.GetSize();
+ DrawOutDev( aPos, aSize, aPos, aSize, maVirDev );
+ }
+ if ( !aRect2.IsEmpty() )
+ {
+ Point aPos = aRect2.TopLeft();
+ Size aSize = aRect2.GetSize();
+ DrawOutDev( aPos, aSize, aPos, aSize, maVirDev );
+ }
+ }
+
+ if ( nItemId1 || nItemId2 )
+ ImplDrawSelect();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplDraw()
+{
+ if ( mbFormat )
+ Format();
+
+ HideFocus();
+
+ Point aDefPos;
+ Size aSize = maVirDev.GetOutputSizePixel();
+
+ if ( mpScrBar )
+ {
+ Point aScrPos = mpScrBar->GetPosPixel();
+ Size aScrSize = mpScrBar->GetSizePixel();
+ Point aTempPos( 0, aScrPos.Y() );
+ Size aTempSize( aSize.Width(), aScrPos.Y() );
+
+ DrawOutDev( aDefPos, aTempSize, aDefPos, aTempSize, maVirDev );
+ aTempSize.Width() = aScrPos.X()-1;
+ aTempSize.Height() = aScrSize.Height();
+ DrawOutDev( aTempPos, aTempSize, aTempPos, aTempSize, maVirDev );
+ aTempPos.Y() = aScrPos.Y()+aScrSize.Height();
+ aTempSize.Width() = aSize.Width();
+ aTempSize.Height() = aSize.Height()-aTempPos.Y();
+ DrawOutDev( aTempPos, aTempSize, aTempPos, aTempSize, maVirDev );
+ }
+ else
+ DrawOutDev( aDefPos, aSize, aDefPos, aSize, maVirDev );
+
+ ImplDrawSelect();
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ValueSet::ImplScroll( const Point& rPos )
+{
+ Size aOutSize = GetOutputSizePixel();
+ long nScrBarWidth;
+
+ if ( mpScrBar )
+ nScrBarWidth = mpScrBar->GetSizePixel().Width();
+ else
+ nScrBarWidth = 0;
+
+ if ( !mbScroll || (rPos.X() < 0) || (rPos.X() > aOutSize.Width()-nScrBarWidth) )
+ return FALSE;
+
+ long nScrollOffset;
+ USHORT nOldLine = mnFirstLine;
+ const Rectangle& rTopRect = mpItemList->GetObject( mnFirstLine*mnCols )->maRect;
+ if ( rTopRect.GetHeight() <= 16 )
+ nScrollOffset = VALUESET_SCROLL_OFFSET/2;
+ else
+ nScrollOffset = VALUESET_SCROLL_OFFSET;
+ if ( (mnFirstLine > 0) && (rPos.Y() >= 0) )
+ {
+ long nTopPos = rTopRect.Top();
+ if ( (rPos.Y() >= nTopPos) && (rPos.Y() <= nTopPos+nScrollOffset) )
+ mnFirstLine--;
+ }
+ if ( (mnFirstLine == nOldLine) &&
+ (mnFirstLine < (USHORT)(mnLines-mnVisLines)) && (rPos.Y() < aOutSize.Height()) )
+ {
+ long nBottomPos = mpItemList->GetObject( (mnFirstLine+mnVisLines-1)*mnCols )->maRect.Bottom();
+ if ( (rPos.Y() >= nBottomPos-nScrollOffset) && (rPos.Y() <= nBottomPos) )
+ mnFirstLine++;
+ }
+
+ if ( mnFirstLine != nOldLine )
+ {
+ mbFormat = TRUE;
+ ImplDraw();
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ValueSet::ImplGetItem( const Point& rPos, BOOL bMove )
+{
+ if ( mpNoneItem )
+ {
+ if ( mpNoneItem->maRect.IsInside( rPos ) )
+ return VALUESET_ITEM_NONEITEM;
+ }
+
+ ULONG nItemCount = mpItemList->Count();
+ for ( ULONG i = 0; i < nItemCount; i++ )
+ {
+ ValueSetItem* pItem = mpItemList->GetObject( i );
+ if ( pItem->maRect.IsInside( rPos ) )
+ return (USHORT)i;
+ }
+
+ // Wenn Spacing gesetzt ist, wird der vorher selektierte
+ // Eintrag zurueckgegeben, wenn die Maus noch nicht das Fenster
+ // verlassen hat
+ if ( bMove && mnSpacing && mnHighItemId )
+ {
+ Point aDefPos;
+ Rectangle aWinRect( aDefPos, maVirDev.GetOutputSizePixel() );
+ if ( aWinRect.IsInside( rPos ) )
+ return GetItemPos( mnHighItemId );
+ }
+
+ return VALUESET_ITEM_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+ValueSetItem* ValueSet::ImplGetItem( USHORT nPos )
+{
+ if ( nPos == VALUESET_ITEM_NONEITEM )
+ return mpNoneItem;
+ else
+ return mpItemList->GetObject( nPos );
+}
+
+// -----------------------------------------------------------------------
+
+ValueSetItem* ValueSet::ImplGetFirstItem()
+{
+ USHORT nItemCount = (USHORT)mpItemList->Count();
+ USHORT i = 0;
+
+ while ( i < nItemCount )
+ {
+ ValueSetItem* pItem = mpItemList->GetObject( i );
+ if ( pItem->meType != VALUESETITEM_SPACE )
+ return pItem;
+ i++;
+ }
+
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( ValueSet,ImplScrollHdl, ScrollBar*, pScrollBar )
+{
+ USHORT nNewFirstLine = (USHORT)pScrollBar->GetThumbPos();
+ if ( nNewFirstLine != mnFirstLine )
+ {
+ mnFirstLine = nNewFirstLine;
+ mbFormat = TRUE;
+ ImplDraw();
+ }
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( ValueSet,ImplTimerHdl, Timer*, pTimer )
+{
+ ImplTracking( GetPointerPosPixel(), TRUE );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplTracking( const Point& rPos, BOOL bRepeat )
+{
+ if ( bRepeat || mbSelection )
+ {
+ if ( ImplScroll( rPos ) )
+ {
+ if ( mbSelection )
+ {
+ maTimer.SetTimeoutHdl( LINK( this, ValueSet, ImplTimerHdl ) );
+ maTimer.SetTimeout( GetSettings().GetMouseSettings().GetScrollRepeat() );
+ maTimer.Start();
+ }
+ }
+ }
+
+ ValueSetItem* pItem = ImplGetItem( ImplGetItem( rPos ) );
+ if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
+ ImplHighlightItem( pItem->mnId );
+ else
+ ImplHighlightItem( mnSelItemId, FALSE );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::ImplEndTracking( const Point& rPos, BOOL bCancel )
+{
+ ValueSetItem* pItem;
+
+ // Bei Abbruch, den alten Status wieder herstellen
+ if ( bCancel )
+ pItem = NULL;
+ else
+ pItem = ImplGetItem( ImplGetItem( rPos ) );
+
+ if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
+ {
+ SelectItem( pItem->mnId );
+ if ( !mbSelection && !(GetStyle() & WB_NOPOINTERFOCUS) )
+ GrabFocus();
+ mbHighlight = FALSE;
+ mbSelection = FALSE;
+ Select();
+ }
+ else
+ {
+ ImplHighlightItem( mnSelItemId, FALSE );
+ mbHighlight = FALSE;
+ mbSelection = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if ( rMEvt.IsLeft() )
+ {
+ ValueSetItem* pItem = ImplGetItem( ImplGetItem( rMEvt.GetPosPixel() ) );
+ if ( mbSelection )
+ {
+ mbHighlight = TRUE;
+ if ( pItem && (pItem->meType != VALUESETITEM_SPACE) )
+ {
+ mnOldItemId = mnSelItemId;
+ mnHighItemId = mnSelItemId;
+ ImplHighlightItem( pItem->mnId );
+ }
+
+ return;
+ }
+ else
+ {
+ if ( pItem && (pItem->meType != VALUESETITEM_SPACE) && !rMEvt.IsMod2() )
+ {
+ if ( (pItem->mnBits & VIB_NODOUBLECLICK) || (rMEvt.GetClicks() == 1) )
+ {
+ mnOldItemId = mnSelItemId;
+ mbHighlight = TRUE;
+ mnHighItemId = mnSelItemId;
+ ImplHighlightItem( pItem->mnId );
+ StartTracking( STARTTRACK_SCROLLREPEAT );
+ }
+ else if ( rMEvt.GetClicks() == 2 )
+ DoubleClick();
+
+ return;
+ }
+ }
+ }
+
+ Control::MouseButtonDown( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ // Wegen SelectionMode
+ if ( rMEvt.IsLeft() && mbSelection )
+ ImplEndTracking( rMEvt.GetPosPixel(), FALSE );
+ else
+ Control::MouseButtonUp( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::MouseMove( const MouseEvent& rMEvt )
+{
+ // Wegen SelectionMode
+ if ( mbSelection )
+ ImplTracking( rMEvt.GetPosPixel(), FALSE );
+ Control::MouseMove( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::Tracking( const TrackingEvent& rTEvt )
+{
+ Point aMousePos = rTEvt.GetMouseEvent().GetPosPixel();
+
+ if ( rTEvt.IsTrackingEnded() )
+ ImplEndTracking( aMousePos, rTEvt.IsTrackingCanceled() );
+ else
+ ImplTracking( aMousePos, rTEvt.IsTrackingRepeat() );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::KeyInput( const KeyEvent& rKEvt )
+{
+ USHORT nLastItem = (USHORT)mpItemList->Count();
+ USHORT nItemPos = VALUESET_ITEM_NOTFOUND;
+ USHORT nCurPos;
+ USHORT nCalcPos;
+
+ if ( !nLastItem || !ImplGetFirstItem() )
+ {
+ Control::KeyInput( rKEvt );
+ return;
+ }
+ else
+ nLastItem--;
+
+ if ( mnSelItemId )
+ nCurPos = GetItemPos( mnSelItemId );
+ else
+ nCurPos = VALUESET_ITEM_NONEITEM;
+ nCalcPos = nCurPos;
+
+ switch ( rKEvt.GetKeyCode().GetCode() )
+ {
+ case KEY_HOME:
+ if ( mpNoneItem )
+ nItemPos = VALUESET_ITEM_NONEITEM;
+ else
+ {
+ nItemPos = 0;
+ while ( ImplGetItem( nItemPos )->meType == VALUESETITEM_SPACE )
+ nItemPos++;
+ }
+ break;
+
+ case KEY_END:
+ nItemPos = nLastItem;
+ while ( ImplGetItem( nItemPos )->meType == VALUESETITEM_SPACE )
+ {
+ if ( nItemPos == 0 )
+ nItemPos = VALUESET_ITEM_NONEITEM;
+ else
+ nItemPos--;
+ }
+ break;
+
+ case KEY_LEFT:
+ do
+ {
+ if ( nCalcPos == VALUESET_ITEM_NONEITEM )
+ nItemPos = nLastItem;
+ else if ( !nCalcPos )
+ {
+ if ( mpNoneItem )
+ nItemPos = VALUESET_ITEM_NONEITEM;
+ else
+ nItemPos = nLastItem;
+ }
+ else
+ nItemPos = nCalcPos-1;
+ nCalcPos = nItemPos;
+ }
+ while ( ImplGetItem( nItemPos )->meType == VALUESETITEM_SPACE );
+ break;
+
+ case KEY_RIGHT:
+ do
+ {
+ if ( nCalcPos == VALUESET_ITEM_NONEITEM )
+ nItemPos = 0;
+ else if ( nCalcPos == nLastItem )
+ {
+ if ( mpNoneItem )
+ nItemPos = VALUESET_ITEM_NONEITEM;
+ else
+ nItemPos = 0;
+ }
+ else
+ nItemPos = nCalcPos+1;
+ nCalcPos = nItemPos;
+ }
+ while ( ImplGetItem( nItemPos )->meType == VALUESETITEM_SPACE );
+ break;
+
+ case KEY_UP:
+ do
+ {
+ if ( nCalcPos == VALUESET_ITEM_NONEITEM )
+ {
+ if ( nLastItem+1 <= mnCols )
+ nItemPos = mnCurCol;
+ else
+ {
+ nItemPos = ((((nLastItem+1)/mnCols)-1)*mnCols)+mnCurCol;
+ if ( nItemPos+mnCols <= nLastItem )
+ nItemPos += mnCols;
+ }
+ }
+ else if ( nCalcPos >= mnCols )
+ nItemPos = nCalcPos-mnCols;
+ else
+ {
+ if ( mpNoneItem )
+ {
+ mnCurCol = nCalcPos%mnCols;
+ nItemPos = VALUESET_ITEM_NONEITEM;
+ }
+ else
+ {
+ if ( nLastItem+1 <= mnCols )
+ nItemPos = nCalcPos;
+ else
+ {
+ nItemPos = ((((nLastItem+1)/mnCols)-1)*mnCols)+nCalcPos;
+ if ( nItemPos+mnCols <= nLastItem )
+ nItemPos += mnCols;
+ }
+ }
+ }
+ nCalcPos = nItemPos;
+ }
+ while ( ImplGetItem( nItemPos )->meType == VALUESETITEM_SPACE );
+ break;
+
+ case KEY_DOWN:
+ do
+ {
+ if ( nCalcPos == VALUESET_ITEM_NONEITEM )
+ nItemPos = mnCurCol;
+ else if ( nCalcPos+mnCols <= nLastItem )
+ nItemPos = nCalcPos+mnCols;
+ else
+ {
+ if ( mpNoneItem )
+ {
+ mnCurCol = nCalcPos%mnCols;
+ nItemPos = VALUESET_ITEM_NONEITEM;
+ }
+ else
+ nItemPos = nCalcPos%mnCols;
+ }
+ nCalcPos = nItemPos;
+ }
+ while ( ImplGetItem( nItemPos )->meType == VALUESETITEM_SPACE );
+ break;
+
+ default:
+ Control::KeyInput( rKEvt );
+ break;
+ }
+
+ if ( nItemPos != VALUESET_ITEM_NOTFOUND )
+ {
+ USHORT nItemId;
+ if ( nItemPos != VALUESET_ITEM_NONEITEM )
+ nItemId = GetItemId( nItemPos );
+ else
+ nItemId = 0;
+ if ( nItemId != mnSelItemId )
+ {
+ SelectItem( nItemId );
+ Select();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::Command( const CommandEvent& rCEvt )
+{
+ if ( (rCEvt.GetCommand() == COMMAND_WHEEL) ||
+ (rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL) ||
+ (rCEvt.GetCommand() == COMMAND_AUTOSCROLL) )
+ {
+ if ( HandleScrollCommand( rCEvt, NULL, mpScrBar ) )
+ return;
+ }
+
+ Control::Command( rCEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::Paint( const Rectangle& rRect )
+{
+ if ( GetStyle() & WB_FLATVALUESET )
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ SetLineColor();
+ SetFillColor( rStyleSettings.GetFaceColor() );
+ long nOffY = maVirDev.GetOutputSizePixel().Height();
+ Size aWinSize = GetOutputSizePixel();
+ DrawRect( Rectangle( Point( 0, nOffY ), Point( aWinSize.Width(), aWinSize.Height() ) ) );
+ }
+
+ ImplDraw();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::GetFocus()
+{
+ ImplDrawSelect();
+ Control::GetFocus();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::LoseFocus()
+{
+ if ( mbNoSelection && mnSelItemId )
+ ImplHideSelect( mnSelItemId );
+ else
+ HideFocus();
+ Control::LoseFocus();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::Resize()
+{
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ Control::Resize();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::RequestHelp( const HelpEvent& rHEvt )
+{
+ if ( (rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON)) == HELPMODE_QUICK )
+ {
+ Point aPos = ScreenToOutputPixel( rHEvt.GetMousePosPixel() );
+ ULONG nItemCount = mpItemList->Count();
+ for ( ULONG i = 0; i < nItemCount; i++ )
+ {
+ ValueSetItem* pItem = mpItemList->GetObject( i );
+ if ( pItem->maRect.IsInside( aPos ) )
+ {
+ Rectangle aItemRect = pItem->maRect;
+ Point aPt = OutputToScreenPixel( aItemRect.TopLeft() );
+ aItemRect.Left() = aPt.X();
+ aItemRect.Top() = aPt.Y();
+ aPt = OutputToScreenPixel( aItemRect.BottomRight() );
+ aItemRect.Right() = aPt.X();
+ aItemRect.Bottom() = aPt.Y();
+ Help::ShowQuickHelp( this, aItemRect, GetItemText( pItem->mnId ) );
+ return;
+ }
+ }
+ }
+
+ Control::RequestHelp( rHEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::StateChanged( StateChangedType nType )
+{
+ Control::StateChanged( nType );
+
+ if ( nType == STATE_CHANGE_INITSHOW )
+ {
+ if ( mbFormat )
+ Format();
+ }
+ else if ( nType == STATE_CHANGE_UPDATEMODE )
+ {
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_TEXT )
+ {
+ if ( mpNoneItem && !mbFormat && IsReallyVisible() && IsUpdateMode() )
+ {
+ ImplFormatItem( mpNoneItem );
+ Invalidate( mpNoneItem->maRect );
+ }
+ }
+ else if ( (nType == STATE_CHANGE_ZOOM) ||
+ (nType == STATE_CHANGE_CONTROLFONT) )
+ {
+ ImplInitSettings( TRUE, FALSE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ {
+ ImplInitSettings( FALSE, TRUE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ ImplInitSettings( FALSE, FALSE, TRUE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_STYLE )
+ {
+ mbFormat = TRUE;
+ ImplInitSettings( FALSE, FALSE, TRUE );
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ Control::DataChanged( rDCEvt );
+
+ if ( (rDCEvt.GetType() == DATACHANGED_FONTS) ||
+ (rDCEvt.GetType() == DATACHANGED_DISPLAY) ||
+ (rDCEvt.GetType() == DATACHANGED_FONTSUBSTITUTION) ||
+ ((rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE)) )
+ {
+ mbFormat = TRUE;
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::Select()
+{
+ maSelectHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::DoubleClick()
+{
+ maDoubleClickHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::UserDraw( const UserDrawEvent& )
+{
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::InsertItem( USHORT nItemId, const Image& rImage, USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
+ "ValueSet::InsertItem(): ItemId already exists" );
+
+ ValueSetItem* pItem = new ValueSetItem;
+ pItem->mnId = nItemId;
+ pItem->meType = VALUESETITEM_IMAGE;
+ pItem->maImage = rImage;
+ mpItemList->Insert( pItem, (ULONG)nPos );
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::InsertItem( USHORT nItemId, const Color& rColor, USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
+ "ValueSet::InsertItem(): ItemId already exists" );
+
+ ValueSetItem* pItem = new ValueSetItem;
+ pItem->mnId = nItemId;
+ pItem->meType = VALUESETITEM_COLOR;
+ pItem->maColor = rColor;
+ mpItemList->Insert( pItem, (ULONG)nPos );
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::InsertItem( USHORT nItemId, const Image& rImage,
+ const XubString& rText, USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
+ "ValueSet::InsertItem(): ItemId already exists" );
+
+ ValueSetItem* pItem = new ValueSetItem;
+ pItem->mnId = nItemId;
+ pItem->meType = VALUESETITEM_IMAGE;
+ pItem->maImage = rImage;
+ pItem->maText = rText;
+ mpItemList->Insert( pItem, (ULONG)nPos );
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::InsertItem( USHORT nItemId, const Color& rColor,
+ const XubString& rText, USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
+ "ValueSet::InsertItem(): ItemId already exists" );
+
+ ValueSetItem* pItem = new ValueSetItem;
+ pItem->mnId = nItemId;
+ pItem->meType = VALUESETITEM_COLOR;
+ pItem->maColor = rColor;
+ pItem->maText = rText;
+ mpItemList->Insert( pItem, (ULONG)nPos );
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::InsertItem( USHORT nItemId, USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
+ "ValueSet::InsertItem(): ItemId already exists" );
+
+ ValueSetItem* pItem = new ValueSetItem;
+ pItem->mnId = nItemId;
+ pItem->meType = VALUESETITEM_USERDRAW;
+ mpItemList->Insert( pItem, (ULONG)nPos );
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::InsertSpace( USHORT nItemId, USHORT nPos )
+{
+ DBG_ASSERT( nItemId, "ValueSet::InsertSpace(): ItemId == 0" );
+ DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND,
+ "ValueSet::InsertSpace(): ItemId already exists" );
+
+ ValueSetItem* pItem = new ValueSetItem;
+ pItem->mnId = nItemId;
+ pItem->meType = VALUESETITEM_SPACE;
+ mpItemList->Insert( pItem, (ULONG)nPos );
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::RemoveItem( USHORT nItemId )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos == VALUESET_ITEM_NOTFOUND )
+ return;
+
+ delete mpItemList->Remove( nPos );
+
+ // Variablen zuruecksetzen
+ if ( (mnHighItemId == nItemId) || (mnSelItemId == nItemId) )
+ {
+ mnCurCol = 0;
+ mnOldItemId = 0;
+ mnHighItemId = 0;
+ mnSelItemId = 0;
+ mbNoSelection = TRUE;
+ }
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::CopyItems( const ValueSet& rValueSet )
+{
+ ValueSetItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
+ }
+
+ pItem = rValueSet.mpItemList->First();
+ while ( pItem )
+ {
+ mpItemList->Insert( new ValueSetItem( *pItem ) );
+ pItem = rValueSet.mpItemList->Next();
+ }
+
+ // Variablen zuruecksetzen
+ mnFirstLine = 0;
+ mnCurCol = 0;
+ mnOldItemId = 0;
+ mnHighItemId = 0;
+ mnSelItemId = 0;
+ mbNoSelection = TRUE;
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::Clear()
+{
+ ValueSetItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ delete pItem;
+ pItem = mpItemList->Next();
+ }
+ mpItemList->Clear();
+
+ // Variablen zuruecksetzen
+ mnFirstLine = 0;
+ mnCurCol = 0;
+ mnOldItemId = 0;
+ mnHighItemId = 0;
+ mnSelItemId = 0;
+ mbNoSelection = TRUE;
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ValueSet::GetItemCount() const
+{
+ return (USHORT)mpItemList->Count();
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ValueSet::GetItemPos( USHORT nItemId ) const
+{
+ ValueSetItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->mnId == nItemId )
+ return (USHORT)mpItemList->GetCurPos();
+ pItem = mpItemList->Next();
+ }
+
+ return VALUESET_ITEM_NOTFOUND;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ValueSet::GetItemId( USHORT nPos ) const
+{
+ ValueSetItem* pItem = mpItemList->GetObject( nPos );
+
+ if ( pItem )
+ return pItem->mnId;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ValueSet::GetItemId( const Point& rPos ) const
+{
+ ValueSetItem* pItem = mpItemList->First();
+ while ( pItem )
+ {
+ if ( pItem->maRect.IsInside( rPos ) )
+ return pItem->mnId;
+
+ pItem = mpItemList->Next();
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+Rectangle ValueSet::GetItemRect( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != VALUESET_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maRect;
+ else
+ return Rectangle();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetColCount( USHORT nNewCols )
+{
+ if ( mnUserCols != nNewCols )
+ {
+ mnUserCols = nNewCols;
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetLineCount( USHORT nNewLines )
+{
+ if ( mnUserVisLines != nNewLines )
+ {
+ mnUserVisLines = nNewLines;
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetItemWidth( long nNewItemWidth )
+{
+ if ( mnUserItemWidth != nNewItemWidth )
+ {
+ mnUserItemWidth = nNewItemWidth;
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetItemHeight( long nNewItemHeight )
+{
+ if ( mnUserItemHeight != nNewItemHeight )
+ {
+ mnUserItemHeight = nNewItemHeight;
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetFirstLine( USHORT nNewLine )
+{
+ if ( mnFirstLine != nNewLine )
+ {
+ mnFirstLine = nNewLine;
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SelectItem( USHORT nItemId )
+{
+ USHORT nPos;
+
+ if ( nItemId )
+ {
+ nPos = GetItemPos( nItemId );
+ if ( nPos == VALUESET_ITEM_NOTFOUND )
+ return;
+ if ( mpItemList->GetObject( nPos )->meType == VALUESETITEM_SPACE )
+ return;
+ }
+
+ if ( (mnSelItemId != nItemId) || mbNoSelection )
+ {
+ USHORT nOldItem = mnSelItemId;
+ mnSelItemId = nItemId;
+ mbNoSelection = FALSE;
+
+ BOOL bNewOut;
+ BOOL bNewLine;
+ if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
+ bNewOut = TRUE;
+ else
+ bNewOut = FALSE;
+ bNewLine = FALSE;
+
+ // Gegebenenfalls in den sichtbaren Bereich scrollen
+ if ( mbScroll && nItemId )
+ {
+ USHORT nNewLine = (USHORT)(nPos / mnCols);
+ if ( nNewLine < mnFirstLine )
+ {
+ mnFirstLine = nNewLine;
+ bNewLine = TRUE;
+ }
+ else if ( nNewLine > (USHORT)(mnFirstLine+mnVisLines-1) )
+ {
+ mnFirstLine = (USHORT)(nNewLine-mnVisLines+1);
+ bNewLine = TRUE;
+ }
+ }
+
+ if ( bNewOut )
+ {
+ if ( bNewLine )
+ {
+ // Falls sich der sichtbare Bereich geaendert hat,
+ // alles neu ausgeben
+ mbFormat = TRUE;
+ ImplDraw();
+ }
+ else
+ {
+ // alte Selection wegnehmen und neue ausgeben
+ ImplHideSelect( nOldItem );
+ ImplDrawSelect();
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetNoSelection()
+{
+ mbNoSelection = TRUE;
+ mbHighlight = FALSE;
+ mbSelection = FALSE;
+
+ if ( IsReallyVisible() && IsUpdateMode() )
+ ImplDraw();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetItemBits( USHORT nItemId, USHORT nItemBits )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != VALUESET_ITEM_NOTFOUND )
+ mpItemList->GetObject( nPos )->mnBits = nItemBits;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ValueSet::GetItemBits( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != VALUESET_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mnBits;
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetItemImage( USHORT nItemId, const Image& rImage )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos == VALUESET_ITEM_NOTFOUND )
+ return;
+
+ ValueSetItem* pItem = mpItemList->GetObject( nPos );
+ pItem->meType = VALUESETITEM_IMAGE;
+ pItem->maImage = rImage;
+
+ if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
+ {
+ ImplFormatItem( pItem );
+ Invalidate( pItem->maRect );
+ }
+ else
+ mbFormat = TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+Image ValueSet::GetItemImage( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != VALUESET_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maImage;
+ else
+ return Image();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetItemColor( USHORT nItemId, const Color& rColor )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos == VALUESET_ITEM_NOTFOUND )
+ return;
+
+ ValueSetItem* pItem = mpItemList->GetObject( nPos );
+ pItem->meType = VALUESETITEM_COLOR;
+ pItem->maColor = rColor;
+
+ if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
+ {
+ ImplFormatItem( pItem );
+ Invalidate( pItem->maRect );
+ }
+ else
+ mbFormat = TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+Color ValueSet::GetItemColor( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != VALUESET_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maColor;
+ else
+ return Color();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetItemData( USHORT nItemId, void* pData )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos == VALUESET_ITEM_NOTFOUND )
+ return;
+
+ ValueSetItem* pItem = mpItemList->GetObject( nPos );
+ pItem->mpData = pData;
+
+ if ( pItem->meType == VALUESETITEM_USERDRAW )
+ {
+ if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
+ {
+ ImplFormatItem( pItem );
+ Invalidate( pItem->maRect );
+ }
+ else
+ mbFormat = TRUE;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void* ValueSet::GetItemData( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != VALUESET_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->mpData;
+ else
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetItemText( USHORT nItemId, const XubString& rText )
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos == VALUESET_ITEM_NOTFOUND )
+ return;
+
+ ValueSetItem* pItem = mpItemList->GetObject( nPos );
+ pItem->maText = rText;
+
+ if ( !mbFormat && IsReallyVisible() && IsUpdateMode() )
+ {
+ USHORT nTempId = mnSelItemId;
+
+ if ( mbHighlight )
+ nTempId = mnHighItemId;
+
+ if ( nTempId == nItemId )
+ ImplDrawItemText( pItem->maText );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+XubString ValueSet::GetItemText( USHORT nItemId ) const
+{
+ USHORT nPos = GetItemPos( nItemId );
+
+ if ( nPos != VALUESET_ITEM_NOTFOUND )
+ return mpItemList->GetObject( nPos )->maText;
+ else
+ return XubString();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetColor( const Color& rColor )
+{
+ maColor = rColor;
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ ImplDraw();
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::SetExtraSpacing( USHORT nNewSpacing )
+{
+ if ( GetStyle() & WB_ITEMBORDER )
+ {
+ mnSpacing = nNewSpacing;
+
+ mbFormat = TRUE;
+ if ( IsReallyVisible() && IsUpdateMode() )
+ Invalidate();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::StartSelection()
+{
+ mnOldItemId = mnSelItemId;
+ mbHighlight = TRUE;
+ mbSelection = TRUE;
+ mnHighItemId = mnSelItemId;
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::EndSelection()
+{
+ if ( mbHighlight )
+ {
+ if ( IsTracking() )
+ EndTracking( ENDTRACK_CANCEL );
+
+ ImplHighlightItem( mnSelItemId );
+ mbHighlight = FALSE;
+ }
+ mbSelection = FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ValueSet::StartDrag( const CommandEvent& rCEvt, Region& rRegion )
+{
+ if ( rCEvt.GetCommand() != COMMAND_STARTDRAG )
+ return FALSE;
+
+ // Gegebenenfalls eine vorhandene Aktion abbrechen
+ EndSelection();
+
+ // Testen, ob angeklickte Seite selektiert ist. Falls dies nicht
+ // der Fall ist, setzen wir ihn als aktuellen Eintrag. Falls Drag and
+ // Drop auch mal ueber Tastatur ausgeloest werden kann, testen wir
+ // dies nur bei einer Mausaktion.
+ USHORT nSelId;
+ if ( rCEvt.IsMouseEvent() )
+ nSelId = GetItemId( rCEvt.GetMousePosPixel() );
+ else
+ nSelId = mnSelItemId;
+
+ // Falls kein Eintrag angeklickt wurde, starten wir kein Dragging
+ if ( !nSelId )
+ return FALSE;
+
+ // Testen, ob Seite selektiertiert ist. Falls nicht, als aktuelle
+ // Seite setzen und Select rufen.
+ if ( nSelId != mnSelItemId )
+ {
+ SelectItem( nSelId );
+ Update();
+ Select();
+ }
+
+#ifdef MAC
+ Region aRegion( GetItemRect( nSelId ) );
+#else
+ Region aRegion;
+#endif
+
+ // Region zuweisen
+ rRegion = aRegion;
+
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+Size ValueSet::CalcWindowSizePixel( const Size& rItemSize, USHORT nDesireCols,
+ USHORT nDesireLines )
+{
+ long nCalcCols = (long)nDesireCols;
+ long nCalcLines = (long)nDesireLines;
+
+ if ( !nCalcCols )
+ {
+ if ( mnUserCols )
+ nCalcCols = (long)mnUserCols;
+ else
+ nCalcCols = 1;
+ }
+
+ if ( !nCalcLines )
+ {
+ nCalcLines = mnVisLines;
+
+ if ( mbFormat )
+ {
+ if ( mnUserVisLines )
+ nCalcLines = mnUserVisLines;
+ else
+ {
+ nCalcLines = (long)mpItemList->Count() / nCalcCols;
+ if ( mpItemList->Count() % nCalcCols )
+ nCalcLines++;
+ else if ( !nCalcLines )
+ nCalcLines = 1;
+ }
+ }
+ }
+
+ Size aSize( rItemSize.Width()*nCalcCols, rItemSize.Height()*nCalcLines );
+ WinBits nStyle = GetStyle();
+ long nTxtHeight = GetTextHeight();
+ long nSpace;
+ long n;
+
+ if ( nStyle & WB_ITEMBORDER )
+ {
+ if ( nStyle & WB_DOUBLEBORDER )
+ n = ITEM_OFFSET_DOUBLE;
+ else
+ n = ITEM_OFFSET;
+
+ aSize.Width() += n*nCalcCols;
+ aSize.Height() += n*nCalcLines;
+ }
+ else
+ n = 0;
+
+ if ( mnSpacing )
+ {
+ nSpace = mnSpacing;
+ aSize.Width() += mnSpacing*(nCalcCols-1);
+ aSize.Height() += mnSpacing*(nCalcLines-1);
+ }
+ else
+ nSpace = 0;
+
+ if ( nStyle & WB_NAMEFIELD )
+ {
+ long nNameOffset = (nStyle & WB_FLATVALUESET) ? NAME_OFFSET_FLAT : NAME_OFFSET;
+ aSize.Height() += nTxtHeight + (nNameOffset*3) + 2 + nSpace;
+ }
+
+ if ( nStyle & WB_NONEFIELD )
+ {
+ aSize.Height() += nTxtHeight + n + nSpace;
+ if ( nStyle & WB_RADIOSEL )
+ aSize.Height() += 8;
+ }
+
+ // Evt. ScrollBar-Breite aufaddieren
+ aSize.Width() += GetScrollWidth();
+
+ return aSize;
+}
+
+// -----------------------------------------------------------------------
+
+Size ValueSet::CalcItemSizePixel( const Size& rItemSize, BOOL bOut ) const
+{
+ Size aSize = rItemSize;
+
+ WinBits nStyle = GetStyle();
+ if ( nStyle & WB_ITEMBORDER )
+ {
+ long n;
+
+ if ( nStyle & WB_DOUBLEBORDER )
+ n = ITEM_OFFSET_DOUBLE;
+ else
+ n = ITEM_OFFSET;
+
+ if ( bOut )
+ {
+ aSize.Width() += n;
+ aSize.Height() += n;
+ }
+ else
+ {
+ aSize.Width() -= n;
+ aSize.Height() -= n;
+ }
+ }
+
+ return aSize;
+}
+
+// -----------------------------------------------------------------------
+
+long ValueSet::GetScrollWidth() const
+{
+ if ( GetStyle() & WB_VSCROLL )
+ {
+ ((ValueSet*)this)->ImplInitScrollBar();
+ return mpScrBar->GetSizePixel().Width()+SCRBAR_OFFSET;
+ }
+ else
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT ValueSet::ShowDropPos( const Point& rPos )
+{
+ mbDropPos = TRUE;
+
+ // Gegebenenfalls scrollen
+ ImplScroll( rPos );
+
+ // DropPosition ermitteln
+ USHORT nPos = ImplGetItem( rPos, TRUE );
+ if ( nPos == VALUESET_ITEM_NONEITEM )
+ nPos = 0;
+ else if ( nPos == VALUESET_ITEM_NOTFOUND )
+ {
+ Size aOutSize = GetOutputSizePixel();
+ if ( GetStyle() & WB_NAMEFIELD )
+ aOutSize.Height() = mnTextOffset;
+ if ( (rPos.X() >= 0) && (rPos.X() < aOutSize.Width()) &&
+ (rPos.Y() >= 0) && (rPos.Y() < aOutSize.Height()) )
+ nPos = (USHORT)mpItemList->Count();
+ }
+ else
+ {
+ // Im letzten viertel, dann wird ein Item spaeter eingefuegt
+ Rectangle aRect = mpItemList->GetObject( nPos )->maRect;
+ if ( rPos.X() > aRect.Left()+aRect.GetWidth()-(aRect.GetWidth()/4) )
+ nPos++;
+ }
+
+ if ( nPos != mnDropPos )
+ {
+ ImplDrawDropPos( FALSE );
+ mnDropPos = nPos;
+ ImplDrawDropPos( TRUE );
+ }
+
+ return mnDropPos;
+}
+
+// -----------------------------------------------------------------------
+
+void ValueSet::HideDropPos()
+{
+ if ( mbDropPos )
+ {
+ ImplDrawDropPos( FALSE );
+ mbDropPos = FALSE;
+ }
+}
diff --git a/svtools/source/dialogs/colctrl.cxx b/svtools/source/dialogs/colctrl.cxx
new file mode 100644
index 000000000000..eb7c168af6de
--- /dev/null
+++ b/svtools/source/dialogs/colctrl.cxx
@@ -0,0 +1,814 @@
+/*************************************************************************
+ *
+ * $RCSfile: colctrl.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:57 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _SV_SALBTYPE_HXX //autogen
+#include <vcl/salbtype.hxx>
+#endif
+
+#ifndef _SV_BMPACC_HXX //autogen
+#include <vcl/bmpacc.hxx>
+#endif
+
+#include <colctrl.hxx>
+
+// ----------------
+// - ColorControl -
+// ----------------
+
+// -----------------------------------------------------------------------
+SvColorControl::SvColorControl( Window* pParent, WinBits nStyle ) :
+ Control ( pParent, nStyle ),
+ mpBitmap ( NULL ),
+ mpReadAccess ( NULL ),
+ mnLuminance ( 50 )
+{
+ Initialize();
+}
+
+// -----------------------------------------------------------------------
+SvColorControl::SvColorControl( Window* pParent, const ResId& rResId ) :
+ Control ( pParent, rResId ),
+ mpBitmap ( NULL ),
+ mpReadAccess ( NULL ),
+ mnLuminance ( 50 )
+{
+ Initialize();
+}
+
+
+// -----------------------------------------------------------------------
+SvColorControl::~SvColorControl()
+{
+ if( mpReadAccess )
+ mpBitmap->ReleaseAccess( mpReadAccess );
+
+ delete mpBitmap;
+
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::Initialize()
+{
+ SetLineColor( Color( COL_BLACK ) );
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::CreateBitmap()
+{
+ Size aSize = GetOutputSizePixel();
+ Size aBmpSize;
+ if( mpBitmap && mpBitmap->GetSizePixel() != aSize )
+ {
+ delete mpBitmap;
+ mpBitmap = NULL;
+ }
+ if( !mpBitmap )
+ mpBitmap = new Bitmap( aSize, 24 );
+
+ BitmapWriteAccess* pWriteAccess = mpBitmap->AcquireWriteAccess();
+
+ USHORT nX = (USHORT) aSize.Width();
+ USHORT nY = (USHORT) aSize.Height();
+
+ UINT16 nHue, nSat;
+ UINT16 nBri = mnLuminance;
+ ColorHSB aColHSB( 0, 0, mnLuminance );
+
+ for( USHORT i = 0; i < nY; i++ )
+ {
+ nSat = 100 - ( 100.0 * i + 0.5 ) / nY;
+
+ for( USHORT j = 0; j < nX; j++ )
+ {
+ nHue = ( 360.0 * j + 0.5 ) / nX;
+
+ aColHSB.SetHue( nHue );
+ aColHSB.SetSat( nSat );
+ Color aCol( aColHSB.GetRGB() );
+
+ pWriteAccess->SetPixel( i, j, BitmapColor( aCol ) );
+
+ }
+ }
+
+ /*
+ erster Ansatz nur mit RGB
+ USHORT n1_6 = (USHORT) ((nX+3) / 6);
+ USHORT n2_6 = (USHORT) ((nX*2+3) / 6);
+ USHORT n3_6 = (USHORT) ((nX*3+3) / 6);
+ USHORT n4_6 = (USHORT) ((nX*4+3) / 6);
+ USHORT n5_6 = (USHORT) ((nX*5+3) / 6);
+ USHORT n6_6 = nX;
+
+ BitmapColor aBmpColor;
+ BYTE cR, cG, cB;
+ */
+ /*
+ for( USHORT i = 0; i < nY; i++ )
+ {
+ USHORT nK = 100 * i / nY;
+
+ for( USHORT j = 0; j < nX; j++ )
+ {
+ if( j < n1_6 )
+ {
+ cR = 255;
+ cG = 255 * j / n1_6;
+ cB = 0;
+ }
+ else if( j < n2_6 )
+ {
+ cR = 255 - 255 * ( j - n1_6 ) / n1_6;
+ cG = 255;
+ cB = 0;
+ }
+ else if( j < n3_6 )
+ {
+ cR = 0;
+ cG = 255;
+ cB = 255 * (j - n2_6 ) / n1_6;
+ }
+ else if( j < n4_6 )
+ {
+ cR = 0;
+ cG = 255 - 255 * ( j - n3_6 ) / n1_6;
+ cB = 255;
+ }
+ else if( j < n5_6 )
+ {
+ cR = 255 * (j - n4_6 ) / n1_6;
+ cG = 0;
+ cB = 255;
+ }
+ else if( j < nX )
+ {
+ cR = 255;
+ cG = 0;
+ cB = 255 - 255 * ( j - n5_6 ) / n1_6;;
+ }
+
+ //cR -= ( cR - mnLuminance * 256 / 100 ) * nK / 100;
+ //cG -= ( cG - mnLuminance * 256 / 100 ) * nK / 100;
+ //cB -= ( cB - mnLuminance * 256 / 100 ) * nK / 100;
+
+ //aBmpColor.SetRed( cR );
+ //aBmpColor.SetGreen( cG );
+ //aBmpColor.SetBlue( cB );
+
+ //pWriteAccess->SetPixel( i, j, aBmpColor );
+
+ ColorHSB aColHSB( Color( cR, cG, cB ) );
+ aColHSB.SetSat( nK );
+ Color aCol( aColHSB.GetRGB() );
+
+ pWriteAccess->SetPixel( i, j, BitmapColor( aCol ) );
+
+ }
+ }
+ */
+ mpBitmap->ReleaseAccess( pWriteAccess );
+
+ mpReadAccess = mpBitmap->AcquireReadAccess();
+
+ SetColor( maColor ); // Anzeige der Position im Control
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::ShowPosition( const Point& rPos )
+{
+ // Explizites Abfragen des Bereichs, da schon mal ein Wert < 0 vorhanden ist
+ if( mpBitmap )
+ {
+ long nX = rPos.X();
+ long nY = rPos.Y();
+ if( nX < 0L )
+ nX = 0L;
+ else if( nX >= mpBitmap->GetSizePixel().Width() )
+ nX = mpBitmap->GetSizePixel().Width() - 1L;
+
+ if( nY < 0L )
+ nY= 0L;
+ else if( nY >= mpBitmap->GetSizePixel().Height() )
+ nY = mpBitmap->GetSizePixel().Height() - 1L;
+
+ Point aPos = maPosition;
+ maPosition.X() = nX - 2;
+ maPosition.Y() = nY - 2;
+ Invalidate( Rectangle( aPos, Size( 5, 5) ) );
+ Invalidate( Rectangle( maPosition, Size( 5, 5) ) );
+
+ maColor = mpReadAccess->GetPixel( nY, nX );
+ }
+}
+// -----------------------------------------------------------------------
+void SvColorControl::MouseMove( const MouseEvent& rMEvt )
+{
+ if( rMEvt.IsLeft() )
+ {
+ ShowPosition( rMEvt.GetPosPixel() );
+ Modify();
+ }
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if( rMEvt.IsLeft() && !rMEvt.IsShift() )
+ {
+ //ShowPointer( FALSE );
+ CaptureMouse();
+ ShowPosition( rMEvt.GetPosPixel() );
+ Modify();
+ }
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ //ShowPointer( TRUE );
+ if( IsMouseCaptured() )
+ ReleaseMouse();
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::Paint( const Rectangle& rRect )
+{
+ if( !mpBitmap )
+ CreateBitmap();
+
+ // dither bitmap if there only 256 colors available !
+ if( GetBitCount() <= 8 )
+ mpBitmap->Dither();
+
+ DrawBitmap( rRect.TopLeft(), rRect.GetSize(),
+ rRect.TopLeft(), rRect.GetSize(), *mpBitmap );
+
+ // Positions-Control (Fadenkreuz oder Aehnliches)
+ Point aPos1( maPosition );
+ Point aPos2( maPosition );
+ aPos2.X() += 4;
+ DrawLine( aPos1, aPos2 );
+ aPos2.X() -= 4;
+ aPos2.Y() += 4;
+ DrawLine( aPos1, aPos2 );
+ aPos1.Y() += 4;
+ aPos2.X() += 4;
+ DrawLine( aPos1, aPos2 );
+ aPos1.X() += 4;
+ aPos2.Y() -= 4;
+ DrawLine( aPos1, aPos2 );
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::Resize()
+{
+ CreateBitmap();
+
+ Control::Resize();
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::Modify()
+{
+ maModifyHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::SetColor( const ColorHSB& rCol, BOOL bSetColor )
+{
+ if( bSetColor )
+ maColor = rCol.GetRGB();
+
+ if( mpBitmap )
+ {
+ USHORT nX = (USHORT) mpBitmap->GetSizePixel().Width();
+ USHORT nY = (USHORT) mpBitmap->GetSizePixel().Height();
+
+ INT16 nZ = rCol.GetBri();
+ SetLuminance( nZ );
+
+ nX = rCol.GetHue() * nX / 360; // Farbe
+ nY = nY - rCol.GetSat() * nY / 100; // Saettigung
+
+ ShowPosition( Point( nX, nY ) );
+ }
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::SetColor( const Color& rCol )
+{
+ maColor = rCol;
+
+ if( mpBitmap )
+ {
+ ColorHSB aColHsb( rCol );
+ SetColor( aColHsb, FALSE );
+ /*
+ BOOL bDone = FALSE;
+ USHORT nX = (USHORT) mpBitmap->GetSizePixel().Width();
+ USHORT nY = (USHORT) mpBitmap->GetSizePixel().Height();
+ USHORT i, j;
+
+ BitmapColor aBmpColor;
+
+ for( i = 0; i < nY && !bDone; i++ )
+ {
+ for( j = 0; j < nX && !bDone; j++ )
+ {
+ aBmpColor = mpReadAccess->GetPixel( i, j );
+
+ if( maColor == (Color)aBmpColor )
+ bDone = TRUE;
+ }
+ }
+
+ if( bDone )
+ ShowPosition( Point( j, i ) );
+ */
+ }
+}
+
+// -----------------------------------------------------------------------
+void SvColorControl::SetLuminance( short nLum )
+{
+ if( nLum != mnLuminance &&
+ nLum >= 0 && nLum <= 100 )
+ {
+ mnLuminance = nLum;
+
+ if( mnLuminance < 40 )
+ SetLineColor( Color( COL_WHITE ) );
+ else
+ SetLineColor( Color( COL_BLACK ) );
+
+ CreateBitmap();
+
+ USHORT nX = maPosition.X() + 2;
+ USHORT nY = maPosition.Y() + 2;
+ maColor = mpReadAccess->GetPixel( nY, nX );
+
+ Invalidate();
+ }
+}
+
+
+// -----------------------
+// - ColorPreviewControl -
+// -----------------------
+
+
+// -----------------------------------------------------------------------
+ColorPreviewControl::ColorPreviewControl( Window* pParent, WinBits nStyle ) :
+ Control ( pParent, nStyle )
+{
+ SetFillColor( maColor );
+ SetLineColor( maColor );
+}
+
+// -----------------------------------------------------------------------
+ColorPreviewControl::ColorPreviewControl( Window* pParent, const ResId& rResId ) :
+ Control ( pParent, rResId )
+{
+ SetFillColor( maColor );
+ SetLineColor( maColor );
+}
+
+
+// -----------------------------------------------------------------------
+ColorPreviewControl::~ColorPreviewControl()
+{
+}
+
+// -----------------------------------------------------------------------
+void ColorPreviewControl::Paint( const Rectangle& rRect )
+{
+ DrawRect( rRect );
+}
+
+// -----------------------------------------------------------------------
+void ColorPreviewControl::SetColor( const Color& rCol )
+{
+ if( rCol != maColor )
+ {
+ maColor = rCol;
+ SetFillColor( maColor );
+ SetLineColor( maColor );
+ Invalidate();
+ }
+}
+
+
+// -----------------------
+// - ColorMixingControl -
+// -----------------------
+
+
+// -----------------------------------------------------------------------
+ColorMixingControl::ColorMixingControl( Window* pParent, WinBits nStyle,
+ USHORT nRows, USHORT nColumns ) :
+ ValueSet ( pParent, nStyle ),
+ mnRows ( nRows ),
+ mnColumns ( nColumns )
+{
+ Initialize();
+}
+
+// -----------------------------------------------------------------------
+ColorMixingControl::ColorMixingControl( Window* pParent, const ResId& rResId,
+ USHORT nRows, USHORT nColumns ) :
+ ValueSet ( pParent, rResId ),
+ mnRows ( nRows ),
+ mnColumns ( nColumns )
+{
+ Initialize();
+}
+
+
+// -----------------------------------------------------------------------
+ColorMixingControl::~ColorMixingControl()
+{
+}
+
+// -----------------------------------------------------------------------
+void ColorMixingControl::Initialize()
+{
+ SetColCount( mnColumns );
+
+ Color aColor;
+ String aStr;
+ for( USHORT i = 1; i <= mnRows * mnColumns; i++ )
+ {
+ InsertItem( i, aColor, aStr );
+ }
+
+ /*maColor[ 0 ] = Color( COL_LIGHTRED );
+ maColor[ 1 ] = Color( COL_LIGHTGREEN );
+ maColor[ 2 ] = Color( COL_YELLOW );
+ maColor[ 3 ] = Color( COL_LIGHTBLUE );*/
+
+ SetColor( CMC_TOPLEFT, Color( COL_LIGHTRED ) );
+ SetColor( CMC_BOTTOMRIGHT, Color( COL_LIGHTBLUE ) );
+
+ SetColor( CMC_TOPRIGHT, Color( COL_LIGHTGREEN ) );
+ SetColor( CMC_BOTTOMLEFT, Color( COL_YELLOW ) );
+
+ /*FillColumn( 0 );
+ FillColumn( mnColumns - 1 );
+ for( i = 0; i < mnRows; i++ )
+ FillRow( i );*/
+}
+
+// -----------------------------------------------------------------------
+Color ColorMixingControl::CalcDifferenceColor( USHORT nCol1, USHORT nCol2,
+ USHORT nSteps )
+{
+ // Die Berechnung ist noch etwas ungenau, daher sollte besser mit floats
+ // gearbeitet werden... (muss !!!)
+ Color aColor( GetItemColor( nCol1 ) );
+ Color aColor2( GetItemColor( nCol2 ) );
+
+ aColor.SetRed( (UINT8) ( ( aColor2.GetRed() - aColor.GetRed() ) / nSteps ) );
+ aColor.SetGreen( (UINT8) ( ( aColor2.GetGreen() - aColor.GetGreen() ) / nSteps ) );
+ aColor.SetBlue( (UINT8) ( ( aColor2.GetBlue() - aColor.GetBlue() ) / nSteps ) );
+
+ return( aColor );
+}
+
+// -----------------------------------------------------------------------
+void ColorMixingControl::FillRow( USHORT nRow )
+{
+ USHORT nCol1 = nRow * mnColumns + 1;
+ USHORT nCol2 = ( nRow + 1 ) * mnColumns;
+ Color aColor( GetItemColor( nCol1 ) );
+ Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnColumns - 1 ) );
+
+ for( USHORT i = nCol1 + 1; i < nCol2; i++ )
+ {
+ aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() );
+ aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() );
+ aColor.SetBlue( aColor.GetBlue() + aDiffColor.GetBlue() );
+
+ SetItemColor( i, aColor );
+ SetItemText( i, GetRGBString( aColor ) );
+ }
+}
+
+// -----------------------------------------------------------------------
+void ColorMixingControl::FillColumn( USHORT nColumn )
+{
+ USHORT nCol1 = nColumn + 1;
+ USHORT nCol2 = nColumn + ( mnRows - 1 ) * mnColumns + 1;
+ Color aColor( GetItemColor( nCol1 ) );
+ Color aDiffColor( CalcDifferenceColor( nCol1, nCol2, mnRows - 1 ) );
+
+ for( USHORT i = nCol1 + mnColumns; i < nCol2; i += mnColumns )
+ {
+ aColor.SetRed( aColor.GetRed() + aDiffColor.GetRed() );
+ aColor.SetGreen( aColor.GetGreen() + aDiffColor.GetGreen() );
+ aColor.SetBlue( aColor.GetBlue() + aDiffColor.GetBlue() );
+
+ SetItemColor( i, aColor );
+ SetItemText( i, GetRGBString( aColor ) );
+ }
+}
+
+// -----------------------------------------------------------------------
+void ColorMixingControl::SetRows( USHORT nRows )
+{
+ mnRows = nRows;
+}
+
+// -----------------------------------------------------------------------
+void ColorMixingControl::SetColumns( USHORT nColumns )
+{
+ mnColumns = nColumns;
+}
+
+// -----------------------------------------------------------------------
+void ColorMixingControl::SetColor( CMCPosition ePos, const Color& rCol )
+{
+ if( rCol != maColor[ ePos ] )
+ {
+ maColor[ ePos ] = rCol;
+ USHORT nPos, nColumn;
+ String aStr( GetRGBString( rCol ) );
+
+ switch( ePos )
+ {
+ case CMC_TOPLEFT:
+ nPos = 1;
+ nColumn = 0;
+ break;
+
+ case CMC_TOPRIGHT:
+ nPos = mnColumns;
+ nColumn = mnColumns - 1;
+ break;
+
+ case CMC_BOTTOMLEFT:
+ nPos = ( mnRows - 1 ) * mnColumns + 1;
+ nColumn = 0;
+ break;
+
+ case CMC_BOTTOMRIGHT:
+ nPos = mnRows * mnColumns;
+ nColumn = mnColumns - 1;
+ break;
+ }
+ SetItemColor( nPos, rCol );
+ SetItemText( nPos, aStr );
+ FillColumn( nColumn );
+
+ for( USHORT i = 0; i < mnRows; i++ )
+ FillRow( i );
+ }
+}
+
+// -----------------------------------------------------------------------
+String ColorMixingControl::GetRGBString( const Color& rColor )
+{
+ String aStr( String::CreateFromInt32(rColor.GetRed()) );
+ aStr += ' ';
+ aStr += String::CreateFromInt32(rColor.GetGreen());
+ aStr += ' ';
+ aStr += String::CreateFromInt32(rColor.GetBlue());
+
+ return aStr;
+}
+// -----------------------------------------------------------------------
+CMCPosition ColorMixingControl::GetCMCPosition() const
+{
+ CMCPosition ePos = CMC_OTHER;
+ USHORT nPos = GetSelectItemId();
+
+ if( nPos == 1 )
+ ePos = CMC_TOPLEFT;
+ else if( nPos == mnColumns )
+ ePos = CMC_TOPRIGHT;
+ else if( nPos == ( mnRows - 1 ) * mnColumns + 1 )
+ ePos = CMC_BOTTOMLEFT;
+ else if( nPos == mnRows * mnColumns )
+ ePos = CMC_BOTTOMRIGHT;
+
+ return( ePos );
+}
+
+
+// ------------
+// - ColorHSB -
+// ------------
+
+// Erste Ansaetze gingen auf die Berechnung von Sven Hannover zurueck
+// Der jetzige Algorithmus stammt im weitesten Sinne aus dem Foley/VanDam
+
+
+/**************************************************************************
+|*
+|* ColorHSB::ColorHSB()
+|*
+|* Beschreibung RGB nach HSB
+|* Ersterstellung SOH 02.10.97
+|*
+**************************************************************************/
+
+ColorHSB::ColorHSB( const Color& rColor )
+{
+ UINT8 c[3];
+ UINT8 cMax, cMin;
+
+ c[0] = rColor.GetRed();
+ c[1] = rColor.GetGreen();
+ c[2] = rColor.GetBlue();
+
+ cMax = c[0];
+ if( c[1] > cMax )
+ cMax = c[1];
+ if( c[2] > cMax )
+ cMax = c[2];
+
+ // Brightness = max(R, G, B);
+ mnBri = cMax * 100 / 255;
+
+ cMin = c[0];
+ if( c[1] < cMin )
+ cMin = c[1];
+ if( c[2] < cMin )
+ cMin = c[2];
+
+ UINT8 cDelta = cMax - cMin;
+
+ // Saturation = max - min / max
+ if( mnBri > 0 )
+ mnSat = cDelta * 100 / cMax;
+ else
+ mnSat = 0;
+
+ if( mnSat == 0 )
+ mnHue = 0; // Default = undefined
+ else
+ {
+ double dHue;
+
+ if( c[0] == cMax )
+ {
+ dHue = (double)( c[1] - c[2] ) / (double)cDelta;
+ }
+ else if( c[1] == cMax )
+ {
+ dHue = 2.0 + (double)( c[2] - c[0] ) / (double)cDelta;
+ }
+ else if ( c[2] == cMax )
+ {
+ dHue = 4.0 + (double)( c[0] - c[1] ) / (double)cDelta;
+ }
+ dHue *= 60.0;
+
+ if( dHue < 0.0 )
+ dHue += 360.0;
+
+ mnHue = (UINT16) dHue;
+ }
+}
+
+/**************************************************************************
+|*
+|* ColorHSB::GetRGB()
+|*
+|* Beschreibung HSB nach RGB
+|* Ersterstellung SOH 02.10.97
+|*
+**************************************************************************/
+
+Color ColorHSB::GetRGB() const
+{
+ UINT8 cR,cG,cB;
+ UINT8 nB = (UINT8) ( mnBri * 255 / 100 );
+
+ if( mnSat == 0 )
+ {
+ cR = nB;
+ cG = nB;
+ cB = nB;
+ }
+ else
+ {
+ double dH = mnHue;
+ double f;
+ UINT16 n;
+ if( dH == 360.0 )
+ dH = 0.0;
+
+ dH /= 60.0;
+ n = (UINT16) dH;
+ f = dH - n;
+
+ UINT8 a = (UINT8) ( nB * ( 100 - mnSat ) / 100 );
+ UINT8 b = (UINT8) ( nB * ( 100 - ( (double)mnSat * f + 0.5 ) ) / 100 );
+ UINT8 c = (UINT8) ( nB * ( 100 - ( (double)mnSat * ( 1.0 - f ) + 0.5 ) ) / 100 );
+
+ switch( n )
+ {
+ case 0: cR = nB; cG = c; cB = a; break;
+ case 1: cR = b; cG = nB; cB = a; break;
+ case 2: cR = a; cG = nB; cB = c; break;
+ case 3: cR = a; cG = b; cB = nB; break;
+ case 4: cR = c; cG = a; cB = nB; break;
+ case 5: cR = nB; cG = a; cB = b; break;
+ }
+ }
+
+ return( Color( cR, cG, cB ) );
+}
+
+// ------------
+// - ColorCMYK -
+// ------------
+
+
+// -----------------------------------------------------------------------
+ColorCMYK::ColorCMYK( const Color& rColor )
+{
+ mnCyan = 255 - rColor.GetRed();
+ mnMagenta = 255 - rColor.GetGreen();
+ mnYellow = 255 - rColor.GetBlue();
+
+ mnKey = Min( Min( mnCyan, mnMagenta ), mnYellow );
+
+ mnCyan = mnCyan - mnKey;
+ mnMagenta = mnMagenta - mnKey;
+ mnYellow = mnYellow - mnKey;
+}
+
+// -----------------------------------------------------------------------
+Color ColorCMYK::GetRGB() const
+{
+ INT16 nTmp = Max( 0, 255 - ( mnCyan + mnKey ) );
+ UINT8 cR = (UINT8) nTmp;
+ nTmp = Max( 0, 255 - ( mnMagenta + mnKey ) );
+ UINT8 cG = (UINT8) nTmp;
+ nTmp = Max( 0, 255 - ( mnYellow + mnKey ) );
+ UINT8 cB = (UINT8) nTmp;
+
+ return( Color( cR, cG, cB ) );
+}
+
+
diff --git a/svtools/source/dialogs/colrdlg.cxx b/svtools/source/dialogs/colrdlg.cxx
new file mode 100644
index 000000000000..5ffb0640b003
--- /dev/null
+++ b/svtools/source/dialogs/colrdlg.cxx
@@ -0,0 +1,358 @@
+/*************************************************************************
+ *
+ * $RCSfile: colrdlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "svtdata.hxx"
+#include "colrdlg.hrc"
+#include "colrdlg.hxx"
+
+// ---------------
+// - ColorDialog -
+// ---------------
+
+SvColorDialog::SvColorDialog( Window* pWindow ) :
+ ModalDialog ( pWindow, SvtResId( DLG_COLOR ) ),
+ maColMixCtrl ( this, SvtResId( VAL_SET_COLOR ), 8, 8 ),
+ maBtn1 ( this, SvtResId( BTN_1 ) ),
+ maBtn2 ( this, SvtResId( BTN_2 ) ),
+ //maBtn3 ( this, SvtResId( BTN_3 ) ),
+ //maBtn4 ( this, SvtResId( BTN_4 ) ),
+ //maFtRGB ( this, SvtResId( FT_RGB ) ),
+ maCtlColor ( this, SvtResId( CTL_COLOR ) ),
+
+ maFtCyan ( this, SvtResId( FT_CYAN ) ),
+ maNumCyan ( this, SvtResId( NUM_CYAN ) ),
+ maFtMagenta ( this, SvtResId( FT_MAGENTA ) ),
+ maNumMagenta ( this, SvtResId( NUM_MAGENTA ) ),
+ maFtYellow ( this, SvtResId( FT_YELLOW ) ),
+ maNumYellow ( this, SvtResId( NUM_YELLOW ) ),
+ maFtKey ( this, SvtResId( FT_KEY ) ),
+ maNumKey ( this, SvtResId( NUM_KEY ) ),
+
+ maFtRed ( this, SvtResId( FT_RED ) ),
+ maNumRed ( this, SvtResId( NUM_RED ) ),
+ maFtGreen ( this, SvtResId( FT_GREEN ) ),
+ maNumGreen ( this, SvtResId( NUM_GREEN ) ),
+ maFtBlue ( this, SvtResId( FT_BLUE ) ),
+ maNumBlue ( this, SvtResId( NUM_BLUE ) ),
+
+ maFtHue ( this, SvtResId( FT_HUE ) ),
+ maNumHue ( this, SvtResId( NUM_HUE ) ),
+ maFtSaturation ( this, SvtResId( FT_SATURATION ) ),
+ maNumSaturation ( this, SvtResId( NUM_SATURATION ) ),
+ maFtLuminance ( this, SvtResId( FT_LUMINANCE ) ),
+ maNumLuminance ( this, SvtResId( NUM_LUMINANCE ) ),
+ maCtlPreview ( this, SvtResId( CTL_PREVIEW ) ),
+ maCtlPreviewOld ( this, SvtResId( CTL_PREVIEW_OLD ) ),
+
+ maBtnOK ( this, SvtResId( BTN_OK ) ),
+ maBtnCancel ( this, SvtResId( BTN_CANCEL ) ),
+ maBtnHelp ( this, SvtResId( BTN_HELP ) )
+{
+ FreeResource();
+
+ maColMixCtrl.SetDoubleClickHdl( LINK( this, SvColorDialog, ClickMixCtrlHdl ) );
+ maColMixCtrl.SetSelectHdl( LINK( this, SvColorDialog, SelectMixCtrlHdl ) );
+
+ Link aLink( LINK( this, SvColorDialog, ColorModifyHdl ) );
+ maCtlColor.SetModifyHdl( aLink );
+
+ maNumRed.SetModifyHdl( aLink );
+ maNumGreen.SetModifyHdl( aLink );
+ maNumBlue.SetModifyHdl( aLink );
+
+ maNumCyan.SetModifyHdl( aLink );
+ maNumMagenta.SetModifyHdl( aLink );
+ maNumYellow.SetModifyHdl( aLink );
+ maNumKey.SetModifyHdl( aLink );
+
+ maNumHue.SetModifyHdl( aLink );
+ maNumSaturation.SetModifyHdl( aLink );
+ maNumLuminance.SetModifyHdl( aLink );
+
+ aLink = ( LINK( this, SvColorDialog, ClickBtnHdl ) );
+ maBtn1.SetClickHdl( aLink );
+ maBtn2.SetClickHdl( aLink );
+ //maBtn3.SetClickHdl( aLink );
+ //maBtn4.SetClickHdl( aLink );
+
+ maColMixCtrl.SetExtraSpacing( 0 );
+}
+
+
+// -----------------------------------------------------------------------
+SvColorDialog::~SvColorDialog()
+{
+}
+
+// -----------------------------------------------------------------------
+void SvColorDialog::Initialize()
+{
+ maNumRed.SetValue( maColor.GetRed() );
+ maNumGreen.SetValue( maColor.GetGreen() );
+ maNumBlue.SetValue( maColor.GetBlue() );
+
+ ColorCMYK aColorCMYK( maColor );
+
+ long aCyan = (long) ( (double)aColorCMYK.GetCyan() * 100.0 / 255.0 + 0.5 );
+ long aMagenta = (long) ( (double)aColorCMYK.GetMagenta() * 100.0 / 255.0 + 0.5 );
+ long aYellow = (long) ( (double)aColorCMYK.GetYellow() * 100.0 / 255.0 + 0.5 );
+ long aKey = (long) ( (double)aColorCMYK.GetKey() * 100.0 / 255.0 + 0.5 );
+ maNumCyan.SetValue( aCyan );
+ maNumMagenta.SetValue( aMagenta );
+ maNumYellow.SetValue( aYellow );
+ maNumKey.SetValue( aKey );
+
+ ColorHSB aColorHSB( maColor );
+ maNumHue.SetValue( aColorHSB.GetHue() );
+ maNumSaturation.SetValue( aColorHSB.GetSat() );
+ maNumLuminance.SetValue( aColorHSB.GetBri() );
+
+ maCtlColor.SetColor( aColorHSB );
+
+ maColMixCtrl.SelectItem( 1 );
+
+ maCtlPreview.SetColor( maColor );
+ maCtlPreviewOld.SetColor( maColor );
+}
+
+// -----------------------------------------------------------------------
+void SvColorDialog::SetColor( const Color& rColor )
+{
+ maColor = rColor;
+}
+
+// -----------------------------------------------------------------------
+const Color& SvColorDialog::GetColor() const
+{
+ return( maColor );
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( SvColorDialog, ColorModifyHdl, void *, p )
+{
+ UINT16 n = 0x00; // 1 == RGB, 2 == CMYK, 4 == HSB
+
+ if( p == &maCtlColor )
+ {
+ maColor = maCtlColor.GetColor();
+ maNumRed.SetValue( maColor.GetRed() );
+ maNumGreen.SetValue( maColor.GetGreen() );
+ maNumBlue.SetValue( maColor.GetBlue() );
+
+ n = 7;
+ }
+ else if( p == &maNumRed )
+ {
+ maColor.SetRed( (UINT8)maNumRed.GetValue() );
+ maCtlColor.SetColor( maColor );
+ n = 6;
+ }
+ else if( p == &maNumGreen )
+ {
+ maColor.SetGreen( (UINT8)maNumGreen.GetValue() );
+ maCtlColor.SetColor( maColor );
+ n = 6;
+ }
+ else if( p == &maNumBlue )
+ {
+ maColor.SetBlue( (UINT8)maNumBlue.GetValue() );
+ maCtlColor.SetColor( maColor );
+ n = 6;
+ }
+ else if( p == &maNumHue ||
+ p == &maNumSaturation ||
+ p == &maNumLuminance )
+ {
+
+ ColorHSB aColorHSB( (UINT16) maNumHue.GetValue(),
+ (UINT16) maNumSaturation.GetValue(),
+ (UINT16) maNumLuminance.GetValue() );
+ maCtlColor.SetColor( aColorHSB );
+ maColor = maCtlColor.GetColor();
+ n = 3;
+ }
+ else if( p == &maNumCyan ||
+ p == &maNumMagenta ||
+ p == &maNumYellow ||
+ p == &maNumKey )
+ {
+ long aCyan = (long) ( (double)maNumCyan.GetValue() * 255.0 / 100.0 + 0.5 );
+ long aMagenta = (long) ( (double)maNumMagenta.GetValue() * 255.0 / 100.0 + 0.5 );
+ long aYellow = (long) ( (double)maNumYellow.GetValue() * 255.0 / 100.0 + 0.5 );
+ long aKey = (long) ( (double)maNumKey.GetValue() * 255.0 / 100.0 + 0.5 );
+
+ ColorCMYK aColorCMYK( (UINT16) aCyan,
+ (UINT16) aMagenta,
+ (UINT16) aYellow,
+ (UINT16) aKey );
+ maColor = aColorCMYK.GetRGB();
+ maCtlColor.SetColor( maColor );
+ n = 5;
+ }
+
+ if( n & 1 ) // RGB setzen
+ {
+ maNumRed.SetValue( maColor.GetRed() );
+ maNumGreen.SetValue( maColor.GetGreen() );
+ maNumBlue.SetValue( maColor.GetBlue() );
+ }
+ if( n & 2 ) // CMYK setzen
+ {
+ ColorCMYK aColorCMYK( maColor );
+ long aCyan = (long) ( (double)aColorCMYK.GetCyan() * 100.0 / 255.0 + 0.5 );
+ long aMagenta = (long) ( (double)aColorCMYK.GetMagenta() * 100.0 / 255.0 + 0.5 );
+ long aYellow = (long) ( (double)aColorCMYK.GetYellow() * 100.0 / 255.0 + 0.5 );
+ long aKey = (long) ( (double)aColorCMYK.GetKey() * 100.0 / 255.0 + 0.5 );
+ maNumCyan.SetValue( aCyan );
+ maNumMagenta.SetValue( aMagenta );
+ maNumYellow.SetValue( aYellow );
+ maNumKey.SetValue( aKey );
+ }
+ if( n & 4 ) // HSB setzen
+ {
+ ColorHSB aColorHSB( maColor );
+ maNumHue.SetValue( aColorHSB.GetHue() );
+ maNumSaturation.SetValue( aColorHSB.GetSat() );
+ maNumLuminance.SetValue( aColorHSB.GetBri() );
+ }
+
+ maCtlPreview.SetColor( maColor );
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( SvColorDialog, ClickBtnHdl, void *, p )
+{
+ /*
+ Color aColor = maCtlColor.GetColor();
+ if( p == &maBtn1 )
+ maColMixCtrl.SetColor( CMC_TOPLEFT, aColor );
+ if( p == &maBtn2 )
+ maColMixCtrl.SetColor( CMC_TOPRIGHT, aColor );
+ if( p == &maBtn3 )
+ maColMixCtrl.SetColor( CMC_BOTTOMLEFT, aColor );
+ if( p == &maBtn4 )
+ maColMixCtrl.SetColor( CMC_BOTTOMRIGHT, aColor );
+ */
+
+ if( p == &maBtn1 )
+ {
+ CMCPosition ePos = maColMixCtrl.GetCMCPosition();
+ if( ePos != CMC_OTHER )
+ maColMixCtrl.SetColor( ePos, maColor );
+ }
+ else if( p == &maBtn2 )
+ {
+ USHORT nPos = maColMixCtrl.GetSelectItemId();
+ maColor = maColMixCtrl.GetItemColor( nPos );
+ maCtlColor.SetColor( maColor );
+ ColorModifyHdl( &maCtlColor );
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( SvColorDialog, ClickMixCtrlHdl, void *, p )
+{
+ USHORT nPos = maColMixCtrl.GetSelectItemId();
+ CMCPosition ePos = maColMixCtrl.GetCMCPosition();
+
+ if( ePos != CMC_OTHER )
+ maColMixCtrl.SetColor( ePos, maColor );
+ else
+ {
+ maColor = maColMixCtrl.GetItemColor( nPos );
+ maCtlColor.SetColor( maColor );
+ ColorModifyHdl( &maCtlColor );
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+IMPL_LINK( SvColorDialog, SelectMixCtrlHdl, void *, p )
+{
+ //USHORT nPos = maColMixCtrl.GetSelectItemId();
+ //maFtRGB.SetText( maColMixCtrl.GetItemText( nPos ) );
+
+ CMCPosition ePos = maColMixCtrl.GetCMCPosition();
+ if( ePos == CMC_OTHER )
+ maBtn1.Enable( FALSE );
+ else
+ maBtn1.Enable();
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+short SvColorDialog::Execute()
+{
+ Initialize();
+
+ short nRet = ModalDialog::Execute();
+
+ return( nRet );
+}
+
diff --git a/svtools/source/dialogs/colrdlg.hrc b/svtools/source/dialogs/colrdlg.hrc
new file mode 100644
index 000000000000..6d06df632a8e
--- /dev/null
+++ b/svtools/source/dialogs/colrdlg.hrc
@@ -0,0 +1,101 @@
+/*************************************************************************
+ *
+ * $RCSfile: colrdlg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define DLG_COLOR 996
+
+#define VAL_SET_COLOR 2
+#define BTN_1 1
+#define BTN_2 2
+#define BTN_3 3
+#define BTN_4 4
+#define FT_RGB 12
+
+#define CTL_COLOR 1
+
+#define FT_RED 1
+#define NUM_RED 1
+#define FT_GREEN 2
+#define NUM_GREEN 2
+#define FT_BLUE 3
+#define NUM_BLUE 3
+
+#define FT_CYAN 7
+#define NUM_CYAN 7
+#define FT_MAGENTA 8
+#define NUM_MAGENTA 8
+#define FT_YELLOW 9
+#define NUM_YELLOW 9
+#define FT_KEY 10
+#define NUM_KEY 10
+
+#define FT_HUE 4
+#define NUM_HUE 4
+#define FT_SATURATION 5
+#define NUM_SATURATION 5
+#define FT_LUMINANCE 6
+#define NUM_LUMINANCE 6
+
+#define CTL_PREVIEW 3
+#define CTL_PREVIEW_OLD 4
+
+#define BTN_OK 1
+#define BTN_CANCEL 1
+#define BTN_HELP 1
+
diff --git a/svtools/source/dialogs/colrdlg.src b/svtools/source/dialogs/colrdlg.src
new file mode 100644
index 000000000000..e9b07fd387a1
--- /dev/null
+++ b/svtools/source/dialogs/colrdlg.src
@@ -0,0 +1,576 @@
+/*************************************************************************
+ *
+ * $RCSfile: colrdlg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "colrdlg.hrc"
+#define DIFF 3
+ModalDialog DLG_COLOR
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 260 , 165 + DIFF ) ;
+ Moveable = TRUE ;
+ Text = "Farbe" ;
+ Text [ ENGLISH ] = "Color" ;
+ Text [ english_us ] = "Color" ;
+ Text [ portuguese_brazilian ] = "Farbe" ;
+ Text [ swedish ] = "Färg" ;
+ Text [ danish ] = "Farve" ;
+ Text [ italian ] = "Colore" ;
+ Text [ spanish ] = "Color" ;
+ Text [ french ] = "Couleur" ;
+ Text [ dutch ] = "Kleur" ;
+ Text [ portuguese ] = "Cor" ;
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 205 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL
+ {
+ Pos = MAP_APPFONT ( 205 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BTN_HELP
+ {
+ Pos = MAP_APPFONT ( 205 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ Control CTL_COLOR
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 100 , 6 ) ;
+ Size = MAP_APPFONT ( 100 , 100 ) ;
+ TabStop = TRUE ;
+ };
+ FixedText FT_RED
+ {
+ Pos = MAP_APPFONT ( 64 , 123 + DIFF ) ;
+ Size = MAP_APPFONT ( 23 , 10 ) ;
+ Text = "~Rot" ;
+ Text [ ENGLISH ] = "~Red" ;
+ Text [ english_us ] = "~Red" ;
+ Text [ portuguese_brazilian ] = "~Rot" ;
+ Text [ swedish ] = "~Rött" ;
+ Text [ danish ] = "Rød" ;
+ Text [ italian ] = "~Rosso" ;
+ Text [ spanish ] = "~Rojo" ;
+ Text [ french ] = "~Rouge" ;
+ Text [ dutch ] = "~Rood" ;
+ Text [ portuguese ] = "~Vermelho" ;
+ Text[ chinese_simplified ] = "ºìÉ«(~R)";
+ Text[ russian ] = "~Êðàñí.";
+ Text[ polish ] = "Czerw.";
+ Text[ japanese ] = "Ô(~R)";
+ Text[ chinese_traditional ] = "¬õ¦â(~R)";
+ Text[ arabic ] = "ÃÍãÑ";
+ Text[ dutch ] = "~Rood";
+ Text[ chinese_simplified ] = "ºìÉ«(~R)";
+ Text[ greek ] = "Êüêêéíï";
+ Text[ korean ] = "»¡°­(~R)";
+ Text[ turkish ] = "~Kýrmýzý";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_GREEN
+ {
+ Pos = MAP_APPFONT ( 64 , 136 + DIFF ) ;
+ Size = MAP_APPFONT ( 23 , 10 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~Grün : ~Gr³n */
+ /* ### ACHTUNG: Neuer Text in Resource? ~Grün : ~Gr³n */
+ Text = "~Grün" ;
+ Text [ ENGLISH ] = "~Green" ;
+ Text [ english_us ] = "~Green" ;
+ Text [ portuguese_brazilian ] = "~Grün" ;
+ Text [ swedish ] = "~Grönt" ;
+ Text [ danish ] = "Grøn" ;
+ Text [ italian ] = "~Verde" ;
+ Text [ spanish ] = "~Verde" ;
+ Text [ french ] = "~Vert" ;
+ Text [ dutch ] = "~Groen" ;
+ Text [ portuguese ] = "~Verde" ;
+ Text[ chinese_simplified ] = "ÂÌÉ«(~G)";
+ Text[ russian ] = "~Çåëåí.";
+ Text[ polish ] = "Zielony";
+ Text[ japanese ] = "—Î(~G)";
+ Text[ chinese_traditional ] = "ºñ¦â(~G)";
+ Text[ arabic ] = "ÃÎÖÑ";
+ Text[ dutch ] = "~Groen";
+ Text[ chinese_simplified ] = "ÂÌÉ«(~G)";
+ Text[ greek ] = "ÐñÜóéíï";
+ Text[ korean ] = "ÃÊ·Ï(~G)";
+ Text[ turkish ] = "~Yeþil";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_BLUE
+ {
+ Pos = MAP_APPFONT ( 64 , 149 + DIFF ) ;
+ Size = MAP_APPFONT ( 23 , 10 ) ;
+ Text = "~Blau" ;
+ Text [ ENGLISH ] = "~Blue" ;
+ Text [ english_us ] = "~Blue" ;
+ Text [ portuguese_brazilian ] = "~Blau" ;
+ Text [ swedish ] = "~Blått" ;
+ Text [ danish ] = "Blå" ;
+ Text [ italian ] = "~Blu" ;
+ Text [ spanish ] = "~Azul" ;
+ Text [ french ] = "~Bleu" ;
+ Text [ dutch ] = "~Blauw" ;
+ Text [ portuguese ] = "~Azul" ;
+ Text[ chinese_simplified ] = "À¶É«(~B)";
+ Text[ russian ] = "Ñèíèé";
+ Text[ polish ] = "Nieb.";
+ Text[ japanese ] = "Â(~B)";
+ Text[ chinese_traditional ] = "ÂŦâ(~B)";
+ Text[ arabic ] = "ÃÒÑÞ";
+ Text[ dutch ] = "~Blauw";
+ Text[ chinese_simplified ] = "À¶É«(~B)";
+ Text[ greek ] = "Ìðëå";
+ Text[ korean ] = "ÆĶû(~B)";
+ Text[ turkish ] = "~Mavi";
+ Text[ language_user1 ] = " ";
+ };
+ NumericField NUM_RED
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 88 , 122 + DIFF ) ;
+ Size = MAP_APPFONT ( 26 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 255 ;
+ Last = 255 ;
+ };
+ NumericField NUM_GREEN
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 88 , 135 + DIFF ) ;
+ Size = MAP_APPFONT ( 26 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 255 ;
+ Last = 255 ;
+ };
+ NumericField NUM_BLUE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 88 , 148 + DIFF ) ;
+ Size = MAP_APPFONT ( 26 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 255 ;
+ Last = 255 ;
+ };
+ FixedText FT_CYAN
+ {
+ Pos = MAP_APPFONT ( 6 , 110 + DIFF ) ;
+ Size = MAP_APPFONT ( 28 , 10 ) ;
+ Text = "~Cyan" ;
+ Text [ ENGLISH ] = "~Cyan" ;
+ Text [ english_us ] = "~Cyan" ;
+ Text [ portuguese_brazilian ] = "~Cyan" ;
+ Text [ swedish ] = "~Cyanblått" ;
+ Text [ danish ] = "Cyan" ;
+ Text [ italian ] = "~Ciano" ;
+ Text [ spanish ] = "~Cian" ;
+ Text [ french ] = "~Cyan" ;
+ Text [ dutch ] = "~Cyaan" ;
+ Text [ portuguese ] = "~Ciano" ;
+ Text[ chinese_simplified ] = "À¶ÂÌÉ«(~C)";
+ Text[ russian ] = "Ãîëóáîé";
+ Text[ polish ] = "Nieb.-ziel.";
+ Text[ japanese ] = "¼±Ý(~C)";
+ Text[ chinese_traditional ] = "Âźñ¦â(~C)";
+ Text[ arabic ] = "ÃÒÑÞ ÓãÇæí";
+ Text[ dutch ] = "~Cyaan";
+ Text[ chinese_simplified ] = "À¶ÂÌÉ«(~C)";
+ Text[ greek ] = "Êõáíü";
+ Text[ korean ] = "û·Ï(~C)";
+ Text[ turkish ] = "~Camgöbeði";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_MAGENTA
+ {
+ Pos = MAP_APPFONT ( 6 , 123 + DIFF ) ;
+ Size = MAP_APPFONT ( 28 , 10 ) ;
+ Text = "~Magenta" ;
+ Text [ ENGLISH ] = "~Magenta" ;
+ Text [ english_us ] = "~Magenta" ;
+ Text [ portuguese_brazilian ] = "~Magenta" ;
+ Text [ swedish ] = "~Magenta" ;
+ Text [ danish ] = "Magenta" ;
+ Text [ italian ] = "~Magenta" ;
+ Text [ spanish ] = "~Magenta" ;
+ Text [ french ] = "~Magenta" ;
+ Text [ dutch ] = "~Magenta" ;
+ Text [ portuguese ] = "~Magenta" ;
+ Text[ chinese_simplified ] = "×ϺìÉ«(~M)";
+ Text[ russian ] = "~Ëèëîâûé";
+ Text[ polish ] = "Purpurowy";
+ Text[ japanese ] = "ϾÞÝÀ(~M)";
+ Text[ chinese_traditional ] = "µµ¬õ¦â(~M)";
+ Text[ arabic ] = "ÃÑÌæÇäí";
+ Text[ dutch ] = "~Magenta";
+ Text[ chinese_simplified ] = "×ϺìÉ«(~M)";
+ Text[ greek ] = "ÌáôæÝíôá";
+ Text[ korean ] = "¸¶Á¨Å¸(~M)";
+ Text[ turkish ] = "M~or";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_YELLOW
+ {
+ Pos = MAP_APPFONT ( 6 , 136 + DIFF ) ;
+ Size = MAP_APPFONT ( 28 , 10 ) ;
+ Text = "~Yellow" ;
+ Text [ ENGLISH ] = "~Yellow" ;
+ Text [ english_us ] = "~Yellow" ;
+ Text [ portuguese_brazilian ] = "~Yellow" ;
+ Text [ swedish ] = "~Gult" ;
+ Text [ danish ] = "Gul" ;
+ Text [ italian ] = "~Giallo" ;
+ Text [ spanish ] = "~Amarillo" ;
+ Text [ french ] = "~Jaune" ;
+ Text [ dutch ] = "~Yellow" ;
+ Text [ portuguese ] = "~Amarelo" ;
+ Text[ chinese_simplified ] = "»ÆÉ«(~Y)";
+ Text[ russian ] = "~Æåëòûé";
+ Text[ polish ] = "¯ó³ty";
+ Text[ japanese ] = "‰©(~Y)";
+ Text[ chinese_traditional ] = "¶À¦â(~Y)";
+ Text[ arabic ] = "ÃÕÝÑ";
+ Text[ dutch ] = "~Yellow";
+ Text[ chinese_simplified ] = "»ÆÉ«(~Y)";
+ Text[ greek ] = "Êßôñéíï";
+ Text[ korean ] = "³ë¶û(~Y)";
+ Text[ turkish ] = "~Sarý";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_KEY
+ {
+ Pos = MAP_APPFONT ( 6 , 149 + DIFF ) ;
+ Size = MAP_APPFONT ( 28 , 10 ) ;
+ Text = "~Key" ;
+ Text [ ENGLISH ] = "~Key" ;
+ Text [ english_us ] = "~Key" ;
+ Text [ portuguese_brazilian ] = "~Key" ;
+ Text [ swedish ] = "~Key" ;
+ Text [ danish ] = "Nøgle" ;
+ Text [ italian ] = "~Chiave" ;
+ Text [ spanish ] = "~Llave" ;
+ Text [ french ] = "~Khôl" ;
+ Text [ dutch ] = "~Key" ;
+ Text [ portuguese ] = "~Chave" ;
+ Text[ chinese_simplified ] = "¼üÂë(~K)";
+ Text[ russian ] = "~Êëþ÷";
+ Text[ polish ] = "Klucz";
+ Text[ japanese ] = "•(~K)";
+ Text[ chinese_traditional ] = "Áä½X(~K)";
+ Text[ arabic ] = "ãÝÊÇÍ";
+ Text[ dutch ] = "~Key";
+ Text[ chinese_simplified ] = "¼üÂë(~K)";
+ Text[ greek ] = "~Êëåéäß";
+ Text[ korean ] = "Å°(~K)";
+ Text[ turkish ] = "~Key";
+ Text[ language_user1 ] = " ";
+ };
+ MetricField NUM_CYAN
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 34 , 109 + DIFF ) ;
+ Size = MAP_APPFONT ( 27 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 100 ;
+ Last = 100 ;
+ Unit = FUNIT_CUSTOM ;
+ CustomUnitText = " %" ;
+ };
+ MetricField NUM_MAGENTA
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 34 , 122 + DIFF ) ;
+ Size = MAP_APPFONT ( 27 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 100 ;
+ Last = 100 ;
+ Unit = FUNIT_CUSTOM ;
+ CustomUnitText = " %" ;
+ };
+ MetricField NUM_YELLOW
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 34 , 135 + DIFF ) ;
+ Size = MAP_APPFONT ( 27 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 100 ;
+ Last = 100 ;
+ Unit = FUNIT_CUSTOM ;
+ CustomUnitText = " %" ;
+ };
+ MetricField NUM_KEY
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 34 , 148 + DIFF ) ;
+ Size = MAP_APPFONT ( 27 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 100 ;
+ Last = 100 ;
+ Unit = FUNIT_CUSTOM ;
+ CustomUnitText = " %" ;
+ };
+ Control CTL_PREVIEW_OLD
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 184 , 109 ) ;
+ Size = MAP_APPFONT ( 35 , 51 + DIFF ) ;
+ TabStop = TRUE ;
+ };
+ Control CTL_PREVIEW
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 219 , 109 ) ;
+ Size = MAP_APPFONT ( 35 , 51 + DIFF ) ;
+ TabStop = TRUE ;
+ };
+ Control VAL_SET_COLOR
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 6 ) ;
+ Size = MAP_APPFONT ( 91 , 100 ) ;
+ TabStop = TRUE ;
+ };
+ FixedText FT_HUE
+ {
+ Pos = MAP_APPFONT ( 117 , 123 + DIFF ) ;
+ Size = MAP_APPFONT ( 35 , 10 ) ;
+ Text = "~Farbe" ;
+ Text [ ENGLISH ] = "H~ue" ;
+ Text [ english_us ] = "H~ue" ;
+ Text [ portuguese_brazilian ] = "~Farbe" ;
+ Text [ swedish ] = "~Färg" ;
+ Text [ danish ] = "Farve" ;
+ Text [ italian ] = "~Colore" ;
+ Text [ spanish ] = "~Color" ;
+ Text [ french ] = "~Teinte" ;
+ Text [ dutch ] = "~Kleur" ;
+ Text [ portuguese ] = "~Tons" ;
+ Text[ chinese_simplified ] = "ÑÕÉ«(~U)";
+ Text[ russian ] = "Öâåò";
+ Text[ polish ] = "Kolor";
+ Text[ japanese ] = "F‡‚¢(~U)";
+ Text[ chinese_traditional ] = "ÃC¦â(~U)";
+ Text[ arabic ] = "Çááæä";
+ Text[ dutch ] = "~Kleur";
+ Text[ chinese_simplified ] = "ÑÕÉ«(~U)";
+ Text[ greek ] = "×ñþìá";
+ Text[ korean ] = "»öÁ¶(~U)";
+ Text[ turkish ] = "~Renk";
+ Text[ language_user1 ] = " ";
+ };
+ NumericField NUM_HUE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 153 , 122 + DIFF ) ;
+ Size = MAP_APPFONT ( 26 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 359 ;
+ Last = 359 ;
+ };
+ FixedText FT_SATURATION
+ {
+ Pos = MAP_APPFONT ( 117 , 136 + DIFF ) ;
+ Size = MAP_APPFONT ( 35 , 10 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? ~Sättigung : ~Sõttigung */
+ /* ### ACHTUNG: Neuer Text in Resource? ~Sättigung : ~Sõttigung */
+ Text = "~Sättigung" ;
+ Text [ ENGLISH ] = "~Saturation" ;
+ Text [ english_us ] = "~Saturation" ;
+ Text [ portuguese_brazilian ] = "~Sättigung" ;
+ Text [ swedish ] = "Mä~ttnad" ;
+ Text [ danish ] = "Mætning" ;
+ Text [ italian ] = "~Saturazione" ;
+ Text [ spanish ] = "~Saturación" ;
+ Text [ french ] = "S~aturation" ;
+ Text [ dutch ] = "~Verzadiging" ;
+ Text [ portuguese ] = "~Saturação" ;
+ Text[ chinese_simplified ] = "±¥ºÍ¶È(~S)";
+ Text[ russian ] = "~Íàñûùåí.";
+ Text[ polish ] = "Nasycenie";
+ Text[ japanese ] = "Ê“x(~S)";
+ Text[ chinese_traditional ] = "¹¡©M«×(~S)";
+ Text[ arabic ] = "ÇáÅÔÈÇÚ";
+ Text[ dutch ] = "~Verzadiging";
+ Text[ chinese_simplified ] = "±¥ºÍ¶È(~S)";
+ Text[ greek ] = "Êïñå~óìüò";
+ Text[ korean ] = "äµµ(~S)";
+ Text[ turkish ] = "~Doygunluk";
+ Text[ language_user1 ] = " ";
+ };
+ NumericField NUM_SATURATION
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 153 , 135 + DIFF ) ;
+ Size = MAP_APPFONT ( 26 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 100 ;
+ Last = 100 ;
+ };
+ FixedText FT_LUMINANCE
+ {
+ Pos = MAP_APPFONT ( 117 , 149 + DIFF ) ;
+ Size = MAP_APPFONT ( 35 , 10 ) ;
+ Text = "He~lligkeit" ;
+ Text [ ENGLISH ] = "~Luminance" ;
+ Text [ english_us ] = "Bright~ness" ;
+ Text [ portuguese_brazilian ] = "He~lligkeit" ;
+ Text [ swedish ] = "~Ljusstyrka" ;
+ Text [ danish ] = "Lysstyrke" ;
+ Text [ italian ] = "~Luminosità" ;
+ Text [ spanish ] = "~Brillo" ;
+ Text [ french ] = "~Luminosité" ;
+ Text [ dutch ] = "Hel~derheid" ;
+ Text [ portuguese ] = "~Brilho" ;
+ Text[ chinese_simplified ] = "ÁÁ¶È(~L)";
+ Text[ russian ] = "ßðêîñòü";
+ Text[ polish ] = "JasnoϾ";
+ Text[ japanese ] = "–¾“x(~L)";
+ Text[ chinese_traditional ] = "«G«×(~L)";
+ Text[ arabic ] = "ÇáÅÖÇÁÉ";
+ Text[ dutch ] = "Hel~derheid";
+ Text[ chinese_simplified ] = "ÁÁ¶È(~L)";
+ Text[ greek ] = "Öùôåéíüôçôá";
+ Text[ korean ] = "¹à±â(~N)";
+ Text[ turkish ] = "Par~laklýk";
+ Text[ language_user1 ] = " ";
+ };
+ NumericField NUM_LUMINANCE
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 153 , 148 + DIFF ) ;
+ Size = MAP_APPFONT ( 26 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Maximum = 100 ;
+ Last = 100 ;
+ };
+ /*
+ FixedText FT_RGB {
+ Pos = MAP_APPFONT( 6, 110 );
+ Size = MAP_APPFONT( 43, 10 );
+ };
+*/
+ PushButton BTN_1
+ {
+ Pos = MAP_APPFONT ( 80 , 109 ) ;
+ Size = MAP_APPFONT ( 17 , 12 ) ;
+ Text = "~<--" ;
+ TabStop = TRUE ;
+ };
+ PushButton BTN_2
+ {
+ Pos = MAP_APPFONT ( 100 , 109 ) ;
+ Size = MAP_APPFONT ( 17 , 12 ) ;
+ Text = "--~>" ;
+ TabStop = TRUE ;
+ };
+ /*
+ PushButton BTN_3 {
+ Pos = MAP_APPFONT( 6, 137 );
+ Size = MAP_APPFONT( 12, 12 );
+ Text = "~3";
+ TabStop = TRUE;
+ };
+ PushButton BTN_4 {
+ Pos = MAP_APPFONT( 21, 137 );
+ Size = MAP_APPFONT( 12, 12 );
+ Text = "~4";
+ TabStop = TRUE;
+ };
+*/
+ Text[ chinese_simplified ] = "ÑÕÉ«";
+ Text[ russian ] = "Öâåò";
+ Text[ polish ] = "Kolor";
+ Text[ japanese ] = "F";
+ Text[ chinese_traditional ] = "ÃC¦â";
+ Text[ arabic ] = "Çááæä";
+ Text[ dutch ] = "Kleur";
+ Text[ chinese_simplified ] = "ÑÕÉ«";
+ Text[ greek ] = "×ñþìá";
+ Text[ korean ] = "»ö»ó";
+ Text[ turkish ] = "Renk";
+ Text[ language_user1 ] = " ";
+};
diff --git a/svtools/source/dialogs/filedlg.cxx b/svtools/source/dialogs/filedlg.cxx
new file mode 100644
index 000000000000..f596badb43e6
--- /dev/null
+++ b/svtools/source/dialogs/filedlg.cxx
@@ -0,0 +1,185 @@
+/*************************************************************************
+ *
+ * $RCSfile: filedlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <filedlg.hxx>
+#include <filedlg2.hxx>
+#include <vcl/rcid.h>
+
+PathDialog::PathDialog( Window* _pParent, WinBits nStyle, BOOL bCreateDir ) :
+ ModalDialog( _pParent, WB_STDMODAL | nStyle )
+{
+ pImpFileDlg = new ImpSvFileDlg;
+ pImpFileDlg->CreateDialog( this, nStyle, WINDOW_PATHDIALOG, bCreateDir );
+}
+
+PathDialog::~PathDialog()
+{
+ delete pImpFileDlg;
+}
+
+short PathDialog::Execute()
+{
+ pImpFileDlg->GetDialog()->PreExecute();
+ short n = ModalDialog::Execute();
+ return n;
+}
+
+UniString PathDialog::GetPath() const
+{
+ return pImpFileDlg->GetDialog()->GetPath();
+}
+
+void PathDialog::SetPath( const UniString& rPath )
+{
+ pImpFileDlg->GetDialog()->SetPath( rPath );
+}
+
+void PathDialog::SetPath( const Edit& rEdit )
+{
+ pImpFileDlg->GetDialog()->SetPath( rEdit );
+}
+
+long PathDialog::OK()
+{
+ if( aOKHdlLink.IsSet() )
+ return aOKHdlLink.Call( this );
+ else
+ return TRUE;
+}
+
+
+FileDialog::FileDialog( Window* _pParent, WinBits nStyle ) :
+ PathDialog( _pParent, WB_STDMODAL | nStyle )
+{
+ // Dadurch dass hier bei VCL nicht der CTOR mit ResType verwendet wird,
+ // wurde im PathDialog-CTOR leider ein ImpPathDialog angelegt...
+ // So zwar scheisse, aber der Dialog ist eh' nur ein Hack:
+ pImpFileDlg->CreateDialog( this, nStyle, WINDOW_FILEDIALOG, FALSE );
+}
+
+FileDialog::~FileDialog()
+{
+}
+
+void FileDialog::AddFilter( const UniString& rFilter, const UniString& rMask )
+{
+ ((ImpFileDialog*)pImpFileDlg->GetDialog())->AddFilter( rFilter, rMask );
+}
+
+void FileDialog::AddFilter( const UniString& rFilter, const UniString& rMask, const UniString& rSysType )
+{
+ ((ImpFileDialog*)pImpFileDlg->GetDialog())->AddFilter( rFilter, rMask );
+}
+
+void FileDialog::RemoveFilter( const UniString& rFilter )
+{
+ ((ImpFileDialog*)pImpFileDlg->GetDialog())->RemoveFilter( rFilter );
+}
+
+void FileDialog::RemoveAllFilter()
+{
+ ((ImpFileDialog*)pImpFileDlg->GetDialog())->RemoveAllFilter();
+}
+
+void FileDialog::SetCurFilter( const UniString& rFilter )
+{
+ ((ImpFileDialog*)pImpFileDlg->GetDialog())->SetCurFilter( rFilter );
+}
+
+UniString FileDialog::GetCurFilter() const
+{
+ return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetCurFilter();
+}
+
+void FileDialog::FileSelect()
+{
+ aFileHdlLink.Call( this );
+}
+
+void FileDialog::FilterSelect()
+{
+ aFilterHdlLink.Call( this );
+}
+
+USHORT FileDialog::GetFilterCount() const
+{
+ return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterCount();
+}
+
+UniString FileDialog::GetFilterName( USHORT nPos ) const
+{
+ return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterName( nPos );
+}
+
+UniString FileDialog::GetFilterType( USHORT nPos ) const
+{
+ return ((ImpFileDialog*)pImpFileDlg->GetDialog())->GetFilterType( nPos );
+}
+
+void FileDialog::SetOkButtonText( const UniString& rText )
+{
+ pImpFileDlg->SetOkButtonText( rText );
+}
+
+void FileDialog::SetCancelButtonText( const UniString& rText )
+{
+ pImpFileDlg->SetCancelButtonText( rText );
+}
diff --git a/svtools/source/dialogs/filedlg2.cxx b/svtools/source/dialogs/filedlg2.cxx
new file mode 100644
index 000000000000..cd798724a878
--- /dev/null
+++ b/svtools/source/dialogs/filedlg2.cxx
@@ -0,0 +1,1377 @@
+/*************************************************************************
+ *
+ * $RCSfile: filedlg2.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+#ifndef _SV_FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _SV_EDIT_HXX //autogen
+#include <vcl/edit.hxx>
+#endif
+#ifndef _SV_LSTBOX_HXX //autogen
+#include <vcl/lstbox.hxx>
+#endif
+#include <svtdata.hxx>
+
+#include <filedlg2.hxx>
+#include <filedlg.hxx>
+#include <filedlg2.hrc>
+
+#ifndef _SV_MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+
+#ifndef _VOS_SECURITY_HXX_
+#include <vos/security.hxx>
+#endif
+
+#include <vcl/rcid.h>
+
+#include <stdctrl.hxx>
+
+#if defined (WNT) && defined (MSC)
+#pragma optimize ("", off)
+#endif
+
+#include <helpid.hrc>
+
+
+DECLARE_LIST( UniStringList, UniString* );
+
+#define STD_BTN_WIDTH 80
+#define STD_BTN_HEIGHT 26
+
+#ifndef UNX
+ #define ALLFILES "*.*"
+#else
+ #define ALLFILES "*"
+#endif
+// #define STD_BTN_WIDTH 90
+// #define STD_BTN_HEIGHT 35
+
+#define INITCONTROL( p, ControlClass, nBits, aPos, aSize, aTitel, nHelpId ) \
+ p = new ControlClass( GetPathDialog(), WinBits( nBits ) ); \
+ p->SetHelpId( nHelpId ); \
+ p->SetPosSizePixel( aPos, aSize ); \
+ p->SetText( aTitel ); \
+ p->Show();
+
+
+inline BOOL IsPrintable( sal_Unicode c )
+{
+ return c >= 32 && c != 127 ? TRUE : FALSE;
+}
+
+long
+KbdListBox::PreNotify( NotifyEvent& rNEvt )
+{
+ if ( rNEvt.GetType() == EVENT_KEYINPUT )
+ {
+ KeyEvent aKeyEvt = *rNEvt.GetKeyEvent();
+ sal_Unicode cCharCode = aKeyEvt.GetCharCode();
+
+ if ( IsPrintable ( cCharCode ) )
+ {
+ USHORT nCurrentPos = GetSelectEntryPos();
+ USHORT nEntries = GetEntryCount();
+
+ for ( USHORT i = 1; i < nEntries; i++ )
+ {
+ UniString aEntry = GetEntry ( (i + nCurrentPos) % nEntries );
+ aEntry.EraseLeadingChars( ' ' );
+ aEntry.ToUpperAscii();
+ UniString aCompare( cCharCode );
+ aCompare.ToUpperAscii();
+
+ if ( aEntry.CompareTo( aCompare, 1 ) == COMPARE_EQUAL )
+ {
+ SelectEntryPos ( (i + nCurrentPos) % nEntries );
+ break;
+ }
+ }
+ }
+ else
+ if ( aKeyEvt.GetKeyCode().GetCode() == KEY_RETURN )
+ {
+ DoubleClick();
+ }
+ }
+
+ return ListBox::PreNotify ( rNEvt );
+}
+
+ImpPathDialog::ImpPathDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType, BOOL bCreateDir )
+{
+ pSvPathDialog = pDlg;
+ nDirCount = 0;
+
+ // initialize Controls if not used as a base class
+ if ( nType == WINDOW_PATHDIALOG )
+ {
+ InitControls();
+ if( pNewDirBtn )
+ pNewDirBtn->Enable( bCreateDir );
+ }
+
+ pDlg->SetHelpId( HID_FILEDLG_PATHDLG );
+}
+
+ImpPathDialog::~ImpPathDialog()
+{
+ delete pEdit;
+ delete pDirTitel;
+ delete pDirList;
+ delete pDirPath;
+ delete pDriveList;
+ delete pDriveTitle;
+ delete pLoadBtn;
+ delete pOkBtn;
+ delete pCancelBtn;
+ delete pNewDirBtn;
+# ifdef UNX
+ delete pHomeBtn;
+# endif
+}
+
+void ImpPathDialog::InitControls()
+{
+ PathDialog* pDlg = GetPathDialog();
+ pDlg->SetText( UniString( SvtResId( STR_FILEDLG_SELECT ) ) );
+
+ Size a3Siz = pDlg->LogicToPixel( Size( 3, 3 ), MAP_APPFONT );
+ Size a6Siz = pDlg->LogicToPixel( Size( 6, 6 ), MAP_APPFONT );
+ Size aBtnSiz = pDlg->LogicToPixel( Size( 70, 14 ), MAP_APPFONT );
+ Size aFTSiz = pDlg->LogicToPixel( Size( 142, 10 ), MAP_APPFONT );
+ Size aEDSiz = pDlg->LogicToPixel( Size( 142, 12 ), MAP_APPFONT );
+ Point aPnt( a6Siz.Width(), a6Siz.Height() );
+ long nLbH1 = pDlg->LogicToPixel( Size( 0, 93 ), MAP_APPFONT ).Height();
+ long nLbH2 = pDlg->LogicToPixel( Size( 0, 60 ), MAP_APPFONT ).Height();
+ long nH = 0;
+ UniString aEmptyStr;
+
+ INITCONTROL( pDirTitel, FixedText, 0,
+ aPnt, aFTSiz, UniString( SvtResId( STR_FILEDLG_DIR ) ), HID_FILEDLG_DIR );
+ aPnt.Y() += aFTSiz.Height() + a3Siz.Height();
+
+ INITCONTROL( pEdit, Edit, WB_BORDER, aPnt, aEDSiz, aPath.GetFull(), HID_FILEDLG_EDIT );
+
+ aPnt.Y() += aEDSiz.Height() + a3Siz.Height();
+#ifndef UNX
+ INITCONTROL( pDirList, KbdListBox, WB_AUTOHSCROLL | WB_BORDER,
+ aPnt, Size( aEDSiz.Width(), nLbH1 ), aEmptyStr, HID_FILEDLG_DIRS );
+ aPnt.Y() += nLbH1 + a6Siz.Height();
+ INITCONTROL( pDriveTitle, FixedText, 0,
+ aPnt, aFTSiz, UniString( SvtResId( STR_FILEDLG_DRIVES ) ), HID_FILEDLG_DRIVE );
+ aPnt.Y() += aFTSiz.Height() + a3Siz.Height();
+ INITCONTROL( pDriveList, ListBox, WB_DROPDOWN,
+ aPnt, Size( aEDSiz.Width(), nLbH2 ), aEmptyStr, HID_FILEDLG_DRIVES );
+ nH = aPnt.Y() + aEDSiz.Height() + a6Siz.Height();
+#else
+ long nNewH = nLbH1 + 3 * a3Siz.Height() +
+ aFTSiz.Height() + aEDSiz.Height();
+ INITCONTROL( pDirList, KbdListBox, WB_AUTOHSCROLL | WB_BORDER,
+ aPnt, Size( aEDSiz.Width(), nNewH ), aEmptyStr, HID_FILEDLG_DIRS );
+ nH = aPnt.Y() + nNewH + a6Siz.Height();
+ pDriveTitle = NULL;
+ pDriveList = NULL;
+#endif
+
+ aPnt.X() = 2 * a6Siz.Width() + aEDSiz.Width();
+ aPnt.Y() = a6Siz.Height();
+ INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
+ aPnt, aBtnSiz, Button::GetStandardText( BUTTON_OK ), 0 );
+ aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
+ INITCONTROL( pCancelBtn, CancelButton, 0,
+ aPnt, aBtnSiz, Button::GetStandardText( BUTTON_CANCEL ), 0 );
+ aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
+ INITCONTROL( pNewDirBtn, PushButton, WB_DEFBUTTON,
+ aPnt, aBtnSiz, UniString( SvtResId( STR_FILEDLG_NEWDIR ) ), HID_FILEDLG_NEWDIR );
+#ifdef UNX
+ aPnt.Y() += aBtnSiz.Height() + a3Siz.Height();
+ INITCONTROL( pHomeBtn, PushButton, WB_DEFBUTTON,
+ aPnt, aBtnSiz, UniString( SvtResId( STR_FILEDLG_HOME ) ), HID_FILEDLG_HOME );
+#else
+ pHomeBtn = NULL;
+#endif
+
+ pDirPath = 0;
+ pLoadBtn = 0;
+ // Dialogbreite == OKBtn-Position + OKBtn-Breite + Rand
+ long nW = aPnt.X() + aBtnSiz.Width() + a6Siz.Width();
+
+ pDlg->SetOutputSizePixel( Size( nW, nH ) ); // Groesse ggf. auch Resource wird geplaettet?
+
+ if (pDirList)
+ pDirList->SetDoubleClickHdl(LINK( this, ImpPathDialog, DblClickHdl) );
+
+ if (pDirList)
+ pDirList->SetSelectHdl( LINK( this, ImpPathDialog, SelectHdl ) );
+
+ if (pDriveList)
+ pDriveList->SetSelectHdl( LINK( this, ImpPathDialog, SelectHdl ) );
+
+ if (pOkBtn)
+ pOkBtn->SetClickHdl( LINK( this, ImpPathDialog, ClickHdl) );
+
+ if (pCancelBtn)
+ pCancelBtn->SetClickHdl( LINK( this, ImpPathDialog, ClickHdl) );
+
+ if (pHomeBtn)
+ pHomeBtn->SetClickHdl( LINK( this, ImpPathDialog, ClickHdl) );
+
+ if (pNewDirBtn)
+ pNewDirBtn->SetClickHdl( LINK( this, ImpPathDialog, ClickHdl) );
+
+ nOwnChilds = pDlg->GetChildCount();
+}
+
+
+
+IMPL_LINK( ImpPathDialog, SelectHdl, ListBox *, p )
+{
+ if( p == pDriveList )
+ {
+ UniString aDrive( pDriveList->GetSelectEntry(), 0, 2);
+ aDrive += '\\';
+ SetPath( aDrive );
+ }
+ else
+ if( p == pDirList )
+ {
+ // isolate the pure name of the entry
+ // removing trainling stuff and leading spaces
+ UniString aEntry( pDirList->GetSelectEntry() );
+
+ aEntry.EraseLeadingChars( ' ' );
+ USHORT nPos = aEntry.Search( '/' );
+ aEntry.Erase( nPos );
+
+ // build the absolute path to the selected item
+ DirEntry aNewPath;
+ aNewPath.ToAbs();
+
+ USHORT nCurPos = pDirList->GetSelectEntryPos();
+
+ // Wird nach oben gewechselt
+ if( nCurPos < nDirCount )
+ aNewPath = aNewPath[nDirCount-nCurPos-1];
+ else
+ aNewPath += aEntry;
+
+ pEdit->SetText( aNewPath.GetFull() );
+ }
+
+ return 0;
+}
+
+
+IMPL_LINK( ImpPathDialog, ClickHdl, Button*, pBtn )
+{
+ if ( pBtn == pOkBtn || pBtn == pLoadBtn )
+ {
+ DirEntry aFile( pEdit->GetText() );
+
+ // Existiert File / File ueberschreiben
+ if( IsFileOk( aFile ) )
+ {
+ // Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden
+ aPath = aFile;
+ aPath.ToAbs();
+ GetPathDialog()->EndDialog( TRUE );
+ }
+ else
+ {
+ DirEntry aCheck( aPath );
+ aCheck += aFile;
+ if( aCheck.Exists() )
+ {
+ aCheck.ToAbs();
+ SetPath( aCheck.GetFull() );
+ pEdit->SetSelection( Selection( 0x7FFFFFFF, 0x7FFFFFFF ) );
+ }
+ }
+ }
+ else
+ if ( pBtn == pCancelBtn )
+ {
+ GetPathDialog()->EndDialog( FALSE );
+ }
+ else
+ if ( pBtn == pHomeBtn )
+ {
+ NAMESPACE_RTL( OUString )aHomeDir;
+ NAMESPACE_VOS( OSecurity ) aSecurity;
+ if ( aSecurity.getHomeDir( aHomeDir ) )
+ {
+ DirEntry aFile ( aHomeDir );
+ if ( IsFileOk( aFile ) )
+ {
+ aFile.ToAbs();
+ SetPath( aFile.GetFull() );
+ }
+ }
+ }
+ else
+ if ( pBtn == pNewDirBtn )
+ {
+ DirEntry aFile( pEdit->GetText() );
+ if( ! aFile.Exists() && ! FileStat( aFile ).IsKind( FSYS_KIND_WILD ) )
+ aFile.MakeDir();
+
+ if( IsFileOk ( aFile ) )
+ {
+ aFile.ToAbs();
+ SetPath( aFile.GetFull() );
+ }
+ }
+
+ return 0;
+}
+
+
+IMPL_LINK( ImpPathDialog, DblClickHdl, ListBox*, pBox )
+{
+ // isolate the pure name of the entry
+ // removing trainling stuff and leading spaces
+ UniString aEntry( pBox->GetSelectEntry() );
+
+ aEntry.EraseLeadingChars( ' ' );
+ USHORT nPos = aEntry.Search( '/' );
+ aEntry.Erase( nPos );
+
+ // build the absolute path to the selected item
+ DirEntry aNewPath;
+ aNewPath.ToAbs();
+ if( pBox == pDirList )
+ {
+ USHORT nCurPos = pDirList->GetSelectEntryPos();
+
+ // Wenn es schon das aktuelle ist, dann mache nichts
+ if( nCurPos == nDirCount-1 )
+ return 0;
+
+ // Wird nach oben gewechselt
+ if( nCurPos < nDirCount )
+ aNewPath = aNewPath[nDirCount-nCurPos-1];
+ else
+ aNewPath += aEntry;
+ }
+ else
+ aNewPath += aEntry;
+
+ USHORT nCurPos = pBox->GetSelectEntryPos();
+
+ pSvPathDialog->EnterWait();
+
+ if( FileStat( aNewPath ).GetKind() & FSYS_KIND_DIR )
+ {
+ // Neuen Pfad setzen und Listboxen updaten
+ aPath = aNewPath;
+ if( !aPath.SetCWD( TRUE ) )
+ {
+ ErrorBox aBox( GetPathDialog(),
+ WB_OK_CANCEL | WB_DEF_OK,
+ UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) );
+ if( aBox.Execute() == RET_CANCEL )
+ GetPathDialog()->EndDialog( FALSE );
+ }
+ UpdateEntries( TRUE );
+ }
+
+ pSvPathDialog->LeaveWait();
+ return 0;
+}
+
+void ImpPathDialog::UpdateEntries( const BOOL dummy_bWithDirs )
+{
+ UniString aTabString;
+ DirEntry aTmpPath;
+ aTmpPath.ToAbs();
+
+ nDirCount = aTmpPath.Level();
+
+ pDirList->SetUpdateMode( FALSE );
+ pDirList->Clear();
+
+ for( USHORT i = nDirCount; i > 0; i-- )
+ {
+ UniString aName( aTabString );
+ aName += aTmpPath[i-1].GetName();
+ pDirList->InsertEntry( aName );
+ aTabString.AppendAscii( " ", 2 );
+ }
+
+ // scan the directory
+ DirEntry aCurrent;
+ aCurrent.ToAbs();
+
+ Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE );
+
+ USHORT nEntries = aDir.Count();
+ if( nEntries )
+ {
+ UniStringList aSortDirList;
+ for ( USHORT n = 0; n < nEntries; n++ )
+ {
+ DirEntry& rEntry = aDir[n];
+ UniString aName( rEntry.GetName() );
+ if( aName.Len() && ( aName.GetChar(0) != '.' ) && rEntry.Exists() )
+ {
+ if( FileStat( rEntry ).GetKind() & FSYS_KIND_DIR )
+ {
+ ULONG l;
+ for( l = 0; l < aSortDirList.Count(); l++ )
+ if( *aSortDirList.GetObject(l) > aName )
+ break;
+ aSortDirList.Insert( new UniString( aName ), l );
+ }
+ }
+ }
+
+ for( ULONG l = 0; l < aSortDirList.Count(); l++ )
+ {
+ UniString aEntryStr( aTabString );
+ aEntryStr += *aSortDirList.GetObject(l);
+ pDirList->InsertEntry( aEntryStr );
+ delete aSortDirList.GetObject(l);
+ }
+ }
+
+ UpdateDirs( aTmpPath );
+}
+
+void ImpPathDialog::UpdateDirs( const DirEntry& rTmpPath )
+{
+ pDirList->SelectEntryPos( nDirCount-1 );
+ pDirList->SetTopEntry( nDirCount > 1
+ ? nDirCount - 2
+ : nDirCount - 1 );
+ pDirList->SetUpdateMode( TRUE );
+ pDirList->Invalidate();
+ pDirList->Update();
+
+ UniString aDirName = rTmpPath.GetFull();
+ if( pDirPath )
+ pDirPath->SetText( aDirName );
+ else
+ pEdit->SetText( aDirName );
+}
+
+BOOL ImpPathDialog::IsFileOk( const DirEntry& rDirEntry )
+{
+ if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) )
+ return FALSE;
+ else
+ {
+ // Datei vorhanden ?
+ if( ! rDirEntry.Exists() )
+ {
+ UniString aQueryTxt( SvtResId( STR_FILEDLG_ASKNEWDIR ) );
+ aQueryTxt.SearchAndReplaceAscii( "%s", rDirEntry.GetFull() );
+ QueryBox aQuery( GetPathDialog(),
+ WB_YES_NO | WB_DEF_YES,
+ aQueryTxt );
+ if( aQuery.Execute() == RET_YES )
+ rDirEntry.MakeDir();
+ else
+ return FALSE;
+ }
+ if( !FileStat( rDirEntry ).IsKind( FSYS_KIND_DIR ) )
+ {
+ UniString aBoxText( SvtResId( STR_FILEDLG_CANTOPENDIR ) );
+ aBoxText.AppendAscii( "\n[" );
+ aBoxText += rDirEntry.GetFull();
+ aBoxText.AppendAscii( "]" );
+ InfoBox aBox( GetPathDialog(), aBoxText );
+ aBox.Execute();
+ return FALSE;
+ }
+ }
+ return GetPathDialog()->OK() != 0;
+}
+
+
+void ImpPathDialog::PreExecute()
+{
+ // Neues Verzeichnis setzen und Listboxen updaten
+ aPath.SetCWD( TRUE );
+ UpdateEntries( TRUE );
+
+ // Zusaetzliche Buttons anordnen
+ Point aPos;
+ Size aSize;
+ long nDY;
+ if( pLoadBtn )
+ {
+ aPos = pLoadBtn->GetPosPixel();
+ aSize = pLoadBtn->GetSizePixel();
+ nDY = pLoadBtn->GetSizePixel().Height() * 2;
+ }
+ else
+ {
+ aPos = pCancelBtn->GetPosPixel();
+ aSize = pCancelBtn->GetSizePixel();
+ nDY = pCancelBtn->GetPosPixel().Y() - pOkBtn->GetPosPixel().Y();
+ }
+
+ // Standard-Controls anpassen
+ long nMaxWidth = 0;
+
+ // Maximale Breite ermitteln
+ USHORT nChilds = GetPathDialog()->GetChildCount();
+ USHORT n;
+ for ( n = nOwnChilds; n < nChilds; n++ )
+ {
+ Window* pChild = GetPathDialog()->GetChild( n );
+ pChild = pChild->GetWindow( WINDOW_CLIENT );
+ if( pChild->GetType() != WINDOW_WINDOW )
+ {
+ long nWidth = pChild->GetTextWidth( pChild->GetText() ) + 12;
+ if( nMaxWidth < nWidth )
+ nMaxWidth = nWidth;
+ nWidth = pChild->GetSizePixel().Width();
+ if( nMaxWidth < nWidth )
+ nMaxWidth = nWidth;
+ }
+ }
+
+ if( nMaxWidth > aSize.Width() )
+ {
+ Size aDlgSize = GetPathDialog()->GetOutputSizePixel();
+ GetPathDialog()->SetOutputSizePixel( Size( aDlgSize.Width()+nMaxWidth-aSize.Width(), aDlgSize.Height() ) );
+ aSize.Width() = nMaxWidth;
+
+ if( pOkBtn )
+ pOkBtn->SetSizePixel( aSize );
+ if( pCancelBtn )
+ pCancelBtn->SetSizePixel( aSize );
+ if( pLoadBtn )
+ pLoadBtn->SetSizePixel( aSize );
+ }
+ else
+ nMaxWidth = aSize.Width();
+
+ for ( n = nOwnChilds; n < nChilds; n++ )
+ {
+ Window* pChild = GetPathDialog()->GetChild( n );
+ pChild = pChild->GetWindow( WINDOW_CLIENT );
+ if( pChild->GetType() != WINDOW_WINDOW )
+ {
+ aPos.Y() += nDY;
+ pChild->SetPosSizePixel( aPos, aSize );
+ }
+ else
+ {
+ Size aDlgSize = GetPathDialog()->GetOutputSizePixel();
+ long nExtra = Min( aDlgSize.Height(), (long)160);
+ GetPathDialog()->SetOutputSizePixel( Size( aDlgSize.Width()+nExtra, aDlgSize.Height() ) );
+ Size aSz( nExtra, nExtra );
+ aSz.Width() -= 8;
+ aSz.Height() -= 8;
+ Point aCtrlPos( aDlgSize.Width() + 2, (aDlgSize.Height()-aSz.Height())/2 );
+ pChild->SetPosSizePixel( aCtrlPos, aSz );
+ }
+ }
+
+ // Laufwerke-LB fuellen
+ if( pDriveList )
+ {
+ DirEntry aTmpDirEntry;
+ Dir aDir( aTmpDirEntry, FSYS_KIND_BLOCK );
+
+ USHORT nCount = aDir.Count(), i;
+ for( i = 0; i < nCount; ++i )
+ {
+ DirEntry& rEntry = aDir[i];
+ UniString aStr = rEntry.GetFull( FSYS_STYLE_HOST, FALSE );
+
+ UniString aVolume = rEntry.GetVolume() ;
+ aStr.ToUpperAscii();
+ if ( aVolume.Len() )
+ {
+ aStr += ' ';
+ aStr += aVolume;
+ }
+ pDriveList->InsertEntry( aStr );
+
+ }
+ UniString aPathStr = aPath.GetFull();
+
+ for ( i = 0; i < pDriveList->GetEntryCount(); ++i )
+ {
+ UniString aEntry = pDriveList->GetEntry(i);
+ int nLen = aEntry.Len();
+ nLen = nLen > 2 ? 2 : nLen;
+ if ( aEntry.CompareIgnoreCaseToAscii( aPathStr, nLen ) == COMPARE_EQUAL )
+ {
+ pDriveList->SelectEntryPos(i);
+ break;
+ }
+ }
+ }
+}
+
+void ImpPathDialog::PostExecute()
+{
+}
+
+void ImpPathDialog::SetPath( UniString const & rPath )
+{
+ aPath = DirEntry( rPath );
+
+ pSvPathDialog->EnterWait();
+
+ DirEntry aFile( rPath );
+ // Falls der Pfad eine Wildcard oder einen Filenamen enthaelt
+ // -> abschneiden und merken
+ if( FileStat( aFile ).GetKind() & (FSYS_KIND_FILE | FSYS_KIND_WILD) || !aFile.Exists() )
+ aFile.CutName();
+
+ // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
+ pEdit->SetText( rPath );
+ aFile.SetCWD( TRUE );
+ UpdateEntries( TRUE );
+
+ pSvPathDialog->LeaveWait();
+}
+
+void ImpPathDialog::SetPath( Edit const & rEdit )
+{
+ UniString aPresetText = rEdit.GetText();
+ if( aPresetText.Len() )
+ SetPath( aPresetText );
+}
+
+
+UniString ImpPathDialog::GetPath() const
+{
+ DirEntry aFile( pEdit->GetText() );
+ aFile.ToAbs();
+ return aFile.GetFull();
+}
+
+
+ImpFileDialog::ImpFileDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType ) :
+ ImpPathDialog( pDlg, nWinBits, nType, FALSE )
+{
+ bOpen = (nWinBits & WB_SAVEAS) == 0;
+
+ SvtResId aSvtResId = bOpen ? STR_FILEDLG_OPEN : STR_FILEDLG_SAVE;
+
+ // Titel setzen
+ GetFileDialog()->SetText( UniString( aSvtResId ) );
+ nDirCount = 0;
+
+ // initialize Controls if not used as a base class
+ if ( nType == WINDOW_FILEDIALOG )
+ InitControls();
+
+ pDlg->SetHelpId( HID_FILEDLG_OPENDLG );
+
+}
+
+ImpFileDialog::~ImpFileDialog()
+{
+ ImpFilterItem* pItem = aFilterList.First();
+ while( pItem )
+ {
+ delete pItem;
+ pItem = aFilterList.Next();
+ }
+
+ delete pFileTitel;
+ if (pFileList && ( pFileList != pDirList ) )
+ delete pFileList;
+
+ delete pTypeTitel;
+ delete pTypeList;
+}
+
+void ImpFileDialog::InitControls()
+{
+ UniString aEmptyStr;
+
+ const nW = 160;
+ const nH = 48; // Um den Dialog in eine akzeptable Form zu bringen
+
+ INITCONTROL( pFileTitel, FixedText, 0,
+ Point(10, 12), Size(nW, 18), UniString( SvtResId( STR_FILEDLG_FILE ) ), HID_FILEDLG_FILE );
+ INITCONTROL( pEdit, Edit, WB_BORDER,
+ Point(10, 31), Size(nW, 20), aEmptyStr, HID_FILEDLG_EDIT ); // aMask()
+ INITCONTROL( pFileList, ListBox, WB_SORT | WB_AUTOHSCROLL | WB_BORDER,
+ Point(10, 58), Size(nW, 180-nH), aEmptyStr, HID_FILEDLG_FILES );
+
+ INITCONTROL( pDirTitel, FixedText, 0,
+ Point(nW+20, 12), Size(nW, 18), UniString( SvtResId( STR_FILEDLG_DIR ) ), HID_FILEDLG_DIR );
+ INITCONTROL( pDirPath, FixedInfo, WB_PATHELLIPSIS,
+ Point(nW+20, 33), Size(nW, 20), aPath.GetFull(), HID_FILEDLG_PATH );
+ INITCONTROL( pDirList, KbdListBox, WB_AUTOHSCROLL | WB_BORDER,
+ Point(nW+20, 58), Size(nW, 180-nH ), aEmptyStr, HID_FILEDLG_DIRS );
+
+ INITCONTROL( pTypeTitel, FixedText, 0,
+ Point(10, 246-nH), Size(nW, 18), UniString( SvtResId( STR_FILEDLG_TYPE ) ), HID_FILEDLG_TYPE );
+
+#ifndef UNX
+ INITCONTROL( pTypeList, ListBox, WB_DROPDOWN,
+ Point(10, 265-nH ), Size(nW, 100 ), aEmptyStr, HID_FILEDLG_TYPES );
+
+ INITCONTROL( pDriveTitle, FixedText, 0,
+ Point(nW+20, 246-nH), Size(nW, 18), UniString( SvtResId( STR_FILEDLG_DRIVES ) ), HID_FILEDLG_DRIVE );
+ INITCONTROL( pDriveList, ListBox, WB_DROPDOWN,
+ Point(nW+20, 265-nH ), Size(nW, 100 ), aEmptyStr, HID_FILEDLG_DRIVES );
+ pNewDirBtn = NULL;
+ pHomeBtn = NULL;
+#else
+ INITCONTROL( pTypeList, ListBox, WB_DROPDOWN,
+ Point(10, 265-nH ), Size(2*nW+20, 100 ), aEmptyStr, HID_FILEDLG_TYPES );
+
+ pDriveTitle = NULL;
+ pDriveList = NULL;
+ pNewDirBtn = NULL;
+ pHomeBtn = NULL;
+#endif
+
+ const long nButtonStartX = 2*nW+20+15;
+ INITCONTROL( pOkBtn, PushButton, WB_DEFBUTTON,
+ Point(nButtonStartX, 10), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
+ Button::GetStandardText( BUTTON_OK ), 0 );
+ INITCONTROL( pCancelBtn, CancelButton, 0,
+ Point(nButtonStartX, 45 ), Size(STD_BTN_WIDTH, STD_BTN_HEIGHT),
+ Button::GetStandardText( BUTTON_CANCEL ), 0 );
+
+ pLoadBtn = 0;
+
+ GetFileDialog()->SetOutputSizePixel( Size(nButtonStartX+STD_BTN_WIDTH+10, 298-nH) );
+
+ nOwnChilds = GetPathDialog()->GetChildCount();
+
+ // Handler setzen
+ if (pDriveList)
+ pDriveList->SetSelectHdl( LINK( this, ImpFileDialog, SelectHdl ) );
+
+ if (pDirList)
+ pDirList->SetDoubleClickHdl(LINK( this, ImpFileDialog, DblClickHdl) );
+
+ if (pOkBtn)
+ pOkBtn->SetClickHdl( LINK( this, ImpFileDialog, ClickHdl) );
+
+ if (pCancelBtn)
+ pCancelBtn->SetClickHdl( LINK( this, ImpFileDialog, ClickHdl) );
+
+ if( pFileList )
+ {
+ pFileList->SetSelectHdl( LINK( this, ImpFileDialog, SelectHdl ) );
+ pFileList->SetDoubleClickHdl( LINK( this, ImpFileDialog, DblClickHdl ) );
+ }
+
+ if( pTypeList )
+ pTypeList->SetSelectHdl( LINK( this, ImpFileDialog, DblClickHdl ) );
+}
+
+IMPL_LINK( ImpFileDialog, SelectHdl, ListBox *, p )
+{
+ if( p == pDriveList )
+ {
+ UniString aDrive ( pDriveList->GetSelectEntry(), 0, 2);
+ aDrive += '\\';
+ SetPath( aDrive );
+ }
+ else if (p == pFileList)
+ {
+ // Ausgewaehltes File in das Edit stellen
+ pEdit->SetText( pFileList->GetSelectEntry() );
+ GetFileDialog()->FileSelect();
+ }
+ return 0;
+}
+
+
+IMPL_LINK( ImpFileDialog, DblClickHdl, ListBox *, pBox )
+{
+ // isolate the pure name of the entry
+ // removing trailing stuff and leading spaces
+ UniString aEntry( pBox->GetSelectEntry() );
+
+ aEntry.EraseLeadingChars( ' ' );
+ USHORT nPos = aEntry.Search( '/' );
+ aEntry.Erase( nPos );
+
+ // build the absolute path to the selected item
+ DirEntry aNewPath;
+ aNewPath.ToAbs();
+
+ if( ( pDirList != pFileList ) && ( pBox == pDirList ) )
+ {
+ // SVLOOK
+ USHORT nCurPos = pDirList->GetSelectEntryPos();
+
+ // Wenn es schon das aktuelle ist, dann mache nichts
+ if( nCurPos == nDirCount-1 )
+ return 0;
+
+ // Wird nach oben gewechselt
+ if( nCurPos < nDirCount )
+ aNewPath = aNewPath[nDirCount-nCurPos-1];
+ else
+ aNewPath += aEntry;
+ }
+ else
+ {
+ // non-SVLOOK
+ if( aEntry == UniString( SvtResId( STR_FILEDLG_GOUP ) ) )
+ aEntry.AssignAscii( ".." );
+ aNewPath += aEntry;
+ }
+
+ if( pBox == pFileList )
+ {
+ DirEntry aFile( aEntry );
+
+ // Abfrage, ob File ueberschrieben werden soll...
+ if( !FileStat(aFile).IsKind(FSYS_KIND_DIR) && IsFileOk( aFile ) )
+ {
+ // dann kompletten Pfad mit Filenamen merken und Dialog beenden
+ aPath = aNewPath;
+ GetFileDialog()->EndDialog( TRUE );
+ }
+ }
+
+ USHORT nCurPos = pBox->GetSelectEntryPos();
+
+ GetFileDialog()->EnterWait();
+
+ UniString aFull = aNewPath.GetFull();
+
+ if( ( ( pBox == pDirList ) && ( pDirList != pFileList ) ) ||
+ ( ( pDirList == pFileList ) && FileStat( aNewPath ).GetKind() & FSYS_KIND_DIR ) )
+ {
+ // Neuen Pfad setzen und Listboxen updaten
+ aPath = aNewPath;
+ if( !aPath.SetCWD( TRUE ) )
+ {
+ if( ErrorBox( GetFileDialog(), WB_OK_CANCEL|WB_DEF_OK,
+ UniString( SvtResId( STR_FILEDLG_CANTCHDIR ) ) ).Execute() == RET_CANCEL )
+ {
+ GetFileDialog()->EndDialog( FALSE );
+ }
+ }
+ UpdateEntries( TRUE );
+ GetFileDialog()->FileSelect();
+ }
+
+ if( pBox == pTypeList )
+ {
+ // Neue Maske setzen, und Listboxen updaten
+ USHORT nCurPos = pTypeList->GetSelectEntryPos();
+ if( nCurPos+1 > (USHORT)aFilterList.Count() )
+ aMask = UniString::CreateFromAscii( ALLFILES );
+ else
+ {
+ UniString aFilterListMask = aFilterList.GetObject( nCurPos )->aMask;
+// if( aFilterListMask.Search( ';' ) == STRING_NOTFOUND ) // kein ; in der Maske
+// aMask = WildCard( aFilterListMask, '\0' );
+// else // ; muss beruecksichtigt werden
+ aMask = WildCard( aFilterListMask, ';' );
+ }
+
+ pEdit->SetText( aMask() );
+ UpdateEntries( FALSE );
+ GetFileDialog()->FilterSelect();
+ }
+
+ GetFileDialog()->LeaveWait();
+
+ return 0;
+}
+
+IMPL_LINK( ImpFileDialog, ClickHdl, Button*, pBtn )
+{
+ if( ( pBtn == pOkBtn ) || ( pBtn == pLoadBtn ) )
+ {
+ DirEntry aFile( pEdit->GetText() );
+
+ // Existiert File / File ueberschreiben
+ if( IsFileOk( aFile ) )
+ {
+ // Ja, dann kompletten Pfad mit Filenamen merken und Dialog beenden
+ aPath = aFile;
+ aPath.ToAbs();
+ GetFileDialog()->EndDialog( TRUE );
+ }
+ else
+ {
+ GetFileDialog()->EnterWait();
+
+ // Falls der Pfad eine Wildcard oder einen Filenamen enthaelt
+ // -> abschneiden und merken
+ if( FileStat( aFile ).GetKind() & (FSYS_KIND_FILE | FSYS_KIND_WILD) || !aFile.Exists() )
+ {
+ aMask = aFile.CutName();
+ }
+
+ // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
+ pEdit->SetText( aMask() );
+ aFile.SetCWD( TRUE );
+ UpdateEntries( TRUE );
+
+ GetFileDialog()->LeaveWait();
+ }
+ }
+ else if( pBtn == pCancelBtn )
+ GetFileDialog()->EndDialog( FALSE );
+
+ return 0;
+}
+
+void ImpFileDialog::UpdateEntries( const BOOL bWithDirs )
+{
+ GetFileDialog()->EnterWait();
+
+ UniString aTabString;
+ DirEntry aTmpPath;
+ aTmpPath.ToAbs();
+ nDirCount = aTmpPath.Level();
+
+ if( pFileList )
+ {
+ pFileList->SetUpdateMode( FALSE );
+ pFileList->Clear();
+ }
+
+ if( bWithDirs && (pDirList != pFileList) )
+ {
+ pDirList->SetUpdateMode( FALSE );
+ pDirList->Clear();
+
+ for( USHORT i = nDirCount; i > 0; i-- )
+ {
+ UniString aEntryStr( aTabString );
+ aEntryStr += aTmpPath[i-1].GetName();
+ pDirList->InsertEntry( aEntryStr );
+ aTabString.AppendAscii( " ", 2 );
+ }
+ }
+
+ // for the combined box insert a '..'
+ // (this happens only if WB_SVLOOK is not set)
+
+ if( pDirList == pFileList && nDirCount != 1 )
+ pFileList->InsertEntry( UniString( SvtResId( STR_FILEDLG_GOUP ) ) );
+
+ // scan the directory
+ DirEntry aCurrent;
+ aCurrent.ToAbs();
+ Dir aDir( aCurrent, FSYS_KIND_DIR|FSYS_KIND_FILE );
+ USHORT nEntries = aDir.Count();
+
+ // TempMask, weil Vergleich case-sensitiv
+ BOOL bMatchCase = FALSE; //aCurrent.IsCaseSensitive();
+ UniString aWildCard( aMask.GetWildCard() );
+ if ( !bMatchCase )
+ aWildCard.ToLowerAscii();
+ WildCard aTmpMask( aWildCard, ';' );
+ if ( nEntries )
+ {
+ UniStringList aSortDirList;
+ for ( USHORT n = 0; n < nEntries; n++ )
+ {
+ DirEntry& rEntry = aDir[n];
+ UniString aName( rEntry.GetName() );
+
+ if( aName.Len() &&
+ ( ( ( aName.GetChar(0) != '.' ) ||
+ ( ( aName.GetChar(0) == '.' ) && ( aMask.GetWildCard() ).GetChar(0) == '.' ) )
+ && rEntry.Exists() ) )
+ {
+ FileStat aFileStat( rEntry );
+ UniString aTmpName( aName );
+ if ( !bMatchCase )
+ aTmpName.ToLowerAscii();
+ if( ( aFileStat.GetKind() & FSYS_KIND_FILE ) && aTmpMask.Matches( aTmpName ) )
+ {
+ ULONG n = aFileStat.GetKind();
+ if( pFileList )
+ pFileList->InsertEntry( aName );
+ }
+ else if( bWithDirs && ( aFileStat.GetKind() & FSYS_KIND_DIR ) )
+ {
+ if( pDirList == pFileList )
+ {
+ UniString aEntryStr( aName );
+ aEntryStr += '/';
+ pDirList->InsertEntry( aEntryStr );
+ }
+ else
+ {
+ ULONG l;
+ for( l = 0; l < aSortDirList.Count(); l++ )
+ if( *aSortDirList.GetObject(l) > aName )
+ break;
+ aSortDirList.Insert( new UniString( aName ), l );
+ }
+ }
+ }
+ }
+ for( ULONG l = 0; l < aSortDirList.Count(); l++ )
+ {
+ UniString aEntryStr( aTabString );
+ aEntryStr += *aSortDirList.GetObject(l);
+ pDirList->InsertEntry( aEntryStr );
+ delete aSortDirList.GetObject(l);
+ }
+ }
+
+ if( bWithDirs )
+ UpdateDirs( aTmpPath );
+
+ if( pFileList )
+ {
+ if ( pDirList == pFileList && nDirCount > 1 )
+ pFileList->SelectEntryPos( 1 );
+ else
+ pFileList->SetNoSelection();
+ pFileList->SetUpdateMode( TRUE );
+ pFileList->Invalidate();
+ pFileList->Update();
+ }
+
+ if( pDriveList )
+ {
+ if( pDirList->GetEntryCount() > 0 )
+ {
+ UniString aStr( pDirList->GetEntry( 0 ) );
+ aStr.Erase( 2 );
+ aStr.ToLowerAscii();
+ pDriveList->SelectEntry( aStr );
+ }
+ }
+
+ GetFileDialog()->LeaveWait();
+}
+
+BOOL ImpFileDialog::IsFileOk( const DirEntry& rDirEntry )
+{
+ if( FileStat( rDirEntry ).GetKind() & (FSYS_KIND_WILD | FSYS_KIND_DEV) )
+ return FALSE;
+ if( FileStat( rDirEntry ).GetKind() & FSYS_KIND_DIR )
+ {
+ if( pFileList )
+ return FALSE;
+ }
+ else if( bOpen )
+ {
+ // Datei vorhanden ?
+ if( !FileStat( rDirEntry ).IsKind( FSYS_KIND_FILE ) )
+ {
+ UniString aErrorString( SvtResId( STR_FILEDLG_CANTOPENFILE ) );
+ aErrorString.AppendAscii( "\n[" );
+ aErrorString += rDirEntry.GetFull();
+ aErrorString += ']';
+ InfoBox aBox( GetFileDialog(),
+ aErrorString );
+ aBox.Execute();
+ return FALSE;
+ }
+ }
+ else
+ {
+ // Datei vorhanden ?
+ if( FileStat( ExtendFileName( rDirEntry ) ).IsKind( FSYS_KIND_FILE ) )
+ {
+ UniString aQueryString( SvtResId( STR_FILEDLG_OVERWRITE ) );
+ aQueryString.AppendAscii( "\n[" );
+ aQueryString += rDirEntry.GetFull();
+ aQueryString += ']';
+ QueryBox aBox( GetFileDialog(),
+ WinBits( WB_YES_NO | WB_DEF_NO ),
+ aQueryString );
+ if( aBox.Execute() != RET_YES )
+ return FALSE;
+ }
+ }
+ return GetFileDialog()->OK() != 0;
+}
+
+void ImpFileDialog::SetPath( UniString const & rPath )
+{
+ aPath = DirEntry( rPath );
+ GetFileDialog()->EnterWait();
+
+ DirEntry aFile( rPath );
+
+ // Falls der Pfad eine Wildcard oder einen Filenamen enthaelt
+ // -> abschneiden und merken
+ if( FileStat( aFile ).GetKind() & (FSYS_KIND_FILE | FSYS_KIND_WILD) || !aFile.Exists() )
+ {
+ aMask = aFile.CutName();
+
+ // Neue Maske und neues Verzeichnis setzen, und Listboxen updaten
+ if( pDirList )
+ {
+ UniString aWildCard( aMask.GetWildCard() );
+ pEdit->SetText( aWildCard );
+ }
+ else
+ pEdit->SetText( rPath );
+ }
+
+ aFile.SetCWD( TRUE );
+
+ UpdateEntries( TRUE );
+
+ GetFileDialog()->LeaveWait();
+}
+
+void ImpFileDialog::SetPath( Edit const& rEdit )
+{
+ UniString aPresetText = rEdit.GetText();
+ if( aPresetText.Len() )
+ SetPath( aPresetText );
+}
+
+
+void ImpFileDialog::AddFilter( const UniString& rFilter, const UniString& rMask )
+{
+ aFilterList.Insert( new ImpFilterItem( rFilter, rMask ), LIST_APPEND );
+ if( pTypeList )
+ pTypeList->InsertEntry( rFilter, LISTBOX_APPEND );
+
+ if( !GetCurFilter().Len() )
+ SetCurFilter( rFilter );
+}
+
+void ImpFileDialog::RemoveFilter( const UniString& rFilter )
+{
+ ImpFilterItem* pItem = aFilterList.First();
+ while( pItem && pItem->aName != rFilter )
+ pItem = aFilterList.Next();
+
+ if( pItem )
+ {
+ delete aFilterList.Remove();
+ if( pTypeList )
+ pTypeList->RemoveEntry( rFilter );
+ }
+}
+
+void ImpFileDialog::RemoveAllFilter()
+{
+ ImpFilterItem* pItem = aFilterList.First();
+ while( pItem )
+ {
+ delete pItem;
+ pItem = aFilterList.Next();
+ }
+ aFilterList.Clear();
+
+ if( pTypeList )
+ pTypeList->Clear();
+}
+
+void ImpFileDialog::SetCurFilter( const UniString& rFilter )
+{
+ if( !pTypeList )
+ return;
+
+ ImpFilterItem* pItem = aFilterList.First();
+ while( pItem && pItem->aName != rFilter )
+ pItem = aFilterList.Next();
+
+ if( pItem )
+ pTypeList->SelectEntryPos( (USHORT)aFilterList.GetCurPos() );
+ else
+ pTypeList->SetNoSelection();
+}
+
+UniString ImpFileDialog::GetCurFilter() const
+{
+ UniString aFilter;
+ if ( pTypeList )
+ aFilter = pTypeList->GetSelectEntry();
+ return aFilter;
+}
+
+void ImpFileDialog::PreExecute()
+{
+ // ListBoxen erst unmittelbar vor Execute fuellen
+ // (damit vor Execute der Pfad umgesetzt werden kann, ohne das immer die
+ // Listboxen sofort upgedatet werden)
+
+ GetFileDialog()->EnterWait();
+
+ // Wenn kein Filter vorhanden, dann auch keine FilterBox
+ if( pTypeList && !pTypeList->GetEntryCount() )
+ {
+ // pTypeList->InsertEntry( "* (all files)" );
+ pTypeTitel->Disable();
+ pTypeList->Disable();
+ }
+
+ if( pTypeList )
+ {
+ USHORT nCurType = pTypeList->GetSelectEntryPos();
+ if( nCurType < aFilterList.Count() )
+ {
+ UniString aFilterListMask = aFilterList.GetObject( nCurType )->aMask;
+ if( aFilterListMask.Search( ';' ) == STRING_NOTFOUND ) // kein ; in der Maske
+ aMask = WildCard( aFilterListMask, '\0' );
+ else // ; in der Maske, muss in der Wildcard beruecksichtigt werden
+ aMask = WildCard( aFilterListMask, ';' );
+ }
+ else
+ aMask = UniString::CreateFromAscii( ALLFILES );
+ }
+ else
+ aMask = UniString::CreateFromAscii( ALLFILES );
+
+ // Neue Maske setzen
+ if( pEdit->GetText().Len() == 0 )
+ pEdit->SetText( aMask() );
+
+ ImpPathDialog::PreExecute();
+
+ GetFileDialog()->LeaveWait();
+}
+
+UniString ImpFileDialog::GetPath() const
+{
+ DirEntry aFile( pEdit->GetText() );
+ return ExtendFileName( aFile );
+}
+
+UniString ImpFileDialog::ExtendFileName( DirEntry aEntry ) const
+{
+ aEntry.ToAbs();
+ // das ganze Theater hier ohnehin nur machen, wenn Dateiname
+ // ohne Extension angegeben wurde
+ if( !aEntry.GetExtension().Len() )
+ {
+ UniString aPostfix; // hier kommt die ausgesuchte Extension herein
+
+ // ist ein Filter mit Extension gesetzt?
+ USHORT nChosenFilterPos = pTypeList->GetSelectEntryPos();
+ if( nChosenFilterPos != LISTBOX_ENTRY_NOTFOUND )
+ {
+ UniString aExtensionMask = GetFileDialog()->GetFilterType( nChosenFilterPos );
+ // aExtension ist z.B. *.sdw, alles bis einschliesslich Punkt abschneiden
+ UniString aExtension = aExtensionMask.Copy( aExtensionMask.Search( '.' )+1 );
+
+ // hat der Filter ueberhaupt eine Extension
+ if( aExtension.Len() )
+ {
+ // keine Wildcards enthalten?
+ if( ( aExtension.Search( '*' ) == STRING_NOTFOUND ) &&
+ ( aExtension.Search( '?' ) == STRING_NOTFOUND ) )
+ {
+ // OK, Filter hat Extension ohne Wildcards -> verwenden
+ aPostfix = aExtension;
+ }
+ else
+ {
+ // Filter hat Extension mit Wildcards (z.B. *.*) -> nicht verwenden
+ aPostfix.Erase();
+ }
+ }
+ else
+ {
+ // Filter hatte keine Extension (schwer vorstellbar) -> nichts anhaengen
+ aPostfix.Erase();
+ }
+ }
+ else
+ {
+ // kein Filter gefunden (merkwÆrdig) -> Default-Extension anhaengen
+ aPostfix = GetFileDialog()->GetDefaultExt();
+ }
+
+ // jetzt kann es mit dem Anhaengen losgehen
+ const sal_Unicode* pExt = aPostfix.GetBuffer();
+ while( *pExt == '*' || *pExt == '?' )
+ pExt++;
+
+ if( *pExt )
+ {
+ UniString aName = aEntry.GetName();
+ if( *pExt != '.' )
+ aName += '.';
+ aName += pExt;
+ aEntry.SetName( aName );
+ }
+ }
+ return aEntry.GetFull();
+}
+
+
+void ImpSvFileDlg::CreateDialog( PathDialog* pSvDlg, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate )
+{
+ delete pDlg;
+ if ( nType == WINDOW_PATHDIALOG )
+ pDlg = new ImpPathDialog( pSvDlg, nStyle, nType, bCreate );
+ else
+ pDlg = new ImpFileDialog( pSvDlg, nStyle, nType );
+}
+
+
diff --git a/svtools/source/dialogs/filedlg2.hrc b/svtools/source/dialogs/filedlg2.hrc
new file mode 100644
index 000000000000..bcb474f0e9db
--- /dev/null
+++ b/svtools/source/dialogs/filedlg2.hrc
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * $RCSfile: filedlg2.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define STR_FILEDLG_SELECT 1000
+#define STR_FILEDLG_CANTCHDIR 1001
+#define STR_FILEDLG_OPEN 1002
+#define STR_FILEDLG_FILE 1003
+#define STR_FILEDLG_DIR 1004
+#define STR_FILEDLG_TYPE 1005
+#define STR_FILEDLG_CANTOPENFILE 1006
+#define STR_FILEDLG_CANTOPENDIR 1007
+#define STR_FILEDLG_OVERWRITE 1008
+#define STR_FILEDLG_GOUP 1009
+#define STR_FILEDLG_SAVE 1010
+#define STR_FILEDLG_DRIVES 1011
+#define STR_FILEDLG_HOME 1012
+#define STR_FILEDLG_NEWDIR 1013
+#define STR_FILEDLG_ASKNEWDIR 1014
diff --git a/svtools/source/dialogs/filedlg2.hxx b/svtools/source/dialogs/filedlg2.hxx
new file mode 100644
index 000000000000..f9f41eb8413d
--- /dev/null
+++ b/svtools/source/dialogs/filedlg2.hxx
@@ -0,0 +1,255 @@
+/*************************************************************************
+ *
+ * $RCSfile: filedlg2.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _FILEDLG2_HXX
+#define _FILEDLG2_HXX
+
+#ifndef _TOOLS_DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#ifndef _FSYS_HXX //autogen
+#include <tools/fsys.hxx>
+#endif
+#ifndef _SV_BUTTON_HXX //autogen wg. PushButton
+#include <vcl/button.hxx>
+#endif
+class FixedText;
+class Edit;
+class ListBox;
+class ListBox;
+class Button;
+
+class PathDialog;
+class FileDialog;
+class ImpPathDialog;
+
+struct ImpFilterItem
+{
+ String aName;
+ String aMask;
+
+ ImpFilterItem( const String & rFilter, const String & rMask )
+ {
+ aName = rFilter;
+ aMask = rMask;
+ }
+};
+
+DECLARE_LIST( ImpFilterList, ImpFilterItem* )
+
+#ifndef _SV_LSTBOX_HXX
+#include <vcl/lstbox.hxx>
+#endif // _SV_LSTBOX_HXX
+
+class KbdListBox : public ListBox
+{
+public:
+
+ KbdListBox( Window* pParent, WinBits nStyle = WB_BORDER )
+ : ListBox ( pParent, nStyle )
+ {};
+
+virtual long PreNotify( NotifyEvent& rNEvt );
+
+};
+
+
+class ImpPathDialog
+{
+ friend class ImpFileDialog;
+
+private:
+ PathDialog* pSvPathDialog;
+ Edit* pEdit;
+ FixedText* pDirTitel;
+ KbdListBox* pDirList;
+ FixedText* pDirPath;
+ ListBox* pDriveList;
+ FixedText* pDriveTitle;
+ PushButton* pLoadBtn;
+ PushButton* pOkBtn;
+ PushButton* pCancelBtn;
+ PushButton* pHomeBtn;
+ PushButton* pNewDirBtn;
+
+ USHORT nOwnChilds;
+
+ DirEntry aPath; // aktuell angewaehlter Pfad
+ USHORT nDirCount; // Anzahl der Verzeichnis-
+ // Verschachtelungen
+
+protected:
+
+ virtual void UpdateEntries( const BOOL bWithDirs );
+ void UpdateDirs( const DirEntry& rTmpPath );
+
+ BOOL IsFileOk( const DirEntry& rDirEntry );
+ void InitControls();
+
+ DECL_LINK( SelectHdl, ListBox * );
+ DECL_LINK( DblClickHdl, ListBox * );
+ DECL_LINK( ClickHdl, Button * );
+
+public:
+ ImpPathDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType, BOOL bCreateDir );
+ virtual ~ImpPathDialog();
+
+ virtual void SetPath( const String& rPath );
+ virtual void SetPath( const Edit& rEdit );
+ virtual String GetPath() const;
+
+ virtual void PreExecute();
+ virtual void PostExecute();
+
+ PathDialog* GetPathDialog() const { return pSvPathDialog; }
+
+ void SetOkButtonText( const String& rText ) { pOkBtn->SetText( rText ); }
+ void SetCancelButtonText( const String& rText ) { pCancelBtn->SetText( rText ); }
+
+};
+
+
+class ImpFileDialog : public ImpPathDialog
+{
+private:
+ FixedText* pFileTitel;
+ ListBox* pFileList;
+ FixedText* pTypeTitel;
+ ListBox* pTypeList;
+
+ WildCard aMask; // aktuelle Maske
+
+ ImpFilterList aFilterList; // Filterliste
+ USHORT nCurFilter; // aktueller Filter
+
+ BOOL bOpen; // TRUE = Open; FALSE = SAVEAS
+
+protected:
+ void InitControls();
+
+ String ExtendFileName( DirEntry aEntry ) const;
+
+ DECL_LINK( SelectHdl, ListBox * );
+ DECL_LINK( DblClickHdl, ListBox * );
+ DECL_LINK( ClickHdl, Button * );
+
+ virtual void UpdateEntries( const BOOL bWithDirs );
+ BOOL IsFileOk( const DirEntry& rDirEntry );
+
+public:
+ ImpFileDialog( PathDialog* pDlg, WinBits nWinBits, RESOURCE_TYPE nType );
+ virtual ~ImpFileDialog();
+
+ void AddFilter( const String& rFilter, const String& rMask );
+ void RemoveFilter( const String& rFilter );
+ void RemoveAllFilter();
+ void SetCurFilter( const String& rFilter );
+ String GetCurFilter() const;
+
+ USHORT GetFilterCount() const { return (USHORT)aFilterList.Count(); }
+ inline String GetFilterName( USHORT nPos ) const;
+ inline String GetFilterType( USHORT nPos ) const;
+
+ virtual void SetPath( const String& rPath );
+ virtual void SetPath( const Edit& rEdit );
+ virtual String GetPath() const;
+
+ virtual void PreExecute();
+
+ FileDialog* GetFileDialog() const { return (FileDialog*)GetPathDialog(); }
+};
+
+inline String ImpFileDialog::GetFilterName( USHORT nPos ) const
+{
+ String aName;
+ ImpFilterItem* pItem = aFilterList.GetObject( nPos );
+ if ( pItem )
+ aName = pItem->aName;
+ return aName;
+}
+
+inline String ImpFileDialog::GetFilterType( USHORT nPos ) const
+{
+ String aMask;
+ ImpFilterItem* pItem = aFilterList.GetObject( nPos );
+ if ( pItem )
+ aMask = pItem->aMask;
+ return aMask;
+}
+
+class ImpSvFileDlg
+{
+private:
+ ImpPathDialog* pDlg;
+
+public:
+ ImpSvFileDlg() { pDlg = 0; }
+ ~ImpSvFileDlg() { delete pDlg; }
+
+ ImpPathDialog* GetDialog() const { return pDlg; }
+ void CreateDialog( PathDialog* pCreateFrom, WinBits nStyle, RESOURCE_TYPE nType, BOOL bCreate );
+
+ void SetOkButtonText( const String& rText ) { pDlg->SetOkButtonText( rText ); } // ihr habts ja nicht anders gewollt
+ void SetCancelButtonText( const String& rText ) { pDlg->SetCancelButtonText( rText ); }
+
+};
+
+#endif // _FILEDLG2_HXX
diff --git a/svtools/source/dialogs/filedlg2.src b/svtools/source/dialogs/filedlg2.src
new file mode 100644
index 000000000000..45364d5cbb31
--- /dev/null
+++ b/svtools/source/dialogs/filedlg2.src
@@ -0,0 +1,422 @@
+/*************************************************************************
+ *
+ * $RCSfile: filedlg2.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <filedlg2.hrc>
+String STR_FILEDLG_SELECT
+{
+ Text = "Verzeichnis auswählen" ;
+ Text [ ENGLISH ] = "Select" ;
+ Text [ portuguese ] = "Seleccionar directório" ;
+ Text [ english_us ] = "Select Directory" ;
+ Text [ portuguese_brazilian ] = "Verzeichnis auswählen" ;
+ Text [ swedish ] = "Välj mapp" ;
+ Text [ danish ] = "Vælg bibliotek" ;
+ Text [ italian ] = "Scelta cartella" ;
+ Text [ spanish ] = "Seleccionar directorio" ;
+ Text [ french ] = "Sélection du répertoire" ;
+ Text [ dutch ] = "Map selecteren" ;
+ Text[ chinese_simplified ] = "Ñ¡ÔñĿ¼";
+ Text[ russian ] = "Âûáîð êàòàëîãà";
+ Text[ polish ] = "Wybierz katalog";
+ Text[ japanese ] = "ÃÞ¨Ú¸ÄØ‚ð‘I‘ð";
+ Text[ chinese_traditional ] = "¿ï¾Ü¥Ø¿ý";
+ Text[ arabic ] = "ÊÍÏíÏ ÇáÏáíá";
+ Text[ greek ] = "ÅðéëïãÞ êáôáëüãïõ";
+ Text[ korean ] = "µð·ºÅ丮 ¼±ÅÃ";
+ Text[ turkish ] = "Dizin seç";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_CANTCHDIR
+{
+ Text = "Kann nicht in Verzeichnis wechseln" ;
+ Text [ ENGLISH ] = "Can't change directory" ;
+ Text [ english_us ] = "Cannot change to directory" ;
+ Text [ portuguese_brazilian ] = "Kann nicht in Verzeichnis wechseln" ;
+ Text [ swedish ] = "Kan inte byta mapp" ;
+ Text [ danish ] = "Kan ikke skifte til bibliotek" ;
+ Text [ italian ] = "Impossibile passare alla cartella" ;
+ Text [ spanish ] = "No es posible cambiar en directorio" ;
+ Text [ french ] = "Impossible de changer le répertoire" ;
+ Text [ dutch ] = "Kan niet in map komen" ;
+ Text [ portuguese ] = "Impossível mudar para directório" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨×ªµ½Ä¿Â¼";
+ Text[ russian ] = "Ñìåíèòü êàòàëîã íåâîçìîæíî";
+ Text[ polish ] = "Nie mo¿e zmieniæ katalogu";
+ Text[ japanese ] = "ÃÞ¨Ú¸ÄØ‚ð•ÏX‚Å‚«‚Ü‚¹‚ñB";
+ Text[ chinese_traditional ] = "µLªkÂà¨ì¥Ø¿ý";
+ Text[ arabic ] = "áÇ íãßä ÊÛííÑ ÇáÏáíá";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá ãßíåé áëëáãÞ óôïí êáôÜëïãï";
+ Text[ korean ] = "µð·ºÅ丮¸¦ º¯°æÇÒ ¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Dizin deðiþtirilemiyor";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_OPEN
+{
+ Text = "Öffnen" ;
+ Text [ ENGLISH ] = "Open" ;
+ Text [ portuguese ] = "Abrir" ;
+ Text [ english_us ] = "Open" ;
+ Text [ portuguese_brazilian ] = "Öffnen" ;
+ Text [ swedish ] = "Öppna" ;
+ Text [ danish ] = "Åbn" ;
+ Text [ italian ] = "Apri" ;
+ Text [ spanish ] = "Abrir" ;
+ Text [ french ] = "Ouvrir" ;
+ Text [ dutch ] = "Openen" ;
+ Text[ chinese_simplified ] = "´ò¿ª";
+ Text[ russian ] = "Îòêðûòü";
+ Text[ polish ] = "Otwórz";
+ Text[ japanese ] = "ŠJ‚­";
+ Text[ chinese_traditional ] = "¶}±ÒÂÂÀÉ";
+ Text[ arabic ] = "ÝÊÍ";
+ Text[ greek ] = "¢íïéãìá";
+ Text[ korean ] = "¿­±â";
+ Text[ turkish ] = "Aç";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_FILE
+{
+ Text = "~Datei" ;
+ Text [ ENGLISH ] = "~File" ;
+ Text [ portuguese ] = "~Ficheiro" ;
+ Text [ english_us ] = "~File" ;
+ Text [ portuguese_brazilian ] = "Datei" ;
+ Text [ swedish ] = "F~il" ;
+ Text [ danish ] = "Fil" ;
+ Text [ italian ] = "File" ;
+ Text [ spanish ] = "~Archivo" ;
+ Text [ french ] = "~Fichier" ;
+ Text [ dutch ] = "~Bestand" ;
+ Text[ chinese_simplified ] = "Îļþ(~F)";
+ Text[ russian ] = "~Ôàéë";
+ Text[ polish ] = "Plik";
+ Text[ japanese ] = "̧²Ù(~F)";
+ Text[ chinese_traditional ] = "ÀÉ®×(~F)";
+ Text[ arabic ] = "ãáÝ";
+ Text[ greek ] = "Áñ÷åßï";
+ Text[ korean ] = "ÆÄÀÏ(~F)";
+ Text[ turkish ] = "~Dosya";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_DIR
+{
+ Text = "~Verzeichnis" ;
+ Text [ ENGLISH ] = "~Directory" ;
+ Text [ portuguese ] = "~Directório" ;
+ Text [ english_us ] = "~Directory" ;
+ Text [ portuguese_brazilian ] = "Verzeichnis" ;
+ Text [ swedish ] = "Mapp" ;
+ Text [ danish ] = "Bibliotek" ;
+ Text [ italian ] = "Cartella" ;
+ Text [ spanish ] = "~Directorio" ;
+ Text [ french ] = "~Répertoire" ;
+ Text [ dutch ] = "~Directory" ;
+ Text[ chinese_simplified ] = "Ŀ¼(~D)";
+ Text[ russian ] = "Êàòàëîã";
+ Text[ polish ] = "Katalog";
+ Text[ japanese ] = "ÃÞ¨Ú¸ÄØ(~D)";
+ Text[ chinese_traditional ] = "¥Ø¿ý(~D)";
+ Text[ arabic ] = "Ïáíá";
+ Text[ greek ] = "ÊáôÜëïãïò";
+ Text[ korean ] = "µð·ºÅ丮(~D)";
+ Text[ turkish ] = "~Dizin";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_TYPE
+{
+ Text = "Datei~typ" ;
+ Text [ ENGLISH ] = "File ~type" ;
+ Text [ portuguese ] = "~Tipo de ficheiro" ;
+ Text [ english_us ] = "File ~type" ;
+ Text [ portuguese_brazilian ] = "Dateityp" ;
+ Text [ swedish ] = "Fil~typ" ;
+ Text [ danish ] = "Filtype" ;
+ Text [ italian ] = "Tipo di file" ;
+ Text [ spanish ] = "Tipo de ar~chivo" ;
+ Text [ french ] = "~Type de fichier" ;
+ Text [ dutch ] = "Bestand~type" ;
+ Text[ chinese_simplified ] = "ÎļþÀàÐÍ(~T)";
+ Text[ russian ] = "Òèï ôàéëà";
+ Text[ polish ] = "Typ pliku";
+ Text[ japanese ] = "̧²Ù‚ÌŽí—Þ(~T)";
+ Text[ chinese_traditional ] = "ÀÉ®×Ãþ«¬(~T)";
+ Text[ arabic ] = "äæÚ ÇáãáÝ";
+ Text[ greek ] = "Ôýðïò áñ÷åßïõ";
+ Text[ korean ] = "ÆÄÀÏ ÇüÅÂ(~T)";
+ Text[ turkish ] = "Dosya ~tipi";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_CANTOPENFILE
+{
+ Text = "Kann Datei nicht öffnen" ;
+ Text [ English ] = "Can't open file" ;
+ Text [ portuguese ] = "Impossível abrir ficheiro" ;
+ Text [ english_us ] = "Can't open file" ;
+ Text [ portuguese_brazilian ] = "Kann Datei nicht öffnen" ;
+ Text [ swedish ] = "Kan inte öppna fil" ;
+ Text [ danish ] = "Kan ikke åbne fil" ;
+ Text [ italian ] = "Impossibile aprire il file" ;
+ Text [ spanish ] = "No es posible abrir el archivo" ;
+ Text [ french ] = "Impossible d'ouvrir le fichier" ;
+ Text [ dutch ] = "Kan bestand niet openen" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨´ò¿ªÎļþ";
+ Text[ russian ] = "Îòêðûòü ôàéë íåâîçìîæíî";
+ Text[ polish ] = "Nie mo¿e otworzyæ pliku";
+ Text[ japanese ] = "̧²Ù‚ðŠJ‚­‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñB";
+ Text[ chinese_traditional ] = "µLªk¶}±ÒÀÉ®×";
+ Text[ arabic ] = "áÇ íãßä ÝÊÍ ÇáãáÝ";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá áíïé÷èåß ôï áñ÷åßï";
+ Text[ korean ] = "ÆÄÀÏÀ» ¿­ ¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Dosya açýlamýyor";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_CANTOPENDIR
+{
+ Text = "Kann Verzeichnis nicht öffnen" ;
+ Text [ English ] = "Can't open directory" ;
+ Text [ portuguese ] = "Impossível abrir directório" ;
+ Text [ english_us ] = "Can't open directory" ;
+ Text [ portuguese_brazilian ] = "Kann Verzeichnis nicht öffnen" ;
+ Text [ swedish ] = "Kan inte öppna mappen" ;
+ Text [ danish ] = "Kan ikke åbne bibliotek" ;
+ Text [ italian ] = "Imposibile aprire la cartella" ;
+ Text [ spanish ] = "No es posible abrir el directorio" ;
+ Text [ french ] = "Impossible d'ouvrir le répertoire" ;
+ Text [ dutch ] = "Kan map niet openen" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨´ò¿ªÄ¿Â¼";
+ Text[ russian ] = "Îòêðûòü êàòàëîã íåâîçìîæíî";
+ Text[ polish ] = "Nie mo¿e otworzyæ katalogu";
+ Text[ japanese ] = "ÃÞ¨Ú¸ÄØ‚ðŠJ‚­‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñB";
+ Text[ chinese_traditional ] = "µLªk¶}±Ò¥Ø¿ý";
+ Text[ arabic ] = "áÇ íãßä ÝÊÍ ÇáÏáíá";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá áíïé÷èåß ï êáôÜëïãïò";
+ Text[ korean ] = "µð·ºÅ丮¸¦ ¿­ ¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Dizin açýlamýyor";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_OVERWRITE
+{
+ Text = "Datei existiert. \nDatei überschreiben?" ;
+ Text [ English ] = "File exists. \nOverwrite file?" ;
+ Text [ portuguese ] = "O ficheiro já existe.\nSobregravar?" ;
+ Text [ english_us ] = "This file already exists. \nOverwrite ?" ;
+ Text [ portuguese_brazilian ] = "Datei existiert. \nDatei überschreiben?" ;
+ Text [ swedish ] = "Filen finns redan. \nSkriva över filen?" ;
+ Text [ danish ] = "Filen eksisterer allerede.\nSkal den overskrives?" ;
+ Text [ italian ] = "Il file esistet. \nSovrascriverlo?" ;
+ Text [ spanish ] = "El archivo ya existe.\n¿Desea sobrescribirlo?" ;
+ Text [ french ] = "Ce fichier existe déjà. \nVoulez-vous le remplacer ?" ;
+ Text [ dutch ] = "Het bestand bestaat reeds. \nOverschrijven?" ;
+ Text[ chinese_simplified ] = "Îļþ´æÔÚ¡£ \nÄúÒª¸²Ð´ÎļþÂð£¿";
+ Text[ russian ] = "Ýòî ôàéë óæå ñóùåñòâóåò. \nÏåðåïèñàòü åãî?";
+ Text[ polish ] = "Plik ju¿ istnieje. \nSkasowaæ plik przez zapisanie?";
+ Text[ japanese ] = "̧²Ù‚Í‚ ‚è‚Ü‚·B \nã‘‚«‚µ‚Ü‚·‚©H";
+ Text[ chinese_traditional ] = "Àɮצs¦b¡C \n±z­nÂмgÀɮסH";
+ Text[ arabic ] = "åÐÇ ÇáãáÝ ãæÌæÏ ãÓÈÞÇð.\nåá ÊÑíÏ ÇáßÊÇÈÉ ÝæÞå¿";
+ Text[ greek ] = "Ôï áñ÷åßï áõôü õðÜñ÷åé Þäç. \nÍá áíôéêáôáóôáèåß;";
+ Text[ korean ] = "ÀÌ ÆÄÀÏÀº ÀÌ¹Ì Á¸ÀçÇÕ´Ï´Ù. \n µ¤¾î ¾²½Ã°Ú½À´Ï±î ?";
+ Text[ turkish ] = "Dosya mevcut. \nÜzerine yazýlsýn mý?";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_GOUP
+{
+ Text = "Eine Ebene höher" ;
+ Text [ English ] = "Go up" ;
+ Text [ portuguese ] = "Um nível acima" ;
+ Text [ english_us ] = "Up One Level" ;
+ Text [ portuguese_brazilian ] = "Eine Ebene höher" ;
+ Text [ swedish ] = "En nivå högre" ;
+ Text [ danish ] = "Et niveau op" ;
+ Text [ italian ] = "Un livello più alto" ;
+ Text [ spanish ] = "Subir un nivel" ;
+ Text [ french ] = "Niveau supérieur" ;
+ Text [ dutch ] = "Een niveau hoger" ;
+ Text[ chinese_simplified ] = "ÏòÉÏÉýÒ»¼¶";
+ Text[ russian ] = "Íà îäèí óðîâåíü ââåðõ";
+ Text[ polish ] = "Jeden poziom wy¿ej";
+ Text[ japanese ] = "ˆê‚Âã‚ÌÌ«ÙÀÞ‚Ö";
+ Text[ chinese_traditional ] = "¦V¤Wª@¤@¯Å";
+ Text[ arabic ] = "ãÓÊæì æÇÍÏ ááÃÚáì";
+ Text[ greek ] = "¸íá åðßðåäï ðéï øçëÜ";
+ Text[ korean ] = "ÇÑ ¼öÁØ À§·Î";
+ Text[ turkish ] = "Bir seviye yukarý";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_SAVE
+{
+ Text = "Speichern" ;
+ Text [ English ] = "Save" ;
+ Text [ portuguese ] = "Guardar" ;
+ Text [ english_us ] = "Save" ;
+ Text [ portuguese_brazilian ] = "Speichern" ;
+ Text [ swedish ] = "Spara" ;
+ Text [ danish ] = "Gem" ;
+ Text [ italian ] = "Salva" ;
+ Text [ spanish ] = "Guardar" ;
+ Text [ french ] = "Enregistrer" ;
+ Text [ dutch ] = "Opslaan" ;
+ Text[ chinese_simplified ] = "´æÅÌ";
+ Text[ russian ] = "Ñîõðàíèòü";
+ Text[ polish ] = "Zapisz";
+ Text[ japanese ] = "•Û‘¶";
+ Text[ chinese_traditional ] = "Àx¦s";
+ Text[ arabic ] = "ÍÝÙ";
+ Text[ greek ] = "ÁðïèÞêåõóç";
+ Text[ korean ] = "ÀúÀå";
+ Text[ turkish ] = "Kaydet";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_DRIVES
+{
+ Text = "~Laufwerke" ;
+ Text [ English ] = "D~rives" ;
+ Text [ portuguese ] = "~Unidades" ;
+ Text [ english_us ] = "D~rive" ;
+ Text [ portuguese_brazilian ] = "Unidades" ;
+ Text [ swedish ] = "~Enheter" ;
+ Text [ danish ] = "Drev" ;
+ Text [ italian ] = "Drive" ;
+ Text [ spanish ] = "~Unidades" ;
+ Text [ french ] = "~Lecteurs" ;
+ Text [ dutch ] = "~Stations" ;
+ Text[ chinese_simplified ] = "Çý¶¯ÅÌ(~R)";
+ Text[ russian ] = "Äèñêè";
+ Text[ polish ] = "Napêdy";
+ Text[ japanese ] = "ÄÞײÌÞ(~R)";
+ Text[ chinese_traditional ] = "ÅX°Ê¾¹(~R)";
+ Text[ arabic ] = "ãÍÑßÇÊ ÇáÃÞÑÇÕ";
+ Text[ greek ] = "ÌïíÜäá äßóêïõ";
+ Text[ korean ] = "µå¶óÀ̺ê(~R)";
+ Text[ turkish ] = "~Sürücü";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_HOME
+{
+ Text = "Benutzer Verzeichnis" ;
+ Text [ ENGLISH ] = "Home Directory" ;
+ Text [ portuguese ] = "Directório do utilizador" ;
+ Text [ english_us ] = "User Directory" ;
+ Text [ portuguese_brazilian ] = "Verzeichnis" ;
+ Text [ swedish ] = "Användarmapp" ;
+ Text [ danish ] = "Brugerbibliotek" ;
+ Text [ italian ] = "Cartella utente" ;
+ Text [ spanish ] = "Directorio de usuario" ;
+ Text [ french ] = "Répertoire d'utilisateur" ;
+ Text [ dutch ] = "Gebruikers-map" ;
+ Text[ chinese_simplified ] = "ʹÓÃÕßĿ¼";
+ Text[ russian ] = "Êàòàëîã ïîëüçîâàòåëÿ";
+ Text[ polish ] = "Katalog u¿ytkowników";
+ Text[ japanese ] = "Õ°»Þ°‚ÌÃÞ¨Ú¸ÄØ";
+ Text[ chinese_traditional ] = "¦Û­q¥Ø¿ý";
+ Text[ arabic ] = "Ïáíá ÇáãÓÊÎÏã";
+ Text[ greek ] = "ÊáôÜëïãïò ÷ñÞóôç";
+ Text[ korean ] = "»ç¿ëÀÚ µð·ºÅ丮";
+ Text[ turkish ] = "Kullanýcý dizini";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_NEWDIR
+{
+ Text = "Verzeichnis anlegen" ;
+ Text [ ENGLISH ] = "Create Directory" ;
+ Text [ portuguese ] = "Criar directório" ;
+ Text [ english_us ] = "Create Directory" ;
+ Text [ portuguese_brazilian ] = "Verzeichnis" ;
+ Text [ swedish ] = "Skapa mapp" ;
+ Text [ danish ] = "Opret bibliotek" ;
+ Text [ italian ] = "Crea cartella" ;
+ Text [ spanish ] = "Crear directorio" ;
+ Text [ french ] = "Créer un répertoire" ;
+ Text [ dutch ] = "Map maken" ;
+ Text[ chinese_simplified ] = "´´½¨Ä¿Â¼";
+ Text[ russian ] = "Ñîçäàòü êàòàëîã";
+ Text[ polish ] = "Utwórz katalog";
+ Text[ japanese ] = "ÃÞ¨Ú¸ÄØ‚ðì¬";
+ Text[ chinese_traditional ] = "«Ø¥ß¥Ø¿ý";
+ Text[ arabic ] = "ÅäÔÇÁ Ïáíá";
+ Text[ greek ] = "Äçìéïõñãßá êáôáëüãïõ";
+ Text[ korean ] = "µð·ºÅ丮 ¸¸µé±â";
+ Text[ turkish ] = "Dizin oluþtur";
+ Text[ language_user1 ] = " ";
+};
+String STR_FILEDLG_ASKNEWDIR
+{
+ Text = "Soll das Verzeichnis %s angelegt werden ?" ;
+ Text [ English ] = "Do you want the directory %s to be created ?" ;
+ Text [ english_us ] = "Do you want the directory %s to be created ?" ;
+ Text [ portuguese_brazilian ] = "Soll das Verzeichnis %s angelegt werden ?" ;
+ Text [ swedish ] = "Skall mappen %s skapas ?" ;
+ Text [ danish ] = "Skal biblioteket %s oprettes?" ;
+ Text [ italian ] = "Si deve creare una cartella %s ?" ;
+ Text [ spanish ] = "¿Desea crear el directorio %s?" ;
+ Text [ french ] = "Souhaitez vous créer le répertoire %s ?" ;
+ Text [ dutch ] = "Wilt u dat map %s wordt aangelegd ?" ;
+ Text [ portuguese ] = "Deseja criar o directório %s ?" ;
+ Text[ chinese_simplified ] = "ÄúÒª½¨Á¢Õâ¸öĿ¼ %s £¿";
+ Text[ russian ] = "Ñîçäàòü êàòàëîã %s ?";
+ Text[ polish ] = "Czy utworzyæ katalog %s?";
+ Text[ japanese ] = "ÃÞ¨Ú¸ÄØ%s‚ð쬂µ‚Ü‚·‚©?";
+ Text[ chinese_traditional ] = "±z­n«Ø¥ß³o­Ó¥Ø¿ý %s ¡H";
+ Text[ arabic ] = "åá ÊÑíÏ ÅäÔÇÁ ÇáÏáíá %s¿";
+ Text[ greek ] = "ÈÝëåôå íá äçìéïõñãçèåß ï êáôÜëïãïò %s;";
+ Text[ korean ] = "µð·ºÅ丮 %s ¸¦ ¸¸µå½Ã°Ú½À´Ï±î ?";
+ Text[ turkish ] = "%s oluþturulsun mu ?";
+ Text[ language_user1 ] = " ";
+};
diff --git a/svtools/source/dialogs/makefile.mk b/svtools/source/dialogs/makefile.mk
new file mode 100644
index 000000000000..9a0dada89c60
--- /dev/null
+++ b/svtools/source/dialogs/makefile.mk
@@ -0,0 +1,93 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=dialogs
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+SRCFILES= filedlg2.src \
+ prnsetup.src \
+ printdlg.src \
+ colrdlg.src
+
+SLOFILES= $(SLO)$/filedlg.obj \
+ $(SLO)$/filedlg2.obj \
+ $(SLO)$/prnsetup.obj \
+ $(SLO)$/printdlg.obj \
+ $(SLO)$/colctrl.obj \
+ $(SLO)$/colrdlg.obj \
+ $(SLO)$/property.obj \
+ $(SLO)$/wizdlg.obj \
+ $(SLO)$/mcvmath.obj
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/dialogs/mcvmath.cxx b/svtools/source/dialogs/mcvmath.cxx
new file mode 100644
index 000000000000..e4127fab5579
--- /dev/null
+++ b/svtools/source/dialogs/mcvmath.cxx
@@ -0,0 +1,336 @@
+/*************************************************************************
+ *
+ * $RCSfile: mcvmath.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <mcvmath.hxx>
+
+// ---------------------------------------------------------------------
+// die folgenden Tabellen enthalten sin(phi) * 2**14
+// fuer phi= 360Grad*2**-32 bis 360 Grad
+// def. fuer x: phi=360Grad * 2**(x-16)
+// d.h. x = 16 -> 360 Grad
+// x = -16 -> (2**-16) * 360 Grad
+// x: -16 ... 0 ... 15
+//x= 0, 1, 2, 3, 4, 5, 6, 7,
+// 8, 9, 10, 11, 12, 13, 14, 15
+
+static const short CosTab[16] =
+{
+ 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16383,
+ 16379, 16364, 16305, 16069, 15137, 11585, 0, -16383
+};
+static const short SinTab[16]=
+{
+ 2, 3, 6, 13, 25, 50, 101, 201,
+ 402, 804, 1606, 3196, 6270, 11585, 16384, 0
+};
+
+/**************************************************************************
+|*
+|* ImpMultBig2()
+|*
+|* Beschreibung Multiplikation fuer FixPoint-Berechnungen
+|* Ersterstellung SH 01.07.93
+|* Letzte Aenderung SH 01.07.93
+|*
+**************************************************************************/
+
+// first parameter should be the bigger one
+
+Fix ImpMultBig2( const Fix& a, const Fix& b )
+{
+ Fix f;
+ f.x = (((b.x+FIX_A2)>>FIX_P2)*a.x+FIX_A3)>>FIX_P3;
+ return f;
+}
+
+/**************************************************************************
+|*
+|* ImpMultBig2()
+|*
+|* Beschreibung Multiplikation fuer FixPoint-Berechnungen
+|* Ersterstellung SH 01.07.93
+|* Letzte Aenderung SH 01.07.93
+|*
+**************************************************************************/
+
+// first parameter should be the bigger one
+
+FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb )
+{
+ Fix rr = ImpMultBig2(ra.r,rb.r)-ImpMultBig2(ra.i,rb.i);
+ Fix ii = ImpMultBig2(ra.r,rb.i)+ImpMultBig2(ra.i,rb.r);
+ return FixCpx( rr,ii );
+}
+
+/**************************************************************************
+|*
+|* ImpSqrt()
+|*
+|* Beschreibung Wurzelfunktion fuer FixPoint-Berechnungen
+|* Ersterstellung SH 01.07.93
+|* Letzte Aenderung SH 01.07.93
+|*
+**************************************************************************/
+
+USHORT ImpSqrt( ULONG nRadi )
+{
+ register ULONG inf = 1;
+ register ULONG sup = nRadi;
+ register USHORT sqr;
+
+ if ( !nRadi )
+ return 0;
+
+ while ( (inf<<1) <= sup )
+ {
+ sup >>= 1;
+ inf <<= 1;
+ }
+ sqr = (sup+inf) >> 1; // Anfangswert der Iteration
+
+ sqr = (nRadi/sqr + sqr) >> 1; // 2 Newton-Iterationen reichen fuer
+ sqr = (nRadi/sqr + sqr) >> 1; // +- 1 Digit
+
+ return sqr;
+}
+
+/**************************************************************************
+|*
+|* ImpExPI()
+|*
+|* Beschreibung EXPI-Funktion fuer FixPoint-Berechnungen
+|* Ersterstellung SH 01.07.93
+|* Letzte Aenderung SH 01.07.93
+|*
+**************************************************************************/
+
+// e**(i*nPhi), Einheit nPhi: 2**16 == 360 Grad
+
+FixCpx ImpExPI( USHORT nPhi )
+{
+ short i;
+ FixCpx aIter(1L); // e**(0*i)
+ FixCpx Mul;
+ const char Sft=14-FIX_POST;
+
+ for ( i = 15; i >= 0; i-- )
+ {
+ if ( (1L<<i) & nPhi )
+ {
+ Mul.r.x = CosTab[i]>>Sft; // e**(i(phi1+phi2)) =
+ Mul.i.x = SinTab[i]>>Sft; // e**(i*phi1)) * e**(i*phi2))
+ aIter *= Mul;
+ }
+ }
+
+ return aIter;
+}
+
+/**************************************************************************
+|*
+|* ImpATanx2()
+|*
+|* Beschreibung ATANX2-Funktion fuer FixPoint-Berechnungen
+|* Ersterstellung SH 01.07.93
+|* Letzte Aenderung SH 01.07.93
+|*
+**************************************************************************/
+
+// use for x*x+y*y==1 only
+
+static USHORT ImpATanx2( const Fix& rX, const Fix& rY )
+{
+ USHORT phi0 = 0; // result angel higher part
+ USHORT phi = 0; // dito lower part
+ long x = rX.x;
+ long y = rY.x;
+ long z;
+ const char Sft=14-FIX_POST;
+ short i;
+ FixCpx aTry;
+ FixCpx aInc;
+ FixCpx aIter(1L);
+ BOOL Small = FALSE;
+
+ if ( (x==0) && (y==0) )
+ return 0;
+
+ if ( y < 0)
+ {
+ // reduce 3. to 1. quadrant (0..90 Degree)
+ phi0 += 180L * 65536L / 360L;
+ // turn 180 degree
+ y *= -1;
+ x *= -1;
+ }
+
+ if ( x < 0)
+ {
+ // 2. to 1. q.
+ phi0 += 90L * 65536L / 360L;
+ // turn 90 degree clockwise
+ z = y;
+ y = -x;
+ x = z;
+ }
+
+ for ( i = 13; i >= 0; i-- )
+ {
+ aInc.r.x = CosTab[i]>>Sft; // e**(i(phi1+phi2)) =
+ aInc.i.x = SinTab[i]>>Sft; // e**(i*phi1)) * e**(i*phi2))
+ aTry = aIter*aInc;
+
+ if ( Small )
+ {
+ // is try ok
+ if ( aTry.r.x >= x )
+ {
+ aIter = aTry;
+ phi += (1<<i);
+ }
+ }
+ else
+ {
+ // is try ok
+ if ( aTry.i.x <= y )
+ {
+ aIter = aTry;
+ phi += (1<<i);
+
+ if ( i > 11 )
+ Small=TRUE;
+ }
+ }
+ }
+
+ return phi0+phi;
+}
+
+/**************************************************************************
+|*
+|* ImpATan2()
+|*
+|* Beschreibung ATAN-Funktion fuer FixPoint-Berechnungen
+|* Ersterstellung SH 01.07.93
+|* Letzte Aenderung SH 01.07.93
+|*
+**************************************************************************/
+
+USHORT ImpATan2( const short x, const short y )
+{
+ Fix rRad = ImpSqrt(ULONG(long(x)*x+long(y)*y));
+
+ if ( !rRad.x )
+ return 0;
+ Fix fx = x;
+ fx.DivBig( rRad ); // Normiere auf Einheitskreis
+ Fix fy = y;
+ fy.DivBig( rRad );
+
+ return ImpATanx2( fx, fy );
+}
+
+/**************************************************************************
+|*
+|* ImpCartToPolar()
+|*
+|* Beschreibung Koordinaaten-Wandlung
+|* Ersterstellung SH 01.07.93
+|* Letzte Aenderung SH 01.07.93
+|*
+**************************************************************************/
+
+void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi )
+{
+ rRad = Fix( ImpSqrt( ULONG( long(x)*x+long(y)*y ) ) );
+
+ if ( !rRad.x )
+ rPhi=0;
+ else
+ {
+ // Normiere auf Einheitskreis
+ Fix fx = x;
+ fx.DivBig(rRad);
+ Fix fy = y;
+ fy.DivBig(rRad);
+ rPhi = ImpATanx2(fx, fy);
+ }
+}
+
+/**************************************************************************
+|*
+|* ImpPolarToCart()
+|*
+|* Beschreibung Koordinaaten-Wandlung
+|* Ersterstellung SH 01.07.93
+|* Letzte Aenderung SH 01.07.93
+|*
+**************************************************************************/
+
+void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY )
+{
+ FixCpx fc = ImpExPI( Phi ); // calculate sin() & cos()
+ fc.GetReal().MultBig( rR );
+ rX = long( fc.GetReal() );
+ fc.GetImag().MultBig( rR );
+ rY = long( fc.GetImag() );
+}
+
diff --git a/svtools/source/dialogs/mcvmath.hxx b/svtools/source/dialogs/mcvmath.hxx
new file mode 100644
index 000000000000..02eaf3a78657
--- /dev/null
+++ b/svtools/source/dialogs/mcvmath.hxx
@@ -0,0 +1,264 @@
+/*************************************************************************
+ *
+ * $RCSfile: mcvmath.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _MCVMATH_HXX
+#define _MCVMATH_HXX
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+class FixCpx;
+class ColWheel;
+
+// No of fractal bits
+// allowed range 0..14, must be even
+#define FIX_POST 14
+
+// scale for ...Big() -Functions
+#if (FIX_POST>=4)
+#define FIX_P2 4
+#define FIX_P3 (FIX_POST-FIX_P2)
+#else
+#define FIX_P2 0
+#define FIX_P3 FIX_POST
+#endif
+
+#if (FIX_POST>=1)
+#define FIX_ADD (1<<(FIX_POST-1))
+#else
+#define FIX_ADD 0
+#endif
+
+#if (FIX_P2>=1)
+#define FIX_A2 (1<<(FIX_P2-1))
+#else
+#define FIX_A2 0
+#endif
+
+#if (FIX_P3>=1)
+#define FIX_A3 (1<<(FIX_P3-1))
+#else
+#define FIX_A3 0
+#endif
+
+// -------
+// - Fix -
+// -------
+
+class Fix
+{
+private:
+ friend FixCpx;
+ friend ColWheel;
+
+// friend Fix ImpMultBig2( const Fix& a, const Fix& b );
+
+public:
+ long x;
+
+public:
+ Fix() { x=0; }
+ Fix( int i ) { x=(long(i)<<FIX_POST); }
+ Fix( short l ) { x=(long(l)<<FIX_POST); }
+ Fix( USHORT l ) { x=(long(l)<<FIX_POST); }
+ Fix( long l ) { x=(l<<FIX_POST); }
+ Fix( long Z, long N ) { x=(Z<<FIX_POST)/N; }
+
+ void SetInternVal( long nVal ) { x=nVal; }
+ long GetInternVal() const { return x; }
+
+ void operator+= ( const Fix& a ) { x+=a.x; }
+ void operator-= ( const Fix& a ) { x-=a.x; }
+ void operator*= ( const Fix& a ) { x=(x*a.x+FIX_ADD)>>FIX_POST; }
+ void operator/= ( const Fix& a ) { x=(x<<FIX_POST)/a.x; }
+ friend Fix operator- ( const Fix& a );
+
+ void MultBig( const Fix& a )
+ { x=((((a.x+FIX_A2)>>FIX_P2)*x+FIX_A3)>>FIX_P3); }
+ void DivBig( const Fix& a )
+ { x=((x<<FIX_P3)/a.x)<<FIX_P2; }
+
+ friend BOOL operator> ( const Fix& a, const Fix& b ) { return a.x > b.x; }
+ friend BOOL operator< ( const Fix& a, const Fix& b ) { return a.x < b.x; }
+
+ operator long() const { return (x+FIX_ADD) >> FIX_POST; }
+ operator double() const { return double(x)/(1<<FIX_POST); }
+
+ friend Fix operator+ ( const Fix& a, const Fix& b );
+ friend Fix operator- ( const Fix& a, const Fix& b );
+ friend Fix operator* ( const Fix& a, const Fix& b );
+ friend Fix operator/ ( const Fix& a, const Fix& b );
+
+ friend FixCpx operator-( const FixCpx& a );
+};
+
+// ----------
+// - FixCpx -
+// ----------
+
+class FixCpx
+{
+// friend FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb );
+
+public:
+ Fix r;
+ Fix i;
+
+public:
+ FixCpx() : r(), i() {}
+ FixCpx( Fix a ) : r( a ), i() {}
+ FixCpx( Fix a, Fix b ) : r( a ), i( b ) {}
+
+ Fix& GetReal() { return r; }
+ Fix& GetImag() { return i; }
+
+ void operator*= ( const FixCpx& ra );
+ void MultBig( const FixCpx& ra, const FixCpx& rb );
+
+ friend FixCpx operator+ ( const FixCpx& a, const FixCpx& b );
+ friend FixCpx operator- ( const FixCpx& a, const FixCpx& b );
+ friend FixCpx operator* ( const FixCpx& a, const FixCpx& b );
+ friend FixCpx operator/ ( const FixCpx& a, const FixCpx& b );
+ friend FixCpx operator- ( const FixCpx& a );
+};
+
+inline Fix operator- ( const Fix& a )
+{
+ Fix f;
+ f.x = -a.x;
+ return f;
+}
+
+inline Fix operator+ ( const Fix& a, const Fix& b )
+{
+ long l = a.x+b.x;
+ return *((Fix*)&l);
+}
+
+inline Fix operator- ( const Fix& a, const Fix& b )
+{
+ long l = a.x-b.x;
+ return *((Fix*)&l);
+}
+
+inline Fix operator* ( const Fix& a, const Fix& b )
+{
+ long l=(a.x*b.x+FIX_ADD)>>FIX_POST;
+ return *((Fix*)&l);
+}
+
+inline Fix operator/ ( const Fix& a, const Fix& b )
+{
+ long l=(a.x<<FIX_POST)/b.x;
+ return *((Fix*)&l);
+}
+
+inline FixCpx operator- ( const FixCpx& a )
+{
+ FixCpx fc;
+
+ fc.r.x = -a.r.x;
+ fc.i.x = -a.i.x;
+ return fc;
+}
+
+inline FixCpx operator+ ( const FixCpx& a, const FixCpx& b )
+{
+ return FixCpx( a.r+b.r, a.i+b.i );
+}
+
+inline FixCpx operator- ( const FixCpx& a, const FixCpx& b )
+{
+ return FixCpx( a.r-b.r, a.i-b.i );
+}
+
+inline void FixCpx::operator*= ( const FixCpx& ra )
+{
+ Fix rr = ra.r*r-ra.i*i;
+ i = ra.r*i+ra.i*r;
+ r = rr;
+}
+
+inline FixCpx operator* ( const FixCpx& a, const FixCpx& b )
+{
+ return FixCpx( a.r*b.r-a.i*b.i, a.r*b.i+a.i*b.r );
+}
+
+inline FixCpx operator/ ( const FixCpx& a, const FixCpx& b )
+{
+ return FixCpx( (a.r*b.r+a.i*b.i)/(b.r*b.r+b.i*b.i),
+ (b.r*a.r-a.r*b.i)/(b.r*b.r+b.i*b.i) );
+}
+
+// -----------------------------------------------------------------------
+
+Fix ImpMultBig2( const Fix& a, const Fix& b );
+FixCpx ImpMultBig2( const FixCpx& ra, const FixCpx& rb );
+
+void ImpCartToPolar( const short x, const short y, Fix& rRad, USHORT& rPhi );
+void ImpPolarToCart( const Fix& rR, const USHORT Phi, short& rX, short& rY );
+
+USHORT ImpSqrt( ULONG nRadi );
+USHORT ImpATan2( const short x, const short y );
+FixCpx ImpExPI( USHORT nPhi );
+
+#endif // _MCVMATH_HXX
diff --git a/svtools/source/dialogs/printdlg.cxx b/svtools/source/dialogs/printdlg.cxx
new file mode 100644
index 000000000000..dd6ba66fc705
--- /dev/null
+++ b/svtools/source/dialogs/printdlg.cxx
@@ -0,0 +1,527 @@
+/*************************************************************************
+ *
+ * $RCSfile: printdlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _SV_APP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _VCL_PRINT_HXX
+#include <vcl/print.hxx>
+#endif
+#ifndef _SV_MSGBOX_HXX
+#include <vcl/msgbox.hxx>
+#endif
+#ifndef _VCL_FILEDLG_HXX
+#include <vcl/filedlg.hxx>
+#endif
+#ifndef _SVTOOLS_FILEDLG_HXX
+#include <filedlg.hxx>
+#endif
+#include <tools/urlobj.hxx>
+#pragma hdrstop
+
+#include "printdlg.hrc"
+#include <prnsetup.hxx>
+#include <printdlg.hxx>
+#include <svtdata.hxx>
+
+// =======================================================================
+
+PrintDialog::PrintDialog( Window* pWindow ) :
+ ModalDialog ( pWindow, SvtResId( DLG_SVT_PRNDLG_PRINTDLG ) ),
+ maGrpPrinter ( this, SvtResId( GRP_PRINTER ) ),
+ maFtName ( this, SvtResId( FT_NAME ) ),
+ maLbName ( this, SvtResId( LB_NAMES ) ),
+ maBtnProperties ( this, SvtResId( BTN_PROPERTIES ) ),
+ maFtStatus ( this, SvtResId( FT_STATUS ) ),
+ maFiStatus ( this, SvtResId( FI_STATUS ) ),
+ maFtType ( this, SvtResId( FT_TYPE ) ),
+ maFiType ( this, SvtResId( FI_TYPE ) ),
+ maFtLocation ( this, SvtResId( FT_LOCATION ) ),
+ maFiLocation ( this, SvtResId( FI_LOCATION ) ),
+ maFtComment ( this, SvtResId( FT_COMMENT ) ),
+ maFiComment ( this, SvtResId( FI_COMMENT ) ),
+ maCbxFilePrint ( this, SvtResId( CBX_FILEPRINT ) ),
+ maFiPrintFile ( this, SvtResId( FI_PRINTFILE ) ),
+ maBtnBrowse ( this, SvtResId( BTN_BROWSE ) ),
+ maGrpPrintRange ( this, SvtResId( GRP_PRINTRANGE ) ),
+ maRbtAll ( this, SvtResId( RBT_ALL ) ),
+ maRbtPages ( this, SvtResId( RBT_PAGES ) ),
+ maRbtSelection ( this, SvtResId( RBT_SELECTION ) ),
+ maEdtPages ( this, SvtResId( EDT_PAGES ) ),
+ maGrpCopies ( this, SvtResId( GRP_COPIES ) ),
+ maFtCopies ( this, SvtResId( FT_COPIES ) ),
+ maNumCopies ( this, SvtResId( NUM_COPIES ) ),
+ maImgCollate ( this, SvtResId( IMG_COLLATE ) ),
+ maImgNotCollate ( this, SvtResId( IMG_NOT_COLLATE ) ),
+ maCbxCollate ( this, SvtResId( CBX_COLLATE ) ),
+ maBtnOptions ( this, SvtResId( BTN_OPTIONS ) ),
+ maBtnHelp ( this, SvtResId( BTN_HELP ) ),
+ maBtnOK ( this, SvtResId( BTN_OK ) ),
+ maBtnCancel ( this, SvtResId( BTN_CANCEL ) )
+{
+ FreeResource();
+
+ mpPrinter = NULL;
+ mpTempPrinter = NULL;
+ mnCopyCount = 1;
+ mnFirstPage = 0;
+ mnLastPage = 0;
+ mnMinPage = 1;
+ mnMaxPage = 65535;
+ meCheckRange = PRINTDIALOG_ALL;
+ mbAll = TRUE;
+ mbSelection = FALSE;
+ mbFromTo = FALSE;
+ mbRange = FALSE;
+ mbCollate = FALSE;
+ mbCollateCheck = FALSE;
+ mbOptions = FALSE;
+
+ maStatusTimer.SetTimeout( IMPL_PRINTDLG_STATUS_UPDATE );
+ maStatusTimer.SetTimeoutHdl( LINK( this, PrintDialog, ImplStatusHdl ) );
+ maBtnProperties.SetClickHdl( LINK( this, PrintDialog, ImplPropertiesHdl ) );
+ maLbName.SetSelectHdl( LINK( this, PrintDialog, ImplChangePrinterHdl ) );
+ maBtnBrowse.SetClickHdl( LINK( this, PrintDialog, ImplBrowseHdl ) );
+
+ maFiPrintFile.SetStyle( maFiPrintFile.GetStyle() | WB_PATHELLIPSIS );
+
+ Link aLink( LINK( this, PrintDialog, ImplModifyControlHdl ) );
+ maCbxFilePrint.SetClickHdl( aLink );
+ maRbtAll.SetClickHdl( aLink );
+ maRbtPages.SetClickHdl( aLink );
+ maRbtSelection.SetClickHdl( aLink );
+ maEdtPages.SetModifyHdl( aLink );
+ maNumCopies.SetModifyHdl( aLink );
+ maCbxCollate.SetClickHdl( aLink );
+ maBtnOptions.SetClickHdl( aLink );
+
+ maRbtAll.Check();
+
+ // Because we have no local print Dialog, or in the other case
+ // the print client and print server must handle this with a
+ // temporaery file and copy the file after printing to the
+ // destionation file name.
+ if ( Application::IsRemoteServer() )
+ maCbxFilePrint.Enable( FALSE );
+}
+
+// -----------------------------------------------------------------------
+
+PrintDialog::~PrintDialog()
+{
+ ImplFreePrnDlgListBox( &maLbName, FALSE );
+ delete mpTempPrinter;
+}
+
+// -----------------------------------------------------------------------
+
+void PrintDialog::ImplSetInfo()
+{
+ const QueueInfo* pInfo = (QueueInfo*)(maLbName.GetEntryData( maLbName.GetSelectEntryPos() ));
+ if ( pInfo )
+ {
+ maFiType.SetText( pInfo->GetDriver() );
+ maFiLocation.SetText( pInfo->GetLocation() );
+ maFiComment.SetText( pInfo->GetComment() );
+ maFiStatus.SetText( ImplPrnDlgGetStatusText( *pInfo ) );
+ }
+ else
+ {
+ XubString aTempStr;
+ maFiType.SetText( aTempStr );
+ maFiLocation.SetText( aTempStr );
+ maFiComment.SetText( aTempStr );
+ maFiStatus.SetText( aTempStr );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void PrintDialog::ImplCheckOK()
+{
+ // Ueberprueft, ob der OK-Button enabled ist
+ BOOL bEnable = TRUE;
+
+ if ( maCbxFilePrint.IsChecked() )
+ bEnable = maFiPrintFile.GetText().Len() > 0;
+
+ if ( bEnable && maRbtPages.IsChecked() )
+ bEnable = maEdtPages.GetText().Len() > 0;
+
+ if ( bEnable )
+ {
+ if ( mpTempPrinter )
+ bEnable = mpTempPrinter->IsValid();
+ else
+ bEnable = mpPrinter->IsValid();
+ }
+
+ maBtnOK.Enable( bEnable );
+}
+
+// -----------------------------------------------------------------------
+
+void PrintDialog::ImplInitControls()
+{
+ // Alles
+ if ( mbAll )
+ {
+ maRbtAll.Enable();
+ if( meCheckRange == PRINTDIALOG_ALL )
+ maRbtAll.Check( TRUE );
+ }
+ else
+ maRbtAll.Enable( FALSE );
+
+ // Selektion
+ if ( mbSelection )
+ {
+ maRbtSelection.Enable();
+ if ( meCheckRange == PRINTDIALOG_SELECTION )
+ maRbtSelection.Check( TRUE );
+ }
+ else
+ maRbtSelection.Enable( FALSE );
+
+ // Seiten
+ if ( mbRange )
+ {
+ maRbtPages.Enable();
+ maEdtPages.Show();
+ maEdtPages.SetText( maRangeText );
+
+ if( ( meCheckRange == PRINTDIALOG_FROMTO ) ||
+ ( meCheckRange == PRINTDIALOG_RANGE ) )
+ {
+ maRbtPages.Check( TRUE );
+ maEdtPages.Enable();
+ }
+ else
+ maEdtPages.Enable( FALSE );
+ }
+ else
+ {
+ maRbtPages.Enable( FALSE );
+ maEdtPages.Hide();
+ }
+
+ // Anzahl Kopien
+ maNumCopies.SetValue( mnCopyCount );
+
+ // Sortierung
+ maCbxCollate.Enable( mbCollate );
+ maCbxCollate.Check( mbCollateCheck );
+
+ // Zusaetze-Button
+ if ( mbOptions )
+ maBtnOptions.Show();
+}
+
+// -----------------------------------------------------------------------
+
+void PrintDialog::ImplFillDialogData()
+{
+ if ( maRbtAll.IsChecked() )
+ meCheckRange = PRINTDIALOG_ALL;
+ else if( maRbtSelection.IsChecked() )
+ meCheckRange = PRINTDIALOG_SELECTION;
+ else
+ {
+ meCheckRange = PRINTDIALOG_RANGE;
+ maRangeText = maEdtPages.GetText();
+ }
+
+ mnCopyCount = (USHORT) maNumCopies.GetValue();
+ mbCollateCheck = maCbxCollate.IsChecked();
+
+ // In Datei drucken
+ if ( maCbxFilePrint.IsChecked() )
+ mpPrinter->SetPrintFile( maFiPrintFile.GetText() );
+ mpPrinter->EnablePrintFile( maCbxFilePrint.IsChecked() );
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( PrintDialog, ImplStatusHdl, Timer*, EMPTYARG )
+{
+ QueueInfo aInfo;
+ ImplPrnDlgUpdateQueueInfo( &maLbName, aInfo );
+ maFiStatus.SetText( ImplPrnDlgGetStatusText( aInfo ) );
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( PrintDialog, ImplPropertiesHdl, void*, EMPTYARG )
+{
+ if ( !mpTempPrinter )
+ mpTempPrinter = new Printer( mpPrinter->GetJobSetup() );
+ mpTempPrinter->Setup();
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( PrintDialog, ImplChangePrinterHdl, void*, EMPTYARG )
+{
+ mpTempPrinter = ImplPrnDlgListBoxSelect( &maLbName, &maBtnProperties,
+ mpPrinter, mpTempPrinter );
+ ImplSetInfo();
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( PrintDialog, ImplBrowseHdl, void*, EMPTYARG )
+{
+ VclFileDialog* pVclFileDlg = GetpApp()->CreateFileDialog( this, WB_SAVEAS );
+ if ( pVclFileDlg )
+ {
+ short nRet = pVclFileDlg->Execute();
+
+ if ( nRet == RET_OK )
+ {
+ INetURLObject aObj( pVclFileDlg->GetPath() );
+ maFiPrintFile.SetText( aObj.PathToFileName() );
+ ImplCheckOK();
+ }
+
+ delete pVclFileDlg;
+ }
+ else
+ {
+ FileDialog* pFileDlg = new FileDialog( this, WB_SAVEAS );
+ short nRet = pFileDlg->Execute();
+
+ if ( nRet == RET_OK )
+ {
+ maFiPrintFile.SetText( pFileDlg->GetPath() );
+ ImplCheckOK();
+ }
+
+ delete pFileDlg;
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( PrintDialog, ImplModifyControlHdl, void*, p )
+{
+ // Drucken in Datei
+ if ( !p || (p == &maCbxFilePrint) )
+ {
+ BOOL bCheck = maCbxFilePrint.IsChecked();
+ if ( bCheck && !maFiPrintFile.GetText().Len() )
+ ImplBrowseHdl( &maBtnBrowse );
+ maFiPrintFile.Enable( bCheck );
+ maBtnBrowse.Enable( bCheck );
+ ImplCheckOK();
+ }
+
+ // Radiobuttons (Umfang)
+ if ( !p || (p == &maRbtAll) || (p == &maRbtPages) || (p == &maRbtSelection) )
+ {
+ BOOL bCheck = maRbtPages.IsChecked();
+ maEdtPages.Enable( bCheck );
+ if ( p == &maRbtPages )
+ maEdtPages.GrabFocus();
+ ImplCheckOK();
+ }
+
+ // Edit-Felder (Dateiname, Seiten)
+ if ( p == &maEdtPages )
+ ImplCheckOK();
+
+ // Anzahl Kopien
+ BOOL bNumCopies = FALSE;
+
+ if ( !p || p == &maNumCopies )
+ {
+ if ( p )
+ bNumCopies = TRUE;
+ BOOL bCopies = maNumCopies.GetValue() > 1;
+ maCbxCollate.Enable( bCopies && mbCollate );
+
+ if ( !bCopies )
+ maCbxCollate.Check( FALSE );
+ else if ( mbCollateCheck )
+ maCbxCollate.Check( TRUE );
+ }
+
+ // Sortieren
+ if ( !p || p == &maCbxCollate || bNumCopies )
+ {
+ BOOL bCheck = maCbxCollate.IsChecked();
+
+ if ( !bNumCopies )
+ mbCollateCheck = maCbxCollate.IsChecked();
+
+ if( bCheck )
+ {
+ maImgCollate.Show();
+ maImgNotCollate.Hide();
+ }
+ else
+ {
+ maImgCollate.Hide();
+ maImgNotCollate.Show();
+ }
+ }
+
+ // Zus"atze
+ if ( p == &maBtnOptions )
+ ClickOptionsHdl();
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+long PrintDialog::ClickOptionsHdl()
+{
+ if ( maOptionsHdlLink.IsSet() )
+ return maOptionsHdlLink.Call( this );
+ else
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+long PrintDialog::OK()
+{
+ if ( maOKHdlLink.IsSet() )
+ return maOKHdlLink.Call( this );
+ else
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+long PrintDialog::Notify( NotifyEvent& rNEvt )
+{
+ if ( (rNEvt.GetType() == EVENT_GETFOCUS) && IsReallyVisible() )
+ ImplStatusHdl( &maStatusTimer );
+
+ return ModalDialog::Notify( rNEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void PrintDialog::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( rDCEvt.GetType() == DATACHANGED_PRINTER )
+ {
+ mpTempPrinter = ImplPrnDlgUpdatePrinter( mpPrinter, mpTempPrinter );
+ Printer* pPrn;
+ if ( mpTempPrinter )
+ pPrn = mpTempPrinter;
+ else
+ pPrn = mpPrinter;
+ ImplFillPrnDlgListBox( pPrn, &maLbName, &maBtnProperties );
+ ImplSetInfo();
+ ImplCheckOK();
+ }
+
+ ModalDialog::DataChanged( rDCEvt );
+}
+
+// -----------------------------------------------------------------------
+
+short PrintDialog::Execute()
+{
+ if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
+ {
+ DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" );
+ return FALSE;
+ }
+
+ // Controls initialisieren
+ ImplFillPrnDlgListBox( mpPrinter, &maLbName, &maBtnProperties );
+ ImplSetInfo();
+ maStatusTimer.Start();
+ ImplInitControls();
+ ImplModifyControlHdl( NULL );
+
+ // Dialog starten
+ short nRet = ModalDialog::Execute();
+
+ // Wenn Dialog mit OK beendet wurde, dann die Daten updaten
+ if( nRet == TRUE )
+ {
+ if ( mpTempPrinter )
+ mpPrinter->SetPrinterProps( mpTempPrinter );
+ ImplFillDialogData();
+ }
+
+ maStatusTimer.Stop();
+
+ return nRet;
+}
+
+
diff --git a/svtools/source/dialogs/printdlg.hrc b/svtools/source/dialogs/printdlg.hrc
new file mode 100644
index 000000000000..4b674f1c83f3
--- /dev/null
+++ b/svtools/source/dialogs/printdlg.hrc
@@ -0,0 +1,95 @@
+/*************************************************************************
+ *
+ * $RCSfile: printdlg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include <svtools.hrc>
+
+#define GRP_PRINTER 1
+#define LB_NAMES 2
+#define BTN_PROPERTIES 3
+#define FT_NAME 4
+#define FT_STATUS 5
+#define FI_STATUS 6
+#define FT_TYPE 7
+#define FI_TYPE 8
+#define FT_LOCATION 9
+#define FI_LOCATION 10
+#define FT_COMMENT 11
+#define FI_COMMENT 12
+#define CBX_FILEPRINT 13
+#define FI_PRINTFILE 14
+#define BTN_BROWSE 15
+
+#define GRP_PRINTRANGE 16
+#define RBT_ALL 17
+#define RBT_PAGES 18
+#define RBT_SELECTION 19
+#define EDT_PAGES 20
+
+#define GRP_COPIES 21
+#define FT_COPIES 22
+#define NUM_COPIES 23
+#define CBX_COLLATE 24
+#define IMG_COLLATE 25
+#define IMG_NOT_COLLATE 26
+
+#define BTN_OK 27
+#define BTN_CANCEL 28
+#define BTN_HELP 29
+#define BTN_OPTIONS 30
diff --git a/svtools/source/dialogs/printdlg.src b/svtools/source/dialogs/printdlg.src
new file mode 100644
index 000000000000..cb3e65ae32c9
--- /dev/null
+++ b/svtools/source/dialogs/printdlg.src
@@ -0,0 +1,616 @@
+/*************************************************************************
+ *
+ * $RCSfile: printdlg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "printdlg.hrc"
+
+#ifndef IMAGE_STDBTN_COLOR
+#define IMAGE_STDBTN_COLOR Color { Red = 0xC000; Green = 0xC000; Blue = 0xC000; }
+#endif
+
+ModalDialog DLG_SVT_PRNDLG_PRINTDLG
+{
+ SVLook = TRUE ;
+ OutputSize = TRUE ;
+ Moveable = TRUE ;
+ Size = MAP_APPFONT ( 260 , 169 ) ;
+ Text = "Drucken" ;
+ Text [ ENGLISH ] = "Print" ;
+ Text [ english_us ] = "Print" ;
+ Text [ portuguese_brazilian ] = "Drucken" ;
+ Text [ swedish ] = "Skriv ut" ;
+ Text [ danish ] = "Udskriv" ;
+ Text [ italian ] = "Stampa" ;
+ Text [ spanish ] = "Imprimir" ;
+ Text [ french ] = "Impression" ;
+ Text [ dutch ] = "Afdrukken" ;
+ Text [ portuguese ] = "Imprimir" ;
+ GroupBox GRP_PRINTER
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 248 , 90 ) ;
+ Text = "Drucker" ;
+ Text [ ENGLISH ] = "Printer" ;
+ Text [ english_us ] = "Printer" ;
+ Text [ portuguese_brazilian ] = "Drucker" ;
+ Text [ swedish ] = "Skrivare" ;
+ Text [ danish ] = "Printer" ;
+ Text [ italian ] = "Stampante" ;
+ Text [ spanish ] = "Impresora" ;
+ Text [ french ] = "Imprimante" ;
+ Text [ dutch ] = "Printer" ;
+ Text [ portuguese ] = "Impressora" ;
+ Text[ chinese_simplified ] = "´òÓ¡»ú";
+ Text[ russian ] = "Ïðèíòåð";
+ Text[ polish ] = "Drukarka";
+ Text[ japanese ] = "ÌßØÝÀ";
+ Text[ chinese_traditional ] = "¦Lªí¾÷";
+ Text[ arabic ] = "ÇáØÇÈÚÉ";
+ Text[ greek ] = "ÅêôõðùôÞò";
+ Text[ korean ] = "ÇÁ¸°ÅÍ";
+ Text[ turkish ] = "Yazýcý";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_NAME
+ {
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "~Name" ;
+ Text [ ENGLISH ] = "~Name" ;
+ Text [ english_us ] = "~Name" ;
+ Text [ portuguese_brazilian ] = "~Name" ;
+ Text [ swedish ] = "~Namn" ;
+ Text [ danish ] = "Navn" ;
+ Text [ italian ] = "~Nome" ;
+ Text [ spanish ] = "~Nombre" ;
+ Text [ french ] = "~Nom" ;
+ Text [ dutch ] = "~Naam" ;
+ Text [ portuguese ] = "~Nome" ;
+ Text[ chinese_simplified ] = "Ãû³Æ(~N)";
+ Text[ russian ] = "~Èìÿ";
+ Text[ polish ] = "Nazwa";
+ Text[ japanese ] = "–¼‘O(~N)";
+ Text[ chinese_traditional ] = "¦WºÙ(~N)";
+ Text[ arabic ] = "ÇáÇÓã";
+ Text[ greek ] = "¼íïìá";
+ Text[ korean ] = "À̸§(~N)";
+ Text[ turkish ] = "~Ad";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_NAMES
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 60 , 12 ) ;
+ Size = MAP_APPFONT ( 125 , 80 ) ;
+ DropDown = TRUE ;
+ Sort = TRUE ;
+ };
+ PushButton BTN_PROPERTIES
+ {
+ Pos = MAP_APPFONT ( 188 , 12 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
+ Text = "~Eigenschaften..." ;
+ Text [ ENGLISH ] = "~Properties..." ;
+ Text [ portuguese ] = "~Propriedades..." ;
+ Text [ english_us ] = "Propert~ies..." ;
+ Text [ portuguese_brazilian ] = "~Eigenschaften..." ;
+ Text [ swedish ] = "~Egenskaper..." ;
+ Text [ danish ] = "Egenskaber..." ;
+ Text [ italian ] = "~Proprietà..." ;
+ Text [ spanish ] = "~Propiedades..." ;
+ Text [ french ] = "~Propriétés..." ;
+ Text [ dutch ] = "~Eigenschappen..." ;
+ Text[ chinese_simplified ] = "ÊôÐÔ(~I)...";
+ Text[ russian ] = "~Ñâîéñòâà...";
+ Text[ polish ] = "W³aœciwoœci...";
+ Text[ japanese ] = "ÌßÛÊßè(~I)...";
+ Text[ chinese_traditional ] = "ÄÝ©Ê(~I)...";
+ Text[ arabic ] = "ÎÕÇÆÕ...";
+ Text[ greek ] = "Éäéüôçôåò...";
+ Text[ korean ] = "µî·ÏÁ¤º¸(~I)...";
+ Text[ turkish ] = "~Özellikler...";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_STATUS
+ {
+ Pos = MAP_APPFONT ( 12 , 29 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Status" ;
+ Text [ ENGLISH ] = "Status" ;
+ Text [ english_us ] = "Status" ;
+ Text [ portuguese_brazilian ] = "Status" ;
+ Text [ swedish ] = "Status" ;
+ Text [ danish ] = "Status" ;
+ Text [ italian ] = "Stato" ;
+ Text [ spanish ] = "Estado" ;
+ Text [ french ] = "État" ;
+ Text [ dutch ] = "Status" ;
+ Text [ portuguese ] = "Estado" ;
+ Text[ chinese_simplified ] = "״̬";
+ Text[ russian ] = "Ñîñòîÿíèå";
+ Text[ polish ] = "Stan";
+ Text[ japanese ] = "½Ã°À½";
+ Text[ chinese_traditional ] = "ª¬ºA";
+ Text[ arabic ] = "ÇáÍÇáÉ";
+ Text[ greek ] = "ÊáôÜóôáóç";
+ Text[ korean ] = "»óÅÂ";
+ Text[ turkish ] = "Durum";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_STATUS
+ {
+ Pos = MAP_APPFONT ( 60 , 29 ) ;
+ Size = MAP_APPFONT ( 188 , 10 ) ;
+ };
+ FixedText FT_TYPE
+ {
+ Pos = MAP_APPFONT ( 12 , 40 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Typ" ;
+ Text [ ENGLISH ] = "Type" ;
+ Text [ english_us ] = "Type" ;
+ Text [ portuguese_brazilian ] = "Typ" ;
+ Text [ swedish ] = "Typ" ;
+ Text [ danish ] = "Type" ;
+ Text [ italian ] = "Tipo" ;
+ Text [ spanish ] = "Tipo" ;
+ Text [ french ] = "Type" ;
+ Text [ dutch ] = "Type" ;
+ Text [ portuguese ] = "Tipo" ;
+ Text[ chinese_simplified ] = "ÀàÐÍ";
+ Text[ russian ] = "Òèï";
+ Text[ polish ] = "Typ";
+ Text[ japanese ] = "Ží—Þ";
+ Text[ chinese_traditional ] = "Ãþ«¬";
+ Text[ arabic ] = "ÇáäæÚ";
+ Text[ greek ] = "Ôýðïò";
+ Text[ korean ] = "ÇüÅÂ";
+ Text[ turkish ] = "Tip";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_TYPE
+ {
+ Pos = MAP_APPFONT ( 60 , 40 ) ;
+ Size = MAP_APPFONT ( 188 , 10 ) ;
+ };
+ FixedText FT_LOCATION
+ {
+ Pos = MAP_APPFONT ( 12 , 51 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Ort" ;
+ Text [ ENGLISH ] = "Location" ;
+ Text [ english_us ] = "Location" ;
+ Text [ portuguese_brazilian ] = "Ort" ;
+ Text [ swedish ] = "Plats" ;
+ Text [ danish ] = "Placering" ;
+ Text [ italian ] = "Percorso" ;
+ Text [ spanish ] = "Ubicación" ;
+ Text [ french ] = "Emplacement" ;
+ Text [ dutch ] = "Plaats" ;
+ Text [ portuguese ] = "Lugar" ;
+ Text[ chinese_simplified ] = "λÖÃ";
+ Text[ russian ] = "Ëîêàëèçàöèÿ";
+ Text[ polish ] = "Lokalizacja";
+ Text[ japanese ] = "êŠ";
+ Text[ chinese_traditional ] = "¦ì¸m";
+ Text[ arabic ] = "ÇáãæÞÚ";
+ Text[ greek ] = "ÈÝóç";
+ Text[ korean ] = "À§Ä¡";
+ Text[ turkish ] = "Yer";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_LOCATION
+ {
+ Pos = MAP_APPFONT ( 60 , 51 ) ;
+ Size = MAP_APPFONT ( 188 , 10 ) ;
+ };
+ FixedText FT_COMMENT
+ {
+ Pos = MAP_APPFONT ( 12 , 62 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Kommentar" ;
+ Text [ ENGLISH ] = "Comment" ;
+ Text [ english_us ] = "Comment" ;
+ Text [ portuguese_brazilian ] = "Kommentar" ;
+ Text [ swedish ] = "Kommentar" ;
+ Text [ danish ] = "Kommentar" ;
+ Text [ italian ] = "Commento" ;
+ Text [ spanish ] = "Comentario" ;
+ Text [ french ] = "Commentaire" ;
+ Text [ dutch ] = "Commentaar" ;
+ Text [ portuguese ] = "Comentário" ;
+ Text[ chinese_simplified ] = "×¢½â";
+ Text[ russian ] = "Êîììåíòàðèé";
+ Text[ polish ] = "Komentarz";
+ Text[ japanese ] = "ºÒÝÄ";
+ Text[ chinese_traditional ] = "ª`¸Ñ";
+ Text[ arabic ] = "ÊÚáíÞ";
+ Text[ greek ] = "Ó÷üëéï";
+ Text[ korean ] = "¸Þ¸ð";
+ Text[ turkish ] = "Açýklama";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_COMMENT
+ {
+ Pos = MAP_APPFONT ( 60 , 62 ) ;
+ Size = MAP_APPFONT ( 188 , 10 ) ;
+ };
+ CheckBox CBX_FILEPRINT
+ {
+ Pos = MAP_APPFONT ( 12 , 77 ) ;
+ Size = MAP_APPFONT ( 75 , 10 ) ;
+ Text = "Ausdruck ~in Datei" ;
+ Text [ ENGLISH ] = "Print to f~ile" ;
+ Text [ english_us ] = "Print to file" ;
+ Text [ portuguese_brazilian ] = "Ausdruck ~in Datei" ;
+ Text [ swedish ] = "Skriv ut till ~fil" ;
+ Text [ danish ] = "Udskrift til fil" ;
+ Text [ italian ] = "Stampa su ~file" ;
+ Text [ spanish ] = "Imprimir ~en archivo" ;
+ Text [ french ] = "Imprimer dans un ~fichier " ;
+ Text [ dutch ] = "Afdrukken in ~bestand" ;
+ Text [ portuguese ] = "Imprimir em ~ficheiro" ;
+ Text[ chinese_simplified ] = "´òÓ¡³ÉÎļþ";
+ Text[ russian ] = "Ïå÷àòü â ôàéë";
+ Text[ polish ] = "Drukuj do pliku";
+ Text[ japanese ] = "̧²Ù‚Öo—Í";
+ Text[ chinese_traditional ] = "¦C¦L¦¨ÀÉ®×";
+ Text[ arabic ] = "ØÈÇÚÉ Åáì ãáÝ";
+ Text[ greek ] = "Åêôýðùóç óå áñ÷åßï";
+ Text[ korean ] = "ÆÄÀÏ·Î Àμâ";
+ Text[ turkish ] = "D~osyaya yazdýr";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_PRINTFILE
+ {
+ Pos = MAP_APPFONT ( 90 , 77 ) ;
+ Size = MAP_APPFONT ( 141 , 12 ) ;
+ };
+ PushButton BTN_BROWSE
+ {
+ Pos = MAP_APPFONT ( 234 , 75 ) ;
+ Size = MAP_APPFONT ( 14 , 14 ) ;
+ Text = "~..." ;
+ };
+ GroupBox GRP_PRINTRANGE
+ {
+ Pos = MAP_APPFONT ( 6 , 96 ) ;
+ Size = MAP_APPFONT ( 117 , 47 ) ;
+ Text = "Druckbereich" ;
+ Text [ ENGLISH ] = "Print range" ;
+ Text [ english_us ] = "Print range" ;
+ Text [ portuguese_brazilian ] = "Druckbereich" ;
+ Text [ swedish ] = "Utskriftsområde" ;
+ Text [ danish ] = "Udskriftsområde" ;
+ Text [ italian ] = "Area di stampa" ;
+ Text [ spanish ] = "Área de impresión" ;
+ Text [ french ] = "Zone d'impression" ;
+ Text [ dutch ] = "Afdrukbereik" ;
+ Text [ portuguese ] = "Área de impressão" ;
+ Text[ chinese_simplified ] = "´òÓ¡ÇøÓò";
+ Text[ russian ] = "Îáëàñòü ïå÷àòè";
+ Text[ polish ] = "Zakres wydruku";
+ Text[ japanese ] = "ˆóü”͈Í";
+ Text[ chinese_traditional ] = "¦C¦L­S³ò";
+ Text[ arabic ] = "äØÇÞ ÇáØÈÇÚÉ";
+ Text[ greek ] = "Ðåñéï÷Þ åêôýðùóçò";
+ Text[ korean ] = "Àμ⠿µ¿ª";
+ Text[ turkish ] = "Yazdýrma alaný";
+ Text[ language_user1 ] = " ";
+ };
+ RadioButton RBT_ALL
+ {
+ Pos = MAP_APPFONT ( 12 , 105 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "~Alles" ;
+ Text [ ENGLISH ] = "~All" ;
+ Text [ portuguese ] = "~Tudo" ;
+ Text [ english_us ] = "All" ;
+ Text [ portuguese_brazilian ] = "~Alles" ;
+ Text [ swedish ] = "~Allt" ;
+ Text [ danish ] = "Alt" ;
+ Text [ italian ] = "~Tutto" ;
+ Text [ spanish ] = "~Todo" ;
+ Text [ french ] = "~Tout" ;
+ Text [ dutch ] = "~Alles" ;
+ Text[ chinese_simplified ] = "È«²¿";
+ Text[ russian ] = "~Âñå";
+ Text[ polish ] = "Wszystko";
+ Text[ japanese ] = "‚·‚ׂÄ";
+ Text[ chinese_traditional ] = "¥þ³¡";
+ Text[ arabic ] = "Çáßá";
+ Text[ greek ] = "¼ëá";
+ Text[ korean ] = "ÀüºÎ";
+ Text[ turkish ] = "~Tümü";
+ Text[ language_user1 ] = " ";
+ };
+ RadioButton RBT_PAGES
+ {
+ Pos = MAP_APPFONT ( 12 , 117 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "~Seiten" ;
+ Text [ ENGLISH ] = "Pa~ges" ;
+ Text [ portuguese ] = "~Páginas" ;
+ Text [ english_us ] = "Pages" ;
+ Text [ portuguese_brazilian ] = "~Seiten" ;
+ Text [ swedish ] = "~Sidor" ;
+ Text [ danish ] = "Sider" ;
+ Text [ italian ] = "~Pagine" ;
+ Text [ spanish ] = "~Páginas" ;
+ Text [ french ] = "P~ages" ;
+ Text [ dutch ] = "~Pagina" ;
+ Text[ chinese_simplified ] = "Ò³";
+ Text[ russian ] = "~Ñòðàíèöû";
+ Text[ polish ] = "Strony";
+ Text[ japanese ] = "Íß°¼ÞŽw’è";
+ Text[ chinese_traditional ] = "­¶";
+ Text[ arabic ] = "ÕÝÍÇÊ";
+ Text[ greek ] = "Óåëßäåò";
+ Text[ korean ] = "ÆäÀÌÁö";
+ Text[ turkish ] = "~Sayfa";
+ Text[ language_user1 ] = " ";
+ };
+ RadioButton RBT_SELECTION
+ {
+ Pos = MAP_APPFONT ( 12 , 129 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "A~uswahl" ;
+ Text [ ENGLISH ] = "~Selection" ;
+ Text [ portuguese ] = "~Selecção" ;
+ Text [ english_us ] = "Selection" ;
+ Text [ portuguese_brazilian ] = "A~uswahl" ;
+ Text [ swedish ] = "~Urval" ;
+ Text [ danish ] = "Udvalg" ;
+ Text [ italian ] = "Scelta" ;
+ Text [ spanish ] = "~Selección" ;
+ Text [ french ] = "~Sélection" ;
+ Text [ dutch ] = "~Selectie" ;
+ Text[ chinese_simplified ] = "Ñ¡Ôñ";
+ Text[ russian ] = "Âûäåëåíèå";
+ Text[ polish ] = "Wybór";
+ Text[ japanese ] = "‘I‘ð‚µ‚½•”•ª";
+ Text[ chinese_traditional ] = "¿ï¾Ü";
+ Text[ arabic ] = "ÇáÊÍÏíÏ";
+ Text[ greek ] = "ÅðéëïãÞ";
+ Text[ korean ] = "¼±ÅÃ";
+ Text[ turkish ] = "Seçim";
+ Text[ language_user1 ] = " ";
+ };
+ Edit EDT_PAGES
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 60 , 116 ) ;
+ Size = MAP_APPFONT ( 57 , 12 ) ;
+ };
+ GroupBox GRP_COPIES
+ {
+ Pos = MAP_APPFONT ( 129 , 96 ) ;
+ Size = MAP_APPFONT ( 125 , 47 ) ;
+ Text = "Kopien" ;
+ Text [ ENGLISH ] = "Copies" ;
+ Text [ english_us ] = "Copies" ;
+ Text [ portuguese_brazilian ] = "Kopien" ;
+ Text [ swedish ] = "Kopior" ;
+ Text [ danish ] = "Kopier" ;
+ Text [ italian ] = "Copia" ;
+ Text [ spanish ] = "Copias" ;
+ Text [ french ] = "Copies" ;
+ Text [ dutch ] = "Kopieën" ;
+ Text [ portuguese ] = "Cópias" ;
+ Text[ chinese_simplified ] = "·ÝÊý";
+ Text[ russian ] = "Êîïèè";
+ Text[ polish ] = "Kopie";
+ Text[ japanese ] = "ˆóü•””";
+ Text[ chinese_traditional ] = "¥ó¼Æ";
+ Text[ arabic ] = "äÓÎ";
+ Text[ greek ] = "Áíôßãñáöá";
+ Text[ korean ] = "º¹»ç";
+ Text[ turkish ] = "Kopya";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_COPIES
+ {
+ Pos = MAP_APPFONT ( 135 , 106 ) ;
+ Size = MAP_APPFONT ( 63 , 10 ) ;
+ DeltaLang = < Default ; Default ; Default ; Default ; > ;
+ DeltaLang [ ENGLISH ] = < Default ; Default ; 19 ; Default ; > ;
+ Text = "E~xemplare" ;
+ Text [ ENGLISH ] = "Number of ~copies" ;
+ Text [ english_us ] = "Number of copies" ;
+ Text [ portuguese_brazilian ] = "E~xemplare" ;
+ Text [ swedish ] = "E~xemplar" ;
+ Text [ danish ] = "Antal kopier" ;
+ Text [ italian ] = "~Numero di copie" ;
+ Text [ spanish ] = "~Ejemplares" ;
+ Text [ french ] = "E~xemplaire(s)" ;
+ Text [ dutch ] = "E~xemplaren" ;
+ Text [ portuguese ] = "E~xemplares" ;
+ Text[ chinese_simplified ] = "´òÓ¡·ÝÊý";
+ Text[ russian ] = "Ýêçåìïëÿðà(îâ)";
+ Text[ polish ] = "Egzemplarze";
+ Text[ japanese ] = "•””";
+ Text[ chinese_traditional ] = "¦C¦L¥ó¼Æ";
+ Text[ arabic ] = "ÚÏÏ ÇáäÓÎ";
+ Text[ greek ] = "Áíôß~ãñáöá";
+ Text[ korean ] = "º¹»çº» ¼ö";
+ Text[ turkish ] = "~Kopya sayýsý";
+ Text[ language_user1 ] = " ";
+ };
+ NumericField NUM_COPIES
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 201 , 105 ) ;
+ Size = MAP_APPFONT ( 39 , 12 ) ;
+ DeltaLang = < Default ; Default ; Default ; Default ; > ;
+ DeltaLang [ ENGLISH ] = < 1 ; Default ; -1 ; Default ; > ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 1 ;
+ Maximum = 9999 ;
+ StrictFormat = TRUE ;
+ First = 1 ;
+ Last = 9999 ;
+ };
+ CheckBox CBX_COLLATE
+ {
+ Pos = MAP_APPFONT ( 201 , 123 ) ;
+ Size = MAP_APPFONT ( 47 , 10 ) ;
+ DeltaLang = < Default ; Default ; Default ; Default ; > ;
+ DeltaLang [ ENGLISH ] = < 2 ; Default ; Default ; Default ; > ;
+ Text = "S~ortieren" ;
+ Text [ ENGLISH ] = "C~ollate" ;
+ Text [ english_us ] = "Co~llate" ;
+ Text [ portuguese_brazilian ] = "S~ortieren" ;
+ Text [ swedish ] = "S~ortera" ;
+ Text [ danish ] = "Sorter" ;
+ Text [ italian ] = "~Ordina" ;
+ Text [ spanish ] = "~Ordenar" ;
+ Text [ french ] = "T~rier" ;
+ Text [ dutch ] = "S~orteren" ;
+ Text [ portuguese ] = "~Ordenar" ;
+ Text[ chinese_simplified ] = "ÅÅÐò(~L)";
+ Text[ russian ] = "Ñîðòèðîâàòü";
+ Text[ polish ] = "Sortuj";
+ Text[ japanese ] = "•”’PˆÊ‚ňóü(~L)";
+ Text[ chinese_traditional ] = "±Æ§Ç(~L)";
+ Text[ arabic ] = "ÊÑÊíÈ ÇáäÓÎ";
+ Text[ greek ] = "Ôáîéíüìçóç";
+ Text[ korean ] = "´ëÁ¶(~L)";
+ Text[ turkish ] = "S~ýrala";
+ Text[ language_user1 ] = " ";
+ };
+ FixedImage IMG_COLLATE
+ {
+ Pos = MAP_APPFONT ( 132 , 118 ) ;
+ Size = MAP_APPFONT ( 67 , 22 ) ;
+ Fixed = Image
+ {
+ ImageBitmap = Bitmap { File = "collate.bmp" ; };
+ MaskColor = IMAGE_STDBTN_COLOR ;
+ };
+ Hide = TRUE ;
+ };
+ FixedImage IMG_NOT_COLLATE
+ {
+ Pos = MAP_APPFONT ( 132 , 118 ) ;
+ Size = MAP_APPFONT ( 67 , 22 ) ;
+ Fixed = Image
+ {
+ ImageBitmap = Bitmap { File = "ncollate.bmp" ; };
+ MaskColor = IMAGE_STDBTN_COLOR ;
+ };
+ Hide = TRUE ;
+ };
+ PushButton BTN_OPTIONS
+ {
+ Hide = TRUE ;
+ Pos = MAP_APPFONT ( 6 , 149 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ /* ### ACHTUNG: Neuer Text in Resource? Zusätze... : Zusõtze... */
+ /* ### ACHTUNG: Neuer Text in Resource? Zusätze... : Zusõtze... */
+ Text = "~Zusätze..." ;
+ Text [ ENGLISH ] = "Op~tions..." ;
+ Text [ portuguese ] = "Opçõe~s..." ;
+ Text [ english_us ] = "~Options..." ;
+ Text [ portuguese_brazilian ] = "Zusätze..." ;
+ Text [ swedish ] = "F~ler..." ;
+ Text [ danish ] = "Flere..." ;
+ Text [ italian ] = "E~xtra..." ;
+ Text [ spanish ] = "~Opciones..." ;
+ Text [ french ] = "~Options..." ;
+ Text [ dutch ] = "~Overige..." ;
+ Text[ chinese_simplified ] = "ÆäËû(~O)...";
+ Text[ russian ] = "Ïàðàìåòðû...";
+ Text[ polish ] = "Dodatki...";
+ Text[ japanese ] = "µÌß¼®Ý(~O)...";
+ Text[ chinese_traditional ] = "¨ä¥L(~O)...";
+ Text[ arabic ] = "ÎíÇÑÇÊ...";
+ Text[ greek ] = "Ðñüóèåôá...";
+ Text[ korean ] = "¿É¼Ç(~O)...";
+ Text[ turkish ] = "~Seçenekler...";
+ Text[ language_user1 ] = " ";
+ };
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 95 , 149 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL
+ {
+ Pos = MAP_APPFONT ( 148 , 149 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ HelpButton BTN_HELP
+ {
+ Pos = MAP_APPFONT ( 204 , 149 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ Text[ chinese_simplified ] = "´òÓ¡";
+ Text[ russian ] = "Ïå÷àòü";
+ Text[ polish ] = "Drukuj";
+ Text[ japanese ] = "ˆóü";
+ Text[ chinese_traditional ] = "¦C¦L";
+ Text[ arabic ] = "ØÈÇÚÉ";
+ Text[ greek ] = "Åêôýðùóç";
+ Text[ korean ] = "Àμâ";
+ Text[ turkish ] = "Yazdýr";
+ Text[ language_user1 ] = " ";
+};
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
new file mode 100644
index 000000000000..2300821d6613
--- /dev/null
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -0,0 +1,444 @@
+/*************************************************************************
+ *
+ * $RCSfile: prnsetup.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _VCL_PRINT_HXX
+#include <vcl/print.hxx>
+#endif
+
+#pragma hdrstop
+
+#include <svtdata.hxx>
+#include "prnsetup.hrc"
+#include <prnsetup.hxx>
+
+// =======================================================================
+
+void ImplFillPrnDlgListBox( const Printer* pPrinter,
+ ListBox* pBox, PushButton* pPropBtn )
+{
+ ImplFreePrnDlgListBox( pBox );
+
+ USHORT nCount = Printer::GetQueueCount();
+ if ( nCount )
+ {
+ for( USHORT i = 0; i < nCount; i++ )
+ {
+ const QueueInfo& rInfo = Printer::GetQueueInfo( i, FALSE );
+ USHORT nPos = pBox->InsertEntry( rInfo.GetPrinterName() );
+ if ( nPos != LISTBOX_ERROR )
+ pBox->SetEntryData( nPos, new QueueInfo( rInfo ) );
+ }
+
+ pBox->SelectEntry( pPrinter->GetName() );
+ }
+
+ pBox->Enable( nCount != 0 );
+ pPropBtn->Enable( pPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
+}
+
+// -----------------------------------------------------------------------
+
+void ImplFreePrnDlgListBox( ListBox* pBox, BOOL bClear )
+{
+ USHORT nEntryCount = pBox->GetEntryCount();
+ for ( USHORT i = 0; i < nEntryCount; i++ )
+ delete (QueueInfo*)pBox->GetEntryData( i );
+
+ if ( bClear )
+ pBox->Clear();
+}
+
+// -----------------------------------------------------------------------
+
+Printer* ImplPrnDlgListBoxSelect( ListBox* pBox, PushButton* pPropBtn,
+ Printer* pPrinter, Printer* pTempPrinter )
+{
+ if ( pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
+ {
+ const QueueInfo& rInfo = *((QueueInfo*)(pBox->GetEntryData( pBox->GetSelectEntryPos() )));
+
+ if ( !pTempPrinter )
+ {
+ if ( (pPrinter->GetName() == rInfo.GetPrinterName()) &&
+ (pPrinter->GetDriverName() == rInfo.GetDriver()) )
+ pTempPrinter = new Printer( pPrinter->GetJobSetup() );
+ else
+ pTempPrinter = new Printer( rInfo );
+ }
+ else
+ {
+ if ( (pTempPrinter->GetName() != rInfo.GetPrinterName()) ||
+ (pTempPrinter->GetDriverName() != rInfo.GetDriver()) )
+ {
+ delete pTempPrinter;
+ pTempPrinter = new Printer( rInfo );
+ }
+ }
+
+ pPropBtn->Enable( pTempPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
+ }
+ else
+ pPropBtn->Disable();
+
+ return pTempPrinter;
+}
+
+// -----------------------------------------------------------------------
+
+Printer* ImplPrnDlgUpdatePrinter( Printer* pPrinter, Printer* pTempPrinter )
+{
+ XubString aPrnName;
+ if ( pTempPrinter )
+ aPrnName = pTempPrinter->GetName();
+ else
+ aPrnName = pPrinter->GetName();
+
+ BOOL bFound = FALSE;
+ USHORT nCount = Printer::GetQueueCount();
+ for( USHORT i = 0; i < nCount; i++ )
+ {
+ if ( aPrnName == Printer::GetQueueInfo( i, FALSE ).GetPrinterName() )
+ {
+ bFound = TRUE;
+ break;
+ }
+ }
+
+ if ( !bFound )
+ {
+ if ( pTempPrinter )
+ delete pTempPrinter;
+ pTempPrinter = new Printer;
+ }
+
+ return pTempPrinter;
+}
+
+// -----------------------------------------------------------------------
+
+void ImplPrnDlgUpdateQueueInfo( ListBox* pBox, QueueInfo& rInfo )
+{
+ if ( pBox->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND )
+ {
+ rInfo = *((QueueInfo*)(pBox->GetEntryData( pBox->GetSelectEntryPos() )));
+
+ USHORT nCount = Printer::GetQueueCount();
+ for( USHORT i = 0; i < nCount; i++ )
+ {
+ const QueueInfo& rTempInfo = Printer::GetQueueInfo( i, FALSE );
+ if ( (rInfo.GetPrinterName() == rTempInfo.GetPrinterName()) &&
+ (rInfo.GetDriver() == rTempInfo.GetDriver()) )
+ {
+ rInfo = Printer::GetQueueInfo( i );
+ break;
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplPrnDlgAddString( XubString& rStr, const XubString& rAddStr )
+{
+ if ( rStr.Len() )
+ rStr.AppendAscii( "; " );
+ rStr += rAddStr;
+}
+
+// -----------------------------------------------------------------------
+
+static void ImplPrnDlgAddResString( XubString& rStr, USHORT nResId )
+{
+ SvtResId aResId( nResId );
+ XubString aAddStr( aResId );
+ ImplPrnDlgAddString( rStr, aAddStr );
+}
+
+// -----------------------------------------------------------------------
+
+XubString ImplPrnDlgGetStatusText( const QueueInfo& rInfo )
+{
+ XubString aStr;
+ ULONG nStatus = rInfo.GetStatus();
+
+ // Default-Printer
+ if ( rInfo.GetPrinterName().Len() &&
+ (rInfo.GetPrinterName() == Printer::GetDefaultPrinterName()) )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_DEFPRINTER );
+
+ // Status
+ if ( nStatus & QUEUE_STATUS_READY )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_READY );
+ if ( nStatus & QUEUE_STATUS_PAUSED )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_PAUSED );
+ if ( nStatus & QUEUE_STATUS_PENDING_DELETION )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_PENDING );
+ if ( nStatus & QUEUE_STATUS_BUSY )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_BUSY );
+ if ( nStatus & QUEUE_STATUS_INITIALIZING )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_INITIALIZING );
+ if ( nStatus & QUEUE_STATUS_WAITING )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_WAITING );
+ if ( nStatus & QUEUE_STATUS_WARMING_UP )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_WARMING_UP );
+ if ( nStatus & QUEUE_STATUS_PROCESSING )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_PROCESSING );
+ if ( nStatus & QUEUE_STATUS_PRINTING )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_PRINTING );
+ if ( nStatus & QUEUE_STATUS_OFFLINE )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_OFFLINE );
+ if ( nStatus & QUEUE_STATUS_ERROR )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_ERROR );
+ if ( nStatus & QUEUE_STATUS_SERVER_UNKNOWN )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_SERVER_UNKNOWN );
+ if ( nStatus & QUEUE_STATUS_PAPER_JAM )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_PAPER_JAM );
+ if ( nStatus & QUEUE_STATUS_PAPER_OUT )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_PAPER_OUT );
+ if ( nStatus & QUEUE_STATUS_MANUAL_FEED )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_MANUAL_FEED );
+ if ( nStatus & QUEUE_STATUS_PAPER_PROBLEM )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_PAPER_PROBLEM );
+ if ( nStatus & QUEUE_STATUS_IO_ACTIVE )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_IO_ACTIVE );
+ if ( nStatus & QUEUE_STATUS_OUTPUT_BIN_FULL )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_OUTPUT_BIN_FULL );
+ if ( nStatus & QUEUE_STATUS_TONER_LOW )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_TONER_LOW );
+ if ( nStatus & QUEUE_STATUS_NO_TONER )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_NO_TONER );
+ if ( nStatus & QUEUE_STATUS_PAGE_PUNT )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_PAGE_PUNT );
+ if ( nStatus & QUEUE_STATUS_USER_INTERVENTION )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_USER_INTERVENTION );
+ if ( nStatus & QUEUE_STATUS_OUT_OF_MEMORY )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_OUT_OF_MEMORY );
+ if ( nStatus & QUEUE_STATUS_DOOR_OPEN )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_DOOR_OPEN );
+ if ( nStatus & QUEUE_STATUS_POWER_SAVE )
+ ImplPrnDlgAddResString( aStr, STR_SVT_PRNDLG_POWER_SAVE );
+
+ // Anzahl Jobs
+ ULONG nJobs = rInfo.GetJobs();
+ if ( nJobs && (nJobs != QUEUE_JOBS_DONTKNOW) )
+ {
+ XubString aJobStr( SvtResId( STR_SVT_PRNDLG_JOBCOUNT ) );
+ XubString aJobs( XubString::CreateFromInt32( nJobs ) );
+ aJobStr.SearchAndReplaceAscii( "%d", aJobs );
+ ImplPrnDlgAddString( aStr, aJobStr );
+ }
+
+ return aStr;
+}
+
+// =======================================================================
+
+PrinterSetupDialog::PrinterSetupDialog( Window* pWindow ) :
+ ModalDialog ( pWindow, SvtResId( DLG_SVT_PRNDLG_PRNSETUPDLG ) ),
+ maGrpPrinter ( this, SvtResId( GRP_PRINTER ) ),
+ maFtName ( this, SvtResId( FT_NAME ) ),
+ maLbName ( this, SvtResId( LB_NAMES ) ),
+ maBtnProperties ( this, SvtResId( BTN_PROPERTIES ) ),
+ maFtStatus ( this, SvtResId( FT_STATUS ) ),
+ maFiStatus ( this, SvtResId( FI_STATUS ) ),
+ maFtType ( this, SvtResId( FT_TYPE ) ),
+ maFiType ( this, SvtResId( FI_TYPE ) ),
+ maFtLocation ( this, SvtResId( FT_LOCATION ) ),
+ maFiLocation ( this, SvtResId( FI_LOCATION ) ),
+ maFtComment ( this, SvtResId( FT_COMMENT ) ),
+ maFiComment ( this, SvtResId( FI_COMMENT ) ),
+ maBtnOK ( this, SvtResId( BTN_OK ) ),
+ maBtnCancel ( this, SvtResId( BTN_CANCEL ) ),
+ maBtnHelp ( this, SvtResId( BTN_HELP ) )
+{
+ FreeResource();
+
+ mpPrinter = NULL;
+ mpTempPrinter = NULL;
+
+ maStatusTimer.SetTimeout( IMPL_PRINTDLG_STATUS_UPDATE );
+ maStatusTimer.SetTimeoutHdl( LINK( this, PrinterSetupDialog, ImplStatusHdl ) );
+ maBtnProperties.SetClickHdl( LINK( this, PrinterSetupDialog, ImplPropertiesHdl ) );
+ maLbName.SetSelectHdl( LINK( this, PrinterSetupDialog, ImplChangePrinterHdl ) );
+}
+
+// -----------------------------------------------------------------------
+
+PrinterSetupDialog::~PrinterSetupDialog()
+{
+ ImplFreePrnDlgListBox( &maLbName, FALSE );
+ delete mpTempPrinter;
+}
+
+// -----------------------------------------------------------------------
+
+void PrinterSetupDialog::ImplSetInfo()
+{
+ const QueueInfo* pInfo = (QueueInfo*)(maLbName.GetEntryData( maLbName.GetSelectEntryPos() ));
+ if ( pInfo )
+ {
+ maFiType.SetText( pInfo->GetDriver() );
+ maFiLocation.SetText( pInfo->GetLocation() );
+ maFiComment.SetText( pInfo->GetComment() );
+ maFiStatus.SetText( ImplPrnDlgGetStatusText( *pInfo ) );
+ }
+ else
+ {
+ XubString aTempStr;
+ maFiType.SetText( aTempStr );
+ maFiLocation.SetText( aTempStr );
+ maFiComment.SetText( aTempStr );
+ maFiStatus.SetText( aTempStr );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( PrinterSetupDialog, ImplStatusHdl, Timer*, EMPTYARG )
+{
+ QueueInfo aInfo;
+ ImplPrnDlgUpdateQueueInfo( &maLbName, aInfo );
+ maFiStatus.SetText( ImplPrnDlgGetStatusText( aInfo ) );
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( PrinterSetupDialog, ImplPropertiesHdl, void*, EMPTYARG )
+{
+ if ( !mpTempPrinter )
+ mpTempPrinter = new Printer( mpPrinter->GetJobSetup() );
+ mpTempPrinter->Setup();
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( PrinterSetupDialog, ImplChangePrinterHdl, void*, EMPTYARG )
+{
+ mpTempPrinter = ImplPrnDlgListBoxSelect( &maLbName, &maBtnProperties,
+ mpPrinter, mpTempPrinter );
+ ImplSetInfo();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+long PrinterSetupDialog::Notify( NotifyEvent& rNEvt )
+{
+ if ( (rNEvt.GetType() == EVENT_GETFOCUS) && IsReallyVisible() )
+ ImplStatusHdl( &maStatusTimer );
+
+ return ModalDialog::Notify( rNEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void PrinterSetupDialog::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( rDCEvt.GetType() == DATACHANGED_PRINTER )
+ {
+ mpTempPrinter = ImplPrnDlgUpdatePrinter( mpPrinter, mpTempPrinter );
+ Printer* pPrn;
+ if ( mpTempPrinter )
+ pPrn = mpTempPrinter;
+ else
+ pPrn = mpPrinter;
+ ImplFillPrnDlgListBox( pPrn, &maLbName, &maBtnProperties );
+ ImplSetInfo();
+ }
+
+ ModalDialog::DataChanged( rDCEvt );
+}
+
+// -----------------------------------------------------------------------
+
+short PrinterSetupDialog::Execute()
+{
+ if ( !mpPrinter || mpPrinter->IsPrinting() || mpPrinter->IsJobActive() )
+ {
+ DBG_ERRORFILE( "PrinterSetupDialog::Execute() - No Printer or printer is printing" );
+ return FALSE;
+ }
+
+ ImplFillPrnDlgListBox( mpPrinter, &maLbName, &maBtnProperties );
+ ImplSetInfo();
+ maStatusTimer.Start();
+
+ // Dialog starten
+ short nRet = ModalDialog::Execute();
+
+ // Wenn Dialog mit OK beendet wurde, dann die Daten updaten
+ if ( nRet == TRUE )
+ {
+ if ( mpTempPrinter )
+ mpPrinter->SetPrinterProps( mpTempPrinter );
+ }
+
+ maStatusTimer.Stop();
+
+ return nRet;
+}
diff --git a/svtools/source/dialogs/prnsetup.hrc b/svtools/source/dialogs/prnsetup.hrc
new file mode 100644
index 000000000000..4d5fede29c84
--- /dev/null
+++ b/svtools/source/dialogs/prnsetup.hrc
@@ -0,0 +1,78 @@
+/*************************************************************************
+ *
+ * $RCSfile: prnsetup.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include <svtools.hrc>
+
+#define GRP_PRINTER 1
+#define LB_NAMES 2
+#define BTN_PROPERTIES 3
+#define FT_NAME 4
+#define FT_STATUS 5
+#define FI_STATUS 6
+#define FT_TYPE 7
+#define FI_TYPE 8
+#define FT_LOCATION 9
+#define FI_LOCATION 10
+#define FT_COMMENT 11
+#define FI_COMMENT 12
+
+#define BTN_OK 13
+#define BTN_CANCEL 14
+#define BTN_HELP 15
diff --git a/svtools/source/dialogs/prnsetup.src b/svtools/source/dialogs/prnsetup.src
new file mode 100644
index 000000000000..476d57e085a7
--- /dev/null
+++ b/svtools/source/dialogs/prnsetup.src
@@ -0,0 +1,966 @@
+/*************************************************************************
+ *
+ * $RCSfile: prnsetup.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "prnsetup.hrc"
+
+String STR_SVT_PRNDLG_READY
+{
+ Text = "Bereit" ;
+ Text [ ENGLISH ] = "Ready" ;
+ Text [ portuguese ] = "Pronto" ;
+ Text [ english_us ] = "Ready" ;
+ Text [ portuguese_brazilian ] = "Bereit" ;
+ Text [ swedish ] = "Redo" ;
+ Text [ danish ] = "Klar" ;
+ Text [ italian ] = "Pronto" ;
+ Text [ spanish ] = "Preparado" ;
+ Text [ french ] = "Disponible" ;
+ Text [ dutch ] = "Klaar" ;
+ Text[ chinese_simplified ] = "¾ÍÐ÷";
+ Text[ russian ] = "Ãîòîâ";
+ Text[ polish ] = "Gotowy";
+ Text[ japanese ] = "±²ÄÞØݸޒ†";
+ Text[ chinese_traditional ] = "´Nºü";
+ Text[ arabic ] = "ÌÇåÒÉ";
+ Text[ greek ] = "Óå åôïéìüôçôá";
+ Text[ korean ] = "Áغñ";
+ Text[ turkish ] = "Hazýr";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_PAUSED
+{
+ Text = "Angehalten" ;
+ Text [ ENGLISH ] = "Paused" ;
+ Text [ portuguese ] = "Cancelado" ;
+ Text [ english_us ] = "Paused" ;
+ Text [ portuguese_brazilian ] = "Angehalten" ;
+ Text [ swedish ] = "Stoppad" ;
+ Text [ danish ] = "Stoppet" ;
+ Text [ italian ] = "Pausa" ;
+ Text [ spanish ] = "Detenido" ;
+ Text [ french ] = "Arrêté" ;
+ Text [ dutch ] = "Gestopt" ;
+ Text[ chinese_simplified ] = "ÔÝÍ£";
+ Text[ russian ] = "Îñòàíîâëåí";
+ Text[ polish ] = "Zatrzymane";
+ Text[ japanese ] = "’†’f";
+ Text[ chinese_traditional ] = "¼È°±";
+ Text[ arabic ] = "ãæÞæÝÉ";
+ Text[ greek ] = "ÄéáêïðÞ";
+ Text[ korean ] = "ÀϽÃÁ¤Áö";
+ Text[ turkish ] = "Durduruldu";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_PENDING
+{
+ Text = "Löschen anstehend" ;
+ Text [ ENGLISH ] = "Pending deletion" ;
+ Text [ portuguese ] = "Eliminar pendente" ;
+ Text [ english_us ] = "Pending deletion" ;
+ Text [ portuguese_brazilian ] = "Löschen anstehend" ;
+ Text [ swedish ] = "Radering i vänteläge" ;
+ Text [ danish ] = "Slet igangværende" ;
+ Text [ italian ] = "Cancellazione in attesa" ;
+ Text [ spanish ] = "Eliminación pendiente" ;
+ Text [ french ] = "Suppression imminente" ;
+ Text [ dutch ] = "Wissen verwacht" ;
+ Text[ chinese_simplified ] = "ɾ³ýµÈºòµÄ";
+ Text[ russian ] = "Óäàëåíèå îòëîæåíî";
+ Text[ polish ] = "Oczekiwanie na usuniêcie";
+ Text[ japanese ] = "휂ð‘Ò‚Á‚Ä‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "§R°£µ¥­Ôªº";
+ Text[ arabic ] = "ÇáÍÐÝ ãÚáÞ";
+ Text[ greek ] = "ÄéáãñáöÞ óôç óõíÝ÷åéá";
+ Text[ korean ] = "´ë±âÁß ÀÛ¾÷ »èÁ¦";
+ Text[ turkish ] = "Silinmek üzere";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_BUSY
+{
+ Text = "Ausgelastet" ;
+ Text [ ENGLISH ] = "Busy" ;
+ Text [ portuguese ] = "Ocupado" ;
+ Text [ english_us ] = "Busy" ;
+ Text [ portuguese_brazilian ] = "Ausgelastet" ;
+ Text [ swedish ] = "Upptaget" ;
+ Text [ danish ] = "Optaget" ;
+ Text [ italian ] = "Sovraccarico" ;
+ Text [ spanish ] = "Ocupado" ;
+ Text [ french ] = "Système occupé" ;
+ Text [ dutch ] = "Bezig" ;
+ Text[ chinese_simplified ] = "æµ";
+ Text[ russian ] = "Â äåéñòâèè";
+ Text[ polish ] = "Zajêty";
+ Text[ japanese ] = "ËÞ¼Þ°ó‘Ô";
+ Text[ chinese_traditional ] = "¦£¸L";
+ Text[ arabic ] = "ãÔÛæáÉ";
+ Text[ greek ] = "Áðáó÷ïëçìÝíïò";
+ Text[ korean ] = "»ç¿ëÁß";
+ Text[ turkish ] = "Meþgul";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_INITIALIZING
+{
+ Text = "Initialisieren" ;
+ Text [ ENGLISH ] = "Initialzing" ;
+ Text [ portuguese ] = "Inicializar" ;
+ Text [ english_us ] = "Initializing" ;
+ Text [ portuguese_brazilian ] = "Initialisieren" ;
+ Text [ swedish ] = "Initierar" ;
+ Text [ danish ] = "Initialiserer" ;
+ Text [ italian ] = "Inizializza" ;
+ Text [ spanish ] = "Inicializar" ;
+ Text [ french ] = "Initialisation" ;
+ Text [ dutch ] = "Initialiseren" ;
+ Text[ chinese_simplified ] = "³õʼ»¯";
+ Text[ russian ] = "Èíèöèàëèçèðîâàòü";
+ Text[ polish ] = "Inicjacja";
+ Text[ japanese ] = "‰Šú‰»";
+ Text[ chinese_traditional ] = "ªì©l¤Æ";
+ Text[ arabic ] = "ÊåíÆÉ";
+ Text[ greek ] = "Áñ÷éêïðïßçóç";
+ Text[ korean ] = "ÃʱâÈ­";
+ Text[ turkish ] = "Baþlat";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_WAITING
+{
+ Text = "Wartend" ;
+ Text [ ENGLISH ] = "Waiting" ;
+ Text [ portuguese ] = "Esperando" ;
+ Text [ english_us ] = "Waiting" ;
+ Text [ portuguese_brazilian ] = "Wartend" ;
+ Text [ swedish ] = "Väntar" ;
+ Text [ danish ] = "Venter" ;
+ Text [ italian ] = "Attesa" ;
+ Text [ spanish ] = "En espera" ;
+ Text [ french ] = "En attente" ;
+ Text [ dutch ] = "Wachtend" ;
+ Text[ chinese_simplified ] = "µÈºò";
+ Text[ russian ] = "Â îæèäàíèè";
+ Text[ polish ] = "Oczekiwanie";
+ Text[ japanese ] = "‘Ò‹@’†";
+ Text[ chinese_traditional ] = "µ¥­Ô";
+ Text[ arabic ] = "ÇäÊÙÇÑ";
+ Text[ greek ] = "ÁíáìïíÞ";
+ Text[ korean ] = "´ë±âÁß";
+ Text[ turkish ] = "Beklemede";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_WARMING_UP
+{
+ Text = "Anlaufen" ;
+ Text [ ENGLISH ] = "Warming up" ;
+ Text [ portuguese ] = "Aquecimento" ;
+ Text [ english_us ] = "Warming up" ;
+ Text [ portuguese_brazilian ] = "Anlaufen" ;
+ Text [ swedish ] = "Startar" ;
+ Text [ danish ] = "Varmer op" ;
+ Text [ italian ] = "In avvio" ;
+ Text [ spanish ] = "Arranque" ;
+ Text [ french ] = "Préchauffage" ;
+ Text [ dutch ] = "Beginnen" ;
+ Text[ chinese_simplified ] = "Ô¤ÈÈ";
+ Text[ russian ] = "Çàïóñê";
+ Text[ polish ] = "Rozgrzewanie";
+ Text[ japanese ] = "€”õ’†";
+ Text[ chinese_traditional ] = "¹w¼ö";
+ Text[ arabic ] = "ÇÓÊÚÏÇÏ";
+ Text[ language_user1 ] = " ";
+ Text[ greek ] = "Ðñïåôïéìáóßá";
+ Text[ korean ] = "ÁغñÁß";
+ Text[ turkish ] = "Isýnýyor";
+};
+String STR_SVT_PRNDLG_PROCESSING
+{
+ Text = "Verarbeiten" ;
+ Text [ ENGLISH ] = "Processing" ;
+ Text [ portuguese ] = "Processamento" ;
+ Text [ english_us ] = "Processing" ;
+ Text [ portuguese_brazilian ] = "Verarbeiten" ;
+ Text [ swedish ] = "Bearbeta" ;
+ Text [ danish ] = "Behandler" ;
+ Text [ italian ] = "Modifica" ;
+ Text [ spanish ] = "Procesar" ;
+ Text [ french ] = "Modifier" ;
+ Text [ dutch ] = "Verwerken" ;
+ Text[ chinese_simplified ] = "´¦Àí";
+ Text[ russian ] = "Îáðàáîòêà";
+ Text[ polish ] = "Opracuj";
+ Text[ japanese ] = "ˆ—";
+ Text[ chinese_traditional ] = "³B²z";
+ Text[ arabic ] = "ãÚÇáÌÉ";
+ Text[ greek ] = "Åðåîåñãáóßá";
+ Text[ korean ] = "ÁøÇàÁß";
+ Text[ turkish ] = "Ýþleniyor";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_PRINTING
+{
+ Text = "Drucken" ;
+ Text [ ENGLISH ] = "Printing" ;
+ Text [ portuguese ] = "Imprimindo" ;
+ Text [ english_us ] = "Printing" ;
+ Text [ portuguese_brazilian ] = "Drucken" ;
+ Text [ swedish ] = "Skriv ut" ;
+ Text [ danish ] = "Udskriv" ;
+ Text [ italian ] = "Stampa" ;
+ Text [ spanish ] = "Imprimir" ;
+ Text [ french ] = "Imprimer" ;
+ Text [ dutch ] = "Printwn" ;
+ Text[ chinese_simplified ] = "´òÓ¡";
+ Text[ russian ] = "Ïå÷àòü";
+ Text[ polish ] = "Drukuj";
+ Text[ japanese ] = "ˆóü";
+ Text[ chinese_traditional ] = "¦C¦L";
+ Text[ arabic ] = "ØÈÇÚÉ";
+ Text[ greek ] = "Åêôýðùóç";
+ Text[ korean ] = "ÀμâÁß";
+ Text[ turkish ] = "Yazdýr";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_OFFLINE
+{
+ Text = "Offline" ;
+ Text [ ENGLISH ] = "Offline" ;
+ Text [ portuguese ] = "Offline" ;
+ Text [ english_us ] = "Offline" ;
+ Text [ portuguese_brazilian ] = "Offline" ;
+ Text [ swedish ] = "Offline" ;
+ Text [ danish ] = "Offline" ;
+ Text [ italian ] = "Offline" ;
+ Text [ spanish ] = "Desconectado" ;
+ Text [ french ] = "Hors ligne" ;
+ Text [ dutch ] = "Offline" ;
+ Text[ chinese_simplified ] = "ÍÑ»ú";
+ Text[ russian ] = "Offline";
+ Text[ polish ] = "Offline";
+ Text[ japanese ] = "µÌײÝ";
+ Text[ chinese_traditional ] = "³s½u";
+ Text[ arabic ] = "ÛíÑ ãÊÕá";
+ Text[ greek ] = "×ùñßò óýíäåóç";
+ Text[ korean ] = "¿ÀÇÁ¶óÀÎ";
+ Text[ turkish ] = "Çevrimdýþý";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_ERROR
+{
+ Text = "Fehler" ;
+ Text [ ENGLISH ] = "Error" ;
+ Text [ portuguese ] = "Erro" ;
+ Text [ english_us ] = "Error" ;
+ Text [ portuguese_brazilian ] = "Fehler" ;
+ Text [ swedish ] = "Fel" ;
+ Text [ danish ] = "Fejl" ;
+ Text [ italian ] = "Errore" ;
+ Text [ spanish ] = "Error" ;
+ Text [ french ] = "Erreur" ;
+ Text [ dutch ] = "Fout" ;
+ Text[ chinese_simplified ] = "´íÎó";
+ Text[ russian ] = "Îøèáêà";
+ Text[ polish ] = "B³¹d";
+ Text[ japanese ] = "´×°";
+ Text[ chinese_traditional ] = "¿ù»~";
+ Text[ arabic ] = "ÎØÃ";
+ Text[ greek ] = "ÓöÜëìá";
+ Text[ korean ] = "¿À·ù";
+ Text[ turkish ] = "Hata";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_SERVER_UNKNOWN
+{
+ Text = "Unbekannter Server" ;
+ Text [ ENGLISH ] = "Unknown Server" ;
+ Text [ portuguese ] = "Servidor desconhecido" ;
+ Text [ english_us ] = "Unknown Server" ;
+ Text [ portuguese_brazilian ] = "Unbekannter Server" ;
+ Text [ swedish ] = "Obekant server" ;
+ Text [ danish ] = "Ukendt server" ;
+ Text [ italian ] = "Server sconosciuto" ;
+ Text [ spanish ] = "Servidor desconocido" ;
+ Text [ french ] = "Serveur inconnu" ;
+ Text [ dutch ] = "Onbekende server" ;
+ Text[ chinese_simplified ] = "²»Ã÷µÄ·þÎñÆ÷";
+ Text[ russian ] = "Íåèçâåñòíûé ñåðâåð";
+ Text[ polish ] = "Nieznany serwer";
+ Text[ japanese ] = "•s–¾‚Ì»°ÊÞ°";
+ Text[ chinese_traditional ] = "¤£©úªº¦øªA¾¹";
+ Text[ arabic ] = "ãÒæøÏ ÛíÑ ãÚÑæÝ";
+ Text[ greek ] = "¢ãíùóôïò äéáêïìéóôÞò";
+ Text[ korean ] = "¾Ë¼ö¾ø´Â ¼­¹ö";
+ Text[ turkish ] = "Bilinmeyen sunucu";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_PAPER_JAM
+{
+ Text = "Papierstau" ;
+ Text [ ENGLISH ] = "Paper jam" ;
+ Text [ portuguese ] = "Engarrafamento de papel" ;
+ Text [ english_us ] = "Paper jam" ;
+ Text [ portuguese_brazilian ] = "Papierstau" ;
+ Text [ swedish ] = "Papperskö" ;
+ Text [ danish ] = "Papirstop" ;
+ Text [ italian ] = "Inceppamento" ;
+ Text [ spanish ] = "Bloqueo de papel" ;
+ Text [ french ] = "Bourrage" ;
+ Text [ dutch ] = "Papieropstopping" ;
+ Text[ chinese_simplified ] = "¿¨Ö½";
+ Text[ russian ] = "Çàåäàíèå áóìàãè";
+ Text[ polish ] = "Papier zablokowany";
+ Text[ japanese ] = "—pŽ†‹l‚Ü‚è";
+ Text[ chinese_traditional ] = "¥d¯È";
+ Text[ arabic ] = "ÊßÏÓ ÇáæÑÞ";
+ Text[ greek ] = "ÌðëïêÜñéóìá ÷áñôéïý";
+ Text[ korean ] = "¿ëÁö °É¸²";
+ Text[ turkish ] = "Kaðýt sýkýþmasý";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_PAPER_OUT
+{
+ Text = "Papiermangel" ;
+ Text [ ENGLISH ] = "Paper out" ;
+ Text [ portuguese ] = "Falta de papel" ;
+ Text [ english_us ] = "Not enough paper" ;
+ Text [ portuguese_brazilian ] = "Papiermangel" ;
+ Text [ swedish ] = "Det saknas papper" ;
+ Text [ danish ] = "Ikke nok papir" ;
+ Text [ italian ] = "Carta esaurita" ;
+ Text [ spanish ] = "Falta de papel" ;
+ Text [ french ] = "Manque de papier" ;
+ Text [ dutch ] = "Geen papier" ;
+ Text[ chinese_simplified ] = "Ö½ÓÃÍê";
+ Text[ russian ] = "Íåõâàòêà áóìàãè";
+ Text[ polish ] = "Brak papieru";
+ Text[ japanese ] = "—pŽ†•s‘«";
+ Text[ chinese_traditional ] = "¯È¥Î§¹";
+ Text[ arabic ] = "äÞÕ Ýí ÇáæÑÞ";
+ Text[ greek ] = "¸ëëåéøç ÷áñôéïý";
+ Text[ korean ] = "¿ëÁö°¡ ºÎÁ·ÇÕ´Ï´Ù.";
+ Text[ turkish ] = "Yeterli miktarda kaðýt yok";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_MANUAL_FEED
+{
+ Text = "Manuelle Papierzufuhr" ;
+ Text [ ENGLISH ] = "Manual feed" ;
+ Text [ portuguese ] = "Alimentação manual" ;
+ Text [ english_us ] = "Manual feed" ;
+ Text [ portuguese_brazilian ] = "Manuelle Papierzufuhr" ;
+ Text [ swedish ] = "Manuell pappersinmatning" ;
+ Text [ danish ] = "Manuel papirfødning" ;
+ Text [ italian ] = "Alimentazione carta manuale" ;
+ Text [ spanish ] = "Alimentación manual" ;
+ Text [ french ] = "Alimentation manuelle" ;
+ Text [ dutch ] = "Handmatige papiertoevoer" ;
+ Text[ chinese_simplified ] = "ÊÖ¹¤ËÍÖ½";
+ Text[ russian ] = "Ðó÷íàÿ ïîäà÷à áóìàãè";
+ Text[ polish ] = "Rêczne podawanie papieru";
+ Text[ japanese ] = "Žè“®‚Å—pŽ†‹Ÿ‹‹";
+ Text[ chinese_traditional ] = "¤â¤u°e¯È";
+ Text[ arabic ] = "ÇáÅãÏÇÏ ÈÇáæÑÞ íÏæíÇð";
+ Text[ greek ] = "×åéñïêßíçôïò åöïäéáóìüò ÷áñôéïý";
+ Text[ korean ] = "¼öµ¿ ±ÞÁö";
+ Text[ turkish ] = "El ile besleme";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_PAPER_PROBLEM
+{
+ Text = "Papierproblem" ;
+ Text [ ENGLISH ] = "Paper problem" ;
+ Text [ portuguese ] = "Problemas com papel" ;
+ Text [ english_us ] = "Paper problem" ;
+ Text [ portuguese_brazilian ] = "Papierproblem" ;
+ Text [ swedish ] = "Pappersproblem" ;
+ Text [ danish ] = "Papirproblem" ;
+ Text [ italian ] = "Errore carta" ;
+ Text [ spanish ] = "Problema de papel" ;
+ Text [ french ] = "Problème d'allimentation de papier" ;
+ Text [ dutch ] = "Papierprobleem" ;
+ Text[ chinese_simplified ] = "Ö½ÕÅÎÊÌâ";
+ Text[ russian ] = "Ïðîáëåìà ñ áóìàãîé";
+ Text[ polish ] = "Problem z papierem";
+ Text[ japanese ] = "—pŽ†‚Ì–â‘è";
+ Text[ chinese_traditional ] = "¯È±i°ÝÃD";
+ Text[ arabic ] = "ãÔßáÉ Ýí ÇáæÑÞ";
+ Text[ greek ] = "Ðñüâëçìá ìå ôï ÷áñôß";
+ Text[ korean ] = "¿ëÁö ¹®Á¦";
+ Text[ turkish ] = "Kaðýt sorunu";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_IO_ACTIVE
+{
+ Text = "E/A aktiv" ;
+ Text [ ENGLISH ] = "I/O active" ;
+ Text [ portuguese ] = "I/O activos" ;
+ Text [ english_us ] = "I/O active" ;
+ Text [ portuguese_brazilian ] = "E/A aktiv" ;
+ Text [ swedish ] = "I/O aktiv" ;
+ Text [ danish ] = "I/O aktiv" ;
+ Text [ italian ] = "I/O attivo" ;
+ Text [ spanish ] = "I/O activos" ;
+ Text [ french ] = "E/S active" ;
+ Text [ dutch ] = "I/O actief" ;
+ Text[ chinese_simplified ] = "¼¤»îÊäÈë/Êä³ö";
+ Text[ russian ] = "Àêòèâíûé Âõîä/Âûõîä";
+ Text[ polish ] = "We/Wy aktywne";
+ Text[ japanese ] = "I/O ±¸Ã¨ÌÞ";
+ Text[ chinese_traditional ] = "¿E¬¡¿é¤J/¿é¥X";
+ Text[ arabic ] = "ÇáÅÏÎÇá/ÇáÅÎÑÇÌ äÔØ";
+ Text[ greek ] = "Åéó/Åî åíåñãÜ";
+ Text[ korean ] = "I/O È°¼º";
+ Text[ turkish ] = "G/Ç aktif";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_OUTPUT_BIN_FULL
+{
+ Text = "Ausgabefach ist voll" ;
+ Text [ ENGLISH ] = "Output bin full" ;
+ Text [ portuguese ] = "Cesto de saída está cheio" ;
+ Text [ english_us ] = "Output bin full" ;
+ Text [ portuguese_brazilian ] = "Ausgabefach ist voll" ;
+ Text [ swedish ] = "Utgångsfacket är fullt" ;
+ Text [ danish ] = "Output-bakken er fyldt" ;
+ Text [ italian ] = "Il vano di uscita è pieno" ;
+ Text [ spanish ] = "La papelera de salida está llena" ;
+ Text [ french ] = "Le bac de sortie est plein" ;
+ Text [ dutch ] = "Postvak UIT is vol" ;
+ Text[ chinese_simplified ] = "Êä³ö»º³åÇøÒçÂú";
+ Text[ russian ] = "Óñòðîéñòâî âûäà÷è çàïîëíåíî";
+ Text[ polish ] = "Zasobnik wyjœciowy zape³niony";
+ Text[ japanese ] = "ˆóü±³ÄÌ߯ėp‚Ì—eŠí‚ª‚¢‚Á‚Ï‚¢‚Å‚·B";
+ Text[ chinese_traditional ] = "¿é¥X½w¨R°Ï·¸º¡";
+ Text[ arabic ] = "ÏÑÌ ÇáÅÎÑÇÌ ããÊáÆ";
+ Text[ greek ] = "Ôï ôìÞìá åîáãùãÞò åßíáé ðëÞñåò";
+ Text[ korean ] = "Ãâ·ÂÇÔÀÌ °¡µæ Âü";
+ Text[ turkish ] = "Çýktý çekmecesi doldu";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_TONER_LOW
+{
+ Text = "Niedriger Tonerstand" ;
+ Text [ ENGLISH ] = "Towner low" ;
+ Text [ portuguese ] = "Pouco toner" ;
+ Text [ english_us ] = "Toner low" ;
+ Text [ portuguese_brazilian ] = "Niedriger Tonerstand" ;
+ Text [ swedish ] = "Lite toner" ;
+ Text [ danish ] = "Næsten ingen toner" ;
+ Text [ italian ] = "Livello del toner basso" ;
+ Text [ spanish ] = "Tóner bajo" ;
+ Text [ french ] = "Remplissez du toner" ;
+ Text [ dutch ] = "Lage tonerstand" ;
+ Text[ chinese_simplified ] = "Ä«·Û²»×ã";
+ Text[ russian ] = "Íèçêîå ñîñòîÿíèå òîíåðà";
+ Text[ polish ] = "Ma³o tonera";
+ Text[ japanese ] = "ÄÅ°‚ÌŽc—Ê‚ª­‚È‚­‚È‚Á‚Ä‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "¾¥¯»¤£¨¬";
+ Text[ arabic ] = "ÇäÎÝÇÖ ãÓÍæÞ ÇáÍÈÑ";
+ Text[ greek ] = "×áìçëÞ óôÜèìç ôïõ Toner";
+ Text[ korean ] = "Åä³Ê°¡ Àû½À´Ï´Ù.";
+ Text[ turkish ] = "Toner azaldý";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_NO_TONER
+{
+ Text = "Kein Toner" ;
+ Text [ ENGLISH ] = "No toner" ;
+ Text [ portuguese ] = "Sem toner" ;
+ Text [ english_us ] = "No toner" ;
+ Text [ portuguese_brazilian ] = "Kein Toner" ;
+ Text [ swedish ] = "Toner slut" ;
+ Text [ danish ] = "Ingen toner" ;
+ Text [ italian ] = "Manca il toner" ;
+ Text [ spanish ] = "No hay tóner" ;
+ Text [ french ] = "Pas de toner" ;
+ Text [ dutch ] = "Geen toner" ;
+ Text[ chinese_simplified ] = "Ä«·ÛÓÃÍê";
+ Text[ russian ] = "Íåò òîíåðà";
+ Text[ polish ] = "Brak tonera";
+ Text[ japanese ] = "ÄÅ°‚ª‚ ‚è‚Ü‚¹‚ñB";
+ Text[ language_user1 ] = " ";
+ Text[ chinese_traditional ] = "¾¥¯»¥Î§¹";
+ Text[ arabic ] = "áÇ íæÌÏ ãÓÍæÞ ÇáÍÈÑ";
+ Text[ greek ] = "Äåí õðÜñ÷åé Ôoner";
+ Text[ korean ] = "Åä³Ê°¡ ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Toner bitti";
+};
+String STR_SVT_PRNDLG_PAGE_PUNT
+{
+ Text = "Seitenverwurf" ;
+ Text [ ENGLISH ] = "Page punt" ;
+ Text [ portuguese ] = "Eliminar página" ;
+ Text [ english_us ] = "Delete Page" ;
+ Text [ portuguese_brazilian ] = "Seitenverwurf" ;
+ Text [ swedish ] = "Kassera sida" ;
+ Text [ danish ] = "Kasser side" ;
+ Text [ italian ] = "Rigetta pagina" ;
+ Text [ spanish ] = "Eliminar página" ;
+ Text [ french ] = "Suppression de page" ;
+ Text [ dutch ] = "Pagina's uitzonderen" ;
+ Text[ chinese_simplified ] = "ɾ³ýÒ³";
+ Text[ russian ] = "Óäàëåíèå ñòðàíèöû";
+ Text[ polish ] = "Usuñ stronê";
+ Text[ japanese ] = "Íß°¼Þíœ";
+ Text[ chinese_traditional ] = "§R°£­¶";
+ Text[ arabic ] = "ÍÐÝ ÕÝÍÉ";
+ Text[ greek ] = "ÄéáãñáöÞ óåëßäáò";
+ Text[ korean ] = "ÆäÀÌÁö »èÁ¦";
+ Text[ turkish ] = "Sayfayý sil";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_USER_INTERVENTION
+{
+ Text = "Benutzerzugriff notwendig" ;
+ Text [ ENGLISH ] = "User intervention necessary" ;
+ Text [ portuguese ] = "Necessária intervenção do utilizador" ;
+ Text [ english_us ] = "User intervention necessary" ;
+ Text [ portuguese_brazilian ] = "Benutzerzugriff notwendig" ;
+ Text [ swedish ] = "Åtkomst nödvändigt för användaren " ;
+ Text [ danish ] = "Brugerhandling krævet" ;
+ Text [ italian ] = "È necessario l'accesso utente" ;
+ Text [ spanish ] = "Intervención necesaria del usuario " ;
+ Text [ french ] = "Intervention de l'utilisateur requise" ;
+ Text [ dutch ] = "Ingrijpen door gebruiker noodzakelijk" ;
+ Text[ chinese_simplified ] = "ÐèҪʹÓÃÕßÉ趨";
+ Text[ russian ] = "Íåîáõîäèìî âìåøàòåëüñòâî ïîëüçîâàòåëÿ";
+ Text[ polish ] = "Konieczna interwencja u¿ytkownika";
+ Text[ japanese ] = "Õ°»Þ°‚̱¸¾½‚ª•K—v";
+ Text[ chinese_traditional ] = "»Ý­n¦Û­q";
+ Text[ arabic ] = "ãä ÇáÖÑæÑí Ãä íÊÏÎá ÇáãÓÊÎÏã";
+ Text[ greek ] = "ÐáñÝìâáóç ôïõ ÷ñÞóôç áíáãêáßá";
+ Text[ korean ] = "»ç¿ëÀÚ °³ÀÔÀÌ ÇÊ¿äÇÔ";
+ Text[ turkish ] = "Kullanýcý müdahalesi gerekiyor";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_OUT_OF_MEMORY
+{
+ Text = "Nicht genügend Speicher" ;
+ Text [ ENGLISH ] = "Out of memory" ;
+ Text [ portuguese ] = "Memória insuficiente" ;
+ Text [ english_us ] = "Insufficient memory" ;
+ Text [ portuguese_brazilian ] = "Nicht genügend Speicher" ;
+ Text [ swedish ] = "Ej tillräckligt med minne" ;
+ Text [ danish ] = "Ikke nok hukommelse" ;
+ Text [ italian ] = "Non c'è abbastanza memoria" ;
+ Text [ spanish ] = "Memoria insuficiente" ;
+ Text [ french ] = "Mémoire insuffisante" ;
+ Text [ dutch ] = "Niet voldoende opslagruimte" ;
+ Text[ chinese_simplified ] = "ÄÚ´æ²»×ã";
+ Text[ russian ] = "Íåäîñòàòî÷íî ïàìÿòè";
+ Text[ polish ] = "Nie wystarczy pamiêci";
+ Text[ japanese ] = "\\•ª‚ÈÒÓØ‚ª‚ ‚è‚Ü‚¹‚ñB";
+ Text[ chinese_traditional ] = "°O¾ÐÅ餣¨¬";
+ Text[ arabic ] = "ÇáÐÇßÑÉ ÛíÑ ßÇÝíÉ";
+ Text[ greek ] = "Ç ìíÞìç äåí åðáñêåß";
+ Text[ korean ] = "¸Þ¸ð¸®°¡ ºÎÁ·ÇÕ´Ï´Ù.";
+ Text[ turkish ] = "Bellek yeterli deðil";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_DOOR_OPEN
+{
+ Text = "Abdeckung offen" ;
+ Text [ ENGLISH ] = "Door open" ;
+ Text [ portuguese ] = "Capa aberta" ;
+ Text [ english_us ] = "Cover open" ;
+ Text [ portuguese_brazilian ] = "Abdeckung offen" ;
+ Text [ swedish ] = "Luckan är öppen" ;
+ Text [ danish ] = "Låget er åben" ;
+ Text [ italian ] = "Apri copertura" ;
+ Text [ spanish ] = "Abrir cubierta" ;
+ Text [ french ] = "Boîtier ouvert" ;
+ Text [ dutch ] = "Afdekking boven" ;
+ Text[ chinese_simplified ] = "»¤¸Ç³¨¿ª";
+ Text[ russian ] = "Êðûøêà îòêðûòà";
+ Text[ polish ] = "Pokrywa otwarta";
+ Text[ japanese ] = "ÌßØÝÀ°‚ÌŠW‚ªŠJ‚¢‚Ä‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "Å@»\\´¯¶}";
+ Text[ arabic ] = "ÇáÛØÇÁ ãÝÊæÍ";
+ Text[ greek ] = "ÊÜëõììá áíïé÷ôü";
+ Text[ korean ] = "µ¤°³¸¦ ¿ÀÇ»óÅ·Î";
+ Text[ turkish ] = "Kapak açýk";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_POWER_SAVE
+{
+ Text = "Energiesparmodus" ;
+ Text [ ENGLISH ] = "Power save" ;
+ Text [ portuguese ] = "Modo poupança de energia" ;
+ Text [ english_us ] = "Power save mode" ;
+ Text [ portuguese_brazilian ] = "Energiesparmodus" ;
+ Text [ swedish ] = "Energiesparläge" ;
+ Text [ danish ] = "Energisparende modus" ;
+ Text [ italian ] = "Modo risparmio energetico" ;
+ Text [ spanish ] = "Modo de ahorro energético" ;
+ Text [ french ] = "Mode économie d'énergie" ;
+ Text [ dutch ] = "Energiespaarmodus" ;
+ Text[ chinese_simplified ] = "½ÚÔ¼µçԴģʽ";
+ Text[ russian ] = "Ðåæèì ýêîíîìèè ýëåêòðîýíåðãèè";
+ Text[ polish ] = "Tryb oszczêdzania energii";
+ Text[ japanese ] = "´Èٷްߌ¸Ó°ÄÞ";
+ Text[ chinese_traditional ] = "¸`¬ù¹q·½¼Ò¦¡";
+ Text[ arabic ] = "æÖÚ ÊæÝíÑ ÇáØÇÞÉ";
+ Text[ greek ] = "ÊáôÜóôáóç åîïéêïíüìçóçò åíÝñãåéáò";
+ Text[ korean ] = "Àü¿ø ÀúÀå ¸ðµå";
+ Text[ turkish ] = "Enerji tasarruf kipi";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_DEFPRINTER
+{
+ Text = "Standarddrucker" ;
+ Text [ ENGLISH ] = "Default printer" ;
+ Text [ portuguese ] = "Impressora-padrão" ;
+ Text [ english_us ] = "Default printer" ;
+ Text [ portuguese_brazilian ] = "Standarddrucker" ;
+ Text [ swedish ] = "Standardskrivare" ;
+ Text [ danish ] = "Standardprinter" ;
+ Text [ italian ] = "Stampante predefinta" ;
+ Text [ spanish ] = "Predeterminada" ;
+ Text [ french ] = "Imprimante par défaut" ;
+ Text [ dutch ] = "Standaardprinter" ;
+ Text[ chinese_simplified ] = "ĬÈÏ´òÓ¡»ú";
+ Text[ russian ] = "Ñòàíäàðòíûé ïðèíòåð";
+ Text[ polish ] = "Drukarka domyœlna";
+ Text[ japanese ] = "•W€ÌßØÝÀ";
+ Text[ chinese_traditional ] = "Àq»{¦Lªí¾÷";
+ Text[ arabic ] = "ÇáØÇÈÚÉ ÇáÇÝÊÑÇÖíÉ";
+ Text[ greek ] = "ÐñïåðéëåãìÝíïò åêôõðùôÞò";
+ Text[ korean ] = "±âº» ÇÁ¸°ÅÍ";
+ Text[ turkish ] = "Standart yazýcý";
+ Text[ language_user1 ] = " ";
+};
+String STR_SVT_PRNDLG_JOBCOUNT
+{
+ Text = "%d Dokumente" ;
+ Text [ ENGLISH ] = "%d documents" ;
+ Text [ portuguese ] = "%d documentos" ;
+ Text [ english_us ] = "%d documents" ;
+ Text [ portuguese_brazilian ] = "%d Dokumente" ;
+ Text [ swedish ] = "%d dokument" ;
+ Text [ danish ] = "%d dokumenter" ;
+ Text [ italian ] = "%d documenti" ;
+ Text [ spanish ] = "%d documentos" ;
+ Text [ french ] = "%d documents" ;
+ Text [ dutch ] = "%d documenten" ;
+ Text[ chinese_simplified ] = "%d Îĵµ";
+ Text[ russian ] = "%d äîêóìåíòà(îâ)";
+ Text[ polish ] = "%d dokumenty";
+ Text[ japanese ] = "%d‚ÌÄÞ·­ÒÝÄ";
+ Text[ chinese_traditional ] = "%d ¤å¥ó";
+ Text[ arabic ] = "ãÓÊäÏÇÊ%d ";
+ Text[ greek ] = "%d Ýããñáöá";
+ Text[ korean ] = "%d ¹®¼­";
+ Text[ turkish ] = "%d belge";
+ Text[ language_user1 ] = " ";
+};
+
+ModalDialog DLG_SVT_PRNDLG_PRNSETUPDLG
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Moveable = TRUE ;
+ Size = MAP_APPFONT ( 260 , 104 ) ;
+ Text = "Drucker einrichten" ;
+ Text [ ENGLISH ] = "Printer Setup" ;
+ Text [ english_us ] = "Printer Setup" ;
+ Text [ portuguese_brazilian ] = "Drucker einrichten" ;
+ Text [ swedish ] = "Installera skrivare" ;
+ Text [ danish ] = "Indstil printer" ;
+ Text [ italian ] = "Imposta stampante" ;
+ Text [ spanish ] = "Configurar impresora" ;
+ Text [ french ] = "Imprimante sélectionnée" ;
+ Text [ dutch ] = "Printer instellen" ;
+ Text [ portuguese ] = "Configurar impressora" ;
+ GroupBox GRP_PRINTER
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 248 , 75 ) ;
+ Text = "Drucker" ;
+ Text [ ENGLISH ] = "Printer" ;
+ Text [ english_us ] = "Printer" ;
+ Text [ portuguese_brazilian ] = "Drucker" ;
+ Text [ swedish ] = "Skrivare" ;
+ Text [ danish ] = "Printer" ;
+ Text [ italian ] = "Stampante" ;
+ Text [ spanish ] = "Impresora" ;
+ Text [ french ] = "Imprimante" ;
+ Text [ dutch ] = "Printer" ;
+ Text [ portuguese ] = "Impressora" ;
+ Text[ chinese_simplified ] = "´òÓ¡»ú";
+ Text[ russian ] = "Ïðèíòåð";
+ Text[ polish ] = "Drukarka";
+ Text[ japanese ] = "ÌßØÝÀ";
+ Text[ chinese_traditional ] = "¦Lªí¾÷";
+ Text[ arabic ] = "ÇáØÇÈÚÉ";
+ Text[ greek ] = "ÅêôõðùôÞò";
+ Text[ korean ] = "ÇÁ¸°ÅÍ";
+ Text[ turkish ] = "Yazýcý";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_NAME
+ {
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "~Name" ;
+ Text [ ENGLISH ] = "~Name" ;
+ Text [ english_us ] = "~Name" ;
+ Text [ portuguese_brazilian ] = "~Name" ;
+ Text [ swedish ] = "~Namn" ;
+ Text [ danish ] = "Navn" ;
+ Text [ italian ] = "~Nome" ;
+ Text [ spanish ] = "~Nombre" ;
+ Text [ french ] = "~Nom" ;
+ Text [ dutch ] = "~Naam" ;
+ Text [ portuguese ] = "~Nome" ;
+ Text[ chinese_simplified ] = "Ãû³Æ(~N)";
+ Text[ russian ] = "~Èìÿ";
+ Text[ polish ] = "Nazwa";
+ Text[ japanese ] = "–¼‘O(~N)";
+ Text[ chinese_traditional ] = "¦WºÙ(~N)";
+ Text[ arabic ] = "ÇáÇÓã";
+ Text[ greek ] = "¼íïìá";
+ Text[ korean ] = "À̸§(~N)";
+ Text[ turkish ] = "~Ad";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_NAMES
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 60 , 12 ) ;
+ Size = MAP_APPFONT ( 125 , 80 ) ;
+ DropDown = TRUE ;
+ Sort = TRUE ;
+ };
+ PushButton BTN_PROPERTIES
+ {
+ Pos = MAP_APPFONT ( 188 , 12 ) ;
+ Size = MAP_APPFONT ( 60 , 14 ) ;
+ Text = "~Eigenschaften..." ;
+ Text [ ENGLISH ] = "~Properties..." ;
+ Text [ portuguese ] = "~Propriedades..." ;
+ Text [ english_us ] = "Propert~ies..." ;
+ Text [ portuguese_brazilian ] = "~Eigenschaften..." ;
+ Text [ swedish ] = "~Egenskaper..." ;
+ Text [ danish ] = "Egenskaber..." ;
+ Text [ italian ] = "~Proprietà..." ;
+ Text [ spanish ] = "~Propiedades..." ;
+ Text [ french ] = "~Propriétés..." ;
+ Text [ dutch ] = "~Eigenschappen..." ;
+ Text[ chinese_simplified ] = "ÊôÐÔ(~I)...";
+ Text[ russian ] = "~Ñâîéñòâà...";
+ Text[ polish ] = "W³aœciwoœci...";
+ Text[ japanese ] = "ÌßÛÊßè(~I)...";
+ Text[ chinese_traditional ] = "ÄÝ©Ê(~I)...";
+ Text[ arabic ] = "ÎÕÇÆÕ...";
+ Text[ greek ] = "Éäéüôçôåò...";
+ Text[ korean ] = "µî·ÏÁ¤º¸(~I)...";
+ Text[ turkish ] = "~Özellikler...";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_STATUS
+ {
+ Pos = MAP_APPFONT ( 12 , 29 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Status" ;
+ Text [ ENGLISH ] = "Status" ;
+ Text [ english_us ] = "Status" ;
+ Text [ portuguese_brazilian ] = "Status" ;
+ Text [ swedish ] = "Status" ;
+ Text [ danish ] = "Status" ;
+ Text [ italian ] = "Stato" ;
+ Text [ spanish ] = "Estado" ;
+ Text [ french ] = "État" ;
+ Text [ dutch ] = "Status" ;
+ Text [ portuguese ] = "Estado" ;
+ Text[ chinese_simplified ] = "״̬";
+ Text[ russian ] = "Ñîñòîÿíèå";
+ Text[ polish ] = "Stan";
+ Text[ japanese ] = "½Ã°À½";
+ Text[ chinese_traditional ] = "ª¬ºA";
+ Text[ arabic ] = "ÇáÍÇáÉ";
+ Text[ greek ] = "ÊáôÜóôáóç";
+ Text[ korean ] = "»óÅÂ";
+ Text[ turkish ] = "Durum";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_STATUS
+ {
+ Pos = MAP_APPFONT ( 60 , 29 ) ;
+ Size = MAP_APPFONT ( 188 , 10 ) ;
+ };
+ FixedText FT_TYPE
+ {
+ Pos = MAP_APPFONT ( 12 , 40 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Typ" ;
+ Text [ ENGLISH ] = "Type" ;
+ Text [ english_us ] = "Type" ;
+ Text [ portuguese_brazilian ] = "Typ" ;
+ Text [ swedish ] = "Typ" ;
+ Text [ danish ] = "Type" ;
+ Text [ italian ] = "Tipo" ;
+ Text [ spanish ] = "Tipo" ;
+ Text [ french ] = "Type" ;
+ Text [ dutch ] = "Type" ;
+ Text [ portuguese ] = "Tipo" ;
+ Text[ chinese_simplified ] = "ÀàÐÍ";
+ Text[ russian ] = "Òèï";
+ Text[ polish ] = "Typ";
+ Text[ japanese ] = "À²Ìß";
+ Text[ chinese_traditional ] = "Ãþ«¬";
+ Text[ arabic ] = "ÇáäæÚ";
+ Text[ greek ] = "Ôýðïò";
+ Text[ korean ] = "ÇüÅÂ";
+ Text[ turkish ] = "Tip";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_TYPE
+ {
+ Pos = MAP_APPFONT ( 60 , 40 ) ;
+ Size = MAP_APPFONT ( 188 , 10 ) ;
+ };
+ FixedText FT_LOCATION
+ {
+ Pos = MAP_APPFONT ( 12 , 51 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Ort" ;
+ Text [ ENGLISH ] = "Location" ;
+ Text [ english_us ] = "Location" ;
+ Text [ portuguese_brazilian ] = "Ort" ;
+ Text [ swedish ] = "Plats" ;
+ Text [ danish ] = "Placering" ;
+ Text [ italian ] = "Percorso" ;
+ Text [ spanish ] = "Ubicación" ;
+ Text [ french ] = "Emplacement" ;
+ Text [ dutch ] = "Plaats" ;
+ Text [ portuguese ] = "Lugar" ;
+ Text[ chinese_simplified ] = "λÖÃ";
+ Text[ russian ] = "Ìåñòî";
+ Text[ polish ] = "Lokalizacja";
+ Text[ japanese ] = "êŠ";
+ Text[ chinese_traditional ] = "¦ì¸m";
+ Text[ arabic ] = "ÇáãæÞÚ";
+ Text[ greek ] = "Ôïðïèåóßá";
+ Text[ korean ] = "À§Ä¡";
+ Text[ turkish ] = "Yer";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_LOCATION
+ {
+ Pos = MAP_APPFONT ( 60 , 51 ) ;
+ Size = MAP_APPFONT ( 188 , 10 ) ;
+ };
+ FixedText FT_COMMENT
+ {
+ Pos = MAP_APPFONT ( 12 , 62 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Kommentar" ;
+ Text [ ENGLISH ] = "Comment" ;
+ Text [ english_us ] = "Comment" ;
+ Text [ portuguese_brazilian ] = "Kommentar" ;
+ Text [ swedish ] = "Kommentar" ;
+ Text [ danish ] = "Kommentar" ;
+ Text [ italian ] = "Commento" ;
+ Text [ spanish ] = "Comentario" ;
+ Text [ french ] = "Commentaire" ;
+ Text [ dutch ] = "Commentaar" ;
+ Text [ portuguese ] = "Comentário" ;
+ Text[ chinese_simplified ] = "×¢½â";
+ Text[ russian ] = "Êîììåíòàðèé";
+ Text[ polish ] = "Komentarz";
+ Text[ japanese ] = "ºÒÝÄ";
+ Text[ chinese_traditional ] = "ª`¸Ñ";
+ Text[ arabic ] = "ÊÚáíÞ";
+ Text[ greek ] = "Ó÷üëéï";
+ Text[ korean ] = "¸Þ¸ð";
+ Text[ turkish ] = "Açýklama";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_COMMENT
+ {
+ Pos = MAP_APPFONT ( 60 , 62 ) ;
+ Size = MAP_APPFONT ( 188 , 10 ) ;
+ };
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 95 , 84 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL
+ {
+ Pos = MAP_APPFONT ( 148 , 84 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ HelpButton BTN_HELP
+ {
+ Pos = MAP_APPFONT ( 204 , 84 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ };
+ Text[ chinese_simplified ] = "É趨´òÓ¡»ú";
+ Text[ russian ] = "Óñòàíîâèòü ïðèíòåð";
+ Text[ polish ] = "Ustaw drukarkê";
+ Text[ japanese ] = "ÌßØÝÀÝ’è";
+ Text[ chinese_traditional ] = "³]©w¦Lªí¾÷";
+ Text[ arabic ] = "ÅÚÏÇÏ ÇáØÇÈÚÉ";
+ Text[ language_user1 ] = " ";
+ Text[ greek ] = "ÅãêáôÜóôáóç åêôõðùôÞ";
+ Text[ korean ] = "ÇÁ¸°ÅÍ ¼³Á¤";
+ Text[ turkish ] = "Yazýcý ayarlarý";
+};
diff --git a/svtools/source/dialogs/propctrl.cxx b/svtools/source/dialogs/propctrl.cxx
new file mode 100644
index 000000000000..f2e5959937b1
--- /dev/null
+++ b/svtools/source/dialogs/propctrl.cxx
@@ -0,0 +1,534 @@
+/*************************************************************************
+ *
+ * $RCSfile: propctrl.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _USR_INTROSP_HXX
+#include <usr/inspect.hxx>
+#endif
+#ifndef _USR_SERINFO_HXX
+#include <usr/serinfo.hxx>
+#endif
+#ifndef _USR_INTROSP_HXX
+#include <usr/introsp.hxx>
+#endif
+
+#include <propctrl.hxx>
+#include <property.hxx>
+
+
+// Controller-Implementation
+class PropertyEditorControler_Impl : public SvPropertyDataControl
+{
+ XIntrospectionAccessRef mxUnoAccess;
+ PropertySequence mPropSeq;
+ XPropertyEditorRef mxEditor;
+ SvPropertyBox* mpPropBox;
+ UsrAny maUnoObj;
+
+public:
+ // Provisorisch direkt Window mitgeben
+ PropertyEditorControler_Impl( SvPropertyBox* pPropBox_ );
+ //SimplePropertyEditor_Impl( void );
+
+ // Objekt zum Editieren setzen, dies loest das Eintragen
+ // der Properties in die PropertyBox aus
+ void setObject( XPropertyEditorRef xEditor_, const UsrAny& aToEditObj,
+ /* HACK fuer History-Interface*/String aPath, BOOL bBack=FALSE, BOOL bForward=FALSE );
+
+ /* SPAETER
+ SMART_UNO_DECLARATION(ImplIntrospection,UsrObject);
+
+ // Methoden von XInterface
+ XInterface * queryInterface( Uik aUik );
+ XIdlClassRef getIdlClass();
+ */
+
+ // Methoden von SvPropertyDataControl
+ virtual void Modified( const String& aName,
+ const String& aVal,
+ void* pData);
+
+ virtual void Clicked( const String& aName,
+ const String& aVal,
+ void* pData);
+
+ virtual void Commit( const String& aName,
+ const String& aVal,
+ void* pData);
+
+ virtual void Select( const String& aName,
+ void* pData);
+
+ virtual void LinkClicked(const String& aName,
+ void* pData);
+
+ // TODO: Das muss raus, sehr unglueckliche Schnittstelle
+ // PropertyBox erzwingt Zustand des Controllers
+ virtual String GetTheCorrectProperty() const;
+};
+
+// Methoden von XPropertyEditor
+PropertyEditorControler_Impl::PropertyEditorControler_Impl( SvPropertyBox* pPropBox_ )
+{
+ mpPropBox = pPropBox_;
+}
+
+void PropertyEditorControler_Impl::setObject( XPropertyEditorRef xEditor_, const UsrAny& aToEditObj,
+ /* HACK fuer History-Interface*/ String aPath, BOOL bBack, BOOL bForward )
+{
+ static XIntrospectionRef xIntrospection;
+
+ // Ohne Fenster laeuft gar nix
+ if( !mpPropBox )
+ return;
+
+ // Fenster aufraeumen
+ mpPropBox->ClearAll();
+
+ // Editor und Objekt übernehmen
+ mxEditor = xEditor_;
+ maUnoObj = aToEditObj;
+
+ if( !xIntrospection.is() )
+ {
+ // Introspection-Service holen
+ XServiceManagerRef xServiceManager = getGlobalServiceManager();
+ XServiceProviderRef xProv = xServiceManager->getServiceProvider
+ ( "com.sun.star.beans.Introspection", UikSequence(), UikSequence() );
+ xIntrospection = (XIntrospection *)xProv->newInstance()
+ ->queryInterface( XIntrospection::getSmartUik() );
+ }
+ if( !xIntrospection.is() )
+ return;
+
+ // und unspecten
+ mxUnoAccess = xIntrospection->inspect( maUnoObj );
+ if( !mxUnoAccess.Is() )
+ return;
+
+ // Uns als Controler anmelden
+ mpPropBox->SetController( this );
+
+ // Properties anlegen
+ mPropSeq = mxUnoAccess->getProperties();
+ UINT32 nPropCount = mPropSeq.getLen();
+ const Property* pProps = mPropSeq.getConstArray();
+
+ // 1. Seite anlegen
+ USHORT nPropPageId = mpPropBox->AppendPage("Properties");
+
+ // Beim Eintragen solls nicht flimmern
+ mpPropBox->DisableUpdate();
+
+ // Dummy-Properties fuer Path und Navigation
+ SvPropertyData aProperty;
+ if( aPath.Len() )
+ {
+ // Interface und Structs werden Hyperlinks
+ aProperty.bIsHyperLink = FALSE;
+ aProperty.bIsLocked = TRUE;
+ aProperty.bHasVisibleXButton = FALSE;
+ aProperty.eKind = KOC_EDIT;
+ aProperty.pControl = NULL;
+ aProperty.pDataPtr = NULL;
+ aProperty.aName = "Path";
+ aProperty.aValue = aPath;
+ mpPropBox->InsertEntry( aProperty );
+ }
+ if( bBack || bForward )
+ {
+ // Interface und Structs werden Hyperlinks
+ aProperty.bIsHyperLink = TRUE;
+ aProperty.bIsLocked = TRUE;
+ // HACK, solange Hyperlink nicht funktioniert
+ aProperty.bHasVisibleXButton = aProperty.bIsHyperLink;
+ aProperty.eKind = KOC_EDIT;
+ UINT32 iHandle;
+ aProperty.pControl = NULL;
+ if( bBack )
+ {
+ iHandle = 1000001;
+ aProperty.pDataPtr = (void*)iHandle;
+ aProperty.aName = "<-";
+ aProperty.aValue = "Back";
+ mpPropBox->InsertEntry( aProperty );
+ }
+ if( bForward )
+ {
+ iHandle = 1000000;
+ aProperty.pDataPtr = (void*)iHandle;
+ aProperty.aName = "->";
+ aProperty.aValue = "Forward";
+ mpPropBox->InsertEntry( aProperty );
+ }
+ }
+
+ // Properties eintragen
+ // TODO: Wo kommen die Strings her
+ UINT32 i;
+ for( i = 0 ; i < nPropCount ; i++ )
+ {
+ const Property& rProp = pProps[ i ];
+
+ // TypeClass des Property ermitteln
+ XIdlClassRef xPropClass = rProp.Type;
+ if( !xPropClass.is() )
+ {
+ DBG_ERROR( "PropertyEditorControler_Impl::Commit(), Property without type" )
+ return;
+ }
+ TypeClass eType = xPropClass->getTypeClass();
+
+ // Interface und Structs werden Hyperlinks
+ aProperty.bIsHyperLink = ( eType == TYPECLASS_INTERFACE || eType == TYPECLASS_STRUCT );
+ aProperty.bIsLocked = ((rProp.Attributes & PROPERTY_READONLY) != 0 );
+
+ // HACK, solange Hyperlink nicht funktioniert
+ aProperty.bHasVisibleXButton = aProperty.bIsHyperLink;
+
+ // Wert holen und in String wandeln
+ UsrAny aVal = mxUnoAccess->getPropertyValueByIndex( maUnoObj, i );
+ String aStrVal = AnyToString( aVal );
+
+ // Properties reinbraten
+ aProperty.eKind = KOC_EDIT;
+ aProperty.aName = rProp.Name;
+ aProperty.aValue = aStrVal;
+ aProperty.pDataPtr = (void*)i;
+ aProperty.pControl = NULL;
+ //aProperty.theValues.Insert(new String("1"),aProperty.theValues.Count());
+ //aProperty.theValues.Insert(new String("2"),aProperty.theValues.Count());
+ //aProperty.theValues.Insert(new String("3"),aProperty.theValues.Count());
+ //aProperty.theValues.Insert(new String("4"),aProperty.theValues.Count());
+ mpPropBox->InsertEntry( aProperty );
+ }
+
+ // 2. Seite fuer Listener
+ // TODO: Wo kommen die Eintraege her
+ USHORT nListenerPageId = mpPropBox->AppendPage("Listener");
+
+ XIdlClassSequence aSupportedListenerSeq = mxUnoAccess->getSupportedListeners();
+ const XIdlClassRef* pListenerArray = aSupportedListenerSeq.getConstArray();
+ UINT32 nIfaceCount = aSupportedListenerSeq.getLen();
+
+ // Property-Data vorfuellen
+ aProperty.eKind = KOC_EDIT;
+ //aProperty.eKind = KOC_UNDEFINED;
+ aProperty.aValue = "Listener-Value";
+ aProperty.bHasVisibleXButton = TRUE;
+ // TEST
+ //aProperty.bIsHyperLink = TRUE;
+ aProperty.bIsHyperLink = FALSE;
+ aProperty.bIsLocked = TRUE;
+ //aProperty.bIsLocked = FALSE;
+ aProperty.pDataPtr = NULL;
+ aProperty.pControl = NULL;
+
+ for( UINT32 j = 0 ; j < nIfaceCount ; j++ )
+ {
+ const XIdlClassRef& rxIfaceClass = pListenerArray[j];
+ aProperty.aName = rxIfaceClass->getName();
+ mpPropBox->InsertEntry( aProperty );
+ }
+ mpPropBox->EnableUpdate();
+ mpPropBox->SetPage( nPropPageId );
+}
+
+void PropertyEditorControler_Impl::Modified
+( const String& aName, const String& aVal, void* pData)
+{
+}
+
+void PropertyEditorControler_Impl::Clicked
+( const String& aName, const String& aVal, void* pData)
+{
+ // HACK, solange LinkClicked nicht funktioniert
+ UINT32 iPos = (UINT32)pData;
+ UINT32 nPropCount = mPropSeq.getLen();
+ if( iPos >= nPropCount )
+ {
+ // Spezial-IDs fuer forward/back?
+ BOOL bForward = (iPos == 1000000);
+ BOOL bBack = (iPos == 1000001);
+ if( bForward || bBack )
+ {
+ // Unterstuetzt der PropertyEditor das?
+ XPropertyEditorNavigationRef xPropEdNav = (XPropertyEditorNavigation*)
+ mxEditor->queryInterface( XPropertyEditorNavigation::getSmartUik() );
+ if( xPropEdNav.is() )
+ {
+ if( bForward )
+ xPropEdNav->forward();
+ else
+ xPropEdNav->back();
+ }
+ }
+ return;
+ }
+
+ const Property* pProps = mPropSeq.getConstArray();
+ const Property& rProp = pProps[ iPos ];
+ XIdlClassRef xPropClass = rProp.Type;
+ if( !xPropClass.is() )
+ {
+ DBG_ERROR( "PropertyEditorControler_Impl::Commit(), Property without type" )
+ return;
+ }
+ TypeClass eType = xPropClass->getTypeClass();
+ if( eType == TYPECLASS_INTERFACE || eType == TYPECLASS_STRUCT )
+ LinkClicked( aName, pData );
+}
+
+void PropertyEditorControler_Impl::Commit
+( const String& aName, const String& aVal, void* pData)
+{
+ UINT32 iPos = (UINT32)pData;
+ UINT32 nPropCount = mPropSeq.getLen();
+ if( iPos >= nPropCount )
+ return;
+
+ // String in Property-Typ wandeln
+ const Property* pProps = mPropSeq.getConstArray();
+ const Property& rProp = pProps[ iPos ];
+ XIdlClassRef xPropClass = rProp.Type;
+ if( !xPropClass.is() )
+ {
+ DBG_ERROR( "PropertyEditorControler_Impl::Commit(), Property without type" )
+ return;
+ }
+ TypeClass eType = xPropClass->getTypeClass();
+ UsrAny aValue = StringToAny( aVal, eType );
+
+ // Wert setzen
+ mxUnoAccess->setPropertyValueByIndex( maUnoObj, iPos, aValue );
+
+ // Wert neu holen und ggf. neu setzen
+ UsrAny aNewVal = mxUnoAccess->getPropertyValueByIndex( maUnoObj, iPos );
+ String aNewStrVal = AnyToString( aNewVal );
+ if( aNewStrVal != aVal )
+ mpPropBox->SetPropertyValue( aName, aNewStrVal );
+}
+
+void PropertyEditorControler_Impl::Select
+( const String& aName, void* pData)
+{
+}
+
+void PropertyEditorControler_Impl::LinkClicked(const String& aName, void* pData)
+{
+ UINT32 iPos = (UINT32)pData;
+ UINT32 nPropCount = mPropSeq.getLen();
+ if( iPos >= nPropCount )
+ return;
+
+ // Wert holen und an Master-Controller zurueckgeben
+ UsrAny aNewObj = mxUnoAccess->getPropertyValueByIndex( maUnoObj, iPos );
+ mxEditor->setObject( aNewObj, aName );
+}
+
+
+// TODO: Das muss raus, sehr unglueckliche Schnittstelle
+// PropertyBox erzwingt Zustand des Controllers
+String PropertyEditorControler_Impl::GetTheCorrectProperty() const
+{
+ return String();
+}
+
+
+SMART_UNO_IMPLEMENTATION(SimplePropertyEditor_Impl,UsrObject);
+
+// Methoden von XInterface
+XInterface * SimplePropertyEditor_Impl::queryInterface( Uik aUik )
+{
+ if( aUik == XPropertyEditor::getSmartUik() )
+ return (XPropertyEditor *)this;
+ if( aUik == XPropertyEditorNavigation::getSmartUik() )
+ return (XPropertyEditorNavigation *)this;
+ return UsrObject::queryInterface( aUik );
+}
+
+XIdlClassRef SimplePropertyEditor_Impl::getIdlClass()
+{
+ // TODO: Unterstuetzen
+ return NULL;
+}
+
+
+// Methoden von SimplePropertyEditor_Impl
+SimplePropertyEditor_Impl::SimplePropertyEditor_Impl( Window *pParent )
+ : maHistorySeq( 10 ), maHistoryNames( 10 ), bSimpleHistory( FALSE )
+{
+ //XVCLComponent xC = pParent->getVCLComponent
+ //xC->addVCLComponentListener( MyListener )
+
+ pActiveControler = NULL;
+ mpPropBox = new SvPropertyBox( pParent );
+ mpPropBox->Show();
+
+ long cxOut = pParent->GetOutputSizePixel().Width();
+ long cyOut = pParent->GetOutputSizePixel().Height();
+ Size aSize( cxOut, cyOut );
+ mpPropBox->SetPosSizePixel( Point( 0, 0 ), aSize );
+
+ mnHistoryCount = 0;
+ mnActualHistoryLevel = -1;
+}
+
+SimplePropertyEditor_Impl::~SimplePropertyEditor_Impl()
+{
+ delete mpPropBox;
+ if( pActiveControler )
+ delete pActiveControler;
+}
+
+// Private Methode zum Anlegen/Aktivieren der Controller
+void SimplePropertyEditor_Impl::showObject( const UsrAny& aToShowObj )
+{
+ if( pActiveControler )
+ delete pActiveControler;
+
+ // Neuen Controller auf der Wiese anlegen (TODO: Controller cachen?)
+ pActiveControler = new PropertyEditorControler_Impl( mpPropBox );
+
+ XPropertyEditorRef xThis = (XPropertyEditor *)this;
+ pActiveControler->setObject( xThis, aToShowObj,
+ /*aPath*/bSimpleHistory ? getPath() : String(),
+ /*bBack*/bSimpleHistory && mnActualHistoryLevel > 0,
+ /*bForward*/bSimpleHistory && (INT32)mnHistoryCount > mnActualHistoryLevel );
+}
+
+String SimplePropertyEditor_Impl::getPath( void )
+{
+ String aRetStr;
+ const String* pStr = maHistoryNames.getConstArray();
+ for( INT32 i = 0 ; i <= mnActualHistoryLevel ; i++ )
+ {
+ String aName = pStr[i];
+
+ // Root speziell behandeln
+ if( i == 0 )
+ {
+ aRetStr += aName;
+ }
+ else
+ {
+ // Ist es ein Index?
+ long l = (long)aName;
+ String aNumStr( l );
+ if( aNumStr == aName )
+ {
+ aRetStr += '[';
+ aRetStr += aName;
+ aRetStr += ']';
+ }
+ else
+ {
+ aRetStr += '.';
+ aRetStr += aName;
+ }
+ }
+ }
+ return aRetStr;
+}
+
+// Methoden von XPropertyEditor
+void SimplePropertyEditor_Impl::setObject( const UsrAny& aToEditObj, const XubString& aObjName )
+{
+ // History pflegen
+ mnActualHistoryLevel++;
+ mnHistoryCount = (UINT32)mnActualHistoryLevel;
+ UINT32 iHistorySize = maHistorySeq.getLen();
+ if( mnHistoryCount > iHistorySize )
+ {
+ maHistorySeq.realloc( iHistorySize + 10 );
+ maHistoryNames.realloc( iHistorySize + 10 );
+ }
+
+ // Neues Object eintragen
+ maHistorySeq.getArray()[ mnHistoryCount ] = aToEditObj;
+ maHistoryNames.getArray()[ mnHistoryCount ] = aObjName;
+
+ // Object anzeigen
+ showObject( aToEditObj );
+}
+
+// Methoden von PropertyEditorNavigation
+void SimplePropertyEditor_Impl::forward(void)
+{
+ if( (INT32)mnHistoryCount > mnActualHistoryLevel )
+ {
+ // Naechstes Object darstellen
+ mnActualHistoryLevel++;
+ showObject( maHistorySeq.getConstArray()[mnActualHistoryLevel] );
+ }
+}
+
+void SimplePropertyEditor_Impl::back(void)
+{
+ if( mnActualHistoryLevel > 0 )
+ {
+ // Voriges Object darstellen
+ mnActualHistoryLevel--;
+ showObject( maHistorySeq.getConstArray()[mnActualHistoryLevel] );
+ }
+}
+
+
diff --git a/svtools/source/dialogs/property.cxx b/svtools/source/dialogs/property.cxx
new file mode 100644
index 000000000000..5c0ce590c08c
--- /dev/null
+++ b/svtools/source/dialogs/property.cxx
@@ -0,0 +1,1582 @@
+/*************************************************************************
+ *
+ * $RCSfile: property.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef PCH
+#include "ui_pch.hxx"
+#endif
+
+#pragma hdrstop
+
+//------------------------------------------------------------------
+
+//#include "Svitems.hxx"
+
+#include "property.hxx"
+/*
+#include "property.hrc"
+#include "Scresid.hxx"
+*/
+#define FRAME_OFFSET 4
+
+
+SvXPropertyControl::SvXPropertyControl( Window* pParent, WinBits nWinStyle)
+ : Control(pParent,nWinStyle)
+{
+}
+
+SvXPropertyControl::SvXPropertyControl( Window* pParent, const ResId& rResId )
+ : Control(pParent,rResId )
+{
+}
+
+//------------------------------------------------------------------
+
+SvXPropertyEdit::SvXPropertyEdit( Window* pParent, WinBits nWinStyle)
+ : SvXPropertyControl(pParent,nWinStyle),
+ aEdit(this,WB_BORDER | WB_TABSTOP)
+{
+ pListener=NULL;
+ aEdit.SetModifyHdl(
+ LINK( this, SvXPropertyEdit, ModifiedHdl ));
+ aEdit.SetGetFocusHdl(
+ LINK( this, SvXPropertyEdit, GetFocusHdl));
+ aEdit.SetLoseFocusHdl(
+ LINK( this, SvXPropertyEdit, LoseFocusHdl));
+
+ aEdit.Show();
+}
+
+SvXPropertyEdit::SvXPropertyEdit( Window* pParent, const ResId& rResId)
+ : SvXPropertyControl(pParent,rResId),
+ aEdit(this,WB_BORDER | WB_TABSTOP)
+{
+ pListener=NULL;
+ aEdit.SetModifyHdl(
+ LINK( this, SvXPropertyEdit, ModifiedHdl ));
+ aEdit.SetGetFocusHdl(
+ LINK( this, SvXPropertyEdit, GetFocusHdl));
+ aEdit.SetLoseFocusHdl(
+ LINK( this, SvXPropertyEdit, LoseFocusHdl));
+
+ Size aSize=GetSizePixel();
+ SetCtrSize(aSize);
+ aEdit.Show();
+}
+
+void SvXPropertyEdit::SetSvXPropertyCtrListener(SvXPropertyCtrListener* pCtrListener)
+{
+ pListener=pCtrListener;
+}
+
+SvXPropertyCtrListener* SvXPropertyEdit::GetSvXPropertyCtrListener()
+{
+ return pListener;
+}
+
+
+void SvXPropertyEdit::SetCtrSize(const Size& rSize)
+{
+ SetSizePixel(rSize);
+ Size aSize=GetOutputSizePixel();
+ Point aPos(0,0);
+ aEdit.SetPosPixel(aPos);
+ aEdit.SetSizePixel(aSize);
+}
+
+void SvXPropertyEdit::SetLocked(BOOL bLocked)
+{
+ if(bLocked)
+ Disable();
+ else
+ Enable();
+}
+
+void SvXPropertyEdit::SetProperty(const String &rString)
+{
+ aEdit.SetText(rString);
+}
+
+String SvXPropertyEdit::GetProperty() const
+{
+ return aEdit.GetText();
+}
+
+BOOL SvXPropertyEdit::HasList()
+{
+ return FALSE;
+};
+
+
+void SvXPropertyEdit::ClearList()
+{
+ return;
+}
+void SvXPropertyEdit::InsertEntry( const String& rString,USHORT nPos)
+{
+ return;
+}
+
+void SvXPropertyEdit::SetMyName(const String &rString)
+{
+ aName=rString;
+}
+
+String SvXPropertyEdit::GetMyName()const
+{
+ return aName;
+}
+
+void SvXPropertyEdit::SetMyData(void* pDat)
+{
+ pData=pDat;
+}
+
+void* SvXPropertyEdit::GetMyData()
+{
+ return pData;
+}
+
+
+IMPL_LINK( SvXPropertyEdit, ModifiedHdl, Edit*, pEd )
+{
+ if(pListener!=NULL)
+ pListener->Modified(this);
+ return 0;
+}
+
+IMPL_LINK( SvXPropertyEdit, GetFocusHdl, Edit*, pEd )
+{
+ if(pListener!=NULL)
+ pListener->GetFocus(this);
+ return 0;
+}
+
+IMPL_LINK( SvXPropertyEdit, LoseFocusHdl, Edit*, pEd )
+{
+ if(pListener!=NULL)
+ pListener->LoseFocus(this);
+ return 0;
+}
+
+//------------------------------------------------------------------
+
+SvXPropertyListBox::SvXPropertyListBox( Window* pParent, WinBits nWinStyle)
+ : SvXPropertyControl(pParent,nWinStyle),
+ aListBox(this,WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
+{
+ pListener=NULL;
+ aListBox.SetSelectHdl(
+ LINK( this, SvXPropertyListBox, ModifiedHdl ));
+ aListBox.SetGetFocusHdl(
+ LINK( this, SvXPropertyListBox, GetFocusHdl));
+ aListBox.SetLoseFocusHdl(
+ LINK( this, SvXPropertyListBox, LoseFocusHdl));
+ aListBox.Show();
+}
+
+SvXPropertyListBox::SvXPropertyListBox( Window* pParent, const ResId& rResId)
+ : SvXPropertyControl(pParent,rResId),
+ aListBox(this,WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
+{
+ pListener=NULL;
+ aListBox.SetSelectHdl(
+ LINK( this, SvXPropertyListBox, ModifiedHdl ));
+ aListBox.SetGetFocusHdl(
+ LINK( this, SvXPropertyListBox, GetFocusHdl));
+ aListBox.SetLoseFocusHdl(
+ LINK( this, SvXPropertyListBox, LoseFocusHdl));
+
+ Size aSize=GetSizePixel();
+ SetCtrSize(aSize);
+ aListBox.Show();
+}
+
+void SvXPropertyListBox::SetSvXPropertyCtrListener(SvXPropertyCtrListener* pCtrListener)
+{
+ pListener=pCtrListener;
+}
+
+SvXPropertyCtrListener* SvXPropertyListBox::GetSvXPropertyCtrListener()
+{
+ return pListener;
+}
+
+
+void SvXPropertyListBox::SetCtrSize(const Size& rSize)
+{
+ SetSizePixel(rSize);
+ Size aSize=GetOutputSizePixel();
+ Point aPos(0,0);
+ aListBox.SetPosPixel(aPos);
+ aListBox.SetSizePixel(aSize);
+}
+
+void SvXPropertyListBox::SetLocked(BOOL bLocked)
+{
+ if(bLocked)
+ Disable();
+ else
+ Enable();
+}
+
+void SvXPropertyListBox::SetProperty(const String &rString)
+{
+ aListBox.SelectEntry(rString);
+}
+
+String SvXPropertyListBox::GetProperty()const
+{
+ return aListBox.GetSelectEntry();
+}
+
+BOOL SvXPropertyListBox::HasList()
+{
+ return TRUE;
+}
+
+
+void SvXPropertyListBox::ClearList()
+{
+ aListBox.Clear();
+}
+
+void SvXPropertyListBox::InsertEntry( const String& rString,USHORT nPos)
+{
+ aListBox.InsertEntry(rString,nPos);
+}
+
+void SvXPropertyListBox::SetMyName(const String &rString)
+{
+ aName=rString;
+}
+
+String SvXPropertyListBox::GetMyName()const
+{
+ return aName;
+}
+
+void SvXPropertyListBox::SetMyData(void* pDat)
+{
+ pData=pDat;
+}
+
+void* SvXPropertyListBox::GetMyData()
+{
+ return pData;
+}
+
+IMPL_LINK( SvXPropertyListBox, ModifiedHdl, ListBox*, pLB )
+{
+ if(pListener!=NULL)
+ pListener->Modified(this);
+ return 0;
+}
+
+IMPL_LINK( SvXPropertyListBox, GetFocusHdl, ListBox*, pLB )
+{
+ if(pListener!=NULL)
+ pListener->GetFocus(this);
+ return 0;
+}
+
+IMPL_LINK( SvXPropertyListBox, LoseFocusHdl, ListBox*, pLB )
+{
+ if(pListener!=NULL)
+ pListener->LoseFocus(this);
+ return 0;
+}
+
+//------------------------------------------------------------------
+
+
+SvXPropertyComboBox::SvXPropertyComboBox( Window* pParent, WinBits nWinStyle)
+ : SvXPropertyControl(pParent,nWinStyle),
+ aComboBox(this,WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
+{
+ pListener=NULL;
+ aComboBox.SetModifyHdl(
+ LINK( this, SvXPropertyComboBox, ModifiedHdl ));
+ aComboBox.SetGetFocusHdl(
+ LINK( this, SvXPropertyComboBox, GetFocusHdl));
+ aComboBox.SetLoseFocusHdl(
+ LINK( this, SvXPropertyComboBox, LoseFocusHdl));
+ aComboBox.Show();
+}
+
+SvXPropertyComboBox::SvXPropertyComboBox( Window* pParent, const ResId& rResId)
+ : SvXPropertyControl(pParent,rResId),
+ aComboBox(this,WB_BORDER | WB_DROPDOWN | WB_TABSTOP)
+{
+ pListener=NULL;
+ aComboBox.SetModifyHdl(
+ LINK( this, SvXPropertyComboBox, ModifiedHdl ));
+ aComboBox.SetGetFocusHdl(
+ LINK( this, SvXPropertyComboBox, GetFocusHdl));
+ aComboBox.SetLoseFocusHdl(
+ LINK( this, SvXPropertyComboBox, LoseFocusHdl));
+
+ Size aSize=GetSizePixel();
+ SetCtrSize(aSize);
+ aComboBox.Show();
+}
+
+void SvXPropertyComboBox::SetLocked(BOOL bLocked)
+{
+ if(bLocked)
+ Disable();
+ else
+ Enable();
+}
+
+void SvXPropertyComboBox::SetSvXPropertyCtrListener(SvXPropertyCtrListener* pCtrListener)
+{
+ pListener=pCtrListener;
+}
+
+SvXPropertyCtrListener* SvXPropertyComboBox::GetSvXPropertyCtrListener()
+{
+ return pListener;
+}
+
+
+void SvXPropertyComboBox::SetCtrSize(const Size& rSize)
+{
+ SetSizePixel(rSize);
+ Size aSize=GetOutputSizePixel();
+ Point aPos(0,0);
+ aComboBox.SetPosPixel(aPos);
+ aComboBox.SetSizePixel(aSize);
+}
+
+
+void SvXPropertyComboBox::SetProperty(const String &rString)
+{
+ aComboBox.SetText(rString);
+}
+
+String SvXPropertyComboBox::GetProperty() const
+{
+ return aComboBox.GetText();
+}
+
+BOOL SvXPropertyComboBox::HasList()
+{
+ return TRUE;
+}
+
+void SvXPropertyComboBox::ClearList()
+{
+ aComboBox.Clear();
+}
+
+void SvXPropertyComboBox::InsertEntry( const String& rString,USHORT nPos)
+{
+ aComboBox.InsertEntry(rString,nPos);
+}
+
+void SvXPropertyComboBox::SetMyName(const String &rString)
+{
+ aName=rString;
+}
+
+String SvXPropertyComboBox::GetMyName()const
+{
+ return aName;
+}
+
+void SvXPropertyComboBox::SetMyData(void* pDat)
+{
+ pData=pDat;
+}
+
+void* SvXPropertyComboBox::GetMyData()
+{
+ return pData;
+}
+
+IMPL_LINK( SvXPropertyComboBox, ModifiedHdl, ComboBox*, pCB )
+{
+ if(pListener!=NULL)
+ pListener->Modified(this);
+ return 0;
+}
+
+IMPL_LINK( SvXPropertyComboBox, GetFocusHdl, ComboBox*, pCB )
+{
+ if(pListener!=NULL)
+ pListener->GetFocus(this);
+ return 0;
+}
+
+IMPL_LINK( SvXPropertyComboBox, LoseFocusHdl, ComboBox*, pCB )
+{
+ if(pListener!=NULL)
+ pListener->LoseFocus(this);
+ return 0;
+}
+//------------------------------------------------------------------
+
+SvPropertyLine::SvPropertyLine( Window* pParent,WinBits nWinStyle)
+ : Control(pParent,nWinStyle),
+ aName(this,WB_BORDER),
+ aXButton(this,WB_BORDER),
+ pSvXPropertyControl(NULL),
+ bIsLocked(FALSE),
+ bIsHyperlink(FALSE)
+{
+ bNeedsRepaint = TRUE;
+ bHasXButton = FALSE;
+ aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) );
+ aName.Show();
+ aXButton.Show();
+ eKindOfCtr = KOC_UNDEFINED;
+ Wallpaper aWall = GetBackground();
+ aWall.SetColor( Color( COL_TRANSPARENT ) );
+ SetBackground( aWall );
+}
+
+SvPropertyLine::SvPropertyLine( Window* pParent,const ResId& rResId )
+ : Control(pParent,rResId),
+ aName (this,WB_BORDER),
+ aXButton (this,WB_BORDER),
+ pSvXPropertyControl(NULL),
+ bIsLocked(FALSE),
+ bIsHyperlink(FALSE)
+{
+ bNeedsRepaint = TRUE;
+ bHasXButton = FALSE;
+ eKindOfCtr = KOC_UNDEFINED;
+ aXButton.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "..." ) ) );
+ aName.Show();
+ aXButton.Show();
+ Wallpaper aWall = GetBackground();
+ aWall.SetColor( Color( COL_TRANSPARENT ) );
+ SetBackground( aWall );
+ Resize();
+}
+
+void SvPropertyLine::SetSvXPropertyControl(SvXPropertyControl* pXControl)
+{
+ pSvXPropertyControl=pXControl;
+ pSvXPropertyControl->Show();
+ Resize();
+}
+
+SvXPropertyControl* SvPropertyLine::GetSvXPropertyControl()
+{
+ return pSvXPropertyControl;
+}
+
+void SvPropertyLine::Resize()
+{
+ Size aSize=GetOutputSizePixel();
+ Size a2Size=aSize;
+
+ aSize.Width()=nNameWidth;
+ a2Size.Width()-=nNameWidth;
+
+ Point aPos(0,0);
+ aName.SetPosPixel(aPos);
+ aName.SetSizePixel(aSize);
+
+ USHORT nXButtonWidth=0;
+
+ if(bHasXButton)
+ {
+ nXButtonWidth=(USHORT)aSize.Height();
+ }
+ a2Size.Width()=a2Size.Width()-nXButtonWidth;
+
+ aPos.X()+=aSize.Width();
+
+ if(pSvXPropertyControl!=NULL)
+ {
+ pSvXPropertyControl->SetPosPixel(aPos);
+ pSvXPropertyControl->SetCtrSize(a2Size);
+ }
+
+ if(bHasXButton)
+ {
+ aPos.X()=GetOutputSizePixel().Width()
+ -nXButtonWidth;
+ aSize.Width()=nXButtonWidth;
+ aXButton .SetSizePixel(aSize);
+ aXButton .SetPosPixel(aPos);
+ }
+}
+
+void SvPropertyLine::SetNeedsRepaint(BOOL bFlag)
+{
+ bNeedsRepaint=bFlag;
+}
+
+BOOL SvPropertyLine::NeedsRepaint()
+{
+ return bNeedsRepaint;
+}
+
+void SvPropertyLine::SetName(const String& rString )
+{
+ aName.SetText(rString);
+ aName.Invalidate();
+}
+
+String SvPropertyLine::GetName() const
+{
+ return aName.GetText();
+}
+
+void SvPropertyLine::SetKindOfControl(eKindOfControl eKOC)
+{
+ eKindOfCtr=eKOC;
+}
+
+eKindOfControl SvPropertyLine::GetKindOfControl()
+{
+ return eKindOfCtr;
+}
+
+void SvPropertyLine::ShowXButton()
+{
+ bHasXButton=TRUE;
+ aXButton.Show();
+ Resize();
+}
+void SvPropertyLine::HideXButton()
+{
+ bHasXButton=FALSE;
+ aXButton.Hide();
+ Resize();
+}
+BOOL SvPropertyLine::IsVisibleXButton()
+{
+ return bHasXButton;
+}
+
+void SvPropertyLine::ShowAsHyperLink(BOOL nFlag)
+{
+ bIsHyperlink=nFlag;
+ if(nFlag)
+ {
+ Font aFont=GetFont();
+ aFont.SetUnderline(UNDERLINE_SINGLE);
+ aFont.SetColor(Color(COL_BLUE));
+ aName.SetFont(aFont);
+ }
+ else
+ {
+ Font aFont=GetFont();
+ aName.SetFont(aFont);
+ }
+}
+
+BOOL SvPropertyLine::IsShownAsHyperlink()
+{
+ return bIsHyperlink;
+}
+
+void SvPropertyLine::Locked(BOOL nFlag)
+{
+ bIsLocked=nFlag;
+ if(pSvXPropertyControl!=NULL)
+ pSvXPropertyControl->SetLocked(nFlag);
+}
+
+BOOL SvPropertyLine::IsLocked()
+{
+ return bIsLocked;
+}
+
+void SvPropertyLine::SetNameWidth(USHORT nWidth)
+{
+ nNameWidth=nWidth;
+ Resize();
+}
+
+void SvPropertyLine::SetClickHdl(const Link& rLink)
+{
+ aXButton.SetClickHdl(rLink );
+}
+
+//----------------------------------------------------------
+
+SvXPropEvListener::SvXPropEvListener()
+{
+ pTheActiveControl=NULL;
+}
+
+void SvXPropEvListener::Modified (SvXPropertyControl *pSvXPCtr)
+{
+ pTheActiveControl=pSvXPCtr;
+ aModifyLink.Call(this);
+}
+
+void SvXPropEvListener::GetFocus (SvXPropertyControl *pSvXPCtr)
+{
+ pTheActiveControl=pSvXPCtr;
+ aGetFocusLink.Call(this);
+}
+
+void SvXPropEvListener::LoseFocus (SvXPropertyControl *pSvXPCtr)
+{
+ pTheActiveControl=pSvXPCtr;
+ aLoseFocusLink.Call(this);
+}
+
+void SvXPropEvListener::KeyInput (SvXPropertyControl *pSvXPCtr,const KeyCode& theKeyCode)
+{
+ pTheActiveControl=pSvXPCtr;
+ aKeyCode=theKeyCode;
+ aKeyInputLink.Call(this);
+}
+
+SvXPropertyControl * SvXPropEvListener::GetPropertyControl()
+{
+ return pTheActiveControl;
+}
+
+KeyCode SvXPropEvListener::GetKeyCode() const
+{
+ return aKeyCode;
+}
+
+//------------------------------------------------------------------
+
+SvListBoxForProperties::SvListBoxForProperties( Window* pParent, WinBits nWinStyle)
+ : Control(pParent,nWinStyle),
+ aVScroll(this,WB_VSCROLL|WB_REPEAT|WB_DRAG),
+ aPlayGround(this,WB_DIALOGCONTROL),
+ pPropDataControl(NULL)
+{
+
+ aListener.SetModifyHdl (LINK( this, SvListBoxForProperties, ModifyHdl));
+ aListener.SetGetFocusHdl (LINK( this, SvListBoxForProperties, GetFocusHdl));
+ aListener.SetLoseFocusHdl(LINK( this, SvListBoxForProperties,LoseFocusHdl));
+ aListener.SetKeyInputHdl (LINK( this, SvListBoxForProperties, KeyInputHdl));
+
+ nYOffset=0;
+ nTheNameSize=0;
+ ListBox aListBox(this,WB_DROPDOWN);
+ aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
+ nRowHeight=(USHORT)aListBox.GetSizePixel().Height();
+ Wallpaper aWall = aPlayGround.GetBackground();
+ aWall.SetColor( Color( COL_TRANSPARENT ) );
+ aPlayGround.SetBackground( aWall );
+ aPlayGround.Show();
+ aVScroll.Hide();
+ aVScroll.SetScrollHdl(
+ LINK( this, SvListBoxForProperties, ScrollHdl ));
+
+}
+
+
+SvListBoxForProperties::SvListBoxForProperties( Window* pParent, const ResId& rResId )
+ : Control(pParent,rResId),
+ aVScroll(this,WB_VSCROLL|WB_REPEAT|WB_DRAG),
+ aPlayGround(this,0),
+ pPropDataControl(NULL)
+{
+ nTheNameSize=0;
+ nYOffset=0;
+ ListBox aListBox(this,WB_DROPDOWN);
+ aListBox.SetPosSizePixel(Point(0,0),Size(100,100));
+ nRowHeight=(USHORT)aListBox.GetSizePixel().Height();
+ Wallpaper aWall = aPlayGround.GetBackground();
+ aWall.SetColor( Color( COL_TRANSPARENT ) );
+ aPlayGround.SetBackground( aWall );
+ aPlayGround.Show();
+ aVScroll.Hide();
+ aVScroll.SetScrollHdl( LINK( this, SvListBoxForProperties, ScrollHdl ) );
+ UpdateVScroll();
+ Resize();
+}
+
+SvListBoxForProperties::~SvListBoxForProperties()
+{
+ Clear();
+}
+
+void SvListBoxForProperties::Clear()
+{
+ for(USHORT i=0;i<PLineArray.Count();i++)
+ {
+ SvPropertyLine* pPropLine=PLineArray[i];
+
+ switch(pPropLine->GetKindOfControl())
+ {
+ case KOC_LISTBOX:
+ case KOC_COMBOBOX:
+ case KOC_EDIT: delete pPropLine->GetSvXPropertyControl();
+ break;
+ }
+ delete pPropLine;
+ }
+ PLineArray.Remove(0,PLineArray.Count());
+}
+
+
+void SvListBoxForProperties::Resize()
+{
+ Size aSize=GetOutputSizePixel();
+ Size a2Size=aSize;
+ Size aVScrollSize;
+
+ if(aVScroll.IsVisible())
+ {
+ Point aPos(0,0);
+ aVScrollSize=aVScroll.GetSizePixel();
+ aVScrollSize.Height()=aSize.Height();
+ a2Size.Width()-=aVScrollSize.Width();
+ aPos.X()=a2Size.Width();
+ aVScroll.SetPosPixel(aPos);
+ aVScroll.SetSizePixel(aVScrollSize);
+ }
+
+ aPlayGround.SetPosPixel(Point(0,0));
+ aPlayGround.SetSizePixel(a2Size);
+ UpdatePosNSize();
+}
+
+void SvListBoxForProperties::SetController( SvPropertyDataControl *pPDC)
+{
+ pPropDataControl=pPDC;
+}
+
+USHORT SvListBoxForProperties::CalcVisibleLines()
+{
+ Size aSize=aPlayGround.GetOutputSizePixel();
+ USHORT nResult=0;
+ if(nRowHeight!=0)
+ nResult=(USHORT) aSize.Height()/nRowHeight;
+
+ return nResult;
+}
+
+void SvListBoxForProperties::UpdateVScroll()
+{
+ USHORT nLines=CalcVisibleLines();
+ aVScroll.SetPageSize(nLines-1);
+ aVScroll.SetVisibleSize(nLines-1);
+ aVScroll.SetRange(Range(0,PLineArray.Count()-1));
+ if(PLineArray.Count()<=nLines)
+ {
+ aVScroll.Hide();
+ }
+ else
+ {
+ BOOL bFlag=aVScroll.IsVisible();
+ aVScroll.Show();
+ if(!bFlag)Resize();
+ }
+
+
+}
+
+void SvListBoxForProperties::UpdatePosNSize()
+{
+ Point aPos(0,nYOffset);
+
+ for(USHORT i=0; i<PLineArray.Count();i++)
+ {
+ if((PLineArray[i])->NeedsRepaint())
+ {
+ (PLineArray[i])->SetPosPixel(aPos);
+ Size aSize=aPlayGround.GetOutputSizePixel();
+ aSize.Height()=nRowHeight;
+ (PLineArray[i])->SetSizePixel(aSize);
+ (PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET);
+ (PLineArray[i])->Invalidate();
+ (PLineArray[i])->Update();
+ (PLineArray[i])->Show();
+ (PLineArray[i])->SetNeedsRepaint(FALSE);
+ }
+ else
+ {
+ if((PLineArray[i])->IsVisible())
+ {
+ Size aSize=aPlayGround.GetOutputSizePixel();
+ aSize.Height()=nRowHeight;
+ (PLineArray[i])->SetSizePixel(aSize);
+ (PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET);
+ (PLineArray[i])->Invalidate();
+ }
+ }
+
+ aPos.Y()+=nRowHeight;
+ }
+ aPlayGround.Invalidate();
+ aPlayGround.Update();
+}
+
+void SvListBoxForProperties::UpdatePlayGround()
+{
+ Point aPos(0,0);
+ long nThumbPos=aVScroll.GetThumbPos();
+ long nLines=aVScroll.GetPageSize();
+ long nDelta=aVScroll.GetDelta();
+
+ USHORT nStart,nEnd;
+ Size aSize=aPlayGround.GetOutputSizePixel();
+ Point aPEnd;
+ aPEnd.X()=aSize.Width();
+
+ if(nDelta>0)
+ {
+ nStart=(USHORT)(nThumbPos+nLines+1-nDelta);
+ nEnd=(USHORT)(nThumbPos+nLines);
+ aPos.Y()=(nLines+1-nDelta)*nRowHeight;
+ }
+ else
+ {
+ nStart=(USHORT)nThumbPos;
+ nEnd=(USHORT)(nThumbPos-nDelta);
+ aPEnd.Y()=(nThumbPos-nDelta)*nRowHeight;;
+ }
+
+ aSize.Height()=nRowHeight;
+
+ nDelta=-nDelta*nRowHeight;
+
+ aPlayGround.Scroll(0,nDelta,SCROLL_CHILDREN);
+
+ for(USHORT i=nStart; i<=nEnd;i++)
+ {
+ (PLineArray[i])->SetPosSizePixel(aPos,aSize);
+ (PLineArray[i])->SetNameWidth(nTheNameSize+2*FRAME_OFFSET);
+ (PLineArray[i])->Show();
+ aPos.Y()+=nRowHeight;
+ }
+ aPlayGround.Update();
+}
+
+void SvListBoxForProperties::UpdateAll()
+{
+ UpdatePosNSize();
+ UpdatePlayGround();
+ //UpdateVScroll();
+}
+
+void SvListBoxForProperties::DisableUpdate()
+{
+ bUpdate=FALSE;
+}
+
+void SvListBoxForProperties::EnableUpdate()
+{
+ bUpdate=TRUE;
+ UpdateAll();
+}
+
+void SvListBoxForProperties::SetPropertyValue( const String & rEntryName, const String & rValue )
+{
+ USHORT i, iEnd = PLineArray.Count();
+ for( i = 0 ; i < iEnd ; i++ )
+ {
+ SvPropertyLine* pPropLine = PLineArray[ i ];
+ SvXPropertyControl* pSvXPCtr=pPropLine->GetSvXPropertyControl();
+ if( pSvXPCtr && pSvXPCtr->GetMyName() == rEntryName )
+ {
+ pSvXPCtr->SetProperty( rValue );
+ }
+ }
+}
+
+USHORT SvListBoxForProperties::AppendEntry( const SvPropertyData& aPropData)
+{
+ return InsertEntry(aPropData);
+}
+
+USHORT SvListBoxForProperties::InsertEntry( const SvPropertyData& aPropData, USHORT nPos)
+{
+ USHORT nInsPos=nPos;
+ SvPropertyLine* pPropLine=new SvPropertyLine(&aPlayGround,WB_TABSTOP | WB_DIALOGCONTROL);
+
+ long nThumbPos=aVScroll.GetThumbPos();
+ long nLines=aVScroll.GetPageSize();
+
+ if(nPos==LISTBOX_APPEND)
+ {
+ nInsPos=PLineArray.Count();
+ PLineArray.Insert(pPropLine,nInsPos);
+ }
+ else
+ {
+ PLineArray.Insert(pPropLine,nPos);
+ }
+ pPropLine->SetNameWidth(nTheNameSize);
+ UpdateVScroll();
+ UpdatePosNSize();
+ ChangeEntry(aPropData,nInsPos);
+ return nInsPos;
+}
+
+void SvListBoxForProperties::ChangeEntry( const SvPropertyData& aPropData, USHORT nPos)
+{
+ if(nPos<PLineArray.Count())
+ {
+ SvPropertyLine* pPropLine=PLineArray[nPos];
+
+ switch(pPropLine->GetKindOfControl())
+ {
+ case KOC_LISTBOX:
+ case KOC_COMBOBOX:
+ case KOC_EDIT: delete pPropLine->GetSvXPropertyControl();
+ break;
+ }
+
+ switch(aPropData.eKind)
+ {
+ case KOC_LISTBOX:
+ pPropLine->SetSvXPropertyControl(
+ new SvXPropertyComboBox(pPropLine,WB_TABSTOP));
+ pPropLine->SetKindOfControl(aPropData.eKind);
+ break;
+ case KOC_COMBOBOX:
+ pPropLine->SetSvXPropertyControl(
+ new SvXPropertyComboBox(pPropLine,WB_TABSTOP));
+ pPropLine->SetKindOfControl(aPropData.eKind);
+ break;
+ case KOC_EDIT:
+ pPropLine->SetSvXPropertyControl(
+ new SvXPropertyEdit(pPropLine,WB_TABSTOP));
+ pPropLine->SetKindOfControl(aPropData.eKind);
+ break;
+ case KOC_USERDEFINED:
+ pPropLine->SetSvXPropertyControl(aPropData.pControl);
+ aPropData.pControl->SetParent(pPropLine);
+ pPropLine->SetKindOfControl(aPropData.eKind);
+ break;
+ default:
+ pPropLine->SetSvXPropertyControl(NULL);
+ pPropLine->SetKindOfControl(KOC_UNDEFINED);
+ break;
+ }
+
+ SvXPropertyControl* pSvXPCtr=pPropLine->GetSvXPropertyControl();
+
+ if(pSvXPCtr!=NULL)
+ {
+ pSvXPCtr->SetSvXPropertyCtrListener(&aListener);
+ pSvXPCtr->SetProperty(aPropData.aValue);
+ pSvXPCtr->SetMyData(aPropData.pDataPtr);
+ pSvXPCtr->SetMyName(aPropData.aName);
+
+ if(pSvXPCtr->HasList())
+ {
+ for(int i=0;i<aPropData.theValues.Count();i++)
+ {
+ pSvXPCtr->InsertEntry(*(aPropData.theValues[i]));
+ }
+ }
+ }
+
+ pPropLine->SetName(aPropData.aName);
+
+ USHORT nTextWidth=(USHORT)aPlayGround.GetTextWidth(aPropData.aName);
+
+ if ( nTheNameSize < nTextWidth )
+ nTheNameSize = nTextWidth;
+
+ if ( aPropData.bHasVisibleXButton )
+ {
+ pPropLine->SetClickHdl(LINK( this, SvListBoxForProperties, ClickHdl ) );
+ pPropLine->ShowXButton();
+ }
+ else
+ pPropLine->HideXButton();
+
+ pPropLine->Locked(aPropData.bIsLocked);
+
+ pPropLine->ShowAsHyperLink(aPropData.bIsHyperLink);
+ pPropLine->SetData(aPropData.pDataPtr);
+ }
+}
+
+USHORT SvListBoxForProperties::GetFirstVisibleEntry()
+{
+ return 0;
+}
+void SvListBoxForProperties::SetFirstVisibleEntry(USHORT nPos)
+{
+ return;
+}
+
+void SvListBoxForProperties::SetSelectedEntry(USHORT nPos)
+{
+ return;
+}
+
+USHORT SvListBoxForProperties::GetSelectedEntry()
+{
+ return 0;
+}
+
+IMPL_LINK( SvListBoxForProperties, ScrollHdl, ScrollBar*, pSB )
+{
+ if(pSB!=NULL)
+ {
+ long nDelta=aVScroll.GetDelta();
+ nYOffset=-aVScroll.GetThumbPos()*nRowHeight;
+ //aPlayGround.SetUpdateMode(FALSE);
+
+ long nThumbPos=aVScroll.GetThumbPos();
+ long nLines=aVScroll.GetPageSize();
+
+ UpdatePlayGround();
+
+ for(int i=nThumbPos-nDelta; i<nThumbPos+nLines-nDelta;i++)
+ {
+ if(i>=nThumbPos && i<=nThumbPos+nLines)
+ {
+ (PLineArray[i])->SetNeedsRepaint(TRUE);
+ }
+ else
+ {
+ (PLineArray[i])->Hide();
+ (PLineArray[i])->SetNeedsRepaint(FALSE);
+ }
+ }
+ }
+ return 0;
+}
+
+IMPL_LINK( SvListBoxForProperties, ClickHdl, PushButton*,pPB)
+{
+ if(pPB!=NULL)
+ {
+ SvPropertyLine *pPropLine=(SvPropertyLine *)pPB->GetParent();
+ SvXPropertyControl* pSvXPCtr=pPropLine->GetSvXPropertyControl();
+ pPropDataControl->Clicked(pSvXPCtr->GetMyName(),
+ pSvXPCtr->GetProperty(),pSvXPCtr->GetMyData());
+ }
+ return 0;
+}
+
+IMPL_LINK( SvListBoxForProperties, ModifyHdl,SvXPropEvListener*, pSvXPEvL)
+{
+ if(pSvXPEvL!=NULL && pPropDataControl!=NULL)
+ {
+
+ SvXPropertyControl* pSvXPCtr=aListener.GetPropertyControl();
+
+ pPropDataControl->Modified(pSvXPCtr->GetMyName(),
+ pSvXPCtr->GetProperty(),pSvXPCtr->GetMyData());
+
+ }
+ return 0;
+}
+
+IMPL_LINK( SvListBoxForProperties, GetFocusHdl,SvXPropEvListener*, pSvXPEvL)
+{
+ if(pSvXPEvL!=NULL && pPropDataControl!=NULL)
+ {
+ SvXPropertyControl* pSvXPCtr=aListener.GetPropertyControl();
+
+ pPropDataControl->Select(pSvXPCtr->GetMyName(),pSvXPCtr->GetMyData());
+ }
+ return 0;
+}
+
+IMPL_LINK( SvListBoxForProperties, LoseFocusHdl,SvXPropEvListener*, pSvXPEvL)
+{
+ if(pSvXPEvL!=NULL && pPropDataControl!=NULL)
+ {
+ SvXPropertyControl* pSvXPCtr=aListener.GetPropertyControl();
+
+ pPropDataControl->Commit(pSvXPCtr->GetMyName(),
+ pSvXPCtr->GetProperty(),pSvXPCtr->GetMyData());
+ /*
+ {
+ pSvXPCtr->SetProperty(
+ pPropDataControl->GetTheCorrectProperty());
+ }
+ */
+ }
+ return 0;
+}
+
+IMPL_LINK( SvListBoxForProperties, KeyInputHdl,SvXPropEvListener*, pSvXPEvL)
+{
+ if(pSvXPEvL!=NULL && pPropDataControl!=NULL)
+ {
+ SvXPropertyControl* pSvXPCtr=aListener.GetPropertyControl();
+ }
+ return 0;
+}
+
+
+
+
+SvTabPageForProperties::SvTabPageForProperties(Window* pParent,WinBits nWinStyle)
+ : TabPage(pParent,nWinStyle),
+ aLbProp(this)
+{
+ aLbProp.Show();
+}
+
+void SvTabPageForProperties::Resize()
+{
+ Point aPos(3,3);
+ Size aSize=GetOutputSizePixel();
+ aSize.Width()-=6;
+ aSize.Height()-=6;
+
+ aLbProp.SetPosSizePixel(aPos,aSize);
+}
+
+SvListBoxForProperties* SvTabPageForProperties::GetTheListBox()
+{
+ return &aLbProp;
+}
+
+
+SvPropertyBox::SvPropertyBox( Window* pParent, WinBits nWinStyle)
+ : Control(pParent,nWinStyle),
+ aTabControl(this)
+{
+ aTabControl.Show();
+}
+
+SvPropertyBox::SvPropertyBox( Window* pParent, const ResId& rResId )
+ : Control(pParent,rResId),
+ aTabControl(this)
+{
+ aTabControl.Show();
+ Resize();
+}
+
+SvPropertyBox::~SvPropertyBox()
+{
+ ClearAll();
+}
+
+
+void SvPropertyBox::ClearAll()
+{
+ USHORT nCount=aTabControl.GetPageCount();
+
+ for(USHORT i=nCount;i>=1;i--)
+ {
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(i);
+ aTabControl.RemovePage(i);
+ delete pPage;
+ }
+}
+
+
+void SvPropertyBox::Resize()
+{
+ Point aPos(3,3);
+ Size aSize=GetOutputSizePixel();
+ aSize.Width()-=6;
+ aSize.Height()-=6;
+
+ aTabControl.SetPosSizePixel(aPos,aSize);
+
+ USHORT nCount=aTabControl.GetPageCount();
+
+ aSize=aTabControl.GetOutputSizePixel();
+ for(USHORT i=1;i<=nCount;i++)
+ {
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(i);
+ pPage->SetSizePixel(aSize);
+ }
+
+}
+
+
+USHORT SvPropertyBox::AppendPage( const String & rText )
+{
+ USHORT nId=aTabControl.GetPageCount()+1;
+ aTabControl.InsertPage( nId,rText);
+ SvTabPageForProperties* pPage=new SvTabPageForProperties(&aTabControl);
+ pPage->SetSizePixel(aTabControl.GetOutputSizePixel());
+ pPage->GetTheListBox()->SetController(pThePropDataCtr);
+ aTabControl.SetTabPage( nId, pPage);
+ aTabControl.SetCurPageId(nId);
+ return nId;
+}
+
+void SvPropertyBox::SetPage( USHORT nId)
+{
+ aTabControl.SetCurPageId(nId);
+}
+
+USHORT SvPropertyBox::GetCurPage()
+{
+ return aTabControl.GetCurPageId();
+}
+
+USHORT SvPropertyBox::CalcVisibleLines()
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ return pPage->GetTheListBox()->CalcVisibleLines();
+}
+void SvPropertyBox::EnableUpdate()
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ pPage->GetTheListBox()->EnableUpdate();
+}
+
+void SvPropertyBox::DisableUpdate()
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ pPage->GetTheListBox()->DisableUpdate();
+}
+
+void SvPropertyBox::SetController(SvPropertyDataControl *pDataCtr)
+{
+ pThePropDataCtr=pDataCtr;
+ USHORT nCount=aTabControl.GetPageCount();
+
+ for(USHORT i=1;i<=nCount;i++)
+ {
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(i);
+
+ pPage->GetTheListBox()->SetController(pThePropDataCtr);
+ }
+
+}
+
+USHORT SvPropertyBox::InsertEntry( const SvPropertyData& rData, USHORT nPos)
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ return pPage->GetTheListBox()->InsertEntry(rData,nPos);
+}
+
+void SvPropertyBox::ChangeEntry( const SvPropertyData& rData, USHORT nPos)
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ pPage->GetTheListBox()->ChangeEntry(rData,nPos);
+}
+
+USHORT SvPropertyBox::AppendEntry( const SvPropertyData& rData)
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ return pPage->GetTheListBox()->AppendEntry(rData);
+}
+
+void SvPropertyBox::SetPropertyValue( const String & rEntryName, const String & rValue )
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ pPage->GetTheListBox()->SetPropertyValue( rEntryName, rValue );
+}
+
+void SvPropertyBox::SetFirstVisibleEntry(USHORT nPos)
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ pPage->GetTheListBox()->SetFirstVisibleEntry(nPos);
+}
+USHORT SvPropertyBox::GetFirstVisibleEntry()
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ return pPage->GetTheListBox()->GetFirstVisibleEntry();
+}
+
+void SvPropertyBox::SetSelectedEntry(USHORT nPos)
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ pPage->GetTheListBox()->SetSelectedEntry(nPos);
+}
+USHORT SvPropertyBox::GetSelectedEntry()
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ return pPage->GetTheListBox()->GetSelectedEntry();
+}
+
+void SvPropertyBox::ClearTable()
+{
+ SvTabPageForProperties* pPage=(SvTabPageForProperties*)
+ aTabControl.GetTabPage(aTabControl.GetCurPageId());
+ pPage->GetTheListBox()->Clear();
+}
+
+
+void SvBasicPropertyDataControl::Modified(const String& aName,
+ const String& aVal,void* pData)
+{
+ aEntryName=aName;
+ aEntryProperty=aVal;
+ pTheData=pData;
+ aModifyLink.Call(this);
+}
+
+void SvBasicPropertyDataControl::Clicked( const String& aName,
+ const String& aVal,
+ void* pData) //Xtension-Button pressed
+{
+ aEntryName=aName;
+ aEntryProperty=aVal;
+ pTheData=pData;
+ aClickedLink.Call(this);
+}
+
+void SvBasicPropertyDataControl::Commit( const String& aName,
+ const String& aVal,
+ void* pData) //User accept changes
+{
+ aEntryName=aName;
+ aEntryProperty=aVal;
+ pTheData=pData;
+ aCommitLink.Call(this);
+}
+
+void SvBasicPropertyDataControl::Select( const String& aName,
+ void* pData) //User select new Row
+{
+ aEntryName=aName;
+ pTheData=pData;
+ aSelectLink.Call(this);
+}
+
+void SvBasicPropertyDataControl::LinkClicked(const String& aName, void* pData)
+{
+}
+
+
+String SvBasicPropertyDataControl::GetName() const //Tell's the name of the Property
+{
+ return aEntryName;
+}
+
+String SvBasicPropertyDataControl::GetProperty() const //Tell's the content of the Property
+{
+ return aEntryProperty;
+}
+
+void* SvBasicPropertyDataControl::GetData() //Tell's the storage
+{
+ return pTheData;
+}
+
+/*
+String SvBasicPropertyDataControl::GetTheCorrectProperty() const
+{
+ return aCorrectProperty;
+}
+*/
+
+void SvBasicPropertyDataControl::SetTheCorrectProperty(const String& aString)
+{
+ aCorrectProperty=aString;
+}
+
+void SvBasicPropertyDataControl::SetIsCorrect(BOOL nFlag)
+{
+ bCorrectness=nFlag;
+}
+
+
+
+//========================================================================
+// Property-Dialog:
+/* zum TESTEN im CALC*/
+//========================================================================
+/*
+ScPropertyDlg::ScPropertyDlg( Window* pParent) :
+ ModalDialog ( pParent, ScResId( RID_SCDLG_PROPERTIES) ),
+ aPropListBox ( this, ResId( CTR_PROPLINE) ),
+ aKindOfListBox (this,ResId( LB_KIND_OF_PROP)),
+ aModAnswer (this,ResId(FT_ANSMOD )),
+ aClickAnswer (this,ResId(FT_ANSCLICK )),
+ aCommitAnswer (this,ResId(FT_ANSCOMMIT)),
+ aSelectAnswer (this,ResId(FT_ANSSELECT)),
+ anOk(this,ResId( BTN_OK)),
+ aCancel(this,ResId( BTN_CANCEL))
+{
+ FreeResource();
+
+ aKindOfListBox.SelectEntryPos(0);
+ aKindOfListBox.SetSelectHdl(
+ LINK( this, ScPropertyDlg, ModifiedHdl ));
+ nCount=0;
+ nClickCount=0;
+
+ String aString("Don't know ");
+
+ aBaProDatCtr.SetModifyHdl (LINK( this, ScPropertyDlg, RowModifiedHdl ));
+ aBaProDatCtr.SetClickedHdl(LINK( this, ScPropertyDlg, ClickHdl ));
+ aBaProDatCtr.SetCommitHdl (LINK( this, ScPropertyDlg, SelectHdl ));
+ aBaProDatCtr.SetSelectHdl (LINK( this, ScPropertyDlg, CommitHdl ));
+
+ aPropListBox.SetController(&aBaProDatCtr);
+
+ USHORT nPageId=aPropListBox.AppendPage("YabbaDabbaDo");
+ aPropListBox.SetPage(nPageId);
+ aProperty.eKind=KOC_EDIT;
+ aProperty.aName=aString;
+ aProperty.aName+=String((USHORT)++nCount);
+ aProperty.aValue=sizeof ComboBox;
+ aProperty.bHasVisibleXButton=FALSE;
+ aProperty.bIsHyperLink=FALSE;
+ aProperty.bIsLocked=FALSE;
+ aProperty.pDataPtr=NULL;
+ aProperty.pControl=NULL;
+ aProperty.theValues.Insert(new String("1"),aProperty.theValues.Count());
+ aProperty.theValues.Insert(new String("2"),aProperty.theValues.Count());
+ aProperty.theValues.Insert(new String("3"),aProperty.theValues.Count());
+ aProperty.theValues.Insert(new String("4"),aProperty.theValues.Count());
+ aPropListBox.InsertEntry(aProperty);
+ aProperty.bHasVisibleXButton=TRUE;
+ aProperty.aName=aString;
+ aProperty.aName+=String((USHORT)++nCount);
+ aProperty.aValue="42";
+ aProperty.eKind=KOC_LISTBOX;
+ aPropListBox.InsertEntry(aProperty);
+ aProperty.aName=aString;
+ aProperty.aName+=String((USHORT)++nCount);
+ aProperty.eKind=KOC_COMBOBOX;
+ aProperty.bHasVisibleXButton=FALSE;
+ aPropListBox.InsertEntry(aProperty);
+}
+
+ScPropertyDlg::~ScPropertyDlg()
+{
+ delete aProperty.theValues[0];
+ delete aProperty.theValues[1];
+ delete aProperty.theValues[2];
+ delete aProperty.theValues[3];
+}
+
+IMPL_LINK( ScPropertyDlg, ModifiedHdl, ListBox*, pLB )
+{
+ if(pLB!=NULL)
+ {
+ String aString("Don't know ");
+ aProperty.aName=aString;
+ aProperty.aName+=String((USHORT)++nCount);
+ if(nCount>20)
+ {
+ String aStr("Yabba ");
+ aStr+=aPropListBox.GetCurPage();
+ USHORT nPageId=aPropListBox.AppendPage(aStr);
+ aPropListBox.SetPage(nPageId);
+ nCount=0;
+ }
+
+ aProperty.eKind=(eKindOfControl)(aKindOfListBox.GetSelectEntryPos()+1);
+ aProperty.bHasVisibleXButton=FALSE;
+ if((nCount % 5)==0) aProperty.bHasVisibleXButton=TRUE;
+ aPropListBox.InsertEntry(aProperty);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScPropertyDlg, RowModifiedHdl, SvBasicPropertyDataControl* ,pProCtr)
+{
+ if(pProCtr!=NULL)
+ {
+ aModAnswer.SetText(aBaProDatCtr.GetProperty());
+ aModAnswer.Invalidate();
+ aBaProDatCtr.SetIsCorrect(TRUE);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScPropertyDlg, CommitHdl, SvBasicPropertyDataControl*,pProCtr)
+{
+ if(pProCtr!=NULL)
+ {
+ aCommitAnswer.SetText(aBaProDatCtr.GetProperty());
+ aCommitAnswer.Invalidate();
+ aBaProDatCtr.SetIsCorrect(TRUE);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScPropertyDlg, ClickHdl, SvBasicPropertyDataControl*,pProCtr)
+{
+ if(pProCtr!=NULL)
+ {
+ aClickAnswer.SetText(aBaProDatCtr.GetName());
+ aClickAnswer.Invalidate();
+ aBaProDatCtr.SetIsCorrect(TRUE);
+ }
+ return 0;
+}
+
+IMPL_LINK( ScPropertyDlg, SelectHdl, SvBasicPropertyDataControl*,pProCtr)
+{
+ if(pProCtr!=NULL)
+ {
+ aSelectAnswer.SetText(aBaProDatCtr.GetName());
+ aSelectAnswer.Invalidate();
+ aBaProDatCtr.SetIsCorrect(TRUE);
+ }
+ return 0;
+}
+*/
+
+
diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx
new file mode 100644
index 000000000000..1382624638fc
--- /dev/null
+++ b/svtools/source/dialogs/wizdlg.cxx
@@ -0,0 +1,678 @@
+/*************************************************************************
+ *
+ * $RCSfile: wizdlg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SVT_WIZDLG_CXX
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _VCL_FIXED_HXX
+#include <vcl/fixed.hxx>
+#endif
+#ifndef _VCL_BUTTON_HXX
+#include <vcl/button.hxx>
+#endif
+#ifndef _VCL_TABPAGE_HXX
+#include <vcl/tabpage.hxx>
+#endif
+
+#ifndef _SVT_WIZDLG_HXX
+#include <wizdlg.hxx>
+#endif
+
+// =======================================================================
+
+#define WIZARDDIALOG_BUTTON_OFFSET_Y 6
+#define WIZARDDIALOG_BUTTON_DLGOFFSET_X 6
+#define WIZARDDIALOG_LINE_DLGOFFSET_X 6
+#define WIZARDDIALOG_VIEW_DLGOFFSET_X 6
+#define WIZARDDIALOG_VIEW_DLGOFFSET_Y 6
+
+// =======================================================================
+
+struct ImplWizPageData
+{
+ ImplWizPageData* mpNext;
+ TabPage* mpPage;
+};
+
+// -----------------------------------------------------------------------
+
+struct ImplWizButtonData
+{
+ ImplWizButtonData* mpNext;
+ Button* mpButton;
+ long mnOffset;
+};
+
+// =======================================================================
+
+void WizardDialog::ImplInitData()
+{
+ mpFirstPage = NULL;
+ mpFirstBtn = NULL;
+ mpFixedLine = NULL;
+ mpCurTabPage = NULL;
+ mpPrevBtn = NULL;
+ mpNextBtn = NULL;
+ mpViewWindow = NULL;
+ mnCurLevel = 0;
+ meViewAlign = WINDOWALIGN_LEFT;
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::ImplCalcSize( Size& rSize )
+{
+ // ButtonBar-Hoehe berechnen
+ long nMaxHeight = 0;
+ ImplWizButtonData* pBtnData = mpFirstBtn;
+ while ( pBtnData )
+ {
+ long nBtnHeight = pBtnData->mpButton->GetSizePixel().Height();
+ if ( nBtnHeight > nMaxHeight )
+ nMaxHeight = nBtnHeight;
+ pBtnData = pBtnData->mpNext;
+ }
+ if ( nMaxHeight )
+ nMaxHeight += WIZARDDIALOG_BUTTON_OFFSET_Y*2;
+ if ( mpFixedLine && mpFixedLine->IsVisible() )
+ nMaxHeight += mpFixedLine->GetSizePixel().Height();
+ rSize.Height() += nMaxHeight;
+
+ // View-Window-Groesse dazurechnen
+ if ( mpViewWindow && mpViewWindow->IsVisible() )
+ {
+ Size aViewSize = mpViewWindow->GetSizePixel();
+ if ( meViewAlign == WINDOWALIGN_TOP )
+ rSize.Height() += aViewSize.Height();
+ else if ( meViewAlign == WINDOWALIGN_LEFT )
+ rSize.Width() += aViewSize.Width();
+ else if ( meViewAlign == WINDOWALIGN_BOTTOM )
+ rSize.Height() += aViewSize.Height();
+ else if ( meViewAlign == WINDOWALIGN_RIGHT )
+ rSize.Width() += aViewSize.Width();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::ImplPosCtrls()
+{
+ Size aDlgSize = GetOutputSizePixel();
+ long nBtnWidth = 0;
+ long nMaxHeight = 0;
+ long nOffY = aDlgSize.Height();
+
+ ImplWizButtonData* pBtnData = mpFirstBtn;
+ while ( pBtnData )
+ {
+ Size aBtnSize = pBtnData->mpButton->GetSizePixel();
+ long nBtnHeight = aBtnSize.Height();
+ if ( nBtnHeight > nMaxHeight )
+ nMaxHeight = nBtnHeight;
+ nBtnWidth += aBtnSize.Width();
+ nBtnWidth += pBtnData->mnOffset;
+ pBtnData = pBtnData->mpNext;
+ }
+
+ if ( nMaxHeight )
+ {
+ long nOffX = aDlgSize.Width()-nBtnWidth-WIZARDDIALOG_BUTTON_DLGOFFSET_X;
+ nOffY -= WIZARDDIALOG_BUTTON_OFFSET_Y+nMaxHeight;
+
+ pBtnData = mpFirstBtn;
+ while ( pBtnData )
+ {
+ Size aBtnSize = pBtnData->mpButton->GetSizePixel();
+ Point aPos( nOffX, nOffY+((nMaxHeight-aBtnSize.Height())/2) );
+ pBtnData->mpButton->SetPosPixel( aPos );
+ nOffX += aBtnSize.Width();
+ nOffX += pBtnData->mnOffset;
+ pBtnData = pBtnData->mpNext;
+ }
+
+ nOffY -= WIZARDDIALOG_BUTTON_OFFSET_Y;
+ }
+
+ if ( mpFixedLine && mpFixedLine->IsVisible() )
+ {
+ nOffY -= mpFixedLine->GetSizePixel().Height();
+ mpFixedLine->SetPosSizePixel( WIZARDDIALOG_LINE_DLGOFFSET_X, nOffY,
+ aDlgSize.Width()-(WIZARDDIALOG_LINE_DLGOFFSET_X*2), 0,
+ WINDOW_POSSIZE_POS | WINDOW_POSSIZE_WIDTH );
+ }
+
+ if ( mpViewWindow && mpViewWindow->IsVisible() )
+ {
+ long nViewOffX = 0;
+ long nViewOffY = 0;
+ long nViewWidth = 0;
+ long nViewHeight = 0;
+ long nDlgHeight = nOffY;
+ USHORT nViewPosFlags = WINDOW_POSSIZE_POS;
+ if ( meViewAlign == WINDOWALIGN_TOP )
+ {
+ nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ nViewOffY = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ nViewWidth = aDlgSize.Width()-(WIZARDDIALOG_VIEW_DLGOFFSET_X*2);
+ nViewPosFlags |= WINDOW_POSSIZE_WIDTH;
+ }
+ else if ( meViewAlign == WINDOWALIGN_LEFT )
+ {
+ nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ nViewOffY = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ nViewHeight = nDlgHeight-(WIZARDDIALOG_VIEW_DLGOFFSET_Y*2);
+ nViewPosFlags |= WINDOW_POSSIZE_HEIGHT;
+ }
+ else if ( meViewAlign == WINDOWALIGN_BOTTOM )
+ {
+ nViewOffX = WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ nViewOffY = nDlgHeight-mpViewWindow->GetSizePixel().Height()-WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ nViewWidth = aDlgSize.Width()-(WIZARDDIALOG_VIEW_DLGOFFSET_X*2);
+ nViewPosFlags |= WINDOW_POSSIZE_WIDTH;
+ }
+ else if ( meViewAlign == WINDOWALIGN_RIGHT )
+ {
+ nViewOffX = aDlgSize.Width()-mpViewWindow->GetSizePixel().Width()-WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ nViewOffY = WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ nViewHeight = nDlgHeight-(WIZARDDIALOG_VIEW_DLGOFFSET_Y*2);
+ nViewPosFlags |= WINDOW_POSSIZE_HEIGHT;
+ }
+ mpViewWindow->SetPosSizePixel( nViewOffX, nViewOffY,
+ nViewWidth, nViewHeight,
+ nViewPosFlags );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::ImplPosTabPage()
+{
+ if ( !mpCurTabPage )
+ return;
+
+ // ButtonBar-Hoehe berechnen
+ long nMaxHeight = 0;
+ ImplWizButtonData* pBtnData = mpFirstBtn;
+ while ( pBtnData )
+ {
+ long nBtnHeight = pBtnData->mpButton->GetSizePixel().Height();
+ if ( nBtnHeight > nMaxHeight )
+ nMaxHeight = nBtnHeight;
+ pBtnData = pBtnData->mpNext;
+ }
+ if ( nMaxHeight )
+ nMaxHeight += WIZARDDIALOG_BUTTON_OFFSET_Y*2;
+ if ( mpFixedLine && mpFixedLine->IsVisible() )
+ nMaxHeight += mpFixedLine->GetSizePixel().Height();
+
+ // TabPage positionieren
+ Size aDlgSize = GetOutputSizePixel();
+ aDlgSize.Height() -= nMaxHeight;
+ long nOffX = 0;
+ long nOffY = 0;
+ if ( mpViewWindow && mpViewWindow->IsVisible() )
+ {
+ Size aViewSize = mpViewWindow->GetSizePixel();
+ if ( meViewAlign == WINDOWALIGN_TOP )
+ {
+ nOffY += aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ aDlgSize.Height() -= aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ }
+ else if ( meViewAlign == WINDOWALIGN_LEFT )
+ {
+ nOffX += aViewSize.Width()+WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ aDlgSize.Width() -= aViewSize.Width()+WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ }
+ else if ( meViewAlign == WINDOWALIGN_BOTTOM )
+ aDlgSize.Height() -= aViewSize.Height()+WIZARDDIALOG_VIEW_DLGOFFSET_Y;
+ else if ( meViewAlign == WINDOWALIGN_RIGHT )
+ aDlgSize.Width() -= aViewSize.Width()+WIZARDDIALOG_VIEW_DLGOFFSET_X;
+ }
+ Point aPos( nOffX, nOffY );
+ mpCurTabPage->SetPosSizePixel( aPos, aDlgSize );
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::ImplShowTabPage( TabPage* pTabPage )
+{
+ if ( mpCurTabPage == pTabPage )
+ return;
+
+ TabPage* pOldTabPage = mpCurTabPage;
+ if ( pOldTabPage )
+ pOldTabPage->DeactivatePage();
+
+ mpCurTabPage = pTabPage;
+ if ( pTabPage )
+ {
+ ImplPosTabPage();
+ pTabPage->ActivatePage();
+ pTabPage->Show();
+ }
+
+ if ( pOldTabPage )
+ pOldTabPage->Hide();
+}
+
+// -----------------------------------------------------------------------
+
+TabPage* WizardDialog::ImplGetPage( USHORT nLevel ) const
+{
+ USHORT nTempLevel = 0;
+ ImplWizPageData* pPageData = mpFirstPage;
+ while ( pPageData )
+ {
+ if ( (nTempLevel == nLevel) || !pPageData->mpNext )
+ break;
+
+ nTempLevel++;
+ pPageData = pPageData->mpNext;
+ }
+
+ if ( pPageData )
+ return pPageData->mpPage;
+ return NULL;
+}
+
+// =======================================================================
+
+WizardDialog::WizardDialog( Window* pParent, WinBits nStyle ) :
+ ModalDialog( pParent, nStyle )
+{
+ ImplInitData();
+}
+
+// -----------------------------------------------------------------------
+
+WizardDialog::WizardDialog( Window* pParent, const ResId& rResId ) :
+ ModalDialog( pParent, rResId )
+{
+ ImplInitData();
+}
+
+// -----------------------------------------------------------------------
+
+WizardDialog::~WizardDialog()
+{
+ if ( mpFixedLine )
+ delete mpFixedLine;
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::Resize()
+{
+ if ( IsReallyShown() && !IsInInitShow() )
+ {
+ ImplPosCtrls();
+ ImplPosTabPage();
+ }
+
+ Dialog::Resize();
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::StateChanged( StateChangedType nType )
+{
+ if ( nType == STATE_CHANGE_INITSHOW )
+ {
+ if ( IsDefaultSize() )
+ {
+ Size aDlgSize = GetPageSizePixel();
+ if ( !aDlgSize.Width() || !aDlgSize.Height() )
+ {
+ ImplWizPageData* pPageData = mpFirstPage;
+ while ( pPageData )
+ {
+ if ( pPageData->mpPage )
+ {
+ Size aPageSize = pPageData->mpPage->GetSizePixel();
+ if ( aPageSize.Width() > aDlgSize.Width() )
+ aDlgSize.Width() = aPageSize.Width();
+ if ( aPageSize.Height() > aDlgSize.Height() )
+ aDlgSize.Height() = aPageSize.Height();
+ }
+
+ pPageData = pPageData->mpNext;
+ }
+ }
+ ImplCalcSize( aDlgSize );
+ SetOutputSizePixel( aDlgSize );
+ }
+
+ ImplPosCtrls();
+ ImplPosTabPage();
+ ImplShowTabPage( ImplGetPage( mnCurLevel ) );
+ }
+
+ Dialog::StateChanged( nType );
+}
+
+// -----------------------------------------------------------------------
+
+long WizardDialog::Notify( NotifyEvent& rNEvt )
+{
+ if ( (rNEvt.GetType() == EVENT_KEYINPUT) && mpPrevBtn && mpNextBtn )
+ {
+ const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
+ KeyCode aKeyCode = pKEvt->GetKeyCode();
+ USHORT nKeyCode = aKeyCode.GetCode();
+
+ if ( aKeyCode.IsMod1() )
+ {
+ if ( aKeyCode.IsShift() || (nKeyCode == KEY_PAGEUP) )
+ {
+ if ( (nKeyCode == KEY_TAB) || (nKeyCode == KEY_PAGEUP) )
+ {
+ if ( mpPrevBtn->IsVisible() &&
+ mpPrevBtn->IsEnabled() && mpPrevBtn->IsInputEnabled() )
+ {
+ mpPrevBtn->SetPressed( TRUE );
+ mpPrevBtn->SetPressed( FALSE );
+ mpPrevBtn->Click();
+ }
+ return TRUE;
+ }
+ }
+ else
+ {
+ if ( (nKeyCode == KEY_TAB) || (nKeyCode == KEY_PAGEDOWN) )
+ {
+ if ( mpNextBtn->IsVisible() &&
+ mpNextBtn->IsEnabled() && mpNextBtn->IsInputEnabled() )
+ {
+ mpNextBtn->SetPressed( TRUE );
+ mpNextBtn->SetPressed( FALSE );
+ mpNextBtn->Click();
+ }
+ return TRUE;
+ }
+ }
+ }
+ }
+
+ return Dialog::Notify( rNEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::ActivatePage()
+{
+ maActivateHdl.Call( this );
+}
+
+// -----------------------------------------------------------------------
+
+long WizardDialog::DeactivatePage()
+{
+ if ( maDeactivateHdl.IsSet() )
+ return maDeactivateHdl.Call( this );
+ else
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL WizardDialog::ShowNextPage()
+{
+ return ShowPage( mnCurLevel+1 );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL WizardDialog::ShowPrevPage()
+{
+ if ( !mnCurLevel )
+ return FALSE;
+ return ShowPage( mnCurLevel-1 );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL WizardDialog::ShowPage( USHORT nLevel )
+{
+ if ( DeactivatePage() )
+ {
+ mnCurLevel = nLevel;
+ ActivatePage();
+ ImplShowTabPage( ImplGetPage( mnCurLevel ) );
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL WizardDialog::Finnish( long nResult )
+{
+ if ( DeactivatePage() )
+ {
+ if ( mpCurTabPage )
+ mpCurTabPage->DeactivatePage();
+
+ if ( IsInExecute() )
+ EndDialog( nResult );
+ else if ( GetStyle() & WB_CLOSEABLE )
+ Close();
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::AddPage( TabPage* pPage )
+{
+ ImplWizPageData* pNewPageData = new ImplWizPageData;
+ pNewPageData->mpNext = NULL;
+ pNewPageData->mpPage = pPage;
+
+ if ( !mpFirstPage )
+ mpFirstPage = pNewPageData;
+ else
+ {
+ ImplWizPageData* pPageData = mpFirstPage;
+ while ( pPageData->mpNext )
+ pPageData = pPageData->mpNext;
+ pPageData->mpNext = pNewPageData;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::RemovePage( TabPage* pPage )
+{
+ ImplWizPageData* pPrevPageData = NULL;
+ ImplWizPageData* pPageData = mpFirstPage;
+ while ( pPageData )
+ {
+ if ( pPageData->mpPage == pPage )
+ {
+ if ( pPrevPageData )
+ pPrevPageData->mpNext = pPageData->mpNext;
+ else
+ mpFirstPage = pPageData->mpNext;
+ if ( pPage == mpCurTabPage )
+ mpCurTabPage = NULL;
+ delete pPageData;
+ return;
+ }
+
+ pPrevPageData = pPageData;
+ pPageData = pPageData->mpNext;
+ }
+
+ DBG_ERROR( "WizardDialog::RemovePage() - Page not in list" );
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::SetPage( USHORT nLevel, TabPage* pPage )
+{
+ USHORT nTempLevel = 0;
+ ImplWizPageData* pPageData = mpFirstPage;
+ while ( pPageData )
+ {
+ if ( (nTempLevel == nLevel) || !pPageData->mpNext )
+ break;
+
+ nTempLevel++;
+ pPageData = pPageData->mpNext;
+ }
+
+ if ( pPageData )
+ {
+ if ( pPageData->mpPage == mpCurTabPage )
+ mpCurTabPage = NULL;
+ pPageData->mpPage = pPage;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+TabPage* WizardDialog::GetPage( USHORT nLevel ) const
+{
+ USHORT nTempLevel = 0;
+ ImplWizPageData* pPageData = mpFirstPage;
+ while ( pPageData )
+ {
+ if ( nTempLevel == nLevel )
+ return pPageData->mpPage;
+
+ nTempLevel++;
+ pPageData = pPageData->mpNext;
+ }
+
+ return NULL;
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::AddButton( Button* pButton, long nOffset )
+{
+ ImplWizButtonData* pNewBtnData = new ImplWizButtonData;
+ pNewBtnData->mpNext = NULL;
+ pNewBtnData->mpButton = pButton;
+ pNewBtnData->mnOffset = nOffset;
+
+ if ( !mpFirstBtn )
+ mpFirstBtn = pNewBtnData;
+ else
+ {
+ ImplWizButtonData* pBtnData = mpFirstBtn;
+ while ( pBtnData->mpNext )
+ pBtnData = pBtnData->mpNext;
+ pBtnData->mpNext = pNewBtnData;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::RemoveButton( Button* pButton )
+{
+ ImplWizButtonData* pPrevBtnData = NULL;
+ ImplWizButtonData* pBtnData = mpFirstBtn;
+ while ( pBtnData )
+ {
+ if ( pBtnData->mpButton == pButton )
+ {
+ if ( pPrevBtnData )
+ pPrevBtnData->mpNext = pBtnData->mpNext;
+ else
+ mpFirstBtn = pBtnData->mpNext;
+ delete pBtnData;
+ return;
+ }
+
+ pPrevBtnData = pBtnData;
+ pBtnData = pBtnData->mpNext;
+ }
+
+ DBG_ERROR( "WizardDialog::RemoveButton() - Button not in list" );
+}
+
+// -----------------------------------------------------------------------
+
+void WizardDialog::ShowButtonFixedLine( BOOL bVisible )
+{
+ if ( !mpFixedLine )
+ {
+ if ( !bVisible )
+ return;
+
+ mpFixedLine = new FixedLine( this );
+ }
+
+ mpFixedLine->Show( bVisible );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL WizardDialog::IsButtonFixedLineVisible()
+{
+ return (mpFixedLine && mpFixedLine->IsVisible());
+}
diff --git a/svtools/source/edit/makefile.mk b/svtools/source/edit/makefile.mk
new file mode 100644
index 000000000000..b73818d70cb8
--- /dev/null
+++ b/svtools/source/edit/makefile.mk
@@ -0,0 +1,135 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=edit
+LIBTARGET=NO
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(header)" == ""
+
+CXXFILES= \
+ textdata.cxx \
+ textdoc.cxx \
+ texteng.cxx \
+ textundo.cxx \
+ textview.cxx \
+ txtattr.cxx \
+ xtextedt.cxx \
+ sychconv.cxx
+
+.IF "$(VCL)" != ""
+CXXFILES+= \
+ svmedit.cxx
+.ENDIF
+
+
+SLOFILES= \
+ $(SLO)$/textdata.obj \
+ $(SLO)$/textdoc.obj \
+ $(SLO)$/texteng.obj \
+ $(SLO)$/textundo.obj \
+ $(SLO)$/textview.obj \
+ $(SLO)$/txtattr.obj \
+ $(SLO)$/xtextedt.obj \
+ $(SLO)$/sychconv.obj
+
+.IF "$(VCL)" != ""
+SLOFILES+= \
+ $(SLO)$/svmedit.obj
+.ENDIF
+
+OBJFILES= \
+ $(OBJ)$/textdata.obj \
+ $(OBJ)$/textdoc.obj \
+ $(OBJ)$/texteng.obj \
+ $(OBJ)$/textundo.obj \
+ $(OBJ)$/textview.obj \
+ $(OBJ)$/txtattr.obj \
+ $(OBJ)$/xtextedt.obj \
+ $(OBJ)$/sychconv.obj
+
+.IF "$(VCL)" != ""
+OBJFILES+= \
+ $(OBJ)$/svmedit.obj
+.ENDIF
+
+LIB1TARGET= $(SLB)$/$(TARGET).lib
+LIB1OBJFILES= $(SLOFILES)
+
+LIB2TARGET= $(LB)$/$(TARGET).lib
+LIB2OBJFILES= $(OBJFILES)
+
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/edit/svmedit.cxx b/svtools/source/edit/svmedit.cxx
new file mode 100644
index 000000000000..29d293e734c7
--- /dev/null
+++ b/svtools/source/edit/svmedit.cxx
@@ -0,0 +1,1396 @@
+/*************************************************************************
+ *
+ * $RCSfile: svmedit.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <vcl/rc.h>
+#include <vcl/decoview.hxx>
+
+#include <svmedit.hxx>
+#include <xtextedt.hxx>
+#include <brdcst.hxx>
+#include <lstner.hxx>
+
+#ifndef _UNDO_HXX
+#include <undo.hxx>
+#endif
+
+
+// IDs erstmal aus VCL geklaut, muss mal richtig delivert werden...
+#define SV_MENU_EDIT_UNDO 1
+#define SV_MENU_EDIT_CUT 2
+#define SV_MENU_EDIT_COPY 3
+#define SV_MENU_EDIT_PASTE 4
+#define SV_MENU_EDIT_DELETE 5
+#define SV_MENU_EDIT_SELECTALL 6
+#define SV_MENU_EDIT_INSERTSYMBOL 7
+
+#ifndef _SV_SCRBAR_HXX //autogen
+#include <vcl/scrbar.hxx>
+#endif
+
+
+class TextWindow : public Window
+{
+private:
+ ExtTextEngine* mpExtTextEngine;
+ ExtTextView* mpExtTextView;
+
+ BOOL mbInMBDown;
+ BOOL mbFocusSelectionHide;
+ BOOL mbIgnoreTab;
+ BOOL mbActivePopup;
+
+public:
+ TextWindow( Window* pParent );
+ ~TextWindow();
+
+ ExtTextEngine* GetTextEngine() const { return mpExtTextEngine; }
+ ExtTextView* GetTextView() const { return mpExtTextView; }
+
+ virtual void MouseMove( const MouseEvent& rMEvt );
+ virtual void MouseButtonDown( const MouseEvent& rMEvt );
+ virtual void MouseButtonUp( const MouseEvent& rMEvt );
+ virtual void KeyInput( const KeyEvent& rKEvent );
+
+ virtual BOOL QueryDrop( DropEvent& rEvt );
+ virtual BOOL Drop( const DropEvent& rEvt );
+
+ virtual void Command( const CommandEvent& rCEvt );
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Resize();
+
+ virtual void GetFocus();
+ virtual void LoseFocus();
+
+ BOOL IsAutoFocusHide() const { return mbFocusSelectionHide; }
+ void SetAutoFocusHide( BOOL bAutoHide ) { mbFocusSelectionHide = bAutoHide; }
+
+ BOOL IsIgnoreTab() const { return mbIgnoreTab; }
+ void SetIgnoreTab( BOOL bIgnore ) { mbIgnoreTab = bIgnore; }
+};
+
+
+class ImpSvMEdit : public SfxListener
+{
+private:
+ MultiLineEdit* pSvMultiLineEdit;
+
+ TextWindow* mpTextWindow;
+ ScrollBar* mpHScrollBar;
+ ScrollBar* mpVScrollBar;
+ ScrollBarBox* mpScrollBox;
+
+ Point maTextWindowOffset;
+ ULONG mnTextWidth;
+
+protected:
+ virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
+ void ImpInitScrollBars();
+ void ImpSetScrollBarRanges();
+ DECL_LINK( ScrollHdl, ScrollBar* );
+
+public:
+ ImpSvMEdit( MultiLineEdit* pSvMultiLineEdit, WinBits nWinStyle );
+ ~ImpSvMEdit();
+
+ void SetModified( BOOL bMod );
+ BOOL IsModified() const;
+
+ void SetReadOnly( BOOL bRdOnly );
+ BOOL IsReadOnly() const;
+
+ void SetMaxTextLen( ULONG nLen );
+ ULONG GetMaxTextLen() const;
+
+ void SetInsertMode( BOOL bInsert );
+ BOOL IsInsertMode() const;
+
+ void InsertText( const String& rStr );
+ String GetSelected() const;
+
+ void SetSelection( const Selection& rSelection );
+ Selection GetSelection() const;
+
+ void Cut();
+ void Copy();
+ void Paste();
+
+ void SetText( const String& rStr );
+ String GetText() const;
+ String GetTextLines() const;
+
+ void Resize();
+ void GetFocus();
+
+ BOOL HandleCommand( const CommandEvent& rCEvt );
+
+ void Enable( BOOL bEnable );
+
+ Size CalcMinimumSize() const;
+ Size CalcSize( USHORT nColumns, USHORT nLines ) const;
+ void GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const;
+
+ void SetAlign( WinBits nWinStyle );
+
+ TextWindow* GetTextWindow() { return mpTextWindow; }
+ ScrollBar* GetHScrollBar() { return mpHScrollBar; }
+ ScrollBar* GetVScrollBar() { return mpVScrollBar; }
+
+ void SetTextWindowOffset( const Point& rOffset );
+};
+
+
+ImpSvMEdit::ImpSvMEdit( MultiLineEdit* pEdt, WinBits nWinStyle )
+{
+ pSvMultiLineEdit = pEdt;
+
+ mnTextWidth = 0;
+
+ mpTextWindow = new TextWindow( pEdt );
+ mpHScrollBar = ( nWinStyle & WB_HSCROLL ) ? new ScrollBar( pEdt, WB_HSCROLL|WB_DRAG ) : NULL;
+ mpVScrollBar = ( nWinStyle & WB_VSCROLL ) ? new ScrollBar( pEdt, WB_VSCROLL|WB_DRAG ) : NULL;
+ mpScrollBox = ( mpVScrollBar && mpHScrollBar ) ? new ScrollBarBox( pEdt, WB_SIZEABLE ) : NULL;
+
+ SetAlign( nWinStyle );
+ StartListening( *mpTextWindow->GetTextEngine() );
+
+ if ( nWinStyle & WB_NOHIDESELECTION )
+ mpTextWindow->SetAutoFocusHide( FALSE );
+ else
+ mpTextWindow->SetAutoFocusHide( TRUE );
+
+ if ( nWinStyle & WB_READONLY )
+ mpTextWindow->GetTextView()->SetReadOnly( TRUE );
+
+ if ( nWinStyle & WB_IGNORETAB )
+ mpTextWindow->SetIgnoreTab( TRUE );
+
+ mpTextWindow->Show();
+ if ( mpHScrollBar )
+ {
+ mpHScrollBar->Show();
+ mpHScrollBar->SetScrollHdl( LINK( this, ImpSvMEdit, ScrollHdl ) );
+ }
+ if ( mpVScrollBar )
+ {
+ mpVScrollBar->Show();
+ mpVScrollBar->SetScrollHdl( LINK( this, ImpSvMEdit, ScrollHdl ) );
+ }
+ if ( mpScrollBox )
+ mpScrollBox->Show();
+
+ ImpInitScrollBars();
+}
+
+ImpSvMEdit::~ImpSvMEdit()
+{
+ EndListening( *mpTextWindow->GetTextEngine() );
+ delete mpTextWindow;
+ delete mpHScrollBar;
+ delete mpVScrollBar;
+ delete mpScrollBox;
+}
+
+void ImpSvMEdit::ImpSetScrollBarRanges()
+{
+ if ( mpVScrollBar )
+ {
+ ULONG nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
+ mpVScrollBar->SetRange( Range( 0, (long)nTextHeight ) );
+ }
+ if ( mpHScrollBar )
+ {
+// ULONG nTextWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
+ // Es gibt kein Notify bei Breiten-Aenderung...
+// ULONG nW = Max( (ULONG)mpTextWindow->GetOutputSizePixel().Width()*5, (ULONG)nTextWidth );
+// mpHScrollBar->SetRange( Range( 0, (long)nW ) );
+ mpHScrollBar->SetRange( Range( 0, (long)mnTextWidth ) );
+ }
+}
+
+void ImpSvMEdit::ImpInitScrollBars()
+{
+ static const sal_Unicode sampleText[] = { 'x', '\0' };
+ if ( mpHScrollBar || mpVScrollBar )
+ {
+ ImpSetScrollBarRanges();
+ Size aCharBox;
+ aCharBox.Width() = mpTextWindow->GetTextWidth( sampleText );
+ aCharBox.Height() = mpTextWindow->GetTextHeight();
+ Size aOutSz = mpTextWindow->GetOutputSizePixel();
+ if ( mpHScrollBar )
+ {
+ mpHScrollBar->SetVisibleSize( aOutSz.Width() );
+ mpHScrollBar->SetPageSize( aOutSz.Width() * 8 / 10 );
+ mpHScrollBar->SetLineSize( aCharBox.Width()*10 );
+ mpHScrollBar->SetThumbPos( mpTextWindow->GetTextView()->GetStartDocPos().X() );
+ }
+ if ( mpVScrollBar )
+ {
+ mpVScrollBar->SetVisibleSize( aOutSz.Height() );
+ mpVScrollBar->SetPageSize( aOutSz.Height() * 8 / 10 );
+ mpVScrollBar->SetLineSize( aCharBox.Height() );
+ mpVScrollBar->SetThumbPos( mpTextWindow->GetTextView()->GetStartDocPos().Y() );
+ }
+ }
+}
+
+IMPL_LINK( ImpSvMEdit, ScrollHdl, ScrollBar*, pCurScrollBar )
+{
+ long nDiffX = 0, nDiffY = 0;
+
+ if ( pCurScrollBar == mpVScrollBar )
+ nDiffY = mpTextWindow->GetTextView()->GetStartDocPos().Y() - pCurScrollBar->GetThumbPos();
+ else if ( pCurScrollBar == mpHScrollBar )
+ nDiffX = mpTextWindow->GetTextView()->GetStartDocPos().X() - pCurScrollBar->GetThumbPos();
+
+ mpTextWindow->GetTextView()->Scroll( nDiffX, nDiffY );
+ // mpTextWindow->GetTextView()->ShowCursor( FALSE, TRUE );
+
+ return 0;
+}
+
+
+// void ImpSvMEdit::ImpModified()
+// {
+// // Wann wird das gerufen ?????????????????????
+// pSvMultiLineEdit->Modify();
+// }
+
+void ImpSvMEdit::SetAlign( WinBits nWinStyle )
+{
+ if ( nWinStyle & WB_CENTER )
+ mpTextWindow->GetTextEngine()->SetTextAlign( TXTALIGN_CENTER );
+ else if ( nWinStyle & WB_RIGHT )
+ mpTextWindow->GetTextEngine()->SetTextAlign( TXTALIGN_RIGHT );
+ else
+ mpTextWindow->GetTextEngine()->SetTextAlign( TXTALIGN_LEFT );
+}
+
+void ImpSvMEdit::SetTextWindowOffset( const Point& rOffset )
+{
+ maTextWindowOffset = rOffset;
+ Resize();
+}
+
+void ImpSvMEdit::SetModified( BOOL bMod )
+{
+ mpTextWindow->GetTextEngine()->SetModified( bMod );
+}
+
+BOOL ImpSvMEdit::IsModified() const
+{
+ return mpTextWindow->GetTextEngine()->IsModified();
+}
+
+void ImpSvMEdit::SetInsertMode( BOOL bInsert )
+{
+ mpTextWindow->GetTextView()->SetInsertMode( bInsert );
+}
+
+void ImpSvMEdit::SetReadOnly( BOOL bRdOnly )
+{
+ mpTextWindow->GetTextView()->SetReadOnly( bRdOnly );
+ // Farbe anpassen ???????????????????????????
+}
+
+BOOL ImpSvMEdit::IsReadOnly() const
+{
+ return mpTextWindow->GetTextView()->IsReadOnly();
+}
+
+void ImpSvMEdit::SetMaxTextLen( ULONG nLen )
+{
+ mpTextWindow->GetTextEngine()->SetMaxTextLen( nLen );
+}
+
+ULONG ImpSvMEdit::GetMaxTextLen() const
+{
+ return mpTextWindow->GetTextEngine()->GetMaxTextLen();
+}
+
+void ImpSvMEdit::InsertText( const String& rStr )
+{
+ mpTextWindow->GetTextView()->InsertText( rStr );
+}
+
+String ImpSvMEdit::GetSelected() const
+{
+ return mpTextWindow->GetTextView()->GetSelected();
+}
+
+void ImpSvMEdit::Resize()
+{
+ Size aSz = pSvMultiLineEdit->GetOutputSizePixel();
+ long nSBWidth = pSvMultiLineEdit->GetSettings().GetStyleSettings().GetScrollBarSize();
+ nSBWidth = pSvMultiLineEdit->CalcZoom( nSBWidth );
+
+ if ( mpHScrollBar )
+ aSz.Height() -= nSBWidth;
+ if ( mpVScrollBar )
+ aSz.Width() -= nSBWidth;
+
+ Size aTextWindowSz( aSz );
+ aTextWindowSz.Width() -= maTextWindowOffset.X();
+ aTextWindowSz.Height() -= maTextWindowOffset.Y();
+ mpTextWindow->SetPosSizePixel( maTextWindowOffset, aTextWindowSz );
+
+ if ( !mpHScrollBar )
+ mpTextWindow->GetTextEngine()->SetMaxTextWidth( aSz.Width() );
+
+ if ( mpHScrollBar )
+ mpHScrollBar->SetPosSizePixel( 0, aSz.Height(), aSz.Width(), nSBWidth );
+
+ if ( mpVScrollBar )
+ mpVScrollBar->SetPosSizePixel( aSz.Width(), 0, nSBWidth, aSz.Height() );
+
+ if ( mpScrollBox )
+ mpScrollBox->SetPosSizePixel( aSz.Width(), aSz.Height(), nSBWidth, nSBWidth );
+
+ ImpInitScrollBars();
+}
+
+void ImpSvMEdit::GetFocus()
+{
+ mpTextWindow->GrabFocus();
+}
+
+void ImpSvMEdit::Cut()
+{
+ if ( !mpTextWindow->GetTextView()->IsReadOnly() )
+ mpTextWindow->GetTextView()->Cut();
+}
+
+void ImpSvMEdit::Copy()
+{
+ mpTextWindow->GetTextView()->Copy();
+}
+
+void ImpSvMEdit::Paste()
+{
+ if ( !mpTextWindow->GetTextView()->IsReadOnly() )
+ mpTextWindow->GetTextView()->Paste();
+}
+
+void ImpSvMEdit::SetText( const String& rStr )
+{
+ BOOL bWasModified = mpTextWindow->GetTextEngine()->IsModified();
+ mpTextWindow->GetTextEngine()->SetText( rStr );
+ if ( !bWasModified )
+ mpTextWindow->GetTextEngine()->SetModified( FALSE );
+
+ mpTextWindow->GetTextView()->SetSelection( TextSelection() );
+}
+
+String ImpSvMEdit::GetText() const
+{
+ return mpTextWindow->GetTextEngine()->GetText();
+}
+
+String ImpSvMEdit::GetTextLines() const
+{
+ return mpTextWindow->GetTextEngine()->GetTextLines();
+}
+
+void ImpSvMEdit::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
+{
+ if ( rHint.ISA( TextHint ) )
+ {
+ const TextHint& rTextHint = (const TextHint&)rHint;
+ if( rTextHint.GetId() == TEXT_HINT_VIEWSCROLLED )
+ {
+ if ( mpHScrollBar )
+ mpHScrollBar->SetThumbPos( mpTextWindow->GetTextView()->GetStartDocPos().X() );
+ if ( mpVScrollBar )
+ mpVScrollBar->SetThumbPos( mpTextWindow->GetTextView()->GetStartDocPos().Y() );
+ }
+ else if( rTextHint.GetId() == TEXT_HINT_TEXTHEIGHTCHANGED )
+ {
+ if ( mpTextWindow->GetTextView()->GetStartDocPos().Y() )
+ {
+ long nOutHeight = mpTextWindow->GetOutputSizePixel().Height();
+ long nTextHeight = mpTextWindow->GetTextEngine()->GetTextHeight();
+ if ( nTextHeight < nOutHeight )
+ mpTextWindow->GetTextView()->Scroll( 0, mpTextWindow->GetTextView()->GetStartDocPos().Y() );
+ }
+
+ ImpSetScrollBarRanges();
+ }
+ else if( rTextHint.GetId() == TEXT_HINT_TEXTFORMATTED )
+ {
+ if ( mpHScrollBar )
+ {
+ ULONG nWidth = mpTextWindow->GetTextEngine()->CalcTextWidth();
+ if ( nWidth != mnTextWidth )
+ {
+ mnTextWidth = nWidth;
+ mpHScrollBar->SetRange( Range( 0, (long)mnTextWidth ) );
+ mpHScrollBar->SetThumbPos( mpTextWindow->GetTextView()->GetStartDocPos().X() );
+ }
+ }
+ }
+ else if( rTextHint.GetId() == TEXT_HINT_MODIFIED )
+ {
+ pSvMultiLineEdit->Modify();
+ }
+ }
+}
+
+void ImpSvMEdit::SetSelection( const Selection& rSelection )
+{
+ String aText = mpTextWindow->GetTextEngine()->GetText();
+
+ Selection aNewSelection( rSelection );
+ if ( aNewSelection.Min() < 0 )
+ aNewSelection.Min() = 0;
+ else if ( aNewSelection.Min() > aText.Len() )
+ aNewSelection.Min() = aText.Len();
+ if ( aNewSelection.Max() < 0 )
+ aNewSelection.Max() = 0;
+ else if ( aNewSelection.Max() > aText.Len() )
+ aNewSelection.Max() = aText.Len();
+
+ long nEnd = Max( aNewSelection.Min(), aNewSelection.Max() );
+ TextSelection aTextSel;
+ ULONG nPara = 0;
+ USHORT nChar = 0;
+ USHORT x = 0;
+ while ( x <= nEnd )
+ {
+ if ( x == aNewSelection.Min() )
+ aTextSel.GetStart() = TextPaM( nPara, nChar );
+ if ( x == aNewSelection.Max() )
+ aTextSel.GetEnd() = TextPaM( nPara, nChar );
+
+ if ( ( x < aText.Len() ) && ( aText.GetChar( x ) == '\n' ) )
+ {
+ nPara++;
+ nChar = 0;
+ }
+ else
+ nChar++;
+ x++;
+ }
+ mpTextWindow->GetTextView()->SetSelection( aTextSel );
+}
+
+Selection ImpSvMEdit::GetSelection() const
+{
+ Selection aSel;
+ TextSelection aTextSel( mpTextWindow->GetTextView()->GetSelection() );
+ aTextSel.Justify();
+ // Selektion flachklopfen => jeder Umbruch ein Zeichen...
+
+ ExtTextEngine* pExtTextEngine = mpTextWindow->GetTextEngine();
+ // Absaetze davor:
+ ULONG n;
+ for ( n = 0; n < aTextSel.GetStart().GetPara(); n++ )
+ {
+ aSel.Min() += pExtTextEngine->GetTextLen( n );
+ aSel.Min()++;
+ }
+
+ // Erster Absatz mit Selektion:
+ aSel.Max() = aSel.Min();
+ aSel.Min() += aTextSel.GetStart().GetIndex();
+
+ for ( n = aTextSel.GetStart().GetPara(); n < aTextSel.GetEnd().GetPara(); n++ )
+ {
+ aSel.Max() += pExtTextEngine->GetTextLen( n );
+ aSel.Max()++;
+ }
+
+ aSel.Max() += aTextSel.GetEnd().GetIndex();
+
+ return aSel;
+}
+
+Size ImpSvMEdit::CalcMinimumSize() const
+{
+ Size aSz( mpTextWindow->GetTextEngine()->CalcTextWidth(),
+ mpTextWindow->GetTextEngine()->GetTextHeight() );
+
+ if ( mpHScrollBar )
+ aSz.Height() += mpHScrollBar->GetSizePixel().Height();
+ if ( mpVScrollBar )
+ aSz.Width() += mpVScrollBar->GetSizePixel().Width();
+
+ return aSz;
+}
+
+Size ImpSvMEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
+{
+ static const sal_Unicode sampleText[] = { 'X', '\0' };
+
+ Size aSz;
+ Size aCharSz;
+ aCharSz.Width() = mpTextWindow->GetTextWidth( sampleText );
+ aCharSz.Height() = mpTextWindow->GetTextHeight();
+
+ if ( nLines )
+ aSz.Height() = nLines*aCharSz.Height();
+ else
+ aSz.Height() = mpTextWindow->GetTextEngine()->GetTextHeight();
+
+ if ( nColumns )
+ aSz.Width() = nColumns*aCharSz.Width();
+ else
+ aSz.Width() = mpTextWindow->GetTextEngine()->CalcTextWidth();
+
+ if ( mpHScrollBar )
+ aSz.Height() += mpHScrollBar->GetSizePixel().Height();
+ if ( mpVScrollBar )
+ aSz.Width() += mpVScrollBar->GetSizePixel().Width();
+
+ return aSz;
+}
+
+void ImpSvMEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+{
+ static const sal_Unicode sampleText[] = { 'x', '\0' };
+ Size aOutSz = mpTextWindow->GetOutputSizePixel();
+ Size aCharSz( mpTextWindow->GetTextWidth( sampleText ), mpTextWindow->GetTextHeight() );
+ rnCols = (USHORT) (aOutSz.Width()/aCharSz.Width());
+ rnLines = (USHORT) (aOutSz.Height()/aCharSz.Height());
+}
+
+void ImpSvMEdit::Enable( BOOL bEnable )
+{
+ mpTextWindow->Enable( bEnable );
+ if ( mpHScrollBar )
+ mpHScrollBar->Enable( bEnable );
+ if ( mpVScrollBar )
+ mpVScrollBar->Enable( bEnable );
+}
+
+BOOL ImpSvMEdit::HandleCommand( const CommandEvent& rCEvt )
+{
+ BOOL bDone = FALSE;
+ if ( ( rCEvt.GetCommand() == COMMAND_WHEEL ) ||
+ ( rCEvt.GetCommand() == COMMAND_STARTAUTOSCROLL ) ||
+ ( rCEvt.GetCommand() == COMMAND_AUTOSCROLL ) )
+ {
+ mpTextWindow->HandleScrollCommand( rCEvt, mpHScrollBar, mpVScrollBar );
+ bDone = TRUE;
+ }
+ return bDone;
+}
+
+
+TextWindow::TextWindow( Window* pParent ) : Window( pParent )
+{
+ mbInMBDown = FALSE;
+ mbFocusSelectionHide = FALSE;
+ mbIgnoreTab = FALSE;
+ mbActivePopup = FALSE;
+
+ SetPointer( Pointer( POINTER_TEXT ) );
+
+ mpExtTextEngine = new ExtTextEngine;
+ mpExtTextEngine->SetMaxTextLen( STRING_MAXLEN );
+ mpExtTextView = new ExtTextView( mpExtTextEngine, this );
+ mpExtTextEngine->InsertView( mpExtTextView );
+ mpExtTextEngine->EnableUndo( TRUE );
+ mpExtTextView->ShowCursor();
+
+ Color aBackgroundColor = GetSettings().GetStyleSettings().GetWorkspaceColor();
+ SetBackground( aBackgroundColor );
+ pParent->SetBackground( aBackgroundColor );
+ EnableDrop( TRUE );
+}
+
+TextWindow::~TextWindow()
+{
+ delete mpExtTextView;
+ delete mpExtTextEngine;
+}
+
+void TextWindow::MouseMove( const MouseEvent& rMEvt )
+{
+ mpExtTextView->MouseMove( rMEvt );
+ Window::MouseMove( rMEvt );
+}
+
+void TextWindow::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ mbInMBDown = TRUE; // Dann im GetFocus nicht alles selektieren wird
+ mpExtTextView->MouseButtonDown( rMEvt );
+ Window::MouseButtonDown( rMEvt );
+ GrabFocus();
+ mbInMBDown = FALSE;
+}
+
+void TextWindow::MouseButtonUp( const MouseEvent& rMEvt )
+{
+ mpExtTextView->MouseButtonUp( rMEvt );
+ Window::MouseButtonUp( rMEvt );
+}
+
+void TextWindow::KeyInput( const KeyEvent& rKEvent )
+{
+ BOOL bDone = FALSE;
+ USHORT nCode = rKEvent.GetKeyCode().GetCode();
+ if ( (nCode == KEY_A) && rKEvent.GetKeyCode().IsMod1() )
+ {
+ mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
+ bDone = TRUE;
+ }
+ else if ( (nCode == KEY_S) && rKEvent.GetKeyCode().IsShift() && rKEvent.GetKeyCode().IsMod1() )
+ {
+ if ( Edit::GetGetSpecialCharsFunction() )
+ {
+ // Damit die Selektion erhalten bleibt
+ mbActivePopup = TRUE;
+ XubString aChars = Edit::GetGetSpecialCharsFunction()( this, GetFont() );
+ if ( aChars.Len() )
+ {
+ mpExtTextView->InsertText( aChars );
+ mpExtTextView->GetTextEngine()->SetModified( TRUE );
+ }
+ mbActivePopup = FALSE;
+ bDone = TRUE;
+ }
+ }
+ else if ( nCode == KEY_TAB )
+ {
+ if ( !mbIgnoreTab || rKEvent.GetKeyCode().IsMod1() )
+ bDone = mpExtTextView->KeyInput( rKEvent );
+ }
+ else
+ {
+ bDone = mpExtTextView->KeyInput( rKEvent );
+ }
+
+ if ( !bDone )
+ Window::KeyInput( rKEvent );
+}
+
+void TextWindow::Paint( const Rectangle& rRect )
+{
+ mpExtTextView->Paint( rRect );
+}
+
+void TextWindow::Resize()
+{
+}
+
+void TextWindow::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+ {
+ PopupMenu* pPopup = Edit::CreatePopupMenu();
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ if ( rStyleSettings.GetOptions() & STYLE_OPTION_HIDEDISABLED )
+ pPopup->SetMenuFlags( MENU_FLAG_HIDEDISABLEDENTRIES );
+ if ( !mpExtTextView->HasSelection() )
+ {
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_COPY, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
+ }
+ if ( mpExtTextView->IsReadOnly() )
+ {
+ pPopup->EnableItem( SV_MENU_EDIT_CUT, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_PASTE, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_DELETE, FALSE );
+ pPopup->EnableItem( SV_MENU_EDIT_INSERTSYMBOL, FALSE );
+ }
+ if ( !mpExtTextView->GetTextEngine()->HasUndoManager() || !mpExtTextView->GetTextEngine()->GetUndoManager().GetUndoActionCount() )
+ {
+ pPopup->EnableItem( SV_MENU_EDIT_UNDO, FALSE );
+ }
+// if ( ( maSelection.Min() == 0 ) && ( maSelection.Max() == maText.Len() ) )
+// {
+// pPopup->EnableItem( SV_MENU_EDIT_SELECTALL, FALSE );
+// }
+ if ( !Edit::GetGetSpecialCharsFunction() )
+ {
+ USHORT nPos = pPopup->GetItemPos( SV_MENU_EDIT_INSERTSYMBOL );
+ pPopup->RemoveItem( nPos );
+ pPopup->RemoveItem( nPos-1 );
+ }
+
+ mbActivePopup = TRUE;
+ Point aPos = rCEvt.GetMousePosPixel();
+ if ( !rCEvt.IsMouseEvent() )
+ {
+ // !!! Irgendwann einmal Menu zentriert in der Selektion anzeigen !!!
+ Size aSize = GetOutputSizePixel();
+ aPos = Point( aSize.Width()/2, aSize.Height()/2 );
+ }
+// pPopup->RemoveDisabledEntries();
+ USHORT n = pPopup->Execute( this, aPos );
+ Edit::DeletePopupMenu( pPopup );
+ switch ( n )
+ {
+ case SV_MENU_EDIT_UNDO: mpExtTextView->Undo();
+ mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
+ break;
+ case SV_MENU_EDIT_CUT: mpExtTextView->Cut();
+ mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
+ break;
+ case SV_MENU_EDIT_COPY: mpExtTextView->Copy();
+ break;
+ case SV_MENU_EDIT_PASTE: mpExtTextView->Paste();
+ mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
+ break;
+ case SV_MENU_EDIT_DELETE: mpExtTextView->DeleteSelected();
+ mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
+ break;
+ case SV_MENU_EDIT_SELECTALL: mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFFFFFF, 0xFFFF ) ) );
+ break;
+ case SV_MENU_EDIT_INSERTSYMBOL:
+ {
+ XubString aChars = Edit::GetGetSpecialCharsFunction()( this, GetFont() );
+ if ( aChars.Len() )
+ {
+ mpExtTextView->InsertText( aChars );
+ mpExtTextEngine->SetModified( TRUE );
+ mpExtTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
+ }
+ }
+ break;
+ }
+ mbActivePopup = FALSE;
+ }
+ else
+ {
+ mpExtTextView->Command( rCEvt );
+ }
+ Window::Command( rCEvt );
+}
+
+void TextWindow::GetFocus()
+{
+ Window::GetFocus();
+ if ( !mbActivePopup )
+ {
+ BOOL bGotoCursor = !mpExtTextView->IsReadOnly();
+ if ( mbFocusSelectionHide && IsReallyVisible() && !mpExtTextView->IsReadOnly()
+ && ( !mbInMBDown || ( GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_FOCUS ) ) )
+ {
+ // Alles selektieren, aber nicht scrollen
+ BOOL bAutoScroll = mpExtTextView->IsAutoScroll();
+ mpExtTextView->SetAutoScroll( FALSE );
+ mpExtTextView->SetSelection( TextSelection( TextPaM( 0, 0 ), TextPaM( 0xFFFF, 0xFFFF ) ) );
+ mpExtTextView->SetAutoScroll( bAutoScroll );
+ bGotoCursor = FALSE;
+ }
+ mpExtTextView->SetPaintSelection( TRUE );
+ mpExtTextView->ShowCursor( bGotoCursor );
+ }
+}
+
+void TextWindow::LoseFocus()
+{
+ Window::LoseFocus();
+
+ if ( mbFocusSelectionHide && !mbActivePopup )
+ mpExtTextView->SetPaintSelection( FALSE );
+}
+
+BOOL TextWindow::QueryDrop( DropEvent& rEvt )
+{
+ return mpExtTextView->QueryDrop( rEvt );
+}
+
+BOOL TextWindow::Drop( const DropEvent& rEvt )
+{
+ return mpExtTextView->Drop( rEvt );
+}
+
+
+MultiLineEdit::MultiLineEdit( Window* pParent, WinBits nWinStyle )
+ : Edit( pParent, nWinStyle )
+{
+ SetType( WINDOW_MULTILINEEDIT );
+ pImpSvMEdit = new ImpSvMEdit( this, nWinStyle );
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ pUpdateDataTimer = 0;
+
+ SetCompoundControl( TRUE );
+ SetStyle( ImplInitStyle( nWinStyle ) );
+}
+
+MultiLineEdit::MultiLineEdit( Window* pParent, const ResId& rResId )
+ : Edit( pParent, rResId.SetRT( RSC_MULTILINEEDIT ) )
+{
+ SetType( WINDOW_MULTILINEEDIT );
+ WinBits nWinStyle = rResId.aWinBits;
+ pImpSvMEdit = new ImpSvMEdit( this, nWinStyle );
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ pUpdateDataTimer = 0;
+
+ USHORT nMaxLen = Edit::GetMaxTextLen();
+ if ( nMaxLen )
+ SetMaxTextLen( nMaxLen );
+
+ SetText( Edit::GetText() );
+
+ if ( IsVisible() )
+ pImpSvMEdit->Resize();
+
+ SetCompoundControl( TRUE );
+ SetStyle( ImplInitStyle( nWinStyle ) );
+}
+
+MultiLineEdit::~MultiLineEdit()
+{
+ delete pImpSvMEdit;
+ delete pUpdateDataTimer;
+}
+
+WinBits MultiLineEdit::ImplInitStyle( WinBits nStyle )
+{
+ if ( !(nStyle & WB_NOTABSTOP) )
+ nStyle |= WB_TABSTOP;
+
+ if ( !(nStyle & WB_NOGROUP) )
+ nStyle |= WB_GROUP;
+
+ if ( !(nStyle & WB_IGNORETAB ))
+ nStyle |= WINDOW_DLGCTRL_MOD1TAB;
+
+ return nStyle;
+}
+
+
+void MultiLineEdit::ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground )
+{
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+
+ // Der Font muss immer mit manipuliert werden, weil die TextEngine
+ // sich nicht um TextColor/Background kuemmert
+
+ Color aTextColor = rStyleSettings.GetFieldTextColor();
+ if ( IsControlForeground() )
+ aTextColor = GetControlForeground();
+
+ Font aFont = rStyleSettings.GetFieldFont();
+ if ( IsControlFont() )
+ aFont.Merge( GetControlFont() );
+ aFont.SetTransparent( FALSE );
+ SetZoomedPointFont( aFont );
+ Font TheFont = GetFont();
+ TheFont.SetColor( aTextColor );
+ TheFont.SetFillColor( IsControlBackground() ? GetControlBackground() : rStyleSettings.GetFieldColor() );
+ pImpSvMEdit->GetTextWindow()->SetFont( TheFont );
+ pImpSvMEdit->GetTextWindow()->GetTextEngine()->SetFont( TheFont );
+ pImpSvMEdit->GetTextWindow()->SetTextColor( aTextColor );
+
+ if ( bBackground )
+ {
+ if( IsControlBackground() )
+ pImpSvMEdit->GetTextWindow()->SetBackground( GetControlBackground() );
+ else
+ pImpSvMEdit->GetTextWindow()->SetBackground( rStyleSettings.GetFieldColor() );
+ // Auch am MultiLineEdit einstellen, weil die TextComponent
+ // ggf. die Scrollbars hidet.
+ SetBackground( pImpSvMEdit->GetTextWindow()->GetBackground() );
+ }
+}
+
+void MultiLineEdit::Modify()
+{
+ aModifyHdlLink.Call( this );
+ if ( pUpdateDataTimer )
+ pUpdateDataTimer->Start();
+}
+
+IMPL_LINK( MultiLineEdit, ImpUpdateDataHdl, Timer*, EMPTYARG )
+{
+ UpdateData();
+ return 0;
+}
+
+void MultiLineEdit::UpdateData()
+{
+ aUpdateDataHdlLink.Call( this );
+}
+
+void MultiLineEdit::SetModifyFlag()
+{
+ pImpSvMEdit->SetModified( TRUE );
+}
+
+void MultiLineEdit::ClearModifyFlag()
+{
+ pImpSvMEdit->SetModified( TRUE );
+}
+
+BOOL MultiLineEdit::IsModified() const
+{
+ return pImpSvMEdit->IsModified();
+}
+
+void MultiLineEdit::EnableUpdateData( ULONG nTimeout )
+{
+ if ( !nTimeout )
+ DisableUpdateData();
+ else
+ {
+ if ( !pUpdateDataTimer )
+ {
+ pUpdateDataTimer = new Timer;
+ pUpdateDataTimer->SetTimeoutHdl( LINK( this, MultiLineEdit, ImpUpdateDataHdl ) );
+ }
+ pUpdateDataTimer->SetTimeout( nTimeout );
+ }
+}
+
+void MultiLineEdit::SetReadOnly( BOOL bReadOnly )
+{
+ pImpSvMEdit->SetReadOnly( bReadOnly );
+ Edit::SetReadOnly( bReadOnly );
+}
+
+BOOL MultiLineEdit::IsReadOnly() const
+{
+ return pImpSvMEdit->IsReadOnly();
+}
+
+void MultiLineEdit::SetMaxTextLen( ULONG nMaxLen )
+{
+ pImpSvMEdit->SetMaxTextLen( nMaxLen );
+}
+
+ULONG MultiLineEdit::GetMaxTextLen() const
+{
+ return pImpSvMEdit->GetMaxTextLen();
+}
+
+void MultiLineEdit::ReplaceSelected( const String& rStr )
+{
+ pImpSvMEdit->InsertText( rStr );
+}
+
+void MultiLineEdit::DeleteSelected()
+{
+ pImpSvMEdit->InsertText( String() );
+}
+
+String MultiLineEdit::GetSelected() const
+{
+ return pImpSvMEdit->GetSelected();
+}
+
+void MultiLineEdit::Cut()
+{
+ pImpSvMEdit->Cut();
+}
+
+void MultiLineEdit::Copy()
+{
+ pImpSvMEdit->Copy();
+}
+
+void MultiLineEdit::Paste()
+{
+ pImpSvMEdit->Paste();
+}
+
+void MultiLineEdit::SetText( const String& rStr )
+{
+ pImpSvMEdit->SetText( rStr );
+}
+
+String MultiLineEdit::GetText() const
+{
+ return pImpSvMEdit->GetText();
+}
+
+String MultiLineEdit::GetTextLines() const
+{
+ return pImpSvMEdit->GetTextLines();
+}
+
+void MultiLineEdit::Resize()
+{
+ pImpSvMEdit->Resize();
+}
+
+void MultiLineEdit::GetFocus()
+{
+ Edit::GetFocus();
+ pImpSvMEdit->GetFocus();
+}
+
+void MultiLineEdit::SetSelection( const Selection& rSelection )
+{
+ pImpSvMEdit->SetSelection( rSelection );
+}
+
+Selection MultiLineEdit::GetSelection() const
+{
+ return pImpSvMEdit->GetSelection();
+}
+
+Size MultiLineEdit::CalcMinimumSize() const
+{
+ Size aSz = pImpSvMEdit->CalcMinimumSize();
+
+ long nLeft, nTop, nRight, nBottom;
+ ((Window*)this)->GetBorder( nLeft, nTop, nRight, nBottom );
+ aSz.Width() += nLeft+nRight;
+ aSz.Height() += nTop+nBottom;
+
+ return aSz;
+}
+
+Size MultiLineEdit::CalcAdjustedSize( const Size& rPrefSize ) const
+{
+ Size aSz = rPrefSize;
+ long nLeft, nTop, nRight, nBottom;
+ ((Window*)this)->GetBorder( nLeft, nTop, nRight, nBottom );
+
+ // In der Hoehe auf ganze Zeilen justieren
+
+ long nHeight = aSz.Height() - nTop - nBottom;
+ long nLineHeight = pImpSvMEdit->CalcSize( 1, 1 ).Height();
+ long nLines = nHeight / nLineHeight;
+ if ( nLines < 1 )
+ nLines = 1;
+
+ aSz.Height() = nLines * nLineHeight;
+ aSz.Height() += nTop+nBottom;
+
+ return aSz;
+}
+
+Size MultiLineEdit::CalcSize( USHORT nColumns, USHORT nLines ) const
+{
+ Size aSz = pImpSvMEdit->CalcSize( nColumns, nLines );
+
+ long nLeft, nTop, nRight, nBottom;
+ ((Window*)this)->GetBorder( nLeft, nTop, nRight, nBottom );
+ aSz.Width() += nLeft+nRight;
+ aSz.Height() += nTop+nBottom;
+ return aSz;
+}
+
+void MultiLineEdit::GetMaxVisColumnsAndLines( USHORT& rnCols, USHORT& rnLines ) const
+{
+ pImpSvMEdit->GetMaxVisColumnsAndLines( rnCols, rnLines );
+}
+
+void MultiLineEdit::StateChanged( StateChangedType nType )
+{
+ if( nType == STATE_CHANGE_ENABLE )
+ {
+ pImpSvMEdit->Enable( IsEnabled() );
+ }
+ else if( nType == STATE_CHANGE_READONLY )
+ {
+ pImpSvMEdit->SetReadOnly( IsReadOnly() );
+ }
+ else if ( nType == STATE_CHANGE_ZOOM )
+ {
+ pImpSvMEdit->GetTextWindow()->SetZoom( GetZoom() );
+ ImplInitSettings( TRUE, FALSE, FALSE );
+ Resize();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLFONT )
+ {
+ ImplInitSettings( TRUE, FALSE, FALSE );
+ Resize();
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLFOREGROUND )
+ {
+ ImplInitSettings( FALSE, TRUE, FALSE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_CONTROLBACKGROUND )
+ {
+ ImplInitSettings( FALSE, FALSE, TRUE );
+ Invalidate();
+ }
+ else if ( nType == STATE_CHANGE_STYLE )
+ {
+ pImpSvMEdit->SetAlign( GetStyle() );
+ SetStyle( ImplInitStyle( GetStyle() ) );
+ }
+
+ Control::StateChanged( nType );
+}
+
+void MultiLineEdit::DataChanged( const DataChangedEvent& rDCEvt )
+{
+ if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
+ (rDCEvt.GetFlags() & SETTINGS_STYLE) )
+ {
+ ImplInitSettings( TRUE, TRUE, TRUE );
+ Resize();
+ Invalidate();
+ }
+ else
+ Control::DataChanged( rDCEvt );
+}
+
+void MultiLineEdit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG nFlags )
+{
+ ImplInitSettings( TRUE, TRUE, TRUE );
+
+ Point aPos = pDev->LogicToPixel( rPos );
+ Size aSize = pDev->LogicToPixel( rSize );
+ Font aFont = pImpSvMEdit->GetTextWindow()->GetDrawPixelFont( pDev );
+ aFont.SetTransparent( TRUE );
+ OutDevType eOutDevType = pDev->GetOutDevType();
+
+ pDev->Push();
+ pDev->SetMapMode();
+ pDev->SetFont( aFont );
+ pDev->SetTextFillColor();
+
+ // Border/Background
+ pDev->SetLineColor();
+ pDev->SetFillColor();
+ BOOL bBorder = !(nFlags & WINDOW_DRAW_NOBORDER ) && (GetStyle() & WB_BORDER);
+ BOOL bBackground = !(nFlags & WINDOW_DRAW_NOBACKGROUND) && IsControlBackground();
+ if ( bBorder || bBackground )
+ {
+ Rectangle aRect( aPos, aSize );
+ if ( bBorder )
+ {
+ DecorationView aDecoView( pDev );
+ aRect = aDecoView.DrawFrame( aRect, FRAME_DRAW_DOUBLEIN );
+ }
+ if ( bBackground )
+ {
+ pDev->SetFillColor( GetControlBackground() );
+ pDev->DrawRect( aRect );
+ }
+ }
+
+ // Inhalt
+ if ( ( nFlags & WINDOW_DRAW_MONO ) || ( eOutDevType == OUTDEV_PRINTER ) )
+ pDev->SetTextColor( Color( COL_BLACK ) );
+ else
+ {
+ if ( !(nFlags & WINDOW_DRAW_NODISABLE ) && !IsEnabled() )
+ {
+ const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
+ pDev->SetTextColor( rStyleSettings.GetDisableColor() );
+ }
+ else
+ {
+ pDev->SetTextColor( GetTextColor() );
+ }
+ }
+
+ XubString aText = GetText();
+ Size aTextSz( pDev->GetTextWidth( aText ), pDev->GetTextHeight() );
+ ULONG nLines = (ULONG) (aSize.Height() / aTextSz.Height());
+ if ( !nLines )
+ nLines = 1;
+ aTextSz.Height() = nLines*aTextSz.Height();
+ long nOnePixel = GetDrawPixel( pDev, 1 );
+ long nOffX = 3*nOnePixel;
+ long nOffY = 2*nOnePixel;
+
+ // Clipping?
+ if ( ( nOffY < 0 ) || ( (nOffY+aTextSz.Height()) > aSize.Height() ) || ( (nOffX+aTextSz.Width()) > aSize.Width() ) )
+ {
+ Rectangle aClip( aPos, aSize );
+ if ( aTextSz.Height() > aSize.Height() )
+ aClip.Bottom() += aTextSz.Height() - aSize.Height() + 1; // Damit HP-Drucker nicht 'weg-optimieren'
+ pDev->IntersectClipRegion( aClip );
+ }
+
+ TextEngine aTE;
+ aTE.SetText( GetText() );
+ aTE.SetMaxTextWidth( aSize.Width() );
+ aTE.SetFont( aFont );
+ aTE.SetTextAlign( pImpSvMEdit->GetTextWindow()->GetTextEngine()->GetTextAlign() );
+ aTE.Draw( pDev, Point( aPos.X() + nOffX, aPos.Y() + nOffY ) );
+
+ pDev->Pop();
+}
+
+long MultiLineEdit::Notify( NotifyEvent& rNEvt )
+{
+ long nDone = 0;
+ if( rNEvt.GetType() == EVENT_COMMAND )
+ {
+ nDone = pImpSvMEdit->HandleCommand( *rNEvt.GetCommandEvent() );
+ }
+ return nDone ? nDone : Edit::Notify( rNEvt );
+}
+
+long MultiLineEdit::PreNotify( NotifyEvent& rNEvt )
+{
+ long nDone = 0;
+
+ if( ( rNEvt.GetType() == EVENT_KEYINPUT ) && ( !GetTextView()->IsCursorEnabled() ) )
+ {
+ const KeyEvent& rKEvent = *rNEvt.GetKeyEvent();
+ if ( !rKEvent.GetKeyCode().IsShift() && ( rKEvent.GetKeyCode().GetGroup() == KEYGROUP_CURSOR ) )
+ {
+ nDone = 1;
+ TextSelection aSel = pImpSvMEdit->GetTextWindow()->GetTextView()->GetSelection();
+ if ( aSel.HasRange() )
+ {
+ aSel.GetStart() = aSel.GetEnd();
+ pImpSvMEdit->GetTextWindow()->GetTextView()->SetSelection( aSel );
+ }
+ else
+ {
+ switch ( rKEvent.GetKeyCode().GetCode() )
+ {
+ case KEY_UP:
+ {
+ if ( pImpSvMEdit->GetVScrollBar() )
+ pImpSvMEdit->GetVScrollBar()->DoScrollAction( SCROLL_LINEUP );
+ }
+ break;
+ case KEY_DOWN:
+ {
+ if ( pImpSvMEdit->GetVScrollBar() )
+ pImpSvMEdit->GetVScrollBar()->DoScrollAction( SCROLL_LINEDOWN );
+ }
+ break;
+ case KEY_PAGEUP :
+ {
+ if ( pImpSvMEdit->GetVScrollBar() )
+ pImpSvMEdit->GetVScrollBar()->DoScrollAction( SCROLL_PAGEUP );
+ }
+ break;
+ case KEY_PAGEDOWN:
+ {
+ if ( pImpSvMEdit->GetVScrollBar() )
+ pImpSvMEdit->GetVScrollBar()->DoScrollAction( SCROLL_PAGEDOWN );
+ }
+ break;
+ case KEY_LEFT:
+ {
+ if ( pImpSvMEdit->GetHScrollBar() )
+ pImpSvMEdit->GetHScrollBar()->DoScrollAction( SCROLL_LINEUP );
+ }
+ break;
+ case KEY_RIGHT:
+ {
+ if ( pImpSvMEdit->GetHScrollBar() )
+ pImpSvMEdit->GetHScrollBar()->DoScrollAction( SCROLL_LINEDOWN );
+ }
+ break;
+ case KEY_HOME:
+ {
+ if ( rKEvent.GetKeyCode().IsMod1() )
+ pImpSvMEdit->GetTextWindow()->GetTextView()->
+ SetSelection( TextSelection( TextPaM( 0, 0 ) ) );
+ }
+ break;
+ case KEY_END:
+ {
+ if ( rKEvent.GetKeyCode().IsMod1() )
+ pImpSvMEdit->GetTextWindow()->GetTextView()->
+ SetSelection( TextSelection( TextPaM( 0xFFFF, 0xFFFF ) ) );
+ }
+ break;
+ default:
+ {
+ nDone = 0;
+ }
+ }
+ }
+ }
+ }
+
+ return nDone ? nDone : Edit::PreNotify( rNEvt );
+}
+
+//
+// Internas fuer abgeleitete Klassen, z.B. TextComponent
+
+ExtTextEngine* MultiLineEdit::GetTextEngine() const
+{
+ return pImpSvMEdit->GetTextWindow()->GetTextEngine();
+}
+
+ExtTextView* MultiLineEdit::GetTextView() const
+{
+ return pImpSvMEdit->GetTextWindow()->GetTextView();
+}
+
+ScrollBar* MultiLineEdit::GetHScrollBar() const
+{
+ return pImpSvMEdit->GetHScrollBar();
+}
+
+
+ScrollBar* MultiLineEdit::GetVScrollBar() const
+{
+ return pImpSvMEdit->GetVScrollBar();
+}
+
+void MultiLineEdit::EnableFocusSelectionHide( BOOL bHide )
+{
+ pImpSvMEdit->GetTextWindow()->SetAutoFocusHide( bHide );
+}
+
+BOOL MultiLineEdit::IsFocusSelectionHideEnabled() const
+{
+ return pImpSvMEdit->GetTextWindow()->IsAutoFocusHide();
+}
diff --git a/svtools/source/edit/sychconv.cxx b/svtools/source/edit/sychconv.cxx
new file mode 100644
index 000000000000..e9bae812c5a5
--- /dev/null
+++ b/svtools/source/edit/sychconv.cxx
@@ -0,0 +1,139 @@
+/*************************************************************************
+ *
+ * $RCSfile: sychconv.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SYCHCONV_HXX
+#include "sychconv.hxx"
+#endif
+#ifndef _SV_OUTDEV_HXX
+#include <vcl/outdev.hxx>
+#endif
+
+const BOOL SymCharConverter::Convert( Font& rFont, UniString& rString, OutputDevice* pDev )
+{
+ // hibyte 0 = exact matching
+ // 1 = little differences,
+ // 2 = the converted character does not look like the original but got the same meaning
+ // 3 = the destination does not match looking and meaning of the original
+
+ static USHORT __READONLY_DATA aWingdingsToStarBatsTable[ 256 - 32 ] =
+ {
+ 0x0020, 0x0238, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0174, 0x02BA, 0x017B, 0x017C, 0x037C, 0x037C, 0x037C, 0x037C,
+ 0x0000, 0x0000, 0x0372, 0x0272, 0x0372, 0x0000, 0x0000, 0x0374, 0x0279, 0x0000, 0x027A, 0x0000, 0x0178, 0x0278, 0x0000, 0x0137,
+ 0x027E, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x017D, 0x0000, 0x0000, 0x0000, 0x0021, 0x03AC, 0x00AD, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x01C0, 0x0000, 0x0000, 0x0286, 0x0286, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0022, 0x0023, 0x0024, 0x0025,
+ 0x0026, 0x0027, 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x0133, 0x0000, 0x0000, 0x0000, 0x0000, 0x0193, 0x0194, 0x0000,
+ 0x0067, 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, 0x0070, 0x0071, 0x005C, 0x005D, 0x005E, 0x005F, 0x0060,
+ 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01A5, 0x0095,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x002E, 0x0000, 0x0125, 0x0000, 0x0000, 0x0000, 0x014B, 0x024D, 0x014E, 0x014A,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x002F, 0x0000, 0x0000, 0x0000, 0x0035, 0x0000, 0x0000, 0x0000,
+ 0x0030, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0031, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x01B1,
+ 0x01AF, 0x01B2, 0x01B0, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0150, 0x0032, 0x0033, 0x0034, 0x01C8
+ };
+
+ static USHORT __READONLY_DATA aMonotypeSortsToStarBatsTable[ 256 - 32 ]=
+ {
+ 0x0020, 0x00cb, 0x00cb, 0x00cb, 0x00cb, 0x0074, 0x00ba, 0x0021, 0x00cc, 0x007b, 0x0036, 0x007d, 0x007e, 0x0037, 0x0038, 0x0038,
+ 0x0039, 0x0038, 0x0038, 0x0039, 0x003a, 0x004f, 0x0050, 0x004f, 0x0050, 0x0051, 0x0052, 0x0053, 0x0054, 0x0086, 0x0086, 0x0086,
+ 0x0052, 0x00cd, 0x0044, 0x0045, 0x0046, 0x0047, 0x0041, 0x0041, 0x0058, 0x0057, 0x0075, 0x0055, 0x0056, 0x0057, 0x0058, 0x0059,
+ 0x005a, 0x004b, 0x004b, 0x0048, 0x0049, 0x004a, 0x004b, 0x004c, 0x004d, 0x004e, 0x004e, 0x004b, 0x004b, 0x00ce, 0x00ce, 0x00ce,
+ 0x00ce, 0x00ce, 0x00ce, 0x00ce, 0x00cf, 0x00cf, 0x00cf, 0x00cf, 0x00cf, 0x00cf, 0x00b9, 0x00b9, 0x003b, 0x003c, 0x003d, 0x003e,
+ 0x003f, 0x003e, 0x0040, 0x00c5, 0x00c4, 0x002b, 0x002c, 0x00d0, 0x00d1, 0x00d1, 0x00d1, 0x0091, 0x0092, 0x0093, 0x0094, 0x0000,
+ 0x00d2, 0x00d3, 0x00d2, 0x00d3, 0x00d2, 0x00d3, 0x00d2, 0x00d3, 0x00d2, 0x00d3, 0x00d2, 0x00d3, 0x00d2, 0x00d3, 0x0000, 0x0000,
+ 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000,
+ 0x0000, 0x00d4, 0x00d4, 0x00d4, 0x00d6, 0x00d6, 0x00d4, 0x00d4, 0x00d5, 0x002a, 0x00d6, 0x00d7, 0x0068, 0x0069, 0x006a, 0x006b,
+ 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066,
+ 0x0068, 0x0069, 0x006a, 0x006b, 0x006c, 0x006d, 0x006e, 0x006f, 0x0070, 0x0071, 0x005d, 0x005e, 0x005f, 0x0060, 0x0061, 0x0062,
+ 0x0063, 0x0064, 0x0065, 0x0066, 0x0030, 0x0031, 0x00d8, 0x00d9, 0x00da, 0x00bc, 0x00db, 0x00bc, 0x00bc, 0x00bc, 0x00bc, 0x0031,
+ 0x0031, 0x0031, 0x002f, 0x002f, 0x002f, 0x00be, 0x00be, 0x0031, 0x0031, 0x00af, 0x00af, 0x00af, 0x00af, 0x00af, 0x00af, 0x00af,
+ 0x0000, 0x00af, 0x0035, 0x00dc, 0x00da, 0x00dc, 0x00db, 0x00da, 0x00dc, 0x00db, 0x00dc, 0x00dc, 0x00dc, 0x00dc, 0x00af, 0x0000
+ };
+
+ const USHORT* pTransTable = NULL;
+
+ BOOL bIsAvailable = ( pDev ) ? pDev->IsFontAvailable( rFont.GetName() ) : FALSE;
+ if ( !bIsAvailable )
+ {
+ if ( rFont.GetName().CompareToAscii( RTL_CONSTASCII_STRINGPARAM( "Wingdings" ) ) == COMPARE_EQUAL )
+ pTransTable = &aWingdingsToStarBatsTable[ 0 ];
+ else if ( rFont.GetName().CompareToAscii( RTL_CONSTASCII_STRINGPARAM( "Monotype Sorts" ) ) == COMPARE_EQUAL )
+ pTransTable = &aMonotypeSortsToStarBatsTable[ 0 ];
+ }
+ if ( pTransTable )
+ {
+ sal_Unicode c;
+ for ( UINT16 i = rString.Len(); i--; )
+ {
+ c = rString.GetChar( i );
+ c -= 32;
+ c = ( ((UINT16)c) >= 224 ) ? 0 : (sal_Unicode) pTransTable[ c ];
+ if ( !c ) // if character is out of range or not matching
+ c = 0xA5; // we will default a StarBats-Bullet
+ rString.SetChar( i, c );
+ }
+ rFont.SetCharSet( RTL_TEXTENCODING_SYMBOL );
+ rFont.SetName( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "StarBats" ) ) );
+ return TRUE;
+ }
+ else return FALSE;
+};
diff --git a/svtools/source/edit/textdat2.hxx b/svtools/source/edit/textdat2.hxx
new file mode 100644
index 000000000000..f96ec1890291
--- /dev/null
+++ b/svtools/source/edit/textdat2.hxx
@@ -0,0 +1,338 @@
+/*************************************************************************
+ *
+ * $RCSfile: textdat2.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _TEXTDAT2_HXX
+#define _TEXTDAT2_HXX
+
+#ifndef _SVARRAY_HXX
+#include <svarray.hxx>
+#endif
+
+#ifndef _LIST_HXX //autogen
+#include <tools/list.hxx>
+#endif
+
+#ifndef _SV_SELENG_HXX //autogen
+#include <vcl/seleng.hxx>
+#endif
+
+#ifndef _SV_VIRDEV_HXX //autogen
+#include <vcl/virdev.hxx>
+#endif
+
+#ifndef _SV_CURSOR_HXX
+#include <vcl/cursor.hxx>
+#endif
+
+class TextNode;
+class TextView;
+
+#define PORTIONKIND_TEXT 0
+#define PORTIONKIND_TAB 1
+
+#define DELMODE_SIMPLE 0
+#define DELMODE_RESTOFWORD 1
+#define DELMODE_RESTOFCONTENT 2
+
+#define DEL_LEFT 1
+#define DEL_RIGHT 2
+#define TRAVEL_X_DONTKNOW 0xFFFF
+#define MAXCHARSINPARA 0x3FFF-CHARPOSGROW
+
+#define LINE_SEP 0x0A
+
+
+class TextPortion
+{
+private:
+ USHORT nLen;
+ long nWidth;
+ BYTE nKind;
+
+ TextPortion() { nLen = 0; nKind = PORTIONKIND_TEXT; nWidth = -1;}
+
+public:
+ TextPortion( USHORT nL ) {
+ nLen = nL;
+ nKind = PORTIONKIND_TEXT;
+ nWidth= -1;
+ }
+
+ USHORT GetLen() const { return nLen; }
+ USHORT& GetLen() { return nLen; }
+
+ long GetWidth()const { return nWidth; }
+ long& GetWidth() { return nWidth; }
+
+ BYTE GetKind() const { return nKind; }
+ BYTE& GetKind() { return nKind; }
+
+ BOOL HasValidSize() const { return nWidth != (-1); }
+};
+
+
+
+typedef TextPortion* TextPortionPtr;
+SV_DECL_PTRARR( TextPortionArray, TextPortionPtr, 0, 8 );
+
+class TETextPortionList : public TextPortionArray
+{
+public:
+ TETextPortionList();
+ ~TETextPortionList();
+
+ void Reset();
+ USHORT FindPortion( USHORT nCharPos, USHORT& rPortionStart );
+ void DeleteFromPortion( USHORT nDelFrom );
+};
+
+
+
+class TextLine
+{
+private:
+ USHORT mnStart;
+ USHORT mnEnd;
+ USHORT mnStartPortion;
+ USHORT mnEndPortion;
+
+ short mnStartX;
+
+ BOOL mbInvalid; // fuer geschickte Formatierung/Ausgabe
+
+public:
+ TextLine() {
+ mnStart = mnEnd = 0;
+ mnStartPortion = mnEndPortion = 0;
+ mnStartX = 0;
+ mbInvalid = TRUE;
+ }
+
+ BOOL IsIn( USHORT nIndex ) const
+ { return ( (nIndex >= mnStart ) && ( nIndex < mnEnd ) ); }
+
+ BOOL IsIn( USHORT nIndex, BOOL bInclEnd ) const
+ { return ( ( nIndex >= mnStart ) && ( bInclEnd ? ( nIndex <= mnEnd ) : ( nIndex < mnEnd ) ) ); }
+
+ void SetStart( USHORT n ) { mnStart = n; }
+ USHORT GetStart() const { return mnStart; }
+ USHORT& GetStart() { return mnStart; }
+
+ void SetEnd( USHORT n ) { mnEnd = n; }
+ USHORT GetEnd() const { return mnEnd; }
+ USHORT& GetEnd() { return mnEnd; }
+
+ void SetStartPortion( USHORT n ) { mnStartPortion = n; }
+ USHORT GetStartPortion() const { return mnStartPortion; }
+ USHORT& GetStartPortion() { return mnStartPortion; }
+
+ void SetEndPortion( USHORT n ) { mnEndPortion = n; }
+ USHORT GetEndPortion() const { return mnEndPortion; }
+ USHORT& GetEndPortion() { return mnEndPortion; }
+
+ USHORT GetLen() const { return mnEnd - mnStart; }
+
+ BOOL IsInvalid() const { return mbInvalid; }
+ BOOL IsValid() const { return !mbInvalid; }
+ void SetInvalid() { mbInvalid = TRUE; }
+ void SetValid() { mbInvalid = FALSE; }
+
+ BOOL IsEmpty() const { return (mnEnd > mnStart) ? FALSE : TRUE; }
+
+ short GetStartX() const { return mnStartX; }
+ void SetStartX( short n ) { mnStartX = n; }
+
+ inline BOOL operator == ( const TextLine& rLine ) const;
+ inline BOOL operator != ( const TextLine& rLine ) const;
+};
+
+typedef TextLine* TextLinePtr;
+SV_DECL_PTRARR_DEL( TextLines, TextLinePtr, 1, 4 );
+
+inline BOOL TextLine::operator == ( const TextLine& rLine ) const
+{
+ return ( ( mnStart == rLine.mnStart ) &&
+ ( mnEnd == rLine.mnEnd ) &&
+ ( mnStartPortion == rLine.mnStartPortion ) &&
+ ( mnEndPortion == rLine.mnEndPortion ) );
+}
+
+inline BOOL TextLine::operator != ( const TextLine& rLine ) const
+{
+ return !( *this == rLine );
+}
+
+
+
+class TEParaPortion
+{
+private:
+ TextNode* mpNode;
+
+ TextLines maLines;
+ TETextPortionList maTextPortions;
+
+ USHORT mnInvalidPosStart;
+ short mnInvalidDiff;
+
+ BOOL mbInvalid;
+ BOOL mbSimple; // nur lineares Tippen
+
+
+ TEParaPortion( const TEParaPortion& ) {;}
+
+public:
+ TEParaPortion( TextNode* pNode );
+ ~TEParaPortion();
+
+
+ BOOL IsInvalid() const { return mbInvalid; }
+ BOOL IsSimpleInvalid() const { return mbSimple; }
+ void SetNotSimpleInvalid() { mbSimple = FALSE; }
+ void SetValid() { mbInvalid = FALSE; mbSimple = TRUE;}
+
+ void MarkInvalid( USHORT nStart, short nDiff);
+ void MarkSelectionInvalid( USHORT nStart, USHORT nEnd );
+
+ USHORT GetInvalidPosStart() const { return mnInvalidPosStart; }
+ short GetInvalidDiff() const { return mnInvalidDiff; }
+
+ TextNode* GetNode() const { return mpNode; }
+ TextLines& GetLines() { return maLines; }
+ TETextPortionList& GetTextPortions() { return maTextPortions; }
+
+ USHORT GetLineNumber( USHORT nIndex, BOOL bInclEnd );
+ void CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine );
+};
+
+
+
+
+DECLARE_LIST( DummyTEParaPortionList, TEParaPortion* );
+
+class TEParaPortions : public DummyTEParaPortionList
+{
+public:
+ TEParaPortions();
+ ~TEParaPortions();
+
+ void Reset();
+// long GetYOffset( TEParaPortion* pPPortion );
+// USHORT FindParagraph( long nYOffset );
+};
+
+
+class TextSelFunctionSet: public FunctionSet
+{
+private:
+ TextView* mpView;
+
+public:
+ TextSelFunctionSet( TextView* pView );
+
+ virtual void BeginDrag();
+
+ virtual void CreateAnchor();
+
+ virtual BOOL SetCursorAtPoint( const Point& rPointPixel, BOOL bDontSelectAtCursor = FALSE );
+
+ virtual BOOL IsSelectionAtPoint( const Point& rPointPixel );
+ virtual void DeselectAll();
+
+ virtual void DeselectAtPoint( const Point& );
+ virtual void DestroyAnchor();
+};
+
+
+class IdleFormatter : public Timer
+{
+private:
+ TextView* mpView;
+ USHORT mnRestarts;
+
+public:
+ IdleFormatter();
+ ~IdleFormatter();
+
+ void DoIdleFormat( TextView* pV );
+ void ForceTimeout();
+ void ResetRestarts() { mnRestarts = 0; }
+ TextView* GetView() { return mpView; }
+};
+
+struct TextDDInfo
+{
+ Cursor maCursor;
+ TextPaM maDropPos;
+
+ BOOL mbStarterOfDD;
+ BOOL mbVisCursor;
+
+ TextDDInfo()
+ {
+ maCursor.SetStyle( CURSOR_SHADOW );
+ mbStarterOfDD = FALSE;
+ mbVisCursor = FALSE;
+ }
+};
+
+#endif // _TEXTDAT2_HXX
diff --git a/svtools/source/edit/textdata.cxx b/svtools/source/edit/textdata.cxx
new file mode 100644
index 000000000000..3b995edfbe50
--- /dev/null
+++ b/svtools/source/edit/textdata.cxx
@@ -0,0 +1,329 @@
+/*************************************************************************
+ *
+ * $RCSfile: textdata.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <textdata.hxx>
+#include <textdat2.hxx>
+
+#include <tools/debug.hxx>
+
+SV_IMPL_PTRARR( TextLines, TextLinePtr );
+
+
+ // -------------------------------------------------------------------------
+// (+) class TextSelection
+// -------------------------------------------------------------------------
+
+TextSelection::TextSelection()
+{
+}
+
+TextSelection::TextSelection( const TextPaM& rPaM ) :
+ maStartPaM( rPaM ), maEndPaM( rPaM )
+{
+}
+
+TextSelection::TextSelection( const TextPaM& rStart, const TextPaM& rEnd ) :
+ maStartPaM( rStart ), maEndPaM( rEnd )
+{
+}
+
+void TextSelection::Justify()
+{
+ if ( maEndPaM < maStartPaM )
+ {
+ TextPaM aTemp( maStartPaM );
+ maStartPaM = maEndPaM;
+ maEndPaM = aTemp;
+ }
+}
+
+
+ // -------------------------------------------------------------------------
+// (+) class TETextPortionList
+// -------------------------------------------------------------------------
+TETextPortionList::TETextPortionList()
+{
+}
+
+TETextPortionList::~TETextPortionList()
+{
+ Reset();
+}
+
+void TETextPortionList::Reset()
+{
+ for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ delete GetObject( nPortion );
+ Remove( 0, Count() );
+}
+
+void TETextPortionList::DeleteFromPortion( USHORT nDelFrom )
+{
+ DBG_ASSERT( ( nDelFrom < Count() ) || ( (nDelFrom == 0) && (Count() == 0) ), "DeleteFromPortion: Out of range" );
+ for ( USHORT nP = nDelFrom; nP < Count(); nP++ )
+ delete GetObject( nP );
+ Remove( nDelFrom, Count()-nDelFrom );
+}
+
+USHORT TETextPortionList::FindPortion( USHORT nCharPos, USHORT& nPortionStart )
+{
+ // Bei nCharPos an Portion-Grenze wird die linke Portion gefunden
+ USHORT nTmpPos = 0;
+ for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ {
+ TextPortion* pPortion = GetObject( nPortion );
+ nTmpPos += pPortion->GetLen();
+ if ( nTmpPos >= nCharPos )
+ {
+ nPortionStart = nTmpPos - pPortion->GetLen();
+ return nPortion;
+ }
+ }
+ DBG_ERROR( "FindPortion: Nicht gefunden!" );
+ return ( Count() - 1 );
+}
+
+ // -------------------------------------------------------------------------
+// (+) class TEParaPortion
+// -------------------------------------------------------------------------
+TEParaPortion::TEParaPortion( TextNode* pN )
+{
+ mpNode = pN;
+ mnInvalidPosStart = mnInvalidDiff = 0;
+ mbInvalid = TRUE;
+ mbSimple = FALSE;
+}
+
+TEParaPortion::~TEParaPortion()
+{
+}
+
+void TEParaPortion::MarkInvalid( USHORT nStart, short nDiff )
+{
+ if ( mbInvalid == FALSE )
+ {
+ mnInvalidPosStart = ( nDiff >= 0 ) ? nStart : ( nStart + nDiff );
+ mnInvalidDiff = nDiff;
+ }
+ else
+ {
+ // Einfaches hintereinander tippen
+ if ( ( nDiff > 0 ) && ( mnInvalidDiff > 0 ) &&
+ ( ( mnInvalidPosStart+mnInvalidDiff ) == nStart ) )
+ {
+ mnInvalidDiff += nDiff;
+ }
+ // Einfaches hintereinander loeschen
+ else if ( ( nDiff < 0 ) && ( mnInvalidDiff < 0 ) && ( mnInvalidPosStart == nStart ) )
+ {
+ mnInvalidPosStart += nDiff;
+ mnInvalidDiff += nDiff;
+ }
+ else
+ {
+ DBG_ASSERT( ( nDiff >= 0 ) || ( (nStart+nDiff) >= 0 ), "MarkInvalid: Diff out of Range" );
+ mnInvalidPosStart = Min( mnInvalidPosStart, (USHORT) ( (nDiff < 0) ? nStart+nDiff : nDiff ) );
+ mnInvalidDiff = 0;
+ mbSimple = FALSE;
+ }
+ }
+ mbInvalid = TRUE;
+}
+
+void TEParaPortion::MarkSelectionInvalid( USHORT nStart, USHORT nEnd )
+{
+ if ( mbInvalid == FALSE )
+ {
+ mnInvalidPosStart = nStart;
+// nInvalidPosEnd = nEnd;
+ }
+ else
+ {
+ mnInvalidPosStart = Min( mnInvalidPosStart, nStart );
+// nInvalidPosEnd = pNode->Len();
+ }
+ mnInvalidDiff = 0;
+ mbInvalid = TRUE;
+ mbSimple = FALSE;
+}
+
+USHORT TEParaPortion::GetLineNumber( USHORT nChar, BOOL bInclEnd )
+{
+ for ( USHORT nLine = 0; nLine < maLines.Count(); nLine++ )
+ {
+ TextLine* pLine = maLines.GetObject( nLine );
+ if ( ( bInclEnd && ( pLine->GetEnd() >= nChar ) ) ||
+ ( pLine->GetEnd() > nChar ) )
+ {
+ return nLine;
+ }
+ }
+
+ // Dann sollte es am Ende der letzten Zeile sein!
+ DBG_ASSERT( nChar == maLines[ maLines.Count() - 1 ]->GetEnd(), "Index voll daneben!" );
+ DBG_ASSERT( !bInclEnd, "Zeile nicht gefunden: FindLine" );
+ return ( maLines.Count() - 1 );
+}
+
+
+void TEParaPortion::CorrectValuesBehindLastFormattedLine( USHORT nLastFormattedLine )
+{
+ USHORT nLines = maLines.Count();
+ DBG_ASSERT( nLines, "CorrectPortionNumbersFromLine: Leere Portion?" );
+ if ( nLastFormattedLine < ( nLines - 1 ) )
+ {
+ const TextLine* pLastFormatted = maLines[ nLastFormattedLine ];
+ const TextLine* pUnformatted = maLines[ nLastFormattedLine+1 ];
+ short nPortionDiff = pUnformatted->GetStartPortion() - pLastFormatted->GetEndPortion();
+ short nTextDiff = pUnformatted->GetStart() - pLastFormatted->GetEnd();
+ nTextDiff++; // LastFormatted->GetEnd() war incl. => 1 zuviel abgezogen!
+
+ // Die erste unformatierte muss genau eine Portion hinter der letzten der
+ // formatierten beginnen:
+ // Wenn in der geaenderten Zeile eine Portion gesplittet wurde,
+ // kann nLastEnd > nNextStart sein!
+ short nPDiff = -( nPortionDiff-1 );
+ short nTDiff = -( nTextDiff-1 );
+ if ( nPDiff || nTDiff )
+ {
+ for ( USHORT nL = nLastFormattedLine+1; nL < nLines; nL++ )
+ {
+ TextLine* pLine = maLines[ nL ];
+
+ pLine->GetStartPortion() += nPDiff;
+ pLine->GetEndPortion() += nPDiff;
+
+ pLine->GetStart() += nTDiff;
+ pLine->GetEnd() += nTDiff;
+
+ pLine->SetValid();
+ }
+ }
+ }
+}
+
+ // -------------------------------------------------------------------------
+// (+) class TEParaPortions
+// -------------------------------------------------------------------------
+TEParaPortions::TEParaPortions()
+{
+}
+
+TEParaPortions::~TEParaPortions()
+{
+ Reset();
+}
+
+void TEParaPortions::Reset()
+{
+ for ( USHORT nPortion = 0; nPortion < Count(); nPortion++ )
+ delete GetObject( nPortion );
+ Clear();
+}
+
+ // -------------------------------------------------------------------------
+// (+) class IdleFormatter
+// -------------------------------------------------------------------------
+IdleFormatter::IdleFormatter()
+{
+ mpView = 0;
+ mnRestarts = 0;
+}
+
+IdleFormatter::~IdleFormatter()
+{
+ mpView = 0;
+}
+
+void IdleFormatter::DoIdleFormat( TextView* pV )
+{
+ mpView = pV;
+
+ if ( IsActive() )
+ mnRestarts++;
+
+ if ( mnRestarts > 4 )
+ ForceTimeout();
+ else
+ Start();
+}
+
+void IdleFormatter::ForceTimeout()
+{
+ if ( IsActive() )
+ {
+ Stop();
+ ((Link&)GetTimeoutHdl()).Call( this );
+ }
+}
+
+TYPEINIT1( TextHint, SfxSimpleHint );
+
+TextHint::TextHint( ULONG nId ) : SfxSimpleHint( nId )
+{
+ mnValue = 0;
+}
+
+TextHint::TextHint( ULONG nId, ULONG nValue ) : SfxSimpleHint( nId )
+{
+ mnValue = nValue;
+}
+
diff --git a/svtools/source/edit/textdoc.cxx b/svtools/source/edit/textdoc.cxx
new file mode 100644
index 000000000000..f9e651808011
--- /dev/null
+++ b/svtools/source/edit/textdoc.cxx
@@ -0,0 +1,1073 @@
+/*************************************************************************
+ *
+ * $RCSfile: textdoc.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <textdoc.hxx>
+
+#include <stdlib.h>
+
+SV_IMPL_PTRARR( TextCharAttribs, TextCharAttribPtr );
+
+
+
+// Vergleichmethode wird von QuickSort gerufen...
+
+EXTERN_C
+#if defined( PM2 ) && (!defined( CSET ) && !defined ( MTW ) && !defined( WTC ))
+int _stdcall
+#else
+#ifdef WNT
+#if _MSC_VER >= 1200
+int __cdecl
+#else
+int _cdecl
+#endif
+#else
+int
+#endif
+#endif
+
+CompareStart( const void* pFirst, const void* pSecond )
+{
+ if ( (*((TextCharAttrib**)pFirst))->GetStart() < (*((TextCharAttrib**)pSecond))->GetStart() )
+ return (-1);
+ else if ( (*((TextCharAttrib**)pFirst))->GetStart() > (*((TextCharAttrib**)pSecond))->GetStart() )
+ return (1);
+ return 0;
+}
+
+
+ // -------------------------------------------------------------------------
+// (+) class TextCharAttrib
+// -------------------------------------------------------------------------
+TextCharAttrib::TextCharAttrib( const TextAttrib& rAttr, USHORT nStart, USHORT nEnd )
+{
+ mpAttr = rAttr.Clone();
+ mnStart = nStart,
+ mnEnd = nEnd;
+}
+
+TextCharAttrib::TextCharAttrib( const TextCharAttrib& rTextCharAttrib )
+{
+ mpAttr = rTextCharAttrib.GetAttr().Clone();
+ mnStart = rTextCharAttrib.mnStart;
+ mnEnd = rTextCharAttrib.mnEnd;
+}
+
+TextCharAttrib::~TextCharAttrib()
+{
+ delete mpAttr;
+}
+
+ // -------------------------------------------------------------------------
+// (+) class TextCharAttribList
+// -------------------------------------------------------------------------
+
+TextCharAttribList::TextCharAttribList()
+{
+ mbHasEmptyAttribs = FALSE;
+}
+
+TextCharAttribList::~TextCharAttribList()
+{
+ // PTRARR_DEL
+}
+
+void TextCharAttribList::Clear( BOOL bDestroyAttribs )
+{
+ if ( bDestroyAttribs )
+ TextCharAttribs::DeleteAndDestroy( 0, Count() );
+ else
+ TextCharAttribs::Remove( 0, Count() );
+}
+
+
+void TextCharAttribList::InsertAttrib( TextCharAttrib* pAttrib )
+{
+ if ( pAttrib->IsEmpty() )
+ mbHasEmptyAttribs = TRUE;
+
+ const USHORT nCount = Count();
+ const USHORT nStart = pAttrib->GetStart(); // vielleicht besser fuer Comp.Opt.
+ BOOL bInserted = FALSE;
+ for ( USHORT x = 0; x < nCount; x++ )
+ {
+ TextCharAttrib* pCurAttrib = GetObject( x );
+ if ( pCurAttrib->GetStart() > nStart )
+ {
+ Insert( pAttrib, x );
+ bInserted = TRUE;
+ break;
+ }
+ }
+ if ( !bInserted )
+ Insert( pAttrib, nCount );
+}
+
+void TextCharAttribList::ResortAttribs()
+{
+ if ( Count() )
+ qsort( (void*)GetData(), Count(), sizeof( TextCharAttrib* ), CompareStart );
+}
+
+TextCharAttrib* TextCharAttribList::FindAttrib( USHORT nWhich, USHORT nPos )
+{
+ // Rueckwaerts, falls eins dort endet, das naechste startet.
+ // => Das startende gilt...
+
+ for ( USHORT nAttr = Count(); nAttr; )
+ {
+ TextCharAttrib* pAttr = GetObject( --nAttr );
+
+ if ( pAttr->GetEnd() < nPos )
+ return 0;
+
+ if ( ( pAttr->Which() == nWhich ) && pAttr->IsIn(nPos) )
+ return pAttr;
+ }
+ return NULL;
+}
+
+TextCharAttrib* TextCharAttribList::FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos ) const
+{
+ DBG_ASSERT( nWhich, "FindNextAttrib: Which?" );
+ const USHORT nAttribs = Count();
+ for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ {
+ TextCharAttrib* pAttr = GetObject( nAttr );
+ if ( ( pAttr->GetStart() >= nFromPos ) &&
+ ( pAttr->GetEnd() <= nMaxPos ) &&
+ ( pAttr->Which() == nWhich ) )
+ return pAttr;
+ }
+ return NULL;
+}
+
+BOOL TextCharAttribList::HasAttrib( USHORT nWhich ) const
+{
+ for ( USHORT nAttr = Count(); nAttr; )
+ {
+ const TextCharAttrib* pAttr = GetObject( --nAttr );
+ if ( pAttr->Which() == nWhich )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+BOOL TextCharAttribList::HasBoundingAttrib( USHORT nBound )
+{
+ // Rueckwaerts, falls eins dort endet, das naechste startet.
+ // => Das startende gilt...
+ for ( USHORT nAttr = Count(); nAttr; )
+ {
+ TextCharAttrib* pAttr = GetObject( --nAttr );
+
+ if ( pAttr->GetEnd() < nBound )
+ return FALSE;
+
+ if ( ( pAttr->GetStart() == nBound ) || ( pAttr->GetEnd() == nBound ) )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+TextCharAttrib* TextCharAttribList::FindEmptyAttrib( USHORT nWhich, USHORT nPos )
+{
+ if ( !mbHasEmptyAttribs )
+ return 0;
+
+ const USHORT nAttribs = Count();
+ for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ {
+ TextCharAttrib* pAttr = GetObject( nAttr );
+ if ( pAttr->GetStart() > nPos )
+ return 0;
+
+ if ( ( pAttr->GetStart() == nPos ) && ( pAttr->GetEnd() == nPos ) && ( pAttr->Which() == nWhich ) )
+ return pAttr;
+ }
+ return 0;
+}
+
+void TextCharAttribList::DeleteEmptyAttribs()
+{
+ for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ )
+ {
+ TextCharAttrib* pAttr = GetObject( nAttr );
+ if ( pAttr->IsEmpty() )
+ {
+ Remove( nAttr );
+ delete pAttr;
+ nAttr--;
+ }
+ }
+ mbHasEmptyAttribs = FALSE;
+}
+
+#ifdef DBG_UTIL
+BOOL TextCharAttribList::DbgCheckAttribs()
+{
+ BOOL bOK = TRUE;
+ for ( USHORT nAttr = 0; nAttr < Count(); nAttr++ )
+ {
+ TextCharAttrib* pAttr = GetObject( nAttr );
+ if ( pAttr->GetStart() > pAttr->GetEnd() )
+ {
+ bOK = FALSE;
+ DBG_ERROR( "Attr verdreht" );
+ }
+ }
+ return bOK;
+}
+#endif
+
+ // -------------------------------------------------------------------------
+// (+) class TextNode
+// -------------------------------------------------------------------------
+
+TextNode::TextNode( const String& rText ) :
+ maText( rText )
+{
+}
+
+void TextNode::ExpandAttribs( USHORT nIndex, USHORT nNew )
+{
+ if ( !nNew )
+ return;
+
+ BOOL bResort = FALSE;
+ USHORT nAttribs = maCharAttribs.Count();
+ for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ {
+ TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
+ if ( pAttrib->GetEnd() >= nIndex )
+ {
+ // Alle Attribute hinter der Einfuegeposition verschieben...
+ if ( pAttrib->GetStart() > nIndex )
+ {
+ pAttrib->MoveForward( nNew );
+ }
+ // 0: Leeres Attribut expandieren, wenn an Einfuegestelle
+ else if ( pAttrib->IsEmpty() )
+ {
+ // Index nicht pruefen, leeres durfte nur dort liegen.
+ // Wenn spaeter doch Ueberpruefung:
+ // Spezialfall: Start == 0; AbsLen == 1, nNew = 1 => Expand, weil durch Absatzumbruch!
+ // Start <= nIndex, End >= nIndex => Start=End=nIndex!
+// if ( pAttrib->GetStart() == nIndex )
+ pAttrib->Expand( nNew );
+ }
+ // 1: Attribut startet davor, geht bis Index...
+ else if ( pAttrib->GetEnd() == nIndex ) // Start muss davor liegen
+ {
+ // Nur expandieren, wenn kein Feature,
+ // und wenn nicht in ExcludeListe!
+ // Sonst geht z.B. ein UL bis zum neuen ULDB, beide expandieren
+ if ( !maCharAttribs.FindEmptyAttrib( pAttrib->Which(), nIndex ) )
+ {
+ pAttrib->Expand( nNew );
+ }
+ else
+ bResort = TRUE;
+ }
+ // 2: Attribut startet davor, geht hinter Index...
+ else if ( ( pAttrib->GetStart() < nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
+ {
+ pAttrib->Expand( nNew );
+ }
+ // 3: Attribut startet auf Index...
+ else if ( pAttrib->GetStart() == nIndex )
+ {
+ if ( nIndex == 0 )
+ {
+ pAttrib->Expand( nNew );
+// bResort = TRUE; // es gibt ja keine Features mehr...
+ }
+ else
+ pAttrib->MoveForward( nNew );
+ }
+ }
+
+ DBG_ASSERT( pAttrib->GetStart() <= pAttrib->GetEnd(), "Expand: Attribut verdreht!" );
+ DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len() ), "Expand: Attrib groesser als Absatz!" );
+ DBG_ASSERT( !pAttrib->IsEmpty(), "Leeres Attribut nach ExpandAttribs?" );
+ }
+
+ if ( bResort )
+ maCharAttribs.ResortAttribs();
+
+#ifdef EDITDEBUG
+ DBG_ASSERT( CheckOrderedList( (TextCharAttribs*)&maCharAttribs ), "Expand: Start-Liste verdreht" );
+#endif
+}
+
+void TextNode::CollapsAttribs( USHORT nIndex, USHORT nDeleted )
+{
+ if ( !nDeleted )
+ return;
+
+ BOOL bResort = FALSE;
+ USHORT nEndChanges = nIndex+nDeleted;
+
+ for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
+ {
+ TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
+ BOOL bDelAttr = FALSE;
+ if ( pAttrib->GetEnd() >= nIndex )
+ {
+ // Alles Attribute hinter der Einfuegeposition verschieben...
+ if ( pAttrib->GetStart() >= nEndChanges )
+ {
+ pAttrib->MoveBackward( nDeleted );
+ }
+ // 1. Innenliegende Attribute loeschen...
+ else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() <= nEndChanges ) )
+ {
+ // Spezialfall: Attrubt deckt genau den Bereich ab
+ // => als leeres Attribut behalten.
+ if ( ( pAttrib->GetStart() == nIndex ) && ( pAttrib->GetEnd() == nEndChanges ) )
+ pAttrib->GetEnd() = nIndex; // leer
+ else
+ bDelAttr = TRUE;
+ }
+ // 2. Attribut beginnt davor, endet drinnen oder dahinter...
+ else if ( ( pAttrib->GetStart() <= nIndex ) && ( pAttrib->GetEnd() > nIndex ) )
+ {
+ if ( pAttrib->GetEnd() <= nEndChanges ) // endet drinnen
+ pAttrib->GetEnd() = nIndex;
+ else
+ pAttrib->Collaps( nDeleted ); // endet dahinter
+ }
+ // 3. Attribut beginnt drinnen, endet dahinter...
+ else if ( ( pAttrib->GetStart() >= nIndex ) && ( pAttrib->GetEnd() > nEndChanges ) )
+ {
+ // Features duerfen nicht expandieren!
+ pAttrib->GetStart() = nEndChanges;
+ pAttrib->MoveBackward( nDeleted );
+ }
+ }
+
+ DBG_ASSERT( pAttrib->GetStart() <= pAttrib->GetEnd(), "Collaps: Attribut verdreht!" );
+ DBG_ASSERT( ( pAttrib->GetEnd() <= maText.Len()) || bDelAttr, "Collaps: Attrib groesser als Absatz!" );
+ if ( bDelAttr /* || pAttrib->IsEmpty() */ )
+ {
+ bResort = TRUE;
+ maCharAttribs.RemoveAttrib( nAttr );
+ delete pAttrib;
+ nAttr--;
+ }
+ else if ( pAttrib->IsEmpty() )
+ maCharAttribs.HasEmptyAttribs() = TRUE;
+ }
+
+ if ( bResort )
+ maCharAttribs.ResortAttribs();
+
+#ifdef EDITDEBUG
+ DBG_ASSERT( CheckOrderedList( (TextCharAttribs)&maCharAttribs ), "Collaps: Start-Liste verdreht" );
+#endif
+}
+
+void TextNode::InsertText( USHORT nPos, const String& rText )
+{
+ maText.Insert( rText, nPos );
+ ExpandAttribs( nPos, rText.Len() );
+}
+
+void TextNode::InsertText( USHORT nPos, sal_Unicode c )
+{
+ maText.Insert( c, nPos );
+ ExpandAttribs( nPos, 1 );
+}
+
+void TextNode::RemoveText( USHORT nPos, USHORT nChars )
+{
+ maText.Erase( nPos, nChars );
+ CollapsAttribs( nPos, nChars );
+}
+
+TextNode* TextNode::Split( USHORT nPos, BOOL bKeepEndingAttribs )
+{
+ String aNewText = maText.Copy( nPos );
+ maText.Erase( nPos );
+ TextNode* pNew = new TextNode( aNewText );
+
+ for ( USHORT nAttr = 0; nAttr < maCharAttribs.Count(); nAttr++ )
+ {
+ TextCharAttrib* pAttrib = maCharAttribs.GetAttrib( nAttr );
+ if ( pAttrib->GetEnd() < nPos )
+ {
+ // bleiben unveraendert....
+ ;
+ }
+ else if ( pAttrib->GetEnd() == nPos )
+ {
+ // muessen als leeres Attribut kopiert werden.
+ // !FindAttrib nur sinnvoll, wenn Rueckwaerts durch Liste!
+ if ( bKeepEndingAttribs && !pNew->maCharAttribs.FindAttrib( pAttrib->Which(), 0 ) )
+ {
+ TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib );
+ pNewAttrib->GetStart() = 0;
+ pNewAttrib->GetEnd() = 0;
+ pNew->maCharAttribs.InsertAttrib( pNewAttrib );
+ }
+ }
+ else if ( pAttrib->IsInside( nPos ) || ( !nPos && !pAttrib->GetStart() ) )
+ {
+ // Wenn ganz vorne gecuttet wird, muss das Attribut erhalten bleiben!
+ // muessen kopiert und geaendert werden
+ TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib );
+ pNewAttrib->GetStart() = 0;
+ pNewAttrib->GetEnd() = pAttrib->GetEnd()-nPos;
+ pNew->maCharAttribs.InsertAttrib( pNewAttrib );
+ // stutzen:
+ pAttrib->GetEnd() = nPos;
+ }
+ else
+ {
+ DBG_ASSERT( pAttrib->GetStart() >= nPos, "Start < nPos!" );
+ DBG_ASSERT( pAttrib->GetEnd() >= nPos, "End < nPos!" );
+ // alle dahinter verschieben in den neuen Node (this)
+ maCharAttribs.RemoveAttrib( nAttr );
+ pNew->maCharAttribs.InsertAttrib( pAttrib );
+ pAttrib->GetStart() -= nPos;
+ pAttrib->GetEnd() -= nPos;
+ nAttr--;
+ }
+ }
+ return pNew;
+}
+
+void TextNode::Append( const TextNode& rNode )
+{
+ USHORT nOldLen = maText.Len();
+
+ maText += rNode.GetText();
+
+#ifdef EDITDEBUG
+ DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute VOR AppendAttribs kaputt" );
+#endif
+
+ const USHORT nAttribs = rNode.GetCharAttribs().Count();
+ for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ {
+ TextCharAttrib* pAttrib = rNode.GetCharAttribs().GetAttrib( nAttr );
+ BOOL bMelted = FALSE;
+ if ( pAttrib->GetStart() == 0 )
+ {
+ // Evtl koennen Attribute zusammengefasst werden:
+ USHORT nTmpAttribs = maCharAttribs.Count();
+ for ( USHORT nTmpAttr = 0; nTmpAttr < nTmpAttribs; nTmpAttr++ )
+ {
+ TextCharAttrib* pTmpAttrib = maCharAttribs.GetAttrib( nTmpAttr );
+
+ if ( pTmpAttrib->GetEnd() == nOldLen )
+ {
+ if ( ( pTmpAttrib->Which() == pAttrib->Which() ) &&
+ ( pTmpAttrib->GetAttr() == pAttrib->GetAttr() ) )
+ {
+ pTmpAttrib->GetEnd() += pAttrib->GetLen();
+ bMelted = TRUE;
+ break; // es kann nur eins von der Sorte an der Stelle geben
+ }
+ }
+ }
+ }
+
+ if ( !bMelted )
+ {
+ TextCharAttrib* pNewAttrib = new TextCharAttrib( *pAttrib );
+ pNewAttrib->GetStart() += nOldLen;
+ pNewAttrib->GetEnd() += nOldLen;
+ maCharAttribs.InsertAttrib( pNewAttrib );
+ }
+ }
+
+#ifdef EDITDEBUG
+ DBG_ASSERT( maCharAttribs.DbgCheckAttribs(), "Attribute NACH AppendAttribs kaputt" );
+#endif
+}
+
+ // -------------------------------------------------------------------------
+// (+) class TextDoc
+// -------------------------------------------------------------------------
+
+TextDoc::TextDoc()
+{
+ mnLeftMargin = 0;
+};
+
+TextDoc::~TextDoc()
+{
+ DestroyTextNodes();
+}
+
+void TextDoc::Clear()
+{
+ DestroyTextNodes();
+}
+
+void TextDoc::DestroyTextNodes()
+{
+ for ( ULONG nNode = 0; nNode < maTextNodes.Count(); nNode++ )
+ delete maTextNodes.GetObject( nNode );
+ maTextNodes.Clear();
+}
+
+String TextDoc::GetText( const sal_Unicode* pSep ) const
+{
+ ULONG nLen = GetTextLen( pSep );
+ ULONG nNodes = maTextNodes.Count();
+
+ if ( nLen > STRING_MAXLEN )
+ {
+ DBG_ERROR( "Text zu gross fuer String" );
+ return String();
+ }
+
+ String aASCIIText;
+ ULONG nLastNode = nNodes-1;
+ for ( ULONG nNode = 0; nNode < nNodes; nNode++ )
+ {
+ TextNode* pNode = maTextNodes.GetObject( nNode );
+ String aTmp( pNode->GetText() );
+ aASCIIText += aTmp;
+ if ( pSep && ( nNode != nLastNode ) )
+ aASCIIText += pSep;
+ }
+
+ return aASCIIText;
+}
+
+XubString TextDoc::GetText( ULONG nPara ) const
+{
+ XubString aText;
+ TextNode* pNode = ( nPara < maTextNodes.Count() ) ? maTextNodes.GetObject( nPara ) : 0;
+ if ( pNode )
+ aText = pNode->GetText();
+
+ return aText;
+}
+
+
+ULONG TextDoc::GetTextLen( const xub_Unicode* pSep, const TextSelection* pSel ) const
+{
+ ULONG nLen = 0;
+ ULONG nNodes = maTextNodes.Count();
+ if ( nNodes )
+ {
+ ULONG nStartNode = 0;
+ ULONG nEndNode = nNodes-1;
+ if ( pSel )
+ {
+ nStartNode = pSel->GetStart().GetPara();
+ nEndNode = pSel->GetEnd().GetPara();
+ }
+
+ for ( ULONG nNode = nStartNode; nNode <= nEndNode; nNode++ )
+ {
+ TextNode* pNode = maTextNodes.GetObject( nNode );
+
+ USHORT nS = 0;
+ ULONG nE = pNode->GetText().Len();
+ if ( pSel && ( nNode == pSel->GetStart().GetPara() ) )
+ nS = pSel->GetStart().GetIndex();
+ if ( pSel && ( nNode == pSel->GetEnd().GetPara() ) )
+ nE = pSel->GetEnd().GetIndex();
+
+ nLen += ( nE - nS );
+ }
+
+ if ( pSep )
+ nLen += (nEndNode-nStartNode) * String( pSep ).Len();
+ }
+
+ return nLen;
+}
+
+TextPaM TextDoc::InsertText( const TextPaM& rPaM, xub_Unicode c )
+{
+ DBG_ASSERT( c != 0x0A, "TextDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" );
+ DBG_ASSERT( c != 0x0D, "TextDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" );
+
+ TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
+ pNode->InsertText( rPaM.GetIndex(), c );
+
+ TextPaM aPaM( rPaM.GetPara(), rPaM.GetIndex()+1 );
+ return aPaM;
+}
+
+TextPaM TextDoc::InsertText( const TextPaM& rPaM, const XubString& rStr )
+{
+ DBG_ASSERT( rStr.Search( 0x0A ) == STRING_NOTFOUND, "TextDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" );
+ DBG_ASSERT( rStr.Search( 0x0D ) == STRING_NOTFOUND, "TextDoc::InsertText: Zeilentrenner in Absatz nicht erlaubt!" );
+
+ TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
+ pNode->InsertText( rPaM.GetIndex(), rStr );
+
+ TextPaM aPaM( rPaM.GetPara(), rPaM.GetIndex()+rStr.Len() );
+ return aPaM;
+}
+
+TextPaM TextDoc::InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
+{
+ TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
+ TextNode* pNew = pNode->Split( rPaM.GetIndex(), bKeepEndingAttribs );
+
+ maTextNodes.Insert( pNew, rPaM.GetPara()+1 );
+
+ TextPaM aPaM( rPaM.GetPara()+1, 0 );
+ return aPaM;
+}
+
+TextPaM TextDoc::ConnectParagraphs( TextNode* pLeft, TextNode* pRight )
+{
+ USHORT nPrevLen = pLeft->GetText().Len();
+ pLeft->Append( *pRight );
+
+ // der rechte verschwindet.
+ ULONG nRight = maTextNodes.GetPos( pRight );
+ maTextNodes.Remove( nRight );
+ delete pRight;
+
+ ULONG nLeft = maTextNodes.GetPos( pLeft );
+ TextPaM aPaM( nLeft, nPrevLen );
+ return aPaM;
+}
+
+TextPaM TextDoc::RemoveChars( const TextPaM& rPaM, USHORT nChars )
+{
+ TextNode* pNode = maTextNodes.GetObject( rPaM.GetPara() );
+ pNode->RemoveText( rPaM.GetIndex(), nChars );
+
+ return rPaM;
+}
+
+BOOL TextDoc::IsValidPaM( const TextPaM& rPaM )
+{
+ if ( rPaM.GetPara() >= maTextNodes.Count() )
+ {
+ DBG_ERROR( "PaM: Para out of range" );
+ return FALSE;
+ }
+ TextNode * pNode = maTextNodes.GetObject( rPaM.GetPara() );
+ if ( rPaM.GetIndex() > pNode->GetText().Len() )
+ {
+ DBG_ERROR( "PaM: Index out of range" );
+ return FALSE;
+ }
+ return TRUE;
+}
+
+/*
+
+void TextDoc::InsertAttribInSelection( TextNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem )
+{
+ DBG_ASSERT( pNode, "Wohin mit dem Attribut?" );
+ DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" );
+
+ // fuer Optimierung:
+ // dieses endet am Anfang der Selektion => kann erweitert werden
+ TextCharAttrib* pEndingAttrib = 0;
+ // dieses startet am Ende der Selektion => kann erweitert werden
+ TextCharAttrib* pStartingAttrib = 0;
+
+ DBG_ASSERT( nStart <= nEnd, "Kleiner Rechenfehler in InsertAttribInSelection" );
+
+ RemoveAttribs( pNode, nStart, nEnd, pStartingAttrib, pEndingAttrib, rPoolItem.Which() );
+
+ if ( pStartingAttrib && pEndingAttrib &&
+ ( *(pStartingAttrib->GetItem()) == rPoolItem ) &&
+ ( *(pEndingAttrib->GetItem()) == rPoolItem ) )
+ {
+ // wird ein groesses Attribut.
+ pEndingAttrib->GetEnd() = pStartingAttrib->GetEnd();
+ pCurPool->Remove( *(pStartingAttrib->GetItem()) );
+ pNode->GetCharAttribs().GetAttribs().Remove( pNode->GetCharAttribs().GetAttribs().GetPos( pStartingAttrib ) );
+ delete pStartingAttrib;
+ }
+ else if ( pStartingAttrib && ( *(pStartingAttrib->GetItem()) == rPoolItem ) )
+ pStartingAttrib->GetStart() = nStart;
+ else if ( pEndingAttrib && ( *(pEndingAttrib->GetItem()) == rPoolItem ) )
+ pEndingAttrib->GetEnd() = nEnd;
+ else
+ InsertAttrib( rPoolItem, pNode, nStart, nEnd );
+
+ if ( pStartingAttrib )
+ pNode->GetCharAttribs().ResortAttribs();
+}
+
+BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, USHORT nWhich )
+{
+ TextCharAttrib* pStarting;
+ TextCharAttrib* pEnding;
+ return RemoveAttribs( pNode, nStart, nEnd, pStarting, pEnding, nWhich );
+}
+
+BOOL TextDoc::RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich )
+{
+ DBG_ASSERT( pNode, "Wohin mit dem Attribut?" );
+ DBG_ASSERT( nEnd <= pNode->Len(), "InsertAttrib: Attribut zu gross!" );
+
+ // dieses endet am Anfang der Selektion => kann erweitert werden
+ rpEnding = 0;
+ // dieses startet am Ende der Selektion => kann erweitert werden
+ rpStarting = 0;
+
+ BOOL bChanged = FALSE;
+
+ DBG_ASSERT( nStart <= nEnd, "Kleiner Rechenfehler in InsertAttribInSelection" );
+
+ // ueber die Attribute iterieren...
+ USHORT nAttr = 0;
+ TextCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr );
+ while ( pAttr )
+ {
+ BOOL bRemoveAttrib = FALSE;
+ if ( !nWhich || ( pAttr->Which() == nWhich ) )
+ {
+ // Attribut beginnt in Selection
+ if ( ( pAttr->GetStart() >= nStart ) && ( pAttr->GetStart() <= nEnd ) )
+ {
+ bChanged = TRUE;
+ if ( pAttr->GetEnd() > nEnd )
+ {
+ pAttr->GetStart() = nEnd; // dann faengt es dahinter an
+ rpStarting = pAttr;
+ break; // es kann kein weiteres Attrib hier liegen
+ }
+ else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) )
+ {
+ // Feature nur loeschen, wenn genau an der Stelle
+ bRemoveAttrib = TRUE;
+ }
+ }
+
+ // Attribut endet in Selection
+ else if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetEnd() <= nEnd ) )
+ {
+ bChanged = TRUE;
+ if ( ( pAttr->GetStart() < nStart ) && !pAttr->IsFeature() )
+ {
+ pAttr->GetEnd() = nStart; // dann hoert es hier auf
+ rpEnding = pAttr;
+ }
+ else if ( !pAttr->IsFeature() || ( pAttr->GetStart() == nStart ) )
+ {
+ // Feature nur loeschen, wenn genau an der Stelle
+ bRemoveAttrib = TRUE;
+ }
+ }
+ // Attribut ueberlappt die Selektion
+ else if ( ( pAttr->GetStart() <= nStart ) && ( pAttr->GetEnd() >= nEnd ) )
+ {
+ bChanged = TRUE;
+ if ( pAttr->GetStart() == nStart )
+ {
+ pAttr->GetStart() = nEnd;
+ rpStarting = pAttr;
+ break; // es kann weitere Attribute geben!
+ }
+ else if ( pAttr->GetEnd() == nEnd )
+ {
+ pAttr->GetEnd() = nStart;
+ rpEnding = pAttr;
+ break; // es kann weitere Attribute geben!
+ }
+ else // Attribut muss gesplittet werden...
+ {
+ USHORT nOldEnd = pAttr->GetEnd();
+ pAttr->GetEnd() = nStart;
+ rpEnding = pAttr;
+// ULONG nSavePos = pNode->GetCharAttribs().GetStartList().GetCurPos();
+ InsertAttrib( *pAttr->GetItem(), pNode, nEnd, nOldEnd );
+// pNode->GetCharAttribs().GetStartList().Seek( nSavePos );
+ break; // es kann weitere Attribute geben!
+ }
+ }
+ }
+ if ( bRemoveAttrib )
+ {
+ DBG_ASSERT( ( pAttr != rpStarting ) && ( pAttr != rpEnding ), "Loeschen und behalten des gleichen Attributs ?" );
+ pNode->GetCharAttribs().GetAttribs().Remove(nAttr);
+ pCurPool->Remove( *pAttr->GetItem() );
+ delete pAttr;
+ nAttr--;
+ }
+ nAttr++;
+ pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr );
+ }
+ return bChanged;
+}
+
+#pragma SEG_FUNCDEF(editdoc_3f)
+
+void TextDoc::InsertAttrib( const SfxPoolItem& rPoolItem, TextNode* pNode, USHORT nStart, USHORT nEnd )
+{
+ // Diese Methode prueft nicht mehr, ob ein entspr. Attribut
+ // schon an der Stelle existiert!
+
+ // pruefen, ob neues Attrib oder einfach nur Ende eines Attribs...
+// const SfxPoolItem& rDefItem = pNode->GetContentAttribs().GetItem( rPoolItem.Which() );
+// BOOL bCreateAttrib = ( rDefItem != rPoolItem );
+
+ // Durch den Verlust der Exclude-Liste geht es nicht mehr, dass ich
+ // kein neues Attribut benoetige und nur das alte nicht expandiere...
+// if ( !bCreateAttrib )
+ {
+ // => Wenn schon Default-Item, dann wenigstens nur dann einstellen,
+ // wenn davor wirklich ein entsprechendes Attribut.
+// if ( pNode->GetCharAttribs().FindAttrib( rPoolItem.Which(), nStart ) )
+// bCreateAttrib = TRUE;
+ // Aber kleiner Trost:
+ // Die wenigsten schreiben, aendern das Attr, schreiben, und
+ // stellen dann wieder das Default-Attr ein.
+ }
+
+ // 22.9.95:
+ // Die Uberlegung, einfach das andere Attribut nicht zu expandieren, war
+ // sowieso falsch, da das DefAttr aus einer Vorlage kommen kann,
+ // die irgendwann verschwindet!
+// if ( bCreateAttrib )
+// {
+ TextCharAttrib* pAttrib = MakeCharAttrib( *pCurPool, rPoolItem, nStart, nEnd );
+ DBG_ASSERT( pAttrib, "MakeCharAttrib fehlgeschlagen!" );
+ pNode->GetCharAttribs().InsertAttrib( pAttrib );
+// }
+// else
+// {
+// TextCharAttrib* pTmpAttrib =
+// pNode->GetCharAttribs().FindAnyAttrib( rPoolItem.Which() );
+// if ( pTmpAttrib ) // sonst benoetige ich es sowieso nicht....
+// {
+// aExcludeList.Insert( pTmpAttrib->GetItem() );
+// }
+// }
+}
+
+#pragma SEG_FUNCDEF(editdoc_40)
+
+void TextDoc::InsertAttrib( TextNode* pNode, USHORT nStart, USHORT nEnd, const SfxPoolItem& rPoolItem )
+{
+ if ( nStart != nEnd )
+ {
+ InsertAttribInSelection( pNode, nStart, nEnd, rPoolItem );
+ }
+ else
+ {
+ // Pruefen, ob schon ein neues Attribut mit der WhichId an der Stelle:
+ TextCharAttrib* pAttr = pNode->GetCharAttribs().FindEmptyAttrib( rPoolItem.Which(), nStart );
+ if ( pAttr )
+ {
+ // Attribut entfernen....
+ pNode->GetCharAttribs().GetAttribs().Remove(
+ pNode->GetCharAttribs().GetAttribs().GetPos( pAttr ) );
+ }
+
+ // pruefen, ob ein 'gleiches' Attribut an der Stelle liegt.
+ pAttr = pNode->GetCharAttribs().FindAttrib( rPoolItem.Which(), nStart );
+ if ( pAttr )
+ {
+ if ( pAttr->IsInside( nStart ) ) // splitten
+ {
+ // ???????????????????????????????
+ // eigentlich noch pruefen, ob wirklich splittet, oder return !
+ // ???????????????????????????????
+ USHORT nOldEnd = pAttr->GetEnd();
+ pAttr->GetEnd() = nStart;
+ pAttr = MakeCharAttrib( *pCurPool, *(pAttr->GetItem()), nStart, nOldEnd );
+ pNode->GetCharAttribs().InsertAttrib( pAttr );
+ }
+ else if ( pAttr->GetEnd() == nStart )
+ {
+ DBG_ASSERT( !pAttr->IsEmpty(), "Doch noch ein leeres Attribut?" );
+ // pruefen, ob genau das gleiche Attribut
+ if ( *(pAttr->GetItem()) == rPoolItem )
+ return;
+ }
+ }
+ InsertAttrib( rPoolItem, pNode, nStart, nStart );
+ }
+}
+
+#pragma SEG_FUNCDEF(editdoc_41)
+
+void TextDoc::FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet )
+{
+ DBG_ASSERT( pNode, "Wo soll ich suchen ?" );
+ DBG_ASSERT( nStartPos <= nEndPos, "Ungueltiger Bereich!" );
+
+ USHORT nAttr = 0;
+ TextCharAttrib* pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr );
+ // keine Selection...
+ if ( nStartPos == nEndPos )
+ {
+ while ( pAttr && ( pAttr->GetStart() <= nEndPos) )
+ {
+ const SfxPoolItem* pItem = 0;
+ // Attribut liegt dadrueber...
+ if ( ( pAttr->GetStart() < nStartPos ) && ( pAttr->GetEnd() > nStartPos ) )
+ pItem = pAttr->GetItem();
+ // Attribut endet hier, ist nicht leer
+ else if ( ( pAttr->GetStart() < nStartPos ) && ( pAttr->GetEnd() == nStartPos ) )
+ {
+ if ( !pNode->GetCharAttribs().FindEmptyAttrib( pAttr->GetItem()->Which(), nStartPos ) )
+ pItem = pAttr->GetItem();
+ }
+ // Attribut endet hier, ist leer
+ else if ( ( pAttr->GetStart() == nStartPos ) && ( pAttr->GetEnd() == nStartPos ) )
+ {
+// if ( aExcludeList.FindAttrib( pAttr->GetItem()->Which() ) )
+ pItem = pAttr->GetItem();
+// else if ( pNode->Len() == 0 ) // Sonderfall
+// pItem = pAttr->GetItem();
+ }
+ // Attribut beginnt hier
+ else if ( ( pAttr->GetStart() == nStartPos ) && ( pAttr->GetEnd() > nStartPos ) )
+ {
+ if ( nStartPos == 0 ) // Sonderfall
+ pItem = pAttr->GetItem();
+ }
+
+ if ( pItem )
+ {
+ USHORT nWhich = pItem->Which();
+ if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF )
+ {
+ rCurSet.Put( *pItem );
+ }
+ else if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_ON )
+ {
+ const SfxPoolItem& rItem = rCurSet.Get( nWhich );
+ if ( rItem != *pItem )
+ {
+ rCurSet.InvalidateItem( nWhich );
+ }
+ }
+ }
+ nAttr++;
+ pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr );
+ }
+ }
+ else // Selektion
+ {
+ while ( pAttr && ( pAttr->GetStart() < nEndPos) )
+ {
+ const SfxPoolItem* pItem = 0;
+ // Attribut liegt dadrueber...
+ if ( ( pAttr->GetStart() <= nStartPos ) && ( pAttr->GetEnd() >= nEndPos ) )
+ pItem = pAttr->GetItem();
+ // Attribut startet mitten drin...
+ else if ( pAttr->GetStart() >= nStartPos )
+ {
+ // !!! pItem = pAttr->GetItem();
+ // einfach nur pItem reicht nicht, da ich z.B. bei Shadow
+ // niemals ein ungleiches Item finden wuerde, da ein solche
+ // seine Anwesenheit durch Abwesenheit repraesentiert!
+ // if ( ... )
+ // Es muesste geprueft werden, on genau das gleiche Attribut
+ // an der Bruchstelle aufsetzt, was recht aufwendig ist.
+ // Da ich beim Einfuegen von Attributen aber etwas optimiere
+ // tritt der Fall nicht so schnell auf...
+ // Also aus Geschwindigkeitsgruenden:
+ rCurSet.InvalidateItem( pAttr->GetItem()->Which() );
+
+ }
+ // Attribut endet mitten drin...
+ else if ( pAttr->GetEnd() > nStartPos )
+ {
+ // pItem = pAttr->GetItem();
+ // s.o.
+
+ // -----------------31.05.95 16:01-------------------
+ // Ist falsch, wenn das gleiche Attribut sofort wieder
+ // eingestellt wird!
+ // => Sollte am besten nicht vorkommen, also gleich beim
+ // Setzen von Attributen richtig machen!
+ // --------------------------------------------------
+ rCurSet.InvalidateItem( pAttr->GetItem()->Which() );
+ }
+
+ if ( pItem )
+ {
+ USHORT nWhich = pItem->Which();
+ if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_OFF )
+ {
+ rCurSet.Put( *pItem );
+ }
+ else if ( rCurSet.GetItemState( nWhich ) == SFX_ITEM_ON )
+ {
+ const SfxPoolItem& rItem = rCurSet.Get( nWhich );
+ if ( rItem != *pItem )
+ {
+ rCurSet.InvalidateItem( nWhich );
+ }
+ }
+ }
+ nAttr++;
+ pAttr = GetAttrib( pNode->GetCharAttribs().GetAttribs(), nAttr );
+ }
+ }
+}
+
+
+*/
+
+
diff --git a/svtools/source/edit/textdoc.hxx b/svtools/source/edit/textdoc.hxx
new file mode 100644
index 000000000000..9659ccce438a
--- /dev/null
+++ b/svtools/source/edit/textdoc.hxx
@@ -0,0 +1,202 @@
+/*************************************************************************
+ *
+ * $RCSfile: textdoc.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _TEXTDOC_HXX
+#define _TEXTDOC_HXX
+
+#ifndef _SVARRAY_HXX
+#include <svarray.hxx>
+#endif
+
+#ifndef _TEXTDATA_HXX
+#include <textdata.hxx>
+#endif
+
+#ifndef _TXTATTR_HXX
+#include <txtattr.hxx>
+#endif
+
+#include <tools/debug.hxx>
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+#ifndef _LIST_HXX //autogen
+#include <tools/list.hxx>
+#endif
+
+
+typedef TextCharAttrib* TextCharAttribPtr;
+SV_DECL_PTRARR_DEL( TextCharAttribs, TextCharAttribPtr, 0, 4 );
+
+class TextCharAttribList : private TextCharAttribs
+{
+private:
+ BOOL mbHasEmptyAttribs;
+
+ TextCharAttribList( const TextCharAttribList& ) {;}
+
+public:
+ TextCharAttribList();
+ ~TextCharAttribList();
+
+ void Clear( BOOL bDestroyAttribs );
+ USHORT Count() const { return TextCharAttribs::Count(); }
+
+ TextCharAttrib* GetAttrib( USHORT n ) const { return TextCharAttribs::GetObject( n ); }
+ void RemoveAttrib( USHORT n ) { TextCharAttribs::Remove( n, 1 ); }
+
+ void InsertAttrib( TextCharAttrib* pAttrib );
+
+ void DeleteEmptyAttribs();
+ void ResortAttribs();
+
+ BOOL HasEmptyAttribs() const { return mbHasEmptyAttribs; }
+ BOOL& HasEmptyAttribs() { return mbHasEmptyAttribs; }
+
+ TextCharAttrib* FindAttrib( USHORT nWhich, USHORT nPos );
+ TextCharAttrib* FindNextAttrib( USHORT nWhich, USHORT nFromPos, USHORT nMaxPos = 0xFFFF ) const;
+ TextCharAttrib* FindEmptyAttrib( USHORT nWhich, USHORT nPos );
+ BOOL HasAttrib( USHORT nWhich ) const;
+ BOOL HasBoundingAttrib( USHORT nBound );
+
+#ifdef DBG_UTIL
+ BOOL DbgCheckAttribs();
+#endif
+};
+
+
+class TextNode
+{
+private:
+ String maText;
+ TextCharAttribList maCharAttribs;
+
+ TextNode( const TextNode& ) {;}
+protected:
+ void ExpandAttribs( USHORT nIndex, USHORT nNewChars );
+ void CollapsAttribs( USHORT nIndex, USHORT nDelChars );
+
+public:
+ TextNode( const String& rText );
+
+
+ const String& GetText() const { return maText; }
+// String& GetText() { return maText; }
+
+ const TextCharAttribList& GetCharAttribs() const { return maCharAttribs; }
+ TextCharAttribList& GetCharAttribs() { return maCharAttribs; }
+
+ void InsertText( USHORT nPos, const String& rText );
+ void InsertText( USHORT nPos, sal_Unicode c );
+ void RemoveText( USHORT nPos, USHORT nChars );
+
+ TextNode* Split( USHORT nPos, BOOL bKeepEndigAttribs );
+ void Append( const TextNode& rNode );
+};
+
+
+
+DECLARE_LIST( TextNodeList, TextNode* );
+
+class TextDoc
+{
+private:
+ TextNodeList maTextNodes;
+ USHORT mnLeftMargin;
+
+protected:
+ void DestroyTextNodes();
+
+public:
+ TextDoc();
+ ~TextDoc();
+
+ void Clear();
+
+ TextNodeList& GetNodes() { return maTextNodes; }
+ const TextNodeList& GetNodes() const { return maTextNodes; }
+
+ TextPaM RemoveChars( const TextPaM& rPaM, USHORT nChars );
+ TextPaM InsertText( const TextPaM& rPaM, sal_Unicode c );
+ TextPaM InsertText( const TextPaM& rPaM, const String& rStr );
+
+ TextPaM InsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs );
+ TextPaM ConnectParagraphs( TextNode* pLeft, TextNode* pRight );
+
+ ULONG GetTextLen( const sal_Unicode* pSep, const TextSelection* pSel = NULL ) const;
+ String GetText( const sal_Unicode* pSep ) const;
+ String GetText( ULONG nPara ) const;
+
+ void SetLeftMargin( USHORT n ) { mnLeftMargin = n; }
+ USHORT GetLeftMargin() const { return mnLeftMargin; }
+
+// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd ), USHORT nWhich = 0 );
+// BOOL RemoveAttribs( TextNode* pNode, USHORT nStart, USHORT nEnd, TextCharAttrib*& rpStarting, TextCharAttrib*& rpEnding, USHORT nWhich = 0 );
+// void InsertAttrib( const EditCharAttrib* pAttr );
+// void InsertAttribInSelection( const EditCharAttrib* pAttr );
+// void FindAttribs( TextNode* pNode, USHORT nStartPos, USHORT nEndPos, SfxItemSet& rCurSet );
+
+ BOOL IsValidPaM( const TextPaM& rPaM );
+};
+
+#endif // _TEXTDOC_HXX
diff --git a/svtools/source/edit/texteng.cxx b/svtools/source/edit/texteng.cxx
new file mode 100644
index 000000000000..1443fc3e72ed
--- /dev/null
+++ b/svtools/source/edit/texteng.cxx
@@ -0,0 +1,2691 @@
+/*************************************************************************
+ *
+ * $RCSfile: texteng.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#include <texteng.hxx>
+#include <textview.hxx>
+#include <textdoc.hxx>
+#include <textdat2.hxx>
+#include <textundo.hxx>
+#include <textund2.hxx>
+
+#include <tools/isolang.hxx>
+
+#ifndef _SV_WINDOW_HXX //autogen
+#include <vcl/window.hxx>
+#endif
+
+#include <vcl/edit.hxx>
+
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_TEXT_XBREAKITERATOR_HPP_
+#include <com/sun/star/text/XBreakIterator.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_TEXT_CHARACTERITERATORMODE_HPP_
+#include <com/sun/star/text/CharacterIteratorMode.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_TEXT_WORDTYPE_HPP_
+#include <com/sun/star/text/WordType.hpp>
+#endif
+
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
+#include <unotools/processfactory.hxx>
+#endif
+
+#include <vcl/unohelp.hxx>
+
+using namespace ::com::sun::star;
+
+typedef TextView* TextViewPtr;
+SV_DECL_PTRARR( TextViews, TextViewPtr, 0, 1 );
+// SV_IMPL_PTRARR( TextViews, TextViewPtr );
+
+SV_DECL_VARARR_SORT( TESortedPositions, ULONG, 16, 8 );
+SV_IMPL_VARARR_SORT( TESortedPositions, ULONG );
+
+#define RESDIFF 10
+#define SCRLRANGE 20 // 1/20 der Breite/Hoehe scrollen, wenn im QueryDrop
+
+
+ // -------------------------------------------------------------------------
+// (-) class TextEngine
+// -------------------------------------------------------------------------
+TextEngine::TextEngine() : maWordDelimiters( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( " .=+-*/()[]<>{};,:\"\t" ) ) )
+{
+ mpDoc = 0;
+ mpTEParaPortions = 0;
+
+ mpViews = new TextViews;
+ mpActiveView = NULL;
+
+ mbIsFormatting = FALSE;
+ mbFormatted = FALSE;
+ mbUpdate = TRUE;
+ mbModified = FALSE;
+ mbUndoEnabled = FALSE;
+ mbIsInUndo = FALSE;
+ mbDowning = FALSE;
+
+ meAlign = TXTALIGN_LEFT;
+
+ mnMaxTextWidth = 0;
+ mnMaxTextLen = 0;
+ mnCurTextHeight = 0;
+
+ mpUndoManager = 0;
+
+ mpIdleFormatter = new IdleFormatter;
+
+ mpRefDev = new VirtualDevice;
+
+ ImpInitDoc();
+
+ Font aFont;
+ aFont.SetTransparent( FALSE );
+ Color aFillColor( aFont.GetFillColor() );
+ aFillColor.SetTransparency( 0 );
+ aFont.SetFillColor( aFillColor );
+ SetFont( aFont );
+}
+
+TextEngine::~TextEngine()
+{
+ mbDowning = TRUE;
+
+ delete mpIdleFormatter;
+ delete mpDoc;
+ delete mpTEParaPortions;
+ delete mpViews; // nur die Liste, nicht die Vies
+ delete mpRefDev;
+ delete mpUndoManager;
+}
+
+void TextEngine::InsertView( TextView* pTextView )
+{
+ mpViews->Insert( pTextView, mpViews->Count() );
+ pTextView->SetSelection( TextSelection() );
+
+ if ( !GetActiveView() )
+ SetActiveView( pTextView );
+}
+
+void TextEngine::RemoveView( TextView* pTextView )
+{
+ USHORT nPos = mpViews->GetPos( pTextView );
+ if( nPos != USHRT_MAX )
+ {
+ pTextView->HideCursor();
+ mpViews->Remove( nPos, 1 );
+ if ( pTextView == GetActiveView() )
+ SetActiveView( 0 );
+ }
+}
+
+USHORT TextEngine::GetViewCount() const
+{
+ return mpViews->Count();
+}
+
+TextView* TextEngine::GetView( USHORT nView ) const
+{
+ return mpViews->GetObject( nView );
+}
+
+TextView* TextEngine::GetActiveView() const
+{
+ return mpActiveView;
+}
+
+void TextEngine::SetActiveView( TextView* pTextView )
+{
+ if ( pTextView != mpActiveView )
+ {
+ if ( mpActiveView )
+ mpActiveView->HideSelection();
+
+ mpActiveView = pTextView;
+
+ if ( mpActiveView )
+ mpActiveView->ShowSelection();
+ }
+}
+
+void TextEngine::SetFont( const Font& rFont )
+{
+ if ( rFont != maFont )
+ {
+ maFont = rFont;
+
+ // Wegen Selektion keinen Transparenten Font zulassen...
+ // (Sonst spaeter in ImplPaint den Hintergrund anders loeschen...)
+ maFont.SetTransparent( FALSE );
+ Color aFillColor( maFont.GetFillColor() );
+ aFillColor.SetTransparency( 0 );
+ maFont.SetFillColor( aFillColor );
+
+ maFont.SetAlign( ALIGN_TOP );
+ mpRefDev->SetFont( maFont );
+ Size aTextSize;
+ aTextSize.Width() = mpRefDev->GetTextWidth( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( " " ) ) );
+ aTextSize.Height() = mpRefDev->GetTextHeight();
+ if ( !aTextSize.Width() )
+ aTextSize.Width() = mpRefDev->GetTextWidth( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "XXXX" ) ) );
+
+ mnDefTab = (USHORT)aTextSize.Width();
+ if ( !mnDefTab )
+ mnDefTab = 1;
+ mnCharHeight = (USHORT)aTextSize.Height();
+ if ( rFont.GetPitch() == PITCH_FIXED )
+ {
+ String aX100;
+ aX100.Fill( 100, 'X' );
+ mnFixCharWidth100 = (USHORT)mpRefDev->GetTextWidth( aX100 );
+ }
+ else
+ mnFixCharWidth100 = 0;
+
+ FormatFullDoc();
+ }
+}
+
+void TextEngine::SetDefTab( USHORT nDefTab )
+{
+ mnDefTab = nDefTab;
+ // evtl neu setzen?
+}
+
+void TextEngine::SetMaxTextLen( ULONG nLen )
+{
+ mnMaxTextLen = nLen;
+}
+
+void TextEngine::SetMaxTextWidth( ULONG nMaxWidth )
+{
+ if ( nMaxWidth != mnMaxTextWidth )
+ {
+ mnMaxTextWidth = Min( nMaxWidth, (ULONG)0x7FFFFFFF );
+ FormatFullDoc();
+ UpdateViews();
+ }
+}
+
+static sal_Unicode static_aLFText[] = { '\n', 0 };
+static sal_Unicode static_aCRText[] = { '\r', 0 };
+static sal_Unicode static_aCRLFText[] = { '\r', '\n', 0 };
+
+static inline const sal_Unicode* static_getLineEndText( LineEnd aLineEnd )
+{
+ const sal_Unicode* pRet = NULL;
+
+ switch( aLineEnd )
+ {
+ case LINEEND_LF: pRet = static_aLFText;break;
+ case LINEEND_CR: pRet = static_aCRText;break;
+ case LINEEND_CRLF: pRet = static_aCRLFText;break;
+ }
+ return pRet;
+}
+
+String TextEngine::GetText( LineEnd aSeparator ) const
+{
+ return mpDoc->GetText( static_getLineEndText( aSeparator ) );
+}
+
+String TextEngine::GetTextLines( LineEnd aSeparator ) const
+{
+ String aText;
+ ULONG nParas = mpTEParaPortions->Count();
+ const sal_Unicode* pSep = static_getLineEndText( aSeparator );
+ for ( ULONG nP = 0; nP < nParas; nP++ )
+ {
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nP );
+
+ USHORT nLines = pTEParaPortion->GetLines().Count();
+ for ( USHORT nL = 0; nL < nLines; nL++ )
+ {
+ TextLine* pLine = pTEParaPortion->GetLines()[nL];
+ aText += pTEParaPortion->GetNode()->GetText().Copy( pLine->GetStart(), pLine->GetEnd() - pLine->GetStart() );
+ if ( pSep && ( ( (nP+1) < nParas ) || ( (nL+1) < nLines ) ) )
+ aText += pSep;
+ }
+ }
+ return aText;
+}
+
+String TextEngine::GetText( ULONG nPara ) const
+{
+ return mpDoc->GetText( nPara );
+}
+
+ULONG TextEngine::GetTextLen( LineEnd aSeparator ) const
+{
+ return mpDoc->GetTextLen( static_getLineEndText( aSeparator ) );
+}
+
+ULONG TextEngine::GetTextLen( const TextSelection& rSel, LineEnd aSeparator ) const
+{
+ TextSelection aSel( rSel );
+ aSel.Justify();
+ ValidateSelection( aSel );
+ return mpDoc->GetTextLen( static_getLineEndText( aSeparator ), &aSel );
+}
+
+USHORT TextEngine::GetTextLen( ULONG nPara ) const
+{
+ return mpDoc->GetNodes().GetObject( nPara )->GetText().Len();
+}
+
+void TextEngine::SetUpdateMode( BOOL bUpdate )
+{
+ if ( bUpdate != mbUpdate )
+ {
+ mbUpdate = bUpdate;
+ if ( mbUpdate )
+ {
+ FormatAndUpdate( GetActiveView() );
+ if ( GetActiveView() )
+ GetActiveView()->ShowCursor();
+ }
+ }
+}
+
+void TextEngine::SetWordDelimiters( const String& rDelimiters )
+{
+ maWordDelimiters = rDelimiters;
+ if ( maWordDelimiters.Search( ' ' ) == STRING_NOTFOUND )
+ maWordDelimiters += ' ';
+ if ( maWordDelimiters.Search( '\t' ) == STRING_NOTFOUND )
+ maWordDelimiters += '\t';
+}
+
+BOOL TextEngine::DoesKeyMoveCursor( const KeyEvent& rKeyEvent )
+{
+ BOOL bDoesMove = FALSE;
+
+ switch ( rKeyEvent.GetKeyCode().GetCode() )
+ {
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ case KEY_HOME:
+ case KEY_END:
+ case KEY_PAGEUP:
+ case KEY_PAGEDOWN:
+ {
+ if ( !rKeyEvent.GetKeyCode().IsMod2() )
+ bDoesMove = TRUE;
+ }
+ break;
+ }
+ return bDoesMove;
+}
+
+BOOL TextEngine::DoesKeyChangeText( const KeyEvent& rKeyEvent )
+{
+ BOOL bDoesChange = FALSE;
+
+ KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction();
+ if ( eFunc != KEYFUNC_DONTKNOW )
+ {
+ switch ( eFunc )
+ {
+ case KEYFUNC_UNDO:
+ case KEYFUNC_REDO:
+ case KEYFUNC_CUT:
+ case KEYFUNC_PASTE: bDoesChange = TRUE;
+ break;
+ default: // wird dann evtl. unten bearbeitet.
+ eFunc = KEYFUNC_DONTKNOW;
+ }
+ }
+ if ( eFunc == KEYFUNC_DONTKNOW )
+ {
+ switch ( rKeyEvent.GetKeyCode().GetCode() )
+ {
+ case KEY_DELETE:
+ case KEY_BACKSPACE:
+ {
+ if ( !rKeyEvent.GetKeyCode().IsMod2() )
+ bDoesChange = TRUE;
+ }
+ break;
+ case KEY_RETURN:
+ case KEY_TAB:
+ {
+ if ( !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() )
+ bDoesChange = TRUE;
+ }
+ break;
+ default:
+ {
+ bDoesChange = TextEngine::IsSimpleCharInput( rKeyEvent );
+ }
+ }
+ }
+ return bDoesChange;
+}
+
+BOOL TextEngine::IsSimpleCharInput( const KeyEvent& rKeyEvent )
+{
+ if( rKeyEvent.GetCharCode() >= 32 && rKeyEvent.GetCharCode() != 127 &&
+#ifndef MAC
+ KEY_MOD2 != (rKeyEvent.GetKeyCode().GetModifier() & ~KEY_SHIFT ) )
+#else
+ KEY_MOD1 != rKeyEvent.GetKeyCode().GetModifier() )
+#endif
+ {
+ return TRUE;
+ }
+ return FALSE;
+}
+
+void TextEngine::ImpInitDoc()
+{
+ if ( mpDoc )
+ mpDoc->Clear();
+ else
+ mpDoc = new TextDoc;
+
+ delete mpTEParaPortions;
+ mpTEParaPortions = new TEParaPortions;
+
+ TextNode* pNode = new TextNode( String() );
+ mpDoc->GetNodes().Insert( pNode );
+
+ TEParaPortion* pIniPortion = new TEParaPortion( pNode );
+ mpTEParaPortions->Insert( pIniPortion, (ULONG)0 );
+
+ mbFormatted = FALSE;
+
+ ImpParagraphRemoved( TEXT_PARA_ALL );
+ ImpParagraphInserted( 0 );
+}
+
+String TextEngine::GetText( const TextSelection& rSel, LineEnd aSeparator ) const
+{
+ String aText;
+
+ if ( !rSel.HasRange() )
+ return aText;
+
+ TextSelection aSel( rSel );
+ aSel.Justify();
+
+ ULONG nStartPara = aSel.GetStart().GetPara();
+ ULONG nEndPara = aSel.GetEnd().GetPara();
+ const sal_Unicode* pSep = static_getLineEndText( aSeparator );
+ for ( ULONG nNode = aSel.GetStart().GetPara(); nNode <= nEndPara; nNode++ )
+ {
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
+
+ USHORT nStartPos = 0;
+ USHORT nEndPos = pNode->GetText().Len();
+ if ( nNode == nStartPara )
+ nStartPos = aSel.GetStart().GetIndex();
+ if ( nNode == nEndPara ) // kann auch == nStart sein!
+ nEndPos = aSel.GetEnd().GetIndex();
+
+ aText += pNode->GetText().Copy( nStartPos, nEndPos-nStartPos );
+ if ( nNode < nEndPara )
+ aText += pSep;
+ }
+ return aText;
+}
+
+void TextEngine::ImpRemoveText()
+{
+ ImpInitDoc();
+
+ TextPaM aStartPaM( 0, 0 );
+ TextSelection aEmptySel( aStartPaM, aStartPaM );
+ for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ {
+ TextView* pView = mpViews->GetObject( nView );
+ pView->maSelection = aEmptySel;
+ }
+ ResetUndo();
+}
+
+void TextEngine::SetText( const XubString& rText )
+{
+ ImpRemoveText();
+
+ BOOL bUndoCurrentlyEnabled = IsUndoEnabled();
+ // Der von Hand reingesteckte Text kann nicht vom Anwender rueckgaengig gemacht werden.
+ EnableUndo( FALSE );
+
+ TextPaM aStartPaM( 0, 0 );
+ TextSelection aEmptySel( aStartPaM, aStartPaM );
+
+ TextPaM aPaM = aStartPaM;
+ if ( rText.Len() )
+ aPaM = ImpInsertText( aEmptySel, rText );
+
+ for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ {
+ TextView* pView = mpViews->GetObject( nView );
+// if ( !pView->IsReadOnly() )
+// pView->maSelection = aPaM;
+// else
+ pView->maSelection = aEmptySel;
+
+ // Wenn kein Text, dann auch Kein Format&Update
+ // => Der Text bleibt stehen.
+ if ( !rText.Len() && GetUpdateMode() )
+ pView->Invalidate();
+ }
+
+ if( !rText.Len() ) // sonst muss spaeter noch invalidiert werden, !bFormatted reicht.
+ mnCurTextHeight = 0;
+
+ FormatAndUpdate();
+
+ EnableUndo( bUndoCurrentlyEnabled );
+ DBG_ASSERT( !HasUndoManager() || !GetUndoManager().GetUndoActionCount(), "Undo nach SetText?" );
+}
+
+
+void TextEngine::CursorMoved( ULONG nNode )
+{
+ // Leere Attribute loeschen, aber nur, wenn Absatz nicht leer!
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
+ if ( pNode && pNode->GetCharAttribs().HasEmptyAttribs() && pNode->GetText().Len() )
+ pNode->GetCharAttribs().DeleteEmptyAttribs();
+}
+
+void TextEngine::ImpRemoveChars( const TextPaM& rPaM, USHORT nChars, SfxUndoAction* pCurUndo )
+{
+ DBG_ASSERT( nChars, "ImpRemoveChars - 0 Chars?!" );
+ if ( IsUndoEnabled() && !IsInUndo() )
+ {
+ // Attribute muessen hier vorm RemoveChars fuer UNDO gesichert werden!
+ TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
+ XubString aStr( pNode->GetText().Copy( rPaM.GetIndex(), nChars ) );
+
+ // Pruefen, ob Attribute geloescht oder geaendert werden:
+ USHORT nStart = rPaM.GetIndex();
+ USHORT nEnd = nStart + nChars;
+ for ( USHORT nAttr = pNode->GetCharAttribs().Count(); nAttr; )
+ {
+ TextCharAttrib* pAttr = pNode->GetCharAttribs().GetAttrib( --nAttr );
+ if ( ( pAttr->GetEnd() >= nStart ) && ( pAttr->GetStart() < nEnd ) )
+ {
+// TextSelection aSel( rPaM );
+// aSel.GetEnd().GetIndex() += nChars;
+// TextUndoSetAttribs* pAttrUndo = CreateAttribUndo( aSel );
+// InsertUndo( pAttrUndo );
+ break; // for
+ }
+ }
+// if ( pCurUndo && ( CreateTextPaM( pCurUndo->GetEPaM() ) == rPaM ) )
+// pCurUndo->GetStr() += aStr;
+// else
+ InsertUndo( new TextUndoRemoveChars( this, rPaM, aStr ) );
+ }
+
+ mpDoc->RemoveChars( rPaM, nChars );
+ ImpCharsRemoved( rPaM.GetPara(), rPaM.GetIndex(), nChars );
+}
+
+TextPaM TextEngine::ImpConnectParagraphs( ULONG nLeft, ULONG nRight )
+{
+ DBG_ASSERT( nLeft != nRight, "Den gleichen Absatz zusammenfuegen ?" );
+
+ TextNode* pLeft = mpDoc->GetNodes().GetObject( nLeft );
+ TextNode* pRight = mpDoc->GetNodes().GetObject( nRight );
+
+ if ( IsUndoEnabled() && !IsInUndo() )
+ InsertUndo( new TextUndoConnectParas( this, nLeft, pLeft->GetText().Len() ) );
+
+ // Erstmal Portions suchen, da pRight nach ConnectParagraphs weg.
+ TEParaPortion* pLeftPortion = mpTEParaPortions->GetObject( nLeft );
+ TEParaPortion* pRightPortion = mpTEParaPortions->GetObject( nRight );
+ DBG_ASSERT( pLeft && pLeftPortion, "Blinde Portion in ImpConnectParagraphs(1)" );
+ DBG_ASSERT( pRight && pRightPortion, "Blinde Portion in ImpConnectParagraphs(2)" );
+
+ TextPaM aPaM = mpDoc->ConnectParagraphs( pLeft, pRight );
+ ImpParagraphRemoved( nRight );
+
+ pLeftPortion->MarkSelectionInvalid( aPaM.GetIndex(), pLeft->GetText().Len() );
+
+ mpTEParaPortions->Remove( nRight );
+ delete pRightPortion;
+ // der rechte Node wird von EditDoc::ConnectParagraphs() geloescht.
+
+ return aPaM;
+}
+
+TextPaM TextEngine::ImpDeleteText( const TextSelection& rSel )
+{
+ if ( !rSel.HasRange() )
+ return rSel.GetStart();
+
+ TextSelection aSel( rSel );
+ aSel.Justify();
+ TextPaM aStartPaM( aSel.GetStart() );
+ TextPaM aEndPaM( aSel.GetEnd() );
+
+ CursorMoved( aStartPaM.GetPara() ); // nur damit neu eingestellte Attribute verschwinden...
+ CursorMoved( aEndPaM.GetPara() ); // nur damit neu eingestellte Attribute verschwinden...
+
+ DBG_ASSERT( mpDoc->IsValidPaM( aStartPaM ), "Index im Wald in ImpDeleteText" )
+ DBG_ASSERT( mpDoc->IsValidPaM( aEndPaM ), "Index im Wald in ImpDeleteText" )
+
+ ULONG nStartNode = aStartPaM.GetPara();
+ ULONG nEndNode = aEndPaM.GetPara();
+
+ // Alle Nodes dazwischen entfernen....
+ for ( ULONG z = nStartNode+1; z < nEndNode; z++ )
+ {
+ // Immer nStartNode+1, wegen Remove()!
+ ImpRemoveParagraph( nStartNode+1 );
+ }
+
+ if ( nStartNode != nEndNode )
+ {
+ // Den Rest des StartNodes...
+ TextNode* pLeft = mpDoc->GetNodes().GetObject( nStartNode );
+ USHORT nChars = pLeft->GetText().Len() - aStartPaM.GetIndex();
+ if ( nChars )
+ {
+ ImpRemoveChars( aStartPaM, nChars );
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( nStartNode );
+ DBG_ASSERT( pPortion, "Blinde Portion in ImpDeleteText(3)" );
+ pPortion->MarkSelectionInvalid( aStartPaM.GetIndex(), pLeft->GetText().Len() );
+ }
+
+ // Den Anfang des EndNodes....
+ nEndNode = nStartNode+1; // Die anderen Absaetze wurden geloescht
+ nChars = aEndPaM.GetIndex();
+ if ( nChars )
+ {
+ aEndPaM.GetPara() = nEndNode;
+ aEndPaM.GetIndex() = 0;
+ ImpRemoveChars( aEndPaM, nChars );
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( nEndNode );
+ DBG_ASSERT( pPortion, "Blinde Portion in ImpDeleteText(4)" );
+ pPortion->MarkSelectionInvalid( 0, pPortion->GetNode()->GetText().Len() );
+ }
+
+ // Zusammenfuegen....
+ aStartPaM = ImpConnectParagraphs( nStartNode, nEndNode );
+ }
+ else
+ {
+ USHORT nChars;
+ nChars = aEndPaM.GetIndex() - aStartPaM.GetIndex();
+ ImpRemoveChars( aStartPaM, nChars );
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( nStartNode );
+ DBG_ASSERT( pPortion, "Blinde Portion in ImpDeleteText(5)" );
+ pPortion->MarkInvalid( aEndPaM.GetIndex(), aStartPaM.GetIndex() - aEndPaM.GetIndex() );
+ }
+
+// UpdateSelections();
+ TextModified();
+ return aStartPaM;
+}
+
+void TextEngine::ImpRemoveParagraph( ULONG nPara )
+{
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
+
+ // Der Node wird vom Undo verwaltet und ggf. zerstoert!
+ /* delete */ mpDoc->GetNodes().Remove( nPara );
+ if ( IsUndoEnabled() && !IsInUndo() )
+ InsertUndo( new TextUndoDelPara( this, pNode, nPara ) );
+ else
+ delete pNode;
+
+ mpTEParaPortions->Remove( nPara );
+ delete pPortion;
+
+ ImpParagraphRemoved( nPara );
+}
+
+TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, sal_Unicode c, BOOL bOverwrite )
+{
+ DBG_ASSERT( c != '\n', "Zeilenumbruch bei InsertText ?" );
+ DBG_ASSERT( c != '\r', "Zeilenumbruch bei InsertText ?" );
+
+ TextPaM aPaM( rCurSel.GetStart() );
+ TextNode* pNode = mpDoc->GetNodes().GetObject( aPaM.GetPara() );
+
+ if ( pNode->GetText().Len() < STRING_MAXLEN )
+ {
+ BOOL bDoOverwrite = ( bOverwrite &&
+ ( aPaM.GetIndex() < pNode->GetText().Len() ) ) ? TRUE : FALSE;
+
+ BOOL bUndoAction = ( rCurSel.HasRange() || bDoOverwrite );
+
+ if ( bUndoAction )
+ UndoActionStart( TEXTUNDO_INSERT );
+
+ if ( rCurSel.HasRange() )
+ {
+ aPaM = ImpDeleteText( rCurSel );
+ }
+ else if ( bDoOverwrite )
+ {
+ // Wenn Selektion, dann kein Zeichen ueberschreiben
+ TextSelection aTmpSel( aPaM );
+ aTmpSel.GetEnd().GetIndex()++;
+ ImpDeleteText( aTmpSel );
+ }
+
+ if ( IsUndoEnabled() && !IsInUndo() )
+ {
+ TextUndoInsertChars* pNewUndo = new TextUndoInsertChars( this, aPaM, c );
+ BOOL bTryMerge = ( !bDoOverwrite && ( c != ' ' ) ) ? TRUE : FALSE;
+ InsertUndo( pNewUndo, bTryMerge );
+ }
+
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( aPaM.GetPara() );
+ pPortion->MarkInvalid( aPaM.GetIndex(), 1 );
+ if ( c == '\t' )
+ pPortion->SetNotSimpleInvalid();
+ aPaM = mpDoc->InsertText( aPaM, c );
+ ImpCharsInserted( aPaM.GetPara(), aPaM.GetIndex()-1, 1 );
+
+ TextModified();
+
+ if ( bUndoAction )
+ UndoActionEnd( TEXTUNDO_INSERT );
+ }
+
+ return aPaM;
+}
+
+TextPaM TextEngine::ImpInsertText( const TextSelection& rCurSel, const XubString& rStr )
+{
+ TextPaM aPaM;
+
+ if ( rCurSel.HasRange() )
+ aPaM = ImpDeleteText( rCurSel );
+ else
+ aPaM = rCurSel.GetEnd();
+
+ TextPaM aCurPaM( aPaM ); // fuers Invalidieren
+
+ XubString aText( rStr );
+ aText.ConvertLineEnd( LINEEND_LF );
+
+ USHORT nStart = 0;
+ while ( nStart < aText.Len() )
+ {
+ USHORT nEnd = aText.Search( LINE_SEP, nStart );
+ if ( nEnd == STRING_NOTFOUND )
+ nEnd = aText.Len(); // nicht dereferenzieren!
+
+ // Start == End => Leerzeile
+ if ( nEnd > nStart )
+ {
+ ULONG nL = aPaM.GetIndex();
+ nL += ( nEnd-nStart );
+ if ( nL > STRING_MAXLEN )
+ {
+ USHORT nDiff = (USHORT) (nL-STRING_MAXLEN);
+ nEnd -= nDiff;
+ }
+
+ XubString aLine( aText, nStart, nEnd-nStart );
+ if ( IsUndoEnabled() && !IsInUndo() )
+ InsertUndo( new TextUndoInsertChars( this, aPaM, aLine ) );
+
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( aPaM.GetPara() );
+ pPortion->MarkInvalid( aPaM.GetIndex(), aLine.Len() );
+ if ( aLine.Search( '\t' ) != STRING_NOTFOUND )
+ pPortion->SetNotSimpleInvalid();
+
+ aPaM = mpDoc->InsertText( aPaM, aLine );
+ ImpCharsInserted( aPaM.GetPara(), aPaM.GetIndex()-aLine.Len(), aLine.Len() );
+
+ }
+ if ( nEnd < aText.Len() )
+ aPaM = ImpInsertParaBreak( aPaM );
+
+ nStart = nEnd+1;
+ }
+
+ TextModified();
+ return aPaM;
+}
+
+TextPaM TextEngine::ImpInsertParaBreak( const TextSelection& rCurSel, BOOL bKeepEndingAttribs )
+{
+ TextPaM aPaM;
+ if ( rCurSel.HasRange() )
+ aPaM = ImpDeleteText( rCurSel );
+ else
+ aPaM = rCurSel.GetEnd();
+
+ return ImpInsertParaBreak( aPaM, bKeepEndingAttribs );
+}
+
+TextPaM TextEngine::ImpInsertParaBreak( const TextPaM& rPaM, BOOL bKeepEndingAttribs )
+{
+ if ( IsUndoEnabled() && !IsInUndo() )
+ InsertUndo( new TextUndoSplitPara( this, rPaM.GetPara(), rPaM.GetIndex() ) );
+
+ TextPaM aPaM( mpDoc->InsertParaBreak( rPaM, bKeepEndingAttribs ) );
+
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( rPaM.GetPara() );
+ DBG_ASSERT( pPortion, "Blinde Portion in ImpInsertParaBreak" );
+ pPortion->MarkInvalid( rPaM.GetIndex(), 0 );
+
+ TextNode* pNewNode = mpDoc->GetNodes().GetObject( aPaM.GetPara() );
+ TEParaPortion* pNewPortion = new TEParaPortion( pNewNode );
+ mpTEParaPortions->Insert( pNewPortion, aPaM.GetPara() );
+ ImpParagraphInserted( aPaM.GetPara() );
+
+ CursorMoved( rPaM.GetPara() ); // falls leeres Attribut entstanden.
+ TextModified();
+ return aPaM;
+}
+
+Rectangle TextEngine::PaMtoEditCursor( const TextPaM& rPaM, BOOL bSpecial )
+{
+ DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: PaMtoEditCursor" );
+
+ Rectangle aEditCursor;
+ long nY = 0;
+ for ( ULONG nPortion = 0; nPortion < rPaM.GetPara(); nPortion++ )
+ {
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject(nPortion);
+ nY += pPortion->GetLines().Count() * mnCharHeight;
+ }
+ aEditCursor = GetEditCursor( rPaM, bSpecial );
+ aEditCursor.Top() += nY;
+ aEditCursor.Bottom() += nY;
+ return aEditCursor;
+}
+
+Rectangle TextEngine::GetEditCursor( const TextPaM& rPaM, BOOL bSpecial )
+{
+ DBG_ASSERT( IsFormatted(), "GetEditCursor: Nicht formatiert" );
+
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( rPaM.GetPara() );
+ TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
+
+ /*
+ bSpecial: Wenn hinter dem letzten Zeichen einer umgebrochenen Zeile,
+ am Ende der Zeile bleiben, nicht am Anfang der naechsten.
+ Zweck: - END => wirklich hinter das letzte Zeichen
+ - Selektion....
+ */
+
+ long nY = 0;
+ USHORT nCurIndex = 0;
+ TextLine* pLine = 0;
+ for ( USHORT nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
+ {
+ TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine );
+ if ( ( pTmpLine->GetStart() == rPaM.GetIndex() ) || ( pTmpLine->IsIn( rPaM.GetIndex(), bSpecial ) ) )
+ {
+ pLine = pTmpLine;
+ break;
+ }
+
+ nCurIndex += pTmpLine->GetLen();
+ nY += mnCharHeight;
+ }
+ if ( !pLine )
+ {
+ // Cursor am Ende des Absatzes.
+ DBG_ASSERT( rPaM.GetIndex() == nCurIndex, "Index voll daneben in GetEditCursor!" );
+
+ pLine = pPortion->GetLines().GetObject( pPortion->GetLines().Count()-1 );
+ nY -= mnCharHeight;
+ nCurIndex -= pLine->GetLen();
+ }
+
+ Rectangle aEditCursor;
+
+ aEditCursor.Top() = nY;
+ nY += mnCharHeight;
+ aEditCursor.Bottom() = nY-1;
+
+ // innerhalb der Zeile suchen....
+ long nX = pLine->GetStartX();
+ for ( USHORT i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
+ {
+ TextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( i );
+ nCurIndex += pTextPortion->GetLen();
+ if ( nCurIndex <= rPaM.GetIndex() )
+ {
+ nX += pTextPortion->GetWidth();
+
+ if ( nCurIndex == rPaM.GetIndex() )
+ break; // for
+ }
+ else // suchen und Ende
+ {
+ nCurIndex -= pTextPortion->GetLen();
+ nX += (long)CalcTextWidth( rPaM.GetPara(), nCurIndex, rPaM.GetIndex()-nCurIndex );
+ break; // for
+ }
+ }
+
+ aEditCursor.Left() = aEditCursor.Right() = nX;
+ return aEditCursor;
+}
+
+const TextAttrib* TextEngine::FindAttrib( const TextPaM& rPaM, USHORT nWhich ) const
+{
+ const TextAttrib* pAttr = NULL;
+ const TextCharAttrib* pCharAttr = FindCharAttrib( rPaM, nWhich );
+ if ( pCharAttr )
+ pAttr = &pCharAttr->GetAttr();
+ return pAttr;
+}
+
+const TextCharAttrib* TextEngine::FindCharAttrib( const TextPaM& rPaM, USHORT nWhich ) const
+{
+ const TextCharAttrib* pAttr = NULL;
+ TextNode* pNode = mpDoc->GetNodes().GetObject( rPaM.GetPara() );
+ if ( pNode && ( rPaM.GetIndex() < pNode->GetText().Len() ) )
+ pAttr = pNode->GetCharAttribs().FindAttrib( nWhich, rPaM.GetIndex() );
+ return pAttr;
+}
+
+BOOL TextEngine::HasAttrib( USHORT nWhich ) const
+{
+ BOOL bAttr = FALSE;
+ for ( ULONG n = mpDoc->GetNodes().Count(); --n && !bAttr; )
+ {
+ TextNode* pNode = mpDoc->GetNodes().GetObject( n );
+ bAttr = pNode->GetCharAttribs().HasAttrib( nWhich );
+ }
+ return bAttr;
+}
+
+TextPaM TextEngine::GetPaM( const Point& rDocPos, BOOL bSmart )
+{
+ DBG_ASSERT( GetUpdateMode(), "Darf bei Update=FALSE nicht erreicht werden: GetPaM" );
+
+ long nY = 0;
+ for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ {
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
+ long nTmpHeight = pPortion->GetLines().Count() * mnCharHeight;
+ nY += nTmpHeight;
+ if ( nY > rDocPos.Y() )
+ {
+ nY -= nTmpHeight;
+ Point aPosInPara( rDocPos );
+ aPosInPara.Y() -= nY;
+
+ TextPaM aPaM( nPortion, 0 );
+ aPaM.GetIndex() = ImpFindIndex( nPortion, aPosInPara, bSmart );
+ return aPaM;
+ }
+ }
+
+ // Nicht gefunden - Dann den letzten sichtbare...
+ ULONG nLastNode = mpDoc->GetNodes().Count() - 1;
+ TextNode* pLast = mpDoc->GetNodes().GetObject( nLastNode );
+ return TextPaM( nLastNode, pLast->GetText().Len() );
+}
+
+USHORT TextEngine::ImpFindIndex( ULONG nPortion, const Point& rPosInPara, BOOL bSmart )
+{
+ DBG_ASSERT( IsFormatted(), "GetPaM: Nicht formatiert" );
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
+
+ USHORT nCurIndex = 0;
+
+ long nY = 0;
+ TextLine* pLine = 0;
+ USHORT nLine;
+ for ( nLine = 0; nLine < pPortion->GetLines().Count(); nLine++ )
+ {
+ TextLine* pTmpLine = pPortion->GetLines().GetObject( nLine );
+ nY += mnCharHeight;
+ if ( nY > rPosInPara.Y() ) // das war 'se
+ {
+ pLine = pTmpLine;
+ break; // richtige Y-Position intressiert nicht
+ }
+ }
+ DBG_ASSERT( pLine, "ImpFindIndex: pLine ?" );
+
+ nCurIndex = GetCharPos( nPortion, nLine, rPosInPara.X(), bSmart );
+
+ if ( nCurIndex && ( nCurIndex == pLine->GetEnd() ) &&
+ ( pLine != pPortion->GetLines().GetObject( pPortion->GetLines().Count()-1) ) )
+ {
+ nCurIndex--;
+ }
+ return nCurIndex;
+}
+
+USHORT TextEngine::GetCharPos( ULONG nPortion, USHORT nLine, long nXPos, BOOL bSmart )
+{
+
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPortion );
+ TextLine* pLine = pPortion->GetLines().GetObject( nLine );
+
+ USHORT nCurIndex = pLine->GetStart();
+
+ if ( !nXPos )
+ return nCurIndex;
+
+ long nTmpX = pLine->GetStartX();
+ for ( USHORT i = pLine->GetStartPortion(); i <= pLine->GetEndPortion(); i++ )
+ {
+ TextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( i );
+ nTmpX += pTextPortion->GetWidth();
+
+ if ( nTmpX > nXPos )
+ {
+ if( pTextPortion->GetLen() > 1 )
+ {
+ nTmpX -= pTextPortion->GetWidth(); // vor die Portion stellen
+ // Optimieren: Kein GetTextBreak, wenn feste Fontbreite...
+ Font aFont;
+ SeekCursor( nPortion, nCurIndex+1, aFont );
+ mpRefDev->SetFont( aFont );
+ nCurIndex = mpRefDev->GetTextBreak( pPortion->GetNode()->GetText(), nXPos-nTmpX, nCurIndex );
+ }
+ return nCurIndex;
+ }
+ nCurIndex += pTextPortion->GetLen();
+ }
+ return nCurIndex;
+}
+
+
+ULONG TextEngine::GetTextHeight() const
+{
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: GetTextHeight" );
+ DBG_ASSERT( IsFormatted() || IsFormatting(), "GetTextHeight: Nicht formatiert" );
+ return mnCurTextHeight;
+}
+
+ULONG TextEngine::CalcTextWidth()
+{
+ if ( !IsFormatted() && !IsFormatting() )
+ FormatDoc();
+
+ long nMaxWidth = 0;
+ long nCurWidth = 0;
+
+ // --------------------------------------------------
+ // Ueber alle Absaetze...
+ // --------------------------------------------------
+ ULONG nParas = mpTEParaPortions->Count();
+ for ( ULONG nPara = mpTEParaPortions->Count(); nPara; )
+ {
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( --nPara );
+
+ // --------------------------------------------------
+ // Ueber die Zeilen des Absatzes...
+ // --------------------------------------------------
+ for ( USHORT nLine = pPortion->GetLines().Count(); nLine; )
+ {
+ TextLine* pLine = pPortion->GetLines().GetObject( --nLine );
+ // --------------------------------------------------
+ // Ueber die Portions der Zeile
+ // --------------------------------------------------
+ nCurWidth = 0;
+ for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
+ {
+ TextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( nTP );
+ nCurWidth += pTextPortion->GetWidth();
+ }
+ if ( nCurWidth > nMaxWidth )
+ nMaxWidth = nCurWidth;
+ }
+ }
+ nMaxWidth++; // Ein breiter, da in CreateLines bei >= umgebrochen wird.
+ return (ULONG)nMaxWidth;
+}
+
+ULONG TextEngine::CalcTextHeight()
+{
+ DBG_ASSERT( GetUpdateMode(), "Sollte bei Update=FALSE nicht verwendet werden: CalcTextHeight" );
+
+ ULONG nY = 0;
+ for ( ULONG nPortion = mpTEParaPortions->Count(); nPortion; )
+ nY += CalcParaHeight( --nPortion );
+ return nY;
+}
+
+ULONG TextEngine::CalcTextWidth( ULONG nPara, USHORT nPortionStart, USHORT nLen, const Font* pFont )
+{
+ // Innerhalb des Textes darf es keinen Portionwechsel (Attribut/Tab) geben!
+ DBG_ASSERT( mpDoc->GetNodes().GetObject( nPara )->GetText().Search( '\t', nPortionStart ) >= (nPortionStart+nLen), "CalcTextWidth: Tab!" );
+
+ ULONG nWidth;
+ if ( mnFixCharWidth100 )
+ nWidth = (ULONG)nLen*mnFixCharWidth100/100;
+ else
+ {
+ if ( pFont )
+ {
+ if ( !mpRefDev->GetFont().IsSameInstance( *pFont ) )
+ mpRefDev->SetFont( *pFont );
+ }
+ else
+ {
+ Font aFont;
+ SeekCursor( nPara, nPortionStart+1, aFont );
+ mpRefDev->SetFont( aFont );
+ }
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+ nWidth = (ULONG)mpRefDev->GetTextWidth( pNode->GetText(), nPortionStart, nLen );
+
+ }
+ return nWidth;
+}
+
+
+USHORT TextEngine::GetLineCount( ULONG nParagraph ) const
+{
+ DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
+
+ TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph );
+ if ( pPPortion )
+ return pPPortion->GetLines().Count();
+
+ return 0xFFFF;
+}
+
+USHORT TextEngine::GetLineLen( ULONG nParagraph, USHORT nLine ) const
+{
+ DBG_ASSERT( nParagraph < mpTEParaPortions->Count(), "GetLineCount: Out of range" );
+
+ TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph );
+ if ( pPPortion && ( nLine < pPPortion->GetLines().Count() ) )
+ {
+ TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
+ return pLine->GetLen();
+ }
+
+ return 0xFFFF;
+}
+
+ULONG TextEngine::CalcParaHeight( ULONG nParagraph )
+{
+ ULONG nHeight = 0;
+
+ TEParaPortion* pPPortion = mpTEParaPortions->GetObject( nParagraph );
+ DBG_ASSERT( pPPortion, "Absatz nicht gefunden: GetParaHeight" );
+ if ( pPPortion )
+ nHeight = pPPortion->GetLines().Count() * mnCharHeight;
+
+ return nHeight;
+}
+
+void TextEngine::UpdateSelections()
+{
+}
+
+Range TextEngine::GetInvalidYOffsets( ULONG nPortion )
+{
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion );
+ USHORT nLines = pTEParaPortion->GetLines().Count();
+ USHORT nLastInvalid, nFirstInvalid = 0;
+ USHORT nLine;
+ for ( nLine = 0; nLine < nLines; nLine++ )
+ {
+ TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine );
+ if ( pL->IsInvalid() )
+ {
+ nFirstInvalid = nLine;
+ break;
+ }
+ }
+
+ for ( nLastInvalid = nFirstInvalid; nLastInvalid < nLines; nLastInvalid++ )
+ {
+ TextLine* pL = pTEParaPortion->GetLines().GetObject( nLine );
+ if ( pL->IsValid() )
+ break;
+ }
+
+ if ( nLastInvalid >= nLines )
+ nLastInvalid = nLines-1;
+
+ return Range( nFirstInvalid*mnCharHeight, ((nLastInvalid+1)*mnCharHeight)-1 );
+}
+
+ULONG TextEngine::GetParagraphCount() const
+{
+ return mpDoc->GetNodes().Count();
+}
+
+void TextEngine::EnableUndo( BOOL bEnable )
+{
+ // Beim Umschalten des Modus Liste loeschen:
+ if ( bEnable != IsUndoEnabled() )
+ ResetUndo();
+
+ mbUndoEnabled = bEnable;
+}
+
+SfxUndoManager& TextEngine::GetUndoManager()
+{
+ if ( !mpUndoManager )
+ mpUndoManager = new TextUndoManager( this );
+ return *mpUndoManager;
+}
+
+void TextEngine::UndoActionStart( USHORT nId )
+{
+ if ( IsUndoEnabled() && !IsInUndo() )
+ {
+ String aComment;
+ // ...
+ GetUndoManager().EnterListAction( aComment, XubString(), nId );
+ }
+}
+
+void TextEngine::UndoActionEnd( USHORT nId )
+{
+ if ( IsUndoEnabled() && !IsInUndo() )
+ GetUndoManager().LeaveListAction();
+}
+
+void TextEngine::InsertUndo( TextUndo* pUndo, BOOL bTryMerge )
+{
+ DBG_ASSERT( !IsInUndo(), "InsertUndo im Undomodus!" );
+ GetUndoManager().AddUndoAction( pUndo, bTryMerge );
+}
+
+void TextEngine::ResetUndo()
+{
+ if ( mpUndoManager )
+ mpUndoManager->Clear();
+}
+
+void TextEngine::InsertContent( TextNode* pNode, ULONG nPara )
+{
+ DBG_ASSERT( pNode, "NULL-Pointer in InsertContent! " );
+ DBG_ASSERT( IsInUndo(), "InsertContent nur fuer Undo()!" );
+ TEParaPortion* pNew = new TEParaPortion( pNode );
+ mpTEParaPortions->Insert( pNew, nPara );
+ mpDoc->GetNodes().Insert( pNode, nPara );
+ ImpParagraphInserted( nPara );
+}
+
+TextPaM TextEngine::SplitContent( ULONG nNode, USHORT nSepPos )
+{
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nNode );
+ DBG_ASSERT( pNode, "Ungueltiger Node in SplitContent" );
+ DBG_ASSERT( IsInUndo(), "SplitContent nur fuer Undo()!" );
+ DBG_ASSERT( nSepPos <= pNode->GetText().Len(), "Index im Wald: SplitContent" );
+ TextPaM aPaM( nNode, nSepPos );
+ return ImpInsertParaBreak( aPaM );
+}
+
+TextPaM TextEngine::ConnectContents( ULONG nLeftNode )
+{
+ DBG_ASSERT( IsInUndo(), "ConnectContent nur fuer Undo()!" );
+ return ImpConnectParagraphs( nLeftNode, nLeftNode+1 );
+}
+
+void TextEngine::SeekCursor( ULONG nPara, USHORT nPos, Font& rFont )
+{
+ rFont = maFont;
+
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+ USHORT nAttribs = pNode->GetCharAttribs().Count();
+ for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ {
+ TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
+ if ( pAttrib->GetStart() > nPos )
+ break;
+
+ // Beim Seeken nicht die Attr beruecksichtigen, die dort beginnen!
+ // Leere Attribute werden beruecksichtigt( verwendet), da diese
+ // gerade eingestellt wurden.
+ // 12.4.95: Doch keine Leeren Attribute verwenden:
+ // - Wenn gerade eingestellt und leer => keine Auswirkung auf Font
+ // In einem leeren Absatz eingestellte Zeichen werden sofort wirksam.
+ if ( ( ( pAttrib->GetStart() < nPos ) && ( pAttrib->GetEnd() >= nPos ) )
+ || !pNode->GetText().Len() )
+ {
+ pAttrib->GetAttr().SetFont( rFont );
+ }
+ }
+}
+
+void TextEngine::SetUpdateMode( BOOL bUp, TextView* pCurView, BOOL bForceUpdate )
+{
+ BOOL bChanged = ( GetUpdateMode() != bUp );
+
+ mbUpdate = bUp;
+ if ( mbUpdate && ( bChanged || bForceUpdate ) )
+ FormatAndUpdate( pCurView );
+}
+
+void TextEngine::FormatAndUpdate( TextView* pCurView )
+{
+ if ( mbDowning )
+ return ;
+
+ if ( IsInUndo() )
+ IdleFormatAndUpdate( pCurView );
+ else
+ {
+ FormatDoc();
+ UpdateViews( pCurView );
+ }
+}
+
+
+void TextEngine::IdleFormatAndUpdate( TextView* pCurView )
+{
+ mpIdleFormatter->DoIdleFormat( pCurView );
+}
+
+void TextEngine::TextModified()
+{
+ mbFormatted = FALSE;
+}
+
+void TextEngine::UpdateViews( TextView* pCurView )
+{
+ if ( !GetUpdateMode() || IsFormatting() || maInvalidRec.IsEmpty() )
+ return;
+
+ DBG_ASSERT( IsFormatted(), "UpdateViews: Doc nicht formatiert!" );
+
+ for ( USHORT nView = 0; nView < mpViews->Count(); nView++ )
+ {
+ TextView* pView = mpViews->GetObject( nView );
+ pView->HideCursor();
+
+ Rectangle aClipRec( maInvalidRec );
+ Rectangle aVisArea( pView->GetStartDocPos(), pView->GetWindow()->GetOutputSizePixel() );
+ aClipRec.Intersection( aVisArea );
+ if ( !aClipRec.IsEmpty() )
+ {
+ // in Fensterkoordinaten umwandeln....
+ aClipRec.SetPos( pView->GetWindowPos( aClipRec.TopLeft() ) );
+
+ if ( pView == pCurView )
+ pView->ImpPaint( aClipRec, TRUE );
+ else
+ pView->GetWindow()->Invalidate( aClipRec );
+ }
+ }
+
+ if ( pCurView )
+ {
+ pCurView->ShowCursor( pCurView->mbAutoScroll );
+ }
+
+ maInvalidRec = Rectangle();
+}
+
+IMPL_LINK_INLINE_START( TextEngine, IdleFormatHdl, Timer *, EMPTYARG )
+{
+ mpIdleFormatter->ResetRestarts();
+ FormatAndUpdate( mpIdleFormatter->GetView() );
+ return 0;
+}
+IMPL_LINK_INLINE_END( TextEngine, IdleFormatHdl, Timer *, EMPTYARG )
+
+void TextEngine::CheckIdleFormatter()
+{
+ mpIdleFormatter->ForceTimeout();
+}
+
+void TextEngine::FormatFullDoc()
+{
+ for ( ULONG nPortion = 0; nPortion < mpTEParaPortions->Count(); nPortion++ )
+ {
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPortion );
+ USHORT nLen = pTEParaPortion->GetNode()->GetText().Len();
+ pTEParaPortion->MarkSelectionInvalid( 0, nLen );
+ }
+ FormatDoc();
+}
+
+void TextEngine::FormatDoc()
+{
+ if ( !GetUpdateMode() || IsFormatting() )
+ return;
+
+ mbIsFormatting = TRUE;
+ mbModified = TRUE;
+
+ long nY = 0;
+ BOOL bGrow = FALSE;
+
+ maInvalidRec = Rectangle(); // leermachen
+ for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ {
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+ if ( pTEParaPortion->IsInvalid() )
+ {
+ ImpFormattingParagraph( nPara );
+
+ if ( CreateLines( nPara ) )
+ bGrow = TRUE;
+
+ // InvalidRec nur einmal setzen...
+ if ( maInvalidRec.IsEmpty() )
+ {
+ // Bei Paperwidth 0 (AutoPageSize) bleibt es sonst Empty()...
+ long nWidth = (long)mnMaxTextWidth;
+ if ( !nWidth )
+ nWidth = 0x7FFFFFFF;
+ Range aInvRange( GetInvalidYOffsets( nPara ) );
+ maInvalidRec = Rectangle( Point( 0, nY+aInvRange.Min() ),
+ Size( nWidth, aInvRange.Len() ) );
+ }
+ else
+ {
+ maInvalidRec.Bottom() = nY + CalcParaHeight( nPara );
+ }
+ }
+ else if ( bGrow )
+ {
+ maInvalidRec.Bottom() = nY + CalcParaHeight( nPara );
+ }
+ nY += CalcParaHeight( nPara );
+ }
+
+ if ( !maInvalidRec.IsEmpty() )
+ {
+ ULONG nNewHeight = CalcTextHeight();
+ long nDiff = nNewHeight - mnCurTextHeight;
+ if ( nNewHeight < mnCurTextHeight )
+ {
+ maInvalidRec.Bottom() = (long)Max( nNewHeight, mnCurTextHeight );
+ if ( maInvalidRec.IsEmpty() )
+ {
+ maInvalidRec.Top() = 0;
+ // Left und Right werden nicht ausgewertet, aber wegen IsEmpty gesetzt.
+ maInvalidRec.Left() = 0;
+ maInvalidRec.Right() = mnMaxTextWidth;
+ }
+ }
+
+ mnCurTextHeight = nNewHeight;
+ if ( nDiff )
+ {
+ mbFormatted = TRUE;
+ ImpTextHeightChanged();
+ }
+ }
+
+ mbIsFormatting = FALSE;
+ mbFormatted = TRUE;
+
+ ImpTextFormatted();
+}
+
+void TextEngine::CreateAndInsertEmptyLine( ULONG nPara )
+{
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+
+ TextLine* pTmpLine = new TextLine;
+ pTmpLine->SetStart( pNode->GetText().Len() );
+ pTmpLine->SetEnd( pTmpLine->GetStart() );
+ pTEParaPortion->GetLines().Insert( pTmpLine, pTEParaPortion->GetLines().Count() );
+
+ if ( meAlign == TXTALIGN_CENTER )
+ pTmpLine->SetStartX( (short)(mnMaxTextWidth / 2) );
+ else if ( meAlign == TXTALIGN_RIGHT )
+ pTmpLine->SetStartX( (short)mnMaxTextWidth );
+ else
+ pTmpLine->SetStartX( mpDoc->GetLeftMargin() );
+
+ BOOL bLineBreak = pNode->GetText().Len() ? TRUE : FALSE;
+
+ TextPortion* pDummyPortion = new TextPortion( 0 );
+ pDummyPortion->GetWidth() = 0;
+ pTEParaPortion->GetTextPortions().Insert( pDummyPortion, pTEParaPortion->GetTextPortions().Count() );
+
+ if ( bLineBreak == TRUE )
+ {
+ // -2: Die neue ist bereits eingefuegt.
+ TextLine* pLastLine = pTEParaPortion->GetLines().GetObject( pTEParaPortion->GetLines().Count()-2 );
+ DBG_ASSERT( pLastLine, "Weicher Umbruch, keine Zeile ?!" );
+ USHORT nPos = (USHORT) pTEParaPortion->GetTextPortions().Count() - 1 ;
+ pTmpLine->SetStartPortion( nPos );
+ pTmpLine->SetEndPortion( nPos );
+ }
+}
+
+void TextEngine::ImpBreakLine( ULONG nPara, TextLine* pLine, TextPortion* pPortion, USHORT nPortionStart, long nRemainingWidth )
+{
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+
+ // Font sollte noch eingestellt sein.
+ USHORT nMaxBreakPos = mpRefDev->GetTextBreak( pNode->GetText(), nRemainingWidth, nPortionStart );
+
+ DBG_ASSERT( nMaxBreakPos < pNode->GetText().Len(), "Break?!" );
+
+ if ( nMaxBreakPos == STRING_LEN ) // GetTextBreak() ist anderer Auffassung als GetTextSize()
+ nMaxBreakPos = pNode->GetText().Len() - 1;
+
+ uno::Reference < text::XBreakIterator > xBI = GetBreakIterator();
+ text::LineBreakHyphenationOptions aHyphOptions( NULL, 1 );
+ text::LineBreakUserOptions aUserOptions;
+ text::LineBreakResults aLBR = xBI->getLineBreak( pNode->GetText(), nMaxBreakPos, GetLocale(), pLine->GetStart(), aHyphOptions, aUserOptions );
+ USHORT nBreakPos = aLBR.breakIndex;
+ if ( nBreakPos <= pLine->GetStart() )
+ nBreakPos = nMaxBreakPos;
+
+ // die angeknackste Portion ist die End-Portion
+ pLine->SetEnd( nBreakPos );
+ USHORT nEndPortion = SplitTextPortion( nPara, nBreakPos );
+
+ sal_Bool bBlankSeparator = ( ( nBreakPos >= pLine->GetStart() ) &&
+ ( pNode->GetText().GetChar( nBreakPos ) == ' ' ) ) ? sal_True : sal_False;
+ if ( bBlankSeparator )
+ {
+ // Blanks am Zeilenende generell unterdruecken...
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+ TextPortion* pTP = pTEParaPortion->GetTextPortions().GetObject( nEndPortion );
+ DBG_ASSERT( nBreakPos > pLine->GetStart(), "SplitTextPortion am Anfang der Zeile?" );
+ pTP->GetWidth() = (long)CalcTextWidth( nPara, nBreakPos-pTP->GetLen(), pTP->GetLen()-1 );
+ }
+ pLine->SetEndPortion( nEndPortion );
+}
+
+USHORT TextEngine::SplitTextPortion( ULONG nPara, USHORT nPos )
+{
+
+ // Die Portion bei nPos wird geplittet, wenn bei nPos nicht
+ // sowieso ein Wechsel ist
+ if ( nPos == 0 )
+ return 0;
+
+ USHORT nSplitPortion;
+ USHORT nTmpPos = 0;
+ TextPortion* pTextPortion = 0;
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+ USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ for ( nSplitPortion = 0; nSplitPortion < nPortions; nSplitPortion++ )
+ {
+ TextPortion* pTP = pTEParaPortion->GetTextPortions().GetObject(nSplitPortion);
+ nTmpPos += pTP->GetLen();
+ if ( nTmpPos >= nPos )
+ {
+ if ( nTmpPos == nPos ) // dann braucht nichts geteilt werden
+ return nSplitPortion;
+ pTextPortion = pTP;
+ break;
+ }
+ }
+
+ DBG_ASSERT( pTextPortion, "Position ausserhalb des Bereichs!" );
+
+ USHORT nOverlapp = nTmpPos - nPos;
+ pTextPortion->GetLen() -= nOverlapp;
+ TextPortion* pNewPortion = new TextPortion( nOverlapp );
+ pTEParaPortion->GetTextPortions().Insert( pNewPortion, nSplitPortion+1 );
+ pTextPortion->GetWidth() = (long)CalcTextWidth( nPara, nPos-pTextPortion->GetLen(), pTextPortion->GetLen() );
+
+ return nSplitPortion;
+}
+
+void TextEngine::CreateTextPortions( ULONG nPara, USHORT nStartPos )
+{
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+ TextNode* pNode = pTEParaPortion->GetNode();
+ DBG_ASSERT( pNode->GetText().Len(), "CreateTextPortions sollte nicht fuer leere Absaetze verwendet werden!" );
+
+ TESortedPositions aPositions;
+ ULONG nZero = 0;
+ aPositions.Insert( nZero );
+
+ USHORT nAttribs = pNode->GetCharAttribs().Count();
+ for ( USHORT nAttr = 0; nAttr < nAttribs; nAttr++ )
+ {
+ TextCharAttrib* pAttrib = pNode->GetCharAttribs().GetAttrib( nAttr );
+
+ // Start und Ende in das Array eintragen...
+ // Die InsertMethode laesst keine doppelten Werte zu....
+ aPositions.Insert( pAttrib->GetStart() );
+ aPositions.Insert( pAttrib->GetEnd() );
+ }
+ aPositions.Insert( pNode->GetText().Len() );
+
+ USHORT nTabPos = pNode->GetText().Search( '\t', 0 );
+ while ( nTabPos != STRING_NOTFOUND )
+ {
+ aPositions.Insert( nTabPos );
+ aPositions.Insert( nTabPos + 1 );
+ nTabPos = pNode->GetText().Search( '\t', nTabPos+1 );
+ }
+
+ // Ab ... loeschen:
+ // Leider muss die Anzahl der TextPortions mit aPositions.Count()
+ // nicht uebereinstimmen, da evtl. Zeilenumbrueche...
+ USHORT nPortionStart = 0;
+ USHORT nInvPortion = 0;
+ for ( USHORT nP = 0; nP < pTEParaPortion->GetTextPortions().Count(); nP++ )
+ {
+ TextPortion* pTmpPortion = pTEParaPortion->GetTextPortions().GetObject(nP);
+ nPortionStart += pTmpPortion->GetLen();
+ if ( nPortionStart >= nStartPos )
+ {
+ nPortionStart -= pTmpPortion->GetLen();
+ nInvPortion = nP;
+ break;
+ }
+ }
+ DBG_ASSERT( nP < pTEParaPortion->GetTextPortions().Count() || !pTEParaPortion->GetTextPortions().Count(), "Nichts zum loeschen: CreateTextPortions" );
+ if ( nInvPortion && ( nPortionStart+pTEParaPortion->GetTextPortions().GetObject(nInvPortion)->GetLen() > nStartPos ) )
+ {
+ // lieber eine davor...
+ // Aber nur wenn es mitten in der Portion war, sonst ist es evtl.
+ // die einzige in der Zeile davor !
+ nInvPortion--;
+ nPortionStart -= pTEParaPortion->GetTextPortions().GetObject(nInvPortion)->GetLen();
+ }
+ pTEParaPortion->GetTextPortions().DeleteFromPortion( nInvPortion );
+
+ // Eine Portion kann auch durch einen Zeilenumbruch entstanden sein:
+ aPositions.Insert( nPortionStart );
+
+ USHORT nInvPos;
+ BOOL bFound = aPositions.Seek_Entry( nPortionStart, &nInvPos );
+ DBG_ASSERT( bFound && ( nInvPos < (aPositions.Count()-1) ), "InvPos ?!" );
+ for ( USHORT i = nInvPos+1; i < aPositions.Count(); i++ )
+ {
+ TextPortion* pNew = new TextPortion( (USHORT)aPositions[i] - (USHORT)aPositions[i-1] );
+ pTEParaPortion->GetTextPortions().Insert( pNew, pTEParaPortion->GetTextPortions().Count());
+ }
+
+ DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine Portions?!" );
+#ifdef EDITDEBUG
+ DBG_ASSERT( pTEParaPortion->DbgCheckTextPortions(), "Portions kaputt?" );
+#endif
+}
+
+void TextEngine::RecalcTextPortion( ULONG nPara, USHORT nStartPos, short nNewChars )
+{
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+ DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine Portions!" );
+ DBG_ASSERT( nNewChars, "RecalcTextPortion mit Diff == 0" );
+
+ TextNode* const pNode = pTEParaPortion->GetNode();
+ if ( nNewChars > 0 )
+ {
+ // Wenn an nStartPos ein Attribut beginnt/endet, oder vor nStartPos
+ // ein Tab steht, faengt eine neue Portion an,
+ // ansonsten wird die Portion an nStartPos erweitert.
+ // Oder wenn ganz vorne ( StartPos 0 ) und dann ein Tab
+
+ if ( ( pNode->GetCharAttribs().HasBoundingAttrib( nStartPos ) ) ||
+ ( nStartPos && ( pNode->GetText().GetChar( nStartPos - 1 ) == '\t' ) ) ||
+ ( ( !nStartPos && ( nNewChars < pNode->GetText().Len() ) && pNode->GetText().GetChar( nNewChars ) == '\t' ) ) )
+ {
+ USHORT nNewPortionPos = 0;
+ if ( nStartPos )
+ nNewPortionPos = SplitTextPortion( nPara, nStartPos ) + 1;
+// else if ( ( pTEParaPortion->GetTextPortions().Count() == 1 ) &&
+// !pTEParaPortion->GetTextPortions()[0]->GetLen() )
+// pTEParaPortion->GetTextPortions().Reset(); // DummyPortion
+
+ // Eine leere Portion kann hier stehen, wenn der Absatz leer war,
+ // oder eine Zeile durch einen harten Zeilenumbruch entstanden ist.
+ if ( ( nNewPortionPos < pTEParaPortion->GetTextPortions().Count() ) &&
+ !pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() )
+ {
+ // Dann die leere Portion verwenden.
+ pTEParaPortion->GetTextPortions()[nNewPortionPos]->GetLen() += nNewChars;
+ }
+ else
+ {
+ TextPortion* pNewPortion = new TextPortion( nNewChars );
+ pTEParaPortion->GetTextPortions().Insert( pNewPortion, nNewPortionPos );
+ }
+ }
+ else
+ {
+ USHORT nPortionStart;
+ const USHORT nTP = pTEParaPortion->GetTextPortions().
+ FindPortion( nStartPos, nPortionStart );
+ TextPortion* const pTP = pTEParaPortion->GetTextPortions()[ nTP ];
+ DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" );
+ pTP->GetLen() += nNewChars;
+ pTP->GetWidth() = (-1);
+ }
+ }
+ else
+ {
+ // Portion schrumpfen oder ggf. entfernen.
+ // Vor Aufruf dieser Methode muss sichergestellt sein, dass
+ // keine Portions in dem geloeschten Bereich lagen!
+
+ // Es darf keine reinragende oder im Bereich startende Portion geben,
+ // also muss nStartPos <= nPos <= nStartPos - nNewChars(neg.) sein
+ USHORT nPortion = 0;
+ USHORT nPos = 0;
+ USHORT nEnd = nStartPos-nNewChars;
+ USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ TextPortion* pTP = 0;
+ for ( nPortion = 0; nPortion < nPortions; nPortion++ )
+ {
+ pTP = pTEParaPortion->GetTextPortions()[ nPortion ];
+ if ( ( nPos+pTP->GetLen() ) > nStartPos )
+ {
+ DBG_ASSERT( nPos <= nStartPos, "Start falsch!" );
+ DBG_ASSERT( nPos+pTP->GetLen() >= nEnd, "End falsch!" );
+ break;
+ }
+ nPos += pTP->GetLen();
+ }
+ DBG_ASSERT( pTP, "RecalcTextPortion: Portion nicht gefunden" );
+ if ( ( nPos == nStartPos ) && ( (nPos+pTP->GetLen()) == nEnd ) )
+ {
+ // Portion entfernen;
+ pTEParaPortion->GetTextPortions().Remove( nPortion );
+ delete pTP;
+ }
+ else
+ {
+ DBG_ASSERT( pTP->GetLen() > (-nNewChars), "Portion zu klein zum schrumpfen!" );
+ pTP->GetLen() += nNewChars;
+ }
+ DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "RecalcTextPortions: Keine mehr da!" );
+ }
+
+#ifdef EDITDEBUG
+ DBG_ASSERT( pTEParaPortion->DbgCheckTextPortions(), "Portions kaputt?" );
+#endif
+}
+
+void TextEngine::ImpPaint( OutputDevice* pOutDev, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange, TextSelection const* pSelection )
+{
+ if ( !GetUpdateMode() )
+ return;
+
+ if ( !IsFormatted() )
+ FormatDoc();
+
+ long nY = rStartPos.Y();
+
+ TextPaM const* pSelStart = 0;
+ TextPaM const* pSelEnd = 0;
+ if ( pSelection && pSelection->HasRange() )
+ {
+ BOOL bInvers = pSelection->GetEnd() < pSelection->GetStart();
+ pSelStart = !bInvers ? &pSelection->GetStart() : &pSelection->GetEnd();
+ pSelEnd = bInvers ? &pSelection->GetStart() : &pSelection->GetEnd();
+ }
+ DBG_ASSERT( !pPaintRange || ( pPaintRange->GetStart() < pPaintRange->GetEnd() ), "ImpPaint: Paint-Range?!" );
+
+ const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings();
+
+ // --------------------------------------------------
+ // Ueber alle Absaetze...
+ // --------------------------------------------------
+ for ( ULONG nPara = 0; nPara < mpTEParaPortions->Count(); nPara++ )
+ {
+ TEParaPortion* pPortion = mpTEParaPortions->GetObject( nPara );
+ // falls beim Tippen Idle-Formatierung, asynchrones Paint.
+ if ( pPortion->IsInvalid() )
+ return;
+
+ ULONG nParaHeight = CalcParaHeight( nPara );
+ USHORT nIndex = 0;
+ if ( ( !pPaintArea || ( ( nY + (long)nParaHeight ) > pPaintArea->Top() ) )
+ && ( !pPaintRange || ( ( nPara >= pPaintRange->GetStart().GetPara() ) && ( nPara <= pPaintRange->GetEnd().GetPara() ) ) ) )
+ {
+ // --------------------------------------------------
+ // Ueber die Zeilen des Absatzes...
+ // --------------------------------------------------
+ USHORT nLines = pPortion->GetLines().Count();
+ for ( USHORT nLine = 0; nLine < nLines; nLine++ )
+ {
+ TextLine* pLine = pPortion->GetLines().GetObject(nLine);
+ Point aTmpPos( rStartPos.X() + pLine->GetStartX(), nY );
+
+ if ( ( !pPaintArea || ( ( nY + mnCharHeight ) > pPaintArea->Top() ) )
+ && ( !pPaintRange || (
+ ( TextPaM( nPara, pLine->GetStart() ) < pPaintRange->GetEnd() ) &&
+ ( TextPaM( nPara, pLine->GetEnd() ) > pPaintRange->GetStart() ) ) ) )
+ {
+ // --------------------------------------------------
+ // Ueber die Portions der Zeile...
+ // --------------------------------------------------
+ nIndex = pLine->GetStart();
+ for ( USHORT y = pLine->GetStartPortion(); y <= pLine->GetEndPortion(); y++ )
+ {
+ DBG_ASSERT( pPortion->GetTextPortions().Count(), "Zeile ohne Textportion im Paint!" );
+ TextPortion* pTextPortion = pPortion->GetTextPortions().GetObject( y );
+ DBG_ASSERT( pTextPortion, "NULL-Pointer im Portioniterator in UpdateViews" );
+
+ long nTxtWidth = pTextPortion->GetWidth();
+
+ // nur ausgeben, was im sichtbaren Bereich beginnt:
+ if ( ( ( aTmpPos.X() + nTxtWidth ) >= 0 )
+ && ( !pPaintRange || (
+ ( TextPaM( nPara, nIndex ) < pPaintRange->GetEnd() ) &&
+ ( TextPaM( nPara, nIndex + pTextPortion->GetLen() ) > pPaintRange->GetStart() ) ) ) )
+ {
+ switch ( pTextPortion->GetKind() )
+ {
+ case PORTIONKIND_TEXT:
+ {
+ {
+ Font aFont;
+ SeekCursor( nPara, nIndex+1, aFont );
+ if ( pSelection )
+ aFont.SetTransparent( FALSE );
+ pOutDev->SetFont( aFont );
+
+ USHORT nTmpIndex = nIndex;
+ USHORT nEnd = nTmpIndex + pTextPortion->GetLen();
+ Point aPos = aTmpPos;
+ if ( pPaintRange )
+ {
+ // evtl soll nicht alles ausgegeben werden...
+ if ( ( pPaintRange->GetStart().GetPara() == nPara )
+ && ( nTmpIndex < pPaintRange->GetStart().GetIndex() ) )
+ {
+ USHORT nL = pPaintRange->GetStart().GetIndex() - nTmpIndex;
+ // aPos.X() += pOutDev->GetTextSize( pPortion->GetNode()->GetText(), nTmpIndex, nL ).Width();
+ aPos.X() += (long)CalcTextWidth( nPara, nTmpIndex, nL, &aFont );
+ nTmpIndex += nL;
+ }
+ if ( ( pPaintRange->GetEnd().GetPara() == nPara )
+ && ( nEnd > pPaintRange->GetEnd().GetIndex() ) )
+ {
+ nEnd = pPaintRange->GetEnd().GetIndex();
+ }
+ }
+
+ BOOL bDone = FALSE;
+ if ( pSelStart )
+ {
+ // liegt ein Teil in der Selektion???
+ TextPaM aTextStart( nPara, nTmpIndex );
+ TextPaM aTextEnd( nPara, nEnd );
+ if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) )
+ {
+ USHORT nL;
+
+ // 1) Bereich vor Selektion
+ if ( aTextStart < *pSelStart )
+ {
+ nL = pSelStart->GetIndex() - nTmpIndex;
+ pOutDev->SetFont( aFont );
+ pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nL );
+ // aPos.X() += pOutDev->GetTextSize( pPortion->GetNode()->GetText(), nTmpIndex, nL ).Width();
+ aPos.X() += (long)CalcTextWidth( nPara, nTmpIndex, nL, &aFont );
+ nTmpIndex += nL;
+
+ }
+ // 2) Bereich mit Selektion
+ nL = nEnd-nTmpIndex;
+ if ( aTextEnd > *pSelEnd )
+ nL = pSelEnd->GetIndex() - nTmpIndex;
+ pOutDev->SetTextColor( rStyleSettings.GetHighlightTextColor() );
+ pOutDev->SetTextFillColor( rStyleSettings.GetHighlightColor() );
+ pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nL );
+ // aPos.X() += pOutDev->GetTextSize( pPortion->GetNode()->GetText(), nTmpIndex, nL ).Width();
+ aPos.X() += (long)CalcTextWidth( nPara, nTmpIndex, nL, &aFont );
+ nTmpIndex += nL;
+
+ // 3) Bereich nach Selektion
+ if ( nTmpIndex < nEnd )
+ {
+ pOutDev->SetFont( aFont );
+ pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
+ }
+ bDone = TRUE;
+ }
+ }
+ if ( !bDone )
+ pOutDev->DrawText( aPos, pPortion->GetNode()->GetText(), nTmpIndex, nEnd-nTmpIndex );
+ }
+
+ }
+ break;
+ case PORTIONKIND_TAB:
+ {
+ // Bei HideSelection() nur Range, pSelection = 0.
+ if ( pSelStart || pPaintRange )
+ {
+ Rectangle aTabArea( aTmpPos, Point( aTmpPos.X()+nTxtWidth, aTmpPos.Y()+mnCharHeight-1 ) );
+ BOOL bDone = FALSE;
+ if ( pSelStart )
+ {
+ // liegt der Tab in der Selektion???
+ TextPaM aTextStart( nPara, nIndex );
+ TextPaM aTextEnd( nPara, nIndex+1 );
+ if ( ( aTextStart < *pSelEnd ) && ( aTextEnd > *pSelStart ) )
+ {
+ Color aOldColor = pOutDev->GetFillColor();
+ pOutDev->SetFillColor( rStyleSettings.GetHighlightColor() );
+ pOutDev->DrawRect( aTabArea );
+ pOutDev->SetFillColor( aOldColor );
+ bDone = TRUE;
+ }
+ }
+ if ( !bDone )
+ {
+ pOutDev->Erase( aTabArea );
+ }
+
+ }
+ }
+ break;
+ default: DBG_ERROR( "ImpPaint: Unknown Portion-Type !" );
+ }
+ }
+ aTmpPos.X() += nTxtWidth;
+ if ( pPaintArea && ( aTmpPos.X() > pPaintArea->Right() ) )
+ break; // Keine weitere Ausgabe in Zeile noetig
+
+ nIndex += pTextPortion->GetLen();
+ }
+ }
+
+ nY += mnCharHeight;
+
+ if ( pPaintArea && ( nY >= pPaintArea->Bottom() ) )
+ break; // keine sichtbaren Aktionen mehr...
+ }
+ }
+ else
+ {
+ nY += nParaHeight;
+ }
+
+ if ( pPaintArea && ( nY > pPaintArea->Bottom() ) )
+ break; // keine sichtbaren Aktionen mehr...
+ }
+}
+
+BOOL TextEngine::CreateLines( ULONG nPara )
+{
+ // BOOL: Aenderung der Hoehe des Absatzes Ja/Nein - TRUE/FALSE
+
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+ DBG_ASSERT( pTEParaPortion->IsInvalid(), "CreateLines: Portion nicht invalid!" );
+
+ USHORT nOldLineCount = pTEParaPortion->GetLines().Count();
+
+ // ---------------------------------------------------------------
+ // Schnelle Sonderbehandlung fuer leere Absaetze...
+ // ---------------------------------------------------------------
+ if ( pTEParaPortion->GetNode()->GetText().Len() == 0 )
+ {
+ // schnelle Sonderbehandlung...
+ if ( pTEParaPortion->GetTextPortions().Count() )
+ pTEParaPortion->GetTextPortions().Reset();
+ if ( pTEParaPortion->GetLines().Count() )
+ pTEParaPortion->GetLines().DeleteAndDestroy( 0, pTEParaPortion->GetLines().Count() );
+ CreateAndInsertEmptyLine( nPara );
+ pTEParaPortion->SetValid();
+ return nOldLineCount != pTEParaPortion->GetLines().Count();
+ }
+
+ // ---------------------------------------------------------------
+ // Initialisierung......
+ // ---------------------------------------------------------------
+
+ if ( pTEParaPortion->GetLines().Count() == 0 )
+ {
+ TextLine* pL = new TextLine;
+ pTEParaPortion->GetLines().Insert( pL, 0 );
+ }
+
+ const short nInvalidDiff = pTEParaPortion->GetInvalidDiff();
+ const USHORT nInvalidStart = pTEParaPortion->GetInvalidPosStart();
+ const USHORT nInvalidEnd = nInvalidStart + Abs( nInvalidDiff );
+ BOOL bQuickFormat = FALSE;
+ if ( pTEParaPortion->IsSimpleInvalid() && ( nInvalidDiff > 0 ) )
+ {
+ bQuickFormat = TRUE;
+ }
+ else if ( ( pTEParaPortion->IsSimpleInvalid() ) && ( nInvalidDiff < 0 ) )
+ {
+ // pruefen, ob loeschen ueber Portiongrenzen erfolgte...
+ USHORT nStart = nInvalidStart; // DOPPELT !!!!!!!!!!!!!!!
+ USHORT nEnd = nStart - nInvalidDiff; // neg.
+ bQuickFormat = TRUE;
+ USHORT nPos = 0;
+ USHORT nPortions = pTEParaPortion->GetTextPortions().Count();
+ for ( USHORT nTP = 0; nTP < nPortions; nTP++ )
+ {
+ // Es darf kein Start/Ende im geloeschten Bereich liegen.
+ TextPortion* const pTP = pTEParaPortion->GetTextPortions().GetObject( nTP );
+ nPos += pTP->GetLen();
+ if ( ( nPos > nStart ) && ( nPos < nEnd ) )
+ {
+ bQuickFormat = FALSE;
+ break;
+ }
+ }
+ }
+
+ if ( bQuickFormat )
+ RecalcTextPortion( nPara, nInvalidStart, nInvalidDiff );
+ else
+ CreateTextPortions( nPara, nInvalidStart );
+
+ // ---------------------------------------------------------------
+ // Zeile mit InvalidPos suchen, eine Zeile davor beginnen...
+ // Zeilen flaggen => nicht removen !
+ // ---------------------------------------------------------------
+
+ USHORT nLine = pTEParaPortion->GetLines().Count()-1;
+ for ( USHORT nL = 0; nL <= nLine; nL++ )
+ {
+ TextLine* pLine = pTEParaPortion->GetLines().GetObject( nL );
+ if ( pLine->GetEnd() > nInvalidStart )
+ {
+ nLine = nL;
+ break;
+ }
+ pLine->SetValid();
+ }
+ // Eine Zeile davor beginnen...
+ // Wenn ganz hinten getippt wird, kann sich die Zeile davor nicht aendern.
+ if ( nLine && ( !pTEParaPortion->IsSimpleInvalid() || ( nInvalidEnd < pNode->GetText().Len() ) || ( nInvalidDiff <= 0 ) ) )
+ nLine--;
+
+ TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine );
+
+ // ---------------------------------------------------------------
+ // Ab hier alle Zeilen durchformatieren...
+ // ---------------------------------------------------------------
+ USHORT nDelFromLine = 0xFFFF;
+ BOOL bLineBreak = FALSE;
+
+ USHORT nIndex = pLine->GetStart();
+ TextLine aSaveLine( *pLine );
+
+ Font aFont;
+
+ BOOL bCalcPortion = TRUE;
+
+ while ( nIndex < pNode->GetText().Len() )
+ {
+ BOOL bEOL = FALSE;
+ BOOL bEOC = FALSE;
+ USHORT nPortionStart = 0;
+ USHORT nPortionEnd = 0;
+
+ USHORT nTmpPos = nIndex;
+ USHORT nTmpPortion = pLine->GetStartPortion();
+ long nTmpWidth = mpDoc->GetLeftMargin();
+// long nXWidth = mnMaxTextWidth ? ( mnMaxTextWidth - mpDoc->GetLeftMargin() ) : 0x7FFFFFFF;
+ // Margin nicht abziehen, ist schon in TmpWidth enthalten.
+ long nXWidth = mnMaxTextWidth ? mnMaxTextWidth : 0x7FFFFFFF;
+ if ( nXWidth < nTmpWidth )
+ nXWidth = nTmpWidth;
+
+ // Portion suchen, die nicht mehr in Zeile passt....
+ TextPortion* pPortion;
+ BOOL bBrokenLine = FALSE;
+ bLineBreak = FALSE;
+
+ while ( ( nTmpWidth <= nXWidth ) && !bEOL && ( nTmpPortion < pTEParaPortion->GetTextPortions().Count() ) )
+ {
+ nPortionStart = nTmpPos;
+ pPortion = pTEParaPortion->GetTextPortions().GetObject( nTmpPortion );
+ DBG_ASSERT( pPortion->GetLen(), "Leere Portion in CreateLines ?!" );
+ if ( pNode->GetText().GetChar( nTmpPos ) == '\t' )
+ {
+ long nCurPos = nTmpWidth-mpDoc->GetLeftMargin();
+ nTmpWidth = ((nCurPos/mnDefTab)+1)*mnDefTab+mpDoc->GetLeftMargin();
+ pPortion->GetWidth() = nTmpWidth - nCurPos - mpDoc->GetLeftMargin();
+ // Wenn dies das erste Token in der Zeile ist, und
+ // nTmpWidth > aPaperSize.Width, habe ich eine Endlos-Schleife!
+ if ( ( nTmpWidth >= nXWidth ) && ( nTmpPortion == pLine->GetStartPortion() ) )
+ {
+ // Aber was jetzt ? Tab passend machen!
+ pPortion->GetWidth() = nXWidth-1;
+ nTmpWidth = pPortion->GetWidth();
+ bEOL = TRUE;
+ bBrokenLine = TRUE;
+ }
+ pPortion->GetKind() = PORTIONKIND_TAB;
+ }
+ else
+ {
+ if ( bCalcPortion || !pPortion->HasValidSize() )
+ pPortion->GetWidth() = (long)CalcTextWidth( nPara, nTmpPos, pPortion->GetLen() );
+ nTmpWidth += pPortion->GetWidth();
+ }
+
+ nTmpPos += pPortion->GetLen();
+ nPortionEnd = nTmpPos;
+ nTmpPortion++;
+ }
+
+ // das war evtl. eine Portion zu weit:
+ BOOL bFixedEnd = FALSE;
+ if ( nTmpWidth > nXWidth )
+ {
+ nPortionEnd = nTmpPos;
+ nTmpPos -= pPortion->GetLen();
+ nPortionStart = nTmpPos;
+ nTmpPortion--;
+ bEOL = FALSE;
+ bEOC = FALSE;
+
+ nTmpWidth -= pPortion->GetWidth();
+ if ( pPortion->GetKind() == PORTIONKIND_TAB )
+ {
+ bEOL = TRUE;
+ bFixedEnd = TRUE;
+ }
+ }
+ else
+ {
+ bEOL = TRUE;
+ bEOC = TRUE;
+ pLine->SetEnd( nPortionEnd );
+ DBG_ASSERT( pTEParaPortion->GetTextPortions().Count(), "Keine TextPortions?" );
+ pLine->SetEndPortion( (USHORT)pTEParaPortion->GetTextPortions().Count() - 1 );
+ }
+
+ if ( bFixedEnd )
+ {
+ pLine->SetEnd( nPortionStart );
+ pLine->SetEndPortion( nTmpPortion-1 );
+ }
+ else if ( bLineBreak || bBrokenLine )
+ {
+ pLine->SetEnd( nPortionStart+1 );
+ pLine->SetEndPortion( nTmpPortion-1 );
+ bEOC = FALSE; // wurde oben gesetzt, vielleich mal die if's umstellen?
+ }
+ else if ( !bEOL )
+ {
+ DBG_ASSERT( (nPortionEnd-nPortionStart) == pPortion->GetLen(), "Doch eine andere Portion?!" );
+ long nRemainingWidth = mnMaxTextWidth - nTmpWidth;
+ ImpBreakLine( nPara, pLine, pPortion, nPortionStart, nRemainingWidth );
+ }
+
+ if ( ( meAlign == TXTALIGN_CENTER ) || ( meAlign == TXTALIGN_RIGHT ) )
+ {
+ // Ausrichten...
+ long nTextWidth = 0;
+ for ( USHORT nTP = pLine->GetStartPortion(); nTP <= pLine->GetEndPortion(); nTP++ )
+ {
+ TextPortion* pTextPortion = pTEParaPortion->GetTextPortions().GetObject( nTP );
+ nTextWidth += pTextPortion->GetWidth();
+ }
+ long nSpace = mnMaxTextWidth - nTextWidth;
+ if ( nSpace > 0 )
+ {
+ if ( meAlign == TXTALIGN_CENTER )
+ pLine->SetStartX( (USHORT)(nSpace / 2) );
+ else // TXTALIGN_RIGHT
+ pLine->SetStartX( (USHORT)nSpace );
+ }
+ }
+ else
+ {
+ pLine->SetStartX( mpDoc->GetLeftMargin() );
+ }
+
+ // -----------------------------------------------------------------
+ // pruefen, ob die Zeile neu ausgegeben werden muss...
+ // -----------------------------------------------------------------
+ pLine->SetInvalid();
+
+ if ( pTEParaPortion->IsSimpleInvalid() )
+ {
+ // Aenderung durch einfache Textaenderung...
+ // Formatierung nicht abbrechen, da Portions evtl. wieder
+ // gesplittet werden muessen!
+ // Wenn irgendwann mal abbrechbar, dann fogende Zeilen Validieren!
+ // Aber ggf. als Valid markieren, damit weniger Ausgabe...
+ if ( pLine->GetEnd() < nInvalidStart )
+ {
+ if ( *pLine == aSaveLine )
+ {
+ pLine->SetValid();
+ }
+ }
+ else
+ {
+ USHORT nStart = pLine->GetStart();
+ USHORT nEnd = pLine->GetEnd();
+
+ if ( nStart > nInvalidEnd )
+ {
+ if ( ( ( nStart-nInvalidDiff ) == aSaveLine.GetStart() ) &&
+ ( ( nEnd-nInvalidDiff ) == aSaveLine.GetEnd() ) )
+ {
+ pLine->SetValid();
+ if ( bCalcPortion && bQuickFormat )
+ {
+ bCalcPortion = FALSE;
+ pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
+ break;
+ }
+ }
+ }
+ else if ( bQuickFormat && ( nEnd > nInvalidEnd) )
+ {
+ // Wenn die ungueltige Zeile so endet, dass die naechste an
+ // der 'gleichen' Textstelle wie vorher beginnt, also nicht
+ // anders umgebrochen wird, brauche ich dort auch nicht die
+ // textbreiten neu bestimmen:
+ if ( nEnd == ( aSaveLine.GetEnd() + nInvalidDiff ) )
+ {
+ bCalcPortion = FALSE;
+ pTEParaPortion->CorrectValuesBehindLastFormattedLine( nLine );
+ break;
+ }
+ }
+ }
+ }
+
+ nIndex = pLine->GetEnd(); // naechste Zeile Start = letzte Zeile Ende
+ // weil nEnd hinter das letzte Zeichen zeigt!
+
+ USHORT nEndPortion = pLine->GetEndPortion();
+
+ // Naechste Zeile oder ggf. neue Zeile....
+ pLine = 0;
+ if ( nLine < pTEParaPortion->GetLines().Count()-1 )
+ pLine = pTEParaPortion->GetLines().GetObject( ++nLine );
+ if ( pLine && ( nIndex >= pNode->GetText().Len() ) )
+ {
+ nDelFromLine = nLine;
+ break;
+ }
+ if ( !pLine && ( nIndex < pNode->GetText().Len() ) )
+ {
+ pLine = new TextLine;
+ pTEParaPortion->GetLines().Insert( pLine, ++nLine );
+ }
+ if ( pLine )
+ {
+ aSaveLine = *pLine;
+ pLine->SetStart( nIndex );
+ pLine->SetEnd( nIndex );
+ pLine->SetStartPortion( nEndPortion+1 );
+ pLine->SetEndPortion( nEndPortion+1 );
+ }
+ } // while ( Index < Len )
+
+ if ( nDelFromLine != 0xFFFF )
+ pTEParaPortion->GetLines().DeleteAndDestroy( nDelFromLine, pTEParaPortion->GetLines().Count() - nDelFromLine );
+
+ DBG_ASSERT( pTEParaPortion->GetLines().Count(), "Keine Zeile nach CreateLines!" );
+
+ if ( bLineBreak == TRUE )
+ CreateAndInsertEmptyLine( nPara );
+
+ pTEParaPortion->SetValid();
+
+ return nOldLineCount != pTEParaPortion->GetLines().Count();
+}
+
+String TextEngine::GetWord( const TextPaM& rCursorPos, TextPaM* pStartOfWord )
+{
+ String aWord;
+ if ( rCursorPos.GetPara() < mpDoc->GetNodes().Count() )
+ {
+ TextSelection aSel( rCursorPos );
+ TextNode* pNode = mpDoc->GetNodes().GetObject( rCursorPos.GetPara() );
+ uno::Reference < text::XBreakIterator > xBI = GetBreakIterator();
+ text::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rCursorPos.GetIndex(), GetLocale(), text::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
+ aSel.GetStart().GetIndex() = aBoundary.startPos;
+ aSel.GetEnd().GetIndex() = aBoundary.endPos;
+ aWord = pNode->GetText().Copy( aSel.GetStart().GetIndex(), aSel.GetEnd().GetIndex() - aSel.GetStart().GetIndex() );
+ if ( pStartOfWord )
+ *pStartOfWord = aSel.GetStart();
+ }
+ return aWord;
+}
+
+BOOL TextEngine::Read( SvStream& rInput, const TextSelection* pSel )
+{
+ BOOL bUpdate = GetUpdateMode();
+ SetUpdateMode( FALSE );
+
+ UndoActionStart( TEXTUNDO_READ );
+ TextSelection aSel;
+ if ( pSel )
+ aSel = *pSel;
+ else
+ {
+ ULONG nParas = mpDoc->GetNodes().Count();
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 );
+ aSel = TextPaM( nParas-1 , pNode->GetText().Len() );
+ }
+
+ if ( aSel.HasRange() )
+ aSel = ImpDeleteText( aSel );
+
+ ByteString aLine;
+ BOOL bDone = rInput.ReadLine( aLine );
+ String aTmpStr( aLine, rInput.GetStreamCharSet() ), aStr;
+ while ( bDone )
+ {
+ aSel = ImpInsertText( aSel, aTmpStr );
+ bDone = rInput.ReadLine( aLine );
+ aTmpStr = String( aLine, rInput.GetStreamCharSet() );
+ if ( bDone )
+ aSel = ImpInsertParaBreak( aSel.GetEnd() );
+ }
+
+ UndoActionEnd( TEXTUNDO_READ );
+
+ TextSelection aNewSel( aSel.GetEnd(), aSel.GetEnd() );
+
+ // Damit bei FormatAndUpdate nicht auf die ungueltige Selektion zugegriffen wird.
+ if ( GetActiveView() )
+ GetActiveView()->maSelection = aNewSel;
+
+ SetUpdateMode( bUpdate );
+ FormatAndUpdate( GetActiveView() );
+// if ( GetActiveView() )
+// GetActiveView()->SetSelection( aNewSel );
+ return rInput.GetError() ? FALSE : TRUE;
+}
+
+#if SUPD < 540
+BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel )
+{
+ return Write( rOutput, pSel, FALSE );
+}
+#endif
+
+BOOL TextEngine::Write( SvStream& rOutput, const TextSelection* pSel, BOOL bHTML )
+{
+ TextSelection aSel;
+ if ( pSel )
+ aSel = *pSel;
+ else
+ {
+ ULONG nParas = mpDoc->GetNodes().Count();
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nParas - 1 );
+ aSel.GetStart() = TextPaM( 0, 0 );
+ aSel.GetEnd() = TextPaM( nParas-1, pNode->GetText().Len() );
+ }
+
+ if ( bHTML )
+ {
+ rOutput.WriteLine( "<HTML>" );
+ rOutput.WriteLine( "<BODY>" );
+ }
+
+ for ( ULONG nPara = aSel.GetStart().GetPara(); nPara <= aSel.GetEnd().GetPara(); nPara++ )
+ {
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+
+ USHORT nStartPos = 0;
+ USHORT nEndPos = pNode->GetText().Len();
+ if ( nPara == aSel.GetStart().GetPara() )
+ nStartPos = aSel.GetStart().GetIndex();
+ if ( nPara == aSel.GetEnd().GetPara() )
+ nEndPos = aSel.GetEnd().GetIndex();
+
+ String aText;
+ if ( !bHTML )
+ {
+ aText = pNode->GetText().Copy( nStartPos, nEndPos-nStartPos );
+ }
+ else
+ {
+ aText.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "<P STYLE=\"margin-bottom: 0cm\">" ) );
+
+ if ( nStartPos == nEndPos )
+ {
+ // Leerzeilen werden von Writer wegoptimiert
+ aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "<BR>" ) );
+ }
+ else
+ {
+ USHORT nTmpStart = nStartPos;
+ USHORT nTmpEnd = nEndPos;
+ do
+ {
+ TextCharAttrib* pAttr = pNode->GetCharAttribs().FindNextAttrib( TEXTATTR_HYPERLINK, nTmpStart, nEndPos );
+ nTmpEnd = pAttr ? pAttr->GetStart() : nEndPos;
+
+ // Text vor dem Attribut
+ aText += pNode->GetText().Copy( nTmpStart, nTmpEnd-nTmpStart );
+
+ if ( pAttr )
+ {
+ nTmpEnd = Min( pAttr->GetEnd(), nEndPos );
+
+ // z.B. <A HREF="http://www.mopo.de/">Morgenpost</A>
+ aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "<A HREF=\"" ) );
+ aText += ((const TextAttribHyperLink&) pAttr->GetAttr() ).GetURL();
+ aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "\">" ) );
+ nTmpStart = pAttr->GetStart();
+ aText += pNode->GetText().Copy( nTmpStart, nTmpEnd-nTmpStart );
+ aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "</A>" ) );
+
+ nTmpStart = pAttr->GetEnd();
+ }
+ } while ( nTmpEnd < nEndPos );
+ }
+
+ aText.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "</P>" ) );
+ }
+ rOutput.WriteLine( ByteString( aText, rOutput.GetStreamCharSet() ) );
+ }
+
+ if ( bHTML )
+ {
+ rOutput.WriteLine( "</BODY>" );
+ rOutput.WriteLine( "</HTML>" );
+ }
+
+ return rOutput.GetError() ? FALSE : TRUE;
+}
+
+void TextEngine::RemoveAttribs( ULONG nPara )
+{
+ if ( nPara < mpDoc->GetNodes().Count() )
+ {
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+ if ( pNode->GetCharAttribs().Count() )
+ {
+ pNode->GetCharAttribs().Clear( TRUE );
+
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+ pTEParaPortion->MarkSelectionInvalid( 0, pNode->GetText().Len() );
+
+ mbFormatted = FALSE;
+ FormatAndUpdate( NULL );
+ }
+ }
+}
+
+void TextEngine::SetAttrib( const TextAttrib& rAttr, ULONG nPara, USHORT nStart, USHORT nEnd )
+{
+ // Es wird hier erstmal nicht geprueft, ob sich Attribute ueberlappen!
+ // Diese Methode ist erstmal nur fuer einen Editor, der fuer eine Zeile
+ // _schnell_ das Syntax-Highlight einstellen will.
+
+ // Da die TextEngine z.Zt fuer Editoren gedacht ist gibt es auch kein
+ // Undo fuer Attribute!
+
+ if ( nPara < mpDoc->GetNodes().Count() )
+ {
+ TextNode* pNode = mpDoc->GetNodes().GetObject( nPara );
+ TEParaPortion* pTEParaPortion = mpTEParaPortions->GetObject( nPara );
+
+ USHORT nMax = pNode->GetText().Len();
+ if ( nStart > nMax )
+ nStart = nMax;
+ if ( nEnd > nMax )
+ nEnd = nMax;
+
+ pNode->GetCharAttribs().InsertAttrib( new TextCharAttrib( rAttr, nStart, nEnd ) );
+ pTEParaPortion->MarkSelectionInvalid( nStart, nEnd );
+
+ mbFormatted = FALSE;
+ FormatAndUpdate( NULL );
+ }
+}
+
+void TextEngine::SetTextAlign( TxtAlign eAlign )
+{
+ if ( eAlign != meAlign )
+ {
+ meAlign = eAlign;
+ FormatFullDoc();
+ }
+}
+
+
+void TextEngine::ValidateSelection( TextSelection& rSel ) const
+{
+ ValidatePaM( rSel.GetStart() );
+ ValidatePaM( rSel.GetEnd() );
+}
+
+void TextEngine::ValidatePaM( TextPaM& rPaM ) const
+{
+ ULONG nMaxPara = mpDoc->GetNodes().Count() - 1;
+ if ( rPaM.GetPara() > nMaxPara )
+ {
+ rPaM.GetPara() = nMaxPara;
+ rPaM.GetIndex() = 0xFFFF;
+ }
+
+ USHORT nMaxIndex = GetTextLen( rPaM.GetPara() );
+ if ( rPaM.GetIndex() > nMaxIndex )
+ rPaM.GetIndex() = nMaxIndex;
+}
+
+
+// Status & Selektionsanpassung
+
+void TextEngine::ImpParagraphInserted( ULONG nPara )
+{
+ // Die aktive View braucht nicht angepasst werden, aber bei allen
+ // passiven muss die Selektion angepasst werden:
+ if ( mpViews->Count() > 1 )
+ {
+ for ( USHORT nView = mpViews->Count(); nView; )
+ {
+ TextView* pView = mpViews->GetObject( --nView );
+ if ( pView != GetActiveView() )
+ {
+// BOOL bInvers = pView->maSelection.GetEnd() < pView->maSelection.GetStart();
+// TextPaM& rMin = !bInvers ? pView->maSelection.GetStart(): pView->maSelection.GetEnd();
+// TextPaM& rMax = bInvers ? pView->maSelection.GetStart() : pView->maSelection.GetEnd();
+//
+// if ( rMin.GetPara() >= nPara )
+// rMin.GetPara()++;
+// if ( rMax.GetPara() >= nPara )
+// rMax.GetPara()++;
+ for ( int n = 0; n <= 1; n++ )
+ {
+ TextPaM& rPaM = n ? pView->maSelection.GetStart(): pView->maSelection.GetEnd();
+ if ( rPaM.GetPara() >= nPara )
+ rPaM.GetPara()++;
+ }
+ }
+ }
+ }
+ Broadcast( TextHint( TEXT_HINT_PARAINSERTED, nPara ) );
+}
+
+void TextEngine::ImpParagraphRemoved( ULONG nPara )
+{
+ if ( mpViews->Count() > 1 )
+ {
+ for ( USHORT nView = mpViews->Count(); nView; )
+ {
+ TextView* pView = mpViews->GetObject( --nView );
+ if ( pView != GetActiveView() )
+ {
+ ULONG nParas = mpDoc->GetNodes().Count();
+ for ( int n = 0; n <= 1; n++ )
+ {
+ TextPaM& rPaM = n ? pView->maSelection.GetStart(): pView->maSelection.GetEnd();
+ if ( rPaM.GetPara() > nPara )
+ rPaM.GetPara()--;
+ else if ( rPaM.GetPara() == nPara )
+ {
+ rPaM.GetIndex() = 0;
+ if ( rPaM.GetPara() >= nParas )
+ rPaM.GetPara()--;
+ }
+ }
+ }
+ }
+ }
+ Broadcast( TextHint( TEXT_HINT_PARAREMOVED, nPara ) );
+}
+
+void TextEngine::ImpCharsRemoved( ULONG nPara, USHORT nPos, USHORT nChars )
+{
+ if ( mpViews->Count() > 1 )
+ {
+ for ( USHORT nView = mpViews->Count(); nView; )
+ {
+ TextView* pView = mpViews->GetObject( --nView );
+ if ( pView != GetActiveView() )
+ {
+ USHORT nEnd = nPos+nChars;
+ for ( int n = 0; n <= 1; n++ )
+ {
+ TextPaM& rPaM = n ? pView->maSelection.GetStart(): pView->maSelection.GetEnd();
+ if ( rPaM.GetPara() == nPara )
+ {
+ if ( rPaM.GetIndex() > nEnd )
+ rPaM.GetIndex() -= nChars;
+ else if ( rPaM.GetIndex() > nPos )
+ rPaM.GetIndex() = nPos;
+ }
+ }
+ }
+ }
+ }
+}
+
+void TextEngine::ImpCharsInserted( ULONG nPara, USHORT nPos, USHORT nChars )
+{
+ if ( mpViews->Count() > 1 )
+ {
+ for ( USHORT nView = mpViews->Count(); nView; )
+ {
+ TextView* pView = mpViews->GetObject( --nView );
+ if ( pView != GetActiveView() )
+ {
+ for ( int n = 0; n <= 1; n++ )
+ {
+ TextPaM& rPaM = n ? pView->maSelection.GetStart(): pView->maSelection.GetEnd();
+ if ( rPaM.GetPara() == nPara )
+ {
+ if ( rPaM.GetIndex() >= nPos )
+ rPaM.GetIndex() += nChars;
+ }
+ }
+ }
+ }
+ }
+}
+
+void TextEngine::ImpFormattingParagraph( ULONG nPara )
+{
+ Broadcast( TextHint( TEXT_HINT_FORMATPARA, nPara ) );
+}
+
+void TextEngine::ImpTextHeightChanged()
+{
+ Broadcast( TextHint( TEXT_HINT_TEXTHEIGHTCHANGED ) );
+}
+
+void TextEngine::ImpTextFormatted()
+{
+ Broadcast( TextHint( TEXT_HINT_TEXTFORMATTED ) );
+}
+
+void TextEngine::Draw( OutputDevice* pDev, const Point& rPos )
+{
+ ImpPaint( pDev, rPos, NULL );
+}
+
+void TextEngine::SetLeftMargin( USHORT n )
+{
+ mpDoc->SetLeftMargin( n );
+}
+
+USHORT TextEngine::GetLeftMargin() const
+{
+ return mpDoc->GetLeftMargin();
+}
+
+uno::Reference< text::XBreakIterator > TextEngine::GetBreakIterator()
+{
+ static uno::Reference < text::XBreakIterator > mxBreakIterator;
+ if ( !mxBreakIterator.is() )
+ mxBreakIterator = vcl::unohelper::CreateBreakIterator();
+ return mxBreakIterator;
+}
+
+::com::sun::star::lang::Locale TextEngine::GetLocale()
+{
+#if SUPD <= 594
+ static ::com::sun::star::lang::Locale maLocale;
+#endif
+ if ( !maLocale.Language.getLength() )
+ {
+ String aLanguage, aCountry;
+ ConvertLanguageToIsoNames( LANGUAGE_ENGLISH, aLanguage, aCountry );
+ maLocale.Language = aLanguage;
+ maLocale.Country = aCountry;
+ }
+ return maLocale;
+}
diff --git a/svtools/source/edit/textund2.hxx b/svtools/source/edit/textund2.hxx
new file mode 100644
index 000000000000..05d400896fed
--- /dev/null
+++ b/svtools/source/edit/textund2.hxx
@@ -0,0 +1,182 @@
+/*************************************************************************
+ *
+ * $RCSfile: textund2.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _TEXTUND2_HXX
+#define _TEXTUND2_HXX
+
+#include <textundo.hxx>
+
+
+class TextUndoDelPara : public TextUndo
+{
+private:
+ BOOL mbDelObject;
+ ULONG mnPara;
+ TextNode* mpNode; // Zeigt auf das gueltige, nicht zerstoerte Objekt!
+
+public:
+ TYPEINFO();
+ TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara );
+ ~TextUndoDelPara();
+
+ virtual void Undo();
+ virtual void Redo();
+};
+
+
+class TextUndoConnectParas : public TextUndo
+{
+private:
+ ULONG mnPara;
+ USHORT mnSepPos;
+
+public:
+ TYPEINFO();
+ TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos );
+ ~TextUndoConnectParas();
+
+ virtual void Undo();
+ virtual void Redo();
+};
+
+
+class TextUndoSplitPara : public TextUndo
+{
+private:
+ ULONG mnPara;
+ USHORT mnSepPos;
+
+public:
+ TYPEINFO();
+ TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nSepPos );
+ ~TextUndoSplitPara();
+
+ virtual void Undo();
+ virtual void Redo();
+};
+
+
+class TextUndoInsertChars : public TextUndo
+{
+private:
+ TextPaM maTextPaM;
+ String maText;
+
+public:
+ TYPEINFO();
+ TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
+
+// const TextPaM& GetTextPaM() { return aTextPaM; }
+// String& GetStr() { return aText; }
+
+ virtual void Undo();
+ virtual void Redo();
+
+ virtual BOOL Merge( SfxUndoAction *pNextAction );
+};
+
+
+class TextUndoRemoveChars : public TextUndo
+{
+private:
+ TextPaM maTextPaM;
+ String maText;
+
+public:
+ TYPEINFO();
+ TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const String& rStr );
+
+// const TextPaM& GetTextPaM() { return aTextPaM; }
+// String& GetStr() { return aText; }
+
+ virtual void Undo();
+ virtual void Redo();
+};
+
+
+class TextUndoSetAttribs: public TextUndo
+{
+private:
+ TextSelection maSelection;
+// SfxItemSet aNewAttribs;
+// TextInfoArray aPrevAttribs;
+// BYTE nSpecial;
+// BOOL bSetIsRemove;
+// USHORT nRemoveWhich;
+//
+// void ImpSetSelection( TextView* pView );
+
+
+public:
+ TYPEINFO();
+ TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rESel );
+ ~TextUndoSetAttribs();
+
+// TextInfoArray& GetTextInfos() { return aPrevAttribs; }
+// SfxItemSet& GetNewAttribs() { return aNewAttribs; }
+// void SetSpecial( BYTE n ) { nSpecial = n; }
+// void SetRemoveAttribs( BOOL b ) { bSetIsRemove = b; }
+// void SetRemoveWhich( USHORT n ) { nRemoveWhich = n; }
+
+ virtual void Undo();
+ virtual void Redo();
+};
+
+#endif // _TEXTUND2_HXX
diff --git a/svtools/source/edit/textundo.cxx b/svtools/source/edit/textundo.cxx
new file mode 100644
index 000000000000..2be7d39b0524
--- /dev/null
+++ b/svtools/source/edit/textundo.cxx
@@ -0,0 +1,374 @@
+/*************************************************************************
+ *
+ * $RCSfile: textundo.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <texteng.hxx>
+#include <textview.hxx>
+#include <textundo.hxx>
+#include <textund2.hxx>
+#include <textdata.hxx>
+#include <textdoc.hxx>
+#include <textdat2.hxx>
+
+TYPEINIT1( TextUndo, SfxUndoAction );
+TYPEINIT1( TextUndoDelPara, TextUndo );
+TYPEINIT1( TextUndoConnectParas, TextUndo );
+TYPEINIT1( TextUndoSplitPara, TextUndo );
+TYPEINIT1( TextUndoInsertChars, TextUndo );
+TYPEINIT1( TextUndoRemoveChars, TextUndo );
+TYPEINIT1( TextUndoSetAttribs, TextUndo );
+
+
+TextUndoManager::TextUndoManager( TextEngine* p )
+{
+ mpTextEngine = p;
+}
+
+TextUndoManager::~TextUndoManager()
+{
+}
+
+BOOL __EXPORT TextUndoManager::Undo( USHORT nCount )
+{
+ if ( GetUndoActionCount() == 0 )
+ return FALSE;
+
+ UndoRedoStart();
+
+ mpTextEngine->SetIsInUndo( TRUE );
+ BOOL bDone = SfxUndoManager::Undo( nCount );
+ mpTextEngine->SetIsInUndo( FALSE );
+
+ UndoRedoEnd();
+
+ return bDone;
+}
+
+BOOL __EXPORT TextUndoManager::Redo( USHORT nCount )
+{
+ if ( GetRedoActionCount() == 0 )
+ return FALSE;
+
+
+ UndoRedoStart();
+
+ mpTextEngine->SetIsInUndo( TRUE );
+ BOOL bDone = SfxUndoManager::Redo( nCount );
+ mpTextEngine->SetIsInUndo( FALSE );
+
+ UndoRedoEnd();
+
+ return bDone;
+}
+
+void TextUndoManager::UndoRedoStart()
+{
+ DBG_ASSERT( GetView(), "Undo/Redo: Active View?" );
+
+// if ( GetView() )
+// GetView()->HideSelection();
+}
+
+void TextUndoManager::UndoRedoEnd()
+{
+ if ( GetView() )
+ {
+ TextSelection aNewSel( GetView()->GetSelection() );
+ aNewSel.GetStart() = aNewSel.GetEnd();
+ GetView()->maSelection = aNewSel;
+ }
+
+ mpTextEngine->UpdateSelections();
+
+ mpTextEngine->FormatAndUpdate( GetView() );
+}
+
+
+TextUndo::TextUndo( USHORT nI, TextEngine* p )
+{
+ mnId = nI;
+ mpTextEngine = p;
+}
+
+TextUndo::~TextUndo()
+{
+}
+
+USHORT __EXPORT TextUndo::GetId() const
+{
+ //nId sollte mal entfallen => GetId ueberall ueberladen...
+ return mnId;
+}
+
+XubString __EXPORT TextUndo::GetComment() const
+{
+// return mpTextEngine->GetUndoComment( this );
+ return String();
+}
+
+void TextUndo::SetSelection( const TextSelection& rSel )
+{
+ if ( GetView() )
+ GetView()->maSelection = rSel;
+}
+
+
+TextUndoDelPara::TextUndoDelPara( TextEngine* pTextEngine, TextNode* pNode, ULONG nPara )
+ : TextUndo( TEXTUNDO_DELCONTENT, pTextEngine )
+{
+ mpNode = pNode;
+ mnPara = nPara;
+ mbDelObject = TRUE;
+}
+
+TextUndoDelPara::~TextUndoDelPara()
+{
+ if ( mbDelObject )
+ delete mpNode;
+}
+
+void __EXPORT TextUndoDelPara::Undo()
+{
+ GetTextEngine()->InsertContent( mpNode, mnPara );
+ mbDelObject = FALSE; // gehoert wieder der Engine
+
+ if ( GetView() )
+ {
+ TextSelection aSel( TextPaM( mnPara, 0 ), TextPaM( mnPara, mpNode->GetText().Len() ) );
+ SetSelection( aSel );
+ }
+}
+
+void __EXPORT TextUndoDelPara::Redo()
+{
+ // pNode stimmt nicht mehr, falls zwischendurch Undos, in denen
+ // Absaetze verschmolzen sind.
+ mpNode = GetDoc()->GetNodes().GetObject( mnPara );
+
+ delete GetTEParaPortions()->GetObject( mnPara );
+ GetTEParaPortions()->Remove( mnPara );
+
+ // Node nicht loeschen, haengt im Undo!
+ GetDoc()->GetNodes().Remove( mnPara );
+ GetTextEngine()->ImpParagraphRemoved( mnPara );
+
+ mbDelObject = TRUE; // gehoert wieder dem Undo
+
+ ULONG nParas = GetDoc()->GetNodes().Count();
+ ULONG n = mnPara < nParas ? mnPara : (nParas-1);
+ TextNode* pN = GetDoc()->GetNodes().GetObject( n );
+ TextPaM aPaM( n, pN->GetText().Len() );
+ SetSelection( aPaM );
+}
+
+ // -----------------------------------------------------------------------
+// TextUndoConnectParas
+// ------------------------------------------------------------------------
+TextUndoConnectParas::TextUndoConnectParas( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
+ : TextUndo( TEXTUNDO_CONNECTPARAS, pTextEngine )
+{
+ mnPara = nPara;
+ mnSepPos = nPos;
+}
+
+TextUndoConnectParas::~TextUndoConnectParas()
+{
+}
+
+void __EXPORT TextUndoConnectParas::Undo()
+{
+ TextPaM aPaM = GetTextEngine()->SplitContent( mnPara, mnSepPos );
+ SetSelection( aPaM );
+}
+
+void __EXPORT TextUndoConnectParas::Redo()
+{
+ TextPaM aPaM = GetTextEngine()->ConnectContents( mnPara );
+ SetSelection( aPaM );
+}
+
+
+TextUndoSplitPara::TextUndoSplitPara( TextEngine* pTextEngine, ULONG nPara, USHORT nPos )
+ : TextUndo( TEXTUNDO_SPLITPARA, pTextEngine )
+{
+ mnPara = nPara;
+ mnSepPos = nPos;
+}
+
+TextUndoSplitPara::~TextUndoSplitPara()
+{
+}
+
+void __EXPORT TextUndoSplitPara::Undo()
+{
+ TextPaM aPaM = GetTextEngine()->ConnectContents( mnPara );
+ SetSelection( aPaM );
+}
+
+void __EXPORT TextUndoSplitPara::Redo()
+{
+ TextPaM aPaM = GetTextEngine()->SplitContent( mnPara, mnSepPos );
+ SetSelection( aPaM );
+}
+
+
+TextUndoInsertChars::TextUndoInsertChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
+ : TextUndo( TEXTUNDO_INSERTCHARS, pTextEngine ),
+ maTextPaM( rTextPaM ), maText( rStr )
+{
+}
+
+void __EXPORT TextUndoInsertChars::Undo()
+{
+ TextSelection aSel( maTextPaM, maTextPaM );
+ aSel.GetEnd().GetIndex() += maText.Len();
+ TextPaM aPaM = GetTextEngine()->ImpDeleteText( aSel );
+ SetSelection( aPaM );
+}
+
+void __EXPORT TextUndoInsertChars::Redo()
+{
+ TextSelection aSel( maTextPaM, maTextPaM );
+ GetTextEngine()->ImpInsertText( aSel, maText );
+ TextPaM aNewPaM( maTextPaM );
+ aNewPaM.GetIndex() += maText.Len();
+ SetSelection( TextSelection( aSel.GetStart(), aNewPaM ) );
+}
+
+BOOL __EXPORT TextUndoInsertChars::Merge( SfxUndoAction* pNextAction )
+{
+ if ( !pNextAction->ISA( TextUndoInsertChars ) )
+ return FALSE;
+
+ TextUndoInsertChars* pNext = (TextUndoInsertChars*)pNextAction;
+
+ if ( maTextPaM.GetPara() != pNext->maTextPaM.GetPara() )
+ return FALSE;
+
+ if ( ( maTextPaM.GetIndex() + maText.Len() ) == pNext->maTextPaM.GetIndex() )
+ {
+ maText += pNext->maText;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+TextUndoRemoveChars::TextUndoRemoveChars( TextEngine* pTextEngine, const TextPaM& rTextPaM, const XubString& rStr )
+ : TextUndo( TEXTUNDO_REMOVECHARS, pTextEngine ),
+ maTextPaM( rTextPaM ), maText( rStr )
+{
+}
+
+void __EXPORT TextUndoRemoveChars::Undo()
+{
+ TextSelection aSel( maTextPaM, maTextPaM );
+ GetTextEngine()->ImpInsertText( aSel, maText );
+ aSel.GetEnd().GetIndex() += maText.Len();
+ SetSelection( aSel );
+}
+
+void __EXPORT TextUndoRemoveChars::Redo()
+{
+ TextSelection aSel( maTextPaM, maTextPaM );
+ aSel.GetEnd().GetIndex() += maText.Len();
+ TextPaM aPaM = GetTextEngine()->ImpDeleteText( aSel );
+ SetSelection( aPaM );
+}
+
+
+TextUndoSetAttribs::TextUndoSetAttribs( TextEngine* pTextEngine, const TextSelection& rSel )
+ : TextUndo( TEXTUNDO_ATTRIBS, pTextEngine ), maSelection( rSel )
+{
+ maSelection.Justify();
+// aNewAttribs.Set( rNewItems );
+// mbSetIsRemove = FALSE;
+// mnRemoveWhich = 0;
+// mnSpecial = 0;
+}
+
+TextUndoSetAttribs::~TextUndoSetAttribs()
+{
+ // ...............
+}
+
+void __EXPORT TextUndoSetAttribs::Undo()
+{
+ for ( ULONG nPara = maSelection.GetStart().GetPara(); nPara <= maSelection.GetEnd().GetPara(); nPara++ )
+ {
+// ContentAttribsInfo* pInf = aPrevAttribs[ (USHORT)(nPara-aESel.nStartPara) ];
+// GetTextEngine()->RemoveCharAttribs( nPara );
+// TextNode* pNode = GetTextEngine()->GetTextDoc().GetObject( nPara );
+// for ( USHORT nAttr = 0; nAttr < pInf->GetPrevCharAttribs().Count(); nAttr++ )
+// {
+// GetTextEngine()->GetTextDoc().InsertAttrib( pNode, pX->GetStart(), pX->GetEnd(), *pX->GetItem() );
+// }
+ }
+ SetSelection( maSelection );
+}
+
+void __EXPORT TextUndoSetAttribs::Redo()
+{
+// if ( !bSetIsRemove )
+// GetTextEngine()->SetAttribs( aSel, aNewAttribs, nSpecial );
+// else
+// GetTextEngine()->RemoveCharAttribs( aSel, bRemoveParaAttribs, nRemoveWhich );
+ SetSelection( maSelection );
+}
diff --git a/svtools/source/edit/textundo.hxx b/svtools/source/edit/textundo.hxx
new file mode 100644
index 000000000000..31bb776178d5
--- /dev/null
+++ b/svtools/source/edit/textundo.hxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * $RCSfile: textundo.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _TEXTUNDO_HXX
+#define _TEXTUNDO_HXX
+
+#ifndef _UNDO_HXX
+#include <undo.hxx>
+#endif
+
+class TextEngine;
+
+class TextUndoManager : public SfxUndoManager
+{
+ TextEngine* mpTextEngine;
+
+protected:
+
+ void UndoRedoStart();
+ void UndoRedoEnd();
+
+ TextView* GetView() const { return mpTextEngine->GetActiveView(); }
+
+public:
+ TextUndoManager( TextEngine* pTextEngine );
+ ~TextUndoManager();
+
+ virtual BOOL Undo( USHORT nCount=1 );
+ virtual BOOL Redo( USHORT nCount=1 );
+
+};
+
+class TextUndo : public SfxUndoAction
+{
+private:
+ USHORT mnId;
+ TextEngine* mpTextEngine;
+
+protected:
+
+ TextView* GetView() const { return mpTextEngine->GetActiveView(); }
+ void SetSelection( const TextSelection& rSel );
+
+ TextDoc* GetDoc() const { return mpTextEngine->mpDoc; }
+ TEParaPortions* GetTEParaPortions() const { return mpTextEngine->mpTEParaPortions; }
+
+public:
+ TYPEINFO();
+ TextUndo( USHORT nId, TextEngine* pTextEngine );
+ virtual ~TextUndo();
+
+ TextEngine* GetTextEngine() const { return mpTextEngine; }
+
+ virtual void Undo() = 0;
+ virtual void Redo() = 0;
+
+ virtual XubString GetComment() const;
+ virtual USHORT GetId() const;
+};
+
+#endif // _TEXTUNDO_HXX
diff --git a/svtools/source/edit/textview.cxx b/svtools/source/edit/textview.cxx
new file mode 100644
index 000000000000..df85abfbf485
--- /dev/null
+++ b/svtools/source/edit/textview.cxx
@@ -0,0 +1,1760 @@
+/*************************************************************************
+ *
+ * $RCSfile: textview.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <textview.hxx>
+#include <texteng.hxx>
+#include <textdoc.hxx>
+#include <textdata.hxx>
+#include <textdat2.hxx>
+
+#include <undo.hxx>
+
+#ifndef _SV_CURSOR_HXX //autogen
+#include <vcl/cursor.hxx>
+#endif
+
+#ifndef _SV_WINDOW_HXX //autogen
+#include <vcl/window.hxx>
+#endif
+
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+
+#ifndef _SV_CLIP_HXX //autogen
+#include <vcl/clip.hxx>
+#endif
+
+#ifndef _SV_DRAG_HXX //autogen
+#include <vcl/drag.hxx>
+#endif
+
+#ifndef _SV_SOUND_HXX //autogen
+#include <vcl/sound.hxx>
+#endif
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#ifndef _NEW_HXX
+#include <tools/new.hxx>
+#endif
+
+#include <sot/formats.hxx>
+
+#ifndef _URLBMK_HXX
+#include <urlbmk.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_TEXT_XBREAKITERATOR_HPP_
+#include <com/sun/star/text/XBreakIterator.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_TEXT_CHARACTERITERATORMODE_HPP_
+#include <com/sun/star/text/CharacterIteratorMode.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_TEXT_WORDTYPE_HPP_
+#include <com/sun/star/text/WordType.hpp>
+#endif
+
+using namespace ::com::sun::star;
+
+
+ // -------------------------------------------------------------------------
+// (+) class TextView
+// -------------------------------------------------------------------------
+TextView::TextView( TextEngine* pEng, Window* pWindow )
+{
+ mpWindow = pWindow;
+ mpTextEngine = pEng;
+ mpVirtDev = NULL;
+
+ mbPaintSelection = TRUE;
+ mbAutoScroll = TRUE;
+ mbInsertMode = TRUE;
+ mbReadOnly = FALSE;
+ mbHighlightSelection = FALSE;
+ mbAutoIndent = FALSE;
+ mbCursorEnabled = TRUE;
+// mbInSelection = FALSE;
+
+ mnTravelXPos = TRAVEL_X_DONTKNOW;
+
+ mpSelFuncSet = new TextSelFunctionSet( this );
+ mpSelEngine = new SelectionEngine( mpWindow, mpSelFuncSet );
+ mpSelEngine->SetSelectionMode( RANGE_SELECTION );
+ mpSelEngine->EnableDrag( TRUE );
+
+ mpCursor = new Cursor;
+ mpCursor->Show();
+ pWindow->SetCursor( mpCursor );
+
+ if ( pWindow->GetSettings().GetStyleSettings().GetSelectionOptions() & SELECTION_OPTION_INVERT )
+ mbHighlightSelection = TRUE;
+
+ pWindow->SetLineColor();
+
+ mpDDInfo = 0;
+}
+
+TextView::~TextView()
+{
+ delete mpSelEngine;
+ delete mpSelFuncSet;
+ delete mpVirtDev;
+
+ if ( mpWindow->GetCursor() == mpCursor )
+ mpWindow->SetCursor( 0 );
+ delete mpCursor;
+ delete mpDDInfo;
+}
+
+void TextView::Invalidate()
+{
+ mpWindow->Invalidate();
+}
+
+void TextView::SetSelection( const TextSelection& rTextSel, BOOL bGotoCursor )
+{
+ // Falls jemand gerade ein leeres Attribut hinterlassen hat,
+ // und dann der Outliner die Selektion manipulitert:
+ if ( !maSelection.HasRange() )
+ mpTextEngine->CursorMoved( maSelection.GetStart().GetPara() );
+
+ // Wenn nach einem KeyInput die Selection manipuliert wird:
+ mpTextEngine->CheckIdleFormatter();
+
+ HideSelection();
+ maSelection = rTextSel;
+ mpTextEngine->ValidateSelection( maSelection );
+ ShowSelection();
+ ShowCursor( bGotoCursor );
+}
+
+void TextView::SetSelection( const TextSelection& rTextSel )
+{
+ SetSelection( rTextSel, mbAutoScroll );
+}
+
+const TextSelection& TextView::GetSelection() const
+{
+ return maSelection;
+}
+
+void TextView::DeleteSelected()
+{
+// HideSelection();
+
+ mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ TextPaM aPaM = mpTextEngine->ImpDeleteText( maSelection );
+ mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
+
+ maSelection = aPaM;
+ mpTextEngine->FormatAndUpdate( this );
+ ShowCursor();
+}
+
+void TextView::ImpPaint( OutputDevice* pOut, const Point& rStartPos, Rectangle const* pPaintArea, TextSelection const* pPaintRange, TextSelection const* pSelection )
+{
+ if ( !mbPaintSelection )
+ pSelection = NULL;
+ else
+ {
+ // Richtige Hintergrundfarbe einstellen.
+ // Ich bekomme leider nicht mit, ob sich diese inzwischen geaendert hat.
+ Font aFont = mpTextEngine->GetFont();
+ Color aColor = pOut->GetBackground().GetColor();
+ aColor.SetTransparency( 0 );
+ if ( aColor != aFont.GetFillColor() )
+ {
+ aFont.SetTransparent( FALSE );
+ aFont.SetFillColor( aColor );
+ mpTextEngine->maFont = aFont;
+ }
+ }
+
+ mpTextEngine->ImpPaint( pOut, rStartPos, pPaintArea, pPaintRange, pSelection );
+}
+
+void TextView::Paint( const Rectangle& rRect )
+{
+ ImpPaint( rRect, FALSE );
+}
+
+void TextView::ImpPaint( const Rectangle& rRect, BOOL bUseVirtDev )
+{
+ if ( !mpTextEngine->GetUpdateMode() || mpTextEngine->IsInUndo() )
+ return;
+
+ if ( bUseVirtDev )
+ {
+ VirtualDevice* pVDev = GetVirtualDevice();
+
+ const Color& rBackgroundColor = mpWindow->GetBackground().GetColor();
+ if ( pVDev->GetFillColor() != rBackgroundColor )
+ pVDev->SetFillColor( rBackgroundColor );
+ if ( pVDev->GetBackground().GetColor() != rBackgroundColor )
+ pVDev->SetBackground( rBackgroundColor );
+
+ BOOL bVDevValid = TRUE;
+ Size aOutSz( pVDev->GetOutputSizePixel() );
+ if ( ( aOutSz.Width() < rRect.GetWidth() ) ||
+ ( aOutSz.Height() < rRect.GetHeight() ) )
+ {
+ bVDevValid = pVDev->SetOutputSizePixel( rRect.GetSize() );
+ }
+ else
+ {
+ // Das VirtDev kann bei einem Resize sehr gross werden =>
+ // irgendwann mal kleiner machen!
+ if ( ( aOutSz.Height() > ( rRect.GetHeight() + 20 ) ) ||
+ ( aOutSz.Width() > ( rRect.GetWidth() + 20 ) ) )
+ {
+ bVDevValid = pVDev->SetOutputSizePixel( rRect.GetSize() );
+ }
+ else
+ {
+ pVDev->Erase();
+ }
+ }
+ if ( !bVDevValid )
+ {
+ ImpPaint( rRect, FALSE /* ohne VDev */ );
+ return;
+ }
+
+ Rectangle aTmpRec( Point( 0, 0 ), rRect.GetSize() );
+ Point aStartPos = GetDocPos( rRect.TopLeft() );
+ aStartPos.X() *= (-1);
+ aStartPos.Y() *= (-1);
+
+ TextSelection *pTmpPtr = mbHighlightSelection ? NULL : &maSelection;
+ ImpPaint( pVDev, aStartPos, &aTmpRec, NULL, pTmpPtr );
+
+ mpWindow->DrawOutDev( rRect.TopLeft(), rRect.GetSize(),
+ Point(0,0), rRect.GetSize(), *pVDev );
+
+// ShowSelection();
+ if ( mbHighlightSelection )
+ ImpHighlight( maSelection );
+ }
+ else
+ {
+ Point aStartPos( -maStartDocPos.X(), -maStartDocPos.Y() );
+
+ TextSelection *pTmpPtr = mbHighlightSelection ? NULL : &maSelection;
+ ImpPaint( mpWindow, aStartPos, &rRect, NULL, pTmpPtr );
+
+// ShowSelection();
+ if ( mbHighlightSelection )
+ ImpHighlight( maSelection );
+ }
+}
+
+void TextView::ImpHighlight( const TextSelection& rSel )
+{
+ TextSelection aSel( rSel );
+ aSel.Justify();
+ if ( aSel.HasRange() && !mpTextEngine->IsInUndo() && mpTextEngine->GetUpdateMode() )
+ {
+ BOOL bInvertSelection = FALSE;
+#ifdef MAC
+ bInvertSelection = ( mpWindow->GetBackground().GetColor() != COL_WHITE );
+#endif
+ mpCursor->Hide();
+
+ DBG_ASSERT( !mpTextEngine->mpIdleFormatter->IsActive(), "ImpHighlight: Not formatted!" );
+
+ Rectangle aVisArea( maStartDocPos, mpWindow->GetOutputSizePixel() );
+ long nY = 0;
+ ULONG nStartPara = aSel.GetStart().GetPara();
+ ULONG nEndPara = aSel.GetEnd().GetPara();
+ for ( ULONG nPara = 0; nPara <= nEndPara; nPara++ )
+ {
+ long nParaHeight = (long)mpTextEngine->CalcParaHeight( nPara );
+ if ( ( nPara >= nStartPara ) && ( ( nY + nParaHeight ) > aVisArea.Top() ) )
+ {
+ TEParaPortion* pTEParaPortion = mpTextEngine->mpTEParaPortions->GetObject( nPara );
+ USHORT nStartLine = 0;
+ USHORT nEndLine = pTEParaPortion->GetLines().Count() -1;
+ if ( nPara == nStartPara )
+ nStartLine = pTEParaPortion->GetLineNumber( aSel.GetStart().GetIndex(), FALSE );
+ if ( nPara == nEndPara )
+ nEndLine = pTEParaPortion->GetLineNumber( aSel.GetEnd().GetIndex(), TRUE );
+
+ // ueber die Zeilen iterieren....
+ for ( USHORT nLine = nStartLine; nLine <= nEndLine; nLine++ )
+ {
+ TextLine* pLine = pTEParaPortion->GetLines().GetObject( nLine );
+ USHORT nStartIndex = pLine->GetStart();
+ USHORT nEndIndex = pLine->GetEnd();
+ if ( ( nPara == nStartPara ) && ( nLine == nStartLine ) )
+ nStartIndex = aSel.GetStart().GetIndex();
+ if ( ( nPara == nEndPara ) && ( nLine == nEndLine ) )
+ nEndIndex = aSel.GetEnd().GetIndex();
+
+ // Kann passieren, wenn am Anfang einer umgebrochenen Zeile.
+ if ( nEndIndex < nStartIndex )
+ nEndIndex = nStartIndex;
+
+ Rectangle aTmpRec( mpTextEngine->GetEditCursor( TextPaM( nPara, nStartIndex ), FALSE ) );
+ aTmpRec.Top() += nY;
+ aTmpRec.Bottom() += nY;
+ Point aTopLeft( aTmpRec.TopLeft() );
+
+ aTmpRec = mpTextEngine->GetEditCursor( TextPaM( nPara, nEndIndex ), TRUE );
+ aTmpRec.Top() += nY;
+ aTmpRec.Bottom() += nY;
+ Point aBottomRight( aTmpRec.BottomRight() );
+ aBottomRight.X()--;
+
+ // Nur Painten, wenn im sichtbaren Bereich...
+ if ( ( aTopLeft.X() < aBottomRight.X() ) && ( aBottomRight.Y() >= aVisArea.Top() ) )
+ {
+ Point aPnt1( GetWindowPos( aTopLeft ) );
+ Point aPnt2( GetWindowPos( aBottomRight ) );
+
+ Rectangle aRect( aPnt1, aPnt2 );
+ /*! (pb) NOOLDSV
+ if ( bInvertSelection )
+ mpWindow->InvertRect( aRect );
+ else
+ mpWindow->HighlightRect( aRect );
+ */
+ mpWindow->Invert( aRect );
+ }
+ }
+ }
+ nY += nParaHeight;
+
+ if ( nY >= aVisArea.Bottom() )
+ break;
+ }
+ }
+}
+
+
+void TextView::ShowSelection()
+{
+ if ( maSelection.HasRange() )
+ {
+ if ( mbHighlightSelection )
+ ImpHighlight( maSelection );
+ else
+ {
+ // Den Bereich neu zeichnen...
+ Rectangle aOutArea( Point( 0, 0 ), mpWindow->GetOutputSizePixel() );
+ Point aStartPos( -maStartDocPos.X(), -maStartDocPos.Y() );
+ TextSelection aRange( maSelection );
+ aRange.Justify();
+ BOOL bVisCursor = mpCursor->IsVisible();
+ mpCursor->Hide();
+ ImpPaint( mpWindow, aStartPos, &aOutArea, &aRange, &maSelection );
+ if ( bVisCursor )
+ mpCursor->Show();
+ }
+ }
+}
+
+void TextView::HideSelection()
+{
+ if ( maSelection.HasRange() )
+ {
+ if ( mbHighlightSelection )
+ ImpHighlight( maSelection );
+ else
+ {
+ // Den Bereich neu zeichnen...
+ Rectangle aOutArea( Point( 0, 0 ), mpWindow->GetOutputSizePixel() );
+ Point aStartPos( -maStartDocPos.X(), -maStartDocPos.Y() );
+ TextSelection aRange( maSelection );
+ aRange.Justify();
+ BOOL bVisCursor = mpCursor->IsVisible();
+ mpCursor->Hide();
+ ImpPaint( mpWindow, aStartPos, &aOutArea, &aRange, NULL );
+ if ( bVisCursor )
+ mpCursor->Show();
+ }
+ }
+}
+
+void TextView::ShowSelection( const TextSelection& rRange )
+{
+ if ( rRange.HasRange() )
+ {
+ if ( mbHighlightSelection )
+ ImpHighlight( rRange );
+ else
+ {
+ // Den Bereich neu zeichnen...
+ Rectangle aOutArea( Point( 0, 0 ), mpWindow->GetOutputSizePixel() );
+ Point aStartPos( -maStartDocPos.X(), -maStartDocPos.Y() );
+ TextSelection aRange( rRange );
+ aRange.Justify();
+ BOOL bVisCursor = mpCursor->IsVisible();
+ mpCursor->Hide();
+ ImpPaint( mpWindow, aStartPos, &aOutArea, &aRange, &maSelection );
+ if ( bVisCursor )
+ mpCursor->Show();
+ }
+ }
+}
+
+VirtualDevice* TextView::GetVirtualDevice()
+{
+ if ( !mpVirtDev )
+ {
+ mpVirtDev = new VirtualDevice;
+ mpVirtDev->SetLineColor();
+ }
+ return mpVirtDev;
+}
+
+void TextView::EraseVirtualDevice()
+{
+ delete mpVirtDev;
+ mpVirtDev = 0;
+}
+
+BOOL TextView::KeyInput( const KeyEvent& rKeyEvent )
+{
+ BOOL bDone = TRUE;
+ BOOL bModified = FALSE;
+ BOOL bMoved = FALSE;
+ BOOL bEndKey = FALSE; // spezielle CursorPosition
+ BOOL bAllowIdle = TRUE;
+
+ // Um zu pruefen ob durch irgendeine Aktion mModified, das lokale
+ // bModified wird z.B. bei Cut/Paste nicht gesetzt, weil dort an anderen
+ // Stellen das updaten erfolgt.
+ BOOL bWasModified = mpTextEngine->IsModified();
+ mpTextEngine->SetModified( FALSE );
+
+ TextSelection aCurSel( maSelection );
+ TextSelection aOldSel( aCurSel );
+
+ USHORT nCode = rKeyEvent.GetKeyCode().GetCode();
+ KeyFuncType eFunc = rKeyEvent.GetKeyCode().GetFunction();
+ if ( eFunc != KEYFUNC_DONTKNOW )
+ {
+ switch ( eFunc )
+ {
+ case KEYFUNC_CUT:
+ {
+ if ( !mbReadOnly )
+ Cut();
+ }
+ break;
+ case KEYFUNC_COPY:
+ {
+ Copy();
+ }
+ break;
+ case KEYFUNC_PASTE:
+ {
+ if ( !mbReadOnly )
+ Paste();
+ }
+ break;
+ case KEYFUNC_UNDO:
+ {
+ if ( !mbReadOnly )
+ Undo();
+ }
+ break;
+ case KEYFUNC_REDO:
+ {
+ if ( !mbReadOnly )
+ Redo();
+ }
+ break;
+
+ default: // wird dann evtl. unten bearbeitet.
+ eFunc = KEYFUNC_DONTKNOW;
+ }
+ }
+ if ( eFunc == KEYFUNC_DONTKNOW )
+ {
+ switch ( nCode )
+ {
+ case KEY_UP:
+ case KEY_DOWN:
+ case KEY_LEFT:
+ case KEY_RIGHT:
+ case KEY_HOME:
+ case KEY_END:
+ case KEY_PAGEUP:
+ case KEY_PAGEDOWN:
+ {
+ if ( !rKeyEvent.GetKeyCode().IsMod2() )
+ {
+ aCurSel = ImpMoveCursor( rKeyEvent );
+ bMoved = TRUE;
+ if ( nCode == KEY_END )
+ bEndKey = TRUE;
+ }
+ }
+ break;
+ case KEY_BACKSPACE:
+ case KEY_DELETE:
+ {
+ if ( !mbReadOnly && !rKeyEvent.GetKeyCode().IsMod2() )
+ {
+ BYTE nDel = ( nCode == KEY_DELETE ) ? DEL_RIGHT : DEL_LEFT;
+ BYTE nMode = rKeyEvent.GetKeyCode().IsMod1() ? DELMODE_RESTOFWORD : DELMODE_SIMPLE;
+ if ( ( nMode == DELMODE_RESTOFWORD ) && rKeyEvent.GetKeyCode().IsShift() )
+ nMode = DELMODE_RESTOFCONTENT;
+
+ mpTextEngine->UndoActionStart( TEXTUNDO_DELETE );
+ aCurSel = ImpDelete( nDel, nMode );
+ mpTextEngine->UndoActionEnd( TEXTUNDO_DELETE );
+ bModified = TRUE;
+ bAllowIdle = FALSE;
+ }
+ else
+ bDone = FALSE;
+ }
+ break;
+ case KEY_TAB:
+ {
+ if ( !mbReadOnly && !rKeyEvent.GetKeyCode().IsShift() &&
+ !rKeyEvent.GetKeyCode().IsMod1() && !rKeyEvent.GetKeyCode().IsMod2() &&
+ ImplCheckTextLen( 'x' ) )
+ {
+ aCurSel = mpTextEngine->ImpInsertText( aCurSel, '\t', !IsInsertMode() );
+ bModified = TRUE;
+ }
+ else
+ bDone = FALSE;
+ }
+ break;
+ case KEY_RETURN:
+ {
+ // Shift-RETURN darf nicht geschluckt werden, weil dann keine
+ // mehrzeilige Eingabe in Dialogen/Property-Editor moeglich.
+ if ( !mbReadOnly && !rKeyEvent.GetKeyCode().IsMod1() &&
+ !rKeyEvent.GetKeyCode().IsMod2() && ImplCheckTextLen( 'x' ) )
+ {
+ mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ aCurSel = mpTextEngine->ImpInsertParaBreak( aCurSel );
+ if ( mbAutoIndent )
+ {
+ TextNode* pPrev = mpTextEngine->mpDoc->GetNodes().GetObject( aCurSel.GetEnd().GetPara() - 1 );
+ USHORT n = 0;
+ while ( ( n < pPrev->GetText().Len() ) && (
+ ( pPrev->GetText().GetChar( n ) == ' ' ) ||
+ ( pPrev->GetText().GetChar( n ) == '\t' ) ) )
+ {
+ n++;
+ }
+ if ( n )
+ aCurSel = mpTextEngine->ImpInsertText( aCurSel, pPrev->GetText().Copy( 0, n ) );
+ }
+ mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+ bModified = TRUE;
+ }
+ else
+ bDone = FALSE;
+ }
+ break;
+ case KEY_INSERT:
+ {
+ if ( !mbReadOnly )
+ SetInsertMode( !IsInsertMode() );
+ }
+ break;
+ default:
+ {
+ if ( TextEngine::IsSimpleCharInput( rKeyEvent ) )
+ {
+ xub_Unicode nCharCode = rKeyEvent.GetCharCode();
+ if ( !mbReadOnly && ImplCheckTextLen( nCharCode ) ) // sonst trotzdem das Zeichen schlucken...
+ {
+ aCurSel = mpTextEngine->ImpInsertText( aCurSel, nCharCode, !IsInsertMode() );
+ bModified = TRUE;
+ }
+ }
+ else
+ bDone = FALSE;
+ }
+ }
+ }
+
+ if ( aCurSel != aOldSel )
+ maSelection = aCurSel;
+
+ mpTextEngine->UpdateSelections();
+
+ if ( ( nCode != KEY_UP ) && ( nCode != KEY_DOWN ) )
+ mnTravelXPos = TRAVEL_X_DONTKNOW;
+
+ if ( bModified )
+ {
+ // Idle-Formatter nur, wenn AnyInput.
+ if ( bAllowIdle && Application::AnyInput( INPUT_KEYBOARD) )
+ mpTextEngine->IdleFormatAndUpdate( this );
+ else
+ mpTextEngine->FormatAndUpdate( this);
+ }
+ else if ( bMoved )
+ {
+ // Selection wird jetzt gezielt in ImpMoveCursor gemalt.
+ ImpShowCursor( mbAutoScroll, TRUE, bEndKey );
+ }
+
+ if ( mpTextEngine->IsModified() )
+ mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
+ else if ( bWasModified )
+ mpTextEngine->SetModified( TRUE );
+
+ return bDone;
+}
+
+void TextView::MouseButtonUp( const MouseEvent& rMouseEvent )
+{
+ mnTravelXPos = TRAVEL_X_DONTKNOW;
+ mpSelEngine->SelMouseButtonUp( rMouseEvent );
+}
+
+void TextView::MouseButtonDown( const MouseEvent& rMouseEvent )
+{
+ mpTextEngine->CheckIdleFormatter(); // Falls schnelles Tippen und MouseButtonDown
+ mnTravelXPos = TRAVEL_X_DONTKNOW;
+
+ mpTextEngine->SetActiveView( this );
+
+ mpSelEngine->SelMouseButtonDown( rMouseEvent );
+
+ // Sonderbehandlungen
+ if ( !rMouseEvent.IsShift() && ( rMouseEvent.GetClicks() >= 2 ) )
+ {
+ if ( rMouseEvent.IsMod2() )
+ {
+ HideSelection();
+ maSelection.GetStart() = maSelection.GetEnd();
+ SetCursorAtPoint( rMouseEvent.GetPosPixel() ); // Wird von SelectionEngine bei MOD2 nicht gesetzt
+ }
+
+ if ( rMouseEvent.GetClicks() == 2 )
+ {
+ // Wort selektieren
+ if ( maSelection.GetEnd().GetIndex() < mpTextEngine->GetTextLen( maSelection.GetEnd().GetPara() ) )
+ {
+ HideSelection();
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( maSelection.GetEnd().GetPara() );
+ uno::Reference < text::XBreakIterator > xBI = mpTextEngine->GetBreakIterator();
+ text::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), maSelection.GetEnd().GetIndex(), mpTextEngine->GetLocale(), text::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
+ maSelection.GetStart().GetIndex() = aBoundary.startPos;
+ maSelection.GetEnd().GetIndex() = aBoundary.endPos;
+ ShowSelection();
+ ShowCursor( TRUE, TRUE );
+ }
+ }
+ else if ( rMouseEvent.GetClicks() == 3 )
+ {
+ // Absatz selektieren
+ if ( maSelection.GetEnd().GetIndex() < mpTextEngine->GetTextLen( maSelection.GetEnd().GetPara() ) )
+ {
+ HideSelection();
+ maSelection.GetStart().GetIndex() = 0;
+ maSelection.GetEnd().GetIndex() = mpTextEngine->mpDoc->GetNodes().GetObject( maSelection.GetEnd().GetPara() )->GetText().Len();
+ ShowSelection();
+ ShowCursor( TRUE, TRUE );
+ }
+ }
+ }
+}
+
+
+void TextView::MouseMove( const MouseEvent& rMouseEvent )
+{
+ mnTravelXPos = TRAVEL_X_DONTKNOW;
+ mpSelEngine->SelMouseMove( rMouseEvent );
+}
+
+void TextView::Command( const CommandEvent& rCEvt )
+{
+ mpTextEngine->CheckIdleFormatter(); // Falls schnelles Tippen und MouseButtonDown
+ mpTextEngine->SetActiveView( this );
+ BOOL bCallSelectionEngineCommand = TRUE;
+ if ( ( rCEvt.GetCommand() == COMMAND_STARTDRAG ) )
+ {
+ }
+ if ( bCallSelectionEngineCommand )
+ mpSelEngine->Command( rCEvt );
+}
+
+void TextView::ShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor )
+{
+ // Die Einstellung hat mehr Gewicht:
+ if ( !mbAutoScroll )
+ bGotoCursor = FALSE;
+ ImpShowCursor( bGotoCursor, bForceVisCursor, FALSE );
+}
+
+void TextView::HideCursor()
+{
+ mpCursor->Hide();
+}
+
+void TextView::Scroll( long ndX, long ndY )
+{
+ DBG_ASSERT( mpTextEngine->IsFormatted(), "Scroll: Nicht formatiert!" );
+
+ if ( !ndX && !ndY )
+ return;
+
+ Point aNewStartPos( maStartDocPos );
+
+ // Vertical:
+ aNewStartPos.Y() -= ndY;
+ if ( aNewStartPos.Y() < 0 )
+ aNewStartPos.Y() = 0;
+
+ // Horizontal:
+ aNewStartPos.X() -= ndX;
+ if ( aNewStartPos.X() < 0 )
+ aNewStartPos.X() = 0;
+
+ long nDiffX = maStartDocPos.X() - aNewStartPos.X();
+ long nDiffY = maStartDocPos.Y() - aNewStartPos.Y();
+
+ if ( nDiffX || nDiffY )
+ {
+ BOOL bVisCursor = mpCursor->IsVisible();
+ mpCursor->Hide();
+ mpWindow->Update();
+ maStartDocPos = aNewStartPos;
+
+ mpWindow->Scroll( nDiffX, nDiffY );
+ mpWindow->Update();
+ mpCursor->SetPos( mpCursor->GetPos() + Point( nDiffX, nDiffY ) );
+ if ( bVisCursor && !mbReadOnly )
+ mpCursor->Show();
+ }
+}
+
+void TextView::Undo()
+{
+ mpTextEngine->SetActiveView( this );
+ mpTextEngine->GetUndoManager().Undo( 1 );
+}
+
+void TextView::Redo()
+{
+ mpTextEngine->SetActiveView( this );
+ mpTextEngine->GetUndoManager().Redo( 0 );
+}
+
+void TextView::Cut()
+{
+ mpTextEngine->UndoActionStart( TEXTUNDO_CUT );
+ Copy();
+ DeleteSelected();
+ mpTextEngine->UndoActionEnd( TEXTUNDO_CUT );
+}
+
+void TextView::Copy()
+{
+ Clipboard::Clear();
+ TextSelection aSel( maSelection );
+ aSel.Justify();
+ SvMemoryStream aMem;
+ mpTextEngine->Write( aMem, &aSel );
+ aMem << '\0';
+ Clipboard::CopyData( (const char*)aMem.GetData(), aMem.Tell(), FORMAT_STRING );
+ if ( mpTextEngine->HasAttrib( TEXTATTR_HYPERLINK ) )
+ {
+ // Dann auch als HTML
+ aMem.SetStreamSize( 0 );
+ aMem.Seek( 0 );
+ mpTextEngine->Write( aMem, &aSel, TRUE );
+ aMem << '\0';
+ Clipboard::CopyData( (const char*)aMem.GetData(), aMem.Tell(), SOT_FORMATSTR_ID_HTML );
+ }
+}
+
+void TextView::Paste()
+{
+ BOOL bPaste = TRUE;
+ if ( mpTextEngine->GetMaxTextLen() )
+ {
+ // QuickCheck, kein String > 64K moeglich...
+ String aStr( Clipboard::PasteString() );
+ aStr.ConvertLineEnd( LINEEND_LF );
+ bPaste = ImplCheckTextLen( aStr );
+ }
+
+ if ( bPaste )
+ {
+ mpTextEngine->UndoActionStart( TEXTUNDO_PASTE );
+
+ ULONG nLen = Clipboard::GetDataLen( FORMAT_STRING );
+ void* pBuf = SvMemAlloc( nLen );
+ Clipboard::PasteData( pBuf, nLen, FORMAT_STRING );
+
+ // commented out while converting to Unicode
+ // long nStringLen = strlen( (const char*) pBuf ); // 0-terminiert, Datenmuell im Clipborad dahinter.
+
+ SvMemoryStream aMem( (char*)pBuf, nLen /*nStringLen*/, STREAM_READ );
+ aMem.ObjectOwnsMemory( TRUE );
+ mpTextEngine->Read( aMem, &maSelection );
+
+ mpTextEngine->UndoActionEnd( TEXTUNDO_PASTE );
+ }
+}
+
+String TextView::GetSelected()
+{
+ return mpTextEngine->GetText( maSelection, GetSystemLineEnd() );
+}
+
+void TextView::SetInsertMode( BOOL bInsert )
+{
+ if ( mbInsertMode != bInsert )
+ {
+ mbInsertMode = bInsert;
+ ShowCursor( mbAutoScroll, FALSE );
+ }
+}
+
+void TextView::SetReadOnly( BOOL bReadOnly )
+{
+ if ( mbReadOnly != bReadOnly )
+ {
+ mbReadOnly = bReadOnly;
+ if ( !mbReadOnly )
+ ShowCursor( mbAutoScroll, FALSE );
+ else
+ HideCursor();
+ }
+}
+
+TextSelection TextView::ImpMoveCursor( const KeyEvent& rKeyEvent )
+{
+ // Eigentlich nur bei Up/Down noetig, aber was solls.
+ mpTextEngine->CheckIdleFormatter();
+
+ TextPaM aPaM( maSelection.GetEnd() );
+ TextPaM aOldEnd( aPaM );
+
+ BOOL bCtrl = rKeyEvent.GetKeyCode().IsMod1() ? TRUE : FALSE;
+
+ switch ( rKeyEvent.GetKeyCode().GetCode() )
+ {
+ case KEY_UP: aPaM = CursorUp( aPaM );
+ break;
+ case KEY_DOWN: aPaM = CursorDown( aPaM );
+ break;
+ case KEY_HOME: aPaM = bCtrl ? CursorStartOfDoc() : CursorStartOfLine( aPaM );
+ break;
+ case KEY_END: aPaM = bCtrl ? CursorEndOfDoc() : CursorEndOfLine( aPaM );
+ break;
+ case KEY_PAGEUP: aPaM = bCtrl ? CursorStartOfDoc() : PageUp( aPaM );
+ break;
+ case KEY_PAGEDOWN: aPaM = bCtrl ? CursorEndOfDoc() : PageDown( aPaM );
+ break;
+ case KEY_LEFT: aPaM = CursorLeft( aPaM, bCtrl );
+ break;
+ case KEY_RIGHT: aPaM = CursorRight( aPaM, bCtrl );
+ break;
+ }
+
+ // Bewirkt evtl. ein CreateAnchor oder Deselection all
+ mpSelEngine->CursorPosChanging( rKeyEvent.GetKeyCode().IsShift(), rKeyEvent.GetKeyCode().IsMod1() );
+
+ if ( aOldEnd != aPaM )
+ {
+ mpTextEngine->CursorMoved( aOldEnd.GetPara() );
+
+
+ TextSelection aOldSelection( maSelection );
+ maSelection.GetEnd() = aPaM;
+ if ( rKeyEvent.GetKeyCode().IsShift() )
+ {
+ // Dann wird die Selektion erweitert...
+ ShowSelection( TextSelection( aOldEnd, aPaM ) );
+ }
+ else
+ {
+ maSelection.GetStart() = aPaM;
+ }
+ }
+
+ return maSelection;
+}
+
+void TextView::InsertText( const XubString& rStr, BOOL bSelect )
+{
+// HideSelection();
+
+ TextSelection aNewSel( maSelection );
+
+ mpTextEngine->UndoActionStart( TEXTUNDO_INSERT );
+ TextPaM aPaM = mpTextEngine->ImpInsertText( maSelection, rStr );
+ mpTextEngine->UndoActionEnd( TEXTUNDO_INSERT );
+
+ if ( bSelect )
+ {
+ aNewSel.Justify();
+ aNewSel.GetEnd() = aPaM;
+ maSelection = aNewSel;
+ }
+ else
+ maSelection = aPaM;
+
+ mpTextEngine->FormatAndUpdate( this );
+}
+
+TextPaM TextView::CursorLeft( const TextPaM& rPaM, BOOL bWordMode )
+{
+ TextPaM aPaM( rPaM );
+
+ if ( aPaM.GetIndex() )
+ {
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() );
+ uno::Reference < text::XBreakIterator > xBI = mpTextEngine->GetBreakIterator();
+ if ( bWordMode )
+ {
+ text::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), rPaM.GetIndex(), mpTextEngine->GetLocale(), text::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
+ if ( aBoundary.startPos == rPaM.GetIndex() )
+ aBoundary = xBI->previousWord( pNode->GetText(), rPaM.GetIndex(), mpTextEngine->GetLocale(), text::WordType::ANYWORD_IGNOREWHITESPACES );
+ aPaM.GetIndex() = aBoundary.startPos;
+ }
+ else
+ {
+ sal_Int32 nCount = 1;
+ aPaM.GetIndex() = xBI->previousCharacters( pNode->GetText(), aPaM.GetIndex(), mpTextEngine->GetLocale(), text::CharacterIteratorMode::SKIPCHARACTER, nCount, nCount );
+ }
+ }
+ else if ( aPaM.GetPara() )
+ {
+ aPaM.GetPara()--;
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() );
+ aPaM.GetIndex() = pNode->GetText().Len();
+ }
+ return aPaM;
+}
+
+TextPaM TextView::CursorRight( const TextPaM& rPaM, BOOL bWordMode )
+{
+ TextPaM aPaM( rPaM );
+
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() );
+ if ( aPaM.GetIndex() < pNode->GetText().Len() )
+ {
+ uno::Reference < text::XBreakIterator > xBI = mpTextEngine->GetBreakIterator();
+ if ( bWordMode )
+ {
+ text::Boundary aBoundary = xBI->nextWord( pNode->GetText(), aPaM.GetIndex(), mpTextEngine->GetLocale(), text::WordType::ANYWORD_IGNOREWHITESPACES );
+ aPaM.GetIndex() = aBoundary.startPos;
+ }
+ else
+ {
+ sal_Int32 nCount = 1;
+ aPaM.GetIndex() = xBI->nextCharacters( pNode->GetText(), aPaM.GetIndex(), mpTextEngine->GetLocale(), text::CharacterIteratorMode::SKIPCHARACTER, nCount, nCount );
+ }
+ }
+ else if ( aPaM.GetPara() < ( mpTextEngine->mpDoc->GetNodes().Count()-1) )
+ {
+ aPaM.GetPara()++;
+ aPaM.GetIndex() = 0;
+ }
+
+ return aPaM;
+}
+
+TextPaM TextView::ImpDelete( BYTE nMode, BYTE nDelMode )
+{
+ if ( maSelection.HasRange() ) // dann nur Sel. loeschen
+ return mpTextEngine->ImpDeleteText( maSelection );
+
+ TextPaM aStartPaM = maSelection.GetStart();
+ TextPaM aEndPaM = aStartPaM;
+ if ( nMode == DEL_LEFT )
+ {
+ if ( nDelMode == DELMODE_SIMPLE )
+ {
+ aEndPaM = CursorLeft( aEndPaM );
+ }
+ else if ( nDelMode == DELMODE_RESTOFWORD )
+ {
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() );
+ uno::Reference < text::XBreakIterator > xBI = mpTextEngine->GetBreakIterator();
+ text::Boundary aBoundary = xBI->getWordBoundary( pNode->GetText(), maSelection.GetEnd().GetIndex(), mpTextEngine->GetLocale(), text::WordType::ANYWORD_IGNOREWHITESPACES, sal_True );
+ if ( aBoundary.startPos == maSelection.GetEnd().GetIndex() )
+ aBoundary = xBI->previousWord( pNode->GetText(), maSelection.GetEnd().GetIndex(), mpTextEngine->GetLocale(), text::WordType::ANYWORD_IGNOREWHITESPACES );
+ aEndPaM.GetIndex() = aBoundary.startPos;
+ }
+ else // DELMODE_RESTOFCONTENT
+ {
+ if ( aEndPaM.GetIndex() != 0 )
+ aEndPaM.GetIndex() = 0;
+ else if ( aEndPaM.GetPara() )
+ {
+ // Absatz davor
+ aEndPaM.GetPara()--;
+ aEndPaM.GetIndex() = 0;
+ }
+ }
+ }
+ else
+ {
+ if ( nDelMode == DELMODE_SIMPLE )
+ {
+ aEndPaM = CursorRight( aEndPaM );
+ }
+ else if ( nDelMode == DELMODE_RESTOFWORD )
+ {
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() );
+ uno::Reference < text::XBreakIterator > xBI = mpTextEngine->GetBreakIterator();
+ text::Boundary aBoundary = xBI->nextWord( pNode->GetText(), maSelection.GetEnd().GetIndex(), mpTextEngine->GetLocale(), text::WordType::ANYWORD_IGNOREWHITESPACES );
+ aEndPaM.GetIndex() = aBoundary.startPos;
+ }
+ else // DELMODE_RESTOFCONTENT
+ {
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() );
+ if ( aEndPaM.GetIndex() < pNode->GetText().Len() )
+ aEndPaM.GetIndex() = pNode->GetText().Len();
+ else if ( aEndPaM.GetPara() < ( mpTextEngine->mpDoc->GetNodes().Count() - 1 ) )
+ {
+ // Absatz danach
+ aEndPaM.GetPara()++;
+ TextNode* pNextNode = mpTextEngine->mpDoc->GetNodes().GetObject( aEndPaM.GetPara() );
+ aEndPaM.GetIndex() = pNextNode->GetText().Len();
+ }
+ }
+ }
+
+ return mpTextEngine->ImpDeleteText( TextSelection( aStartPaM, aEndPaM ) );
+}
+
+
+
+TextPaM TextView::CursorUp( const TextPaM& rPaM )
+{
+ TextPaM aPaM( rPaM );
+
+ long nX;
+ if ( mnTravelXPos == TRAVEL_X_DONTKNOW )
+ {
+ nX = mpTextEngine->GetEditCursor( rPaM, FALSE ).Left();
+ mnTravelXPos = nX+1;
+ }
+ else
+ nX = mnTravelXPos;
+
+ TEParaPortion* pPPortion = mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
+ USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE );
+ if ( nLine ) // gleicher Absatz
+ {
+ USHORT nCharPos = mpTextEngine->GetCharPos( rPaM.GetPara(), nLine-1, nX );
+ aPaM.GetIndex() = nCharPos;
+ // Wenn davor eine autom.Umgebrochene Zeile, und ich muss genau an das
+ // Ende dieser Zeile, landet der Cursor in der aktuellen Zeile am Anfang
+ // Siehe Problem: Letztes Zeichen einer autom.umgebr. Zeile = Cursor
+ TextLine* pLine = pPPortion->GetLines().GetObject( nLine - 1 );
+ if ( aPaM.GetIndex() && ( aPaM.GetIndex() == pLine->GetEnd() ) )
+ aPaM.GetIndex()--;
+ }
+ else if ( rPaM.GetPara() ) // vorheriger Absatz
+ {
+ aPaM.GetPara()--;
+ pPPortion = mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
+ USHORT nL = pPPortion->GetLines().Count() - 1;
+ USHORT nCharPos = mpTextEngine->GetCharPos( aPaM.GetPara(), nL, nX+1 );
+ aPaM.GetIndex() = nCharPos;
+ }
+
+ return aPaM;
+}
+
+TextPaM TextView::CursorDown( const TextPaM& rPaM )
+{
+ TextPaM aPaM( rPaM );
+
+ long nX;
+ if ( mnTravelXPos == TRAVEL_X_DONTKNOW )
+ {
+ nX = mpTextEngine->GetEditCursor( rPaM, FALSE ).Left();
+ mnTravelXPos = nX+1;
+ }
+ else
+ nX = mnTravelXPos;
+
+ TEParaPortion* pPPortion = mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
+ USHORT nLine = pPPortion->GetLineNumber( rPaM.GetIndex(), FALSE );
+ if ( nLine < ( pPPortion->GetLines().Count() - 1 ) )
+ {
+ USHORT nCharPos = mpTextEngine->GetCharPos( rPaM.GetPara(), nLine+1, nX );
+ aPaM.GetIndex() = nCharPos;
+
+ // Sonderbehandlung siehe CursorUp...
+ TextLine* pLine = pPPortion->GetLines().GetObject( nLine + 1 );
+ if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && aPaM.GetIndex() < pPPortion->GetNode()->GetText().Len() )
+ aPaM.GetIndex()--;
+ }
+ else if ( rPaM.GetPara() < ( mpTextEngine->mpDoc->GetNodes().Count() - 1 ) ) // naechster Absatz
+ {
+ aPaM.GetPara()++;
+ pPPortion = mpTextEngine->mpTEParaPortions->GetObject( aPaM.GetPara() );
+ USHORT nCharPos = mpTextEngine->GetCharPos( aPaM.GetPara(), 0, nX+1 );
+ aPaM.GetIndex() = nCharPos;
+ TextLine* pLine = pPPortion->GetLines().GetObject( 0 );
+ if ( ( aPaM.GetIndex() == pLine->GetEnd() ) && ( aPaM.GetIndex() > pLine->GetStart() ) && ( pPPortion->GetLines().Count() > 1 ) )
+ aPaM.GetIndex()--;
+ }
+
+ return aPaM;
+}
+
+TextPaM TextView::CursorStartOfLine( const TextPaM& rPaM )
+{
+ TextPaM aPaM( rPaM );
+
+ TEParaPortion* pPPortion = mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
+ USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
+ aPaM.GetIndex() = pLine->GetStart();
+
+ return aPaM;
+}
+
+TextPaM TextView::CursorEndOfLine( const TextPaM& rPaM )
+{
+ TextPaM aPaM( rPaM );
+
+ TEParaPortion* pPPortion = mpTextEngine->mpTEParaPortions->GetObject( rPaM.GetPara() );
+ USHORT nLine = pPPortion->GetLineNumber( aPaM.GetIndex(), FALSE );
+ TextLine* pLine = pPPortion->GetLines().GetObject( nLine );
+ aPaM.GetIndex() = pLine->GetEnd();
+
+ if ( pLine->GetEnd() > pLine->GetStart() ) // Leerzeile
+ {
+ xub_Unicode cLastChar = pPPortion->GetNode()->GetText().GetChar((USHORT)(aPaM.GetIndex()-1) );
+ if ( ( cLastChar == ' ' ) && ( aPaM.GetIndex() != pPPortion->GetNode()->GetText().Len() ) )
+ {
+ // Bei einem Blank in einer autom. umgebrochenen Zeile macht es Sinn,
+ // davor zu stehen, da der Anwender hinter das Wort will.
+ // Wenn diese geaendert wird, Sonderbehandlung fuer Pos1 nach End!
+ aPaM.GetIndex()--;
+ }
+ }
+ return aPaM;
+}
+
+TextPaM TextView::CursorStartOfParagraph( const TextPaM& rPaM )
+{
+ TextPaM aPaM( rPaM );
+ aPaM.GetIndex() = 0;
+ return aPaM;
+}
+
+TextPaM TextView::CursorEndOfParagraph( const TextPaM& rPaM )
+{
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( rPaM.GetPara() );
+ TextPaM aPaM( rPaM );
+ aPaM.GetIndex() = pNode->GetText().Len();
+ return aPaM;
+}
+
+TextPaM TextView::CursorStartOfDoc()
+{
+ TextPaM aPaM( 0, 0 );
+ return aPaM;
+}
+
+TextPaM TextView::CursorEndOfDoc()
+{
+ ULONG nNode = mpTextEngine->mpDoc->GetNodes().Count() - 1;
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( nNode );
+ TextPaM aPaM( nNode, pNode->GetText().Len() );
+ return aPaM;
+}
+
+TextPaM TextView::PageUp( const TextPaM& rPaM )
+{
+ Rectangle aRec = mpTextEngine->PaMtoEditCursor( rPaM );
+ Point aTopLeft = aRec.TopLeft();
+ aTopLeft.Y() -= mpWindow->GetOutputSizePixel().Height() * 9/10;
+ aTopLeft.X() += 1;
+ if ( aTopLeft.Y() < 0 )
+ aTopLeft.Y() = 0;
+
+ TextPaM aPaM = mpTextEngine->GetPaM( aTopLeft );
+ return aPaM;
+}
+
+TextPaM TextView::PageDown( const TextPaM& rPaM )
+{
+ Rectangle aRec = mpTextEngine->PaMtoEditCursor( rPaM );
+ Point aBottomRight = aRec.BottomRight();
+ aBottomRight.Y() += mpWindow->GetOutputSizePixel().Height() * 9/10;
+ aBottomRight.X() += 1;
+ long nHeight = mpTextEngine->GetTextHeight();
+ if ( aBottomRight.Y() > nHeight )
+ aBottomRight.Y() = nHeight-1;
+
+ TextPaM aPaM = mpTextEngine->GetPaM( aBottomRight );
+ return aPaM;
+}
+
+void TextView::ImpShowCursor( BOOL bGotoCursor, BOOL bForceVisCursor, BOOL bSpecial )
+{
+ if ( mpTextEngine->IsFormatting() )
+ return;
+ if ( mpTextEngine->GetUpdateMode() == FALSE )
+ return;
+ if ( mpTextEngine->IsInUndo() )
+ return;
+
+ mpTextEngine->CheckIdleFormatter();
+ if ( !mpTextEngine->IsFormatted() )
+ mpTextEngine->FormatAndUpdate( this );
+
+
+ TextPaM aPaM( maSelection.GetEnd() );
+ Rectangle aEditCursor = mpTextEngine->PaMtoEditCursor( aPaM, bSpecial );
+ if ( !IsInsertMode() && !maSelection.HasRange() )
+ {
+ TextNode* pNode = mpTextEngine->mpDoc->GetNodes().GetObject( aPaM.GetPara() );
+ if ( pNode->GetText().Len() && ( aPaM.GetIndex() < pNode->GetText().Len() ) )
+ {
+ long nWidth = (long)mpTextEngine->CalcTextWidth( aPaM.GetPara(), aPaM.GetIndex(), 1 );
+ aEditCursor.Right() += nWidth;
+ }
+ }
+
+ Size aOutSz = mpWindow->GetOutputSizePixel();
+ if ( aEditCursor.GetHeight() > aOutSz.Height() )
+ aEditCursor.Bottom() = aEditCursor.Top() + aOutSz.Height() - 1;
+
+ if ( bGotoCursor )
+ {
+ long nVisStartY = maStartDocPos.Y();
+ long nVisEndY = maStartDocPos.Y() + aOutSz.Height();
+ long nVisStartX = maStartDocPos.X();
+ long nVisEndX = maStartDocPos.X() + aOutSz.Width();
+ long nMoreX = aOutSz.Width() / 4;
+
+ Point aNewStartPos( maStartDocPos );
+
+ if ( aEditCursor.Bottom() > nVisEndY )
+ {
+ aNewStartPos.Y() += ( aEditCursor.Bottom() - nVisEndY );
+ }
+ else if ( aEditCursor.Top() < nVisStartY )
+ {
+ aNewStartPos.Y() -= ( nVisStartY - aEditCursor.Top() );
+ }
+
+ if ( aEditCursor.Right() > nVisEndX )
+ {
+ aNewStartPos.X() += ( aEditCursor.Right() - nVisEndX );
+
+ // Darfs ein bischen mehr sein?
+ aNewStartPos.X() += nMoreX;
+ }
+ else if ( aEditCursor.Left() < nVisStartX )
+ {
+ aNewStartPos.X() -= ( nVisStartX - aEditCursor.Left() );
+
+ // Darfs ein bischen mehr sein?
+ aNewStartPos.X() -= nMoreX;
+ }
+
+ // X kann durch das 'bischen mehr' falsch sein:
+// ULONG nMaxTextWidth = mpTextEngine->GetMaxTextWidth();
+// if ( !nMaxTextWidth || ( nMaxTextWidth > 0x7FFFFFFF ) )
+// nMaxTextWidth = 0x7FFFFFFF;
+// long nMaxX = (long)nMaxTextWidth - aOutSz.Width();
+ long nMaxX = mpTextEngine->CalcTextWidth() - aOutSz.Width();
+ if ( nMaxX < 0 )
+ nMaxX = 0;
+
+ if ( aNewStartPos.X() < 0 )
+ aNewStartPos.X() = 0;
+ else if ( aNewStartPos.X() > nMaxX )
+ aNewStartPos.X() = nMaxX;
+
+ // Y sollte nicht weiter unten als noetig liegen:
+ long nYMax = mpTextEngine->GetTextHeight() - aOutSz.Height();
+ if ( nYMax < 0 )
+ nYMax = 0;
+ if ( aNewStartPos.Y() > nYMax )
+ aNewStartPos.Y() = nYMax;
+
+ if ( aNewStartPos != maStartDocPos )
+ {
+ Scroll( -(aNewStartPos.X() - maStartDocPos.X()), -(aNewStartPos.Y() - maStartDocPos.Y()) );
+ mpTextEngine->Broadcast( TextHint( TEXT_HINT_VIEWSCROLLED ) );
+ }
+ }
+
+ Point aPoint( GetWindowPos( aEditCursor.TopLeft() ) );
+ mpCursor->SetPos( aPoint );
+ mpCursor->SetSize( aEditCursor.GetSize() );
+ if ( bForceVisCursor && mbCursorEnabled )
+ mpCursor->Show();
+}
+
+BOOL TextView::SetCursorAtPoint( const Point& rPosPixel )
+{
+// if ( !Rectangle( Point(), mpWindow->GetOutputSizePixel() ).IsInside( rPosPixel ) && !mbInSelection )
+// return FALSE;
+
+ mpTextEngine->CheckIdleFormatter();
+
+ Point aDocPos = GetDocPos( rPosPixel );
+
+ TextPaM aPaM = mpTextEngine->GetPaM( aDocPos );
+
+ // aTmpNewSel: Diff zwischen alt und neu, nicht die neue Selektion
+ TextSelection aTmpNewSel( maSelection.GetEnd(), aPaM );
+ maSelection.GetEnd() = aPaM;
+
+ if ( !mpSelEngine->HasAnchor() )
+ {
+ if ( maSelection.GetStart() != aPaM )
+ mpTextEngine->CursorMoved( maSelection.GetStart().GetPara() );
+ maSelection.GetStart() = aPaM;
+ }
+ else
+ {
+ ShowSelection( aTmpNewSel );
+ }
+
+ BOOL bForceCursor = mpDDInfo ? FALSE : TRUE; // && !mbInSelection
+ ImpShowCursor( mbAutoScroll, bForceCursor, FALSE );
+ return TRUE;
+}
+
+BOOL TextView::IsSelectionAtPoint( const Point& rPosPixel )
+{
+// if ( !Rectangle( Point(), mpWindow->GetOutputSizePixel() ).IsInside( rPosPixel ) && !mbInSelection )
+// return FALSE;
+
+ Point aDocPos = GetDocPos( rPosPixel );
+ TextPaM aPaM = mpTextEngine->GetPaM( aDocPos, FALSE );
+ // Bei Hyperlinks D&D auch ohne Selektion starten.
+ // BeginDrag wird aber nur gerufen, wenn IsSelectionAtPoint()
+ // Problem: IsSelectionAtPoint wird bei Command() nicht gerufen,
+ // wenn vorher im MBDown schon FALSE returnt wurde.
+ return ( IsInSelection( aPaM ) ||
+ ( /* mpSelEngine->IsInCommand() && */ mpTextEngine->FindAttrib( aPaM, TEXTATTR_HYPERLINK ) ) );
+}
+
+BOOL TextView::IsInSelection( const TextPaM& rPaM )
+{
+ TextSelection aSel = maSelection;
+ aSel.Justify();
+
+ ULONG nStartNode = aSel.GetStart().GetPara();
+ ULONG nEndNode = aSel.GetEnd().GetPara();
+ ULONG nCurNode = rPaM.GetPara();
+
+ if ( ( nCurNode > nStartNode ) && ( nCurNode < nEndNode ) )
+ return TRUE;
+
+ if ( nStartNode == nEndNode )
+ {
+ if ( nCurNode == nStartNode )
+ if ( ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) )
+ return TRUE;
+ }
+ else if ( ( nCurNode == nStartNode ) && ( rPaM.GetIndex() >= aSel.GetStart().GetIndex() ) )
+ return TRUE;
+ else if ( ( nCurNode == nEndNode ) && ( rPaM.GetIndex() < aSel.GetEnd().GetIndex() ) )
+ return TRUE;
+
+ return FALSE;
+}
+
+void TextView::ImpHideDDCursor()
+{
+ if ( mpDDInfo && mpDDInfo->mbVisCursor )
+ {
+ mpDDInfo->maCursor.Hide();
+ mpDDInfo->mbVisCursor = FALSE;
+ }
+}
+
+void TextView::ImpShowDDCursor()
+{
+ if ( !mpDDInfo->mbVisCursor )
+ {
+ Rectangle aCursor = mpTextEngine->PaMtoEditCursor( mpDDInfo->maDropPos, TRUE );
+ aCursor.Right()++;
+ aCursor.SetPos( GetWindowPos( aCursor.TopLeft() ) );
+
+ mpDDInfo->maCursor.SetWindow( mpWindow );
+ mpDDInfo->maCursor.SetPos( aCursor.TopLeft() );
+ mpDDInfo->maCursor.SetSize( aCursor.GetSize() );
+ mpDDInfo->maCursor.Show();
+ mpDDInfo->mbVisCursor = TRUE;
+ }
+}
+
+void TextView::BeginDrag()
+{
+ delete mpDDInfo;
+ mpDDInfo = new TextDDInfo;
+
+ mpDDInfo->mbStarterOfDD = TRUE;
+
+ DragServer::Clear();
+
+ TextSelection aSel( maSelection );
+ aSel.Justify();
+
+ // D&D eines Hyperlinks.
+ // Besser waere es im MBDown sich den MBDownPaM zu merken,
+ // ist dann aber inkompatibel => spaeter mal umstellen.
+ TextPaM aPaM( mpTextEngine->GetPaM( GetDocPos( GetWindow()->GetPointerPosPixel() ) ) );
+
+ const TextCharAttrib* pAttr = mpTextEngine->FindCharAttrib( aPaM, TEXTATTR_HYPERLINK );
+ if ( pAttr )
+ {
+ aSel = aPaM;
+ aSel.GetStart().GetIndex() = pAttr->GetStart();
+ aSel.GetEnd().GetIndex() = pAttr->GetEnd();
+
+ const TextAttribHyperLink& rLink = (const TextAttribHyperLink&)pAttr->GetAttr();
+ String aText( rLink.GetDescription() );
+ if ( !aText.Len() )
+ aText = mpTextEngine->GetText( aSel );
+ INetBookmark aBookmark( rLink.GetURL(), aText );
+ aBookmark.CopyDragServer();
+ }
+
+ DragServer::CopyString( mpTextEngine->GetText( aSel ) );
+
+ Region* pDDRegion = NULL;
+#ifdef MAC
+ // ... Region ermitteln
+ Size aOutSz = mpWindow->GetOutputSizePixel();
+ Rectangle aStartCursor( mpTextEngine->GetEditCursor( aSel.GetStart(), FALSE ) );
+ Rectangle aEndCursor( mpTextEngine->GetEditCursor( aSel.GetEnd(), TRUE ) );
+
+ Point aTopLeft = aStartCursor.TopLeft();
+ aTopLeft -= maStartDocPos;
+
+ Point aBottomRight = aStartCursor.BottomRight();
+ aBottomRight -= maStartDocPos;
+
+ if ( aStartCursor.Top() != aEndCursor.Top() )
+ {
+ // Dann einfach das Rechteck mit den kompletten Zeilem
+ aTopLeft.X() = 0;
+ aBottomRight.X() = aOutSz.Width();
+ }
+
+ pDDRegion = new Region( Rectangle( aTopLeft, aBottomRight ) );
+#endif
+
+ mpCursor->Hide();
+
+ mpWindow->ExecuteDrag( Pointer( POINTER_MOVEDATA ),
+ Pointer( POINTER_COPYDATA ), DRAG_ALL, pDDRegion );
+
+ DragServer::Clear();
+ ImpHideDDCursor();
+
+ delete mpDDInfo;
+ mpDDInfo = 0;
+}
+
+BOOL TextView::QueryDrop( DropEvent& rEvt )
+{
+ if ( rEvt.IsLeaveWindow() )
+ {
+ ImpHideDDCursor();
+ return FALSE;
+ }
+
+ BOOL bDrop = FALSE;
+ if ( !mbReadOnly && DragServer::HasFormat( 0, FORMAT_STRING ) &&
+ ( ( rEvt.GetAction() == DROP_COPY ) || ( rEvt.GetAction() == DROP_MOVE ) ) )
+ {
+ if ( !mpDDInfo )
+ mpDDInfo = new TextDDInfo;
+
+ TextPaM aPrevDropPos = mpDDInfo->maDropPos;
+ Point aDocPos = GetDocPos( rEvt.GetPosPixel() );
+ mpDDInfo->maDropPos = mpTextEngine->GetPaM( aDocPos );
+
+ Size aOutSize = mpWindow->GetOutputSizePixel();
+ if ( ( rEvt.GetPosPixel().X() < 0 ) || ( rEvt.GetPosPixel().X() > aOutSize.Width() ) ||
+ ( rEvt.GetPosPixel().Y() < 0 ) || ( rEvt.GetPosPixel().Y() > aOutSize.Height() ) )
+ {
+ // Scrollen ?
+ }
+
+ // Nicht in Selektion droppen:
+ if ( IsInSelection( mpDDInfo->maDropPos ) )
+ {
+ ImpHideDDCursor();
+ return FALSE;
+ }
+
+ // Alten Cursor wegzeichnen...
+ if ( !mpDDInfo->mbVisCursor || ( aPrevDropPos != mpDDInfo->maDropPos ) )
+ {
+ ImpHideDDCursor();
+ ImpShowDDCursor();
+ }
+ bDrop = TRUE;
+ }
+ return bDrop;
+}
+
+BOOL TextView::Drop( const DropEvent& rEvt )
+{
+ BOOL bDone = FALSE;
+ if ( !mbReadOnly && mpDDInfo )
+ {
+ ImpHideDDCursor();
+
+ // Daten fuer das loeschen nach einem DROP_MOVE:
+ TextSelection aPrevSel( maSelection );
+ aPrevSel.Justify();
+ ULONG nPrevParaCount = mpTextEngine->GetParagraphCount();
+ USHORT nPrevStartParaLen = mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() );
+
+ BOOL bStarterOfDD = FALSE;
+ for ( USHORT nView = mpTextEngine->GetViewCount(); nView && !bStarterOfDD; )
+ bStarterOfDD = mpTextEngine->GetView( --nView )->mpDDInfo ? mpTextEngine->GetView( nView )->mpDDInfo->mbStarterOfDD : FALSE;
+
+ HideSelection();
+ maSelection = mpDDInfo->maDropPos;
+
+ mpTextEngine->UndoActionStart( TEXTUNDO_DRAGANDDROP );
+
+ String aText = DragServer::PasteString( 0 );
+ aText.ConvertLineEnd( LINEEND_LF );
+
+ if ( aText.Len() && ( aText.GetChar( aText.Len()-1 ) == LINE_SEP ) )
+ aText.Erase( aText.Len()-1 );
+
+ if ( ImplCheckTextLen( aText ) )
+ maSelection = mpTextEngine->ImpInsertText( mpDDInfo->maDropPos, aText );
+
+ if ( aPrevSel.HasRange() &&
+ ( rEvt.GetAction() == DROP_MOVE ) || !bStarterOfDD )
+ {
+ // ggf. Selection anpasssen:
+ if ( ( mpDDInfo->maDropPos.GetPara() < aPrevSel.GetStart().GetPara() ) ||
+ ( ( mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
+ && ( mpDDInfo->maDropPos.GetIndex() < aPrevSel.GetStart().GetIndex() ) ) )
+ {
+ ULONG nNewParasBeforeSelection =
+ mpTextEngine->GetParagraphCount() - nPrevParaCount;
+
+ aPrevSel.GetStart().GetPara() += nNewParasBeforeSelection;
+ aPrevSel.GetEnd().GetPara() += nNewParasBeforeSelection;
+
+ if ( mpDDInfo->maDropPos.GetPara() == aPrevSel.GetStart().GetPara() )
+ {
+ USHORT nNewChars =
+ mpTextEngine->GetTextLen( aPrevSel.GetStart().GetPara() ) - nPrevStartParaLen;
+
+ aPrevSel.GetStart().GetIndex() += nNewChars;
+ if ( aPrevSel.GetStart().GetPara() == aPrevSel.GetEnd().GetPara() )
+ aPrevSel.GetEnd().GetIndex() += nNewChars;
+ }
+ }
+ else
+ {
+ // aktuelle Selektion anpassen
+ TextPaM aPaM = maSelection.GetStart();
+ aPaM.GetPara() -= ( aPrevSel.GetEnd().GetPara() - aPrevSel.GetStart().GetPara() );
+ if ( aPrevSel.GetEnd().GetPara() == mpDDInfo->maDropPos.GetPara() )
+ {
+ aPaM.GetIndex() -= aPrevSel.GetEnd().GetIndex();
+ if ( aPrevSel.GetStart().GetPara() == mpDDInfo->maDropPos.GetPara() )
+ aPaM.GetIndex() += aPrevSel.GetStart().GetIndex();
+ }
+ maSelection = aPaM;
+
+ }
+ mpTextEngine->ImpDeleteText( aPrevSel );
+ }
+
+ mpTextEngine->UndoActionEnd( TEXTUNDO_DRAGANDDROP );
+
+ delete mpDDInfo;
+ mpDDInfo = 0;
+
+ mpTextEngine->FormatAndUpdate( this );
+
+ mpTextEngine->Broadcast( TextHint( TEXT_HINT_MODIFIED ) );
+ }
+
+ return bDone;
+}
+
+void TextView::SetPaintSelection( BOOL bPaint )
+{
+ if ( bPaint != mbPaintSelection )
+ {
+ mbPaintSelection = bPaint;
+ ShowSelection( maSelection );
+ }
+}
+
+void TextView::SetHighlightSelection( BOOL bSelectByHighlight )
+{
+ if ( bSelectByHighlight != mbHighlightSelection )
+ {
+ // Falls umschalten zwischendurch moeglich...
+ mbHighlightSelection = bSelectByHighlight;
+ }
+}
+
+BOOL TextView::Read( SvStream& rInput )
+{
+ BOOL bDone = mpTextEngine->Read( rInput, &maSelection );
+ ShowCursor();
+ return bDone;
+}
+
+BOOL TextView::Write( SvStream& rOutput )
+{
+ return mpTextEngine->Read( rOutput, &maSelection );
+}
+
+BOOL TextView::ImplCheckTextLen( const String& rNewText )
+{
+ BOOL bOK = TRUE;
+ if ( mpTextEngine->GetMaxTextLen() )
+ {
+ ULONG n = mpTextEngine->GetTextLen();
+ n += rNewText.Len();
+ if ( n > mpTextEngine->GetMaxTextLen() )
+ {
+ // nur dann noch ermitteln, wie viel Text geloescht wird
+ n -= mpTextEngine->GetTextLen( maSelection );
+ if ( n > mpTextEngine->GetMaxTextLen() )
+ {
+ // Beep hat hier eigentlich nichts verloren, sondern lieber ein Hdl,
+ // aber so funktioniert es wenigstens in ME, BasicIDE, SourceView
+ Sound::Beep();
+ bOK = FALSE;
+ }
+ }
+ }
+ return bOK;
+}
+
+
+ // -------------------------------------------------------------------------
+// (+) class TextSelFunctionSet
+// -------------------------------------------------------------------------
+TextSelFunctionSet::TextSelFunctionSet( TextView* pView )
+{
+ mpView = pView;
+}
+
+void __EXPORT TextSelFunctionSet::BeginDrag()
+{
+ mpView->BeginDrag();
+}
+
+void __EXPORT TextSelFunctionSet::CreateAnchor()
+{
+// TextSelection aSel( mpView->GetSelection() );
+// aSel.GetStart() = aSel.GetEnd();
+// mpView->SetSelection( aSel );
+
+ // Es darf kein ShowCursor folgen:
+ mpView->HideSelection();
+ mpView->maSelection.GetStart() = mpView->maSelection.GetEnd();
+}
+
+BOOL __EXPORT TextSelFunctionSet::SetCursorAtPoint( const Point& rPointPixel, BOOL )
+{
+ return mpView->SetCursorAtPoint( rPointPixel );
+}
+
+BOOL __EXPORT TextSelFunctionSet::IsSelectionAtPoint( const Point& rPointPixel )
+{
+ return mpView->IsSelectionAtPoint( rPointPixel );
+}
+
+void __EXPORT TextSelFunctionSet::DeselectAll()
+{
+ CreateAnchor();
+}
+
+void __EXPORT TextSelFunctionSet::DeselectAtPoint( const Point& )
+{
+ // Nur bei Mehrfachselektion
+}
+
+void __EXPORT TextSelFunctionSet::DestroyAnchor()
+{
+ // Nur bei Mehrfachselektion
+}
+
diff --git a/svtools/source/edit/txtattr.cxx b/svtools/source/edit/txtattr.cxx
new file mode 100644
index 000000000000..d88a4afa64bd
--- /dev/null
+++ b/svtools/source/edit/txtattr.cxx
@@ -0,0 +1,157 @@
+/*************************************************************************
+ *
+ * $RCSfile: txtattr.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <txtattr.hxx>
+#include <vcl/font.hxx>
+
+
+
+
+TextAttrib::~TextAttrib()
+{
+}
+
+void TextAttrib::SetFont( Font& ) const
+{
+}
+
+TextAttrib* TextAttrib::Clone() const
+{
+ return NULL;
+}
+
+int TextAttrib::operator==( const TextAttrib& rAttr ) const
+{
+ return mnWhich == rAttr.mnWhich;
+}
+
+
+TextAttribFontColor::TextAttribFontColor( const Color& rColor )
+ : TextAttrib( TEXTATTR_FONTCOLOR ), maColor( rColor )
+{
+}
+
+TextAttribFontColor::TextAttribFontColor( const TextAttribFontColor& rAttr )
+ : TextAttrib( rAttr ), maColor( rAttr.maColor )
+{
+}
+
+TextAttribFontColor::~TextAttribFontColor()
+{
+}
+
+void TextAttribFontColor::SetFont( Font& rFont ) const
+{
+ rFont.SetColor( maColor );
+}
+
+TextAttrib* TextAttribFontColor::Clone() const
+{
+ return new TextAttribFontColor( *this );
+}
+
+int TextAttribFontColor::operator==( const TextAttrib& rAttr ) const
+{
+ return ( ( TextAttrib::operator==(rAttr ) ) &&
+ ( maColor == ((const TextAttribFontColor&)rAttr).maColor ) );
+}
+
+
+TextAttribHyperLink::TextAttribHyperLink( const XubString& rURL )
+ : TextAttrib( TEXTATTR_HYPERLINK ), maURL( rURL )
+{
+ maColor = COL_BLUE;
+}
+
+TextAttribHyperLink::TextAttribHyperLink( const XubString& rURL, const XubString& rDescription )
+ : TextAttrib( TEXTATTR_HYPERLINK ), maURL( rURL ), maDescription( rDescription )
+{
+ maColor = COL_BLUE;
+}
+
+TextAttribHyperLink::TextAttribHyperLink( const TextAttribHyperLink& rAttr )
+ : TextAttrib( rAttr ), maURL( rAttr.maURL ), maDescription( rAttr.maDescription )
+{
+ maColor = rAttr.maColor;
+}
+
+TextAttribHyperLink::~TextAttribHyperLink()
+{
+}
+
+void TextAttribHyperLink::SetFont( Font& rFont ) const
+{
+ rFont.SetColor( maColor );
+ rFont.SetUnderline( UNDERLINE_SINGLE );
+}
+
+TextAttrib* TextAttribHyperLink::Clone() const
+{
+ return new TextAttribHyperLink( *this );
+}
+
+int TextAttribHyperLink::operator==( const TextAttrib& rAttr ) const
+{
+ return ( ( TextAttrib::operator==(rAttr ) ) &&
+ ( maURL == ((const TextAttribHyperLink&)rAttr).maURL ) &&
+ ( maDescription == ((const TextAttribHyperLink&)rAttr).maDescription ) &&
+ ( maColor == ((const TextAttribHyperLink&)rAttr).maColor ) );
+}
diff --git a/svtools/source/edit/xtextedt.cxx b/svtools/source/edit/xtextedt.cxx
new file mode 100644
index 000000000000..0203f0727f02
--- /dev/null
+++ b/svtools/source/edit/xtextedt.cxx
@@ -0,0 +1,444 @@
+/*************************************************************************
+ *
+ * $RCSfile: xtextedt.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:58 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <xtextedt.hxx>
+#include <txtcmp.hxx>
+#include <vcl/svapp.hxx> // International
+
+ // -------------------------------------------------------------------------
+// class ExtTextEngine
+// -------------------------------------------------------------------------
+ExtTextEngine::ExtTextEngine() : maGroupChars( String::CreateFromAscii( "(){}[]", 6 ) )
+{
+}
+
+ExtTextEngine::~ExtTextEngine()
+{
+}
+
+TextSelection ExtTextEngine::MatchGroup( const TextPaM& rCursor ) const
+{
+ TextSelection aSel( rCursor );
+ USHORT nPos = rCursor.GetIndex();
+ ULONG nPara = rCursor.GetPara();
+ ULONG nParas = GetParagraphCount();
+ if ( ( nPara < nParas ) && ( nPos < GetTextLen( nPara ) ) )
+ {
+ USHORT nMatchChar = maGroupChars.Search( GetText( rCursor.GetPara() ).GetChar( nPos ) );
+ if ( nMatchChar != STRING_NOTFOUND )
+ {
+ if ( ( nMatchChar % 2 ) == 0 )
+ {
+ // Vorwaerts suchen...
+ sal_Unicode nSC = maGroupChars.GetChar( nMatchChar );
+ sal_Unicode nEC = maGroupChars.GetChar( nMatchChar+1 );
+
+ USHORT nCur = nPos+1;
+ USHORT nLevel = 1;
+ while ( nLevel && ( nPara < nParas ) )
+ {
+ XubString aStr = GetText( nPara );
+ while ( nCur < aStr.Len() )
+ {
+ if ( aStr.GetChar( nCur ) == nSC )
+ nLevel++;
+ else if ( aStr.GetChar( nCur ) == nEC )
+ {
+ nLevel--;
+ if ( !nLevel )
+ break; // while nCur...
+ }
+ nCur++;
+ }
+
+ if ( nLevel )
+ {
+ nPara++;
+ nCur = 0;
+ }
+ }
+ if ( nLevel == 0 ) // gefunden
+ {
+ aSel.GetStart() = rCursor;
+ aSel.GetEnd() = TextPaM( nPara, nCur+1 );
+ }
+ }
+ else
+ {
+ // Rueckwaerts suchen...
+ xub_Unicode nEC = maGroupChars.GetChar( nMatchChar );
+ xub_Unicode nSC = maGroupChars.GetChar( nMatchChar-1 );
+
+ USHORT nCur = rCursor.GetIndex()-1;
+ USHORT nLevel = 1;
+ while ( nLevel )
+ {
+ if ( GetTextLen( nPara ) )
+ {
+ XubString aStr = GetText( nPara );
+ while ( nCur )
+ {
+ if ( aStr.GetChar( nCur ) == nSC )
+ {
+ nLevel--;
+ if ( !nLevel )
+ break; // while nCur...
+ }
+ else if ( aStr.GetChar( nCur ) == nEC )
+ nLevel++;
+
+ nCur--;
+ }
+ }
+
+ if ( nLevel )
+ {
+ if ( nPara )
+ {
+ nPara--;
+ nCur = GetTextLen( nPara )-1; // egal ob negativ, weil if Len()
+ }
+ else
+ break;
+ }
+ }
+
+ if ( nLevel == 0 ) // gefunden
+ {
+ aSel.GetStart() = rCursor;
+ aSel.GetStart().GetIndex()++; // hinter das Zeichen
+ aSel.GetEnd() = TextPaM( nPara, nCur );
+ }
+ }
+ }
+ }
+ return aSel;
+}
+
+BOOL ExtTextEngine::Search( TextSelection& rSel, const SearchParam& rSearchParam, BOOL bForward )
+{
+ TextSelection aSel( rSel );
+ aSel.Justify();
+
+ TextPaM aStartPaM( aSel.GetEnd() );
+ if ( aSel.HasRange() && (
+ ( rSearchParam.IsSrchInSelection() && bForward ) ||
+ ( !rSearchParam.IsSrchInSelection() && !bForward ) ) )
+ {
+ aStartPaM = aSel.GetStart();
+ }
+
+ BOOL bFound = FALSE;
+ ULONG nStartNode, nEndNode;
+
+ if ( rSearchParam.IsSrchInSelection() )
+ nEndNode = bForward ? aSel.GetEnd().GetPara() : aSel.GetStart().GetPara();
+ else
+ nEndNode = bForward ? (GetParagraphCount()-1) : 0;
+
+ nStartNode = aStartPaM.GetPara();
+ SearchText aSearcher( rSearchParam, Application::GetAppInternational() );
+
+ // ueber die Absaetze iterieren...
+ for ( ULONG nNode = nStartNode;
+ bForward ? ( nNode <= nEndNode) : ( nNode >= nEndNode );
+ bForward ? nNode++ : nNode-- )
+ {
+ String aText = GetText( nNode );
+ USHORT nStartPos = 0;
+ USHORT nEndPos = aText.Len();
+ if ( nNode == nStartNode )
+ {
+ if ( bForward )
+ nStartPos = aStartPaM.GetIndex();
+ else
+ nEndPos = aStartPaM.GetIndex();
+ }
+ if ( ( nNode == nEndNode ) && rSearchParam.IsSrchInSelection() )
+ {
+ if ( bForward )
+ nEndPos = aSel.GetEnd().GetIndex();
+ else
+ nStartPos = aSel.GetStart().GetIndex();
+ }
+
+ if ( bForward )
+ bFound = aSearcher.SearchFrwrd( aText, &nStartPos, &nEndPos );
+ else
+ bFound = aSearcher.SearchBkwrd( aText, &nEndPos, &nStartPos );
+
+ if ( bFound )
+ {
+ rSel.GetStart().GetPara() = nNode;
+ rSel.GetStart().GetIndex() = nStartPos;
+ rSel.GetEnd().GetPara() = nNode;
+ rSel.GetEnd().GetIndex() = nEndPos;
+ // Ueber den Absatz selektieren?
+ if( nStartPos == (USHORT)(nEndPos+1) ) // USHORT fuer 0 und -1 !
+ {
+ if ( (rSel.GetEnd().GetPara()+1) < GetParagraphCount() )
+ {
+ rSel.GetEnd().GetPara()++;
+ rSel.GetEnd().GetIndex() = 0;
+ }
+ else
+ {
+ rSel.GetEnd().GetIndex() = nStartPos;
+ bFound = FALSE;
+ }
+ }
+ else if ( bForward && ( rSel.GetEnd().GetIndex() < aText.Len() ) )
+ rSel.GetEnd().GetIndex()++;
+ else if ( !bForward && ( rSel.GetStart().GetIndex() < aText.Len() ) )
+ rSel.GetStart().GetIndex()++;
+
+ break;
+ }
+
+ if ( !bForward && !nNode ) // Bei rueckwaertsuche, wenn nEndNode = 0:
+ break;
+ }
+
+ return bFound;
+}
+
+
+ // -------------------------------------------------------------------------
+// class ExtTextView
+// -------------------------------------------------------------------------
+ExtTextView::ExtTextView( ExtTextEngine* pEng, Window* pWindow )
+ : TextView( pEng, pWindow )
+{
+}
+
+ExtTextView::~ExtTextView()
+{
+}
+
+BOOL ExtTextView::MatchGroup()
+{
+ TextSelection aTmpSel( GetSelection() );
+ aTmpSel.Justify();
+ if ( ( aTmpSel.GetStart().GetPara() != aTmpSel.GetEnd().GetPara() ) ||
+ ( ( aTmpSel.GetEnd().GetIndex() - aTmpSel.GetStart().GetIndex() ) > 1 ) )
+ {
+ return FALSE;
+ }
+
+ TextSelection aMatchSel = ((ExtTextEngine*)GetTextEngine())->MatchGroup( aTmpSel.GetStart() );
+ if ( aMatchSel.HasRange() )
+ SetSelection( aMatchSel );
+
+ return aMatchSel.HasRange() ? TRUE : FALSE;
+}
+
+BOOL ExtTextView::Search( const SearchParam& rSearchParam, BOOL bForward )
+{
+ BOOL bFound = FALSE;
+ TextSelection aSel( GetSelection() );
+ if ( ((ExtTextEngine*)GetTextEngine())->Search( aSel, rSearchParam, bForward ) )
+ {
+ bFound = TRUE;
+ // Erstmal den Anfang des Wortes als Selektion einstellen,
+ // damit das ganze Wort in den sichtbaren Bereich kommt.
+ SetSelection( aSel.GetStart() );
+ ShowCursor( TRUE, FALSE );
+ }
+ else
+ {
+ aSel = GetSelection().GetEnd();
+ }
+
+ SetSelection( aSel );
+ ShowCursor();
+
+ return bFound;
+}
+
+USHORT ExtTextView::Replace( const SearchParam& rSearchParam, BOOL bAll, BOOL bForward )
+{
+ USHORT nFound = 0;
+
+ if ( !bAll )
+ {
+ if ( GetSelection().HasRange() )
+ {
+ InsertText( rSearchParam.GetReplaceStr() );
+ nFound = 1;
+ Search( rSearchParam, bForward ); // gleich zum naechsten
+ }
+ else
+ {
+ if( Search( rSearchParam, bForward ) )
+ nFound = 1;
+ }
+ }
+ else
+ {
+ // Der Writer ersetzt alle, vom Anfang bis Ende...
+
+ ExtTextEngine* pTextEngine = (ExtTextEngine*)GetTextEngine();
+
+ // HideSelection();
+ TextSelection aSel;
+ if ( rSearchParam.IsSrchInSelection() )
+ {
+ aSel = GetSelection();
+ aSel.Justify();
+ }
+
+ TextSelection aSearchSel( aSel );
+
+ BOOL bFound = pTextEngine->Search( aSel, rSearchParam, TRUE );
+ if ( bFound )
+ pTextEngine->UndoActionStart( XTEXTUNDO_REPLACEALL );
+ while ( bFound )
+ {
+ nFound++;
+
+ TextPaM aNewStart = pTextEngine->ImpInsertText( aSel, rSearchParam.GetReplaceStr() );
+ aSel = aSearchSel;
+ aSel.GetStart() = aNewStart;
+ bFound = pTextEngine->Search( aSel, rSearchParam, TRUE );
+ }
+ if ( nFound )
+ {
+ SetSelection( aSel.GetStart() );
+ pTextEngine->FormatAndUpdate( this );
+ pTextEngine->UndoActionEnd( XTEXTUNDO_REPLACEALL );
+ }
+ }
+ return nFound;
+}
+
+BOOL ExtTextView::ImpIndentBlock( BOOL bRight )
+{
+ BOOL bDone = FALSE;
+
+ TextSelection aSel = GetSelection();
+ aSel.Justify();
+
+ HideSelection();
+ GetTextEngine()->UndoActionStart( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+
+ ULONG nStartPara = aSel.GetStart().GetPara();
+ ULONG nEndPara = aSel.GetEnd().GetPara();
+ BOOL bIndentAll = TRUE;
+ if ( aSel.HasRange() && !aSel.GetEnd().GetIndex() )
+ {
+ nEndPara--; // den dann nicht einruecken...
+ }
+
+ for ( ULONG nPara = nStartPara; nPara <= nEndPara; nPara++ )
+ {
+ if ( bRight )
+ {
+ // Tabs hinzufuegen
+ GetTextEngine()->ImpInsertText( TextPaM( nPara, 0 ), '\t' );
+ bDone = TRUE;
+ }
+ else
+ {
+ // Tabs/Blanks entfernen
+ String aText = GetTextEngine()->GetText( nPara );
+ if ( aText.Len() && (
+ ( aText.GetChar( 0 ) == '\t' ) ||
+ ( aText.GetChar( 0 ) == ' ' ) ) )
+ {
+ GetTextEngine()->ImpDeleteText( TextSelection( TextPaM( nPara, 0 ), TextPaM( nPara, 1 ) ) );
+ bDone = TRUE;
+ }
+ }
+ }
+
+ GetTextEngine()->UndoActionEnd( bRight ? XTEXTUNDO_INDENTBLOCK : XTEXTUNDO_UNINDENTBLOCK );
+
+ BOOL bRange = aSel.HasRange();
+ if ( bRight )
+ {
+ aSel.GetStart().GetIndex()++;
+ if ( bRange && ( aSel.GetEnd().GetPara() == nEndPara ) )
+ aSel.GetEnd().GetIndex()++;
+ }
+ else
+ {
+ if ( aSel.GetStart().GetIndex() )
+ aSel.GetStart().GetIndex()--;
+ if ( bRange && aSel.GetEnd().GetIndex() )
+ aSel.GetEnd().GetIndex()--;
+ }
+
+ maSelection = aSel;
+ GetTextEngine()->FormatAndUpdate( this );
+
+ return bDone;
+}
+
+BOOL ExtTextView::IndentBlock()
+{
+ return ImpIndentBlock( TRUE );
+}
+
+BOOL ExtTextView::UnindentBlock()
+{
+ return ImpIndentBlock( FALSE );
+}
+
diff --git a/svtools/source/filerec/filerec.cxx b/svtools/source/filerec/filerec.cxx
new file mode 100644
index 000000000000..075090e9b076
--- /dev/null
+++ b/svtools/source/filerec/filerec.cxx
@@ -0,0 +1,1039 @@
+/*************************************************************************
+ *
+ * $RCSfile: filerec.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "filerec.hxx"
+
+//========================================================================
+
+SV_IMPL_VARARR( SfxUINT32s, UINT32 );
+
+//========================================================================
+
+/* Die folgenden Makros extrahieren Teilbereiche aus einem UINT32 Wert.
+ Diese UINT32-Werte werden anstelle der einzelnen Werte gestreamt,
+ um Calls zu sparen.
+*/
+
+#define SFX_REC_PRE(n) ( ((n) & 0x000000FF) )
+#define SFX_REC_OFS(n) ( ((n) & 0xFFFFFF00) >> 8 )
+#define SFX_REC_TYP(n) ( ((n) & 0x000000FF) )
+#define SFX_REC_VER(n) ( ((n) & 0x0000FF00) >> 8 )
+#define SFX_REC_TAG(n) ( ((n) & 0xFFFF0000) >> 16 )
+
+#define SFX_REC_CONTENT_VER(n) ( ((n) & 0x000000FF) )
+#define SFX_REC_CONTENT_OFS(n) ( ((n) & 0xFFFFFF00) >> 8 )
+
+//-------------------------------------------------------------------------
+
+/* Die folgenden Makros setzen Teilbereiche zu einem UINT32 Wert zusammen.
+ Diese UINT32-Werte werden anstelle der einzelnen Werte gestreamt,
+ um Calls zu sparen.
+*/
+
+#define SFX_REC_MINI_HEADER(nPreTag,nStartPos,nEndPos) \
+ ( UINT32(nPreTag) | \
+ UINT32(nEndPos-nStartPos-SFX_REC_HEADERSIZE_MINI) << 8 )
+
+#define SFX_REC_HEADER(nRecType,nContentTag,nContentVer) \
+ ( UINT32(nRecType) | \
+ ( UINT32(nContentVer) << 8 ) | \
+ ( UINT32(nContentTag) << 16 ) )
+
+#define SFX_REC_CONTENT_HEADER(nContentVer,n1StStartPos,nCurStartPos) \
+ ( UINT32(nContentVer) | \
+ UINT32( nCurStartPos - n1StStartPos ) << 8 )
+
+//=========================================================================
+
+UINT32 SfxMiniRecordWriter::Close
+(
+ FASTBOOL bSeekToEndOfRec /* TRUE (default)
+ Der Stream wird an das Ende des Records
+ positioniert.
+
+ FALSE
+ Der Stream wird an den Anfang des
+ Contents (also hinter den Header)
+ positioniert.
+ */
+)
+
+/* [Beschreibung]
+
+ Diese Methode schlie\st den Record. Dabei wird haupts"achlich der
+ Header geschrieben.
+
+ Wurde der Header bereits geschrieben, hat der Aufruf keine Wirkung.
+
+
+ [R"uckgabewert]
+
+ UINT32 != 0
+ Position im Stream, die direkt hinter dem Record liegt.
+ 'bSeekToEndOfRecord==TRUE'
+ => R"uckgabewert == aktuelle Stream-Position nach Aufruf
+
+ == 0
+ Der Header war bereits geschrieben worden.
+*/
+
+{
+ // wurde der Header noch nicht geschrieben?
+ if ( !_bHeaderOk )
+ {
+ // Header an den Anfang des Records schreiben
+ UINT32 nEndPos = _pStream->Tell();
+ _pStream->Seek( _nStartPos );
+ *_pStream << SFX_REC_MINI_HEADER( _nPreTag, _nStartPos, nEndPos );
+
+ // je nachdem ans Ende des Records seeken oder hinter Header bleiben
+ if ( bSeekToEndOfRec )
+ _pStream->Seek( nEndPos );
+
+ // Header wurde JETZT geschrieben
+ _bHeaderOk = TRUE;
+ return nEndPos;
+ }
+#ifdef DBG_UTIL
+ // mu\s Fix-Size-Record gepr"uft werden?
+ else if ( SFX_BOOL_DONTCARE == _bHeaderOk )
+ {
+ // Header auslesen, um Soll-Gr"o\se zu bestimmen
+ UINT32 nEndPos = _pStream->Tell();
+ _pStream->Seek( _nStartPos );
+ ULONG nHeader;
+ *_pStream >> nHeader;
+ _pStream->Seek( nEndPos );
+
+ // Soll-Gr"o\se mit Ist-Gr"o\se vergleichen
+ DBG_ASSERT( nEndPos - SFX_REC_OFS(nHeader) == _nStartPos + sizeof(UINT32),
+ "fixed record size incorrect" );
+ DbgOutf( "SfxFileRec: written record until %ul", nEndPos );
+ }
+#endif
+
+ // Record war bereits geschlossen
+ return 0;
+}
+
+//=========================================================================
+
+USHORT SfxMiniRecordReader::ScanRecordType
+(
+ SvStream* pStream /* <SvStream> an dessen aktueller Position
+ ein Record liegt, dessen Typ erkannt werden
+ soll.
+ */
+)
+
+/* [Beschreibung]
+
+ Mit dieser statischen Methode kann ermittelt werden, ob sich an der
+ aktuellen Position in einem Stream ein Record befindet, und der Typ
+ des Records kann ermittelt werden.
+
+ Die Position im Stream ist nach dem Aufruf aufver"andert.
+
+
+ [Anmerkung]
+
+ Die Record-Typen k"onnen zwar (abgesehen vom Drawing-Enginge-Record)
+ untereinander eindeutig erkannt werden, es besteht jedoch die Gefahr
+ der Verwechslung von Records mit normalen Daten. File-Formate sollten
+ darauf R"ucksicht nehmen. Handelt es sich um keinen Record, wird
+ am wahrscheinlichsten SFX_REC_TYPE_MINI zur"uckgeliefert, da dieser
+ Typ sich aufgrund seines sparsam kurzen Headers durch die k"urzeste
+ Kennung auszeichnet.
+
+
+ [R"uckgabewert]
+
+ USHORT SFX_REC_TYPE_EOR
+ An der aktuellen Position des Streams
+ steht eine End-Of-Records-Kennung.
+
+ SFX_REC_TYPE_MINI
+ Es handelt sich um einen SW3 kompatiblen
+ Mini-Record, dessen einzige Kennung sein
+ 'Mini-Tag' ist.
+
+ SFX_REC_TYPE_SINGLE
+ Es handelt sich um einen Extended-Record
+ mit einem einzigen Content, der durch eine
+ Version und ein Tag n"aher gekennzeichnet
+ ist.
+
+ SFX_REC_TYPE_FIXSIZE
+ Es handelt sich um einen Extended-Record
+ mit mehreren Contents gleicher Gr"o\se,
+ die gemeinsam durch eine einzige Version
+ und ein einziges gemeinsames Tag n"aher
+ gekennzeichnet sind.
+
+ SFX_REC_TYPE_VARSIZE
+ Es handelt sich um einen Extended-Record
+ mit mehreren Contents variabler Gr"o\se,
+ die gemeinsam durch eine einzige Version
+ und ein einziges gemeinsames Tag n"aher
+ gekennzeichnet sind.
+
+ SFX_REC_TYPE_MIXTAGS
+ Es handelt sich um einen Extended-Record
+ mit mehreren Contents variabler Gr"o\se,
+ die jeweils durch ein eignes Tag und
+ eine eigene Versions-Nummer n"aher
+ gekennzeichnet sind.
+
+ SFX_REC_TYPE_DRAWENG
+ Es handelt sich wahrscheinlich um einen
+ Drawing-Engine-Record. Dieser Record-Typ
+ kann von den Klassen dieser Gruppe nicht
+ interpretiert werden.
+*/
+
+{
+ // die ersten 4 Bytes als Mini-Header lesen
+ ULONG nHeader;
+ *pStream >> nHeader;
+
+ // k"onnte es sich um einen extended-Record handeln?
+ USHORT nPreTag = SFX_REC_PRE(nHeader);
+ if ( SFX_REC_PRETAG_EXT == nPreTag )
+ {
+ // die n"achsten 4 Bytes als extended-Header lesen
+ *pStream >> nHeader;
+
+ // Stream-Position restaurieren
+ pStream->SeekRel(-8);
+
+ // liegt eine g"ultige Record-Kennung vor?
+ USHORT nType = SFX_REC_TYP(nHeader);
+ if ( nType >= SFX_REC_TYPE_FIRST && nType <= SFX_REC_TYPE_LAST )
+ // entsprechenden extended-Record-Typ zur"uckliefern
+ return nType;
+
+ // sonst ist der Record-Typ unbekannt
+ return SFX_REC_TYPE_NONE;
+ }
+
+ // Stream-Position restaurieren
+ pStream->SeekRel(-4);
+
+ // liegt eine End-Of-Record-Kennung vor?
+ if ( SFX_REC_PRETAG_EOR == nPreTag )
+ return nPreTag;
+
+ // liegt ein Drawin-Engine-Record vor?
+ if ( nHeader == UINT32(*"DRMD") || nHeader == UINT32(*"DRVW") )
+ return SFX_REC_TYPE_DRAWENG;
+
+ // alle anderen sind grunds"atzlich g"ultige Mini-Records
+ return SFX_REC_TYPE_MINI;
+}
+
+//-------------------------------------------------------------------------
+
+FASTBOOL SfxMiniRecordReader::SetHeader_Impl( UINT32 nHeader )
+
+/* [Beschreibung]
+
+ Interne Methode zum nachtr"aglichen Verarbeiten eines extern gelesenen
+ Headers. Falls der Header eine End-Of-Records-Kennung darstellt,
+ wird am Stream ein Errorcode gesetzt und FALSE zur"uckgeliefert. Im
+ Fehlerfall wird der Stream jedoch nicht auf den Record-Anfang zur"uck-
+ gesetzt.
+*/
+
+{
+ FASTBOOL bRet = TRUE;
+
+ // Record-Ende und Pre-Tag aus dem Header ermitteln
+ _nEofRec = _pStream->Tell() + SFX_REC_OFS(nHeader);
+ _nPreTag = SFX_REC_PRE(nHeader);
+
+ // wenn End-Of-Record-Kennung, dann Fehler
+ if ( _nPreTag == SFX_REC_PRETAG_EOR )
+ {
+ _pStream->SetError( ERRCODE_IO_WRONGFORMAT );
+ bRet = FALSE;
+ }
+ return bRet;
+}
+
+//-------------------------------------------------------------------------
+
+SfxMiniRecordReader::SfxMiniRecordReader
+(
+ SvStream* pStream /* <SvStream>, an dessen aktueller
+ Position sich ein <SfxMiniRecord>
+ befindet.
+ */
+)
+
+/* [Beschreibung]
+
+ Dieser Ctor liest den Header eines <SfxMiniRecord> ab der aktuellen
+ Position von 'pStream'. Da grunds"atzlich fast 4-Byte Kombination ein
+ g"ultiger SfxMiniRecord-Header ist, bleiben die einzig m"oglichen
+ Fehler der EOF-Status des Streams, und ein SFX_REC_PRETAG_EOR
+ als Pre-Tag. Ein entsprechender Error-Code (ERRCODE_IO_EOF bzw.
+ ERRCODE_IO_WRONGFORMAT) ist dann am Stream gesetzt, dessen Position
+ dann au\serdem unver"andert ist.
+*/
+
+: _pStream( pStream ),
+ _bSkipped( FALSE )
+{
+ // Header einlesen
+ UINT32 nStartPos = pStream->Tell(); // um im Fehlerfall zur"uck zu-seeken
+ DBG( DbgOutf( "SfxFileRec: reading record at %ul", nStartPos ) );
+ UINT32 nHeader;
+ *pStream >> nHeader;
+
+ // Headerdaten extrahieren
+ SetHeader_Impl( nHeader );
+
+ // Fehlerbehandlung
+ if ( pStream->IsEof() )
+ _nPreTag = SFX_REC_PRETAG_EOR;
+ else if ( _nPreTag == SFX_REC_PRETAG_EOR )
+ pStream->SetError( ERRCODE_IO_WRONGFORMAT );
+ if ( !IsValid() )
+ pStream->Seek( nStartPos );
+}
+
+//-------------------------------------------------------------------------
+
+SfxMiniRecordReader::SfxMiniRecordReader
+(
+ SvStream* pStream, /* <SvStream>, an dessen aktueller
+ Position sich ein <SfxMiniRecord>
+ befindet.
+ */
+ BYTE nTag // Pre-Tag des gew"unschten Records
+)
+
+/* [Beschreibung]
+
+ Dieser Ctor interpretiert 'pStream' ab der aktuellen Position als
+ eine l"uckenlose Folge von, von dieser Klassen-Gruppe interpretierbaren,
+ Records. Der in dieser Folge erste als <SfxMiniRecord> interpretierbare
+ (also ggf. auch ein extended-Record) mit dem PreTag 'nTag' wird ge"offnet
+ und durch diese Instanz repr"asentiert.
+
+ Wird das Ende des Streams oder die Kennung SFX_REC_PRETAG_EOR
+ erreicht, bevor ein Record mit dem ge"unschten Pre-Tag gefunden wird,
+ ist die erzeugte Instanz ung"ultig ('IsValid() == FALSE'). Ein ent-
+ sprechender Error-Code (ERRCODE_IO_EOF bzw. ERRCODE_IO_WRONGFORMAT)
+ ist dann am Stream gesetzt, dessen Position ist dann au\serdem unver-
+ "andert.
+
+ Bei 'nTag==SFX_FILEREC_PRETAG_EOR' wird nicht versucht, einen Record
+ zu lesen, es wird sofort 'IsValid()' auf FALSE gesetzt und kein Error-Code
+ am Stream gesetzt. Dies ist dauzu gedacht, ohne 'new' und 'delete'
+ abw"rtskompatibel SfxMiniRecords einbauen zu k"onnen. Siehe dazu
+ <SfxItemSet::Load()>.
+
+
+ [Anwendungsvorschlag]
+
+ Wird dieser Ctor in einer bereits ausgelieferten Programmversion
+ verwendet, k"onnen in das File-Format jeweils davor kompatibel neue
+ Records mit einer anderen Kennung eingef"ugt werden. Diese werden
+ schlie\slich automatisch "uberlesen. Erkauft wird diese M"oglichkeit
+ allerdings mit etwas schlechterem Laufzeitverhalten im Vergleich mit
+ direktem 'drauf-los-lesen', der sich jedoch auf einen Vergleich zweier
+ Bytes reduziert, falls der gesuchte Record der erste in der Folge ist.
+*/
+
+: _pStream( pStream ),
+ _bSkipped( nTag == SFX_REC_PRETAG_EOR )
+{
+ // ggf. ignorieren (s.o.)
+ if ( _bSkipped )
+ {
+ _nPreTag = nTag;
+ return;
+ }
+
+ // StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen
+ UINT32 nStartPos = pStream->Tell();
+
+ // passenden Record suchen
+ while(TRUE)
+ {
+ // Header lesen
+ DBG( DbgOutf( "SfxFileRec: searching record at %ul", pStream->Tell() ) );
+ UINT32 nHeader;
+ *pStream >> nHeader;
+
+ // Headerdaten von Basisklasse extrahieren lassen
+ SetHeader_Impl( nHeader );
+
+ // ggf. Fehler behandeln
+ if ( pStream->IsEof() )
+ _nPreTag = SFX_REC_PRETAG_EOR;
+ else if ( _nPreTag == SFX_REC_PRETAG_EOR )
+ pStream->SetError( ERRCODE_IO_WRONGFORMAT );
+ else
+ {
+ // wenn gefunden, dann Schleife abbrechen
+ if ( _nPreTag == nTag )
+ break;
+
+ // sonst skippen und weitersuchen
+ pStream->Seek( _nEofRec );
+ continue;
+ }
+
+ // Fehler => zur"uck-seeken
+ pStream->Seek( nStartPos );
+ break;
+ }
+}
+
+//=========================================================================
+
+SfxSingleRecordWriter::SfxSingleRecordWriter
+(
+ BYTE nRecordType, // f"ur Subklassen
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ UINT16 nContentTag, // Inhalts-Art-Kennung
+ BYTE nContentVer // Inhalts-Versions-Kennung
+)
+
+/* [Beschreibung]
+
+ Interner Ctor f"ur Subklassen.
+*/
+
+: SfxMiniRecordWriter( pStream, SFX_REC_PRETAG_EXT )
+{
+ // Erweiterten Header hiner den des SfxMiniRec schreiben
+ *pStream << SFX_REC_HEADER(nRecordType, nContentTag, nContentVer);
+}
+
+//-------------------------------------------------------------------------
+
+SfxSingleRecordWriter::SfxSingleRecordWriter
+(
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ UINT16 nContentTag, // Inhalts-Art-Kennung
+ BYTE nContentVer // Inhalts-Versions-Kennung
+)
+
+/* [Beschreibung]
+
+ Legt in 'pStream' einen 'SfxSingleRecord' an, dessen Content-Gr"o\se
+ nicht bekannt ist, sondern nach dam Streamen des Contents errechnet
+ werden soll.
+*/
+
+: SfxMiniRecordWriter( pStream, SFX_REC_PRETAG_EXT )
+{
+ // Erweiterten Header hiner den des SfxMiniRec schreiben
+ *pStream << SFX_REC_HEADER( SFX_REC_TYPE_SINGLE, nContentTag, nContentVer);
+}
+
+//-------------------------------------------------------------------------
+
+SfxSingleRecordWriter::SfxSingleRecordWriter
+(
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ UINT16 nContentTag, // Inhalts-Art-Kennung
+ BYTE nContentVer, // Inhalts-Versions-Kennung
+ UINT32 nContentSize // Gr"o\se des Inhalts in Bytes
+)
+
+/* [Beschreibung]
+
+ Legt in 'pStream' einen 'SfxSingleRecord' an, dessen Content-Gr"o\se
+ von vornherein bekannt ist.
+*/
+
+: SfxMiniRecordWriter( pStream, SFX_REC_PRETAG_EXT,
+ nContentSize + SFX_REC_HEADERSIZE_SINGLE )
+{
+ // Erweiterten Header hinter den des SfxMiniRec schreiben
+ *pStream << SFX_REC_HEADER( SFX_REC_TYPE_SINGLE, nContentTag, nContentVer);
+}
+
+//=========================================================================
+
+inline FASTBOOL SfxSingleRecordReader::ReadHeader_Impl( USHORT nTypes )
+
+/* [Beschreibung]
+
+ Interne Methode zum Einlesen eines SfxMultiRecord-Headers, nachdem
+ die Basisklasse bereits initialisiert und deren Header gelesen ist.
+ Ggf. ist ein Error-Code am Stream gesetzt, im Fehlerfall wird jedoch
+ nicht zur"uckge-seekt.
+*/
+
+{
+ FASTBOOL bRet;
+
+ // Basisklassen-Header einlesen
+ UINT32 nHeader;
+ *_pStream >> nHeader;
+ if ( !SetHeader_Impl( nHeader ) )
+ bRet = FALSE;
+ else
+ {
+ // eigenen Header einlesen
+ *_pStream >> nHeader;
+ _nRecordVer = SFX_REC_VER(nHeader);
+ _nRecordTag = SFX_REC_TAG(nHeader);
+
+ // falscher Record-Typ?
+ _nRecordType = SFX_REC_TYP(nHeader);
+ bRet = 0 != ( nTypes & _nRecordType);
+ }
+ return bRet;
+}
+
+//-------------------------------------------------------------------------
+
+SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream )
+: SfxMiniRecordReader()
+{
+ // Startposition merken, um im Fehlerfall zur"uck-seeken zu k"onnen
+ UINT32 nStartPos = pStream->Tell();
+ DBG( DbgOutf( "SfxFileRec: reading record at %ul", nStartPos ) );
+
+ // Basisklasse initialisieren (nicht via Ctor, da der nur MiniRecs akzept.)
+ Construct_Impl( pStream );
+
+ // nur Header mit korrektem Record-Type akzeptieren
+ if ( !ReadHeader_Impl( SFX_REC_TYPE_SINGLE ) )
+ {
+ // Error-Code setzen und zur"uck-seeken
+ pStream->SeekRel( - SFX_REC_HEADERSIZE_SINGLE );
+ pStream->SetError( ERRCODE_IO_WRONGFORMAT );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxSingleRecordReader::SfxSingleRecordReader( SvStream *pStream, USHORT nTag )
+{
+ // StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen
+ UINT32 nStartPos = pStream->Tell();
+
+ // richtigen Record suchen, ggf. Error-Code setzen und zur"uck-seeken
+ Construct_Impl( pStream );
+ if ( !FindHeader_Impl( SFX_REC_TYPE_SINGLE, nTag ) )
+ {
+ // Error-Code setzen und zur"uck-seeken
+ pStream->Seek( nStartPos );
+ pStream->SetError( ERRCODE_IO_WRONGFORMAT );
+ }
+}
+
+//-------------------------------------------------------------------------
+
+FASTBOOL SfxSingleRecordReader::FindHeader_Impl
+(
+ UINT16 nTypes, // arithm. Veroderung erlaubter Record-Typen
+ UINT16 nTag // zu findende Record-Art-Kennung
+)
+
+/* [Beschreibung]
+
+ Interne Methode zum lesen des Headers des ersten Record, der einem
+ der Typen in 'nTypes' entspricht und mit der Art-Kennung 'nTag'
+ gekennzeichnet ist.
+
+ Kann ein solcher Record nicht gefunden werden, wird am Stream ein
+ Errorcode gesetzt, zur"uck-geseekt und FALSE zur"uckgeliefert.
+*/
+
+{
+ // StartPos merken, um im Fehlerfall zur"uck-seeken zu k"onnen
+ UINT32 nStartPos = _pStream->Tell();
+
+ // richtigen Record suchen
+ while ( !_pStream->IsEof() )
+ {
+ // Header lesen
+ UINT32 nHeader;
+ DBG( DbgOutf( "SfxFileRec: searching record at %ul", _pStream->Tell() ) );
+ *_pStream >> nHeader;
+ if ( !SetHeader_Impl( nHeader ) )
+ // EOR => Such-Schleife abbreichen
+ break;
+
+ // Extended Record gefunden?
+ if ( _nPreTag == SFX_REC_PRETAG_EXT )
+ {
+ // Extended Header lesen
+ *_pStream >> nHeader;
+ _nRecordTag = SFX_REC_TAG(nHeader);
+
+ // richtigen Record gefunden?
+ if ( _nRecordTag == nTag )
+ {
+ // gefundener Record-Typ passend?
+ _nRecordType = SFX_REC_TYP(nHeader);
+ if ( nTypes & _nRecordType )
+ // ==> gefunden
+ return TRUE;
+
+ // error => Such-Schleife abbrechen
+ break;
+ }
+ }
+
+ // sonst skippen
+ if ( !_pStream->IsEof() )
+ _pStream->Seek( _nEofRec );
+ }
+
+ // Fehler setzen und zur"uck-seeken
+ _pStream->SetError( ERRCODE_IO_WRONGFORMAT );
+ _pStream->Seek( nStartPos );
+ return FALSE;
+}
+
+//=========================================================================
+
+SfxMultiFixRecordWriter::SfxMultiFixRecordWriter
+(
+ BYTE nRecordType, // Subklassen Record-Kennung
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ UINT16 nContentTag, // Content-Art-Kennung
+ BYTE nContentVer, // Content-Versions-Kennung
+ UINT32 nContentSize // Gr"o\se jedes einzelnen Contents in Bytes
+)
+
+/* [Beschreibung]
+
+ Interne Methode f"ur Subklassen.
+*/
+
+: SfxSingleRecordWriter( nRecordType, pStream, nContentTag, nContentVer ),
+ _nContentCount( 0 )
+{
+ // Platz f"ur eigenen Header
+ pStream->SeekRel( + SFX_REC_HEADERSIZE_MULTI );
+}
+
+//------------------------------------------------------------------------
+
+SfxMultiFixRecordWriter::SfxMultiFixRecordWriter
+(
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ UINT16 nContentTag, // Content-Art-Kennung
+ BYTE nContentVer, // Content-Versions-Kennung
+ UINT32 nContentSize // Gr"o\se jedes einzelnen Contents in Bytes
+)
+
+/* [Beschreibung]
+
+ Legt in 'pStream' einen 'SfxMultiFixRecord' an, dessen Content-Gr"o\se
+ konstant und von vornherein bekannt ist.
+*/
+
+: SfxSingleRecordWriter( SFX_REC_TYPE_FIXSIZE,
+ pStream, nContentTag, nContentVer ),
+ _nContentCount( 0 )
+{
+ // Platz f"ur eigenen Header
+ pStream->SeekRel( + SFX_REC_HEADERSIZE_MULTI );
+}
+
+//------------------------------------------------------------------------
+
+UINT32 SfxMultiFixRecordWriter::Close( FASTBOOL bSeekToEndOfRec )
+
+// siehe <SfxMiniRecordWriter>
+
+{
+ // Header noch nicht geschrieben?
+ if ( !_bHeaderOk )
+ {
+ // Position hinter Record merken, um sie restaurieren zu k"onnen
+ UINT32 nEndPos = SfxSingleRecordWriter::Close( FALSE );
+
+ // gegen"uber SfxSingleRecord erweiterten Header schreiben
+ *_pStream << _nContentCount;
+ *_pStream << _nContentSize;
+
+ // je nachdem ans Ende des Records seeken oder hinter Header bleiben
+ if ( bSeekToEndOfRec )
+ _pStream->Seek(nEndPos);
+ return nEndPos;
+ }
+
+ // Record war bereits geschlossen
+ return 0;
+}
+
+//=========================================================================
+
+SfxMultiVarRecordWriter::SfxMultiVarRecordWriter
+(
+ BYTE nRecordType, // Record-Kennung der Subklasse
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ UINT16 nRecordTag, // Gesamt-Art-Kennung
+ BYTE nRecordVer // Gesamt-Versions-Kennung
+)
+
+/* [Beschreibung]
+
+ Interner Ctor f"ur Subklassen.
+*/
+
+: SfxMultiFixRecordWriter( nRecordType, pStream, nRecordTag, nRecordVer, 0 ),
+ _nContentVer( 0 )
+{
+}
+
+//-------------------------------------------------------------------------
+
+SfxMultiVarRecordWriter::SfxMultiVarRecordWriter
+(
+ SvStream* pStream, // Stream, in dem der Record angelegt wird
+ UINT16 nRecordTag, // Gesamt-Art-Kennung
+ BYTE nRecordVer // Gesamt-Versions-Kennung
+)
+
+/* [Beschreibung]
+
+ Legt in 'pStream' einen 'SfxMultiVarRecord' an, dessen Content-Gr"o\sen
+ weder bekannt sind noch identisch sein m"ussen, sondern jeweils nach dem
+ Streamen jedes einzelnen Contents errechnet werden sollen.
+
+
+ [Anmerkung]
+
+ Diese Methode ist nicht inline, da f"ur die Initialisierung eines
+ <SvULongs>-Members zu viel Code generiert werden w"urde.
+*/
+
+: SfxMultiFixRecordWriter( SFX_REC_TYPE_VARSIZE,
+ pStream, nRecordTag, nRecordVer, 0 ),
+ _nContentVer( 0 )
+{
+}
+
+//-------------------------------------------------------------------------
+
+SfxMultiVarRecordWriter::~SfxMultiVarRecordWriter()
+
+/* [Beschreibung]
+
+ Der Dtor der Klasse <SfxMultiVarRecordWriter> schlie\st den Record
+ automatisch, falls <SfxMultiVarRecordWriter::Close()> nicht bereits
+ explizit gerufen wurde.
+*/
+
+{
+ // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden
+ if ( !_bHeaderOk )
+ Close();
+}
+
+//-------------------------------------------------------------------------
+
+void SfxMultiVarRecordWriter::FlushContent_Impl()
+
+/* [Beschreibung]
+
+ Interne Methode zum Abschlie\sen eines einzelnen Contents.
+*/
+
+{
+ // Versions-Kennung und Positions-Offset des aktuellen Contents merken;
+ // das Positions-Offset ist relativ zur Startposition des ersten Contents
+ _aContentOfs.Insert(
+ SFX_REC_CONTENT_HEADER(_nContentVer,_nStartPos,_nContentStartPos),
+ _nContentCount-1 );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxMultiVarRecordWriter::NewContent()
+
+// siehe <SfxMultiFixRecordWriter>
+
+{
+ // schon ein Content geschrieben?
+ if ( _nContentCount )
+ FlushContent_Impl();
+
+ // neuen Content beginnen
+ _nContentStartPos = _pStream->Tell();
+ ++_nContentCount;
+}
+
+//-------------------------------------------------------------------------
+
+UINT32 SfxMultiVarRecordWriter::Close( FASTBOOL bSeekToEndOfRec )
+
+// siehe <SfxMiniRecordWriter>
+
+{
+ // Header noch nicht geschrieben?
+ if ( !_bHeaderOk )
+ {
+ // ggf. letzten Content abschlie\sen
+ if ( _nContentCount )
+ FlushContent_Impl();
+
+ // Content-Offset-Tabelle schreiben
+ UINT32 nContentOfsPos = _pStream->Tell();
+ //! darf man das so einr"ucken?
+ #if defined(__LITTLEENDIAN)
+ _pStream->Write( _aContentOfs.GetData(),
+ sizeof(UINT32)*_nContentCount );
+ #else
+ for ( USHORT n = 0; n < _nContentCount; ++n )
+ *_pStream << UINT32(_aContentOfs[n]);
+ #endif
+
+ // SfxMultiFixRecordWriter::Close() "uberspringen!
+ UINT32 nEndPos = SfxSingleRecordWriter::Close( FALSE );
+
+ // eigenen Header schreiben
+ *_pStream << _nContentCount;
+ if ( SFX_REC_TYPE_VARSIZE_RELOC == _nPreTag ||
+ SFX_REC_TYPE_MIXTAGS_RELOC == _nPreTag )
+ *_pStream << nContentOfsPos - ( _pStream->Tell() + sizeof(UINT32) );
+ else
+ *_pStream << nContentOfsPos;
+
+ // ans Ende des Records seeken bzw. am Ende des Headers bleiben
+ if ( bSeekToEndOfRec )
+ _pStream->Seek(nEndPos);
+ return nEndPos;
+ }
+
+ // Record war bereits vorher geschlossen
+ return 0;
+}
+
+//=========================================================================
+
+void SfxMultiMixRecordWriter::NewContent
+(
+ UINT16 nContentTag, // Kennung f"ur die Art des Contents
+ BYTE nContentVer // Kennung f"ur die Version des Contents
+)
+
+/* [Beschreibung]
+
+ Mit dieser Methode wird in den Record ein neuer Content eingef"ugt
+ und dessen Content-Tag sowie dessen Content-Version angegeben. Jeder,
+ auch der 1. Record mu\s durch Aufruf dieser Methode eingeleitet werden.
+*/
+
+{
+ // ggf. vorherigen Record abschlie\sen
+ if ( _nContentCount )
+ FlushContent_Impl();
+
+ // Tag vor den Content schreiben, Version und Startposition merken
+ _nContentStartPos = _pStream->Tell();
+ ++_nContentCount;
+ *_pStream << nContentTag;
+ _nContentVer = nContentVer;
+}
+
+//=========================================================================
+
+FASTBOOL SfxMultiRecordReader::ReadHeader_Impl()
+
+/* [Beschreibung]
+
+ Interne Methode zum Einlesen eines SfxMultiRecord-Headers, nachdem
+ die Basisklasse bereits initialisiert und deren Header gelesen ist.
+ Ggf. ist ein Error-Code am Stream gesetzt, im Fehlerfall wird jedoch
+ nicht zur"uckge-seekt.
+*/
+
+{
+ // eigenen Header lesen
+ *_pStream >> _nContentCount;
+ *_pStream >> _nContentSize; // Fix: jedes einzelnen, Var|Mix: Tabellen-Pos.
+
+ // mu\s noch eine Tabelle mit Content-Offsets geladen werden?
+ if ( _nRecordType != SFX_REC_TYPE_FIXSIZE )
+ {
+ // Tabelle aus dem Stream einlesen
+ UINT32 nContentPos = _pStream->Tell();
+ if ( _nRecordType == SFX_REC_TYPE_VARSIZE_RELOC ||
+ _nRecordType == SFX_REC_TYPE_MIXTAGS_RELOC )
+ _pStream->SeekRel( + _nContentSize );
+ else
+ _pStream->Seek( _nContentSize );
+ _pContentOfs = new UINT32[_nContentCount];
+ //! darf man jetzt so einr"ucken
+ #if defined(__LITTLEENDIAN)
+ _pStream->Read( _pContentOfs, sizeof(UINT32)*_nContentCount );
+ #else
+ for ( USHORT n = 0; n < _nContentCount; ++n )
+ *_pStream >> _pContentOfs[n];
+ #endif
+ _pStream->Seek( nContentPos );
+ }
+
+ // Header konnte gelesen werden, wenn am Stream kein Error gesetzt ist
+ return !_pStream->GetError();
+}
+
+//-------------------------------------------------------------------------
+
+SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream )
+: _nContentNo(0), _pContentOfs( NULL )
+{
+ // Position im Stream merken, um im Fehlerfall zur"uck-seeken zu k"onnen
+ _nStartPos = pStream->Tell();
+
+ // Basisklasse konstruieren (normaler Ctor w"urde nur SingleRecs lesen)
+ SfxSingleRecordReader::Construct_Impl( pStream );
+
+ // Header der Basisklasse lesen
+ if ( !SfxSingleRecordReader::ReadHeader_Impl( SFX_REC_TYPE_FIXSIZE |
+ SFX_REC_TYPE_VARSIZE | SFX_REC_TYPE_VARSIZE_RELOC |
+ SFX_REC_TYPE_MIXTAGS | SFX_REC_TYPE_MIXTAGS_RELOC ) ||
+ !ReadHeader_Impl() )
+ // als ung"ultig markieren und zur"uck-seeken
+ SetInvalid_Impl( _nStartPos );
+}
+
+//-------------------------------------------------------------------------
+
+SfxMultiRecordReader::SfxMultiRecordReader( SvStream *pStream, UINT16 nTag )
+: _nContentNo(0)
+{
+ // Position im Stream merken, um im Fehlerfall zur"uck-seeken zu k"onnen
+ _nStartPos = pStream->Tell();
+
+ // passenden Record suchen und Basisklasse initialisieren
+ SfxSingleRecordReader::Construct_Impl( pStream );
+ if ( SfxSingleRecordReader::FindHeader_Impl( SFX_REC_TYPE_FIXSIZE |
+ SFX_REC_TYPE_VARSIZE | SFX_REC_TYPE_VARSIZE_RELOC |
+ SFX_REC_TYPE_MIXTAGS | SFX_REC_TYPE_MIXTAGS_RELOC,
+ nTag ) )
+ {
+ // eigenen Header dazu-lesen
+ if ( !ReadHeader_Impl() )
+ // nicht lesbar => als ung"ultig markieren und zur"uck-seeken
+ SetInvalid_Impl( _nStartPos);
+ }
+}
+
+//-------------------------------------------------------------------------
+
+SfxMultiRecordReader::~SfxMultiRecordReader()
+{
+ delete _pContentOfs;
+}
+
+//-------------------------------------------------------------------------
+
+FASTBOOL SfxMultiRecordReader::GetContent()
+
+/* [Beschreibung]
+
+ Positioniert den Stream an den Anfang des n"chsten bzw. beim 1. Aufruf
+ auf den Anfang des ersten Contents im Record und liest ggf. dessen
+ Header ein.
+
+ Liegt laut Record-Header kein Content mehr vor, wird FALSE zur"uck-
+ gegeben. Trotz einem TRUE-Returnwert kann am Stream ein Fehlercode
+ gesetzt sein, z.B. falls er unvorhergesehenerweise (kaputtes File)
+ zuende ist.
+*/
+
+{
+ // noch ein Content vorhanden?
+ if ( _nContentNo < _nContentCount )
+ {
+ // den Stream an den Anfang des Contents positionieren
+ UINT32 nOffset = _nRecordType == SFX_REC_TYPE_FIXSIZE
+ ? _nContentNo * _nContentSize
+ : SFX_REC_CONTENT_OFS(_pContentOfs[_nContentNo]);
+ UINT32 nNewPos = _nStartPos + nOffset;
+ DBG_ASSERT( nNewPos >= _pStream->Tell(), "SfxMultiRecordReader::GetContent() - New position before current, to much data red!" );
+ if ( nNewPos > _pStream->Tell() )
+ _pStream->Seek( nNewPos );
+
+ // ggf. Content-Header lesen
+ if ( _nRecordType == SFX_REC_TYPE_MIXTAGS ||
+ _nRecordType == SFX_REC_TYPE_MIXTAGS_RELOC )
+ {
+ _nContentVer = SFX_REC_CONTENT_VER(_pContentOfs[_nContentNo]);
+ *_pStream >> _nContentTag;
+ }
+
+ // ContentNo weiterz"ahlen
+ ++_nContentNo;
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
diff --git a/svtools/source/filerec/makefile.mk b/svtools/source/filerec/makefile.mk
new file mode 100644
index 000000000000..d190b7dcf097
--- /dev/null
+++ b/svtools/source/filerec/makefile.mk
@@ -0,0 +1,85 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=filerec
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES = \
+ filerec.cxx
+
+SLOFILES = \
+ $(SLO)$/filerec.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.cxx b/svtools/source/filter.vcl/filter/dlgejpg.cxx
new file mode 100644
index 000000000000..3bd89b7f0c13
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/dlgejpg.cxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * $RCSfile: dlgejpg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#pragma hdrstop
+
+#include "dlgejpg.hxx"
+#include "dlgejpg.hrc"
+#include "strings.hrc"
+
+#define KEY_QUALITY "JPG-EXPORT-QUALITY"
+#define KEY_GRAYSCALES "JPG_EXPORT_COLORMODE"
+
+/*************************************************************************
+|*
+|* Ctor
+|*
+\************************************************************************/
+
+DlgExportEJPG::DlgExportEJPG( FltCallDialogParameter& rPara ) :
+ ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_JPG, rPara.pResMgr ) ),
+ aFiDescr ( this, ResId( FI_DESCR ) ),
+ aNumFldQuality ( this, ResId( NUM_FLD_QUALITY ) ),
+ aGrpQuality ( this, ResId( GRP_QUALITY ) ),
+ aRbGray ( this, ResId( RB_GRAY ) ),
+ aRbRGB ( this, ResId( RB_RGB ) ),
+ aGrpColors ( this, ResId( GRP_COLORS ) ),
+ aBtnOK ( this, ResId( BTN_OK ) ),
+ aBtnCancel ( this, ResId( BTN_CANCEL ) ),
+ aBtnHelp ( this, ResId( BTN_HELP ) ),
+ pConfig ( rPara.pCfg ),
+ pMgr ( rPara.pResMgr )
+{
+ FreeResource();
+
+ // Config-Parameter lesen
+ ByteString aStr( pConfig->ReadKey( KEY_QUALITY ) );
+
+ if ( !aStr.Len() )
+ aNumFldQuality.SetValue( 75 );
+ else
+ aNumFldQuality.SetValue( aStr.ToInt32() );
+
+ if ( pConfig->ReadKey( KEY_GRAYSCALES ).ToInt32() )
+ aRbGray.Check( TRUE );
+ else
+ aRbRGB.Check( TRUE );
+
+ aBtnOK.SetClickHdl( LINK( this, DlgExportEJPG, OK ) );
+}
+
+
+/*************************************************************************
+|*
+|* Speichert eingestellte Werte in ini-Datei
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportEJPG, OK, void *, EMPTYARG )
+{
+ // Config-Parameter schreiben
+ pConfig->WriteKey( KEY_QUALITY, ByteString::CreateFromInt32( (long)aNumFldQuality.GetValue() ) );
+ pConfig->WriteKey( KEY_GRAYSCALES, ByteString::CreateFromInt32( (sal_Int32)aRbGray.IsChecked() ) );
+
+ EndDialog( RET_OK );
+
+ return 0;
+}
+
+
+
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hrc b/svtools/source/filter.vcl/filter/dlgejpg.hrc
new file mode 100644
index 000000000000..f93826427388
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/dlgejpg.hrc
@@ -0,0 +1,73 @@
+/*************************************************************************
+ *
+ * $RCSfile: dlgejpg.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "svtools.hrc"
+
+#define BTN_OK 1
+#define BTN_CANCEL 1
+#define BTN_HELP 1
+#define FI_DESCR 1
+#define NUM_FLD_QUALITY 1
+#define GRP_QUALITY 1
+#define GRP_COLORS 2
+#define RB_GRAY 1
+#define RB_RGB 2
+
+
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.hxx b/svtools/source/filter.vcl/filter/dlgejpg.hxx
new file mode 100644
index 000000000000..faddda9c262e
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/dlgejpg.hxx
@@ -0,0 +1,105 @@
+/*************************************************************************
+ *
+ * $RCSfile: dlgejpg.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _DLGEJPG_HXX_
+#define _DLGEJPG_HXX_
+
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/group.hxx>
+#include <vcl/lstbox.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/config.hxx>
+#include "stdctrl.hxx"
+#include <fltcall.hxx>
+
+/*************************************************************************
+|*
+|* Dialog zum Einstellen von Filteroptionen
+|*
+\************************************************************************/
+class DlgExportEJPG : public ModalDialog
+{
+private:
+ FixedInfo aFiDescr;
+ NumericField aNumFldQuality;
+ GroupBox aGrpQuality;
+ RadioButton aRbGray;
+ RadioButton aRbRGB;
+ GroupBox aGrpColors;
+ OKButton aBtnOK;
+ CancelButton aBtnCancel;
+ HelpButton aBtnHelp;
+
+ Config* pConfig;
+ ResMgr* pMgr;
+
+ DECL_LINK( OK, void * );
+
+public:
+ DlgExportEJPG( FltCallDialogParameter& rDlgPara );
+};
+
+#endif // _DLGEJPG_HXX_
+
diff --git a/svtools/source/filter.vcl/filter/dlgejpg.src b/svtools/source/filter.vcl/filter/dlgejpg.src
new file mode 100644
index 000000000000..11cbffb37255
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/dlgejpg.src
@@ -0,0 +1,266 @@
+/*************************************************************************
+ *
+ * $RCSfile: dlgejpg.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "dlgejpg.hrc"
+ModalDialog DLG_EXPORT_JPG
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 159 , 111 ) ;
+ Text = "JPEG Optionen" ;
+ Text [ ENGLISH ] = "JPEG Optionen" ;
+ Text [ english_us ] = "JPEG Options" ;
+ Text [ italian ] = "Opzioni JPEG" ;
+ Text [ spanish ] = "Opciones JPEG" ;
+ Text [ french ] = "Options JPEG" ;
+ Text [ dutch ] = "JPEG-opties" ;
+ Text [ swedish ] = "JPEG-alternativ" ;
+ Text [ danish ] = "JPEG-indstillinger" ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ OKButton BTN_OK
+ {
+ Pos = MAP_APPFONT ( 103 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL
+ {
+ Pos = MAP_APPFONT ( 103 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BTN_HELP
+ {
+ Pos = MAP_APPFONT ( 103 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ GroupBox GRP_QUALITY
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 90 , 55 ) ;
+ Text = "Qualität" ;
+ Text [ ENGLISH ] = "Quality" ;
+ Text [ english_us ] = "Quality" ;
+ Text [ italian ] = "Qualità" ;
+ Text [ spanish ] = "Calidad" ;
+ Text [ french ] = "Qualité" ;
+ Text [ dutch ] = "Kwaliteit" ;
+ Text [ swedish ] = "Kvalitet" ;
+ Text [ danish ] = "Kvalitet" ;
+ Text [ portuguese_brazilian ] = "Qualität" ;
+ Text [ portuguese ] = "Qualidade" ;
+ Text[ chinese_simplified ] = "ÖÊÁ¿";
+ Text[ russian ] = "Êà÷åñòâî";
+ Text[ polish ] = "JakoϾ";
+ Text[ japanese ] = "‰æ‘œ•iŽ¿";
+ Text[ chinese_traditional ] = "½è¶q";
+ Text[ arabic ] = "ÇáÌæÏÉ";
+ Text[ dutch ] = "Kwaliteit";
+ Text[ chinese_simplified ] = "ÖÊÁ¿";
+ Text[ greek ] = "Ðïéüôçôá";
+ Text[ korean ] = "È­Áú";
+ Text[ turkish ] = "Kalite";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FI_DESCR
+ {
+ Pos = MAP_APPFONT ( 12 , 15 ) ;
+ Size = MAP_APPFONT ( 81 , 21 ) ;
+ Text = "0: min. Qualität\n100: max. Qualität" ;
+ Text [ ENGLISH ] = "0: min. quality\n100: max. quality" ;
+ Text [ english_us ] = "0: min. Quality\n100: max. Quality" ;
+ Text [ italian ] = "Q: min. qualità\n100: max. qualità" ;
+ Text [ spanish ] = "0: mín. calidad\n100: máx. calidad" ;
+ Text [ french ] = "0: qualité min.\n100: qualité max." ;
+ Text [ dutch ] = "0: min. kwaliteit\n100: max. kwaliteit" ;
+ Text [ swedish ] = "0: min. kvalitet\n100: max. kvalitet" ;
+ Text [ danish ] = "0: min. kvalitet\n100: maks. kvalitet" ;
+ Text [ portuguese_brazilian ] = "0: min. Qualidade\n100: max. Qualidade" ;
+ Text [ portuguese ] = "0: min. Qualidade\n100: max. Qualidade" ;
+ Text[ chinese_simplified ] = "0: ×î²î \n100: ×î¼Ñ¡¡";
+ Text[ russian ] = "0: íèçêîå êà÷åñòâî\n100: âûñîêîå êà÷åñòâî";
+ Text[ polish ] = "0: min. jakoϾ\n100: max. jakoϾ";
+ Text[ japanese ] = "0: Å’á\n100: Å‚";
+ Text[ chinese_traditional ] = "0: ³Ì®t \n100: ³Ì¨Î¡@";
+ Text[ arabic ] = "0: ÇáÍÏ ÇáÃÏäì ááÌæÏÉ\n100: ÇáÍÏ ÇáÃÞÕì ááÌæÏÉ";
+ Text[ dutch ] = "0: min. kwaliteit\n100: max. kwaliteit";
+ Text[ chinese_simplified ] = "0: ×î²î \n100: ×î¼Ñ¡¡";
+ Text[ greek ] = "0: åëÜ÷éóôç ðïéüôçôá\n100: ìÝãéóôç ðïéüôçôá";
+ Text[ korean ] = "0: ÃÖ¼Ò ¼º´É\n100: ÃÖ´ë ¼º´É";
+ Text[ turkish ] = "0: asg. kalite\n100: azm. kalite";
+ Text[ language_user1 ] = " ";
+ };
+ NumericField NUM_FLD_QUALITY
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 12 , 40 ) ;
+ Size = MAP_APPFONT ( 50 , 12 ) ;
+ TabStop = TRUE ;
+ Spin = TRUE ;
+ Maximum = 100 ;
+ StrictFormat = TRUE ;
+ Last = 100 ;
+ Repeat = TRUE ;
+ };
+ GroupBox GRP_COLORS
+ {
+ Pos = MAP_APPFONT ( 6 , 61 ) ;
+ Size = MAP_APPFONT ( 90 , 44 ) ;
+ Text = "Farbauflösung" ;
+ Text [ ENGLISH ] = "Color resolution" ;
+ Text [ english_us ] = "Color resolution" ;
+ Text [ portuguese_brazilian ] = "Farbauflösung" ;
+ Text [ swedish ] = "Färgupplösning" ;
+ Text [ danish ] = "Farveopløsning" ;
+ Text [ italian ] = "Profondità cromatica" ;
+ Text [ spanish ] = "Resolución del color" ;
+ Text [ french ] = "Résolution couleur" ;
+ Text [ dutch ] = "Kleurdichtheid" ;
+ Text [ portuguese ] = "Resolução de cores" ;
+ Text[ chinese_simplified ] = "ÑÕÉ«·Ö±æÂÊ";
+ Text[ russian ] = "Öâåòîâîå ðàçðåøåíèå";
+ Text[ polish ] = "Rozdzielczoœæ kolorów";
+ Text[ japanese ] = "F‚̉𑜓x";
+ Text[ chinese_traditional ] = "ÃC¦â¸ÑªR«×";
+ Text[ arabic ] = "ÇÓÊÈÇäÉ Çááæä";
+ Text[ dutch ] = "Kleurdichtheid";
+ Text[ chinese_simplified ] = "ÑÕÉ«·Ö±æÂÊ";
+ Text[ greek ] = "ÁíÜëõóç ÷ñùìÜôùí";
+ Text[ korean ] = "Ä÷¯ ÇØ»óµµ";
+ Text[ turkish ] = "Renk çözünürlüðü";
+ Text[ language_user1 ] = " ";
+ };
+ RadioButton RB_GRAY
+ {
+ Pos = MAP_APPFONT ( 12 , 72 ) ;
+ Size = MAP_APPFONT ( 81 , 12 ) ;
+ TabStop = TRUE ;
+ Text = "Graustufen" ;
+ Text [ ENGLISH ] = "Grayscales" ;
+ Text [ english_us ] = "Grayscale" ;
+ Text [ portuguese ] = "Tons de cinzento" ;
+ Text [ portuguese_brazilian ] = "Graustufen" ;
+ Text [ swedish ] = "Gråskalor" ;
+ Text [ danish ] = "Gråtoner" ;
+ Text [ italian ] = "Toni di grigio" ;
+ Text [ spanish ] = "Escala de grises" ;
+ Text [ french ] = "Niveaux de gris" ;
+ Text [ dutch ] = "Grijswaarden" ;
+ Text[ chinese_simplified ] = "»Ò¶È";
+ Text[ russian ] = "Îòòåíêè ñåðîãî";
+ Text[ polish ] = "Odcienie szaroœci";
+ Text[ japanese ] = "¸ÞÚ°½¹°Ù";
+ Text[ chinese_traditional ] = "¦Ç«×";
+ Text[ arabic ] = "ÏÑÌÇÊ ÇáÑãÇÏí";
+ Text[ dutch ] = "Grijswaarden";
+ Text[ chinese_simplified ] = "»Ò¶È";
+ Text[ greek ] = "ÄéáâÜèìéóç ôïõ ãêñé";
+ Text[ korean ] = "ȸ»öÁ¶";
+ Text[ turkish ] = "Gri tonlama";
+ Text[ language_user1 ] = " ";
+ };
+ RadioButton RB_RGB
+ {
+ Pos = MAP_APPFONT ( 12 , 87 ) ;
+ Size = MAP_APPFONT ( 81 , 12 ) ;
+ TabStop = TRUE ;
+ Text = "Echtfarben" ;
+ Text [ ENGLISH ] = "TrueColors" ;
+ Text [ english_us ] = "True Colors" ;
+ Text [ portuguese ] = "Cores reais" ;
+ Text [ portuguese_brazilian ] = "Echtfarben" ;
+ Text [ swedish ] = "True Colors" ;
+ Text [ danish ] = "Ægte farver" ;
+ Text [ italian ] = "Colori reali" ;
+ Text [ spanish ] = "Colores reales" ;
+ Text [ french ] = "Vraies couleurs (Truecolor)" ;
+ Text [ dutch ] = "Echte kleuren" ;
+ Text[ chinese_simplified ] = "·ÂÕæÉ«";
+ Text[ russian ] = "Íàòóðàëüíûå öâåòà";
+ Text[ polish ] = "Trwa³e kolory";
+ Text[ japanese ] = "‘NÊF";
+ Text[ chinese_traditional ] = "¥þ±m";
+ Text[ arabic ] = "ÃáæÇä ÍÞíÞíÉ";
+ Text[ dutch ] = "Echte kleuren";
+ Text[ chinese_simplified ] = "·ÂÕæÉ«";
+ Text[ greek ] = "ÖõóéêÜ ÷ñþìáôá";
+ Text[ korean ] = "Æ®·ç Ä÷¯";
+ Text[ turkish ] = "Gerçek renkler";
+ Text[ language_user1 ] = " ";
+ };
+ Text [ portuguese_brazilian ] = "JPEG Optionen" ;
+ Text [ portuguese ] = "Opções JPEG" ;
+ Text[ chinese_simplified ] = "JPEG Ñ¡Ïî";
+ Text[ russian ] = "Ïàðàìåòðû JPEG";
+ Text[ polish ] = "Opcje JPEG";
+ Text[ japanese ] = "JPEG µÌß¼®Ý";
+ Text[ chinese_traditional ] = "JPEG ¿ï¶µ";
+ Text[ arabic ] = "ÎíÇÑÇÊJPEG ";
+ Text[ dutch ] = "JPEG-opties";
+ Text[ chinese_simplified ] = "JPEG Ñ¡Ïî";
+ Text[ greek ] = "ÅðéëïãÝò JPEG";
+ Text[ korean ] = "JPEG ¿É¼Ç";
+ Text[ turkish ] = "JPEG seçenekleri";
+ Text[ language_user1 ] = " ";
+};
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.cxx b/svtools/source/filter.vcl/filter/dlgexpor.cxx
new file mode 100644
index 000000000000..1f53a52914db
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/dlgexpor.cxx
@@ -0,0 +1,517 @@
+/*************************************************************************
+ *
+ * $RCSfile: dlgexpor.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <tools/ref.hxx>
+#include <vcl/config.hxx>
+#include <vcl/msgbox.hxx>
+#include "dlgexpor.hxx"
+#include "dlgexpor.hrc"
+#include "strings.hrc"
+
+/*************************************************************************
+|*
+|* Ctor
+|*
+\************************************************************************/
+
+DlgExportPix::DlgExportPix( FltCallDialogParameter& rPara ) :
+ ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_PIX, rPara.pResMgr ) ),
+ aBtnOK ( this, ResId( BTN_OK_PIX ) ),
+ aBtnCancel ( this, ResId( BTN_CANCEL_PIX ) ),
+ aBtnHelp ( this, ResId( BTN_HELP_PIX ) ),
+ aGrpMode ( this, ResId( GRP_MODE_PIX ) ),
+ aCbbRes ( this, ResId( CBB_RES_PIX ) ),
+ aRbOriginal ( this, ResId( RB_ORIGINAL_PIX ) ),
+ aRbRes ( this, ResId( RB_RES_PIX ) ),
+ aRbSize ( this, ResId( RB_SIZE_PIX ) ),
+ aFtSizeX ( this, ResId( FT_SIZEX_PIX ) ),
+ aMtfSizeX ( this, ResId( MTF_SIZEX_PIX ) ),
+ aFtSizeY ( this, ResId( FT_SIZEY_PIX ) ),
+ aMtfSizeY ( this, ResId( MTF_SIZEY_PIX ) ),
+ aGrpColors ( this, ResId( GRP_COLORS ) ),
+ aLbColors ( this, ResId( LB_COLORS ) ),
+ aCbxRLE ( this, ResId( CBX_RLE ) ),
+ pConfig ( rPara.pCfg ),
+ pMgr ( rPara.pResMgr ),
+ rExt ( rPara.aFilterExt )
+
+{
+ String aTitle( rExt );
+
+ FreeResource();
+
+ aBtnOK.SetClickHdl( LINK( this, DlgExportPix, OK ) );
+ aRbOriginal.SetClickHdl( LINK( this, DlgExportPix, ClickRbOriginal ) );
+ aRbRes.SetClickHdl( LINK( this, DlgExportPix, ClickRbRes ) );
+ aRbSize.SetClickHdl( LINK( this, DlgExportPix, ClickRbSize ) );
+ aLbColors.SetSelectHdl( LINK( this, DlgExportPix, SelectLbColors ) );
+
+ aTitle.ToUpperAscii();
+ aTitle += String( ResId( EXPORT_DIALOG_TITLE, pMgr ) );
+ SetText( aTitle );
+
+
+ // Config-Parameter lesen
+ ByteString aStrColors( rExt, RTL_TEXTENCODING_UTF8 );
+ aStrColors.Append( ByteString( String( ResId( KEY_COLORS, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrColors = pConfig->ReadKey( aStrColors );
+ ByteString aStrMode( rExt, RTL_TEXTENCODING_UTF8 );
+ aStrMode.Append( ByteString( String( ResId( KEY_MODE, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrMode = pConfig->ReadKey( aStrMode );
+ ByteString aStrRes( rExt, RTL_TEXTENCODING_UTF8 );
+ aStrRes.Append( ByteString( String( ResId( KEY_RES, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrRes = pConfig->ReadKey( aStrRes );
+ ByteString aStrSizeX( rExt, RTL_TEXTENCODING_UTF8 );
+ aStrSizeX.Append( ByteString( String( ResId( KEY_SIZEX, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrSizeX = pConfig->ReadKey( aStrSizeX );
+ ByteString aStrSizeY( rExt, RTL_TEXTENCODING_UTF8 );
+ aStrSizeY.Append( ByteString( String( ResId( KEY_SIZEY, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrSizeY = pConfig->ReadKey( aStrSizeY );
+ ByteString aStrRLE( rExt, RTL_TEXTENCODING_UTF8 );
+ aStrRLE.Append( ByteString( String( ResId( KEY_RLE_CODING, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrRLE = pConfig->ReadKey( aStrRLE );
+
+ aLbColors.SelectEntryPos( Min( (USHORT) 7, (USHORT)aStrColors.ToInt32() ) );
+ aCbxRLE.Check( aStrRLE.CompareIgnoreCaseToAscii( "false", 5 ) == COMPARE_EQUAL );
+
+ if ( !aStrRes.Len() )
+ aStrRes = 75;
+
+ aStrRes += " DPI";
+ aCbbRes.SetText( UniString( aStrRes, RTL_TEXTENCODING_UTF8 ) );
+
+ aMtfSizeX.SetDefaultUnit( FUNIT_MM );
+ aMtfSizeY.SetDefaultUnit( FUNIT_MM );
+
+ if ( !aStrSizeX.Len() )
+ aMtfSizeX.SetValue( 10000 );
+ else
+ aMtfSizeX.SetValue( aStrSizeX.ToInt32() );
+
+ if ( !aStrSizeY.Len() )
+ aMtfSizeY.SetValue( 10000 );
+ else
+ aMtfSizeY.SetValue( aStrSizeY.ToInt32() );
+
+ switch ( rPara.eFieldUnit )
+ {
+// case FUNIT_NONE :
+// case FUNIT_KM :
+// case FUNIT_PERCENT :
+// case FUNIT_CUSTOM :
+// case FUNIT_MILE :
+// case FUNIT_FOOT :
+// case FUNIT_M :
+ case FUNIT_MM :
+ case FUNIT_CM :
+ case FUNIT_TWIP :
+ case FUNIT_POINT :
+ case FUNIT_PICA :
+ case FUNIT_INCH :
+ case FUNIT_100TH_MM :
+ {
+ aMtfSizeX.SetUnit( rPara.eFieldUnit );
+ aMtfSizeY.SetUnit( rPara.eFieldUnit );
+ }
+ break;
+ }
+
+ switch ( aStrMode.ToInt32() )
+ {
+ case 2 :
+ {
+ aRbSize.Check( TRUE );
+ ClickRbSize( NULL );
+ }
+ break;
+ case 1 :
+ {
+ aRbRes.Check( TRUE );
+ ClickRbRes( NULL );
+ }
+ break;
+ default :
+ {
+ aRbOriginal.Check( TRUE );
+ ClickRbOriginal( NULL );
+ }
+ break;
+ }
+ SelectLbColors( &aLbColors );
+}
+
+/*************************************************************************
+|*
+|* Speichert eingestellte Werte in ini-Datei
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportPix, OK, void *, EMPTYARG )
+{
+ // Config-Parameter schreiben
+
+ ByteString aStrMode;
+ ByteString aRLEStr;
+
+ long nRes = Max( Min( aCbbRes.GetText().ToInt32(), 600L), 75L );
+ long nSizeX = (long)MetricField::ConvertDoubleValue( aMtfSizeX.GetValue(), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM );
+ long nSizeY = (long)MetricField::ConvertDoubleValue( aMtfSizeY.GetValue(), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM );
+
+ if ( aRbRes.IsChecked() )
+ aStrMode = '1';
+ else if ( aRbSize.IsChecked() )
+ aStrMode = '2';
+ else
+ aStrMode = '0';
+
+ if ( aCbxRLE.IsChecked() )
+ aRLEStr = ByteString( "TRUE", 4 );
+ else
+ aRLEStr = ByteString( "FALSE", 5 );
+
+ ByteString aExt0( rExt, RTL_TEXTENCODING_UTF8 );
+ aExt0.Append( ByteString( String( ResId( KEY_MODE, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aExt0, aStrMode );
+
+ ByteString aExt1( rExt, RTL_TEXTENCODING_UTF8 );
+ aExt1.Append( ByteString( String( ResId( KEY_RES, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aExt1, ByteString::CreateFromInt32( nRes ) );
+
+ ByteString aExt2( rExt, RTL_TEXTENCODING_UTF8 );
+ aExt2.Append( ByteString( String( ResId( KEY_SIZEX, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aExt2, ByteString::CreateFromInt32( nSizeX ) );
+
+ ByteString aExt3( rExt, RTL_TEXTENCODING_UTF8 );
+ aExt3.Append( ByteString( String( ResId( KEY_SIZEY, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aExt3, ByteString::CreateFromInt32( nSizeY ) );
+
+ ByteString aExt4( rExt, RTL_TEXTENCODING_UTF8 );
+ aExt4.Append( ByteString( String( ResId( KEY_COLORS, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aExt4, ByteString::CreateFromInt32( (sal_Int32)aLbColors.GetSelectEntryPos() ) );
+
+ ByteString aExt5( rExt, RTL_TEXTENCODING_UTF8 );
+ aExt5.Append( ByteString( String( ResId( KEY_RLE_CODING, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aExt5, ByteString::CreateFromInt32( (sal_Int32)aLbColors.GetSelectEntryPos() ) );
+
+ EndDialog( RET_OK );
+
+ return 0;
+}
+
+/*************************************************************************
+|*
+|* Enabled/Disabled Controls
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportPix, ClickRbOriginal, void*, EMPTYARG )
+{
+ aCbbRes.Disable();
+
+ aFtSizeX.Disable();
+ aMtfSizeX.Disable();
+ aFtSizeY.Disable();
+ aMtfSizeY.Disable();
+
+ return 0;
+}
+
+
+/*************************************************************************
+|*
+|* Enabled/Disabled Controls
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportPix, ClickRbRes, void*, EMPTYARG )
+{
+ aCbbRes.Enable();
+
+ aFtSizeX.Disable();
+ aMtfSizeX.Disable();
+ aFtSizeY.Disable();
+ aMtfSizeY.Disable();
+
+ return 0;
+}
+
+
+/*************************************************************************
+|*
+|* Enabled/Disabled Controls
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportPix, ClickRbSize, void*, EMPTYARG )
+{
+ aFtSizeX.Enable();
+ aMtfSizeX.Enable();
+ aFtSizeY.Enable();
+ aMtfSizeY.Enable();
+
+ aCbbRes.Disable();
+
+ return 0;
+}
+
+
+/*************************************************************************
+|*
+|* Enabled/Disabled Controls
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportPix, SelectLbColors, void*, EMPTYARG )
+{
+ const USHORT nLbPos = aLbColors.GetSelectEntryPos();
+
+ if ( ( nLbPos >= 3 ) && ( nLbPos <= 6 ) )
+ aCbxRLE.Enable();
+ else
+ aCbxRLE.Disable();
+
+ return 0L;
+}
+
+
+/******************************************************************************/
+
+
+/*************************************************************************
+|*
+|* Ctor
+|*
+\************************************************************************/
+
+DlgExportVec::DlgExportVec( FltCallDialogParameter& rPara ) :
+ ModalDialog ( rPara.pWindow, ResId( DLG_EXPORT_VEC, rPara.pResMgr ) ),
+ aBtnOK ( this, ResId( BTN_OK_VEC ) ),
+ aBtnCancel ( this, ResId( BTN_CANCEL_VEC ) ),
+ aBtnHelp ( this, ResId( BTN_HELP_VEC ) ),
+ aRbOriginal ( this, ResId( RB_ORIGINAL_VEC ) ),
+ aRbSize ( this, ResId( RB_SIZE_VEC ) ),
+ aGrpMode ( this, ResId( GRP_MODE_VEC ) ),
+ aFtSizeX ( this, ResId( FT_SIZEX_VEC ) ),
+ aMtfSizeX ( this, ResId( MTF_SIZEX_VEC ) ),
+ aFtSizeY ( this, ResId( FT_SIZEY_VEC ) ),
+ aMtfSizeY ( this, ResId( MTF_SIZEY_VEC ) ),
+ aGrpSize ( this, ResId( GRP_SIZE_VEC ) ),
+ pConfig ( rPara.pCfg ),
+ pMgr ( rPara.pResMgr ),
+ rExt ( rPara.aFilterExt )
+
+{
+ String aTitle( rExt );
+
+ FreeResource();
+
+ aBtnOK.SetClickHdl( LINK( this, DlgExportVec, OK ) );
+ aRbOriginal.SetClickHdl( LINK( this, DlgExportVec, ClickRbOriginal ) );
+ aRbSize.SetClickHdl( LINK( this, DlgExportVec, ClickRbSize ) );
+
+ aTitle.ToUpperAscii();
+ aTitle += String( ResId( EXPORT_DIALOG_TITLE, pMgr ) );
+ SetText( aTitle );
+
+ // Config-Parameter lesen
+ // String aStrMode = pConfig->ReadKey( rExt + String( ResId( KEY_MODE, pMgr ) ) );
+ ByteString aExt( rExt, RTL_TEXTENCODING_UTF8 );
+ ByteString aStrMode( aExt );
+ aStrMode.Append( ByteString( String( ResId( KEY_MODE, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrMode = pConfig->ReadKey( aStrMode );
+
+ ByteString aStrSizeX( aExt );
+ aStrSizeX.Append( ByteString( String( ResId( KEY_SIZEX, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrSizeX = pConfig->ReadKey( aStrSizeX );
+
+ ByteString aStrSizeY( aExt );
+ aStrSizeY.Append( ByteString( String( ResId( KEY_SIZEY, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ aStrSizeY = pConfig->ReadKey( aStrSizeY );
+
+ aMtfSizeX.SetDefaultUnit( FUNIT_MM );
+ aMtfSizeY.SetDefaultUnit( FUNIT_MM );
+
+ if ( !aStrSizeX.Len() )
+ aMtfSizeX.SetValue( 10000 );
+ else
+ aMtfSizeX.SetValue( aStrSizeX.ToInt32() );
+
+ if ( !aStrSizeY.Len() )
+ aMtfSizeY.SetValue( 10000 );
+ else
+ aMtfSizeY.SetValue( aStrSizeY.ToInt32() );
+
+ switch ( rPara.eFieldUnit )
+ {
+// case FUNIT_NONE :
+// case FUNIT_KM :
+// case FUNIT_PERCENT :
+// case FUNIT_CUSTOM :
+// case FUNIT_MILE :
+// case FUNIT_FOOT :
+ case FUNIT_MM :
+ case FUNIT_CM :
+ case FUNIT_M :
+ case FUNIT_TWIP :
+ case FUNIT_POINT :
+ case FUNIT_PICA :
+ case FUNIT_INCH :
+ case FUNIT_100TH_MM :
+ {
+ aMtfSizeX.SetUnit( rPara.eFieldUnit );
+ aMtfSizeY.SetUnit( rPara.eFieldUnit );
+ }
+ break;
+ }
+
+ switch ( aStrMode.ToInt32() )
+ {
+ case 1 :
+ {
+ aRbSize.Check( TRUE );
+ ClickRbSize( NULL );
+ }
+ break;
+
+ default :
+ {
+ aRbOriginal.Check( TRUE );
+ ClickRbOriginal( NULL );
+ }
+ break;
+ }
+}
+
+/*************************************************************************
+|*
+|* Speichert eingestellte Werte in ini-Datei
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportVec, OK, void *, EMPTYARG )
+{
+ // Config-Parameter schreiben
+ long nSizeX = (long)MetricField::ConvertDoubleValue( aMtfSizeX.GetValue(), 2, aMtfSizeX.GetUnit(), MAP_100TH_MM );
+ long nSizeY = (long)MetricField::ConvertDoubleValue( aMtfSizeY.GetValue(), 2, aMtfSizeY.GetUnit(), MAP_100TH_MM );
+
+ ByteString aStrMode;
+ if ( aRbSize.IsChecked() )
+ aStrMode = '1';
+ else
+ aStrMode = '0';
+
+ ByteString aExt( rExt, RTL_TEXTENCODING_UTF8 );
+ ByteString aDest( aExt );
+ aDest.Append( ByteString( String( ResId( KEY_MODE, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aDest, aStrMode );
+
+ aDest = aExt;
+ aDest.Append( ByteString( String( ResId( KEY_SIZEX, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aDest, ByteString::CreateFromInt32( nSizeX ) );
+
+ aDest = aExt;
+ aDest.Append( ByteString( String( ResId( KEY_SIZEY, pMgr ) ), RTL_TEXTENCODING_UTF8 ) );
+ pConfig->WriteKey( aDest, ByteString::CreateFromInt32( nSizeY ) );
+
+ EndDialog( RET_OK );
+
+ return 0;
+}
+
+/*************************************************************************
+|*
+|* Enabled/Disabled Controls
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportVec, ClickRbOriginal, void*, EMPTYARG )
+{
+ aGrpSize.Disable();
+ aFtSizeX.Disable();
+ aMtfSizeX.Disable();
+ aFtSizeY.Disable();
+ aMtfSizeY.Disable();
+
+ return 0;
+}
+
+
+/*************************************************************************
+|*
+|* Enabled/Disabled Controls
+|*
+\************************************************************************/
+
+IMPL_LINK( DlgExportVec, ClickRbSize, void*, EMPTYARG )
+{
+ aGrpSize.Enable();
+ aFtSizeX.Enable();
+ aMtfSizeX.Enable();
+ aFtSizeY.Enable();
+ aMtfSizeY.Enable();
+
+ return 0;
+}
+
+
+
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hrc b/svtools/source/filter.vcl/filter/dlgexpor.hrc
new file mode 100644
index 000000000000..cf35e9785666
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/dlgexpor.hrc
@@ -0,0 +1,92 @@
+/*************************************************************************
+ *
+ * $RCSfile: dlgexpor.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include <svtools.hrc>
+
+#define BTN_OK_PIX 1
+#define BTN_CANCEL_PIX 1
+#define BTN_HELP_PIX 1
+#define CBX_RES_PIX 1
+#define CBX_SIZE_PIX 2
+#define CBX_RLE 3
+#define CBB_RES_PIX 1
+#define LB_COLORS 1
+#define MTF_SIZEX_PIX 1
+#define MTF_SIZEY_PIX 2
+#define FT_SIZEX_PIX 1
+#define FT_SIZEY_PIX 2
+#define GRP_MODE_PIX 1
+#define GRP_COLORS 4
+#define RB_ORIGINAL_PIX 1
+#define RB_RES_PIX 2
+#define RB_SIZE_PIX 3
+
+#define BTN_OK_VEC 1
+#define BTN_CANCEL_VEC 1
+#define BTN_HELP_VEC 1
+#define CBX_SIZE_VEC 2
+#define MTF_SIZEX_VEC 1
+#define MTF_SIZEY_VEC 2
+#define FT_SIZEX_VEC 1
+#define FT_SIZEY_VEC 2
+#define GRP_SIZE_VEC 1
+#define GRP_MODE_VEC 2
+#define RB_ORIGINAL_VEC 1
+#define RB_SIZE_VEC 2
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.hxx b/svtools/source/filter.vcl/filter/dlgexpor.hxx
new file mode 100644
index 000000000000..2b1e59922d6b
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/dlgexpor.hxx
@@ -0,0 +1,152 @@
+/*************************************************************************
+ *
+ * $RCSfile: dlgexpor.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _DLGEXPOR_HXX_
+#define _DLGEXPOR_HXX_
+
+#include "fltcall.hxx"
+#include <vcl/dialog.hxx>
+#include <vcl/button.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/field.hxx>
+#include <vcl/group.hxx>
+#include <vcl/lstbox.hxx>
+
+/*************************************************************************
+|*
+|* Dialog zum Einstellen von Filteroptionen bei Pixelformaten
+|*
+\************************************************************************/
+class DlgExportPix : public ModalDialog
+{
+private:
+ OKButton aBtnOK;
+ CancelButton aBtnCancel;
+ HelpButton aBtnHelp;
+
+ ListBox aLbColors;
+ CheckBox aCbxRLE;
+ GroupBox aGrpColors;
+
+ RadioButton aRbOriginal;
+ RadioButton aRbRes;
+ RadioButton aRbSize;
+ FixedText aFtSizeX;
+ MetricField aMtfSizeX;
+ FixedText aFtSizeY;
+ MetricField aMtfSizeY;
+ GroupBox aGrpMode;
+ ComboBox aCbbRes;
+
+ Config* pConfig;
+ ResMgr* pMgr;
+
+ const String& rExt;
+
+ DECL_LINK( OK, void* p );
+ DECL_LINK( ClickRbOriginal,void* p );
+ DECL_LINK( ClickRbRes,void* p );
+ DECL_LINK( ClickRbSize,void* p );
+ DECL_LINK( SelectLbColors, void* p );
+
+public:
+ DlgExportPix( FltCallDialogParameter& rPara );
+};
+
+
+/*************************************************************************
+|*
+|* Dialog zum Einstellen von Filteroptionen bei Vektorformaten
+|*
+\************************************************************************/
+class DlgExportVec : public ModalDialog
+{
+private:
+ OKButton aBtnOK;
+ CancelButton aBtnCancel;
+ HelpButton aBtnHelp;
+
+ RadioButton aRbOriginal;
+ RadioButton aRbSize;
+ GroupBox aGrpMode;
+
+ FixedText aFtSizeX;
+ MetricField aMtfSizeX;
+ FixedText aFtSizeY;
+ MetricField aMtfSizeY;
+ GroupBox aGrpSize;
+
+ Config* pConfig;
+ ResMgr* pMgr;
+
+ const String& rExt;
+
+ DECL_LINK( OK, void* p );
+ DECL_LINK( ClickRbOriginal,void* p );
+ DECL_LINK( ClickRbSize,void* p );
+
+public:
+ DlgExportVec( FltCallDialogParameter& rPara );
+};
+
+#endif // _DLGEXPOR_HXX_
+
diff --git a/svtools/source/filter.vcl/filter/dlgexpor.src b/svtools/source/filter.vcl/filter/dlgexpor.src
new file mode 100644
index 000000000000..d983cecc51dd
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/dlgexpor.src
@@ -0,0 +1,809 @@
+/*************************************************************************
+ *
+ * $RCSfile: dlgexpor.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#include "dlgexpor.hrc"
+
+ModalDialog DLG_EXPORT_PIX
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 178 , 144 ) ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ GroupBox GRP_COLORS
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 110 , 45 ) ;
+ Text = "Farbauflösung" ;
+ Text [ ENGLISH ] = "Color resolution" ;
+ Text [ english_us ] = "Color resolution" ;
+ Text [ portuguese ] = "Resolução de cores" ;
+ Text [ portuguese_brazilian ] = "Farbauflösung" ;
+ Text [ swedish ] = "Färgupplösning" ;
+ Text [ danish ] = "Farveopløsning" ;
+ Text [ italian ] = "Profondità cromatica" ;
+ Text [ spanish ] = "Resolución del color" ;
+ Text [ french ] = "Résolution couleur" ;
+ Text [ dutch ] = "Kleurdichtheid" ;
+ Text[ chinese_simplified ] = "ÑÕÉ«·Ö±æÂÊ";
+ Text[ russian ] = "Öâåòîâîå ðàçðåøåíèå";
+ Text[ polish ] = "Rozdzielczoœæ kolorów";
+ Text[ japanese ] = "F‚̉𑜓x";
+ Text[ chinese_traditional ] = "ÃC¦â¸ÑªR«×";
+ Text[ arabic ] = "ÇÓÊÈÇäÉ Çááæä";
+ Text[ greek ] = "ÁíÜëõóç ÷ñùìÜôùí";
+ Text[ korean ] = "Ä÷¯ ÇØ»óµµ";
+ Text[ turkish ] = "Renk çözünürlüðü";
+ Text[ language_user1 ] = " ";
+ };
+ ListBox LB_COLORS
+ {
+ Pos = MAP_APPFONT ( 12 , 14 ) ;
+ Size = MAP_APPFONT ( 98 , 90 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ AutoHScroll = TRUE ;
+ StringList =
+ {
+ < "Original" ; Default ; > ;
+ < "1Bit - Schwellenwert" ; Default ; > ;
+ < "1Bit - Gedithert" ; Default ; > ;
+ < "4Bit - Graustufenpalette" ; Default ; > ;
+ < "4Bit - Farbpalette" ; Default ; > ;
+ < "8Bit - Graustufenpalette" ; Default ; > ;
+ < "8Bit - Farbpalette" ; Default ; > ;
+ < "24Bit - Echtfarben" ; Default ; > ;
+ };
+ StringList [ ENGLISH ] =
+ {
+ < "Original" ; Default ; > ;
+ < "1Bit - Schwellenwert" ; Default ; > ;
+ < "1Bit - Gedithert" ; Default ; > ;
+ < "4Bit - Graustufenpalette" ; Default ; > ;
+ < "4Bit - Farbpalette" ; Default ; > ;
+ < "8Bit - Graustufenpalette" ; Default ; > ;
+ < "8Bit - Farbpalette" ; Default ; > ;
+ < "24Bit - Echtfarben" ; Default ; > ;
+ };
+ StringList [ english_us ] =
+ {
+ < "Original" ; Default ; > ;
+ < "1 Bit - Threshold Value" ; Default ; > ;
+ < "1 Bit - Dithering" ; Default ; > ;
+ < "4 Bit - Grayscale" ; Default ; > ;
+ < "4 Bit - Color Palette" ; Default ; > ;
+ < "8 Bit - Grayscales" ; Default ; > ;
+ < "8 Bit - Color Palette" ; Default ; > ;
+ < "24 Bit - True Colors" ; Default ; > ;
+ };
+ stringlist [ portuguese ] =
+ {
+ < "Original" ; Default ; > ;
+ < "Valor limite - 1 bit" ; Default ; > ;
+ < "Sombreado - 1 bit" ; Default ; > ;
+ < "Paleta de tons cinzentos de 4 bits" ; Default ; > ;
+ < "Paleta de cores de 4 bits" ; Default ; > ;
+ < "Paleta de tons cinzentos de 8 bits" ; Default ; > ;
+ < "Paleta de cores de 8 bits" ; Default ; > ;
+ < "Cores reais de 24 bits" ; Default ; > ;
+ };
+ stringlist [ portuguese_brazilian ] =
+ {
+ < "Original" ; Default ; > ;
+ < "1Bit - Schwellenwert" ; Default ; > ;
+ < "1Bit - Gedithert" ; Default ; > ;
+ < "4Bit - Graustufenpalette" ; Default ; > ;
+ < "4Bit - Farbpalette" ; Default ; > ;
+ < "8Bit - Graustufenpalette" ; Default ; > ;
+ < "8Bit - Farbpalette" ; Default ; > ;
+ < "24Bit - Echtfarben" ; Default ; > ;
+ };
+ stringlist [ swedish ] =
+ {
+ < "Original" ; Default ; > ;
+ < "1bit-tröskelvärde" ; Default ; > ;
+ < "1bit-ditrering" ; Default ; > ;
+ < "4bit-gråskalepalett" ; Default ; > ;
+ < "4bit-färgpalett" ; Default ; > ;
+ < "8Bit - gråskalepalett" ; Default ; > ;
+ < "8Bit - färgpalett" ; Default ; > ;
+ < "24bit - True Colors" ; Default ; > ;
+ };
+ stringlist [ danish ] =
+ {
+ < "Original" ; Default ; > ;
+ < "1bit - tærskelværdi" ; Default ; > ;
+ < "1bit - dithering" ; Default ; > ;
+ < "4bit - gråtoneskala" ; Default ; > ;
+ < "4bit - farvepalet" ; Default ; > ;
+ < "8bit - gråtoneskala" ; Default ; > ;
+ < "8bit - farvepalet" ; Default ; > ;
+ < "24bit - ægte farver" ; Default ; > ;
+ };
+ stringlist [ italian ] =
+ {
+ < "Originale" ; Default ; > ;
+ < "Valore soglia 1 bit" ; Default ; > ;
+ < "Dithering a 1 bit" ; Default ; > ;
+ < "Scala di grigio 4 bit" ; Default ; > ;
+ < "Tavola dei colori 4 bit" ; Default ; > ;
+ < "Scala di grigio 8 bit" ; Default ; > ;
+ < "Tavola dei colori a 8 bit" ; Default ; > ;
+ < "Colori reali - 24 bit" ; Default ; > ;
+ };
+ stringlist [ spanish ] =
+ {
+ < "Original" ; Default ; > ;
+ < "Valor umbral de 1 bit" ; Default ; > ;
+ < "1 bit - difusionado" ; Default ; > ;
+ < "Paleta de escala de grises 4 bits" ; Default ; > ;
+ < "Paleta de colores de 4 bits" ; Default ; > ;
+ < "Paleta de escala de grises 8 bits" ; Default ; > ;
+ < "Paleta de colores de 8 bits" ; Default ; > ;
+ < "Color real 24 bits" ; Default ; > ;
+ };
+ stringlist [ french ] =
+ {
+ < "Original" ; Default ; > ;
+ < "Valeur de seuil 1 bit" ; Default ; > ;
+ < "Dithering (diffusion) 1 bit" ; Default ; > ;
+ < "Niveaux de gris 4 bits" ; Default ; > ;
+ < "Palette de couleurs 4 bits" ; Default ; > ;
+ < "Niveaux de gris 8 bits" ; Default ; > ;
+ < "Palette de couleurs 8 bits" ; Default ; > ;
+ < "Couleurs 24 bit (Truecolor)" ; Default ; > ;
+ };
+ stringlist [ dutch ] =
+ {
+ < "Origineel" ; Default ; > ;
+ < "1Bit - grenswaarde" ; Default ; > ;
+ < "1Bit - geditherd" ; Default ; > ;
+ < "4Bit - grijswaardenpalet" ; Default ; > ;
+ < "4Bit - kleurenpalet" ; Default ; > ;
+ < "8Bit - grijswaardenpalet" ; Default ; > ;
+ < "8Bit - kleurenpalet" ; Default ; > ;
+ < "24Bit - echte kleuren" ; Default ; > ;
+ };
+ StringList [ chinese_simplified ] =
+ {
+ < "Ô­¼þ" ; Default ; > ;
+ < "1 λ³õʼֵ" ; Default ; > ;
+ < "1 붶¶¯" ; Default ; > ;
+ < "4 λ»Ò¶Èµ÷É«°å" ; Default ; > ;
+ < "4 λµ÷É«°å" ; Default ; > ;
+ < "8 λ»Ò¶Èµ÷É«°å" ; Default ; > ;
+ < "8 λµ÷É«°å" ; Default ; > ;
+ < "24 λ·ÂÕæÑÕÉ«" ; Default ; > ;
+ };
+ StringList [ russian ] =
+ {
+ < "Îðèãèíàë" ; Default ; > ;
+ < "1-ðàçðÿäíîå ïîðîãîâîå çíà÷åíèå" ; Default ; > ;
+ < "1-ðàçðÿäíîå ïñåâäîïîëóòîíîâîå èçîáðàæåíèå" ; Default ; > ;
+ < "4-ðàçðÿäíàÿ ãàììà îòòåíêîâ ñåðîãî" ; Default ; > ;
+ < "4-ðàçðÿäíàÿ öâåòîâàÿ ïàëèòðà" ; Default ; > ;
+ < "8-ðàçÿäíàÿ ãàììà îòòåíêîâ ñåðîãî" ; Default ; > ;
+ < "8-ðàçðÿäíàÿ öâåòîâàÿ ïàëèòðà" ; Default ; > ;
+ < "24-ðàçðÿäíîå êîäèðîâàíèå öâåòà" ; Default ; > ;
+ };
+ StringList [ polish ] =
+ {
+ < "Orygina³" ; Default ; > ;
+ < "WartoϾ progowa - 1bit" ; Default ; > ;
+ < "Rozsiewanie - 1 bit" ; Default ; > ;
+ < "Paleta odcieni szaroœci - 4bity" ; Default ; > ;
+ < "Paleta kolorów - 4bity" ; Default ; > ;
+ < "Paleta odcieni szaroœci - 8bitów" ; Default ; > ;
+ < "Paleta kolorów - 8bitów" ; Default ; > ;
+ < "True Color - 24bity" ; Default ; > ;
+ };
+ StringList [ japanese ] =
+ {
+ < "µØ¼ÞÅÙ" ; Default ; > ;
+ < "1Bit ‚µ‚«‚¢’l" ; Default ; > ;
+ < "1Bit ÃÞ¨»Þ–@" ; Default ; > ;
+ < "4Bit-¸ÞÚ°½¹°Ù" ; Default ; > ;
+ < "4Bit-¶×°ÊßÚ¯Ä" ; Default ; > ;
+ < "8Bit-¸ÞÚ°½¹°Ù" ; Default ; > ;
+ < "8Bit-¶×°ÊßÚ¯Ä" ; Default ; > ;
+ < "24Bit-‘NÊF" ; Default ; > ;
+ };
+ StringList [ chinese_traditional ] =
+ {
+ < "­ì¥ó" ; Default ; > ;
+ < "1 ¦ì¤¸ªì©l­È" ; Default ; > ;
+ < "1 ¦ì¤¸§Ý°Ê" ; Default ; > ;
+ < "4 ¦ì¤¸¦Ç«×¦âªO" ; Default ; > ;
+ < "4 ¦ì¤¸¦âªO" ; Default ; > ;
+ < "8 ¦ì¤¸¦Ç«×¦âªO" ; Default ; > ;
+ < "8 ¦ì¤¸¦âªO" ; Default ; > ;
+ < "24 ¦ì¤¸¥þ±m" ; Default ; > ;
+ };
+ StringList [ arabic ] =
+ {
+ < "ÇáÃÕá" ; Default ; > ;
+ < "ÞíãÉ ÇáÈÏÁ 1 ÈÊ" ; Default ; > ;
+ < "1 ÈÊ Dithering" ; Default ; > ;
+ < "áæÍ ÏÑÌÇÊ ÇáÑãÇÏí 4 ÈÊ" ; Default ; > ;
+ < "áæÍ ÃáæÇä 4 ÈÊ" ; Default ; > ;
+ < "áæÍ ÏÑÌÇÊ ÇáÑãÇÏí 8 ÈÊ" ; Default ; > ;
+ < "áæÍ ÃáæÇä 8 ÈÊ" ; Default ; > ;
+ < "ÃáæÇä ÍÞíÞíÉ 24 ÈÊ" ; Default ; > ;
+ };
+ StringList [ greek ] =
+ {
+ < "Áñ÷éêü" ; Default ; > ;
+ < "ÔéìÞ ïñßïõ 1 bit" ; Default ; > ;
+ < "Áðüäïóç ÷ñùìÜôùí 1 bit" ; Default ; > ;
+ < "ÄéáâÜèìéóç ôïõ ãêñé: 4 bit" ; Default ; > ;
+ < "ÐáëÝôá ÷ñùìÜôùí 4 bit" ; Default ; > ;
+ < "ÄéáâÜèìéóç ôïõ ãêñé: 8 bit" ; Default ; > ;
+ < "ÐáëÝôá ÷ñùìÜôùí 8 bit" ; Default ; > ;
+ < "24 bit - ÖõóéêÜ ÷ñþìáôá" ; Default ; > ;
+ };
+ StringList [ korean ] =
+ {
+ < "¿øº»" ; Default ; > ;
+ < "1 ºñÆ®- ÀÓ°è°ª" ; Default ; > ;
+ < "1ºñÆ® - Èçµé¸²" ; Default ; > ;
+ < "4 ºñÆ® - ȸ»öÁ¶" ; Default ; > ;
+ < "4 ºñÆ® - »ö»ó ÆÄ·¹Æ®" ; Default ; > ;
+ < "8 ºñÆ® - ȸ»öÁ¶" ; Default ; > ;
+ < "8 ºñÆ® - »ö»ó ÆÄ·¹Æ®" ; Default ; > ;
+ < "24 ºñÆ® - Æ®·ç Ä÷¯" ; Default ; > ;
+ };
+ StringList [ turkish ] =
+ {
+ < "Asýl" ; Default ; > ;
+ < "1Bit - eþik deðer" ; Default ; > ;
+ < "1Bit - titrek" ; Default ; > ;
+ < "4Bit - gri tonlama paleti" ; Default ; > ;
+ < "4Bit - renk paleti" ; Default ; > ;
+ < "8Bit - gri tonlama paleti" ; Default ; > ;
+ < "8Bit - renk paleti" ; Default ; > ;
+ < "24Bit - gerçek renk" ; Default ; > ;
+ };
+ StringList [ language_user1 ] =
+ {
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ < " " ; Default ; > ;
+ };
+ };
+ CheckBox CBX_RLE
+ {
+ Pos = MAP_APPFONT ( 12 , 31 ) ;
+ Size = MAP_APPFONT ( 98 , 12 ) ;
+ TabStop = TRUE ;
+ Text = "RLE-Kodierung" ;
+ Text [ ENGLISH ] = "RLE-Coding" ;
+ Text [ english_us ] = "RLE coding" ;
+ Text [ portuguese_brazilian ] = "RLE-Kodierung" ;
+ Text [ swedish ] = "RLE-kodning" ;
+ Text [ danish ] = "RLE-kodning" ;
+ Text [ italian ] = "Codifica RLE" ;
+ Text [ spanish ] = "Codificación RLE" ;
+ Text [ french ] = "Code RLE" ;
+ Text [ dutch ] = "RLE-codering" ;
+ Text [ portuguese ] = "Codificação RLE" ;
+ Text[ chinese_simplified ] = "RLE - ±àÂë";
+ Text[ russian ] = "Êîäèðîâêà RLE";
+ Text[ polish ] = "Kodowanie RLE";
+ Text[ japanese ] = "RLE º°ÃިݸÞ";
+ Text[ chinese_traditional ] = "RLE ½s½X";
+ Text[ arabic ] = "ÊÑãíÒ RLE";
+ Text[ greek ] = "Êùäéêïðïßçóç RLE";
+ Text[ korean ] = "RLE ÄÚµù";
+ Text[ turkish ] = "RLE kodlama";
+ Text[ language_user1 ] = " ";
+ };
+ GroupBox GRP_MODE_PIX
+ {
+ Pos = MAP_APPFONT ( 6 , 51 ) ;
+ Size = MAP_APPFONT ( 110 , 87 ) ;
+ Text = "Modus" ;
+ Text [ ENGLISH ] = "Mode" ;
+ Text [ english_us ] = "Mode" ;
+ Text [ italian ] = "Modo" ;
+ Text [ spanish ] = "Modo" ;
+ Text [ french ] = "Mode" ;
+ Text [ dutch ] = "Modus" ;
+ Text [ swedish ] = "Läge" ;
+ Text [ danish ] = "Modus" ;
+ Text [ portuguese ] = "Modo" ;
+ Text [ portuguese_brazilian ] = "Modus" ;
+ Text[ chinese_simplified ] = "ģʽ";
+ Text[ russian ] = "Ðåæèì";
+ Text[ polish ] = "Tryb";
+ Text[ japanese ] = "Ó°ÄÞ";
+ Text[ chinese_traditional ] = "¼Ò¦¡";
+ Text[ arabic ] = "ÇáæÖÚ";
+ Text[ greek ] = "ÊáôÜóôáóç";
+ Text[ korean ] = "¸ðµå";
+ Text[ turkish ] = "Kip";
+ Text[ language_user1 ] = " ";
+ };
+ RadioButton RB_ORIGINAL_PIX
+ {
+ Pos = MAP_APPFONT ( 12 , 60 ) ;
+ Size = MAP_APPFONT ( 98 , 12 ) ;
+ Text = "~Original" ;
+ Text [ ENGLISH ] = "~Original" ;
+ TabStop = TRUE ;
+ Text [ dutch ] = "~Origineel" ;
+ Text [ english_us ] = "~Original" ;
+ Text [ italian ] = "~Originale" ;
+ Text [ spanish ] = "~Original" ;
+ Text [ french ] = "~Original" ;
+ Text [ swedish ] = "~Original" ;
+ Text [ danish ] = "Original" ;
+ Text [ portuguese ] = "~Original" ;
+ Text [ portuguese_brazilian ] = "~Original" ;
+ Text[ chinese_simplified ] = "Ô­¼þ(~O)";
+ Text[ russian ] = "Îðèãèíàë";
+ Text[ polish ] = "Orygina³";
+ Text[ japanese ] = "µØ¼ÞÅÙ(~O)";
+ Text[ chinese_traditional ] = "­ì¥ó(~O)";
+ Text[ arabic ] = "ÇáÃÕá";
+ Text[ greek ] = "Áñ÷éêü";
+ Text[ korean ] = "¿øº»(~O)";
+ Text[ turkish ] = "~Asýl";
+ Text[ language_user1 ] = " ";
+ };
+ RadioButton RB_RES_PIX
+ {
+ Pos = MAP_APPFONT ( 12 , 75 ) ;
+ Size = MAP_APPFONT ( 55 , 12 ) ;
+ Text = "~Auflösung" ;
+ Text [ ENGLISH ] = "~Resolution" ;
+ TabStop = TRUE ;
+ Text [ dutch ] = "~Resolutie" ;
+ Text [ english_us ] = "~Resolution" ;
+ Text [ italian ] = "~Risoluzione" ;
+ Text [ spanish ] = "~Resolución" ;
+ Text [ french ] = "Résolution" ;
+ Text [ swedish ] = "~Upplösning" ;
+ Text [ danish ] = "Opløsning" ;
+ Text [ portuguese ] = "~Resolução" ;
+ Text [ portuguese_brazilian ] = "~Auflösung" ;
+ Text[ chinese_simplified ] = "·Ö±æÂÊ(~R)";
+ Text[ russian ] = "Ðàçðåøåíèå";
+ Text[ polish ] = "RozdzielczoϾ";
+ Text[ japanese ] = "‰ð‘œ“x(~R)";
+ Text[ chinese_traditional ] = "¸ÑªR«×(~R)";
+ Text[ arabic ] = "ÇáÇÓÊÈÇäÉ";
+ Text[ greek ] = "ÁíÜëõóç";
+ Text[ korean ] = "ÇØ»óµµ(~R)";
+ Text[ turkish ] = "~Çözünürlük";
+ Text[ language_user1 ] = " ";
+ };
+ ComboBox CBB_RES_PIX
+ {
+ Pos = MAP_APPFONT ( 70 , 75 ) ;
+ Size = MAP_APPFONT ( 40 , 50 ) ;
+ TabStop = TRUE ;
+ DropDown = TRUE ;
+ StringList =
+ {
+ "75 DPI" ;
+ "150 DPI" ;
+ "300 DPI" ;
+ "600 DPI" ;
+ };
+ };
+ RadioButton RB_SIZE_PIX
+ {
+ Pos = MAP_APPFONT ( 12 , 90 ) ;
+ Size = MAP_APPFONT ( 98 , 12 ) ;
+ Text = "~Größe" ;
+ Text [ ENGLISH ] = "~Size" ;
+ TabStop = TRUE ;
+ Text [ dutch ] = "~Grootte" ;
+ Text [ english_us ] = "~Size" ;
+ Text [ italian ] = "~Dimensione" ;
+ Text [ spanish ] = "~Tamaño" ;
+ Text [ french ] = "Taille" ;
+ Text [ swedish ] = "~Storlek" ;
+ Text [ danish ] = "Størrelse" ;
+ Text [ portuguese ] = "~Tamanho" ;
+ Text [ portuguese_brazilian ] = "~Größe" ;
+ Text[ chinese_simplified ] = "´óС(~S)";
+ Text[ russian ] = "Ðàçìåð";
+ Text[ polish ] = "Rozmiar";
+ Text[ japanese ] = "»²½Þ(~S)";
+ Text[ chinese_traditional ] = "¤j¤p(~S)";
+ Text[ arabic ] = "ÇáÍÌã";
+ Text[ greek ] = "ÌÝãåèïò";
+ Text[ korean ] = "Å©±â(~S)";
+ Text[ turkish ] = "~Büyüklük";
+ Text[ language_user1 ] = " ";
+ };
+ MetricField MTF_SIZEX_PIX
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 60 , 105 ) ;
+ Size = MAP_APPFONT ( 50 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 100 ;
+ Maximum = 99999 ;
+ StrictFormat = TRUE ;
+ DecimalDigits = 2 ;
+ Unit = FUNIT_MM ;
+ First = 100 ;
+ Last = 99999 ;
+ SpinSize = 100 ;
+ };
+ MetricField MTF_SIZEY_PIX
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 60 , 120 ) ;
+ Size = MAP_APPFONT ( 50 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 100 ;
+ Maximum = 99999 ;
+ StrictFormat = TRUE ;
+ DecimalDigits = 2 ;
+ Unit = FUNIT_MM ;
+ First = 100 ;
+ Last = 99999 ;
+ SpinSize = 100 ;
+ };
+ FixedText FT_SIZEX_PIX
+ {
+ Pos = MAP_APPFONT ( 18 , 106 ) ;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text = "Breite" ;
+ Text [ ENGLISH ] = "Width" ;
+ Text [ english_us ] = "Width" ;
+ Text [ italian ] = "Larghezza" ;
+ Text [ spanish ] = "Ancho" ;
+ Text [ french ] = "Largeur" ;
+ Text [ dutch ] = "Breedte" ;
+ Text [ swedish ] = "Bredd" ;
+ Text [ danish ] = "Bredde" ;
+ Text [ portuguese_brazilian ] = "Breite" ;
+ Text [ portuguese ] = "Largura" ;
+ Text[ chinese_simplified ] = "¿í¶È";
+ Text[ russian ] = "Øèðèíà";
+ Text[ polish ] = "Szer.";
+ Text[ japanese ] = "•";
+ Text[ chinese_traditional ] = "¼e«×";
+ Text[ arabic ] = "ÇáÚÑÖ";
+ Text[ greek ] = "ÐëÜôïò";
+ Text[ korean ] = "³Êºñ";
+ Text[ turkish ] = "Geniþlik";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_SIZEY_PIX
+ {
+ Pos = MAP_APPFONT ( 18 , 121 ) ;
+ Size = MAP_APPFONT ( 41 , 10 ) ;
+ Text = "Höhe" ;
+ Text [ ENGLISH ] = "Height" ;
+ Text [ english_us ] = "Height" ;
+ Text [ italian ] = "Altezza" ;
+ Text [ spanish ] = "Altura" ;
+ Text [ french ] = "Hauteur" ;
+ Text [ dutch ] = "Hoogte" ;
+ Text [ swedish ] = "Höjd" ;
+ Text [ danish ] = "Højde" ;
+ Text [ portuguese ] = "Altura" ;
+ Text [ portuguese_brazilian ] = "Höhe" ;
+ Text[ chinese_simplified ] = "¸ß¶È";
+ Text[ russian ] = "Âûñîòà";
+ Text[ polish ] = "Wys.";
+ Text[ japanese ] = "‚‚³";
+ Text[ chinese_traditional ] = "°ª«×";
+ Text[ arabic ] = "ÇáÇÑÊÝÇÚ";
+ Text[ greek ] = "¾øïò";
+ Text[ korean ] = "³ôÀÌ";
+ Text[ turkish ] = "Yükseklik";
+ Text[ language_user1 ] = " ";
+ };
+ OKButton BTN_OK_PIX
+ {
+ Pos = MAP_APPFONT ( 122 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL_PIX
+ {
+ Pos = MAP_APPFONT ( 122 , 23 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BTN_HELP_PIX
+ {
+ Pos = MAP_APPFONT ( 122 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+};
+ModalDialog DLG_EXPORT_VEC
+{
+ OutputSize = TRUE ;
+ SVLook = TRUE ;
+ Size = MAP_APPFONT ( 178 , 98 ) ;
+ Moveable = TRUE ;
+ Closeable = TRUE ;
+ MetricField MTF_SIZEX_VEC
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 60 , 59 ) ;
+ Size = MAP_APPFONT ( 50 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 100 ;
+ Maximum = 99999 ;
+ StrictFormat = TRUE ;
+ DecimalDigits = 2 ;
+ Unit = FUNIT_MM ;
+ First = 100 ;
+ Last = 99999 ;
+ SpinSize = 100 ;
+ };
+ MetricField MTF_SIZEY_VEC
+ {
+ Border = TRUE ;
+ Pos = MAP_APPFONT ( 60 , 74 ) ;
+ Size = MAP_APPFONT ( 50 , 12 ) ;
+ TabStop = TRUE ;
+ Repeat = TRUE ;
+ Spin = TRUE ;
+ Minimum = 100 ;
+ Maximum = 99999 ;
+ StrictFormat = TRUE ;
+ DecimalDigits = 2 ;
+ Unit = FUNIT_MM ;
+ First = 100 ;
+ Last = 99999 ;
+ SpinSize = 100 ;
+ };
+ GroupBox GRP_SIZE_VEC
+ {
+ Pos = MAP_APPFONT ( 6 , 48 ) ;
+ Size = MAP_APPFONT ( 110 , 44 ) ;
+ Text = "Größe" ;
+ Text [ ENGLISH ] = "Size" ;
+ Text [ dutch ] = "Grootte" ;
+ Text [ english_us ] = "Size" ;
+ Text [ italian ] = "Dimensione" ;
+ Text [ spanish ] = "Tamaño" ;
+ Text [ french ] = "Taille" ;
+ Text [ swedish ] = "Storlek" ;
+ Text [ danish ] = "Størrelse" ;
+ Text [ portuguese_brazilian ] = "Größe" ;
+ Text [ portuguese ] = "Tamanho" ;
+ Text[ chinese_simplified ] = "´óС";
+ Text[ russian ] = "Ðàçìåð";
+ Text[ polish ] = "Rozmiar";
+ Text[ japanese ] = "»²½Þ";
+ Text[ chinese_traditional ] = "¤j¤p";
+ Text[ arabic ] = "ÇáÍÌã";
+ Text[ greek ] = "ÌÝãåèïò";
+ Text[ korean ] = "Å©±â";
+ Text[ turkish ] = "Büyüklük";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_SIZEX_VEC
+ {
+ Pos = MAP_APPFONT ( 12 , 59 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Breite" ;
+ Text [ ENGLISH ] = "Width" ;
+ Text [ dutch ] = "Breedte" ;
+ Text [ english_us ] = "Width" ;
+ Text [ italian ] = "Larghezza" ;
+ Text [ spanish ] = "Ancho" ;
+ Text [ french ] = "Largeur" ;
+ Text [ swedish ] = "Bredd" ;
+ Text [ danish ] = "Bredde" ;
+ Text [ portuguese ] = "Largura" ;
+ Text [ portuguese_brazilian ] = "Breite" ;
+ Text[ chinese_simplified ] = "¿í¶È";
+ Text[ russian ] = "Øèðèíà";
+ Text[ polish ] = "Szer.";
+ Text[ japanese ] = "•";
+ Text[ chinese_traditional ] = "¼e«×";
+ Text[ arabic ] = "ÇáÚÑÖ";
+ Text[ greek ] = "ÐëÜôïò";
+ Text[ korean ] = "³Êºñ";
+ Text[ turkish ] = "Geniþlik";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText FT_SIZEY_VEC
+ {
+ Pos = MAP_APPFONT ( 12 , 74 ) ;
+ Size = MAP_APPFONT ( 45 , 10 ) ;
+ Text = "Höhe" ;
+ Text [ ENGLISH ] = "Height" ;
+ Text [ english_us ] = "Height" ;
+ Text [ italian ] = "Altezza" ;
+ Text [ spanish ] = "Altura" ;
+ Text [ french ] = "Hauteur" ;
+ Text [ dutch ] = "Hoogte" ;
+ Text [ swedish ] = "Höjd" ;
+ Text [ danish ] = "Højde" ;
+ Text [ portuguese_brazilian ] = "Höhe" ;
+ Text [ portuguese ] = "Altura" ;
+ Text[ chinese_simplified ] = "¸ß¶È";
+ Text[ russian ] = "Âûñîòà";
+ Text[ polish ] = "Wys.";
+ Text[ japanese ] = "‚‚³";
+ Text[ chinese_traditional ] = "°ª«×";
+ Text[ arabic ] = "ÇáÇÑÊÝÇÚ";
+ Text[ greek ] = "¾øïò";
+ Text[ korean ] = "³ôÀÌ";
+ Text[ turkish ] = "Yükseklik";
+ Text[ language_user1 ] = " ";
+ };
+ OKButton BTN_OK_VEC
+ {
+ Pos = MAP_APPFONT ( 122 , 6 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ DefButton = TRUE ;
+ };
+ CancelButton BTN_CANCEL_VEC
+ {
+ Pos = MAP_APPFONT ( 122 , 24 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ HelpButton BTN_HELP_VEC
+ {
+ Pos = MAP_APPFONT ( 122 , 43 ) ;
+ Size = MAP_APPFONT ( 50 , 14 ) ;
+ TabStop = TRUE ;
+ };
+ RadioButton RB_ORIGINAL_VEC
+ {
+ Pos = MAP_APPFONT ( 12 , 12 ) ;
+ Size = MAP_APPFONT ( 98 , 12 ) ;
+ Text = "~Original" ;
+ Text [ ENGLISH ] = "~Original" ;
+ TabStop = TRUE ;
+ Text [ dutch ] = "~Origineel" ;
+ Text [ english_us ] = "~Original" ;
+ Text [ italian ] = "~Originale" ;
+ Text [ spanish ] = "~Original" ;
+ Text [ french ] = "~Original" ;
+ Text [ swedish ] = "~Original" ;
+ Text [ danish ] = "Original" ;
+ Text [ portuguese_brazilian ] = "~Original" ;
+ Text [ portuguese ] = "~Original" ;
+ Text[ chinese_simplified ] = "Ô­¼þ(~O)";
+ Text[ russian ] = "Îðèãèíàë";
+ Text[ polish ] = "Orygina³";
+ Text[ japanese ] = "µØ¼ÞÅÙ(~O)";
+ Text[ chinese_traditional ] = "­ì¥ó(~O)";
+ Text[ arabic ] = "ÇáÃÕá";
+ Text[ greek ] = "Áñ÷éêü";
+ Text[ korean ] = "¿øº»(~O)";
+ Text[ turkish ] = "~Asýl";
+ Text[ language_user1 ] = " ";
+ };
+ RadioButton RB_SIZE_VEC
+ {
+ Pos = MAP_APPFONT ( 12 , 27 ) ;
+ Size = MAP_APPFONT ( 98 , 12 ) ;
+ Text = "~Größe" ;
+ Text [ ENGLISH ] = "~Size" ;
+ TabStop = TRUE ;
+ Text [ dutch ] = "~Grootte" ;
+ Text [ english_us ] = "~Size" ;
+ Text [ italian ] = "~Dimensione" ;
+ Text [ spanish ] = "~Tamaño" ;
+ Text [ french ] = "Taille" ;
+ Text [ swedish ] = "~Storlek" ;
+ Text [ danish ] = "Størrelse" ;
+ Text [ portuguese_brazilian ] = "~Größe" ;
+ Text [ portuguese ] = "~Tamanho" ;
+ Text[ chinese_simplified ] = "´óС(~S)";
+ Text[ russian ] = "Ðàçìåð";
+ Text[ polish ] = "Rozmiar";
+ Text[ japanese ] = "»²½Þ(~S)";
+ Text[ chinese_traditional ] = "¤j¤p(~S)";
+ Text[ arabic ] = "ÇáÍÌã";
+ Text[ greek ] = "ÌÝãåèïò";
+ Text[ korean ] = "Å©±â(~S)";
+ Text[ turkish ] = "~Büyüklük";
+ Text[ language_user1 ] = " ";
+ };
+ GroupBox GRP_MODE_VEC
+ {
+ Pos = MAP_APPFONT ( 6 , 3 ) ;
+ Size = MAP_APPFONT ( 110 , 42 ) ;
+ Text = "Modus" ;
+ Text [ ENGLISH ] = "Mode" ;
+ Text [ dutch ] = "Modus" ;
+ Text [ english_us ] = "Mode" ;
+ Text [ italian ] = "Modo" ;
+ Text [ spanish ] = "Modo" ;
+ Text [ french ] = "Mode" ;
+ Text [ swedish ] = "Läge" ;
+ Text [ danish ] = "Modus" ;
+ Text [ portuguese_brazilian ] = "Modus" ;
+ Text [ portuguese ] = "Modo" ;
+ Text[ chinese_simplified ] = "ģʽ";
+ Text[ russian ] = "Ðåæèì";
+ Text[ polish ] = "Tryb";
+ Text[ japanese ] = "Ó°ÄÞ";
+ Text[ chinese_traditional ] = "¼Ò¦¡";
+ Text[ arabic ] = "ÇáæÖÚ";
+ Text[ greek ] = "ÊáôÜóôáóç";
+ Text[ korean ] = "¸ðµå";
+ Text[ turkish ] = "Kip";
+ Text[ language_user1 ] = " ";
+ };
+};
diff --git a/svtools/source/filter.vcl/filter/filter.cxx b/svtools/source/filter.vcl/filter/filter.cxx
new file mode 100644
index 000000000000..17c0c47587d2
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/filter.cxx
@@ -0,0 +1,2735 @@
+/*************************************************************************
+ *
+ * $RCSfile: filter.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#if defined UNX && defined ALPHA
+#include <fstream.hxx>
+#endif
+#include <unotools/processfactory.hxx>
+#include <ucbhelper/content.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include <tools/urlobj.hxx>
+#include <tools/tempfile.hxx>
+#include <vcl/salctype.hxx>
+#include <vcl/virdev.hxx>
+#include <vcl/svapp.hxx>
+#include "filter.hxx"
+#include "fltcall.hxx"
+#include "wmf.hxx"
+#include "gifread.hxx"
+#include "pngread.hxx"
+#include "jpeg.hxx"
+#include "xbmread.hxx"
+#include "xpmread.hxx"
+#include "solar.hrc"
+#include "strings.hrc"
+#include "dlgexpor.hxx"
+#include "dlgejpg.hxx"
+#include "sgffilt.hxx"
+#ifndef _VOS_MODULE_HXX_
+#include "vos/module.hxx"
+#endif
+
+#ifdef MAC
+#include "extattr.hxx"
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_REFERENCE_H_
+#include <com/sun/star/uno/Reference.h>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XINTERFACE_HPP_
+#include <com/sun/star/uno/XInterface.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XWEAK_HPP_
+#include <com/sun/star/uno/XWeak.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XAGGREGATION_HPP_
+#include <com/sun/star/uno/XAggregation.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UNO_XTYPEPROVIDER_HPP_
+#include <com/sun/star/lang/XTypeProvider.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_
+#include <com/sun/star/io/XOutputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_SVG_XSVGWRITER_HPP_
+#include <com/sun/star/svg/XSVGWriter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_XML_SAX_XDOCUMENTHANDLER_HPP_
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#endif
+
+#define IMPEXP_FILTERPATHES "Pathes"
+
+#define IMP_BMP "SVBMP"
+#define IMP_SVMETAFILE "SVMETAFILE"
+#define IMP_WMF "SVWMF"
+#define IMP_EMF "SVEMF"
+#define IMP_SVSGF "SVSGF"
+#define IMP_SVSGV "SVSGV"
+#define IMP_GIF "SVIGIF"
+#define IMP_PNG "SVIPNG"
+#define IMP_JPEG "SVIJPEG"
+#define IMP_XBM "SVIXBM"
+#define IMP_XPM "SVIXPM"
+#define EXP_BMP "SVBMP"
+#define EXP_SVMETAFILE "SVMETAFILE"
+#define EXP_WMF "SVWMF"
+#define EXP_EMF "SVEMF"
+#define EXP_JPEG "SVEJPEG"
+#define EXP_SVG "SVESVG"
+
+#define BMP_SHORTNAME "BMP"
+#define GIF_SHORTNAME "GIF"
+#define JPG_SHORTNAME "JPG"
+#define MET_SHORTNAME "MET"
+#define PCT_SHORTNAME "PCT"
+#define PNG_SHORTNAME "PNG"
+#define SVM_SHORTNAME "SVM"
+#define TIF_SHORTNAME "TIF"
+#define WMF_SHORTNAME "WMF"
+#define EMF_SHORTNAME "EMF"
+
+#if defined WIN || (defined OS2 && !defined ICC)
+
+#define IMPORT_FUNCTION_NAME "_GraphicImport"
+#define EXPORT_FUNCTION_NAME "_GraphicExport"
+#define IMPDLG_FUNCTION_NAME "_DoImportDialog"
+#define EXPDLG_FUNCTION_NAME "_DoExportDialog"
+
+#else
+
+#define IMPORT_FUNCTION_NAME "GraphicImport"
+#define EXPORT_FUNCTION_NAME "GraphicExport"
+#define IMPDLG_FUNCTION_NAME "DoImportDialog"
+#define EXPDLG_FUNCTION_NAME "DoExportDialog"
+
+#endif
+
+// Compilerfehler, wenn Optimierung bei WNT & MSC
+#if defined WNT && defined MSC
+#pragma optimize( "", off )
+#endif
+
+// -----------
+// - statics -
+// -----------
+
+ULONG GraphicFilter::nFilterCount = 0UL;
+Link GraphicFilter::aLastFilterHdl = Link();
+
+// -------------------------
+// - ImpFilterOutputStream -
+// -------------------------
+
+class ImpFilterOutputStream : public ::cppu::WeakImplHelper1< ::com::sun::star::io::XOutputStream >
+{
+protected:
+
+ SvStream& mrStm;
+
+ virtual void SAL_CALL writeBytes( const ::com::sun::star::uno::Sequence< sal_Int8 >& rData ) { mrStm.Write( rData.getConstArray(), rData.getLength() ); }
+ virtual void SAL_CALL flush() { mrStm.Flush(); }
+ virtual void SAL_CALL closeOutput() {}
+
+public:
+
+ ImpFilterOutputStream( SvStream& rStm ) : mrStm( rStm ) {}
+ ~ImpFilterOutputStream() {}
+};
+
+// -------------------------
+// - ImpFilterCallbackData -
+// -------------------------
+
+struct ImpFilterCallbackData
+{
+ GraphicFilter * pFilt;
+ USHORT * pPercent;
+ Link * pUpdatePercentHdl;
+ BOOL * pAbort;
+ USHORT nFilePercentOfTotal;
+};
+
+// ---------------------
+// - ImpFilterCallback -
+// ---------------------
+
+BOOL ImplDirEntryHelper::Exists( const INetURLObject& rObj )
+{
+ BOOL bExists = FALSE;
+
+ try
+ {
+ ::rtl::OUString aTitle;
+ ::ucb::Content aCnt( rObj.GetMainURL(),
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
+
+ aCnt.getPropertyValue( ::rtl::OUString::createFromAscii( "Title" ) ) >>= aTitle;
+
+ if( aTitle.getLength() )
+ bExists = TRUE;
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+
+ return bExists;
+}
+
+// -----------------------------------------------------------------------------
+
+void ImplDirEntryHelper::Kill( const String& rStr )
+{
+ try
+ {
+ ::ucb::Content aCnt( INetURLObject( rStr, INET_PROT_FILE ).GetMainURL(),
+ ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XCommandEnvironment >() );
+
+ aCnt.executeCommand( ::rtl::OUString::createFromAscii( "delete" ),
+ ::com::sun::star::uno::makeAny( sal_Bool( sal_True ) ) );
+ }
+ catch( ::com::sun::star::ucb::CommandAbortedException& )
+ {
+ DBG_ERRORFILE( "CommandAbortedException" );
+ }
+ catch( ... )
+ {
+ DBG_ERRORFILE( "Any other exception" );
+ }
+}
+
+// ---------------------
+// - ImpFilterCallback -
+// ---------------------
+
+BOOL ImpFilterCallback( void* pCallerData, USHORT nPercent )
+{
+ ImpFilterCallbackData* pData= (ImpFilterCallbackData*) pCallerData;
+
+ nPercent = nPercent * pData->nFilePercentOfTotal / 100;
+
+ if( nPercent >= ( 3 + *pData->pPercent ) )
+ {
+ *pData->pPercent = nPercent;
+ pData->pUpdatePercentHdl->Call( pData->pFilt );
+ }
+
+ return *pData->pAbort;
+}
+
+// --------------------
+// - Helper functions -
+// --------------------
+
+static String ImpGetNthEntry( const String& rStr, USHORT nEntry )
+{
+ const sal_Unicode* pA = rStr.GetBuffer();
+ const sal_Unicode* pEnd = pA + rStr.Len();
+
+ sal_uInt16 i;
+ for( i = 0; ( i < nEntry ) && ( pA != pEnd ); i++ )
+ {
+ while( ( *pA != ',' ) && ( pA != pEnd ) )
+ pA++;
+
+ if( *pA == ',')
+ pA++;
+ }
+ i = 0;
+ if( *pA == '"' )
+ {
+ *pA++;
+ while( ( ( pA + i ) != pEnd ) && ( pA[i] != '"' ) )
+ i++;
+ }
+ else
+ {
+ while( ( ( pA + i ) != pEnd ) && ( pA[i] != ',' ) )
+ i++;
+ }
+ return String( pA, (xub_StrLen)i );
+}
+
+//--------------------------------------------------------------------------
+
+static BYTE* ImplSearchEntry( BYTE* pSource, BYTE* pDest, ULONG nComp, ULONG nSize )
+{
+ while ( nComp-- >= nSize )
+ {
+ ULONG i;
+ for ( i = 0; i < nSize; i++ )
+ {
+ if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
+ break;
+ }
+ if ( i == nSize )
+ return pSource;
+ pSource++;
+ }
+ return NULL;
+}
+
+//--------------------------------------------------------------------------
+
+inline String ImpGetFormatName( const String& rStr )
+{
+ return ImpGetNthEntry( rStr, 0 );
+}
+
+//--------------------------------------------------------------------------
+
+inline String ImpGetMacType( const String& rStr )
+{
+ return ImpGetNthEntry( rStr, 1 );
+}
+
+//--------------------------------------------------------------------------
+
+inline String ImpGetFormatExtension( const String& rStr )
+{
+ return ImpGetNthEntry( rStr, 2 );
+}
+
+//--------------------------------------------------------------------------
+
+inline String ImpGetFilterName( const String& rStr )
+{
+ return ImpGetNthEntry( rStr, 3 );
+}
+
+//--------------------------------------------------------------------------
+
+inline String ImpGetFilterVendor( const String& rStr )
+{
+ return ImpGetNthEntry( rStr, 4 );
+}
+
+//--------------------------------------------------------------------------
+
+inline String ImpGetFilterPixOrVec( const String& rStr )
+{
+ return ImpGetNthEntry( rStr, 5 );
+}
+
+//--------------------------------------------------------------------------
+
+inline String ImpGetFilterDialog( const String& rStr )
+{
+ return ImpGetNthEntry( rStr, 6 );
+}
+
+//--------------------------------------------------------------------------
+
+inline String ImpGetExtension( const String &rPath )
+{
+ String aExt;
+ INetURLObject aURL;
+
+ aURL.SetSmartURL( rPath );
+ aExt = aURL.GetFileExtension().ToUpperAscii();
+ return aExt;
+}
+
+/*************************************************************************
+|*
+|* ImpPeekGraphicFormat()
+|*
+|* Beschreibung:
+|* Diese Funktion kann zweierlei:
+|* 1.) Datei anlesen, Dateiformat ermitteln
+|* Eingabe-prarameter:
+|* rPath - Dateipfad
+|* rFormatExtension - Inhalt egal
+|* bTest - setze FALSE
+|* Ausgabe-parameter:
+|* Funkionswert - TRUE wenn Erfolg
+|* rFormatExtension - Bei Erfolg: uebliche Dateiendung
+|* des Formats (Grossbuchstaben)
+|* 2.) Datei anlesen, Dateiformat ueberpruefen
+|* Eingabe-prarameter:
+|* rPath - Dateipfad
+|* rFormatExtension - uebliche Dateiendung des Formats
+|* (Grossbuchstaben)
+|* bTest - setze TRUE
+|* Ausgabe-parameter:
+|* Funkionswert - FALSE, wenn die Datei bestimmt nicht
+|* vom uebgebenen Format ist.
+|* TRUE, wenn die Datei WAHRSCHEINLICH von
+|* dem Format ist, ODER WENN DAS FORMAT
+|* DIESER FUNKTION NICHT BEKANNT IST!
+|*
+|* Ersterstellung OH 26.05.95
+|* Letzte Aenderung OH 07.08.95
+|*
+*************************************************************************/
+
+static BOOL ImpPeekGraphicFormat( SvStream& rStream, String& rFormatExtension, BOOL bTest )
+{
+ USHORT i;
+ BYTE sFirstBytes[ 256 ];
+ ULONG nFirstLong,nSecondLong;
+ ULONG nStreamPos = rStream.Tell();
+
+ rStream.Seek( STREAM_SEEK_TO_END );
+ ULONG nStreamLen = rStream.Tell() - nStreamPos;
+ rStream.Seek( nStreamPos );
+
+ // Die ersten 256 Bytes in einen Buffer laden:
+ if( nStreamLen >= 256 )
+ rStream.Read( sFirstBytes, 256 );
+ else
+ {
+ rStream.Read( sFirstBytes, nStreamLen );
+
+ for( i = (USHORT) nStreamLen; i < 256; i++ )
+ sFirstBytes[ i ]=0;
+ }
+
+ if( rStream.GetError() )
+ return FALSE;
+
+ // Die ersten 8 Bytes in nFirstLong, nSecondLong unterbringen,
+ // Big-Endian:
+ for( i = 0, nFirstLong = 0L, nSecondLong = 0L; i < 4; i++ )
+ {
+ nFirstLong=(nFirstLong<<8)|(ULONG)sFirstBytes[i];
+ nSecondLong=(nSecondLong<<8)|(ULONG)sFirstBytes[i+4];
+ }
+
+ // Folgende Variable ist nur bei bTest==TRUE interessant. Sie
+ // bleibt FALSE, wenn das Format (rFormatExtension) hier noch nicht
+ // einprogrammiert wurde.
+ BOOL bSomethingTested = FALSE;
+
+ // Nun werden die verschieden Formate ueberprueft. Dabei ist die
+ // Reihenfolge nicht egal. Z.b. koennte eine MET-Datei auch durch
+ // den BMP-Test gehen, umgekehrt kann eine BMP-Datei kaum durch den
+ // MET-Test gehen. Also sollte MET vor BMP getestet werden.
+ // Theoretisch waere aber vielleicht auch eine BMP-Datei denkbar,
+ // die durch den MET-Test geht.
+ // Diese Probleme gibt es natuerlich nicht nur bei MET und BMP.
+ // Deshalb wird im Falle der Uberpruefung eines Formats (bTest==TRUE)
+ // nur genau dieses eine Format getestet. Alles andere koennte fatale
+ // Folgen haben, z.B. wenn der Benutzer sagt, es sei BMP-Datei (und es
+ // ist BMP-Datei), und hier wuerde die Datei durch den MET-Test gehen...
+
+ //--------------------------- MET ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "MET", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if( sFirstBytes[2] == 0xd3 )
+ {
+ rStream.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
+ rStream.Seek( nStreamPos );
+ USHORT nFieldSize;
+ BYTE nMagic;
+ BOOL bOK=TRUE;
+ rStream >> nFieldSize >> nMagic;
+ for (i=0; i<3; i++) {
+ if (nFieldSize<6) { bOK=FALSE; break; }
+ if (nStreamLen < rStream.Tell() + nFieldSize ) { bOK=FALSE; break; }
+ rStream.SeekRel(nFieldSize-3);
+ rStream >> nFieldSize >> nMagic;
+ if (nMagic!=0xd3) { bOK=FALSE; break; }
+ }
+ rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ if (bOK && !rStream.GetError()) {
+ rFormatExtension= UniString::CreateFromAscii( "MET", 3 );
+ return TRUE;
+ }
+ }
+ }
+
+ //--------------------------- BMP ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "BMP", 3 ) == COMPARE_EQUAL ) )
+ {
+ BYTE nOffs;
+
+ bSomethingTested=TRUE;
+
+ // OS/2-Bitmaparray ('BA') koennen wir evtl. auch lesen,
+ // dementspr. muessen wir den Offset anpassen,
+ // um auf die erste Bitmap im Array zu stossen
+ if ( sFirstBytes[0] == 0x42 && sFirstBytes[1] == 0x41 )
+ nOffs = 14;
+ else
+ nOffs = 0;
+
+ // Jetzt testen wir zunaechst auf 'BM'
+ if ( sFirstBytes[0+nOffs]==0x42 && sFirstBytes[1+nOffs]==0x4d )
+ {
+ // unter OS/2 koennen die Reserved-Flags != 0 sein
+ // (was sie eigentlich nicht duerften);
+ // in diesem Fall testen wir die Groesse des BmpInfoHeaders
+ if ( ( sFirstBytes[6+nOffs]==0x00 &&
+ sFirstBytes[7+nOffs]==0x00 &&
+ sFirstBytes[8+nOffs]==0x00 &&
+ sFirstBytes[9+nOffs]==0x00 ) ||
+ sFirstBytes[14+nOffs] == 0x28 ||
+ sFirstBytes[14+nOffs] == 0x0c )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "BMP", 3 );
+ return TRUE;
+ }
+ }
+ }
+
+ //--------------------------- WMF/EMF ------------------------------------
+
+ if( !bTest ||
+ ( rFormatExtension.CompareToAscii( "WMF", 3 ) == COMPARE_EQUAL ) ||
+ ( rFormatExtension.CompareToAscii( "EMF", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested = TRUE;
+
+ if ( nFirstLong==0xd7cdc69a || nFirstLong==0x01000900 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "WMF", 3 );
+ return TRUE;
+ }
+ else if( nFirstLong == 0x01000000 && sFirstBytes[ 40 ] == 0x20 && sFirstBytes[ 41 ] == 0x45 &&
+ sFirstBytes[ 42 ] == 0x4d && sFirstBytes[ 43 ] == 0x46 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "EMF", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- PCX ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "PCX", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if (sFirstBytes[0]==0x0a)
+ {
+ BYTE nVersion=sFirstBytes[1];
+ BYTE nEncoding=sFirstBytes[2];
+ if( ( nVersion==0 || nVersion==2 || nVersion==3 || nVersion==5 ) && nEncoding<=1 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PCX", 3 );
+ return TRUE;
+ }
+ }
+ }
+
+ //--------------------------- TIF ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "TIF", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if ( nFirstLong==0x49492a00 || nFirstLong==0x4d4d002a )
+ {
+ rFormatExtension=UniString::CreateFromAscii( "TIF", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- GIF ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "GIF", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if ( nFirstLong==0x47494638 && (sFirstBytes[4]==0x37 || sFirstBytes[4]==0x39) && sFirstBytes[5]==0x61 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "GIF", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- PNG ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "PNG", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if (nFirstLong==0x89504e47 && nSecondLong==0x0d0a1a0a)
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PNG", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- JPG ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "JPG", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if ( ( nFirstLong==0xffd8ffe0 && sFirstBytes[6]==0x4a && sFirstBytes[7]==0x46 && sFirstBytes[8]==0x49 && sFirstBytes[9]==0x46 ) ||
+ ( nFirstLong==0xffd8fffe ) || ( 0xffd8ff00 == ( nFirstLong & 0xffffff00 ) ) )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "JPG", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- SVM ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "SVM", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if( nFirstLong==0x53564744 && sFirstBytes[4]==0x49 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "SVM", 3 );
+ return TRUE;
+ }
+ else if( sFirstBytes[2]==0x56 && sFirstBytes[3]==0x43 && sFirstBytes[4]==0x4C &&
+ sFirstBytes[5]==0x4D && sFirstBytes[6]==0x54 && sFirstBytes[7]==0x46 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "SVM", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- PCD ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "PCD", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested = TRUE;
+ if( nStreamLen >= 2055 )
+ {
+ char sBuf[8];
+ rStream.Seek( nStreamPos + 2048 );
+ rStream.Read( sBuf, 7 );
+
+ if( strncmp( sBuf, "PCD_IPI", 7 ) == 0 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PCD", 3 );
+ return TRUE;
+ }
+ }
+ }
+
+ //--------------------------- PSD ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "PSD", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested = TRUE;
+ if ( ( nFirstLong == 0x38425053 ) && ( (nSecondLong >> 16 ) == 1 ) )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PSD", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- EPS ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "EPS", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested = TRUE;
+ if ( ( nFirstLong == 0xC5D0D3C6 ) || ( ImplSearchEntry( sFirstBytes, (BYTE*)"%!PS-Adobe", 10, 10 ) &&
+ ImplSearchEntry( &sFirstBytes[15], (BYTE*)"EPS", 3, 3 ) ) )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "EPS", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- DXF ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "DXF", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+
+ i=0;
+ while (i<256 && sFirstBytes[i]<=32)
+ i++;
+
+ if (i<256)
+ {
+ if( sFirstBytes[i]=='0' )
+ i++;
+ else
+ i=256;
+ }
+ while( i<256 && sFirstBytes[i]<=32 )
+ i++;
+
+ if (i+7<256)
+ {
+ if (strncmp((char*)(sFirstBytes+i),"SECTION",7)==0)
+ {
+ rFormatExtension = UniString::CreateFromAscii( "DXF", 3 );
+ return TRUE;
+ }
+ }
+
+ if( strncmp( (char*) sFirstBytes, "AutoCAD Binary DXF", 18 ) == 0 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "DXF", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- PCT ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "PCT", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested = TRUE;
+ if( nStreamLen >= 525 )
+ {
+ BYTE sBuf[4];
+ sal_uInt32 nOffset; // in ms documents the pict format is used without the first 512 bytes
+ for ( nOffset = 10; nOffset <= 512; nOffset += 512 )
+ {
+ rStream.Seek( nStreamPos + nOffset );
+ rStream.Read( sBuf,3 );
+ if ( sBuf[ 0 ] == 0x00 && sBuf[ 1 ] == 0x11 && ( sBuf[ 2 ] == 0x01 || sBuf[ 2 ] == 0x02 ) )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "PCT", 3 );
+ return TRUE;
+ }
+ }
+ }
+ }
+
+ //------------------------- PBM + PGM + PPM ---------------------------
+ if( !bTest ||
+ ( rFormatExtension.CompareToAscii( "PBM", 3 ) == COMPARE_EQUAL ) ||
+ ( rFormatExtension.CompareToAscii( "PGM", 3 ) == COMPARE_EQUAL ) ||
+ ( rFormatExtension.CompareToAscii( "PPM", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if ( sFirstBytes[ 0 ] == 'P' )
+ {
+ switch( sFirstBytes[ 1 ] )
+ {
+ case '1' :
+ case '4' :
+ rFormatExtension = UniString::CreateFromAscii( "PBM", 3 );
+ return TRUE;
+
+ case '2' :
+ case '5' :
+ rFormatExtension = UniString::CreateFromAscii( "PGM", 3 );
+ return TRUE;
+
+ case '3' :
+ case '6' :
+ rFormatExtension = UniString::CreateFromAscii( "PPM", 3 );
+ return TRUE;
+ }
+ }
+ }
+
+ //--------------------------- RAS( SUN RasterFile )------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "RAS", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested=TRUE;
+ if( nFirstLong == 0x59a66a95 )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "RAS", 3 );
+ return TRUE;
+ }
+ }
+
+ //--------------------------- XPM ------------------------------------
+ if( !bTest )
+ {
+ bSomethingTested = TRUE;
+ if( ImplSearchEntry( sFirstBytes, (BYTE*)"/* XPM */", 256, 9 ) )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "XPM", 3 );
+ return TRUE;
+ }
+ }
+ else if( rFormatExtension.CompareToAscii( "XPM", 3 ) == COMPARE_EQUAL )
+ {
+ bSomethingTested = TRUE;
+ return TRUE;
+ }
+
+ //--------------------------- XBM ------------------------------------
+ if( !bTest )
+ {
+ ULONG nSize = ( nStreamLen > 2048 ) ? 2048 : nStreamLen;
+ BYTE* pBuf = new BYTE [ nSize ];
+
+ rStream.Seek( nStreamPos );
+ rStream.Read( pBuf, nSize );
+ BYTE* pPtr = ImplSearchEntry( pBuf, (BYTE*)"#define", nSize, 7 );
+
+ if( pPtr )
+ {
+ if( ImplSearchEntry( pPtr, (BYTE*)"_width", pBuf + nSize - pPtr, 6 ) )
+ {
+ rFormatExtension = UniString::CreateFromAscii( "XBM", 3 );
+ delete pBuf;
+ return TRUE;
+ }
+ }
+ delete pBuf;
+ }
+ else if( rFormatExtension.CompareToAscii( "XBM", 3 ) == COMPARE_EQUAL )
+ {
+ bSomethingTested = TRUE;
+ return TRUE;
+ }
+
+ //--------------------------- TGA ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested = TRUE;
+ if( rFormatExtension.CompareToAscii( "TGA", 3 ) == COMPARE_EQUAL )
+ return TRUE;
+ }
+
+ //--------------------------- SGV ------------------------------------
+ if( !bTest || ( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL ) )
+ {
+ bSomethingTested = TRUE;
+ if( rFormatExtension.CompareToAscii( "SGV", 3 ) == COMPARE_EQUAL )
+ return TRUE;
+ }
+
+ return bTest && !bSomethingTested;
+}
+
+//--------------------------------------------------------------------------
+
+static USHORT ImpTestOrFindFormat( GraphicFilter& rFilter, Config& rConfig, const String& rPath,
+ SvStream& rStream, String* pConfigString, USHORT* pFormat )
+{
+ USHORT n = rConfig.GetKeyCount();
+
+#ifdef MAC
+ // ggf. Filter anhand der Mac-Typen raussuchen:
+ if( *pFormat == GRFILTER_FORMAT_DONTKNOW )
+ {
+ String aFormType;
+ String aType;
+ SvEaMgr aFile( rPath );
+
+ aFile.GetFileType( aType );
+ aType.Cut( 4 );
+
+ for( USHORT i = 0; i < n; i++ )
+ {
+ aFormType=ImpGetMacType(rConfig.ReadKey(i));
+ aFormType.Cut( 4 );
+ if( aFormType == aType && aFormType != "????" )
+ {
+ *pFormat = i;
+ break;
+ }
+ }
+ }
+#endif
+
+ // ggf. Filter bzw. Format durch anlesen ermitteln,
+ // oder durch anlesen zusichern, dass das Format stimmt:
+ if( *pFormat == GRFILTER_FORMAT_DONTKNOW )
+ {
+ String aFormatExt;
+
+ if( ImpPeekGraphicFormat( rStream, aFormatExt, FALSE ) )
+ {
+ // teuer
+ for( USHORT i = 0; i < n; i++ )
+ {
+ UniString aConfigString( rConfig.ReadKey( i ), RTL_TEXTENCODING_UTF8 );
+
+ if( ImpGetFormatExtension( aConfigString ).ToUpperAscii() == aFormatExt )
+ {
+ *pFormat = i;
+
+ if( pConfigString )
+ *pConfigString = aConfigString;
+
+ return GRFILTER_OK;
+ }
+ }
+ }
+
+ // ggf. Filter anhand der Datei-Endung raussuchen:
+ if( rPath.Len() )
+ {
+ String aExt( ImpGetExtension( rPath ) );
+
+ for( USHORT i = 0; i < n; i++ )
+ {
+ String aConfigString( rConfig.ReadKey( i ), RTL_TEXTENCODING_UTF8 );
+
+ if( ImpGetFormatExtension( aConfigString ).ToUpperAscii() == aExt )
+ {
+ *pFormat = i;
+
+ if( pConfigString )
+ *pConfigString = aConfigString;
+
+ return GRFILTER_OK;
+ }
+ }
+ }
+
+ return GRFILTER_FORMATERROR;
+ }
+ else
+ {
+ String aConfigString( rConfig.ReadKey( *pFormat ), RTL_TEXTENCODING_UTF8 );
+ String aFormatExt( ImpGetFormatExtension( aConfigString ).ToUpperAscii() );
+
+ if( !ImpPeekGraphicFormat( rStream, aFormatExt, TRUE ) )
+ return GRFILTER_FORMATERROR;
+
+ if( pConfigString )
+ *pConfigString = aConfigString;
+ }
+
+ return GRFILTER_OK;
+}
+
+//--------------------------------------------------------------------------
+
+static void ImpCorrectFilterUpdateNumber( String & rFilter )
+{
+ xub_StrLen i, nq, npq;
+
+ String aUPD( UniString::CreateFromInt32( SOLARUPD ) );
+ String aDllExt( __DLLEXTENSION, RTL_TEXTENCODING_UTF8 );
+
+ aDllExt.Erase( 2 );
+
+ const sal_Unicode* pSource = rFilter.GetBuffer();
+ const sal_Unicode* pEnd = pSource + rFilter.Len();
+
+ // Fragezeichen suchen
+ for( i = 0, nq = 0; pSource != pEnd; i++ )
+ {
+ if( *pSource++ == '?' )
+ {
+ if( nq == 0 )
+ npq = i;
+ nq++;
+ }
+ else if( nq == aUPD.Len() )
+ break;
+ else
+ nq = 0;
+ }
+
+ // Fragezeichen durch UPD-Nummer ersetzen
+ if( nq == aUPD.Len() )
+ rFilter.Replace( npq, nq, aUPD );
+
+ // Sternchen suchen
+ pSource = rFilter.GetBuffer();
+ for( i = 0, nq = 0; pSource != pEnd; i++ )
+ {
+ if( *pSource++ == '*' )
+ {
+ if( nq == 0 )
+ npq=i;
+ nq++;
+ }
+ else if( nq == 2 )
+ break;
+ else
+ nq=0;
+ }
+ // Sternchen durch Plattform-Kuerzel ersetzen
+ if( nq == 2 )
+ rFilter.Replace( npq, nq, aDllExt );
+}
+
+//--------------------------------------------------------------------------
+
+static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, const String& rFilterExt, Config* pOptions )
+{
+ Graphic aGraphic;
+ ByteString aResMgrName( "svt", 3 );
+ ResMgr* pResMgr;
+
+ aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
+ pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetAppInternational().GetLanguage() );
+
+ if ( ( rGraphic.GetType() != GRAPHIC_NONE ) && pOptions )
+ {
+ String aStrMode( rFilterExt );
+ sal_Int32 nMode;
+ aStrMode += String( ResId( KEY_MODE, pResMgr ) );
+
+ nMode = pOptions->ReadKey( ByteString( aStrMode, RTL_TEXTENCODING_UTF8 ) ).ToInt32();
+
+ if( rGraphic.GetType() == GRAPHIC_BITMAP )
+ {
+ // Auflösung wird eingestellt
+ if( nMode == 1 )
+ {
+ Bitmap aBitmap( rGraphic.GetBitmap() );
+ MapMode aMap( MAP_100TH_INCH );
+
+ String aKey( rFilterExt );
+ aKey += String( ResId( KEY_RES, pResMgr ) );
+ long nDPI = pOptions->ReadKey( ByteString( aKey, RTL_TEXTENCODING_UTF8 ) ).ToInt32();
+ Fraction aFrac( 1, Min( Max( nDPI, 75L ), 600L ) );
+
+ aMap.SetScaleX( aFrac );
+ aMap.SetScaleY( aFrac );
+
+ Size aOldSize = aBitmap.GetSizePixel();
+ aBitmap.SetPrefMapMode( aMap );
+ aBitmap.SetPrefSize( Size( aOldSize.Width() * 100,
+ aOldSize.Height() * 100 ) );
+
+ aGraphic = Graphic( aBitmap );
+ }
+ // Groesse wird eingestellt
+ else if( nMode == 2 )
+ {
+ Bitmap aBitmap( rGraphic.GetBitmap() );
+ String aKeyDX( rFilterExt );
+ aKeyDX += String( ResId( KEY_SIZEX, pResMgr ) );
+ long nDX = pOptions->ReadKey( ByteString( aKeyDX, RTL_TEXTENCODING_UTF8 ) ).ToInt32();
+ String aKeyDY( rFilterExt );
+ aKeyDY += String( ResId( KEY_SIZEY, pResMgr ) );
+ long nDY = pOptions->ReadKey( ByteString( aKeyDY, RTL_TEXTENCODING_UTF8 ) ).ToInt32();
+
+ aBitmap.SetPrefMapMode( MapMode( MAP_100TH_MM ) );
+ aBitmap.SetPrefSize( Size( nDX, nDY ) );
+ aGraphic = Graphic( aBitmap );
+ }
+ else
+ aGraphic = rGraphic;
+ }
+ else
+ {
+ if( ( nMode == 1 ) || ( nMode == 2 ) )
+ {
+ GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() );
+ String aKeyDX( rFilterExt );
+ aKeyDX += String( ResId( KEY_SIZEX, pResMgr ) );
+ long nDX = pOptions->ReadKey( ByteString( aKeyDX, RTL_TEXTENCODING_UTF8 ) ).ToInt32();
+ String aKeyDY( rFilterExt );
+ aKeyDY += String( ResId( KEY_SIZEY, pResMgr ) );
+ long nDY = pOptions->ReadKey( ByteString( aKeyDY, RTL_TEXTENCODING_UTF8 ) ).ToInt32();
+ Size aNewSize( OutputDevice::LogicToLogic( Size( nDX, nDY ), MAP_100TH_MM, aMtf.GetPrefMapMode() ) );
+
+ if( aNewSize.Width() && aNewSize.Height() )
+ {
+ const Size aPrefSize( aMtf.GetPrefSize() );
+ aMtf.Scale( Fraction( aNewSize.Width(), aPrefSize.Width() ),
+ Fraction( aNewSize.Height(), aPrefSize.Height() ) );
+ }
+
+ aGraphic = Graphic( aMtf );
+ }
+ else
+ aGraphic = rGraphic;
+ }
+ }
+ else
+ aGraphic = rGraphic;
+
+ delete pResMgr;
+
+ return aGraphic;
+}
+
+// --------------------------
+// - ImpFilterLibCacheEntry -
+// --------------------------
+
+class ImpFilterLibCache;
+
+struct ImpFilterLibCacheEntry
+{
+ ImpFilterLibCacheEntry* mpNext;
+ ::vos::OModule maLibrary;
+ String maFiltername;
+ PFilterCall mpfnImport;
+ PFilterDlgCall mpfnImportDlg;
+
+ ImpFilterLibCacheEntry( const String& rPathname, const String& rFiltername );
+ int operator==( const String& rFiltername ) const { return maFiltername == rFiltername; }
+
+ PFilterCall GetImportFunction();
+ PFilterDlgCall GetImportDlgFunction();
+ PFilterCall GetExportFunction() { return (PFilterCall) maLibrary.getSymbol( UniString::CreateFromAscii( EXPORT_FUNCTION_NAME ) ); }
+ PFilterDlgCall GetExportDlgFunction() { return (PFilterDlgCall) maLibrary.getSymbol( UniString::CreateFromAscii( EXPDLG_FUNCTION_NAME ) ); }
+};
+
+// ------------------------------------------------------------------------
+
+ImpFilterLibCacheEntry::ImpFilterLibCacheEntry( const String& rPathname, const String& rFiltername ) :
+ mpNext ( NULL ),
+ maLibrary ( rPathname ),
+ maFiltername ( rFiltername ),
+ mpfnImport ( NULL ),
+ mpfnImportDlg ( NULL )
+{
+}
+
+// ------------------------------------------------------------------------
+
+PFilterCall ImpFilterLibCacheEntry::GetImportFunction()
+{
+ if( !mpfnImport )
+ mpfnImport = (PFilterCall) maLibrary.getSymbol( UniString::CreateFromAscii( IMPORT_FUNCTION_NAME ) );
+
+ return mpfnImport;
+}
+
+// ------------------------------------------------------------------------
+
+PFilterDlgCall ImpFilterLibCacheEntry::GetImportDlgFunction()
+{
+ if( !mpfnImportDlg )
+ mpfnImportDlg = (PFilterDlgCall)maLibrary.getSymbol( UniString::CreateFromAscii( IMPDLG_FUNCTION_NAME ) );
+
+ return mpfnImportDlg;
+}
+
+// ---------------------
+// - ImpFilterLibCache -
+// ---------------------
+
+class ImpFilterLibCache
+{
+ ImpFilterLibCacheEntry* mpFirst;
+ ImpFilterLibCacheEntry* mpLast;
+ ImpFilterLibCacheEntry* mpLastUsed;
+
+public:
+ ImpFilterLibCache();
+ ~ImpFilterLibCache();
+
+ ImpFilterLibCacheEntry* GetFilter( INetURLObject& rFilter, const String& rFiltername );
+};
+
+// ------------------------------------------------------------------------
+
+ImpFilterLibCache::ImpFilterLibCache() :
+ mpFirst ( NULL ),
+ mpLast ( NULL ),
+ mpLastUsed ( NULL )
+{
+}
+
+// ------------------------------------------------------------------------
+
+ImpFilterLibCache::~ImpFilterLibCache()
+{
+ ImpFilterLibCacheEntry* pEntry = mpFirst;
+ while( pEntry )
+ {
+ ImpFilterLibCacheEntry* pNext = pEntry->mpNext;
+ delete pEntry;
+ pEntry = pNext;
+ }
+}
+
+// ------------------------------------------------------------------------
+
+ImpFilterLibCacheEntry* ImpFilterLibCache::GetFilter( INetURLObject& rFilter, const String& rFiltername )
+{
+ if( mpLastUsed && ( *mpLastUsed == rFiltername ) )
+ return mpLastUsed;
+ else
+ {
+ ImpFilterLibCacheEntry* pEntry = mpFirst;
+
+ while( pEntry )
+ {
+ if( *pEntry == rFiltername )
+ break;
+ else
+ pEntry = pEntry->mpNext;
+ }
+
+ if( !pEntry )
+ {
+ pEntry = new ImpFilterLibCacheEntry( rFilter.GetFull(), rFiltername );
+
+ if( !mpFirst )
+ mpFirst = mpLast = pEntry;
+ else
+ mpLast = mpLast->mpNext = pEntry;
+ }
+
+ mpLastUsed = pEntry;
+ return pEntry;
+ }
+};
+
+// ------------------------------------------------------------------------
+
+static ImpFilterLibCache aCache;
+
+// -----------------
+// - GraphicFilter -
+// -----------------
+
+GraphicFilter::GraphicFilter()
+{
+ ImplInit( String() );
+}
+
+// ------------------------------------------------------------------------
+
+GraphicFilter::GraphicFilter( const INetURLObject& rPath )
+{
+ ImplInit( rPath.PathToFileName() );
+}
+
+// ------------------------------------------------------------------------
+
+GraphicFilter::GraphicFilter( const String& rMultiPath )
+{
+ ImplInit( rMultiPath );
+}
+
+// ------------------------------------------------------------------------
+
+GraphicFilter::~GraphicFilter()
+{
+ // no graphic filter, no handler => restore old handler
+ if( !--nFilterCount )
+ Application::SetFilterHdl( aLastFilterHdl );
+
+ String aCfgPath( pConfig->GetPathName() );
+
+ delete pErrorEx;
+ delete pConfig;
+ delete pConfigPath;
+ delete pFilterPath;
+ delete pOptionsConfigPath;
+
+ if( pOptionsConfig )
+ {
+ pOptionsConfig->Flush();
+ delete pOptionsConfig;
+ }
+ ImplDirEntryHelper::Kill( aCfgPath );
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::ImplInit( const String& rInitPath )
+{
+ pErrorEx = new FilterErrorEx;
+ pConfig = new Config( TempFile::CreateTempName() );
+ pConfig->EnablePersistence( FALSE );
+ pConfigPath = new String;
+ pFilterPath = new String;
+ pOptionsConfigPath = new String;
+
+ ImplCreateMultiConfig( rInitPath );
+ pOptionsConfig = NULL;
+ bOptionsEnabled = FALSE;
+ nPercent = 0;
+ bAbort = FALSE;
+ bCacheEnabled = TRUE;
+
+ // first instance of GraphicFilter sets link
+ if( !nFilterCount++ )
+ {
+ // save old link
+ aLastFilterHdl = Application::GetFilterHdl();
+ Application::SetFilterHdl( LINK( this, GraphicFilter, FilterCallback ) );
+ }
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::ImplCreateMultiConfig( const String& rMultiPath )
+{
+ *pConfigPath = rMultiPath;
+
+ if( rMultiPath.Len() )
+ {
+ for( long i = rMultiPath.GetTokenCount( ';' ); i; )
+ {
+ Config aCfg( rMultiPath.GetToken( (USHORT) --i, ';' ) );
+
+ // clone import entries
+ if( aCfg.HasGroup( IMP_FILTERSECTION ) )
+ {
+ aCfg.SetGroup( IMP_FILTERSECTION );
+ pConfig->SetGroup( IMP_FILTERSECTION );
+
+ for( USHORT n = 0, nCount = aCfg.GetKeyCount(); n < nCount; n++ )
+ pConfig->WriteKey( aCfg.GetKeyName( n ), aCfg.ReadKey( n ) );
+ }
+
+ // clone export entries
+ if( aCfg.HasGroup( EXP_FILTERSECTION ) )
+ {
+ aCfg.SetGroup( EXP_FILTERSECTION );
+ pConfig->SetGroup( EXP_FILTERSECTION );
+
+ for( USHORT n = 0, nCount = aCfg.GetKeyCount(); n < nCount; n++ )
+ pConfig->WriteKey( aCfg.GetKeyName( n ), aCfg.ReadKey( n ) );
+ }
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
+ULONG GraphicFilter::ImplSetError( ULONG nError, const SvStream* pStm )
+{
+ pErrorEx->nFilterError = nError;
+ pErrorEx->nStreamError = pStm ? pStm->GetError() : ERRCODE_NONE;
+ return nError;
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::EnableConfigCache( BOOL bEnable )
+{
+ bCacheEnabled = bEnable;
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::SetConfigPath( const INetURLObject& rPath )
+{
+ SetConfigPath( rPath.PathToFileName() );
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::SetConfigPath( const String& rMultiPath )
+{
+ // delete old import group
+ if( pConfig->HasGroup( IMP_FILTERSECTION ) )
+ pConfig->DeleteGroup( IMP_FILTERSECTION );
+
+ // delete old export group
+ if( pConfig->HasGroup( EXP_FILTERSECTION ) )
+ pConfig->DeleteGroup( EXP_FILTERSECTION );
+
+ ImplCreateMultiConfig( rMultiPath );
+}
+
+// ------------------------------------------------------------------------
+
+const String& GraphicFilter::GetConfigPath() const
+{
+ DBG_ASSERT( pConfigPath, "GraphicFilter::GetConfigPath(): Missing ConfigPath!" );
+ return *pConfigPath;
+}
+
+// ------------------------------------------------------------------------
+
+Config& GraphicFilter::GetConfig() const
+{
+ DBG_ASSERT( pConfig, "GraphicFilter::GetConfig(): Missing Config!" );
+ return *pConfig;
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::SetFilterPath( const INetURLObject& rPath )
+{
+ SetFilterPath( rPath.PathToFileName() );
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::SetFilterPath( const String& rMultiPath )
+{
+ *pFilterPath = rMultiPath;
+
+ // delete old filter path group
+ if( pConfig->HasGroup( IMPEXP_FILTERPATHES ) )
+ pConfig->DeleteGroup( IMPEXP_FILTERPATHES );
+
+ pConfig->SetGroup( IMPEXP_FILTERPATHES );
+
+ // add new pathes to group
+ for( USHORT i = 0, nCount = rMultiPath.GetTokenCount( ';' ); i < nCount; i++ )
+ {
+ INetURLObject aPath;
+ aPath.SetSmartURL( rMultiPath.GetToken( i, ';' ) );
+ if( ImplDirEntryHelper::Exists( aPath ) )
+ {
+ ByteString aKey( 'P' );
+ aKey += ByteString::CreateFromInt32( i );
+ pConfig->WriteKey( aKey, aPath.PathToFileName(), RTL_TEXTENCODING_UTF8 );
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
+const String& GraphicFilter::GetFilterPath() const
+{
+ DBG_ASSERT( pFilterPath, "GraphicFilter::GetFilterPath(): Missing FilterPath!" );
+ return *pFilterPath;
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::SetOptionsConfigPath( const INetURLObject& rConfigPath )
+{
+ const String aNewPath( rConfigPath.PathToFileName() );
+
+ if( aNewPath != GetOptionsConfigPath() )
+ {
+ *pOptionsConfigPath = aNewPath;
+
+ if( pOptionsConfig )
+ {
+ pOptionsConfig->Flush();
+ delete pOptionsConfig;
+ }
+
+ if( aNewPath.Len() )
+ {
+ pOptionsConfig = new Config( aNewPath );
+ pOptionsConfig->SetGroup( OPT_FILTERSECTION );
+ bOptionsEnabled = TRUE;
+ }
+ else
+ {
+ pOptionsConfig = NULL;
+ bOptionsEnabled = FALSE;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
+const String& GraphicFilter::GetOptionsConfigPath() const
+{
+ DBG_ASSERT( pOptionsConfigPath, "GraphicFilter::GetOptionsConfigPath(): Missing OptionsConfigPath!" );
+ return *pOptionsConfigPath;
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::GetImportFormatCount()
+{
+ DBG_ASSERT (pConfig,"GraphicFilter::GetImportFormatCount() : no Config" );
+
+ pConfig->SetGroup( IMP_FILTERSECTION );
+ return pConfig->GetKeyCount();
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::GetImportFormatNumber( const String& rFormatName )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter::GetImportFormatNumber() : no Config" );
+
+ pConfig->SetGroup( IMP_FILTERSECTION );
+
+ USHORT nKeys = pConfig->GetKeyCount();
+ USHORT i = 0;
+ String aFormatStr;
+ String aUpperFormat( rFormatName );
+
+ aUpperFormat.ToUpperAscii();
+
+ xub_StrLen nLen = aUpperFormat.Len();
+ while( i < nKeys )
+ {
+ UniString aFormat( pConfig->ReadKey( i ), RTL_TEXTENCODING_UTF8 );
+ if( ImpGetFormatName( aFormat ).CompareIgnoreCaseToAscii( aUpperFormat.GetBuffer(), nLen ) == COMPARE_EQUAL )
+ break;
+
+ i++;
+ }
+
+ return( ( i == nKeys ) ? GRFILTER_FORMAT_NOTFOUND : i );
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetImportFormatName( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter::GetImportFormatName() : no Config" );
+
+ pConfig->SetGroup( IMP_FILTERSECTION );
+ UniString aFormat( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 );
+ return ImpGetFormatName( aFormat );
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetImportFormatShortName( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter::GetImportFormatShortName() : no Config" );
+
+ pConfig->SetGroup( IMP_FILTERSECTION );
+ return UniString( pConfig->GetKeyName( nFormat ), RTL_TEXTENCODING_UTF8 );
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetImportFormatType( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter::GetImportFormatType() : no Config" );
+
+ pConfig->SetGroup( IMP_FILTERSECTION );
+
+#ifdef MAC
+
+ String aStr=ImpGetMacType( pConfig->ReadKey( nFormat ) );
+
+ if( !aStr.Len() )
+ {
+ aStr = "????.";
+ aStr += ImpGetFormatExtension( pConfig->ReadKey(nFormat) );
+ }
+
+ return aStr;
+
+#else
+
+ return ImpGetFormatExtension( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) );
+
+#endif
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetImportOSFileType( USHORT nFormat )
+{
+ String aOSFileType;
+
+#ifdef MAC
+
+ DBG_ASSERT( pConfig,"GraphicFilter::GetImportOSFileType() : no Config" );
+ pConfig->SetGroup( IMP_FILTERSECTION );
+ aOSFileType = ImpGetMacType( pConfig->ReadKey( nFormat ) );
+
+#endif
+
+ return aOSFileType;
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetImportWildcard( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter::GetImportWildcard() : no Config" );
+
+ String aWildcard( UniString::CreateFromAscii( "*.", 2 ) );
+ pConfig->SetGroup( IMP_FILTERSECTION );
+ aWildcard.Append( ImpGetFormatExtension( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) ) );
+ return aWildcard;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GraphicFilter::IsImportPixelFormat( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter::IsImportPixelFormat() : no Config" );
+
+ pConfig->SetGroup( IMP_FILTERSECTION );
+ return ( ImpGetNthEntry( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ), 5 )
+ .CompareIgnoreCaseToAscii( "PIX", 3 ) == COMPARE_EQUAL );
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::GetExportFormatCount()
+{
+ DBG_ASSERT( pConfig,"GraphicFilter:: : no Config" );
+
+ pConfig->SetGroup( EXP_FILTERSECTION );
+ return pConfig->GetKeyCount();
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::GetExportFormatNumber( const String& rFormatName )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter:: : no Config" );
+
+ pConfig->SetGroup( EXP_FILTERSECTION );
+
+ USHORT nKeys = pConfig->GetKeyCount();
+ USHORT i = 0;
+ String aUpperFormat( rFormatName );
+ while( i < nKeys )
+ {
+ UniString aTemp( pConfig->ReadKey( i ), RTL_TEXTENCODING_UTF8 );
+ if( ImpGetFormatName( aTemp ).EqualsIgnoreCaseAscii( aUpperFormat ) )
+ break;
+ i++;
+ }
+
+ return( ( i == nKeys ) ? GRFILTER_FORMAT_NOTFOUND : i );
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetExportFormatName( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter:: : no Config" );
+
+ pConfig->SetGroup( EXP_FILTERSECTION );
+ return ImpGetFormatName( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) );
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetExportFormatShortName( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter:: : no Config" );
+
+ pConfig->SetGroup( EXP_FILTERSECTION );
+ return UniString( pConfig->GetKeyName( nFormat ), RTL_TEXTENCODING_UTF8 );
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetExportFormatType( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter:: : no Config" );
+
+ pConfig->SetGroup( EXP_FILTERSECTION );
+
+#ifdef MAC
+
+ String aStr = ImpGetMacType( pConfig->ReadKey( nFormat ) );
+
+ if ( !aStr.Len() )
+ {
+ aStr = "????.";
+ aStr += ImpGetFormatExtension( pConfig->ReadKey(nFormat) );
+ }
+
+ return aStr;
+
+#else
+
+ return ImpGetFormatExtension( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) );
+
+#endif
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetExportOSFileType( USHORT nFormat )
+{
+ String aOSFileType;
+
+#ifdef MAC
+
+ DBG_ASSERT( pConfig,"GraphicFilter::GetExportOSFileType() : no Config" );
+
+ pConfig->SetGroup( EXP_FILTERSECTION );
+ aOSFileType = ImpGetMacType( pConfig->ReadKey( nFormat ) );
+
+#endif
+
+ return aOSFileType;
+}
+
+// ------------------------------------------------------------------------
+
+String GraphicFilter::GetExportWildcard( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter::GetExportWildcard() : no Config" );
+
+ String aWildcard( UniString::CreateFromAscii( "*.", 2 ) );
+ pConfig->SetGroup( EXP_FILTERSECTION );
+ aWildcard.Append( ImpGetFormatExtension( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) ) );
+ return aWildcard;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GraphicFilter::IsExportPixelFormat( USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter::IsExportPixelFormat() : no Config" );
+
+ pConfig->SetGroup( EXP_FILTERSECTION );
+ return ( ImpGetNthEntry( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ), 5 )
+ .CompareIgnoreCaseToAscii( "PIX", 3 ) == COMPARE_EQUAL );
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::CanImportGraphic( const INetURLObject& rPath,
+ USHORT nFormat, USHORT* pDeterminedFormat )
+{
+ String aPath( rPath.PathToFileName() );
+ SvFileStream aIStream( aPath, STREAM_READ | STREAM_SHARE_DENYNONE );
+
+ return CanImportGraphic( aPath, aIStream, nFormat, pDeterminedFormat );
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::CanImportGraphic( const String& rPath, SvStream& rIStream,
+ USHORT nFormat, USHORT* pDeterminedFormat )
+{
+ DBG_ASSERT(pConfig,"GraphicFilter:: : no Config");
+
+ if( !bCacheEnabled || pConfig->GetGroup() != IMP_FILTERSECTION )
+ pConfig->SetGroup( IMP_FILTERSECTION );
+
+ ULONG nStreamPos = rIStream.Tell();
+ USHORT nRes = ImpTestOrFindFormat( *this, *pConfig, rPath, rIStream, NULL, &nFormat );
+
+ rIStream.Seek(nStreamPos);
+
+ if( nRes==GRFILTER_OK && pDeterminedFormat!=NULL )
+ *pDeterminedFormat = nFormat;
+
+ return (USHORT) ImplSetError( nRes, &rIStream );
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const INetURLObject& rPath,
+ USHORT nFormat, USHORT * pDeterminedFormat )
+{
+ const String aPath( rPath.PathToFileName() );
+ SvFileStream aIStm( aPath, STREAM_READ | STREAM_SHARE_DENYNONE );
+
+ return ImportGraphic( rGraphic, aPath, aIStm, nFormat, pDeterminedFormat );
+}
+
+//-------------------------------------------------------------------------
+
+USHORT GraphicFilter::ImportGraphic( Graphic& rGraphic, const String& rPath, SvStream& rIStream,
+ USHORT nFormat, USHORT* pDeterminedFormat )
+{
+ ImpFilterCallbackData aCallbackData;
+ String aFilterName;
+ String aConfigString;
+ String aUpperName;
+ ULONG nStmBegin;
+ USHORT nStatus;
+ GraphicReader* pContext = rGraphic.GetContext();
+ GfxLinkType eLinkType = GFX_LINK_TYPE_NONE;
+ BOOL bDummyContext = ( pContext == (GraphicReader*) 1 );
+ const BOOL bLinkSet = rGraphic.IsLink();
+
+ ResetLastError();
+
+ if( !pContext || bDummyContext )
+ {
+ DBG_ASSERT( pConfig,"GraphicFilter:: : no Config" );
+
+ if( bDummyContext )
+ {
+ rGraphic.SetContext( NULL );
+ nStmBegin = 0;
+ }
+ else
+ nStmBegin = rIStream.Tell();
+
+ if( !bCacheEnabled || pConfig->GetGroup() != IMP_FILTERSECTION )
+ pConfig->SetGroup( IMP_FILTERSECTION );
+
+ aCallbackData.pFilt = this;
+ aCallbackData.pPercent = &nPercent;
+ aCallbackData.pUpdatePercentHdl = &aUpdatePercentHdlLink;
+ aCallbackData.pAbort = &bAbort;
+ aCallbackData.nFilePercentOfTotal = 100;
+ bAbort = FALSE;
+ nPercent = 0;
+ nStatus = ImpTestOrFindFormat( *this, *pConfig, rPath, rIStream, &aConfigString, &nFormat );
+
+ // Falls Pending, geben wir GRFILTER_OK zurueck,
+ // um mehr Bytes anzufordern
+ if( rIStream.GetError() == ERRCODE_IO_PENDING )
+ {
+ rGraphic.SetContext( (GraphicReader*) 1 );
+ rIStream.ResetError();
+ rIStream.Seek( nStmBegin );
+ return (USHORT) ImplSetError( GRFILTER_OK );
+ }
+
+ rIStream.Seek( nStmBegin );
+
+ if( ( nStatus != GRFILTER_OK ) || rIStream.GetError() )
+ return (USHORT) ImplSetError( ( nStatus != GRFILTER_OK ) ? nStatus : GRFILTER_OPENERROR, &rIStream );
+
+ if( pDeterminedFormat != NULL )
+ *pDeterminedFormat = nFormat;
+
+ aUpperName = aFilterName = ImpGetFilterName( aConfigString );
+ aUpperName.ToUpperAscii();
+ }
+ else
+ {
+ if( pContext && !bDummyContext )
+ aUpperName = pContext->GetUpperFilterName();
+
+ nStmBegin = 0;
+ nStatus = GRFILTER_OK;
+ }
+
+ // read graphic
+ if( aUpperName.CompareToAscii( IMP_GIF ) == COMPARE_EQUAL )
+ {
+ if( rGraphic.GetContext() == (GraphicReader*) 1 )
+ rGraphic.SetContext( NULL );
+
+ if( !ImportGIF( rIStream, rGraphic, NULL ) )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ eLinkType = GFX_LINK_TYPE_NATIVE_GIF;
+ }
+ else if( aUpperName.CompareToAscii( IMP_PNG ) == COMPARE_EQUAL )
+ {
+ if ( rGraphic.GetContext() == (GraphicReader*) 1 )
+ rGraphic.SetContext( NULL );
+ if ( !ImportPNG( rIStream, rGraphic, NULL ) )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ eLinkType = GFX_LINK_TYPE_NATIVE_PNG;
+ }
+ else if( aUpperName.CompareToAscii( IMP_JPEG ) == COMPARE_EQUAL )
+ {
+ if( rGraphic.GetContext() == (GraphicReader*) 1 )
+ rGraphic.SetContext( NULL );
+
+ if( !ImportJPEG( rIStream, rGraphic, NULL ) )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ eLinkType = GFX_LINK_TYPE_NATIVE_JPG;
+ }
+ else if( aUpperName.CompareToAscii( IMP_XBM ) == COMPARE_EQUAL )
+ {
+ if( rGraphic.GetContext() == (GraphicReader*) 1 )
+ rGraphic.SetContext( NULL );
+
+ if( !ImportXBM( rIStream, rGraphic, NULL ) )
+ nStatus = GRFILTER_FILTERERROR;
+ }
+ else if( aUpperName.CompareToAscii( IMP_XPM ) == COMPARE_EQUAL )
+ {
+ if( rGraphic.GetContext() == (GraphicReader*) 1 )
+ rGraphic.SetContext( NULL );
+
+ if( !ImportXPM( rIStream, rGraphic, NULL ) )
+ nStatus = GRFILTER_FILTERERROR;
+ }
+ else if( ( aUpperName.CompareToAscii( IMP_BMP ) == COMPARE_EQUAL ) ||
+ ( aUpperName.CompareToAscii( IMP_SVMETAFILE ) == COMPARE_EQUAL ) )
+ {
+ // SV interne Importfilter fuer Bitmaps und MetaFiles
+ aStartFilterHdlLink.Call( this );
+ nPercent = 60;
+ aUpdatePercentHdlLink.Call( this );
+ rIStream >> rGraphic;
+ nPercent = 100;
+ aUpdatePercentHdlLink.Call( this );
+
+ if( rIStream.GetError() )
+ nStatus = GRFILTER_FORMATERROR;
+ }
+ else if( ( aUpperName.CompareToAscii( IMP_WMF ) == COMPARE_EQUAL ) ||
+ ( aUpperName.CompareToAscii( IMP_EMF ) == COMPARE_EQUAL ) )
+ {
+ GDIMetaFile aMtf;
+ aStartFilterHdlLink.Call( this );
+ nPercent = 1;
+
+ if( !ConvertWMFToGDIMetaFile( rIStream, aMtf, &ImpFilterCallback, &aCallbackData ) )
+ nStatus = GRFILTER_FORMATERROR;
+ else
+ {
+ rGraphic = aMtf;
+ eLinkType = GFX_LINK_TYPE_NATIVE_WMF;
+ }
+ }
+ else if( ( aUpperName.CompareToAscii( IMP_SVSGF ) == COMPARE_EQUAL )
+ || ( aUpperName.CompareToAscii( IMP_SVSGV ) == COMPARE_EQUAL ) )
+ {
+ USHORT nVersion;
+ unsigned char nTyp = CheckSgfTyp( rIStream, nVersion );
+
+ switch( nTyp )
+ {
+ case SGF_BITIMAGE:
+ {
+ String aTempFileName( TempFile::CreateTempName() );
+ SvFileStream aTempStream( aTempFileName, STREAM_READ | STREAM_WRITE | STREAM_SHARE_DENYNONE );
+
+ if( aTempStream.GetError() )
+ return GRFILTER_OPENERROR;
+
+ // SGF in temporaere Datei filtern
+ aStartFilterHdlLink.Call( this );
+ nPercent = 30;
+ aUpdatePercentHdlLink.Call( this );
+
+ if( !SgfBMapFilter( rIStream, aTempStream ) )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ {
+ nPercent = 60;
+ aUpdatePercentHdlLink.Call( this );
+ aTempStream.Seek( 0L );
+ aTempStream >> rGraphic;
+
+ nPercent = 100;
+ aUpdatePercentHdlLink.Call( this );
+ if( aTempStream.GetError() )
+ nStatus = GRFILTER_FILTERERROR;
+ }
+ aTempStream.Close();
+ ImplDirEntryHelper::Kill( aTempFileName );
+ }
+ break;
+
+ case SGF_SIMPVECT:
+ {
+ GDIMetaFile aMtf;
+
+ aStartFilterHdlLink.Call( this );
+ nPercent = 50;
+ aUpdatePercentHdlLink.Call( this );
+ if( !SgfVectFilter( rIStream, aMtf ) )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ {
+ nPercent = 100;
+ aUpdatePercentHdlLink.Call( this );
+ rGraphic = Graphic( aMtf );
+ }
+ }
+ break;
+
+ case SGF_STARDRAW:
+ {
+ if( nVersion != SGV_VERSION )
+ nStatus = GRFILTER_VERSIONERROR;
+ else
+ {
+ GDIMetaFile aMtf;
+
+ aStartFilterHdlLink.Call( this );
+ nPercent = 50;
+ aUpdatePercentHdlLink.Call( this );
+ if( !SgfSDrwFilter( rIStream, aMtf, aFilterPath, aFilterPath, aConfigPath ) )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ {
+ nPercent = 100;
+ aUpdatePercentHdlLink.Call( this );
+ rGraphic = Graphic( aMtf );
+ }
+ }
+ }
+ break;
+
+ default:
+ {
+ nStatus = GRFILTER_FORMATERROR;
+ }
+ break;
+ }
+ }
+ else if( ImpGetFilterVendor( aConfigString ).CompareIgnoreCaseToAscii( "SD", 2 ) == COMPARE_EQUAL )
+ {
+ ImpFilterLibCacheEntry* pFilter = NULL;
+
+ pConfig->SetGroup( IMPEXP_FILTERPATHES );
+ ImpCorrectFilterUpdateNumber( aFilterName );
+
+ // find first filter in filter pathes
+ for( USHORT i = 0, nPathCount = pConfig->GetKeyCount(); i < nPathCount; i++ )
+ {
+ INetURLObject aFilterPath;
+ aFilterPath.SetSmartURL( UniString( pConfig->ReadKey( i ), RTL_TEXTENCODING_UTF8 ) );
+ aFilterPath.Append( aFilterName );
+ if ( pFilter = aCache.GetFilter( aFilterPath, aFilterName ) )
+ {
+ if ( ImplDirEntryHelper::Exists( aFilterPath ) )
+ break;
+ }
+ }
+
+ if( !pFilter )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ {
+ PFilterCall pFunc = pFilter->GetImportFunction();
+
+ if( !pFunc )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ {
+ aStartFilterHdlLink.Call( this );
+ aUpdatePercentHdlLink.Call( this );
+
+ if( !(*pFunc)( rIStream, rGraphic, &ImpFilterCallback, &aCallbackData, GetOptionsConfig(), FALSE ) )
+ nStatus = GRFILTER_FORMATERROR;
+ else
+ {
+ nPercent = 100;
+ aUpdatePercentHdlLink.Call( this );
+
+ // try to set link type if format matches
+ if( nFormat != GRFILTER_FORMAT_DONTKNOW )
+ {
+ const String aShortName( GetImportFormatShortName( nFormat ).ToUpperAscii() );
+
+ if( aShortName.CompareToAscii( TIF_SHORTNAME ) == COMPARE_EQUAL )
+ eLinkType = GFX_LINK_TYPE_NATIVE_TIF;
+ else if( aShortName.CompareToAscii( MET_SHORTNAME ) == COMPARE_EQUAL )
+ eLinkType = GFX_LINK_TYPE_NATIVE_MET;
+ else if( aShortName.CompareToAscii( PCT_SHORTNAME ) == COMPARE_EQUAL )
+ eLinkType = GFX_LINK_TYPE_NATIVE_PCT;
+ }
+ }
+ }
+ }
+ }
+ else
+ nStatus = GRFILTER_FILTERERROR;
+
+ // Set error code or try to set native buffer
+ if( nStatus != GRFILTER_OK )
+ {
+ if( bAbort )
+ nStatus = GRFILTER_ABORT;
+
+ ImplSetError( nStatus, &rIStream );
+ rIStream.Seek( nStmBegin );
+ rGraphic.Clear();
+
+ if( nPercent )
+ aErrorHdlLink.Call( this );
+ }
+ else if( ( eLinkType != GFX_LINK_TYPE_NONE ) && !rGraphic.GetContext() && !bLinkSet )
+ {
+ const ULONG nStmEnd = rIStream.Tell();
+ const ULONG nBufSize = nStmEnd - nStmBegin;
+
+ if( nBufSize )
+ {
+ BYTE* pBuf = new BYTE[ nBufSize ];
+ GraphicReader* pOldContext = rGraphic.GetContext();
+
+ rIStream.Seek( nStmBegin );
+ rIStream.Read( pBuf, nBufSize );
+ rGraphic.SetLink( GfxLink( pBuf, nBufSize, eLinkType, TRUE ) );
+ }
+ }
+
+ if( nPercent && !pContext )
+ {
+ nPercent = 0;
+ aEndFilterHdlLink.Call( this );
+ }
+
+ return nStatus;
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const INetURLObject& rPath, USHORT nFormat )
+{
+ const BOOL bAlreadyExists = ImplDirEntryHelper::Exists( rPath );
+ const String aPath( rPath.PathToFileName() );
+ SvFileStream aOStm( aPath, STREAM_WRITE | STREAM_TRUNC );
+ USHORT nRet = ExportGraphic( rGraphic, aPath, aOStm, nFormat );
+
+ aOStm.Close();
+
+ if( ( GRFILTER_OK != nRet ) && !bAlreadyExists )
+ ImplDirEntryHelper::Kill( aPath );
+
+ return nRet;
+}
+
+// ------------------------------------------------------------------------
+
+USHORT GraphicFilter::ExportGraphic( const Graphic& rGraphic, const String& rPath,
+ SvStream& rOStm, USHORT nFormat )
+{
+ DBG_ASSERT( pConfig, "GraphicFilter:: : no Config" );
+
+ USHORT nFormatCount = GetExportFormatCount();
+
+ ResetLastError();
+
+ if( nFormat == GRFILTER_FORMAT_DONTKNOW )
+ {
+ INetURLObject aURL;
+ aURL.SetSmartURL( rPath );
+ String aExt( aURL.GetFileExtension().ToUpperAscii() );
+
+
+ for( USHORT i = 0; i < nFormatCount; i++ )
+ {
+ if ( ImpGetFormatExtension( UniString( pConfig->ReadKey( i ), RTL_TEXTENCODING_UTF8 ) )
+ .CompareIgnoreCaseToAscii( aExt ) == COMPARE_EQUAL )
+ {
+ nFormat=i;
+ break;
+ }
+ }
+ }
+
+ if( nFormat >= nFormatCount )
+ return (USHORT) ImplSetError( GRFILTER_FORMATERROR );
+
+ ImpFilterCallbackData aCallbackData;
+ aCallbackData.pFilt=this;
+ aCallbackData.pPercent=&nPercent;
+ aCallbackData.pUpdatePercentHdl=&aUpdatePercentHdlLink;
+ aCallbackData.pAbort=&bAbort;
+ aCallbackData.nFilePercentOfTotal=100;
+ bAbort=FALSE;
+
+ String aKey( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 );
+ String aFilterName( ImpGetFilterName( aKey ) );
+ String aUpperName( aFilterName );
+ String aFilterVendor( ImpGetFilterVendor( aKey ).ToUpperAscii() );
+ String aPixOrVec( ImpGetFilterPixOrVec( aKey).ToUpperAscii() );
+
+ aUpperName.ToUpperAscii();
+ nPercent=0;
+ aStartFilterHdlLink.Call(this);
+ aUpdatePercentHdlLink.Call(this);
+
+ USHORT nStatus = GRFILTER_OK;
+ GraphicType eType;
+ Graphic aGraphic( ImpGetScaledGraphic( rGraphic,
+ UniString( pConfig->GetKeyName( nFormat ), RTL_TEXTENCODING_UTF8 ),
+ GetOptionsConfig() ) );
+
+ eType = aGraphic.GetType();
+
+ if( aPixOrVec.CompareToAscii( "PIX", 3 ) == COMPARE_EQUAL )
+ {
+ if( eType != GRAPHIC_BITMAP )
+ {
+ Size aSizePixel;
+ ULONG nColorCount,nBitsPerPixel,nNeededMem,nMaxMem;
+ VirtualDevice aVirDev;
+
+ // Maximalen Speicherbedarf fuer das Bildes holen:
+ if( GetOptionsConfig() )
+ nMaxMem = (UINT32)GetOptionsConfig()->ReadKey( "VEC-TO-PIX-MAX-KB", "1024" ).ToInt32();
+ else
+ nMaxMem = 1024;
+
+ nMaxMem *= 1024; // In Bytes
+
+ // Berechnen, wie gross das Bild normalerweise werden wuerde:
+ aSizePixel=aVirDev.LogicToPixel(aGraphic.GetPrefSize(),aGraphic.GetPrefMapMode());
+
+ // Berechnen, wieviel Speicher das Bild benoetigen wuerde:
+ nColorCount=aVirDev.GetColorCount();
+ if (nColorCount<=2) nBitsPerPixel=1;
+ else if (nColorCount<=4) nBitsPerPixel=2;
+ else if (nColorCount<=16) nBitsPerPixel=4;
+ else if (nColorCount<=256) nBitsPerPixel=8;
+ else if (nColorCount<=65536) nBitsPerPixel=16;
+ else nBitsPerPixel=24;
+ nNeededMem=((ULONG)aSizePixel.Width()*(ULONG)aSizePixel.Height()*nBitsPerPixel+7)/8;
+
+ // ggf. Groesse des Bildes einschraenken:
+ if (nMaxMem<nNeededMem)
+ {
+ double fFak=sqrt(((double)nMaxMem)/((double)nNeededMem));
+ aSizePixel.Width()=(ULONG)(((double)aSizePixel.Width())*fFak);
+ aSizePixel.Height()=(ULONG)(((double)aSizePixel.Height())*fFak);
+ }
+
+ aVirDev.SetMapMode(MapMode(MAP_PIXEL));
+ aVirDev.SetOutputSizePixel(aSizePixel);
+ Graphic aGraphic2=aGraphic;
+ aGraphic2.Draw(&aVirDev,Point(0,0),aSizePixel); // Gemein: dies aendert den MapMode
+ aVirDev.SetMapMode(MapMode(MAP_PIXEL));
+ aGraphic=Graphic(aVirDev.GetBitmap(Point(0,0),aSizePixel));
+ }
+ }
+ else if ( aPixOrVec.CompareToAscii( "VEC", 3 ) != COMPARE_EQUAL )
+ nStatus=GRFILTER_FILTERERROR;
+
+ if( GRFILTER_OK == nStatus )
+ {
+ if( aUpperName.CompareToAscii( EXP_BMP ) == COMPARE_EQUAL )
+ {
+ nPercent = 60;
+ aUpdatePercentHdlLink.Call( this );
+
+ if( !rOStm.GetError() )
+ {
+ Bitmap aBmp( aGraphic.GetBitmap() );
+
+ if( GetOptionsConfig() )
+ {
+ ResMgr* pResMgr = CREATERESMGR( svt );
+ UniString aRLEKey( pConfig->GetKeyName( nFormat ), RTL_TEXTENCODING_UTF8 );
+
+ aRLEKey += UniString( ResId( KEY_RLE_CODING, pResMgr ) );
+ ByteString aRLEStr( GetOptionsConfig()->ReadKey( ByteString( aRLEKey, RTL_TEXTENCODING_UTF8 ) ) );
+
+ // Wollen wir RLE-Kodiert speichern?
+ aGraphic.GetBitmap().Write( rOStm, aRLEStr.CompareIgnoreCaseToAscii( "FALSE", 5 ) != COMPARE_EQUAL );
+
+ delete pResMgr;
+ }
+ else
+ rOStm << aBmp;
+ }
+
+ nPercent = 90;
+ aUpdatePercentHdlLink.Call( this );
+
+ if( rOStm.GetError() )
+ nStatus = GRFILTER_IOERROR;
+ }
+ else if( aUpperName.CompareToAscii( EXP_SVMETAFILE ) == COMPARE_EQUAL )
+ {
+ if( !rOStm.GetError() )
+ {
+ GDIMetaFile aMTF;
+
+ if ( eType != GRAPHIC_BITMAP )
+ aMTF = aGraphic.GetGDIMetaFile();
+ else
+ {
+ VirtualDevice aVirDev;
+
+ aMTF.Record( &aVirDev );
+ aGraphic.Draw( &aVirDev, Point(), aGraphic.GetPrefSize() );
+ aMTF.Stop();
+ aMTF.SetPrefSize( aGraphic.GetPrefSize() );
+ aMTF.SetPrefMapMode( aGraphic.GetPrefMapMode() );
+ }
+
+ nPercent = 60;
+ aUpdatePercentHdlLink.Call( this );
+ rOStm << aMTF;
+ nPercent = 90;
+ aUpdatePercentHdlLink.Call( this );
+ }
+
+ if( rOStm.GetError() )
+ nStatus = GRFILTER_IOERROR;
+ }
+ else if ( aUpperName.CompareToAscii( EXP_WMF ) == COMPARE_EQUAL )
+ {
+ if( !rOStm.GetError() )
+ {
+ if( eType == GRAPHIC_GDIMETAFILE )
+ {
+ if ( !ConvertGDIMetaFileToWMF( aGraphic.GetGDIMetaFile(), rOStm, &ImpFilterCallback, &aCallbackData ) )
+ nStatus = GRFILTER_FORMATERROR;
+ }
+ else
+ {
+ Bitmap aBmp( aGraphic.GetBitmap() );
+ GDIMetaFile aMTF;
+ VirtualDevice aVirDev;
+
+ aMTF.Record( &aVirDev );
+ aVirDev.DrawBitmap( Point(), aBmp );
+ aMTF.Stop();
+ aMTF.SetPrefSize( aBmp.GetSizePixel() );
+
+ if( !ConvertGDIMetaFileToWMF( aMTF, rOStm, &ImpFilterCallback, &aCallbackData) )
+ nStatus = GRFILTER_FORMATERROR;
+ }
+ }
+
+ if( rOStm.GetError() )
+ nStatus = GRFILTER_IOERROR;
+ }
+ else if ( aUpperName.CompareToAscii( EXP_EMF ) == COMPARE_EQUAL )
+ {
+ if( !rOStm.GetError() )
+ {
+ if( eType == GRAPHIC_GDIMETAFILE )
+ {
+ if ( !ConvertGDIMetaFileToEMF( aGraphic.GetGDIMetaFile(), rOStm, &ImpFilterCallback, &aCallbackData ) )
+ nStatus = GRFILTER_FORMATERROR;
+ }
+ else
+ {
+ Bitmap aBmp( aGraphic.GetBitmap() );
+ GDIMetaFile aMTF;
+ VirtualDevice aVirDev;
+
+ aMTF.Record( &aVirDev );
+ aVirDev.DrawBitmap( Point(), aBmp );
+ aMTF.Stop();
+ aMTF.SetPrefSize( aBmp.GetSizePixel() );
+
+ if( !ConvertGDIMetaFileToEMF( aMTF, rOStm, &ImpFilterCallback, &aCallbackData) )
+ nStatus = GRFILTER_FORMATERROR;
+ }
+ }
+
+ if( rOStm.GetError() )
+ nStatus = GRFILTER_IOERROR;
+ }
+ else if( aUpperName.CompareToAscii( EXP_JPEG ) == COMPARE_EQUAL )
+ {
+ if( !rOStm.GetError() )
+ {
+ if( !ExportJPEG( rOStm, aGraphic, &ImpFilterCallback, &aCallbackData, GetOptionsConfig() ) )
+ nStatus = GRFILTER_FORMATERROR;
+ }
+
+ if( rOStm.GetError() )
+ nStatus = GRFILTER_IOERROR;
+ }
+ else if( aUpperName.CompareToAscii( EXP_SVG ) == COMPARE_EQUAL )
+ {
+ if( !rOStm.GetError() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMgr( ::utl::getProcessServiceFactory() );
+
+ if( xMgr.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > xSaxWriter( xMgr->createInstance(
+ ::rtl::OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ) ), ::com::sun::star::uno::UNO_QUERY );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::svg::XSVGWriter > xSVGWriter( xMgr->createInstance(
+ ::rtl::OUString::createFromAscii( "com.sun.star.svg.SVGWriter" ) ), ::com::sun::star::uno::UNO_QUERY );
+
+ if( xSaxWriter.is() && xSVGWriter.is() )
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::io::XActiveDataSource > xActiveDataSource(
+ xSaxWriter, ::com::sun::star::uno::UNO_QUERY );
+
+ if( xActiveDataSource.is() )
+ {
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xStmIf(
+ static_cast< ::cppu::OWeakObject* >( new ImpFilterOutputStream( rOStm ) ) );
+
+ SvMemoryStream aMemStm( 65535, 65535 );
+
+ aMemStm.SetCompressMode( COMPRESSMODE_FULL );
+ ( (GDIMetaFile&) aGraphic.GetGDIMetaFile() ).Write( aMemStm );
+
+ nPercent = 60;
+ aUpdatePercentHdlLink.Call( this );
+
+ xActiveDataSource->setOutputStream( ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >(
+ xStmIf, ::com::sun::star::uno::UNO_QUERY ) );
+ ::com::sun::star::uno::Sequence< sal_Int8 > aMtfSeq( (sal_Int8*) aMemStm.GetData(), aMemStm.Tell() );
+ xSVGWriter->write( xSaxWriter, aMtfSeq );
+ nPercent = 90;
+ aUpdatePercentHdlLink.Call( this );
+ }
+ }
+ }
+ }
+ }
+ else if( aFilterVendor.CompareToAscii( "SD" ) == COMPARE_EQUAL )
+ {
+ INetURLObject aFilterFilePath;
+ BOOL bFound = FALSE;
+
+ pConfig->SetGroup( IMPEXP_FILTERPATHES );
+ ImpCorrectFilterUpdateNumber( aFilterName );
+
+ // find first filter in filter pathes
+ for( USHORT i = 0, nPathCount = pConfig->GetKeyCount(); i < nPathCount; i++ )
+ {
+ aFilterFilePath.SetSmartURL( UniString( pConfig->ReadKey( i ), RTL_TEXTENCODING_UTF8 ) );
+ aFilterFilePath.Append( aFilterName );
+ if( ImplDirEntryHelper::Exists( aFilterFilePath ) )
+ {
+ bFound = TRUE;
+ break;
+ }
+ }
+
+ if( !bFound )
+ nStatus = GRFILTER_FILTERERROR;
+ else
+ {
+ ::vos::OModule aLibrary( aFilterFilePath.PathToFileName() );
+ PFilterCall pFunc = (PFilterCall) aLibrary.getSymbol( UniString::CreateFromAscii( EXPORT_FUNCTION_NAME ) );
+
+ if( pFunc )
+ {
+ if( !rOStm.GetError() )
+ {
+ if ( !(*pFunc)( rOStm, aGraphic, &ImpFilterCallback, &aCallbackData, GetOptionsConfig(), FALSE ) )
+ nStatus = GRFILTER_FORMATERROR;
+ }
+ else
+ nStatus = GRFILTER_IOERROR;
+ }
+ else
+ nStatus = GRFILTER_FILTERERROR;
+ }
+ }
+ else
+ nStatus = GRFILTER_FILTERERROR;
+ }
+
+ if( nStatus != GRFILTER_OK )
+ {
+ if( bAbort )
+ nStatus = GRFILTER_ABORT;
+
+ ImplSetError( nStatus, &rOStm );
+ aErrorHdlLink.Call( this );
+ }
+ else
+ {
+ nPercent = 100;
+ aUpdatePercentHdlLink.Call( this );
+ }
+
+ aEndFilterHdlLink.Call( this );
+
+ return nStatus;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GraphicFilter::Setup( USHORT nFormat )
+{
+ return FALSE;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GraphicFilter::HasImportDialog( USHORT nFormat )
+{
+ BOOL bRet = FALSE;
+
+ if( pConfig && GetOptionsConfig() )
+ {
+ pConfig->SetGroup( IMP_FILTERSECTION );
+ bRet = ( ImpGetFilterDialog( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) ).CompareToAscii( "TRUE", 4 ) == COMPARE_EQUAL );
+ }
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GraphicFilter::DoImportDialog( Window* pWindow, USHORT nFormat )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter:: : no Config" );
+ DBG_ASSERT( GetOptionsConfig(),"GraphicFilter:: : no OptionsConfig" );
+
+ pConfig->SetGroup( IMP_FILTERSECTION );
+
+ String aFilterName( ImpGetFilterName( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) ) );
+ String aUpperName( aFilterName );
+ BOOL bRet = FALSE;
+
+ aUpperName.ToUpperAscii();
+
+ if( ( aUpperName.CompareToAscii( IMP_BMP ) == COMPARE_EQUAL ) || ( aUpperName.CompareToAscii( IMP_SVMETAFILE ) == COMPARE_EQUAL ) )
+ {
+ // Bitmaps und SV-MetaFiles
+ }
+ else if( aUpperName.CompareToAscii( IMP_WMF ) == COMPARE_EQUAL )
+ {
+ // Import-Filter fuer WMF
+ }
+ else if( ( aUpperName.CompareToAscii( IMP_SVSGF ) == COMPARE_EQUAL ) || ( aUpperName.CompareToAscii( IMP_SVSGV ) ) )
+ {
+ // StarDraw- und StarWriter-Filter
+ }
+ else
+ {
+ // ladbare Filter
+ String aFilterVendor( ImpGetFilterVendor( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) ) );
+
+ // eigene Filter
+ if( aFilterVendor.CompareToAscii( "SD", 2 ) == COMPARE_EQUAL )
+ {
+ ImpFilterLibCacheEntry* pFilter = NULL;
+
+ pConfig->SetGroup( IMPEXP_FILTERPATHES );
+ ImpCorrectFilterUpdateNumber( aFilterName );
+
+ // find first filter in filter pathes
+ for( USHORT i = 0, nPathCount = pConfig->GetKeyCount(); i < nPathCount; i++ )
+ {
+ INetURLObject aFilterPath;
+ aFilterPath.SetSmartURL( UniString( pConfig->ReadKey( i ), RTL_TEXTENCODING_UTF8 ) );
+ if ( pFilter = aCache.GetFilter( aFilterPath, aFilterName ) )
+ {
+ aFilterPath.Append( aFilterName );
+ if ( ImplDirEntryHelper::Exists( aFilterPath ) )
+ break;
+ }
+ }
+
+ if( pFilter )
+ {
+ PFilterDlgCall pFunc = pFilter->GetImportDlgFunction();
+
+ // Dialog in DLL ausfuehren
+ if( pFunc )
+ {
+ FltCallDialogParameter aFltCallDlgPara( pWindow, NULL, GetOptionsConfig(), FUNIT_MM );
+ bRet = (*pFunc)( aFltCallDlgPara );
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GraphicFilter::HasExportDialog( USHORT nFormat )
+{
+ BOOL bRet = FALSE;
+
+ if( pConfig && GetOptionsConfig() )
+ {
+ pConfig->SetGroup( EXP_FILTERSECTION );
+ bRet = ( ImpGetFilterDialog( UniString( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 ) )
+ .CompareToAscii( "TRUE", 4 ) == COMPARE_EQUAL );
+ }
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GraphicFilter::DoExportDialog( Window* pWindow, USHORT nFormat )
+{
+ return DoExportDialog( pWindow, nFormat, FUNIT_MM );
+}
+
+BOOL GraphicFilter::DoExportDialog( Window* pWindow, USHORT nFormat, FieldUnit eFieldUnit )
+{
+ DBG_ASSERT( pConfig,"GraphicFilter:: : no Config" );
+
+ pConfig->SetGroup( EXP_FILTERSECTION );
+
+ String aKey( pConfig->ReadKey( nFormat ), RTL_TEXTENCODING_UTF8 );
+ String aFilterName( ImpGetFilterName( aKey ) );
+ String aUpperName( aFilterName );
+ String aFilterVendor( ImpGetFilterVendor( aKey ).ToUpperAscii() );
+ BOOL bRet = FALSE;
+
+ aUpperName.ToUpperAscii();
+
+ if( GetOptionsConfig() )
+ GetOptionsConfig()->Update();
+
+ // Export-Dialog fuer Bitmap's, SVM's und WMF's
+ if( ( aUpperName.CompareToAscii( EXP_BMP ) == COMPARE_EQUAL ) ||
+ ( aUpperName.CompareToAscii( EXP_SVMETAFILE ) == COMPARE_EQUAL ) ||
+ ( aUpperName.CompareToAscii( EXP_WMF ) == COMPARE_EQUAL ) ||
+ ( aUpperName.CompareToAscii( EXP_EMF ) == COMPARE_EQUAL ) ||
+ ( aUpperName.CompareToAscii( EXP_JPEG ) == COMPARE_EQUAL ) )
+ {
+ ByteString aResMgrName( "svt", 3 );
+ ResMgr* pResMgr;
+
+ aResMgrName.Append( ByteString::CreateFromInt32( SOLARUPD ) );
+ pResMgr = ResMgr::CreateResMgr( aResMgrName.GetBuffer(), Application::GetAppInternational().GetLanguage() );
+
+ FltCallDialogParameter aFltCallDlgPara( pWindow, pResMgr, GetOptionsConfig(), eFieldUnit );
+
+ // JPEG-Dialog
+ if( aUpperName.CompareToAscii( EXP_JPEG ) == COMPARE_EQUAL )
+ bRet = ( DlgExportEJPG( aFltCallDlgPara ).Execute() == RET_OK );
+ // Fuer Bitmaps nehmen wir den Pixel-Dialog
+ else if( aUpperName.CompareToAscii( EXP_BMP ) != COMPARE_EQUAL )
+ {
+ aFltCallDlgPara.aFilterExt = UniString( pConfig->GetKeyName( nFormat ), RTL_TEXTENCODING_UTF8 );
+ bRet = ( DlgExportVec( aFltCallDlgPara ).Execute() == RET_OK );
+ }
+ // Fuer Vektorformate nehmen wir den Vektor-Dialog
+ else
+ {
+ aFltCallDlgPara.aFilterExt = UniString( pConfig->GetKeyName( nFormat ), RTL_TEXTENCODING_UTF8 );
+ bRet = ( DlgExportPix( aFltCallDlgPara ).Execute() == RET_OK );
+ }
+
+
+ delete pResMgr;
+ }
+ // ladbare Filter
+ else
+ {
+ // eigene Filter
+ if( aFilterVendor.CompareToAscii( "SD", 2 ) == COMPARE_EQUAL )
+ {
+ INetURLObject aFilterFilePath;
+ BOOL bFound = FALSE;
+
+ pConfig->SetGroup( IMPEXP_FILTERPATHES );
+ ImpCorrectFilterUpdateNumber( aFilterName );
+
+ // find first filter in filter pathes
+ for( USHORT i = 0, nPathCount = pConfig->GetKeyCount(); i < nPathCount; i++ )
+ {
+ aFilterFilePath.SetSmartURL( UniString( pConfig->ReadKey( i ), RTL_TEXTENCODING_UTF8 ) );
+ aFilterFilePath.Append( aFilterName );
+
+ if( ImplDirEntryHelper::Exists( aFilterFilePath ) )
+ {
+ bFound = TRUE;
+ break;
+ }
+ }
+
+ if( bFound )
+ {
+ ::vos::OModule aLibrary( aFilterFilePath.PathToFileName() );
+ PFilterDlgCall pFunc = (PFilterDlgCall) aLibrary.getSymbol( UniString( EXPDLG_FUNCTION_NAME, RTL_TEXTENCODING_UTF8 ) );
+
+ // Dialog in DLL ausfuehren
+ if( pFunc )
+ {
+ FltCallDialogParameter aFltCallDlgPara( pWindow, NULL, GetOptionsConfig(), eFieldUnit );
+ bRet = (*pFunc)( aFltCallDlgPara );
+ }
+ }
+ }
+ }
+
+ if( bRet && GetOptionsConfig() )
+ GetOptionsConfig()->Flush();
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+
+const FilterErrorEx& GraphicFilter::GetLastError() const
+{
+ return *pErrorEx;
+}
+
+// ------------------------------------------------------------------------
+
+void GraphicFilter::ResetLastError()
+{
+ pErrorEx->nFilterError = pErrorEx->nStreamError = 0UL;
+}
+
+// ------------------------------------------------------------------------
+
+IMPL_LINK( GraphicFilter, FilterCallback, ConvertData*, pData )
+{
+ long nRet = 0L;
+
+ if( pData )
+ {
+ USHORT nFormat = GRFILTER_FORMAT_DONTKNOW;
+ ByteString aShortName;
+ const BOOL bOptions = AreOptionsEnabled();
+
+ EnableOptions( FALSE );
+
+ switch( pData->mnFormat )
+ {
+ case( CVT_BMP ): aShortName = BMP_SHORTNAME; break;
+ case( CVT_GIF ): aShortName = GIF_SHORTNAME; break;
+ case( CVT_JPG ): aShortName = JPG_SHORTNAME; break;
+ case( CVT_MET ): aShortName = MET_SHORTNAME; break;
+ case( CVT_PCT ): aShortName = PCT_SHORTNAME; break;
+ case( CVT_PNG ): aShortName = PNG_SHORTNAME; break;
+ case( CVT_SVM ): aShortName = SVM_SHORTNAME; break;
+ case( CVT_TIF ): aShortName = TIF_SHORTNAME; break;
+ case( CVT_WMF ): aShortName = WMF_SHORTNAME; break;
+ case( CVT_EMF ): aShortName = EMF_SHORTNAME; break;
+
+ default:
+ break;
+ }
+
+ if( GRAPHIC_NONE == pData->maGraphic.GetType() || pData->maGraphic.GetContext() ) // Import
+ {
+ if( aShortName.Len() )
+ {
+ for( USHORT i = 0, nCount = GetImportFormatCount(); i < nCount; i++ )
+ {
+ ByteString aImpShortName( GetImportFormatShortName( i ), RTL_TEXTENCODING_UTF8 );
+ aImpShortName.ToUpperAscii();
+ if( aImpShortName.CompareTo( aShortName ) == COMPARE_EQUAL )
+ {
+ nFormat = i;
+ break;
+ }
+ }
+ }
+
+ nRet = ( ImportGraphic( pData->maGraphic, String(), pData->mrStm, nFormat ) == GRFILTER_OK );
+ }
+ else if( aShortName.Len() ) // Export
+ {
+ for( USHORT i = 0, nCount = GetExportFormatCount(); i < nCount; i++ )
+ {
+ ByteString aExpShortName( GetExportFormatShortName( i ), RTL_TEXTENCODING_UTF8 );
+ aExpShortName.ToUpperAscii();
+ if( aExpShortName.CompareTo( aShortName ) == COMPARE_EQUAL )
+ {
+ nFormat = i;
+ break;
+ }
+ }
+
+ if( nFormat )
+ nRet = ( ExportGraphic( pData->maGraphic, String(), pData->mrStm, nFormat ) == GRFILTER_OK );
+ }
+
+ EnableOptions( bOptions );
+ }
+
+ return nRet;
+}
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx
new file mode 100644
index 000000000000..01dd188534d7
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/filter2.cxx
@@ -0,0 +1,1427 @@
+/*************************************************************************
+ *
+ * $RCSfile: filter2.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string.h>
+#include <stdio.h>
+#include <tools/stream.hxx>
+#include <tools/debug.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/config.hxx>
+#include "filter.hxx"
+
+#define DATA_SIZE 640
+#define IMP_FILTERSECTION "Graphics Filters - Import"
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+GraphicDescriptor::GraphicDescriptor( const String* pPath )
+{
+ ImpConstruct();
+
+ if ( pPath )
+ {
+ INetURLObject aURL( *pPath, INET_PROT_FILE );
+ aPathExt = aURL.GetFileExtension().ToLowerAscii();
+ }
+
+ bLinked = TRUE;
+ bLinkChanged = FALSE;
+ bWideSearch = FALSE;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+GraphicDescriptor::GraphicDescriptor( const INetURLObject& rPath ) :
+ aFileStm( rPath.PathToFileName(), STREAM_READ ),
+ aPathExt( rPath.GetFileExtension().ToLowerAscii() )
+{
+ ImpConstruct();
+
+ if ( aFileStm.IsOpen() && !aFileStm.GetError() )
+ {
+ nStmPos = 0;
+ aFileStm.Seek( nStmPos );
+ bDataReady = TRUE;
+ }
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+GraphicDescriptor::GraphicDescriptor( SvStream& rInStream, const String* pPath)
+{
+ ImpConstruct();
+
+ if ( pPath )
+ {
+ INetURLObject aURL( *pPath, INET_PROT_FILE );
+// aURL.SetSmartURL( *pPath );
+ aPathExt = aURL.GetFileExtension().ToLowerAscii();
+ }
+
+ nStmPos = rInStream.Tell();
+ pBaseStm = &rInStream;
+ bBaseStm = TRUE;
+
+ if ( !pBaseStm->GetError() )
+ bDataReady = TRUE;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+GraphicDescriptor::~GraphicDescriptor()
+{
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::Detect( BOOL bExtendedInfo )
+{
+ BOOL bRet = FALSE;
+
+ // Link-Status ueberpruefen
+ if ( bLinked && bLinkChanged )
+ {
+ DBG_ASSERT( aReqLink.IsSet(), "Wo ist der RequestHandler???" );
+ if ( pMemStm = (SvStream*) aReqLink.Call( this ) )
+ {
+ nStmPos = pMemStm->Tell();
+ bDataReady = TRUE;
+ }
+ }
+
+ if ( bDataReady )
+ {
+ SvStream& rStm = GetSearchStream();
+ UINT16 nOldFormat = rStm.GetNumberFormatInt();
+
+ if ( ImpDetectGIF( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectJPG( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectBMP( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectPNG( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectTIF( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectPCX( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectDXF( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectMET( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectSGF( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectSGV( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectSVM( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectWMF( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectEMF( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectPCT( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectXBM( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectXPM( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectPBM( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectPGM( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectPPM( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectRAS( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectTGA( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectPSD( rStm, bExtendedInfo ) ) bRet = TRUE;
+ else if ( ImpDetectEPS( rStm, bExtendedInfo ) ) bRet = TRUE;
+
+ // diese Formate lassen sich nur bei WideSearch im gesamten
+ // Stream ermitteln
+ else if ( bWideSearch )
+ {
+ if ( ImpDetectPCD( rStm, bExtendedInfo ) )
+ bRet = TRUE;
+ }
+
+ rStm.SetNumberFormatInt( nOldFormat );
+ rStm.Seek( nStmPos );
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::IsDataReady() const
+{
+ return bDataReady;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::IsWideSearch() const
+{
+ return bWideSearch;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+SvStream& GraphicDescriptor::GetSearchStream() const
+{
+ DBG_ASSERT( bDataReady, "Was laeuft hier falsch???" );
+
+ if ( bLinked )
+ return *pMemStm;
+ else if ( bBaseStm )
+ return *pBaseStm;
+ else
+ return (SvStream&) aFileStm;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+void GraphicDescriptor::SetRequestHdl( const Link& rRequestLink )
+{
+ aReqLink = rRequestLink;
+ bLinkChanged = TRUE;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+ULONG GraphicDescriptor::GetRequestedByteCount() const
+{
+ return DATA_SIZE;
+}
+
+
+/******************************************************************************/
+/* IMP-Methoden */
+/* */
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+void GraphicDescriptor::ImpConstruct()
+{
+ nFormat = GFF_NOT;
+ nBitsPerPixel = 0;
+ nPlanes = 0;
+ bCompressed = FALSE;
+ bDataReady = FALSE;
+ bLinked = FALSE;
+ bWideSearch = TRUE;
+ bBaseStm = FALSE;
+ pMemStm = NULL;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectBMP( SvStream& rStm, BOOL bExtendedInfo )
+{
+ UINT16 nTemp16;
+ BOOL bRet = FALSE;
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ rStm.Seek( nStmPos );
+
+ rStm >> nTemp16;
+
+ // OS/2-BitmapArray
+ if ( nTemp16 == 0x4142 )
+ {
+ rStm.SeekRel( 0x0c );
+ rStm >> nTemp16;
+ }
+
+ // Bitmap
+ if ( nTemp16 == 0x4d42 )
+ {
+ nFormat = GFF_BMP;
+ bRet = TRUE;
+
+ if ( bExtendedInfo )
+ {
+ UINT32 nTemp32;
+ UINT32 nCompression;
+
+ // bis zur ersten Information
+ rStm.SeekRel( 0x10 );
+
+ // PixelBreite auslesen
+ rStm >> nTemp32;
+ aPixSize.Width() = nTemp32;
+
+ // PixelHoehe auslesen
+ rStm >> nTemp32;
+ aPixSize.Height() = nTemp32;
+
+ // Planes auslesen
+ rStm >> nTemp16;
+ nPlanes = nTemp16;
+
+ // BitCount auslesen
+ rStm >> nTemp16;
+ nBitsPerPixel = nTemp16;
+
+ // Compression auslesen
+ rStm >> nTemp32;
+ bCompressed = ( ( nCompression = nTemp32 ) > 0 );
+
+ // logische Breite
+ rStm.SeekRel( 4 );
+ rStm >> nTemp32;
+ if ( nTemp32 )
+ aLogSize.Width() = ( aPixSize.Width() * 100000 ) / nTemp32;
+
+ // logische Hoehe
+ rStm >> nTemp32;
+ if ( nTemp32 )
+ aLogSize.Height() = ( aPixSize.Height() * 100000 ) / nTemp32;
+
+ // Wir wollen noch etwas feiner differenzieren und
+ // auf sinnvolle Werte ueberpruefen ( Bug-Id #29001 )
+ if ( ( nBitsPerPixel > 24 ) || ( nCompression > 3 ) )
+ {
+ nFormat = GFF_NOT;
+ bRet = FALSE;
+ }
+ }
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectGIF( SvStream& rStm, BOOL bExtendedInfo )
+{
+ UINT32 nTemp32;
+ UINT16 nTemp16;
+ BOOL bRet = FALSE;
+ BYTE cByte;
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ rStm.Seek( nStmPos );
+
+ rStm >> nTemp32;
+ if ( nTemp32 == 0x38464947 )
+ {
+ rStm >> nTemp16;
+ if ( ( nTemp16 == 0x6137 ) || ( nTemp16 == 0x6139 ) )
+ {
+ nFormat = GFF_GIF;
+ bRet = TRUE;
+
+ if ( bExtendedInfo )
+ {
+ UINT16 nTemp16;
+
+ // PixelBreite auslesen
+ rStm >> nTemp16;
+ aPixSize.Width() = nTemp16;
+
+ // PixelHoehe auslesen
+ rStm >> nTemp16;
+ aPixSize.Height() = nTemp16;
+
+ // Bits/Pixel auslesen
+ rStm >> cByte;
+ nBitsPerPixel = ( ( cByte & 112 ) >> 4 ) + 1;
+ }
+ }
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
+{
+ UINT32 nTemp32;
+ BOOL bRet = FALSE;
+ BYTE cByte;
+ BOOL bM_COM;
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
+ rStm.Seek( nStmPos );
+
+ rStm >> nTemp32;
+
+ // compare upper 28 bits
+ if( 0xffd8ff00 == ( nTemp32 & 0xffffff00 ) )
+ {
+ nFormat = GFF_JPG;
+ return TRUE;
+ }
+
+ bM_COM = ( nTemp32 == 0xffd8fffe );
+ if ( ( nTemp32 == 0xffd8ffe0 ) || bM_COM )
+ {
+ if( !bM_COM )
+ {
+ rStm.SeekRel( 2 );
+ rStm >> nTemp32;
+ }
+
+ if( bM_COM || ( nTemp32 == 0x4a464946 ) )
+ {
+ nFormat = GFF_JPG;
+ bRet = TRUE;
+
+ if( bExtendedInfo )
+ {
+ MapMode aMap;
+ UINT16 nTemp16;
+ ULONG nCount = 9;
+ ULONG nMax;
+ ULONG nResX;
+ ULONG nResY;
+ BYTE cUnit;
+
+ // Groesse des verbleibenden Puffers ermitteln
+ if ( bLinked )
+ nMax = ( (SvMemoryStream&) rStm ).GetSize() - 16;
+ else
+ nMax = DATA_SIZE - 16;
+
+ // max. 8K
+ nMax = Min( nMax, (ULONG) 8192 );
+
+ // Res-Unit ermitteln
+ rStm.SeekRel( 3 );
+ rStm >> cUnit;
+
+ // ResX ermitteln
+ rStm >> nTemp16;
+ nResX = nTemp16;
+
+ // ResY ermitteln
+ rStm >> nTemp16;
+ nResY = nTemp16;
+
+ // SOF0/1-Marker finden, aber dabei
+ // nicht mehr als DATA_SIZE Pixel lesen, falls
+ // kein WideSearch
+ do
+ {
+ while ( ( cByte != 0xff ) &&
+ ( bWideSearch || ( nCount++ < nMax ) ) )
+ {
+ rStm >> cByte;
+ }
+
+ while ( ( cByte == 0xff ) &&
+ ( bWideSearch || ( nCount++ < nMax ) ) )
+ {
+ rStm >> cByte;
+ }
+ }
+ while ( ( cByte != 0xc0 ) &&
+ ( cByte != 0xc1 ) &&
+ ( bWideSearch || ( nCount < nMax ) ) );
+
+ // wir haben den SOF0/1-Marker
+ if ( ( cByte == 0xc0 ) || ( cByte == 0xc1 ) )
+ {
+ // Hoehe einlesen
+ rStm.SeekRel( 3 );
+ rStm >> nTemp16;
+ aPixSize.Height() = nTemp16;
+
+ // Breite einlesen
+ rStm >> nTemp16;
+ aPixSize.Width() = nTemp16;
+
+ // Bit/Pixel einlesen
+ rStm >> cByte;
+ nBitsPerPixel = ( cByte == 3 ? 24 : cByte == 1 ? 8 : 0 );
+
+ // logische Groesse setzen
+ if ( cUnit && nResX && nResY )
+ {
+ aMap.SetMapUnit( cUnit == 1 ? MAP_INCH : MAP_CM );
+ aMap.SetScaleX( Fraction( 1, nResX ) );
+ aMap.SetScaleY( Fraction( 1, nResY ) );
+ aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap,
+ MapMode( MAP_100TH_MM ) );
+ }
+
+ // Planes immer 1
+ nPlanes = 1;
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectPCD( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet = FALSE;
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ rStm.Seek( nStmPos );
+
+ if ( bWideSearch )
+ {
+ UINT32 nTemp32;
+ UINT16 nTemp16;
+ BYTE cByte;
+
+ rStm.SeekRel( 2048 );
+ rStm >> nTemp32;
+ rStm >> nTemp16;
+ rStm >> cByte;
+
+ if ( ( nTemp32 == 0x5f444350 ) &&
+ ( nTemp16 == 0x5049 ) &&
+ ( cByte == 0x49 ) )
+ {
+ nFormat = GFF_PCD;
+ bRet = TRUE;
+ }
+ }
+ else if ( bRet = ( aPathExt.CompareToAscii( "pcd", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_PCD;
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectPCX( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet = FALSE;
+ BYTE cByte;
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ rStm.Seek( nStmPos );
+
+ rStm >> cByte;
+ if ( cByte == 0x0a )
+ {
+ nFormat = GFF_PCX;
+ bRet = TRUE;
+
+ if ( bExtendedInfo )
+ {
+ UINT16 nTemp16;
+ USHORT nXmin;
+ USHORT nXmax;
+ USHORT nYmin;
+ USHORT nYmax;
+ USHORT nDPIx;
+ USHORT nDPIy;
+
+
+ rStm.SeekRel( 1 );
+
+ // Kompression lesen
+ rStm >> cByte;
+ bCompressed = ( cByte > 0 );
+
+ // Bits/Pixel lesen
+ rStm >> cByte;
+ nBitsPerPixel = cByte;
+
+ // Bildabmessungen
+ rStm >> nTemp16;
+ nXmin = nTemp16;
+ rStm >> nTemp16;
+ nYmin = nTemp16;
+ rStm >> nTemp16;
+ nXmax = nTemp16;
+ rStm >> nTemp16;
+ nYmax = nTemp16;
+
+ aPixSize.Width() = nXmax - nXmin + 1;
+ aPixSize.Height() = nYmax - nYmin + 1;
+
+ // Aufloesung
+ rStm >> nTemp16;
+ nDPIx = nTemp16;
+ rStm >> nTemp16;
+ nDPIy = nTemp16;
+
+ // logische Groesse setzen
+ MapMode aMap( MAP_INCH, Point(),
+ Fraction( 1, nDPIx ), Fraction( 1, nDPIy ) );
+ aLogSize = OutputDevice::LogicToLogic( aPixSize, aMap,
+ MapMode( MAP_100TH_MM ) );
+
+
+ // Anzahl Farbebenen
+ rStm.SeekRel( 49 );
+ rStm >> cByte;
+ nPlanes = cByte;
+ }
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectPNG( SvStream& rStm, BOOL bExtendedInfo )
+{
+ UINT32 nTemp32;
+ BOOL bRet = FALSE;
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
+ rStm.Seek( nStmPos );
+
+ rStm >> nTemp32;
+ if ( nTemp32 == 0x89504e47 )
+ {
+ rStm >> nTemp32;
+ if ( nTemp32 == 0x0d0a1a0a )
+ {
+ nFormat = GFF_PNG;
+ bRet = TRUE;
+
+ if ( bExtendedInfo )
+ {
+ BYTE cByte;
+
+ // IHDR-Chunk
+ rStm.SeekRel( 8 );
+
+ // Breite einlesen
+ rStm >> nTemp32;
+ aPixSize.Width() = nTemp32;
+
+ // Hoehe einlesen
+ rStm >> nTemp32;
+ aPixSize.Height() = nTemp32;
+
+ // Bits/Pixel einlesen
+ rStm >> cByte;
+ nBitsPerPixel = cByte;
+
+ // Planes immer 1;
+ // Kompression immer
+ nPlanes = 1;
+ bCompressed = TRUE;
+
+ if ( bWideSearch )
+ {
+ BOOL bOk = FALSE;
+ UINT32 nLen32;
+
+ rStm.SeekRel( 8 );
+
+ // so lange ueberlesen, bis wir den pHYs-Chunk haben oder
+ // den Anfang der Bilddaten
+ rStm >> nLen32;
+ rStm >> nTemp32;
+ while( ( nTemp32 != 0x70485973 ) && ( nTemp32 != 0x49444154 ) )
+ {
+ rStm.SeekRel( 4 + nLen32 );
+ rStm >> nLen32;
+ rStm >> nTemp32;
+ }
+
+ if ( nTemp32 == 0x70485973 )
+ {
+ ULONG nXRes;
+ ULONG nYRes;
+
+ // horizontale Aufloesung
+ rStm >> nTemp32;
+ nXRes = nTemp32;
+
+ // vertikale Aufloesung
+ rStm >> nTemp32;
+ nYRes = nTemp32;
+
+ // Unit einlesen
+ rStm >> cByte;
+
+ if ( cByte )
+ {
+ if ( nXRes )
+ aLogSize.Width() = ( aPixSize.Width() * 100000 ) /
+ nTemp32;
+
+ if ( nYRes )
+ aLogSize.Height() = ( aPixSize.Height() * 100000 ) /
+ nTemp32;
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectTIF( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bOk = FALSE;
+ BOOL bRet = FALSE;
+ BYTE cByte1;
+ BYTE cByte2;
+
+ rStm.Seek( nStmPos );
+ rStm >> cByte1;
+ rStm >> cByte2;
+ if ( cByte1 == cByte2 )
+ {
+ if ( cByte1 == 0x49 )
+ {
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ bOk = TRUE;
+ }
+ else if ( cByte1 == 0x4d )
+ {
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
+ bOk = TRUE;
+ }
+
+ if ( bOk )
+ {
+ UINT16 nTemp16;
+
+ rStm >> nTemp16;
+ if ( nTemp16 == 0x2a )
+ {
+ nFormat = GFF_TIF;
+ bRet = TRUE;
+
+ if ( bExtendedInfo )
+ {
+ ULONG nCount;
+ ULONG nMax = DATA_SIZE - 48;
+ UINT32 nTemp32;
+ BOOL bOk;
+
+ // Offset des ersten IFD einlesen
+ rStm >> nTemp32;
+ rStm.SeekRel( ( nCount = ( nTemp32 + 2 ) ) - 0x08 );
+
+ if ( bWideSearch || ( nCount < nMax ) )
+ {
+ // Tag's lesen, bis wir auf Tag256 ( Width ) treffen
+ // nicht mehr Bytes als DATA_SIZE lesen
+ rStm >> nTemp16;
+ while ( ( nTemp16 != 256 ) && ( bOk = ( bWideSearch || ( nCount < nMax ) ) ) )
+ {
+ rStm.SeekRel( 10 );
+ rStm >> nTemp16;
+ nCount += 12;
+ }
+
+ if ( bOk )
+ {
+ // Breite lesen
+ rStm >> nTemp16;
+ rStm.SeekRel( 4 );
+ if ( nTemp16 == 3 )
+ {
+ rStm >> nTemp16;
+ aPixSize.Width() = nTemp16;
+ rStm.SeekRel( 2 );
+ }
+ else
+ {
+ rStm >> nTemp32;
+ aPixSize.Width() = nTemp32;
+ }
+ nCount += 12;
+
+ // Hoehe lesen
+ rStm.SeekRel( 2 );
+ rStm >> nTemp16;
+ rStm.SeekRel( 4 );
+ if ( nTemp16 == 3 )
+ {
+ rStm >> nTemp16;
+ aPixSize.Height() = nTemp16;
+ rStm.SeekRel( 2 );
+ }
+ else
+ {
+ rStm >> nTemp32;
+ aPixSize.Height() = nTemp32;
+ }
+ nCount += 12;
+
+ // ggf. Bits/Pixel lesen
+ rStm >> nTemp16;
+ if ( nTemp16 == 258 )
+ {
+ rStm.SeekRel( 6 );
+ rStm >> nTemp16;
+ nBitsPerPixel = nTemp16;
+ rStm.SeekRel( 2 );
+ nCount += 12;
+ }
+ else
+ rStm.SeekRel( -2 );
+
+ // ggf. Compression lesen
+ rStm >> nTemp16;
+ if ( nTemp16 == 259 )
+ {
+ rStm.SeekRel( 6 );
+ rStm >> nTemp16;
+ bCompressed = ( nTemp16 > 1 );
+ rStm.SeekRel( 2 );
+ nCount += 12;
+ }
+ else
+ rStm.SeekRel( -2 );
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectXBM( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "xbm", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_XBM;
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectXPM( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "xpm", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_XPM;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectPBM( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet = FALSE;
+
+ // erst auf Datei Extension pruefen, da diese aussagekraeftiger ist
+ // als die 2 ID Bytes
+
+ if ( aPathExt.CompareToAscii( "pbm", 3 ) == COMPARE_EQUAL )
+ bRet = TRUE;
+ else
+ {
+ BYTE nFirst, nSecond;
+ rStm.Seek( nStmPos );
+ rStm >> nFirst >> nSecond;
+ if ( nFirst == 'P' && ( ( nSecond == '1' ) || ( nSecond == '4' ) ) )
+ bRet = TRUE;
+ }
+
+ if ( bRet )
+ nFormat = GFF_PBM;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectPGM( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet = FALSE;
+
+ if ( aPathExt.CompareToAscii( "pgm", 3 ) == COMPARE_EQUAL )
+ bRet = TRUE;
+ else
+ {
+ BYTE nFirst, nSecond;
+ rStm.Seek( nStmPos );
+ rStm >> nFirst >> nSecond;
+ if ( nFirst == 'P' && ( ( nSecond == '2' ) || ( nSecond == '5' ) ) )
+ bRet = TRUE;
+ }
+
+ if ( bRet )
+ nFormat = GFF_PGM;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectPPM( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet = FALSE;
+
+ if ( aPathExt.CompareToAscii( "ppm", 3 ) == COMPARE_EQUAL )
+ bRet = TRUE;
+ else
+ {
+ BYTE nFirst, nSecond;
+ rStm.Seek( nStmPos );
+ rStm >> nFirst >> nSecond;
+ if ( nFirst == 'P' && ( ( nSecond == '3' ) || ( nSecond == '6' ) ) )
+ bRet = TRUE;
+ }
+
+ if ( bRet )
+ nFormat = GFF_PPM;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectRAS( SvStream& rStm, BOOL bExtendedInfo )
+{
+ UINT32 nMagicNumber;
+ rStm.Seek( nStmPos );
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
+ rStm >> nMagicNumber;
+ if ( nMagicNumber == 0x59a66a95 )
+ {
+ nFormat = GFF_RAS;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectTGA( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "tga", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_TGA;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectPSD( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet = FALSE;
+
+ UINT32 nMagicNumber;
+ rStm.Seek( nStmPos );
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
+ rStm >> nMagicNumber;
+ if ( nMagicNumber == 0x38425053 )
+ {
+ UINT16 nVersion;
+ rStm >> nVersion;
+ if ( nVersion == 1 )
+ {
+ bRet = TRUE;
+ if ( bExtendedInfo )
+ {
+ UINT16 nChannels;
+ UINT32 nRows;
+ UINT32 nColumns;
+ UINT16 nDepth;
+ UINT16 nMode;
+ rStm.SeekRel( 6 ); // Pad
+ rStm >> nChannels >> nRows >> nColumns >> nDepth >> nMode;
+ if ( ( nDepth == 1 ) || ( nDepth == 8 ) || ( nDepth == 16 ) )
+ {
+ nBitsPerPixel = ( nDepth == 16 ) ? 8 : nDepth;
+ switch ( nChannels )
+ {
+ case 4 :
+ case 3 :
+ nBitsPerPixel = 24;
+ case 2 :
+ case 1 :
+ aPixSize.Width() = nColumns;
+ aPixSize.Height() = nRows;
+ break;
+ default:
+ bRet = FALSE;
+ }
+ }
+ else
+ bRet = FALSE;
+ }
+ }
+ }
+
+ if ( bRet )
+ nFormat = GFF_PSD;
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectEPS( SvStream& rStm, BOOL bExtendedInfo )
+{
+ // es wird die EPS mit Vorschaubild Variante und die Extensionübereinstimmung
+ // geprüft
+
+ UINT32 nFirstLong;
+ rStm.Seek( nStmPos );
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_BIGENDIAN );
+ rStm >> nFirstLong;
+ if ( ( nFirstLong == 0xC5D0D3C6 ) || ( aPathExt.CompareToAscii( "eps", 3 ) == COMPARE_EQUAL ) )
+ {
+ nFormat = GFF_EPS;
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectDXF( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "dxf", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_DXF;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectMET( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "met", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_MET;
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectPCT( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "pct", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_PCT;
+ else
+ {
+ BYTE sBuf[4];
+
+ rStm.Seek( nStmPos + 522 );
+ rStm.Read( sBuf, 3 );
+
+ if( !rStm.GetError() )
+ {
+ if ( ( sBuf[0] == 0x00 ) && ( sBuf[1] == 0x11 ) &&
+ ( ( sBuf[2] == 0x01 ) || ( sBuf[2] == 0x02 ) ) )
+ {
+ bRet = TRUE;
+ nFormat = GFF_PCT;
+ }
+ }
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectSGF( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "sgf",3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_SGF;
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectSGV( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "sgv", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_SGV;
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectSVM( SvStream& rStm, BOOL bExtendedInfo )
+{
+ UINT32 nTemp32;
+ BOOL bRet = FALSE;
+ BYTE cByte;
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ rStm.Seek( nStmPos );
+
+ rStm >> nTemp32;
+ if ( nTemp32 == 0x44475653 )
+ {
+ rStm >> cByte;
+ if ( cByte == 0x49 )
+ {
+ nFormat = GFF_SVM;
+ bRet = TRUE;
+
+ if ( bExtendedInfo )
+ {
+ UINT32 nTemp32;
+ UINT16 nTemp16;
+
+ rStm.SeekRel( 0x04 );
+
+ // Breite auslesen
+ rStm >> nTemp32;
+ aLogSize.Width() = nTemp32;
+
+ // Hoehe auslesen
+ rStm >> nTemp32;
+ aLogSize.Height() = nTemp32;
+
+ // Map-Unit auslesen und PrefSize ermitteln
+ rStm >> nTemp16;
+ aLogSize = OutputDevice::LogicToLogic( aLogSize,
+ MapMode( (MapUnit) nTemp16 ),
+ MapMode( MAP_100TH_MM ) );
+ }
+ }
+ }
+ else
+ {
+ // StringLen-Feld ueberlesen
+ rStm.SeekRel( -2L );
+ rStm >> nTemp32;
+
+ if( nTemp32 == 0x4D4C4356 )
+ {
+ UINT16 nTmp16;
+
+ rStm >> nTmp16;
+
+ if( nTmp16 == 0x4654 )
+ {
+ nFormat = GFF_SVM;
+ bRet = TRUE;
+
+ if( bExtendedInfo )
+ {
+ MapMode aMapMode;
+
+ rStm.SeekRel( 0x06 );
+ rStm >> aMapMode;
+ rStm >> aLogSize;
+ aLogSize = OutputDevice::LogicToLogic( aLogSize, aMapMode, MapMode( MAP_100TH_MM ) );
+ }
+ }
+ }
+ }
+
+ return bRet;
+}
+
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectWMF( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "wmf",3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_WMF;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+BOOL GraphicDescriptor::ImpDetectEMF( SvStream& rStm, BOOL bExtendedInfo )
+{
+ BOOL bRet;
+
+ if ( bRet = ( aPathExt.CompareToAscii( "emf", 3 ) == COMPARE_EQUAL ) )
+ nFormat = GFF_EMF;
+
+ return bRet;
+}
+
+/*************************************************************************
+|*
+|*
+|*
+\************************************************************************/
+
+USHORT GraphicDescriptor::GetImportFormatNumber( USHORT nFormat, Config& rConfig )
+{
+ ByteString aKeyName;
+ const ByteString aOldGroup( rConfig.GetGroup() );
+ USHORT nKeyNumber = GRFILTER_FORMAT_NOTFOUND;
+
+ rConfig.SetGroup( IMP_FILTERSECTION );
+
+ switch( nFormat )
+ {
+ case( GFF_BMP ) : aKeyName = "bmp"; break;
+ case( GFF_GIF ) : aKeyName = "gif"; break;
+ case( GFF_JPG ) : aKeyName = "jpg"; break;
+ case( GFF_PCD ) : aKeyName = "pcd"; break;
+ case( GFF_PCX ) : aKeyName = "pcx"; break;
+ case( GFF_PNG ) : aKeyName = "png"; break;
+ case( GFF_XBM ) : aKeyName = "xbm"; break;
+ case( GFF_XPM ) : aKeyName = "xpm"; break;
+ case( GFF_PBM ) : aKeyName = "pbm"; break;
+ case( GFF_PGM ) : aKeyName = "pgm"; break;
+ case( GFF_PPM ) : aKeyName = "ppm"; break;
+ case( GFF_RAS ) : aKeyName = "ras"; break;
+ case( GFF_TGA ) : aKeyName = "tga"; break;
+ case( GFF_PSD ) : aKeyName = "psd"; break;
+ case( GFF_EPS ) : aKeyName = "eps"; break;
+ case( GFF_TIF ) : aKeyName = "tif"; break;
+ case( GFF_DXF ) : aKeyName = "dxf"; break;
+ case( GFF_MET ) : aKeyName = "met"; break;
+ case( GFF_PCT ) : aKeyName = "pct"; break;
+ case( GFF_SGF ) : aKeyName = "sgf"; break;
+ case( GFF_SGV ) : aKeyName = "sgv"; break;
+ case( GFF_SVM ) : aKeyName = "svm"; break;
+ case( GFF_WMF ) : aKeyName = "wmf"; break;
+ case( GFF_EMF ) : aKeyName = "emf"; break;
+ }
+
+ if( aKeyName.Len() )
+ {
+ for( USHORT i = 0, nCount = rConfig.GetKeyCount(); i < nCount; i++ )
+ {
+ if( rConfig.GetKeyName( i ).CompareIgnoreCaseToAscii( aKeyName ) == COMPARE_EQUAL )
+ {
+ nKeyNumber = i;
+ break;
+ }
+ }
+ }
+
+ rConfig.SetGroup( aOldGroup );
+
+ return nKeyNumber;
+}
diff --git a/svtools/source/filter.vcl/filter/fldll.cxx b/svtools/source/filter.vcl/filter/fldll.cxx
new file mode 100644
index 000000000000..ea9b47083c31
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/fldll.cxx
@@ -0,0 +1,110 @@
+/*************************************************************************
+ *
+ * $RCSfile: fldll.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef WIN
+
+#ifndef _SVWIN_H
+#include <svwin.h>
+#endif
+
+// Statische DLL-Verwaltungs-Variablen
+static HINSTANCE hDLLInst = 0; // HANDLE der DLL
+
+
+/***************************************************************************
+|*
+|* LibMain()
+|*
+|* Beschreibung Initialisierungsfunktion der DLL
+|* Ersterstellung TH 05.05.93
+|* Letzte Aenderung TH 05.05.93
+|*
+***************************************************************************/
+
+extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
+{
+#ifndef WNT
+ if ( nHeap )
+ UnlockData( 0 );
+#endif
+
+ hDLLInst = hDLL;
+
+ return TRUE;
+}
+
+/***************************************************************************
+|*
+|* WEP()
+|*
+|* Beschreibung DLL-Deinitialisierung
+|* Ersterstellung TH 05.05.93
+|* Letzte Aenderung TH 05.05.93
+|*
+***************************************************************************/
+
+extern "C" int CALLBACK WEP( int )
+{
+ return 1;
+}
+
+#endif
+
diff --git a/svtools/source/filter.vcl/filter/gradwrap.cxx b/svtools/source/filter.vcl/filter/gradwrap.cxx
new file mode 100644
index 000000000000..d17c97e04074
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/gradwrap.cxx
@@ -0,0 +1,619 @@
+/*************************************************************************
+ *
+ * $RCSfile: gradwrap.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <math.h>
+#include <svgrad.hxx>
+#include <svbmpacc.hxx>
+#include <gradwrap.hxx>
+
+// -------------------
+// - GradientWrapper -
+// -------------------
+
+GradientWrapper::GradientWrapper(const Link& rDrawPolyRecordHdl,
+ const Link& rDrawPolyPolyRecordHdl,
+ const Link& rSetFillInBrushRecordHdl) :
+ aDrawPolyRecordHdl (rDrawPolyRecordHdl),
+ aDrawPolyPolyRecordHdl (rDrawPolyPolyRecordHdl),
+ aSetFillInBrushRecordHdl(rSetFillInBrushRecordHdl)
+{
+}
+
+// ------------------------------------------------------------------------
+
+GradientWrapper::~GradientWrapper()
+{
+}
+
+// ------------------------------------------------------------------------
+
+void GradientWrapper::WriteLinearGradient(const Rectangle& rRect,
+ const Gradient& rGradient)
+{
+ USHORT nStepCount = 100;
+
+ Rectangle aRect = rRect;
+ aRect.Left()--;
+ aRect.Top()--;
+ aRect.Right()++;
+ aRect.Bottom()++;
+
+ // rotiertes BoundRect ausrechnen
+ double fAngle = (rGradient.GetAngle() % 3600) * F_PI1800;
+ double fWidth = aRect.GetWidth();
+ double fHeight = aRect.GetHeight();
+ double fDX = fWidth * fabs( cos( fAngle ) ) +
+ fHeight * fabs( sin( fAngle ) );
+ double fDY = fHeight * fabs( cos( fAngle ) ) +
+ fWidth * fabs( sin( fAngle ) );
+ fDX = (fDX - fWidth) * 0.5 + 0.5;
+ fDY = (fDY - fHeight) * 0.5 + 0.5;
+ aRect.Left() -= (long)fDX;
+ aRect.Right() += (long)fDX;
+ aRect.Top() -= (long)fDY;
+ aRect.Bottom() += (long)fDY;
+
+ // Rand berechnen und Rechteck neu setzen
+ Point aCenter = rRect.Center();
+ Rectangle aFullRect = aRect;
+ long nBorder = (long)rGradient.GetBorder() * aRect.GetHeight() / 100;
+ BOOL bLinear;
+
+ // Rand berechnen und Rechteck neu setzen fuer linearen Farbverlauf
+ if ( rGradient.GetStyle() == GRADIENT_LINEAR )
+ {
+ bLinear = TRUE;
+ aRect.Top() += nBorder;
+ }
+ // Rand berechnen und Rechteck neu setzen fuer axiale Farbverlauf
+ else
+ {
+ bLinear = FALSE;
+ nBorder >>= 1;
+
+ aRect.Top() += nBorder;
+ aRect.Bottom() -= nBorder;
+ }
+
+ // Top darf nicht groesser als Bottom sein
+ aRect.Top() = Min( aRect.Top(), (long)(aRect.Bottom() - 1) );
+
+ long nMinRect = aRect.GetHeight();
+
+ // Anzahl der Schritte berechnen, falls nichts uebergeben wurde
+ if ( !nStepCount )
+ {
+ long nInc = ((nMinRect >> 9) + 1) << 3;
+
+ if ( !nInc )
+ nInc = 1;
+
+ nStepCount = (USHORT)(nMinRect / nInc);
+ }
+ // minimal drei Schritte
+ long nSteps = Max( nStepCount, (USHORT)3 );
+
+ // Falls axialer Farbverlauf, muss die Schrittanzahl ungerade sein
+ if ( !bLinear && !(nSteps & 1) )
+ nSteps++;
+
+ // Berechnung ueber Double-Addition wegen Genauigkeit
+ double fScanLine = aRect.Top();
+ double fScanInc = (double)aRect.GetHeight() / (double)nSteps;
+
+ // Intensitaeten von Start- und Endfarbe ggf. aendern und
+ // Farbschrittweiten berechnen
+ long nFactor;
+ const Color& rStartCol = rGradient.GetStartColor();
+ const Color& rEndCol = rGradient.GetEndColor();
+ long nRed = rStartCol.GetRed();
+ long nGreen = rStartCol.GetGreen();
+ long nBlue = rStartCol.GetBlue();
+ long nEndRed = rEndCol.GetRed();
+ long nEndGreen = rEndCol.GetGreen();
+ long nEndBlue = rEndCol.GetBlue();
+ nFactor = rGradient.GetStartIntensity();
+ nRed = (nRed * nFactor) / 100;
+ nGreen = (nGreen * nFactor) / 100;
+ nBlue = (nBlue * nFactor) / 100;
+ nFactor = rGradient.GetEndIntensity();
+ nEndRed = (nEndRed * nFactor) / 100;
+ nEndGreen = (nEndGreen * nFactor) / 100;
+ nEndBlue = (nEndBlue * nFactor) / 100;
+ long nStepRed = (nEndRed - nRed) / nSteps;
+ long nStepGreen = (nEndGreen - nGreen) / nSteps;
+ long nStepBlue = (nEndBlue - nBlue) / nSteps;
+ long nSteps2;
+
+ if ( bLinear )
+ {
+ // Um 1 erhoeht, um die Border innerhalb der Schleife
+ // zeichnen zu koennen
+ nSteps2 = nSteps + 1;
+ }
+ else
+ {
+ nStepRed <<= 1;
+ nStepGreen <<= 1;
+ nStepBlue <<= 1;
+ nRed = nEndRed;
+ nGreen = nEndGreen;
+ nBlue = nEndBlue;
+
+ // Um 2 erhoeht, um die Border innerhalb der Schleife
+ // zeichnen zu koennen
+ nSteps2 = nSteps + 2;
+ }
+ Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue );
+
+ // GDI-Objekte sichern und setzen
+ Brush aBrush( aCol );
+ aSetFillInBrushRecordHdl.Call(&aBrush);
+
+ // Startpolygon erzeugen (== Borderpolygon)
+ Polygon aPoly( 4 );
+ Polygon aTempPoly( 2 );
+ aPoly[0] = aFullRect.TopLeft();
+ aPoly[1] = aFullRect.TopRight();
+ aPoly[2] = aRect.TopRight();
+ aPoly[3] = aRect.TopLeft();
+ aPoly.Rotate( aCenter, rGradient.GetAngle() );
+
+ // Schleife, um rotierten Verlauf zu fuellen
+ for ( long i = 0; i < nSteps2; i++ )
+ {
+ Polygon aTempPoly = aPoly;
+ aTempPoly.Clip( rRect );
+ aDrawPolyRecordHdl.Call(&aTempPoly);
+ aTempPoly.SetSize( 2 );
+
+ // neues Polygon berechnen
+ aRect.Top() = (long)(fScanLine += fScanInc);
+
+ // unteren Rand komplett fuellen
+ if ( i == nSteps )
+ {
+ aTempPoly[0] = aFullRect.BottomLeft();
+ aTempPoly[1] = aFullRect.BottomRight();
+ }
+ else
+ {
+ aTempPoly[0] = aRect.TopLeft();
+ aTempPoly[1] = aRect.TopRight();
+ }
+ aTempPoly.Rotate( aCenter, rGradient.GetAngle() );
+
+ aPoly[0] = aPoly[3];
+ aPoly[1] = aPoly[2];
+ aPoly[2] = aTempPoly[1];
+ aPoly[3] = aTempPoly[0];
+
+ // Farbintensitaeten aendern...
+ // fuer lineare FV
+ if ( bLinear )
+ {
+ nRed += nStepRed;
+ nGreen += nStepGreen;
+ nBlue += nStepBlue;
+ }
+ // fuer radiale FV
+ else
+ {
+ if ( i <= (nSteps >> 1) )
+ {
+ nRed -= nStepRed;
+ nGreen -= nStepGreen;
+ nBlue -= nStepBlue;
+ }
+ // genau die Mitte und hoeher
+ else
+ {
+ nRed += nStepRed;
+ nGreen += nStepGreen;
+ nBlue += nStepBlue;
+ }
+ }
+
+ nRed = MinMax( nRed, 0, 255 );
+ nGreen = MinMax( nGreen, 0, 255 );
+ nBlue = MinMax( nBlue, 0, 255 );
+
+ // fuer lineare FV ganz normale Bestimmung der Farbe
+ if ( bLinear || (i <= nSteps) )
+ {
+ aCol = Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue );
+ }
+ // fuer axiale FV muss die letzte Farbe der ersten
+ // Farbe entsprechen
+ else
+ {
+ aCol = Color( (BYTE) nEndRed, (BYTE) nEndGreen, (BYTE) nEndBlue );
+ }
+
+ aBrush.SetColor(aCol);
+ aSetFillInBrushRecordHdl.Call(&aBrush);
+ }
+}
+
+// ------------------------------------------------------------------------
+
+void GradientWrapper::WriteRadialGradient(const Rectangle& rRect,
+ const Gradient& rGradient)
+{
+ USHORT nStepCount = 100;
+ Rectangle aClipRect = rRect;
+ Rectangle aRect = rRect;
+ long nZWidth = aRect.GetWidth() * (long)rGradient.GetOfsX() / 100;
+ long nZHeight= aRect.GetHeight() * (long)rGradient.GetOfsY() / 100;
+ Size aSize = aRect.GetSize();
+ Point aCenter( aRect.Left() + nZWidth, aRect.Top() + nZHeight );
+
+ // Radien-Berechnung fuer Kreisausgabe (Kreis schliesst Rechteck ein)
+ if ( rGradient.GetStyle() == GRADIENT_RADIAL )
+ {
+ aSize.Width() = (long)(0.5 + sqrt((double)aSize.Width()*(double)aSize.Width() +
+ (double)aSize.Height()*(double)aSize.Height()));
+ aSize.Height() = aSize.Width();
+ }
+ // Radien-Berechnung fuer Ellipse
+ else
+ {
+ aSize.Width() = (long)(0.5 + (double)aSize.Width() * 1.4142);
+ aSize.Height() = (long)(0.5 + (double)aSize.Height() * 1.4142);
+ }
+
+ long nBorderX = (long)rGradient.GetBorder() * aSize.Width() / 100;
+ long nBorderY = (long)rGradient.GetBorder() * aSize.Height() / 100;
+ aSize.Width() -= nBorderX;
+ aSize.Height() -= nBorderY;
+ aRect.Left() = aCenter.X() - (aSize.Width() >> 1);
+ aRect.Top() = aCenter.Y() - (aSize.Height() >> 1);
+ aRect.SetSize( aSize );
+
+ long nMinRect = Min( aRect.GetWidth(), aRect.GetHeight() );
+
+ // Anzahl der Schritte berechnen, falls nichts uebergeben wurde
+ if ( !nStepCount )
+ {
+ long nInc = ((nMinRect >> 9) + 1) << 3;
+
+ if ( !nInc )
+ nInc = 1;
+
+ nStepCount = (USHORT)(nMinRect / nInc);
+ }
+ // minimal drei Schritte
+ long nSteps = Max( nStepCount, (USHORT)3 );
+
+ // Ausgabebegrenzungen und Schrittweite fuer jede Richtung festlegen
+ double fScanLeft = aRect.Left();
+ double fScanTop = aRect.Top();
+ double fScanRight = aRect.Right();
+ double fScanBottom = aRect.Bottom();
+ double fScanInc = (double)nMinRect / (double)nSteps * 0.5;
+
+ // Intensitaeten von Start- und Endfarbe ggf. aendern und
+ // Farbschrittweiten berechnen
+ long nFactor;
+ const Color& rStartCol = rGradient.GetStartColor();
+ const Color& rEndCol = rGradient.GetEndColor();
+ long nRed = rStartCol.GetRed();
+ long nGreen = rStartCol.GetGreen();
+ long nBlue = rStartCol.GetBlue();
+ long nEndRed = rEndCol.GetRed();
+ long nEndGreen = rEndCol.GetGreen();
+ long nEndBlue = rEndCol.GetBlue();
+ nFactor = rGradient.GetStartIntensity();
+ nRed = (nRed * nFactor) / 100;
+ nGreen = (nGreen * nFactor) / 100;
+ nBlue = (nBlue * nFactor) / 100;
+ nFactor = rGradient.GetEndIntensity();
+ nEndRed = (nEndRed * nFactor) / 100;
+ nEndGreen = (nEndGreen * nFactor) / 100;
+ nEndBlue = (nEndBlue * nFactor) / 100;
+ long nStepRed = (nEndRed - nRed) / nSteps;
+ long nStepGreen = (nEndGreen - nGreen) / nSteps;
+ long nStepBlue = (nEndBlue - nBlue) / nSteps;
+ Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue );
+
+ // GDI-Objekte sichern und setzen
+ Brush aBrush( aCol );
+ aSetFillInBrushRecordHdl.Call(&aBrush);
+
+ // Recteck erstmal ausgeben
+ PolyPolygon aPolyPoly( 2 );
+ Polygon aPoly( rRect );
+
+ aPolyPoly.Insert( aPoly );
+ aPoly = Polygon( aRect );
+ aPoly.Rotate( aCenter, rGradient.GetAngle() );
+ aPolyPoly.Insert( aPoly );
+
+ // erstes Polygon zeichnen (entspricht Rechteck)
+ PolyPolygon aTempPolyPoly = aPolyPoly;
+ aTempPolyPoly.Clip( aClipRect );
+ aDrawPolyPolyRecordHdl.Call(&aTempPolyPoly);
+
+ for ( long i = 0; i < nSteps; i++ )
+ {
+ Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue );
+ aBrush.SetColor( aCol );
+ aSetFillInBrushRecordHdl.Call(&aBrush);
+
+ // neues Polygon berechnen
+ aRect.Left() = (long)(fScanLeft += fScanInc);
+ aRect.Top() = (long)(fScanTop += fScanInc);
+ aRect.Right() = (long)(fScanRight -= fScanInc);
+ aRect.Bottom() = (long)(fScanBottom -= fScanInc);
+
+ if ( (aRect.GetWidth() < 2) || (aRect.GetHeight() < 2) )
+ break;
+
+ aPoly = Polygon( aRect.Center(),
+ aRect.GetWidth() >> 1, aRect.GetHeight() >> 1 );
+ aPoly.Rotate( aCenter, rGradient.GetAngle() );
+
+ aPolyPoly.Replace( aPolyPoly.GetObject( 1 ), 0 );
+ aPolyPoly.Replace( aPoly, 1 );
+
+ PolyPolygon aTempPolyPoly = aPolyPoly;
+ aTempPolyPoly.Clip( aClipRect );
+ aDrawPolyPolyRecordHdl.Call(&aTempPolyPoly);
+
+ // Farbe entsprechend anpassen
+ nRed += nStepRed;
+ nGreen += nStepGreen;
+ nBlue += nStepBlue;
+
+#ifndef VCL
+ nRed = MinMax( nRed, 0, 0xFFFF );
+ nGreen = MinMax( nGreen, 0, 0xFFFF );
+ nBlue = MinMax( nBlue, 0, 0xFFFF );
+#else
+ nRed = MinMax( nRed, 0, 0xFF );
+ nGreen = MinMax( nGreen, 0, 0xFF );
+ nBlue = MinMax( nBlue, 0, 0xFF );
+#endif
+ }
+
+ // Falls PolyPolygon-Ausgabe, muessen wir noch ein letztes
+ // inneres Polygon zeichnen
+ aBrush.SetColor( Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ) );
+ aSetFillInBrushRecordHdl.Call(&aBrush);
+
+ aPoly = aPolyPoly.GetObject( 1 );
+ if ( !aPoly.GetBoundRect().IsEmpty() )
+ {
+ aPoly.Clip( aClipRect );
+ aDrawPolyRecordHdl.Call(&aPoly);
+ }
+}
+
+// ------------------------------------------------------------------------
+
+void GradientWrapper::WriteRectGradient(const Rectangle& rRect,
+ const Gradient& rGradient)
+{
+ USHORT nStepCount = 100;
+ Rectangle aClipRect = rRect;
+ Rectangle aRect = rRect;
+
+ aRect.Left()--;
+ aRect.Top()--;
+ aRect.Right()++;
+ aRect.Bottom()++;
+
+ // rotiertes BoundRect ausrechnen
+ double fAngle = (rGradient.GetAngle() % 3600) * F_PI1800;
+ double fWidth = aRect.GetWidth();
+ double fHeight = aRect.GetHeight();
+ double fDX = fWidth * fabs( cos( fAngle ) ) +
+ fHeight * fabs( sin( fAngle ) );
+ double fDY = fHeight * fabs( cos( fAngle ) ) +
+ fWidth * fabs( sin( fAngle ) );
+ fDX = (fDX - fWidth) * 0.5 + 0.5;
+ fDY = (fDY - fHeight) * 0.5 + 0.5;
+ aRect.Left() -= (long)fDX;
+ aRect.Right() += (long)fDX;
+ aRect.Top() -= (long)fDY;
+ aRect.Bottom() += (long)fDY;
+
+ // Quadratisch machen, wenn angefordert;
+ Size aSize = aRect.GetSize();
+ if ( rGradient.GetStyle() == GRADIENT_SQUARE )
+ {
+ if ( aSize.Width() > aSize.Height() )
+ aSize.Height() = aSize.Width();
+ else
+ aSize.Width() = aSize.Height();
+ }
+
+ // neue Mittelpunkte berechnen
+ long nZWidth = aRect.GetWidth() * (long)rGradient.GetOfsX() / 100;
+ long nZHeight = aRect.GetHeight() * (long)rGradient.GetOfsY() / 100;
+ long nBorderX = (long)rGradient.GetBorder() * aSize.Width() / 100;
+ long nBorderY = (long)rGradient.GetBorder() * aSize.Height() / 100;
+ Point aCenter( aRect.Left() + nZWidth, aRect.Top() + nZHeight );
+
+ // Rand beruecksichtigen
+ aSize.Width() -= nBorderX;
+ aSize.Height() -= nBorderY;
+
+ // Ausgaberechteck neu setzen
+ aRect.Left() = aCenter.X() - (aSize.Width() >> 1);
+ aRect.Top() = aCenter.Y() - (aSize.Height() >> 1);
+ aRect.SetSize( aSize );
+
+ long nMinRect = Min( aRect.GetWidth(), aRect.GetHeight() );
+
+ // Anzahl der Schritte berechnen, falls nichts uebergeben wurde
+ if ( !nStepCount )
+ {
+ long nInc = ((nMinRect >> 9) + 1) << 3;
+
+ if ( !nInc )
+ nInc = 1;
+
+ nStepCount = (USHORT)(nMinRect / nInc);
+ }
+ // minimal drei Schritte
+ long nSteps = Max( nStepCount, (USHORT)3 );
+
+ // Ausgabebegrenzungen und Schrittweite fuer jede Richtung festlegen
+ double fScanLeft = aRect.Left();
+ double fScanTop = aRect.Top();
+ double fScanRight = aRect.Right();
+ double fScanBottom = aRect.Bottom();
+ double fScanInc = (double)nMinRect / (double)nSteps * 0.5;
+
+ // Intensitaeten von Start- und Endfarbe ggf. aendern und
+ // Farbschrittweiten berechnen
+ long nFactor;
+ const Color& rStartCol = rGradient.GetStartColor();
+ const Color& rEndCol = rGradient.GetEndColor();
+ long nRed = rStartCol.GetRed();
+ long nGreen = rStartCol.GetGreen();
+ long nBlue = rStartCol.GetBlue();
+ long nEndRed = rEndCol.GetRed();
+ long nEndGreen = rEndCol.GetGreen();
+ long nEndBlue = rEndCol.GetBlue();
+ nFactor = rGradient.GetStartIntensity();
+ nRed = (nRed * nFactor) / 100;
+ nGreen = (nGreen * nFactor) / 100;
+ nBlue = (nBlue * nFactor) / 100;
+ nFactor = rGradient.GetEndIntensity();
+ nEndRed = (nEndRed * nFactor) / 100;
+ nEndGreen = (nEndGreen * nFactor) / 100;
+ nEndBlue = (nEndBlue * nFactor) / 100;
+ long nStepRed = (nEndRed - nRed) / nSteps;
+ long nStepGreen = (nEndGreen - nGreen) / nSteps;
+ long nStepBlue = (nEndBlue - nBlue) / nSteps;
+ Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue );
+
+ // GDI-Objekte sichern und setzen
+ Brush aBrush( aCol );
+ aSetFillInBrushRecordHdl.Call(&aBrush);
+
+ // Recteck erstmal ausgeben
+ PolyPolygon aPolyPoly( 2 );
+ Polygon aPoly( rRect );
+
+ aPolyPoly.Insert( aPoly );
+ aPoly = Polygon( aRect );
+ aPoly.Rotate( aCenter, rGradient.GetAngle() );
+ aPolyPoly.Insert( aPoly );
+
+ PolyPolygon aTempPolyPoly = aPolyPoly;
+ aTempPolyPoly.Clip( aClipRect );
+ aDrawPolyPolyRecordHdl.Call(&aTempPolyPoly);
+
+ // Schleife, um nacheinander die Polygone/PolyPolygone auszugeben
+ for ( long i = 0; i < nSteps; i++ )
+ {
+ Color aCol( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue );
+ aBrush.SetColor( aCol );
+ aSetFillInBrushRecordHdl.Call(&aBrush);
+
+ // neues Polygon berechnen
+ aRect.Left() = (long)(fScanLeft += fScanInc);
+ aRect.Top() = (long)(fScanTop += fScanInc);
+ aRect.Right() = (long)(fScanRight -= fScanInc);
+ aRect.Bottom() = (long)(fScanBottom-= fScanInc);
+
+ if ( (aRect.GetWidth() < 2) || (aRect.GetHeight() < 2) )
+ break;
+
+ aPoly = Polygon( aRect );
+ aPoly.Rotate( aCenter, rGradient.GetAngle() );
+
+ aPolyPoly.Replace( aPolyPoly.GetObject( 1 ), 0 );
+ aPolyPoly.Replace( aPoly, 1 );
+
+ PolyPolygon aTempPolyPoly = aPolyPoly;
+ aTempPolyPoly.Clip( aClipRect );
+ aDrawPolyPolyRecordHdl.Call(&aTempPolyPoly);
+
+ // Farben aendern
+ nRed += nStepRed;
+ nGreen += nStepGreen;
+ nBlue += nStepBlue;
+
+#ifndef VCL
+ nRed = MinMax( nRed, 0, 65535 );
+ nGreen = MinMax( nGreen, 0, 65535 );
+ nBlue = MinMax( nBlue, 0, 65535 );
+#else
+ nRed = MinMax( nRed, 0, 0xFF );
+ nGreen = MinMax( nGreen, 0, 0xFF );
+ nBlue = MinMax( nBlue, 0, 0xFF );
+#endif
+ }
+
+ aBrush.SetColor( Color( (BYTE) nRed, (BYTE) nGreen, (BYTE) nBlue ) );
+ aSetFillInBrushRecordHdl.Call(&aBrush);
+
+ aPoly = aPolyPoly.GetObject( 1 );
+ if ( !aPoly.GetBoundRect().IsEmpty() )
+ {
+ aPoly.Clip( aClipRect );
+ aDrawPolyRecordHdl.Call(&aPoly);
+ }
+}
diff --git a/svtools/source/filter.vcl/filter/makefile.mk b/svtools/source/filter.vcl/filter/makefile.mk
new file mode 100644
index 000000000000..71c638a89764
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/makefile.mk
@@ -0,0 +1,137 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=SVTOOLS
+TARGET=filter
+DEPTARGET=vfilter
+VERSION=$(UPD)
+
+# --- Settings -----------------------------------------------------
+
+.IF "$(VCL)" != ""
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+.IF "$(GUI)"=="WIN"
+LINKFLAGS=$(LINKFLAGS) /PACKC:32768
+.ENDIF
+
+# --- UNOTypes -----------------------------------------------------
+
+UNOUCRDEP=$(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/applicat.rdb
+UNOUCROUT=$(OUT)$/inc$/$(PRJNAME)$/$(TARGET)
+INCPRE+=$(UNOUCROUT)
+UNOTYPES=\
+ com.sun.star.uno.TypeClass \
+ com.sun.star.uno.XInterface \
+ com.sun.star.uno.XWeak \
+ com.sun.star.uno.XAggregation \
+ com.sun.star.lang.XTypeProvider \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.io.XActiveDataSource \
+ com.sun.star.io.XOutputStream \
+ com.sun.star.svg.XSVGWriter \
+ com.sun.star.xml.sax.XDocumentHandler
+
+
+# --- Files --------------------------------------------------------
+
+CXXFILES= filter.cxx \
+ filter2.cxx \
+ dlgexpor.cxx \
+ dlgejpg.cxx \
+ sgfbram.cxx \
+ sgvmain.cxx \
+ sgvtext.cxx \
+ sgvspln.cxx
+
+SRCFILES= strings.src \
+ dlgexpor.src \
+ dlgejpg.src
+
+SLOFILES= $(SLO)$/filter.obj \
+ $(SLO)$/filter2.obj \
+ $(SLO)$/dlgexpor.obj \
+ $(SLO)$/dlgejpg.obj \
+ $(SLO)$/sgfbram.obj \
+ $(SLO)$/sgvmain.obj \
+ $(SLO)$/sgvtext.obj \
+ $(SLO)$/sgvspln.obj
+
+EXCEPTIONSNOOPTFILES= $(SLO)$/filter.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+.ELSE
+
+dummy:
+ @+echo VCL not set. nothing to do!
+
+.ENDIF # VCL
+
diff --git a/svtools/source/filter.vcl/filter/sgf.ini b/svtools/source/filter.vcl/filter/sgf.ini
new file mode 100644
index 000000000000..7444e40c8836
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/sgf.ini
@@ -0,0 +1,118 @@
+#Family : (Roman,Swiss,Modern,Script,Decora);
+#CharSet : (Ansi,IBMPC,Mac,Symbol,System); Default is System
+#Attribute: (Bold,Ital,Sans,Serf,Fixd);
+
+[SGV Fonts fuer StarView]
+#IF-ID Fontname Attribute SV-Fam ChSet Width FontName
+ 3848=(ITC Zapf Dingbats) Decora ()
+ 5720=(Symbol) Serf Decora Symbol ()
+ 5721=(Symbol) Bold Serf Decora Symbol ()
+ 5723=(Symbol Sans) Sans Decora Symbol ()
+ 5724=(Symbol Sans) Bold Sans Decora Symbol ()
+ 90133=(Dom Casual) Sans Script ()
+ 90326=(Brush) Bold Ital Serf Script ()
+ 90349=(Park Avenue) Ital Serf Script ()
+ 90508=(Uncial) Sans Roman ()
+ 91118=(Antique Olive) Bold Sans Swiss ()
+ 91119=(Antique Olive) Sans Swiss ()
+ 91120=(Antique Olive Compact) Bold Sans Swiss ()
+ 91335=(ITC Benguiat) Bold Serf Roman ()
+ 91336=(ITC Benguiat) Bold Ital Serf Roman ()
+ 91846=(Antique Olive) Ital Sans Roman ()
+#92500=(CG Times) Serf Roman ()
+#92501=(CG Times) Ital Serf Roman ()
+#92504=(CG Times) Bold Serf Roman ()
+#92505=(CG Times) Bold Ital Serf Roman ()
+#93950=(Courier) Serf Fixd Modern ()
+#93951=(Courier) Ital Serf Fixd Modern ()
+#93952=(Courier) Bold Serf Fixd Modern ()
+#93953=(Courier) Bold Ital Serf Fixd Modern ()
+#94021=(Univers) Sans Swiss ()
+#94022=(Univers) Ital Sans Swiss ()
+#94023=(Univers) Bold Sans Swiss ()
+#94024=(Univers) Bold Ital Sans Swiss ()
+102004=(Avanti) Bold Ital Sans Swiss ()
+102005=(Avanti) Ital Sans Swiss ()
+102007=(Booklet) Bold Sans Roman ()
+102008=(Booklet) Bold Ital Sans Roman ()
+102009=(Booklet) Ital Sans Roman ()
+102010=(Centuri) Sans Roman ()
+102011=(Centuri) Bold Sans Roman ()
+102012=(Centuri) Bold Ital Sans Roman ()
+102013=(Centuri) Ital Sans Roman ()
+102014=(Paltus) Bold Sans Roman ()
+102015=(Paltus) Sans Roman ()
+102016=(Paltus) Bold Ital Sans Roman ()
+102017=(Paltus) Ital Sans Roman ()
+102018=(Sans) Sans Swiss ()
+102019=(Sans) Bold Sans Swiss ()
+102020=(Sans) Bold Ital Sans Swiss ()
+102021=(Sans) Ital Sans Swiss ()
+102022=(SansCondensed) Sans Swiss ()
+102023=(SansCondensed) Bold Sans Swiss ()
+102024=(SansCondensed) Bold Ital Sans Swiss ()
+102025=(SansCondensed) Ital Sans Swiss ()
+102026=(PS-Roman) Sans Roman ()
+102027=(PS-Roman) Bold Sans Roman ()
+102028=(PS-Roman) Bold Ital Sans Roman ()
+102029=(PS-Roman) Ital Sans Roman ()
+200111=(Chalenge) Sans ()
+200112=(Chalenge) Bold Sans ()
+200113=(Chalenge) Ital Sans ()
+200114=(Chalenge) Bold Ital Sans ()
+200121=(Office) Sans ()
+200122=(Office) Bold Sans ()
+200123=(Office) Ital Sans ()
+200124=(Office) Bold Ital Sans ()
+200131=(Milano) Sans ()
+200132=(Milano) Bold Sans ()
+200133=(Milano) Ital Sans ()
+200134=(Milano) Bold Ital Sans ()
+200141=(Atlantic) Sans Roman ()
+200142=(Atlantic) Bold Sans Roman ()
+200143=(Atlantic) Ital Sans Roman ()
+200144=(Atlantic) Bold Ital Sans Roman ()
+200151=(Pentagon) Sans ()
+200152=(Pentagon) Bold Sans ()
+200153=(Pentagon) Ital Sans ()
+200154=(Pentagon) Bold Ital Sans ()
+200161=(Classico) Sans ()
+200162=(Classico) Bold Sans ()
+200163=(Classico) Ital Sans ()
+200164=(Classico) Bold Ital Sans ()
+200211=(Westcost) Sans ()
+200212=(Westcost) Bold Sans ()
+200213=(Westcost) Ital Sans ()
+200214=(Westcost) Bold Ital Sans ()
+200221=(Finish) Sans ()
+200222=(Finish) Bold Sans ()
+200223=(Finish) Ital Sans ()
+200224=(Finish) Bold Ital Sans ()
+200231=(Classic) Sans ()
+200232=(Classic) Bold Sans ()
+200233=(Classic) Ital Sans ()
+200234=(Classic) Bold Ital Sans ()
+200241=(Hilton) Sans ()
+200242=(Hilton) Bold Sans ()
+200243=(Hilton) Ital Sans ()
+200244=(Hilton) Bold Ital Sans ()
+200251=(Progress) Sans ()
+200252=(Progress) Bold Sans ()
+200253=(Progress) Ital Sans ()
+200254=(Progress) Bold Ital Sans ()
+200261=(PrestigeElite) Sans ()
+200262=(PrestigeElite) Bold Sans ()
+200263=(PrestigeElite) Ital Sans ()
+200271=(Ovetti) Bold Sans ()
+200272=(Ovetti) Sans ()
+200301=(Cescendo) Sans ()
+200302=(Funky) Sans Decora ()
+200303=(Speed) Sans Decora ()
+200304=(Skyline) Sans Decora ()
+200305=(Calculator) Sans Decora ()
+200306=(Xpress) Sans Decora ()
+200307=(Console) Sans Decora ()
+200308=(Paisley) Sans ()
+200309=(Nova) Sans ()
+200310=(New York) Sans Decora ()
+200311=(Shanghai) Sans Decora ()
diff --git a/svtools/source/filter.vcl/filter/sgfbram.cxx b/svtools/source/filter.vcl/filter/sgfbram.cxx
new file mode 100644
index 000000000000..824abf8271f3
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/sgfbram.cxx
@@ -0,0 +1,696 @@
+/*************************************************************************
+ *
+ * $RCSfile: sgfbram.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string.h>
+#include <tools/stream.hxx>
+#include <vcl/gdimtf.hxx>
+#include <vcl/color.hxx>
+#include <vcl/virdev.hxx>
+#include "sgffilt.hxx"
+#include "sgfbram.hxx"
+
+#if defined( WIN ) && defined( MSC )
+#pragma code_seg( "SVTOOLS_FILTER4", "SVTOOLS_CODE" )
+#endif
+
+/*************************************************************************
+|*
+|* operator>>( SvStream&, SgfHeader& )
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+SvStream& operator>>(SvStream& rIStream, SgfHeader& rHead)
+{
+ rIStream.Read((char*)&rHead.Magic,SgfHeaderSize);
+#if defined __BIGENDIAN
+ rHead.Magic =SWAPSHORT(rHead.Magic );
+ rHead.Version=SWAPSHORT(rHead.Version);
+ rHead.Typ =SWAPSHORT(rHead.Typ );
+ rHead.Xsize =SWAPSHORT(rHead.Xsize );
+ rHead.Ysize =SWAPSHORT(rHead.Ysize );
+ rHead.Xoffs =SWAPSHORT(rHead.Xoffs );
+ rHead.Yoffs =SWAPSHORT(rHead.Yoffs );
+ rHead.Planes =SWAPSHORT(rHead.Planes );
+ rHead.SwGrCol=SWAPSHORT(rHead.SwGrCol);
+ rHead.OfsLo =SWAPSHORT(rHead.OfsLo );
+ rHead.OfsHi =SWAPSHORT(rHead.OfsHi );
+#endif
+ return rIStream;
+}
+
+
+/*************************************************************************
+|*
+|* SgfHeader::ChkMagic()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL SgfHeader::ChkMagic()
+{ return Magic=='J'*256+'J'; }
+
+UINT32 SgfHeader::GetOffset()
+{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); }
+
+
+/*************************************************************************
+|*
+|* operator>>( SvStream&, SgfEntry& )
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+SvStream& operator>>(SvStream& rIStream, SgfEntry& rEntr)
+{
+ rIStream.Read((char*)&rEntr.Typ,SgfEntrySize);
+#if defined __BIGENDIAN
+ rEntr.Typ =SWAPSHORT(rEntr.Typ );
+ rEntr.iFrei=SWAPSHORT(rEntr.iFrei);
+ rEntr.lFreiLo=SWAPSHORT (rEntr.lFreiLo);
+ rEntr.lFreiHi=SWAPSHORT (rEntr.lFreiHi);
+ rEntr.OfsLo=SWAPSHORT(rEntr.OfsLo);
+ rEntr.OfsHi=SWAPSHORT(rEntr.OfsHi);
+#endif
+ return rIStream;
+}
+
+UINT32 SgfEntry::GetOffset()
+{ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi); }
+
+
+/*************************************************************************
+|*
+|* operator>>( SvStream&, SgfVector& )
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+SvStream& operator>>(SvStream& rIStream, SgfVector& rVect)
+{
+ rIStream.Read((char*)&rVect,sizeof(rVect));
+#if defined __BIGENDIAN
+ rVect.Flag =SWAPSHORT(rVect.Flag );
+ rVect.x =SWAPSHORT(rVect.x );
+ rVect.y =SWAPSHORT(rVect.y );
+ rVect.OfsLo=SWAPLONG (rVect.OfsLo);
+ rVect.OfsHi=SWAPLONG (rVect.OfsHi);
+#endif
+ return rIStream;
+}
+
+
+/*************************************************************************
+|*
+|* operator<<( SvStream&, BmpFileHeader& )
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+SvStream& operator<<(SvStream& rOStream, BmpFileHeader& rHead)
+{
+#if defined __BIGENDIAN
+ rHead.Typ =SWAPSHORT(rHead.Typ );
+ rHead.SizeLo =SWAPSHORT(rHead.SizeLo );
+ rHead.SizeHi =SWAPSHORT(rHead.SizeHi );
+ rHead.Reserve1=SWAPSHORT(rHead.Reserve1);
+ rHead.Reserve2=SWAPSHORT(rHead.Reserve2);
+ rHead.OfsLo =SWAPSHORT(rHead.OfsLo );
+ rHead.OfsHi =SWAPSHORT(rHead.OfsHi );
+#endif
+ rOStream.Write((char*)&rHead,sizeof(rHead));
+#if defined __BIGENDIAN
+ rHead.Typ =SWAPSHORT(rHead.Typ );
+ rHead.SizeLo =SWAPSHORT(rHead.SizeLo );
+ rHead.SizeHi =SWAPSHORT(rHead.SizeHi );
+ rHead.Reserve1=SWAPSHORT(rHead.Reserve1);
+ rHead.Reserve2=SWAPSHORT(rHead.Reserve2);
+ rHead.OfsLo =SWAPSHORT(rHead.OfsLo );
+ rHead.OfsHi =SWAPSHORT(rHead.OfsHi );
+#endif
+ return rOStream;
+}
+
+void BmpFileHeader::SetSize(UINT32 Size)
+{
+ SizeLo=UINT16(Size & 0x0000FFFF);
+ SizeHi=UINT16((Size & 0xFFFF0000)>>16);
+}
+
+void BmpFileHeader::SetOfs(UINT32 Ofs)
+{
+ OfsLo=UINT16(Ofs & 0x0000FFFF);
+ OfsHi=UINT16((Ofs & 0xFFFF0000)>>16);
+}
+
+UINT32 BmpFileHeader::GetOfs()
+{
+ return UINT32(OfsLo)+0x00010000*UINT32(OfsHi);
+}
+
+/*************************************************************************
+|*
+|* operator<<( SvStream&, BmpInfoHeader& )
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+SvStream& operator<<(SvStream& rOStream, BmpInfoHeader& rInfo)
+{
+#if defined __BIGENDIAN
+ rInfo.Size =SWAPLONG (rInfo.Size );
+ rInfo.Width =SWAPLONG (rInfo.Width );
+ rInfo.Hight =SWAPLONG (rInfo.Hight );
+ rInfo.Planes =SWAPSHORT(rInfo.Planes );
+ rInfo.PixBits =SWAPSHORT(rInfo.PixBits );
+ rInfo.Compress=SWAPLONG (rInfo.Compress);
+ rInfo.ImgSize =SWAPLONG (rInfo.ImgSize );
+ rInfo.xDpmm =SWAPLONG (rInfo.xDpmm );
+ rInfo.yDpmm =SWAPLONG (rInfo.yDpmm );
+ rInfo.ColUsed =SWAPLONG (rInfo.ColUsed );
+ rInfo.ColMust =SWAPLONG (rInfo.ColMust );
+#endif
+ rOStream.Write((char*)&rInfo,sizeof(rInfo));
+#if defined __BIGENDIAN
+ rInfo.Size =SWAPLONG (rInfo.Size );
+ rInfo.Width =SWAPLONG (rInfo.Width );
+ rInfo.Hight =SWAPLONG (rInfo.Hight );
+ rInfo.Planes =SWAPSHORT(rInfo.Planes );
+ rInfo.PixBits =SWAPSHORT(rInfo.PixBits );
+ rInfo.Compress=SWAPLONG (rInfo.Compress);
+ rInfo.ImgSize =SWAPLONG (rInfo.ImgSize );
+ rInfo.xDpmm =SWAPLONG (rInfo.xDpmm );
+ rInfo.yDpmm =SWAPLONG (rInfo.yDpmm );
+ rInfo.ColUsed =SWAPLONG (rInfo.ColUsed );
+ rInfo.ColMust =SWAPLONG (rInfo.ColMust );
+#endif
+ return rOStream;
+}
+
+
+/*************************************************************************
+|*
+|* operator<<( SvStream&, RGBQuad& )
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+SvStream& operator<<(SvStream& rOStream, const RGBQuad& rQuad)
+{
+ rOStream.Write((char*)&rQuad,sizeof(rQuad));
+ return rOStream;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// PcxExpand ///////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+class PcxExpand
+{
+private:
+ USHORT Count;
+ BYTE Data;
+public:
+ PcxExpand() { Count=0; }
+ BYTE GetByte(SvStream& rInp);
+};
+
+BYTE PcxExpand::GetByte(SvStream& rInp)
+{
+ if (Count>0) {
+ Count--;
+ } else {
+ rInp.Read((char*)&Data,1);
+ if ((Data & 0xC0) == 0xC0) {
+ Count=(Data & 0x3F) -1;
+ rInp.Read((char*)&Data,1);
+ }
+ }
+ return Data;
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SgfBMapFilter ///////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+
+/*************************************************************************
+|*
+|* SgfFilterBmp()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL SgfFilterBMap(SvStream& rInp, SvStream& rOut, SgfHeader& rHead, SgfEntry&)
+{
+ BmpFileHeader aBmpHead;
+ BmpInfoHeader aBmpInfo;
+ USHORT nWdtInp=(rHead.Xsize+7)/8; // Breite der Input-Bitmap in Bytes
+ USHORT nWdtOut; // Breite der Output-Bitmap in Bytes
+ USHORT nColors; // Anzahl der Farben (1,16,256)
+ USHORT nColBits; // Anzahl der Bits/Pixel (2, 4, 8)
+ USHORT i,j,k; // Spaltenz„hler, Zeilenz„hler, Planez„hler
+ USHORT a,b; // Hilfsvariable
+ BYTE pl1,pl2; // Masken fr die Planes
+ BYTE* pBuf=NULL; // Buffer fr eine Pixelzeile
+ PcxExpand aPcx;
+ ULONG nOfs;
+ BYTE cRGB[4];
+
+ if (rHead.Planes<=1) nColBits=1; else nColBits=4; if (rHead.Typ==4) nColBits=8;
+ nColors=1<<nColBits;
+ nWdtOut=((rHead.Xsize*nColBits+31)/32)*4;
+ aBmpHead.Typ='B'+'M'*256;
+ aBmpHead.SetOfs(sizeof(aBmpHead)+sizeof(aBmpInfo)+nColors*4);
+ aBmpHead.SetSize(aBmpHead.GetOfs()+nWdtOut*rHead.Ysize);
+ aBmpHead.Reserve1=0;
+ aBmpHead.Reserve2=0;
+ aBmpInfo.Size=sizeof(aBmpInfo);
+ aBmpInfo.Width=rHead.Xsize;
+ aBmpInfo.Hight=rHead.Ysize;
+ aBmpInfo.Planes=1;
+ aBmpInfo.PixBits=nColBits;
+ aBmpInfo.Compress=0;
+ aBmpInfo.ImgSize=0;
+ aBmpInfo.xDpmm=0;
+ aBmpInfo.yDpmm=0;
+ aBmpInfo.ColUsed=0;
+ aBmpInfo.ColMust=0;
+ pBuf=new BYTE[nWdtOut];
+ if (!pBuf) return FALSE; // Fehler: kein Speichel da
+ rOut<<aBmpHead<<aBmpInfo;
+ memset(pBuf,0,nWdtOut); // Buffer mit Nullen fllen
+
+ if (nColors==2)
+ {
+
+ rOut<<RGBQuad(0x00,0x00,0x00); // Schwarz
+ rOut<<RGBQuad(0xFF,0xFF,0xFF); // Weiss
+ nOfs=rOut.Tell();
+ for (j=0;j<rHead.Ysize;j++)
+ rOut.Write((char*)pBuf,nWdtOut); // Datei erstmal komplett mit Nullen fllen
+ for (j=0;j<rHead.Ysize;j++) {
+ for(i=0;i<nWdtInp;i++) {
+ pBuf[i]=aPcx.GetByte(rInp);
+ }
+ for(i=nWdtInp;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
+ rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rckw„rts schreiben!
+ rOut.Write((char*)pBuf,nWdtOut);
+ }
+ } else if (nColors==16) {
+ rOut<<RGBQuad(0x00,0x00,0x00); // Schwarz
+ rOut<<RGBQuad(0x24,0x24,0x24); // Grau 80%
+ rOut<<RGBQuad(0x49,0x49,0x49); // Grau 60%
+ rOut<<RGBQuad(0x92,0x92,0x92); // Grau 40%
+ rOut<<RGBQuad(0x6D,0x6D,0x6D); // Grau 30%
+ rOut<<RGBQuad(0xB6,0xB6,0xB6); // Grau 20%
+ rOut<<RGBQuad(0xDA,0xDA,0xDA); // Grau 10%
+ rOut<<RGBQuad(0xFF,0xFF,0xFF); // Weiss
+ rOut<<RGBQuad(0x00,0x00,0x00); // Schwarz
+ rOut<<RGBQuad(0xFF,0x00,0x00); // Rot
+ rOut<<RGBQuad(0x00,0x00,0xFF); // Blau
+ rOut<<RGBQuad(0xFF,0x00,0xFF); // Magenta
+ rOut<<RGBQuad(0x00,0xFF,0x00); // Gruen
+ rOut<<RGBQuad(0xFF,0xFF,0x00); // Gelb
+ rOut<<RGBQuad(0x00,0xFF,0xFF); // Cyan
+ rOut<<RGBQuad(0xFF,0xFF,0xFF); // Weiss
+
+ nOfs=rOut.Tell();
+ for (j=0;j<rHead.Ysize;j++)
+ rOut.Write((char*)pBuf,nWdtOut); // Datei erstmal komplett mit Nullen fllen
+ for (j=0;j<rHead.Ysize;j++) {
+ memset(pBuf,0,nWdtOut);
+ for(k=0;k<4;k++) {
+ if (k==0) {
+ pl1=0x10; pl2=0x01;
+ } else {
+ pl1<<=1; pl2<<=1;
+ }
+ for(i=0;i<nWdtInp;i++) {
+ a=i*4;
+ b=aPcx.GetByte(rInp);
+ if (b & 0x80) pBuf[a ]|=pl1;
+ if (b & 0x40) pBuf[a ]|=pl2;
+ if (b & 0x20) pBuf[a+1]|=pl1;
+ if (b & 0x10) pBuf[a+1]|=pl2;
+ if (b & 0x08) pBuf[a+2]|=pl1;
+ if (b & 0x04) pBuf[a+2]|=pl2;
+ if (b & 0x02) pBuf[a+3]|=pl1;
+ if (b & 0x01) pBuf[a+3]|=pl2;
+ }
+ }
+ for(i=nWdtInp*4;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
+ rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rckw„rts schreiben!
+ rOut.Write((char*)pBuf,nWdtOut);
+ }
+ } else if (nColors==256) {
+ cRGB[3]=0; // der 4. Paletteneintrag fr BMP
+ for (i=0;i<256;i++) { // Palette kopieren
+ rInp.Read((char*)cRGB,3);
+ pl1=cRGB[0]; // Rot mit Blau tauschen
+ cRGB[0]=cRGB[2];
+ cRGB[2]=pl1;
+ rOut.Write((char*)cRGB,4);
+ }
+
+ nOfs=rOut.Tell();
+ for (j=0;j<rHead.Ysize;j++)
+ rOut.Write((char*)pBuf,nWdtOut); // Datei erstmal komplett mit Nullen fllen
+ for (j=0;j<rHead.Ysize;j++) {
+ for(i=0;i<rHead.Xsize;i++)
+ pBuf[i]=aPcx.GetByte(rInp);
+ for(i=rHead.Xsize;i<nWdtOut;i++) pBuf[i]=0; // noch bis zu 3 Bytes
+ rOut.Seek(nOfs+((ULONG)rHead.Ysize-j-1L)*(ULONG)nWdtOut); // rckw„rts schreiben!
+ rOut.Write((char*)pBuf,nWdtOut);
+ }
+ }
+ delete pBuf;
+ return TRUE;
+}
+
+
+/*************************************************************************
+|*
+|* SgfBMapFilter()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL SgfBMapFilter(SvStream& rInp, SvStream& rOut)
+{
+ ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ SgfHeader aHead;
+ SgfEntry aEntr;
+ ULONG nNext;
+ BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
+ BOOL bRet=FALSE; // Returncode
+
+ nFileStart=rInp.Tell();
+ rInp>>aHead;
+ if (aHead.ChkMagic() && (aHead.Typ==SgfBitImag0 || aHead.Typ==SgfBitImag1 ||
+ aHead.Typ==SgfBitImag2 || aHead.Typ==SgfBitImgMo)) {
+ nNext=aHead.GetOffset();
+ while (nNext && !bRdFlag && !rInp.GetError() && !rOut.GetError()) {
+ rInp.Seek(nFileStart+nNext);
+ rInp>>aEntr;
+ nNext=aEntr.GetOffset();
+ if (aEntr.Typ==aHead.Typ) {
+ bRdFlag=TRUE;
+ switch(aEntr.Typ) {
+ case SgfBitImag0:
+ case SgfBitImag1:
+ case SgfBitImag2:
+ case SgfBitImgMo: bRet=SgfFilterBMap(rInp,rOut,aHead,aEntr); break;
+ }
+ }
+ } // while(nNext)
+ }
+ if (rInp.GetError()) bRet=FALSE;
+ return(bRet);
+}
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SgfVectFilter ///////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+// Fr StarDraw Embedded SGF-Vector
+long SgfVectXofs=0;
+long SgfVectYofs=0;
+long SgfVectXmul=0;
+long SgfVectYmul=0;
+long SgfVectXdiv=0;
+long SgfVectYdiv=0;
+BOOL SgfVectScal=FALSE;
+
+////////////////////////////////////////////////////////////
+// Hpgl2SvFarbe ////////////////////////////////////////////
+////////////////////////////////////////////////////////////
+
+Color Hpgl2SvFarbe( BYTE nFarb )
+{
+ ULONG nColor = COL_BLACK;
+
+ switch (nFarb & 0x07) {
+ case 0: nColor=COL_WHITE; break;
+ case 1: nColor=COL_YELLOW; break;
+ case 2: nColor=COL_LIGHTMAGENTA; break;
+ case 3: nColor=COL_LIGHTRED; break;
+ case 4: nColor=COL_LIGHTCYAN; break;
+ case 5: nColor=COL_LIGHTGREEN; break;
+ case 6: nColor=COL_LIGHTBLUE; break;
+ case 7: nColor=COL_BLACK; break;
+ }
+ Color aColor( nColor );
+ return aColor;
+}
+
+/*************************************************************************
+|*
+|* SgfFilterVect()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL SgfFilterVect(SvStream& rInp, SgfHeader& rHead, SgfEntry&, GDIMetaFile& rMtf)
+{
+ VirtualDevice aOutDev;
+ SgfVector aVect;
+ BYTE nFarb;
+ BYTE nFrb0=7;
+ BYTE nLTyp;
+ BYTE nOTyp;
+ BOOL bEoDt=FALSE;
+ BOOL bPDwn=FALSE;
+ Point aP0(0,0);
+ Point aP1(0,0);
+ String Msg;
+ USHORT RecNr=0;
+
+ rMtf.Record(&aOutDev);
+ aOutDev.SetLineColor(Color(COL_BLACK));
+ aOutDev.SetFillColor(Color(COL_BLACK));
+
+ while (!bEoDt && !rInp.GetError()) {
+ rInp>>aVect; RecNr++;
+ nFarb=(BYTE) (aVect.Flag & 0x000F);
+ nLTyp=(BYTE)((aVect.Flag & 0x00F0) >>4);
+ nOTyp=(BYTE)((aVect.Flag & 0x0F00) >>8);
+ bEoDt=(aVect.Flag & 0x4000) !=0;
+ bPDwn=(aVect.Flag & 0x8000) !=0;
+
+ long x=aVect.x-rHead.Xoffs;
+ long y=rHead.Ysize-(aVect.y-rHead.Yoffs);
+ if (SgfVectScal) {
+ if (SgfVectXdiv==0) SgfVectXdiv=rHead.Xsize;
+ if (SgfVectYdiv==0) SgfVectYdiv=rHead.Ysize;
+ if (SgfVectXdiv==0) SgfVectXdiv=1;
+ if (SgfVectYdiv==0) SgfVectYdiv=1;
+ x=SgfVectXofs+ x *SgfVectXmul /SgfVectXdiv;
+ y=SgfVectYofs+ y *SgfVectXmul /SgfVectYdiv;
+ }
+ aP1=Point(x,y);
+ if (!bEoDt && !rInp.GetError()) {
+ if (bPDwn && nLTyp<=6) {
+ switch(nOTyp) {
+ case 1: if (nFarb!=nFrb0) {
+ switch(rHead.SwGrCol) {
+ case SgfVectFarb: aOutDev.SetLineColor(Hpgl2SvFarbe(nFarb)); break;
+ case SgfVectGray: break;
+ case SgfVectWdth: break;
+ }
+ }
+ aOutDev.DrawLine(aP0,aP1); break; // Linie
+ case 2: break; // Kreis
+ case 3: break; // Text
+ case 5: aOutDev.DrawRect(Rectangle(aP0,aP1)); break; // Rechteck (solid)
+ }
+ }
+ aP0=aP1;
+ nFrb0=nFarb;
+ }
+ }
+ rMtf.Stop();
+ rMtf.WindStart();
+ MapMode aMap( MAP_10TH_MM, Point(),
+ Fraction( 1, 4 ), Fraction( 1, 4 ) );
+ rMtf.SetPrefMapMode( aMap );
+ rMtf.SetPrefSize( Size( (short)rHead.Xsize, (short)rHead.Ysize ) );
+ return TRUE;
+}
+
+
+/*************************************************************************
+|*
+|* SgfVectFilter()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL SgfVectFilter(SvStream& rInp, GDIMetaFile& rMtf)
+{
+ ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ SgfHeader aHead;
+ SgfEntry aEntr;
+ ULONG nNext;
+ BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
+ BOOL bRet=FALSE; // Returncode
+
+ nFileStart=rInp.Tell();
+ rInp>>aHead;
+ if (aHead.ChkMagic() && aHead.Typ==SGF_SIMPVECT) {
+ nNext=aHead.GetOffset();
+ while (nNext && !bRdFlag && !rInp.GetError()) {
+ rInp.Seek(nFileStart+nNext);
+ rInp>>aEntr;
+ nNext=aEntr.GetOffset();
+ if (aEntr.Typ==aHead.Typ) {
+ bRet=SgfFilterVect(rInp,aHead,aEntr,rMtf);
+ }
+ } // while(nNext)
+ if (bRdFlag) {
+ if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok
+ }
+ }
+ return(bRet);
+}
+
+
+/*************************************************************************
+|*
+|* SgfFilterPScr()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL SgfFilterPScr(SvStream&, SgfHeader&, SgfEntry&)
+{
+ return FALSE; // PostSrcipt wird noch nicht unterstuetzt !
+}
+
+
+/*************************************************************************
+|*
+|* CheckSgfTyp()
+|*
+|* Beschreibung Feststellen, uwas fr ein SGF/SGV es sich handelt.
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BYTE CheckSgfTyp(SvStream& rInp, USHORT& nVersion)
+{
+#ifdef DEBUG // RecordgrӇen checken. Neuer Compiler hat vielleichte anderes Allignment!
+ if (sizeof(SgfHeader)!=SgfHeaderSize ||
+ sizeof(SgfEntry) !=SgfEntrySize ||
+ sizeof(SgfVector)!=SgfVectorSize ||
+ sizeof(BmpFileHeader)!=BmpFileHeaderSize ||
+ sizeof(BmpInfoHeader)!=BmpInfoHeaderSize ||
+ sizeof(RGBQuad )!=RGBQuadSize ) return SGF_DONTKNOW;
+#endif
+
+ ULONG nPos;
+ SgfHeader aHead;
+ nVersion=0;
+ nPos=rInp.Tell();
+ rInp>>aHead;
+ rInp.Seek(nPos);
+ if (aHead.ChkMagic()) {
+ nVersion=aHead.Version;
+ switch(aHead.Typ) {
+ case SgfBitImag0:
+ case SgfBitImag1:
+ case SgfBitImag2:
+ case SgfBitImgMo: return SGF_BITIMAGE;
+ case SgfSimpVect: return SGF_SIMPVECT;
+ case SgfPostScrp: return SGF_POSTSCRP;
+ case SgfStarDraw: return SGF_STARDRAW;
+ default : return SGF_DONTKNOW;
+ }
+ } else {
+ return SGF_DONTKNOW;
+ }
+}
diff --git a/svtools/source/filter.vcl/filter/sgvmain.cxx b/svtools/source/filter.vcl/filter/sgvmain.cxx
new file mode 100644
index 000000000000..33e59755579a
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/sgvmain.cxx
@@ -0,0 +1,1220 @@
+/*************************************************************************
+ *
+ * $RCSfile: sgvmain.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef MAC
+#include <mac_start.h>
+#include <math.h>
+#include <mac_end.h>
+#else
+#include <math.h>
+#endif
+#include <vcl/graph.hxx>
+#include <vcl/poly.hxx>
+#include "filter.hxx"
+#include "sgffilt.hxx"
+#include "sgfbram.hxx"
+#include "sgvmain.hxx"
+#include "sgvspln.hxx"
+
+#ifdef DEBUG
+//#include "Debug.c"
+#endif
+
+#define SWAPPOINT(p) { \
+ p.x=SWAPSHORT(p.x); \
+ p.y=SWAPSHORT(p.y); }
+
+#define SWAPPAGE(p) { \
+ p.Next =SWAPLONG (p.Next ); \
+ p.nList =SWAPLONG (p.nList ); \
+ p.ListEnd=SWAPLONG (p.ListEnd); \
+ p.Paper.Size.x=SWAPSHORT(p.Paper.Size.x); \
+ p.Paper.Size.y=SWAPSHORT(p.Paper.Size.y); \
+ p.Paper.RandL =SWAPSHORT(p.Paper.RandL ); \
+ p.Paper.RandR =SWAPSHORT(p.Paper.RandR ); \
+ p.Paper.RandO =SWAPSHORT(p.Paper.RandO ); \
+ p.Paper.RandU =SWAPSHORT(p.Paper.RandU ); \
+ SWAPPOINT(p.U); \
+ UINT16 iTemp; \
+ for (iTemp=0;iTemp<20;iTemp++) { \
+ rPage.HlpLnH[iTemp]=SWAPSHORT(rPage.HlpLnH[iTemp]); \
+ rPage.HlpLnV[iTemp]=SWAPSHORT(rPage.HlpLnV[iTemp]); }}
+
+#define SWAPOBJK(o) { \
+ o.Last =SWAPLONG (o.Last ); \
+ o.Next =SWAPLONG (o.Next ); \
+ o.MemSize =SWAPSHORT(o.MemSize ); \
+ SWAPPOINT(o.ObjMin); \
+ SWAPPOINT(o.ObjMax); }
+
+#define SWAPLINE(l) { \
+ l.LMSize=SWAPSHORT(l.LMSize); \
+ l.LDicke=SWAPSHORT(l.LDicke); }
+
+#define SWAPAREA(a) { \
+ a.FDummy2=SWAPSHORT(a.FDummy2); \
+ a.FMuster=SWAPSHORT(a.FMuster); }
+
+#define SWAPTEXT(t) { \
+ SWAPLINE(t.L); \
+ SWAPAREA(t.F); \
+ t.FontLo =SWAPSHORT(t.FontLo ); \
+ t.FontHi =SWAPSHORT(t.FontHi ); \
+ t.Grad =SWAPSHORT(t.Grad ); \
+ t.Breite =SWAPSHORT(t.Breite ); \
+ t.Schnitt=SWAPSHORT(t.Schnitt); \
+ t.LnFeed =SWAPSHORT(t.LnFeed ); \
+ t.Slant =SWAPSHORT(t.Slant ); \
+ SWAPLINE(t.ShdL); \
+ SWAPAREA(t.ShdF); \
+ SWAPPOINT(t.ShdVers); \
+ SWAPAREA(t.BackF); }
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Einschränkungen:
+//
+// þ Flächenmuster werden den unter StarView verfügbaren Mustern angenähert.
+// þ Linienenden werden unter StarView immer rund dargestellt und gehen über
+// den Endpunkt der Linie hinaus.
+// þ Linienmuster werden den unter StarView verfügbaren Mustern angenähert.
+// Transparent/Opak wird zur Zeit noch nicht berücksichtigt.
+// þ Keine gedrehten Ellipsen
+//
+//
+//
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+#if defined( WIN ) && defined( MSC )
+#pragma code_seg( "svtools", "AUTO_CODE" )
+#endif
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Für Fontübersetzung /////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+SgfFontLst* pSgfFonts = 0;
+
+#if defined( WIN ) && defined( MSC )
+#pragma code_seg( "SVTOOLS_FILTER3", "SVTOOLS_CODE" )
+static void AntiMscBug() {}
+#endif
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// Für Kreisunterarten, Text und gedrehte Rechtecke ////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+void RotatePoint(PointType& P, INT16 cx, INT16 cy, double sn, double cs)
+{
+ INT16 dx,dy;
+ double x1,y1;
+ dx=P.x-cx;
+ dy=P.y-cy;
+ x1=dx*cs-dy*sn;
+ y1=dy*cs+dx*sn;
+ P.x=cx+INT16(x1);
+ P.y=cy+INT16(y1);
+}
+
+void RotatePoint(Point& P, INT16 cx, INT16 cy, double sn, double cs)
+{
+ INT16 dx,dy;
+ double x1,y1;
+ dx=(INT16)(P.X()-cx);
+ dy=(INT16)(P.Y()-cy);
+ x1=dx*cs-dy*sn;
+ y1=dy*cs+dx*sn;
+ P=Point(cx+INT16(x1),cy+INT16(y1));
+}
+
+INT16 iMulDiv(INT16 a, INT16 Mul, INT16 Div)
+{
+ INT32 Temp;
+ Temp=INT32(a)*INT32(Mul)/INT32(Div);
+ return INT16(Temp);
+}
+
+UINT16 MulDiv(UINT16 a, UINT16 Mul, UINT16 Div)
+{
+ UINT32 Temp;
+ Temp=UINT32(a)*UINT32(Mul)/UINT32(Div);
+ return UINT16(Temp);
+}
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+// SgfFilterSDrw ///////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+SvStream& operator>>(SvStream& rIStream, DtHdType& rDtHd)
+{
+ rIStream.Read((char*)&rDtHd.Reserved[0],DtHdSize);
+ return rIStream;
+}
+
+void DtHdOverSeek(SvStream& rInp)
+{
+ ULONG FPos=rInp.Tell();
+ FPos+=(ULONG)DtHdSize;
+ rInp.Seek(FPos);
+// rInp.seekg(rInp.tellg()+(ULONG)DtHdSize);
+}
+
+
+SvStream& operator>>(SvStream& rIStream, PageType& rPage)
+{
+ rIStream.Read((char*)&rPage.Next,PageSize);
+#if defined __BIGENDIAN
+ SWAPPAGE(rPage);
+#endif
+ return rIStream;
+}
+
+void ObjkOverSeek(SvStream& rInp, ObjkType& rObjk)
+{
+ ULONG Siz;
+ Siz=(ULONG)rObjk.MemSize+rObjk.Last; // ObjSize+ObjAnhSize
+ rInp.Seek(rInp.Tell()+Siz);
+}
+
+SvStream& operator>>(SvStream& rInp, ObjkType& rObjk)
+{ // Die Fileposition im Stream bleibt unverändert!
+ ULONG nPos;
+ nPos=rInp.Tell();
+ rInp.Read((char*)&rObjk.Last,ObjkSize);
+#if defined __BIGENDIAN
+ SWAPOBJK(rObjk);
+#endif
+#ifdef InArbeit
+ ULONG nPos1=rInp.Tell();
+ if(nPos == nPos1) InfoBox( NULL, "tellg funkt nich" ).Execute();
+#endif
+ rInp.Seek(nPos);
+#ifdef InArbeit
+ if (rInp.Tell() != nPos) InfoBox( NULL, "seekg funkt nich" ).Execute();
+#endif
+ return rInp;
+}
+SvStream& operator>>(SvStream& rInp, StrkType& rStrk)
+{
+ rInp.Read((char*)&rStrk.Last,StrkSize);
+#if defined __BIGENDIAN
+ SWAPOBJK (rStrk);
+ SWAPLINE (rStrk.L);
+ SWAPPOINT(rStrk.Pos1);
+ SWAPPOINT(rStrk.Pos2);
+#endif
+ return rInp;
+}
+SvStream& operator>>(SvStream& rInp, RectType& rRect)
+{
+ rInp.Read((char*)&rRect.Last,RectSize);
+#if defined __BIGENDIAN
+ SWAPOBJK (rRect);
+ SWAPLINE (rRect.L);
+ SWAPAREA (rRect.F);
+ SWAPPOINT(rRect.Pos1);
+ SWAPPOINT(rRect.Pos2);
+ rRect.Radius =SWAPSHORT(rRect.Radius );
+ rRect.DrehWink=SWAPSHORT(rRect.DrehWink);
+ rRect.Slant =SWAPSHORT(rRect.Slant );
+#endif
+ return rInp;
+}
+SvStream& operator>>(SvStream& rInp, PolyType& rPoly)
+{
+ rInp.Read((char*)&rPoly.Last,PolySize);
+#if defined __BIGENDIAN
+ SWAPOBJK (rPoly);
+ SWAPLINE (rPoly.L);
+ SWAPAREA (rPoly.F);
+ // rPoly.EckP=SWAPLONG(rPoly.EckP);
+#endif
+ return rInp;
+}
+SvStream& operator>>(SvStream& rInp, SplnType& rSpln)
+{
+ rInp.Read((char*)&rSpln.Last,SplnSize);
+#if defined __BIGENDIAN
+ SWAPOBJK (rSpln);
+ SWAPLINE (rSpln.L);
+ SWAPAREA (rSpln.F);
+ // rSpln.EckP=SWAPLONG(rSpln.EckP);
+#endif
+ return rInp;
+}
+SvStream& operator>>(SvStream& rInp, CircType& rCirc)
+{
+ rInp.Read((char*)&rCirc.Last,CircSize);
+#if defined __BIGENDIAN
+ SWAPOBJK (rCirc);
+ SWAPLINE (rCirc.L);
+ SWAPAREA (rCirc.F);
+ SWAPPOINT(rCirc.Radius);
+ SWAPPOINT(rCirc.Center);
+ rCirc.DrehWink =SWAPSHORT(rCirc.DrehWink );
+ rCirc.StartWink=SWAPSHORT(rCirc.StartWink);
+ rCirc.RelWink =SWAPSHORT(rCirc.RelWink );
+#endif
+ return rInp;
+}
+SvStream& operator>>(SvStream& rInp, TextType& rText)
+{
+ rInp.Read((char*)&rText.Last,TextSize);
+#if defined __BIGENDIAN
+ SWAPOBJK (rText);
+ SWAPTEXT (rText.T);
+ SWAPPOINT(rText.Pos1);
+ SWAPPOINT(rText.Pos2);
+ rText.TopOfs =SWAPSHORT(rText.TopOfs );
+ rText.DrehWink=SWAPSHORT(rText.DrehWink);
+ rText.BoxSlant=SWAPSHORT(rText.BoxSlant);
+ rText.BufSize =SWAPSHORT(rText.BufSize );
+ //rText.Buf =SWAPLONG (rText.Buf );
+ //rText.Ext =SWAPLONG (rText.Ext );
+ SWAPPOINT(rText.FitSize);
+ rText.FitBreit=SWAPSHORT(rText.FitBreit);
+#endif
+ rText.Buffer=NULL;
+ return rInp;
+}
+SvStream& operator>>(SvStream& rInp, BmapType& rBmap)
+{
+ rInp.Read((char*)&rBmap.Last,BmapSize);
+#if defined __BIGENDIAN
+ SWAPOBJK (rBmap);
+ SWAPAREA (rBmap.F);
+ SWAPPOINT(rBmap.Pos1);
+ SWAPPOINT(rBmap.Pos2);
+ rBmap.DrehWink=SWAPSHORT(rBmap.DrehWink);
+ rBmap.Slant =SWAPSHORT(rBmap.Slant );
+ SWAPPOINT(rBmap.PixSize);
+#endif
+ return rInp;
+}
+SvStream& operator>>(SvStream& rInp, GrupType& rGrup)
+{
+ rInp.Read((char*)&rGrup.Last,GrupSize);
+#if defined __BIGENDIAN
+ SWAPOBJK (rGrup);
+ rGrup.SbLo =SWAPSHORT(rGrup.SbLo );
+ rGrup.SbHi =SWAPSHORT(rGrup.SbHi );
+ rGrup.UpLo =SWAPSHORT(rGrup.UpLo );
+ rGrup.UpHi =SWAPSHORT(rGrup.UpHi );
+ rGrup.ChartSize=SWAPSHORT(rGrup.ChartSize);
+ rGrup.ChartPtr =SWAPLONG (rGrup.ChartPtr );
+#endif
+ return rInp;
+}
+
+
+
+/*************************************************************************
+|*
+|* Sgv2SvFarbe()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+#ifndef VCL
+Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts)
+{
+ UINT16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0;
+ BYTE nInt2=100-nInts;
+ switch(nFrb1 & 0x07) {
+ case 0: r1=0xFFFF; g1=0xFFFF; b1=0xFFFF; break;
+ case 1: r1=0xFFFF; g1=0xFFFF; break;
+ case 2: g1=0xFFFF; b1=0xFFFF; break;
+ case 3: g1=0xFFFF; break;
+ case 4: r1=0xFFFF; b1=0xFFFF; break;
+ case 5: r1=0xFFFF; break;
+ case 6: b1=0xFFFF; break;
+ case 7: break;
+ }
+ switch(nFrb2 & 0x07) {
+ case 0: r2=0xFFFF; g2=0xFFFF; b2=0xFFFF; break;
+ case 1: r2=0xFFFF; g2=0xFFFF; break;
+ case 2: g2=0xFFFF; b2=0xFFFF; break;
+ case 3: g2=0xFFFF; break;
+ case 4: r2=0xFFFF; b2=0xFFFF; break;
+ case 5: r2=0xFFFF; break;
+ case 6: b2=0xFFFF; break;
+ case 7: break;
+ }
+#else
+Color Sgv2SvFarbe(BYTE nFrb1, BYTE nFrb2, BYTE nInts)
+{
+ UINT16 r1=0,g1=0,b1=0,r2=0,g2=0,b2=0;
+ BYTE nInt2=100-nInts;
+ switch(nFrb1 & 0x07) {
+ case 0: r1=0xFF; g1=0xFF; b1=0xFF; break;
+ case 1: r1=0xFF; g1=0xFF; break;
+ case 2: g1=0xFF; b1=0xFF; break;
+ case 3: g1=0xFF; break;
+ case 4: r1=0xFF; b1=0xFF; break;
+ case 5: r1=0xFF; break;
+ case 6: b1=0xFF; break;
+ case 7: break;
+ }
+ switch(nFrb2 & 0x07) {
+ case 0: r2=0xFF; g2=0xFF; b2=0xFF; break;
+ case 1: r2=0xFF; g2=0xFF; break;
+ case 2: g2=0xFF; b2=0xFF; break;
+ case 3: g2=0xFF; break;
+ case 4: r2=0xFF; b2=0xFF; break;
+ case 5: r2=0xFF; break;
+ case 6: b2=0xFF; break;
+ case 7: break;
+ }
+#endif
+ r1=(UINT16)((UINT32)r1*nInts/100+(UINT32)r2*nInt2/100);
+ g1=(UINT16)((UINT32)g1*nInts/100+(UINT32)g2*nInt2/100);
+ b1=(UINT16)((UINT32)b1*nInts/100+(UINT32)b2*nInt2/100);
+ Color aColor(r1,g1,b1);
+ return aColor;
+}
+
+void SetLine(ObjLineType& rLine, OutputDevice& rOut)
+{
+/* !!!
+ PenStyle aStyle=PEN_SOLID;
+ switch(rLine.LMuster & 0x07) {
+ case 0: aStyle=PEN_NULL; break;
+ case 1: aStyle=PEN_SOLID; break;
+ case 2: aStyle=PEN_DOT; break; // ù ù ù ù ù ù ù ù ù ù ù ù ù ù
+ case 3: aStyle=PEN_DASH; break; // ÄÄ ÄÄ ÄÄ ÄÄ ÄÄ ÄÄ ÄÄ ÄÄ ÄÄ
+ case 4: aStyle=PEN_DASH; break; // ÄÄÄ ÄÄÄ ÄÄÄ ÄÄÄ ÄÄÄ ÄÄÄ ÄÄÄ
+ case 5: aStyle=PEN_DASHDOT; break; // ÄÄ ù ÄÄ ù ÄÄ ù ÄÄ ù ÄÄ ù ÄÄ
+ case 6: aStyle=PEN_DASHDOT; break; // ÄÄ Ä ÄÄ Ä ÄÄ Ä ÄÄ Ä ÄÄ Ä ÄÄ
+ case 7: aStyle=PEN_DASHDOT; break; // ÄÄÄ Ä Ä ÄÄÄ Ä Ä ÄÄÄ Ä Ä ÄÄÄ
+ }
+ Pen aPen(Sgv2SvFarbe(rLine.LFarbe,rLine.LBFarbe,rLine.LIntens),rLine.LDicke,aStyle);
+ SetPen(aPen,rOut);
+*/
+ if( 0 == ( rLine.LMuster & 0x07 ) )
+ rOut.SetLineColor();
+ else
+ rOut.SetLineColor( Sgv2SvFarbe(rLine.LFarbe,rLine.LBFarbe,rLine.LIntens) );
+}
+
+void SetArea(ObjAreaType& rArea, OutputDevice& rOut)
+{
+/*
+ BrushStyle aStyle=BRUSH_SOLID;
+ switch(rArea.FMuster & 0x00FF) {
+ case 0: aStyle=BRUSH_NULL; break;
+ case 1: aStyle=BRUSH_SOLID; break;
+ case 2: case 4: case 6: case 8:
+ case 10: case 12: case 14: case 16:
+ case 43: case 45: aStyle=BRUSH_VERT; break;
+ case 3: case 5: case 7: case 9:
+ case 11: case 13: case 15: case 17:
+ case 42: case 44: aStyle=BRUSH_HORZ; break;
+ case 18: case 20: case 22: case 24:
+ case 26: case 28: case 30: case 32:
+ case 46: case 48: aStyle=BRUSH_UPDIAG; break;
+ case 19: case 21: case 23: case 25:
+ case 27: case 29: case 31: case 33:
+ case 47: case 49: aStyle=BRUSH_DOWNDIAG; break;
+ case 34: case 35: case 36: case 37: aStyle=BRUSH_CROSS; break;
+ case 38: case 39: case 40: case 41: aStyle=BRUSH_DIAGCROSS; break;
+ default: aStyle=BRUSH_DIAGCROSS; break;
+ }
+ Brush aBrush(Sgv2SvFarbe(rArea.FFarbe,rArea.FBFarbe,rArea.FIntens),aStyle);
+ aBrush.SetTransparent((rArea.FMuster & 0x80) !=0L);
+ SetBrush(aBrush,rOut);
+*/
+ if( 0 == ( rArea.FMuster & 0x00FF ) )
+ rOut.SetFillColor();
+ else
+ rOut.SetFillColor( Sgv2SvFarbe( rArea.FFarbe,rArea.FBFarbe,rArea.FIntens ) );
+}
+
+/*************************************************************************
+|*
+|* ObjkType::DrawObjekt()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+void ObjkType::Draw(OutputDevice&)
+{
+// ShowSDObjk(*this);
+}
+
+void Obj0Type::Draw(OutputDevice&) {}
+
+/*************************************************************************
+|*
+|* StrkType::DrawObjekt()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+void StrkType::Draw(OutputDevice& rOut)
+{
+ SetLine(L,rOut);
+ rOut.DrawLine(Point(Pos1.x,Pos1.y),Point(Pos2.x,Pos2.y)); // !!!
+}
+
+/*************************************************************************
+|*
+|* RectType::DrawObjekt()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+void SgfAreaColorIntens(UINT16 Muster, BYTE Col1, BYTE Col2, BYTE Int, OutputDevice& rOut)
+{
+ ObjAreaType F;
+ F.FMuster=Muster;
+ F.FFarbe=Col2;
+ F.FBFarbe=Col1;
+ F.FIntens=Int;
+ SetArea(F,rOut);
+}
+
+void DrawSlideRect(INT16 x1, INT16 y1, INT16 x2, INT16 y2, ObjAreaType& F, OutputDevice& rOut)
+{
+ INT16 i,i0,b,b0;
+ INT16 Int1,Int2;
+ INT16 Col1,Col2;
+ // ClipMerk: HgdClipRec;
+ INT16 cx,cy;
+ INT16 MaxR;
+ INT32 dx,dy;
+
+ rOut.SetLineColor();
+ if (x1>x2) { i=x1; x1=x2; x2=i; }
+ if (y1>y2) { i=y1; y1=y2; y2=i; }
+ Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87;
+ Int1=100-F.FIntens; Int2=F.FIntens;
+ if (Int1==Int2) {
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ rOut.DrawRect(Rectangle(x1,y1,x2,y2));
+ } else {
+ b0=Int1;
+ switch (F.FBFarbe & 0x38) {
+ case 0x08: { // vertikal
+ i0=y1;
+ i=y1;
+ while (i<=y2) {
+ b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1));
+ if (b!=b0) {
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ rOut.DrawRect(Rectangle(x1,i0,x2,i-1));
+ i0=i; b0=b;
+ }
+ i++;
+ }
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ rOut.DrawRect(Rectangle(x1,i0,x2,y2));
+ } break;
+ case 0x28: { // horizontal
+ i0=x1;
+ i=x1;
+ while (i<=x2) {
+ b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1));
+ if (b!=b0) {
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ rOut.DrawRect(Rectangle(i0,y1,i-1,y2));
+ i0=i; b0=b;
+ }
+ i++;
+ }
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ rOut.DrawRect(Rectangle(i0,y1,x2,y2));
+ } break;
+
+ case 0x18: case 0x38: { // Kreis
+ Region ClipMerk=rOut.GetClipRegion();
+ double a;
+
+ rOut.SetClipRegion(Region(Rectangle(x1,y1,x2,y2)));
+ cx=(x1+x2) /2;
+ cy=(y1+y2) /2;
+ dx=x2-x1+1;
+ dy=y2-y1+1;
+ a=sqrt((double)(dx*dx+dy*dy));
+ MaxR=INT16(a) /2 +1;
+ b0=Int2;
+ i0=MaxR; if (MaxR<1) MaxR=1;
+ i=MaxR;
+ while (i>=0) {
+ b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR));
+ if (b!=b0) {
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ //if (i0>200 || (Col1 & $80)!=0 || (Col2 & $80)!=0) {
+ // then begin { Fallunterscheidung für etwas bessere Performance }
+ // s2:=i0-i+2;
+ // SetPenSize(s2);
+ // s2:=s2 div 2;
+ // Circle(cx,cy,i0-s2,i0-s2);{}
+ // else
+ rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
+ i0=i; b0=b;
+ }
+ i--;
+ }
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut);
+ rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
+ rOut.SetClipRegion(ClipMerk);
+ } break; // Kreis
+ }
+ }
+}
+
+
+void RectType::Draw(OutputDevice& rOut)
+{
+ if (L.LMuster!=0) L.LMuster=1; // keine Linienmuster hier, nur an oder aus
+ SetArea(F,rOut);
+ if (DrehWink==0) {
+ if ((F.FBFarbe & 0x38)==0 || Radius!=0) {
+ SetLine(L,rOut);
+ rOut.DrawRect(Rectangle(Pos1.x,Pos1.y,Pos2.x,Pos2.y),Radius,Radius);
+ } else {
+ DrawSlideRect(Pos1.x,Pos1.y,Pos2.x,Pos2.y,F,rOut);
+ if (L.LMuster!=0) {
+ SetLine(L,rOut);
+ rOut.SetFillColor();
+ rOut.DrawRect(Rectangle(Pos1.x,Pos1.y,Pos2.x,Pos2.y));
+ }
+ }
+ } else {
+ Point aPts[4];
+ USHORT i;
+ double sn,cs;
+ sn=sin(double(DrehWink)*3.14159265359/18000);
+ cs=cos(double(DrehWink)*3.14159265359/18000);
+ aPts[0]=Point(Pos1.x,Pos1.y);
+ aPts[1]=Point(Pos2.x,Pos1.y);
+ aPts[2]=Point(Pos2.x,Pos2.y);
+ aPts[3]=Point(Pos1.x,Pos2.y);
+ for (i=0;i<4;i++) {
+ RotatePoint(aPts[i],Pos1.x,Pos1.y,sn,cs);
+ }
+ SetLine(L,rOut);
+ Polygon aPoly(4,aPts);
+ rOut.DrawPolygon(aPoly);
+ }
+}
+
+/*************************************************************************
+|*
+|* PolyType::Draw()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+void PolyType::Draw(OutputDevice& rOut)
+{
+ if ((Flags & PolyClosBit) !=0) SetArea(F,rOut);
+ SetLine(L,rOut);
+ Polygon aPoly(nPoints);
+ USHORT i;
+ for(i=0;i<nPoints;i++) aPoly.SetPoint(Point(EckP[i].x,EckP[i].y),i);
+ if ((Flags & PolyClosBit) !=0) {
+ rOut.DrawPolygon(aPoly);
+ } else {
+ rOut.DrawPolyLine(aPoly);
+ }
+}
+
+/*************************************************************************
+|*
+|* SplnType::Draw()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+void SplnType::Draw(OutputDevice& rOut)
+{
+ if ((Flags & PolyClosBit) !=0) SetArea(F,rOut);
+ SetLine(L,rOut);
+ Polygon aPoly(0);
+ Polygon aSpln(nPoints);
+ USHORT i;
+ for(i=0;i<nPoints;i++) aSpln.SetPoint(Point(EckP[i].x,EckP[i].y),i);
+ if ((Flags & PolyClosBit) !=0) {
+ Spline2Poly(aSpln,TRUE,aPoly);
+ if (aPoly.GetSize()>0) rOut.DrawPolygon(aPoly);
+ } else {
+ Spline2Poly(aSpln,FALSE,aPoly);
+ if (aPoly.GetSize()>0) rOut.DrawPolyLine(aPoly);
+ }
+}
+
+/*************************************************************************
+|*
+|* CircType::Draw()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+void DrawSlideCirc(INT16 cx, INT16 cy, INT16 rx, INT16 ry, ObjAreaType& F, OutputDevice& rOut)
+{
+ INT16 x1=cx-rx;
+ INT16 y1=cy-ry;
+ INT16 x2=cx+rx;
+ INT16 y2=cy+ry;
+
+ INT16 i,i0,b,b0;
+ INT16 Int1,Int2;
+ INT16 Col1,Col2;
+
+ rOut.SetLineColor();
+ Col1=F.FBFarbe & 0x87; Col2=F.FFarbe & 0x87;
+ Int1=100-F.FIntens; Int2=F.FIntens;
+ if (Int1==Int2) {
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
+ } else {
+ b0=Int1;
+ switch (F.FBFarbe & 0x38) {
+ case 0x08: { // vertikal
+ Region ClipMerk=rOut.GetClipRegion();
+ i0=y1;
+ i=y1;
+ while (i<=y2) {
+ b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-y1) /(INT32)(y2-y1+1));
+ if (b!=b0) {
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ rOut.SetClipRegion(Rectangle(x1,i0,x2,i-1));
+ rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
+ i0=i; b0=b;
+ }
+ i++;
+ }
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ rOut.SetClipRegion(Rectangle(x1,i0,x2,y2));
+ rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
+ rOut.SetClipRegion(ClipMerk);
+ } break;
+ case 0x28: { // horizontal
+ Region ClipMerk=rOut.GetClipRegion();
+ i0=x1;
+ i=x1;
+ while (i<=x2) {
+ b=Int1+INT16((INT32)(Int2-Int1)*(INT32)(i-x1) /(INT32)(x2-x1+1));
+ if (b!=b0) {
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ rOut.SetClipRegion(Rectangle(i0,y1,i-1,y2));
+ rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
+ i0=i; b0=b;
+ }
+ i++;
+ }
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int2,rOut);
+ rOut.SetClipRegion(Rectangle(i0,y1,x2,y2));
+ rOut.DrawEllipse(Rectangle(x1,y1,x2,y2));
+ rOut.SetClipRegion(ClipMerk);
+ } break;
+
+ case 0x18: case 0x38: { // Kreis
+ INT16 MaxR;
+
+ if (rx<1) rx=1;
+ if (ry<1) ry=1;
+ MaxR=rx;
+ b0=Int2;
+ i0=MaxR; if (MaxR<1) MaxR=1;
+ i=MaxR;
+ while (i>=0) {
+ b=Int1+INT16((INT32(Int2-Int1)*INT32(i)) /INT32(MaxR));
+ if (b!=b0) {
+ INT32 temp=INT32(i0)*INT32(ry)/INT32(rx);
+ INT16 j0=INT16(temp);
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)b0,rOut);
+ rOut.DrawEllipse(Rectangle(cx-i0,cy-j0,cx+i0,cy+j0));
+ i0=i; b0=b;
+ }
+ i--;
+ }
+ SgfAreaColorIntens(F.FMuster,(BYTE)Col1,(BYTE)Col2,(BYTE)Int1,rOut);
+ rOut.DrawEllipse(Rectangle(cx-i0,cy-i0,cx+i0,cy+i0));
+ } break; // Kreis
+ }
+ }
+}
+
+
+void CircType::Draw(OutputDevice& rOut)
+{
+ Rectangle aRect(Center.x-Radius.x,Center.y-Radius.y,Center.x+Radius.x,Center.y+Radius.y);
+
+ if (L.LMuster!=0) L.LMuster=1; // keine Linienmuster hier, nur an oder aus
+ SetArea(F,rOut);
+ if ((Flags & 0x03)==CircFull) {
+ if ((F.FBFarbe & 0x38)==0) {
+ SetLine(L,rOut);
+ rOut.DrawEllipse(aRect);
+ } else {
+ DrawSlideCirc(Center.x,Center.y,Radius.x,Radius.y,F,rOut);
+ if (L.LMuster!=0) {
+ SetLine(L,rOut);
+ rOut.SetFillColor();
+ rOut.DrawEllipse(aRect);
+ }
+ }
+ } else {
+ PointType a,b;
+ Point aStrt,aEnde;
+ double sn,cs;
+
+ a.x=Center.x+Radius.x; a.y=Center.y; b=a;
+ sn=sin(double(StartWink)*3.14159265359/18000);
+ cs=cos(double(StartWink)*3.14159265359/18000);
+ RotatePoint(a,Center.x,Center.y,sn,cs);
+ sn=sin(double(StartWink+RelWink)*3.14159265359/18000);
+ cs=cos(double(StartWink+RelWink)*3.14159265359/18000);
+ RotatePoint(b,Center.x,Center.y,sn,cs);
+ if (Radius.x!=Radius.y) {
+ if (Radius.x<1) Radius.x=1;
+ if (Radius.y<1) Radius.y=1;
+ a.y-=Center.y;
+ b.y-=Center.y;
+ a.y=iMulDiv(a.y,Radius.y,Radius.x);
+ b.y=iMulDiv(b.y,Radius.y,Radius.x);
+ a.y+=Center.y;
+ b.y+=Center.y;
+ }
+ aStrt=Point(a.x,a.y);
+ aEnde=Point(b.x,b.y);
+ SetLine(L,rOut);
+ switch (Flags & 0x03) {
+ case CircArc : rOut.DrawArc(aRect,aEnde,aStrt); break;
+ case CircSect:
+ case CircAbsn: rOut.DrawPie(aRect,aEnde,aStrt); break;
+ }
+ }
+}
+
+/*************************************************************************
+|*
+|* BmapType::Draw()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+
+void BmapType::SetPaths(const INetURLObject rFltPath, const INetURLObject rCfgPath)
+{
+ aFltPath = rFltPath;
+ aCfgPath = rCfgPath;
+}
+
+void BmapType::Draw(OutputDevice& rOut)
+{
+ //ifstream aInp;
+ unsigned char nSgfTyp;
+ USHORT nVersion;
+ String aStr( Filename[ 1 ], (xub_StrLen)Filename[ 0 ], RTL_TEXTENCODING_UTF8 );
+ INetURLObject aFNam;
+ aFNam.SetSmartURL( aStr );
+ BOOL Ok = ImplDirEntryHelper::Exists( aFNam );
+ if (!Ok)
+ {
+ aStr = aFNam.GetName(); // Path weg, nur nach Namen suchen
+ aFNam.SetSmartURL( aStr );
+ Ok = ImplDirEntryHelper::Exists( aFNam );
+ }
+ SvFileStream aInp( aFNam.PathToFileName(), STREAM_READ );
+ if (Ok)
+ Ok=aInp.GetError() ? FALSE : TRUE;
+ if (Ok) {
+ nSgfTyp=CheckSgfTyp(aInp,nVersion);
+ switch(nSgfTyp) {
+ case SGF_BITIMAGE: {
+ GraphicFilter aFlt;
+ Graphic aGrf;
+ USHORT nRet;
+ aFlt.SetFilterPath(aFltPath);
+ aFlt.SetConfigPath(aCfgPath);
+ nRet=aFlt.ImportGraphic(aGrf,aFNam);
+ aGrf.Draw(&rOut,Point(Pos1.x,Pos1.y),Size(Pos2.x-Pos1.x,Pos2.y-Pos1.y));
+ } break;
+ case SGF_SIMPVECT: {
+ GDIMetaFile aMtf;
+ SgfVectXofs=Pos1.x;
+ SgfVectYofs=Pos1.y;
+ SgfVectXmul=Pos2.x-Pos1.x;
+ SgfVectYmul=Pos2.y-Pos1.y;
+ SgfVectXdiv=0;
+ SgfVectYdiv=0;
+ SgfVectScal=TRUE;
+ Ok=SgfVectFilter(aInp,aMtf);
+ SgfVectXofs=0;
+ SgfVectYofs=0;
+ SgfVectXmul=0;
+ SgfVectYmul=0;
+ SgfVectXdiv=0;
+ SgfVectYdiv=0;
+ SgfVectScal=FALSE;
+ aMtf.Play(&rOut);
+ } break;
+ }
+ }
+}
+
+
+/*************************************************************************
+|*
+|* GrupType::...
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+UINT32 GrupType::GetSubPtr()
+{
+ return UINT32(SbLo)+0x00010000*UINT32(SbHi);
+}
+
+/*************************************************************************
+|*
+|* DrawObjkList()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+void DrawObjkList(SvStream& rInp, OutputDevice& rOut, const INetURLObject& rFltPath, const INetURLObject& rCfgPath)
+{
+ ObjkType aObjk;
+ USHORT nGrpCnt=0;
+ BOOL bEnde=FALSE;
+ do {
+ rInp>>aObjk;
+ if (!rInp.GetError()) {
+ switch(aObjk.Art) {
+ case ObjStrk: { StrkType aStrk; rInp>>aStrk; if (!rInp.GetError()) aStrk.Draw(rOut); } break;
+ case ObjRect: { RectType aRect; rInp>>aRect; if (!rInp.GetError()) aRect.Draw(rOut); } break;
+ case ObjCirc: { CircType aCirc; rInp>>aCirc; if (!rInp.GetError()) aCirc.Draw(rOut); } break;
+ case ObjText: {
+ TextType aText;
+ rInp>>aText;
+ if (!rInp.GetError()) {
+ aText.Buffer=new UCHAR[aText.BufSize+1]; // Ein mehr für LookAhead bei CK-Trennung
+ rInp.Read((char* )aText.Buffer,aText.BufSize);
+ if (!rInp.GetError()) aText.Draw(rOut);
+ delete aText.Buffer;
+ }
+ } break;
+ case ObjBmap: {
+ BmapType aBmap;
+ rInp>>aBmap;
+ if (!rInp.GetError()) {
+ aBmap.SetPaths( rFltPath, rCfgPath );
+ aBmap.Draw(rOut);
+ }
+ } break;
+ case ObjPoly: {
+ PolyType aPoly;
+ rInp>>aPoly;
+ if (!rInp.GetError()) {
+ aPoly.EckP=new PointType[aPoly.nPoints];
+ rInp.Read((char*)aPoly.EckP,4*aPoly.nPoints);
+#if defined __BIGENDIAN
+ for(short i=0;i<aPoly.nPoints;i++) SWAPPOINT(aPoly.EckP[i]);
+#endif
+ if (!rInp.GetError()) aPoly.Draw(rOut);
+ delete aPoly.EckP;
+ }
+ } break;
+ case ObjSpln: {
+ SplnType aSpln;
+ rInp>>aSpln;
+ if (!rInp.GetError()) {
+ aSpln.EckP=new PointType[aSpln.nPoints];
+ rInp.Read((char*)aSpln.EckP,4*aSpln.nPoints);
+#if defined __BIGENDIAN
+ for(short i=0;i<aSpln.nPoints;i++) SWAPPOINT(aSpln.EckP[i]);
+#endif
+ if (!rInp.GetError()) aSpln.Draw(rOut);
+ delete aSpln.EckP;
+ }
+ } break;
+ case ObjGrup: {
+ GrupType aGrup;
+ rInp>>aGrup;
+ if (!rInp.GetError()) {
+ rInp.Seek(rInp.Tell()+aGrup.Last); // Obj-Anhängsel
+ if(aGrup.GetSubPtr()!=0L) nGrpCnt++;// DrawObjkList(rInp,rOut,rFltPath,rCfgPath);
+ }
+ } break;
+ default: {
+ aObjk.Draw(rOut); // Objektbezeichnung auf 2. Screen
+ ObjkOverSeek(rInp,aObjk); // zum nächsten Objekt
+ }
+ }
+ } // if rInp
+ if (!rInp.GetError()) {
+ if (aObjk.Next==0L) {
+ if (nGrpCnt==0) bEnde=TRUE;
+ else nGrpCnt--;
+ }
+ } else {
+ bEnde=TRUE; // Lesefehler
+ }
+ } while (!bEnde);
+}
+
+/*************************************************************************
+|*
+|* SkipObjkList()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+void SkipObjkList(SvStream& rInp)
+{
+ ObjkType aObjk;
+ do
+ {
+ rInp>>aObjk;
+ if(aObjk.Art==ObjGrup) {
+ GrupType aGrup;
+ rInp>>aGrup;
+ rInp.Seek(rInp.Tell()+aGrup.Last); // Obj-Anhängsel
+ if(aGrup.GetSubPtr()!=0L) SkipObjkList(rInp);
+ } else {
+ ObjkOverSeek(rInp,aObjk); // zum nächsten Objekt
+ }
+ } while (aObjk.Next!=0L && !rInp.GetError());
+}
+
+/*************************************************************************
+|*
+|* SgfFilterSDrw()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL SgfFilterSDrw(SvStream& rInp, SgfHeader&, SgfEntry&, GDIMetaFile& rMtf, const INetURLObject& rFltPath, const INetURLObject& rCfgPath)
+{
+ BOOL bRet = FALSE;
+ ObjkType aObjk;
+ PageType aPage;
+ VirtualDevice aOutDev;
+ OutputDevice* pOutDev;
+ ULONG nStdPos;
+ ULONG nZchPos;
+ USHORT Num;
+
+ pOutDev=&aOutDev;
+ DtHdOverSeek(rInp); // DataHeader weglesen
+
+ nStdPos=rInp.Tell();
+ do { // Standardseiten weglesen
+ rInp>>aPage;
+ if (aPage.nList!=0) SkipObjkList(rInp);
+ } while (aPage.Next!=0L && !rInp.GetError());
+
+// ShowMsg("Zeichnungseite(n)\n");
+ nZchPos=rInp.Tell();
+ rInp>>aPage;
+
+ rMtf.Record(pOutDev);
+ Num=aPage.StdPg;
+ if (Num!=0) {
+ rInp.Seek(nStdPos);
+ while(Num>1 && aPage.Next!=0L && !rInp.GetError()) { // Standardseite suchen
+ rInp>>aPage;
+ if (aPage.nList!=0) SkipObjkList(rInp);
+ Num--;
+ }
+ rInp>>aPage;
+ if(Num==1 && aPage.nList!=0L) DrawObjkList(rInp,*pOutDev,rFltPath,rCfgPath);
+ rInp.Seek(nZchPos);
+ nZchPos=rInp.Tell();
+ rInp>>aPage;
+ }
+ if (aPage.nList!=0L) DrawObjkList(rInp,*pOutDev,rFltPath,rCfgPath);
+
+ rMtf.Stop();
+ rMtf.WindStart();
+ MapMode aMap(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4));
+ rMtf.SetPrefMapMode(aMap);
+ rMtf.SetPrefSize(Size((INT16)aPage.Paper.Size.x,(INT16)aPage.Paper.Size.y));
+ bRet=TRUE;
+ return bRet;
+}
+
+
+
+/*************************************************************************
+|*
+|* SgfSDrwFilter()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL SgfSDrwFilter(SvStream& rInp, GDIMetaFile& rMtf, INetURLObject aIniPath, const INetURLObject& rFltPath, const INetURLObject& rCfgPath)
+{
+#ifdef DEBUG // Recordgrößen checken. Neuer Compiler hat vielleichte anderes Allignment!
+ if (sizeof(ObjTextType)!=ObjTextTypeSize) return FALSE;
+#endif
+
+ ULONG nFileStart; // Offset des SgfHeaders. Im allgemeinen 0.
+ SgfHeader aHead;
+ SgfEntry aEntr;
+ ULONG nNext;
+ BOOL bRdFlag=FALSE; // Grafikentry gelesen ?
+ BOOL bRet=FALSE; // Returncode
+
+ aIniPath.Append( String::CreateFromAscii( "sgf.ini", 7 ) );
+// aIniPath.ToAbs();
+
+ pSgfFonts = new SgfFontLst;
+
+ pSgfFonts->AssignFN( aIniPath.PathToFileName() );
+ nFileStart=rInp.Tell();
+ rInp>>aHead;
+ if (aHead.ChkMagic() && aHead.Typ==SgfStarDraw && aHead.Version==SGV_VERSION) {
+ nNext=aHead.GetOffset();
+ while (nNext && !bRdFlag && !rInp.GetError()) {
+ rInp.Seek(nFileStart+nNext);
+ rInp>>aEntr;
+ nNext=aEntr.GetOffset();
+ if (aEntr.Typ==aHead.Typ) {
+ bRet=SgfFilterSDrw(rInp,aHead,aEntr,rMtf,rFltPath,rCfgPath);
+ }
+ } // while(nNext)
+ if (bRdFlag) {
+ if (!rInp.GetError()) bRet=TRUE; // Scheinbar Ok
+ }
+ }
+ delete pSgfFonts;
+ return(bRet);
+}
+
+/*
+Bitmap Dither(BYTE Intens)
+{
+ Bitmap aBmp;
+ BmpInfoHeader Info;
+
+
+const dmatrix: array[0..7,0..7] of byte =
+ (( 0, 48, 12, 60, 3, 51, 15, 63 ),
+ ( 32, 16, 44, 28, 35, 19, 47, 31 ),
+ ( 8, 56, 4, 52, 11, 59, 7, 55 ),
+ ( 40, 24, 36, 20, 43, 27, 39, 23 ),
+ ( 2, 50, 14, 62, 1, 49, 13, 61 ),
+ ( 34, 18, 46, 30, 33, 17, 45, 29 ),
+ ( 10, 58, 6, 54, 9, 57, 5, 53 ),
+ ( 42, 26, 38, 22, 41, 25, 37, 21 ));
+
+
+ cmatrix: array[0..7,0..7] of byte;
+ dmatrixn,dmatrixi: array[0..7] of byte;
+
+
+procedure SetColorIntens(col0,col1,bal: integer);
+var cmatrix0: array[0..63] of byte absolute cmatrix;
+ dmatrix0: array[0..63] of byte absolute dmatrix;
+ n,i: integer;
+ b,bit: byte;
+begin
+if col0=col1 then bal:=0;
+if bal<=32 then
+ begin
+ plotcolor0:=col0 and $1F; plotcolor1:=col1 and $1F;
+ plotbal:=bal;
+ end
+else
+ begin
+ plotcolor0:=col1 and $1F; plotcolor1:=col0 and $1F;
+ plotbal:=64-bal;
+ end;
+for n:=0 to 63 do
+ if plotbal<=dmatrix0[n] then cmatrix0[n]:=col0 else cmatrix0[n]:=col1;
+end;
+*/
+
+#if defined( WIN ) && defined( MSC )
+#pragma code_seg( "svtools", "AUTO_CODE" )
+#endif
+
diff --git a/svtools/source/filter.vcl/filter/sgvspln.cxx b/svtools/source/filter.vcl/filter/sgvspln.cxx
new file mode 100644
index 000000000000..1934ca6091cb
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/sgvspln.cxx
@@ -0,0 +1,1115 @@
+/*************************************************************************
+ *
+ * $RCSfile: sgvspln.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef MAC
+#include <mac_start.h>
+#include <math.h>
+#include <mac_end.h>
+#else
+#include <math.h>
+#endif
+
+
+#ifndef _SV_POLY_HXX //autogen
+#include <vcl/poly.hxx>
+#endif
+
+#if defined( WIN ) && defined( MSC )
+#pragma code_seg( "SVTOOLS_FILTER2", "SVTOOLS_CODE" )
+#pragma optimize( "", off )
+#endif
+
+#if defined( PM2 ) && defined( __BORLANDC__ )
+#pragma option -Od
+#endif
+
+extern "C" {
+
+/*.pn 277 */
+/*.hlAnhang: C - Programme*/
+/*.hrKonstanten- und Macro-Definitionen*/
+/*.fe Die Include-Datei u_const.h ist in das Verzeichnis zu stellen, */
+/*.fe wo der Compiler nach Include-Dateien sucht. */
+
+
+/*----------------------- FILE u_const.h ---------------------------*/
+
+#ifndef S390
+#define IEEE
+#endif
+
+/* IEEE - Norm fuer die Darstellung von Gleitkommazahlen:
+
+ 8 Byte lange Gleitkommazahlen, mit
+
+ 53 Bit Mantisse ==> Mantissenbereich: 2 hoch 52 versch. Zahlen
+ mit 0.1 <= Zahl < 1.0,
+ 1 Vorzeichen-Bit
+ 11 Bit Exponent ==> Exponentenbereich: -1024...+1023
+
+ Die 1. Zeile ( #define IEEE ) ist zu loeschen, falls die Maschine
+ bzw. der Compiler keine Gleitpunktzahlen gemaess der IEEE-Norm
+ benutzt. Zusaetzlich muessen die Zahlen MAXEXPON, MINEXPON
+ (s.u.) angepasst werden.
+ */
+
+#ifdef IEEE /*----------- Falls IEEE Norm --------------------*/
+
+#define MACH_EPS 2.220446049250313e-016 /* Maschinengenauigkeit */
+ /* IBM-AT: = 2 hoch -52 */
+/* MACH_EPS ist die kleinste positive, auf der Maschine darstellbare
+ Zahl x, die der Bedingung genuegt: 1.0 + x > 1.0 */
+
+#define EPSQUAD 4.930380657631324e-032
+#define EPSROOT 1.490116119384766e-008
+
+#define POSMAX 8.98846567431158e+307 /* groesste positive Zahl */
+#define POSMIN 5.56268464626800e-309 /* kleinste positive Zahl */
+#define MAXROOT 9.48075190810918e+153
+
+#define BASIS 2 /* Basis der Zahlendarst. */
+#ifndef PI
+#define PI 3.141592653589793e+000
+#endif
+#define EXP_1 2.718281828459045e+000
+
+#else /*------------------ sonst -----------------------*/
+
+#ifndef S390
+double exp (double);
+double atan (double);
+double pow (double,double);
+double sqrt (double);
+#endif
+
+double masch() /* MACH_EPS maschinenunabhaengig bestimmen */
+{
+ double eps = 1.0, x = 2.0, y = 1.0;
+ while ( y < x )
+ { eps *= 0.5;
+ x = 1.0 + eps;
+ }
+ eps *= 2.0; return (eps);
+}
+
+short basis() /* BASIS maschinenunabhaengig bestimmen */
+{
+ double x = 1.0, one = 1.0, b = 1.0;
+
+ while ( (x + one) - x == one ) x *= 2.0;
+ while ( (x + b) == x ) b *= 2.0;
+
+ return ( (short) ((x + b) - x) );
+}
+
+#define BASIS basis() /* Basis der Zahlendarst. */
+
+/* Falls die Maschine (der Compiler) keine IEEE-Darstellung fuer
+ Gleitkommazahlen nutzt, muessen die folgenden 2 Konstanten an-
+ gepasst werden.
+ */
+
+#ifndef S390
+#define MAXEXPON 1023.0 /* groesster Exponent */
+#define MINEXPON -1024.0 /* kleinster Exponent */
+#else
+#include <float.h>
+#define MAXEXPON 75.0
+#define MINEXPON -79.0
+#endif
+
+
+#define MACH_EPS masch()
+#define EPSQUAD MACH_EPS * MACH_EPS
+#define EPSROOT sqrt(MACH_EPS)
+
+#define POSMAX pow ((double) BASIS, MAXEXPON)
+#define POSMIN pow ((double) BASIS, MINEXPON)
+#define MAXROOT sqrt(POSMAX)
+
+#define PI 4.0 * atan (1.0)
+#define EXP_1 exp(1.0)
+
+#endif /*-------------- ENDE ifdef ----------------------*/
+
+
+#define NEGMAX -POSMIN /* groesste negative Zahl */
+#define NEGMIN -POSMAX /* kleinste negative Zahl */
+
+#define TRUE 1
+#define FALSE 0
+
+
+/* Definition von Funktionsmakros:
+ */
+
+// #define min(X, Y) ((X) < (Y) ? (X) : (Y)) /* Minimum von X,Y */
+// #define max(X, Y) ((X) > (Y) ? (X) : (Y)) /* Maximum von X,Y */
+#define abs(X) ((X) >= 0 ? (X) : -(X)) /* Absolutbetrag von X */
+#define sign(X, Y) (Y < 0 ? -abs(X) : abs(X)) /* Vorzeichen von */
+ /* Y mal abs(X) */
+#define sqr(X) ((X) * (X)) /* Quadrat von X */
+
+/*------------------- ENDE FILE u_const.h --------------------------*/
+
+
+
+
+
+
+
+
+
+/*.HL Anhang: C - Programme*/
+/*.HRGleichungssysteme fr Tridiagonalmatrizen*/
+
+/*.FE P 3.7 TRIDIAGONALE GLEICHUNGSSYSTEME*/
+
+
+/*---------------------- MODUL TRIDIAGONAL ------------------------*/
+
+USHORT TriDiagGS(BOOL rep, USHORT n, double* lower,
+ double* diag, double* upper, double* b)
+ /************************/
+ /* GAUSS-Verfahren fuer */
+ /* Tridiagonalmatrizen */
+ /************************/
+
+/*====================================================================*/
+/* */
+/* trdiag bestimmt die Loesung x des linearen Gleichungssystems */
+/* A * x = b mit tridiagonaler n x n Koeffizientenmatrix A, die in */
+/* den 3 Vektoren lower, upper und diag wie folgt abgespeichert ist: */
+/* */
+/* ( diag[0] upper[0] 0 0 . . . 0 ) */
+/* ( lower[1] diag[1] upper[1] 0 . . . ) */
+/* ( 0 lower[2] diag[2] upper[2] 0 . ) */
+/* A = ( . 0 lower[3] . . . ) */
+/* ( . . . . . 0 ) */
+/* ( . . . . . ) */
+/* ( . . . upper[n-2] ) */
+/* ( 0 . . . 0 lower[n-1] diag[n-1] ) */
+/* */
+/*====================================================================*/
+/* */
+/* Anwendung: */
+/* ========= */
+/* Vorwiegend fuer diagonaldominante Tridiagonalmatrizen, wie */
+/* sie bei der Spline-Interpolation auftreten. */
+/* Fuer diagonaldominante Matrizen existiert immer eine LU- */
+/* Zerlegung; fuer nicht diagonaldominante Tridiagonalmatrizen */
+/* sollte die Funktion band vorgezogen werden, da diese mit */
+/* Spaltenpivotsuche arbeitet und daher numerisch stabiler ist. */
+/* */
+/*====================================================================*/
+/* */
+/* Eingabeparameter: */
+/* ================ */
+/* n Dimension der Matrix ( > 1 ) USHORT n */
+/* */
+/* lower untere Nebendiagonale double lower[n] */
+/* diag Hauptdiagonale double diag[n] */
+/* upper obere Nebendiagonale double upper[n] */
+/* */
+/* bei rep != 0 enthalten lower, diag und upper die */
+/* Dreieckzerlegung der Ausgangsmatrix. */
+/* */
+/* b rechte Seite des Systems double b[n] */
+/* rep = 0 erstmaliger Aufruf BOOL rep */
+/* !=0 wiederholter Aufruf */
+/* fuer gleiche Matrix, */
+/* aber verschiedenes b. */
+/* */
+/* Ausgabeparameter: */
+/* ================ */
+/* b Loesungsvektor des Systems; double b[n] */
+/* die urspruengliche rechte Seite wird ueberspeichert */
+/* */
+/* lower ) enthalten bei rep = 0 die Zerlegung der Matrix; */
+/* diag ) die urspruenglichen Werte von lower u. diag werden */
+/* upper ) ueberschrieben */
+/* */
+/* Die Determinante der Matrix ist bei rep = 0 durch */
+/* det A = diag[0] * ... * diag[n-1] bestimmt. */
+/* */
+/* Rueckgabewert: */
+/* ============= */
+/* = 0 alles ok */
+/* = 1 n < 2 gewaehlt */
+/* = 2 Die Dreieckzerlegung der Matrix existiert nicht */
+/* */
+/*====================================================================*/
+/* */
+/* Benutzte Funktionen: */
+/* =================== */
+/* */
+/* Aus der C Bibliothek: fabs() */
+/* */
+/*====================================================================*/
+
+/*.cp 5 */
+{
+ USHORT i;
+ short j;
+
+// double fabs(double);
+
+ if ( n < 2 ) return(1); /* n mindestens 2 */
+
+ /* Wenn rep = 0 ist, */
+ /* Dreieckzerlegung der */
+ if (rep == 0) /* Matrix u. det be- */
+ { /* stimmen */
+ for (i = 1; i < n; i++)
+ { if ( fabs(diag[i-1]) < MACH_EPS ) /* Wenn ein diag[i] = 0 */
+ return(2); /* ist, ex. keine Zerle- */
+ lower[i] /= diag[i-1]; /* gung. */
+ diag[i] -= lower[i] * upper[i-1];
+ }
+ }
+
+ if ( fabs(diag[n-1]) < MACH_EPS ) return(2);
+
+ for (i = 1; i < n; i++) /* Vorwaertselimination */
+ b[i] -= lower[i] * b[i-1];
+
+ b[n-1] /= diag[n-1]; /* Rueckwaertselimination */
+ for (j = n-2; j >= 0; j--) {
+ i=j;
+ b[i] = ( b[i] - upper[i] * b[i+1] ) / diag[i];
+ }
+ return(0);
+}
+
+/*----------------------- ENDE TRIDIAGONAL -------------------------*/
+
+
+
+
+
+
+
+
+
+/*.HL Anhang: C - Programme*/
+/*.HRGleichungssysteme mit zyklisch tridiagonalen Matrizen*/
+
+/*.FE P 3.8 SYSTEME MIT ZYKLISCHEN TRIDIAGONALMATRIZEN */
+
+
+/*---------------- MODUL ZYKLISCH TRIDIAGONAL ----------------------*/
+
+
+USHORT ZyklTriDiagGS(BOOL rep, USHORT n, double* lower, double* diag,
+ double* upper, double* lowrow, double* ricol, double* b)
+ /******************************/
+ /* Systeme mit zyklisch tri- */
+ /* diagonalen Matrizen */
+ /******************************/
+
+/*====================================================================*/
+/* */
+/* tzdiag bestimmt die Loesung x des linearen Gleichungssystems */
+/* A * x = b mit zyklisch tridiagonaler n x n Koeffizienten- */
+/* matrix A, die in den 5 Vektoren lower, upper, diag, lowrow und */
+/* ricol wie folgt abgespeichert ist: */
+/* */
+/* ( diag[0] upper[0] 0 0 . . 0 ricol[0] ) */
+/* ( lower[1] diag[1] upper[1] 0 . . 0 ) */
+/* ( 0 lower[2] diag[2] upper[2] 0 . ) */
+/* A = ( . 0 lower[3] . . . . ) */
+/* ( . . . . . 0 ) */
+/* ( . . . . . ) */
+/* ( 0 . . . upper[n-2] ) */
+/* ( lowrow[0] 0 . . 0 lower[n-1] diag[n-1] ) */
+/* */
+/* Speicherplatz fuer lowrow[1],..,lowrow[n-3] und ricol[1],..., */
+/* ricol[n-3] muss zusaetzlich bereitgestellt werden, da dieser */
+/* fuer die Aufnahme der Zerlegungsmatrix verfuegbar sein muss, die */
+/* auf die 5 genannten Vektoren ueberspeichert wird. */
+/* */
+/*====================================================================*/
+/* */
+/* Anwendung: */
+/* ========= */
+/* Vorwiegend fuer diagonaldominante zyklische Tridiagonalmatri- */
+/* zen wie sie bei der Spline-Interpolation auftreten. */
+/* Fuer diagonaldominante Matrizen existiert immer eine LU- */
+/* Zerlegung. */
+/* */
+/*====================================================================*/
+/* */
+/* Eingabeparameter: */
+/* ================ */
+/* n Dimension der Matrix ( > 2 ) USHORT n */
+/* lower untere Nebendiagonale double lower[n] */
+/* diag Hauptdiagonale double diag[n] */
+/* upper obere Nebendiagonale double upper[n] */
+/* b rechte Seite des Systems double b[n] */
+/* rep = 0 erstmaliger Aufruf BOOL rep */
+/* !=0 wiederholter Aufruf */
+/* fuer gleiche Matrix, */
+/* aber verschiedenes b. */
+/* */
+/* Ausgabeparameter: */
+/* ================ */
+/* b Loesungsvektor des Systems, double b[n] */
+/* die urspruengliche rechte Seite wird ueberspeichert */
+/* */
+/* lower ) enthalten bei rep = 0 die Zerlegung der Matrix; */
+/* diag ) die urspruenglichen Werte von lower u. diag werden */
+/* upper ) ueberschrieben */
+/* lowrow ) double lowrow[n-2] */
+/* ricol ) double ricol[n-2] */
+/* */
+/* Die Determinante der Matrix ist bei rep = 0 durch */
+/* det A = diag[0] * ... * diag[n-1] bestimmt. */
+/* */
+/* Rueckgabewert: */
+/* ============= */
+/* = 0 alles ok */
+/* = 1 n < 3 gewaehlt */
+/* = 2 Die Zerlegungsmatrix existiert nicht */
+/* */
+/*====================================================================*/
+/* */
+/* Benutzte Funktionen: */
+/* =================== */
+/* */
+/* Aus der C Bibliothek: fabs() */
+/* */
+/*====================================================================*/
+
+/*.cp 5 */
+{
+ double temp; // fabs(double);
+ USHORT i;
+ short j;
+
+ if ( n < 3 ) return(1);
+
+ if (rep == 0) /* Wenn rep = 0 ist, */
+ { /* Zerlegung der */
+ lower[0] = upper[n-1] = 0.0; /* Matrix berechnen. */
+
+ if ( fabs (diag[0]) < MACH_EPS ) return(2);
+ /* Ist ein Diagonalelement */
+ temp = 1.0 / diag[0]; /* betragsmaessig kleiner */
+ upper[0] *= temp; /* MACH_EPS, so ex. keine */
+ ricol[0] *= temp; /* Zerlegung. */
+
+ for (i = 1; i < n-2; i++)
+ { diag[i] -= lower[i] * upper[i-1];
+ if ( fabs(diag[i]) < MACH_EPS ) return(2);
+ temp = 1.0 / diag[i];
+ upper[i] *= temp;
+ ricol[i] = -lower[i] * ricol[i-1] * temp;
+ }
+
+ diag[n-2] -= lower[n-2] * upper[n-3];
+ if ( fabs(diag[n-2]) < MACH_EPS ) return(2);
+
+ for (i = 1; i < n-2; i++)
+ lowrow[i] = -lowrow[i-1] * upper[i-1];
+
+ lower[n-1] -= lowrow[n-3] * upper[n-3];
+ upper[n-2] = ( upper[n-2] - lower[n-2] * ricol[n-3] ) / diag[n-2];
+
+ for (temp = 0.0, i = 0; i < n-2; i++)
+ temp -= lowrow[i] * ricol[i];
+ diag[n-1] += temp - lower[n-1] * upper[n-2];
+
+ if ( fabs(diag[n-1]) < MACH_EPS ) return(2);
+ } /* end if ( rep == 0 ) */
+
+ b[0] /= diag[0]; /* Vorwaertselemination */
+ for (i = 1; i < n-1; i++)
+ b[i] = ( b[i] - b[i-1] * lower[i] ) / diag[i];
+
+ for (temp = 0.0, i = 0; i < n-2; i++)
+ temp -= lowrow[i] * b[i];
+
+ b[n-1] = ( b[n-1] + temp - lower[n-1] * b[n-2] ) / diag[n-1];
+
+ b[n-2] -= b[n-1] * upper[n-2]; /* Rueckwaertselimination */
+ for (j = n-3; j >= 0; j--) {
+ i=j;
+ b[i] -= upper[i] * b[i+1] + ricol[i] * b[n-1];
+ }
+ return(0);
+}
+
+/*------------------ ENDE ZYKLISCH TRIDIAGONAL ---------------------*/
+
+
+} // extern "C"
+
+
+/*************************************************************************
+|*
+|* NaturalSpline()
+|*
+|* Beschreibung Berechnet die Koeffizienten eines natrlichen
+|* kubischen Polynomsplines mit n Sttzstellen.
+|* Ersterstellung JOE 17-08.93
+|* Letzte Aenderung JOE 17-08.93
+|*
+*************************************************************************/
+
+USHORT NaturalSpline(USHORT n, double* x, double* y,
+ double Marg0, double MargN,
+ BYTE MargCond,
+ double* b, double* c, double* d)
+{
+ USHORT i;
+ double* a;
+ double* h;
+ USHORT error;
+
+ if (n<2) return 1;
+ if (MargCond<0 || MargCond>3) return 2;
+ a=new double[n+1];
+ h=new double[n+1];
+ for (i=0;i<n;i++) {
+ h[i]=x[i+1]-x[i];
+ if (h[i]<=0.0) { delete a; delete h; return 1; }
+ }
+ for (i=0;i<n-1;i++) {
+ a[i]=3.0*((y[i+2]-y[i+1])/h[i+1]-(y[i+1]-y[i])/h[i]);
+ b[i]=h[i];
+ c[i]=h[i+1];
+ d[i]=2.0*(h[i]+h[i+1]);
+ }
+ switch (MargCond) {
+ case 0: {
+ if (n==2) {
+ a[0]=a[0]/3.0;
+ d[0]=d[0]*0.5;
+ } else {
+ a[0] =a[0]*h[1]/(h[0]+h[1]);
+ a[n-2]=a[n-2]*h[n-2]/(h[n-1]+h[n-2]);
+ d[0] =d[0]-h[0];
+ d[n-2]=d[n-2]-h[n-1];
+ c[0] =c[0]-h[0];
+ b[n-2]=b[n-2]-h[n-1];
+ }
+ }
+ case 1: {
+ a[0] =a[0]-1.5*((y[1]-y[0])/h[0]-Marg0);
+ a[n-2]=a[n-2]-1.5*(MargN-(y[n]-y[n-1])/h[n-1]);
+ d[0] =d[0]-h[0]*0.5;
+ d[n-2]=d[n-2]-h[n-1]*0.5;
+ }
+ case 2: {
+ a[0] =a[0]-h[0]*Marg0*0.5;
+ a[n-2]=a[n-2]-h[n-1]*MargN*0.5;
+ }
+ case 3: {
+ a[0] =a[0]+Marg0*h[0]*h[0]*0.5;
+ a[n-2]=a[n-2]-MargN*h[n-1]*h[n-1]*0.5;
+ d[0] =d[0]+h[0];
+ d[n-2]=d[n-2]+h[n-1];
+ }
+ } // switch MargCond
+ if (n==2) {
+ c[1]=a[0]/d[0];
+ } else {
+ error=TriDiagGS(FALSE,n-1,b,d,c,a);
+ if (error!=0) { delete a; delete h; return error+2; }
+ for (i=0;i<n-1;i++) c[i+1]=a[i];
+ }
+ switch (MargCond) {
+ case 0: {
+ if (n==2) {
+ c[2]=c[1];
+ c[0]=c[1];
+ } else {
+ c[0]=c[1]+h[0]*(c[1]-c[2])/h[1];
+ c[n]=c[n-1]+h[n-1]*(c[n-1]-c[n-2])/h[n-2];
+ }
+ }
+ case 1: {
+ c[0]=1.5*((y[1]-y[0])/h[0]-Marg0);
+ c[0]=(c[0]-c[1]*h[0]*0.5)/h[0];
+ c[n]=1.5*((y[n]-y[n-1])/h[n-1]-MargN);
+ c[n]=(c[n]-c[n-1]*h[n-1]*0.5)/h[n-1];
+ }
+ case 2: {
+ c[0]=Marg0*0.5;
+ c[n]=MargN*0.5;
+ }
+ case 3: {
+ c[0]=c[1]-Marg0*h[0]*0.5;
+ c[n]=c[n-1]+MargN*h[n-1]*0.5;
+ }
+ } // switch MargCond
+ for (i=0;i<n;i++) {
+ b[i]=(y[i+1]-y[i])/h[i]-h[i]*(c[i+1]+2.0*c[i])/3.0;
+ d[i]=(c[i+1]-c[i])/(3.0*h[i]);
+ }
+ delete a;
+ delete h;
+ return 0;
+}
+
+
+/*************************************************************************
+|*
+|* PeriodicSpline()
+|*
+|* Beschreibung Berechnet die Koeffizienten eines periodischen
+|* kubischen Polynomsplines mit n Sttzstellen.
+|* Ersterstellung JOE 17-08.93
+|* Letzte Aenderung JOE 17-08.93
+|*
+*************************************************************************/
+
+
+USHORT PeriodicSpline(USHORT n, double* x, double* y,
+ double* b, double* c, double* d)
+{ // Arrays mssen von [0..n] dimensioniert sein!
+ USHORT Error;
+ USHORT i,im1,nm1; //integer
+ double hr,hl;
+ double* a;
+ double* lowrow;
+ double* ricol;
+
+ if (n<2) return 4;
+ nm1=n-1;
+ for (i=0;i<=nm1;i++) if (x[i+1]<=x[i]) return 2; // muá streng nonoton fallend sein!
+ if (y[n]!=y[0]) return 3; // Anfang muá gleich Ende sein!
+
+ a =new double[n+1];
+ lowrow=new double[n+1];
+ ricol =new double[n+1];
+
+ if (n==2) {
+ c[1]=3.0*((y[2]-y[1])/(x[2]-x[1]));
+ c[1]=c[1]-3.0*((y[i]-y[0])/(x[1]-x[0]));
+ c[1]=c[1]/(x[2]-x[0]);
+ c[2]=-c[1];
+ } else {
+ for (i=1;i<=nm1;i++) {
+ im1=i-1;
+ hl=x[i]-x[im1];
+ hr=x[i+1]-x[i];
+ b[im1]=hl;
+ d[im1]=2.0*(hl+hr);
+ c[im1]=hr;
+ a[im1]=3.0*((y[i+1]-y[i])/hr-(y[i]-y[im1])/hl);
+ }
+ hl=x[n]-x[nm1];
+ hr=x[1]-x[0];
+ b[nm1]=hl;
+ d[nm1]=2.0*(hl+hr);
+ lowrow[0]=hr;
+ ricol[0]=hr;
+ a[nm1]=3.0*((y[1]-y[0])/hr-(y[n]-y[nm1])/hl);
+ Error=ZyklTriDiagGS(FALSE,n,b,d,c,lowrow,ricol,a);
+ if (Error!=0) { delete a,lowrow,ricol; return(Error+4); }
+ for (i=0;i<=nm1;i++) c[i+1]=a[i];
+ }
+ c[0]=c[n];
+ for (i=0;i<=nm1;i++) {
+ hl=x[i+1]-x[i];
+ b[i]=(y[i+1]-y[i])/hl;
+ b[i]=b[i]-hl*(c[i+1]+2.0*c[i])/3.0;
+ d[i]=(c[i+1]-c[i])/hl/3.0;
+ }
+ delete a,lowrow,ricol;
+ return 0;
+}
+
+
+
+/*************************************************************************
+|*
+|* ParaSpline()
+|*
+|* Beschreibung Berechnet die Koeffizienten eines parametrischen
+|* natrlichen oder periodischen kubischen
+|* Polynomsplines mit n Sttzstellen.
+|* Ersterstellung JOE 17-08.93
+|* Letzte Aenderung JOE 17-08.93
+|*
+*************************************************************************/
+
+USHORT ParaSpline(USHORT n, double* x, double* y, BYTE MargCond,
+ double Marg01, double Marg02,
+ double MargN1, double MargN2,
+ BOOL CondT, double* T,
+ double* bx, double* cx, double* dx,
+ double* by, double* cy, double* dy)
+{
+ USHORT Error,Marg;
+ USHORT i;
+ double deltX,deltY,delt,
+ alphX,alphY,
+ betX,betY;
+
+ if (n<2) return 1;
+ if (MargCond<0 || MargCond>4) return 2; // ungltige Randbedingung
+ if (CondT==FALSE) {
+ T[0]=0.0;
+ for (i=0;i<n;i++) {
+ deltX=x[i+1]-x[i]; deltY=y[i+1]-y[i];
+ delt =deltX*deltX+deltY*deltY;
+ if (delt<=0.0) return 3; // zwei identische Punkte nacheinander!
+ T[i+1]=T[i]+sqrt(delt);
+ }
+ }
+ switch (MargCond) {
+ case 0: Marg=0; break;
+ case 1: case 2: {
+ Marg=MargCond;
+ alphX=Marg01; betX=MargN1;
+ alphY=Marg02; betY=MargN2;
+ } break;
+ case 3: {
+ if (x[n]!=x[0]) return 3;
+ if (y[n]!=y[0]) return 4;
+ } break;
+ case 4: {
+ Marg=1;
+ if (abs(Marg01)>=MAXROOT) {
+ alphX=0.0;
+ alphY=sign(1.0,y[1]-y[0]);
+ } else {
+ alphX=sign(sqrt(1.0/(1.0+Marg01*Marg01)),x[1]-x[0]);
+ alphY=alphX*Marg01;
+ }
+ if (abs(MargN1)>=MAXROOT) {
+ betX=0.0;
+ betY=sign(1.0,y[n]-y[n-1]);
+ } else {
+ betX=sign(sqrt(1.0/(1.0+MargN1*MargN1)),x[n]-x[n-1]);
+ betY=betX*MargN1;
+ }
+ }
+ } // switch MargCond
+ if (MargCond==3) {
+ Error=PeriodicSpline(n,T,x,bx,cx,dx);
+ if (Error!=0) return(Error+4);
+ Error=PeriodicSpline(n,T,y,by,cy,dy);
+ if (Error!=0) return(Error+10);
+ } else {
+ Error=NaturalSpline(n,T,x,alphX,betX,MargCond,bx,cx,dx);
+ if (Error!=0) return(Error+4);
+ Error=NaturalSpline(n,T,y,alphY,betY,MargCond,by,cy,dy);
+ if (Error!=0) return(Error+9);
+ }
+ return 0;
+}
+
+
+
+/*************************************************************************
+|*
+|* CalcSpline()
+|*
+|* Beschreibung Berechnet die Koeffizienten eines parametrischen
+|* natrlichen oder periodischen kubischen
+|* Polynomsplines. Die Eckpunkte des šbergebenen
+|* Polygons werden als Sttzstellen angenommen.
+|* n liefert die Anzahl der Teilpolynome.
+|* Ist die Berechnung fehlerfrei verlaufen, so
+|* liefert die Funktion TRUE. Nur in diesem Fall
+|* ist Speicher fr die Koeffizientenarrays
+|* allokiert, der dann sp„ter vom Aufrufer mittels
+|* delete freizugeben ist.
+|* Ersterstellung JOE 17-08.93
+|* Letzte Aenderung JOE 17-08.93
+|*
+*************************************************************************/
+
+BOOL CalcSpline(Polygon& rPoly, BOOL Periodic, USHORT& n,
+ double*& ax, double*& ay, double*& bx, double*& by,
+ double*& cx, double*& cy, double*& dx, double*& dy, double*& T)
+{
+ BYTE Marg;
+ double Marg01,Marg02;
+ double MargN1,MargN2;
+ USHORT i;
+ Point P0(-32768,-32768);
+ Point Pt;
+
+ n=rPoly.GetSize();
+ ax=new double[rPoly.GetSize()+2];
+ ay=new double[rPoly.GetSize()+2];
+
+ n=0;
+ for (i=0;i<rPoly.GetSize();i++) {
+ Pt=rPoly.GetPoint(i);
+ if (i==0 || Pt!=P0) {
+ ax[n]=Pt.X();
+ ay[n]=Pt.Y();
+ n++;
+ P0=Pt;
+ }
+ }
+
+ if (Periodic) {
+ Marg=3;
+ ax[n]=ax[0];
+ ay[n]=ay[0];
+ n++;
+ } else {
+ Marg=2;
+ }
+
+ bx=new double[n+1];
+ by=new double[n+1];
+ cx=new double[n+1];
+ cy=new double[n+1];
+ dx=new double[n+1];
+ dy=new double[n+1];
+ T =new double[n+1];
+
+ Marg01=0.0; Marg02=0.0;
+ MargN1=0.0; MargN2=0.0;
+ if (n>0) n--; // n Korregieren (Anzahl der Teilpolynome)
+
+ if ((Marg==3 && n>=3) || (Marg==2 && n>=2)) {
+ i=ParaSpline(n,ax,ay,Marg,Marg01,Marg01,MargN1,MargN2,FALSE,T,bx,cx,dx,by,cy,dy);
+ if (i==0) {
+ return TRUE;
+ } else {
+ delete ax,ay,bx,by,cx,cy,dx,dy,T;
+ n=0;
+ return FALSE;
+ }
+ } else {
+ delete ax,ay,bx,by,cx,cy,dx,dy,T;
+ n=0;
+ return FALSE;
+ }
+}
+
+
+/*************************************************************************
+|*
+|* Spline2Poly()
+|*
+|* Beschreibung Konvertiert einen parametrichen kubischen
+|* Polynomspline Spline (natrlich oder periodisch)
+|* in ein angen„hertes Polygon.
+|* Die Funktion liefert FALSE, wenn ein Fehler bei
+|* der Koeffizientenberechnung aufgetreten ist oder
+|* das Polygon zu groá wird (>PolyMax=16380). Im 1.
+|* Fall hat das Polygon 0, im 2. Fall PolyMax Punkte.
+|* Um Koordinatenberl„ufe zu vermeiden werden diese
+|* auf +/-32000 begrenzt.
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+BOOL Spline2Poly(Polygon& rSpln, BOOL Periodic, Polygon& rPoly)
+{
+ short MinKoord=-32000; // zur Vermeidung
+ short MaxKoord=32000; // von šberl„ufen
+
+ double* ax; // ¿
+ double* ay; // ³ Koeffizienten
+ double* bx; // ³ der Polynome
+ double* by; // ³
+ double* cx; // ³
+ double* cy; // ³
+ double* dx; // ³
+ double* dy; // ³
+ double* tv; // Ù
+
+ double Step; // Schrittweite fr t
+ double dt1,dt2,dt3; // Delta t, ý, ^3
+ double t;
+ BOOL bEnde; // Teilpolynom zu Ende?
+ USHORT n; // Anzahl der zu zeichnenden Teilpolynome
+ USHORT i; // aktuelles Teilpolynom
+ BOOL bOk; // noch alles ok?
+ USHORT PolyMax=16380;// Maximale Anzahl von Polygonpunkten
+ long x,y;
+
+ bOk=CalcSpline(rSpln,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv);
+ if (bOk) {
+ Step =10;
+
+ rPoly.SetSize(1);
+ rPoly.SetPoint(Point(short(ax[0]),short(ay[0])),0); // erster Punkt
+ i=0;
+ while (i<n) { // n Teilpolynome malen
+ t=tv[i]+Step;
+ bEnde=FALSE;
+ while (!bEnde) { // ein Teilpolynom interpolieren
+ bEnde=t>=tv[i+1];
+ if (bEnde) t=tv[i+1];
+ dt1=t-tv[i]; dt2=dt1*dt1; dt3=dt2*dt1;
+ x=long(ax[i]+bx[i]*dt1+cx[i]*dt2+dx[i]*dt3);
+ y=long(ay[i]+by[i]*dt1+cy[i]*dt2+dy[i]*dt3);
+ if (x<MinKoord) x=MinKoord; if (x>MaxKoord) x=MaxKoord;
+ if (y<MinKoord) y=MinKoord; if (y>MaxKoord) y=MaxKoord;
+ if (rPoly.GetSize()<PolyMax) {
+ rPoly.SetSize(rPoly.GetSize()+1);
+ rPoly.SetPoint(Point(short(x),short(y)),rPoly.GetSize()-1);
+ } else {
+ bOk=FALSE; // Fehler: Polygon wird zu groá
+ }
+ t=t+Step;
+ } // Ende von Teilpolynom
+ i++; // n„chstes Teilpolynom
+ }
+ delete ax,ay,bx,by,cx,cy,dx,dy,tv;
+ return bOk;
+ } // Ende von if (bOk)
+ rPoly.SetSize(0);
+ return FALSE;
+}
+
+
+
+
+
+
+
+
+
+/*************************************************************************
+|*
+|* CalcLine()
+|*
+|* Beschreibung Routine fr DrawSpline (s.u.).
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+/*void CalcLine(short x1, short y1,
+ short x2, short y2,
+ short hb, Polygon& rPoly)
+{
+ short dx,dy,dxp,dyp;
+ double l;
+
+ rPoly.SetSize(4);
+ dx=x2-x1;
+ dy=y2-y1;
+ l=sqrt(dx*dx+dy*dy);
+ if (l>0) {
+ dxp=short((long(dy)*long(hb))/l);
+ dyp=short((long(dx)*long(hb))/l);
+ rPoly.SetPoint(Point(x1-dxp,y1+dyp),0);
+ rPoly.SetPoint(Point(x1+dxp,y1-dyp),1);
+ rPoly.SetPoint(Point(x2+dxp,y2-dyp),2);
+ rPoly.SetPoint(Point(x2-dxp,y2+dyp),3);
+ } else {
+ rPoly.SetPoint(Point(x1,y1+hb),0);
+ rPoly.SetPoint(Point(x1,y1-hb),1);
+ rPoly.SetPoint(Point(x2,y2-hb),2);
+ rPoly.SetPoint(Point(x2,y2+hb),3);
+ }
+} */
+
+
+/*************************************************************************
+|*
+|* DrawSpline()
+|*
+|* Beschreibung Alte Routine. Dicke Linien werden mit Polys gemalt.
+|* Ersterstellung JOE 23.06.93
+|* Letzte Aenderung JOE 23.06.93
+|*
+*************************************************************************/
+/*
+BOOL DrawSpline(OutputDevice& rOut, Polygon& rPoly, BOOL Periodic)
+{
+ short MinKoord=-12000; // StarDraw-Definitionen
+ short MaxKoord=32000; // zur Vermeidung von šberl„ufen
+
+ double* ax; // ¿
+ double* ay; // ³ Koeffizienten
+ double* bx; // ³ der Polynome
+ double* by; // ³
+ double* cx; // ³
+ double* cy; // ³
+ double* dx; // ³
+ double* dy; // ³
+ double* tv; // Ù
+
+ double Step; // Schrittweite fr t
+ double dt1,dt2,dt3; // Delta t, ý, ^3
+ double t;
+ BOOL bEnde; // Teilpolynom zu Ende?
+ USHORT FHB; // Halbe Linienbreite in SGV
+ Point P10,P20; // letzter Punkt (Screen) fr Anschluá
+ Point P100,P200; // erster Punkt (Screen) zum Schlieáen des pSpline
+ BOOL bFirst; // erster Schrit des ersten Teilpolynoms?
+ BOOL bThin; // Strichst„rke 1 Pixel?
+ Polygon aFP(0); // fr gefllten Spline
+ Polygon aLP(4); // fr dicke Umrandung
+ BOOL bFill; // gefllter Spline?
+ BOOL bOutl; // umrandeter Spline?
+ USHORT n; // Anzahl der zu zeichnenden Teilpolynome
+ USHORT i; // aktuelles Teilpolynom
+ BOOL bOk; // noch alles ok?
+ USHORT StatA,StatB;
+ USHORT PolyMax=16384;// Maximale Anzahl von Polygonpunkten
+ Pen aPenMerk;
+ Brush aBrushMerk;
+ short x0,y0;
+ long x,y;
+
+ bOk=CalcSpline(rPoly,Periodic,n,ax,ay,bx,by,cx,cy,dx,dy,tv);
+ if (bOk) {
+ aPenMerk=rOut.GetPen();
+ aBrushMerk=rOut.GetFillInBrush();
+ bFill=rOut.GetFillInBrush().GetStyle()!=BRUSH_NULL && Periodic;
+ bOutl=rOut.GetPen().GetStyle()!=PEN_NULL;
+ FHB =rOut.GetPen().GetWidth() /2;
+ bThin=rOut.GetPen().GetWidth()<=1;
+ Step =10;
+
+ StatA=1; if (!bFill) StatA++;
+ StatB=2; if (!bOutl) StatB--;
+
+ while (StatA<=StatB) {
+ if (StatA==1) {
+ rOut.SetFillInBrush(aBrushMerk);
+ rOut.SetPen(Pen(PEN_NULL));
+ } else {
+ if (!bThin) {
+ rOut.SetFillInBrush(Brush(rOut.GetPen().GetColor()));
+ rOut.SetPen(Pen(PEN_NULL));
+ } else {
+ rOut.SetPen(aPenMerk);
+ }
+ }
+ bFirst=TRUE;
+
+ x0=short(ax[0]); y0=short(ay[0]); // erster Punkt
+ i=0;
+ while (i<n) { // n Teilpolynome malen
+ t=tv[i]+Step;
+ bEnde=FALSE;
+ while (!bEnde) { // ein Teilpolynom interpolieren
+ bEnde=t>=tv[i+1];
+ if (bEnde) t=tv[i+1];
+ dt1=t-tv[i]; dt2=dt1*dt1; dt3=dt2*dt1;
+ x=long(ax[i]+bx[i]*dt1+cx[i]*dt2+dx[i]*dt3);
+ y=long(ay[i]+by[i]*dt1+cy[i]*dt2+dy[i]*dt3);
+ if (x-FHB<MinKoord) x=MinKoord+FHB; if (x+FHB>MaxKoord) x=MaxKoord-FHB;
+ if (y-FHB<MinKoord) y=MinKoord+FHB; if (y+FHB>MaxKoord) y=MaxKoord-FHB;
+ if (StatA==1) { // Fl„che
+ if (aFP.GetSize()<PolyMax) {
+ aFP.SetSize(aFP.GetSize()+1);
+ aFP.SetPoint(Point(short(x),short(y)),aFP.GetSize()-1);
+ } else {
+ bOk=FALSE; // Fehler: Polygon wird zu groá
+ }
+ } else { // Umrandung
+ if (bThin) {
+ rOut.DrawLine(Point(x0,y0),Point(short(x),short(y)));
+ } else {
+ CalcLine(x0,y0,short(x),short(y),FHB,aLP);
+ rOut.DrawPolygon(aLP);
+ if (bFirst) {
+ P100=aLP.GetPoint(0); // fr pSpline merken
+ P200=aLP.GetPoint(1);
+ } else {
+ Polygon aMP(4);
+ aMP.SetPoint(P10,0);
+ aMP.SetPoint(P20,1);
+ aMP.SetPoint(aLP.GetPoint(1),2);
+ aMP.SetPoint(aLP.GetPoint(0),3);
+ rOut.DrawPolygon(aMP);
+ }
+ P10=aLP.GetPoint(3); // zum Fllen der M„useecken merken
+ P20=aLP.GetPoint(2);
+ } // Ende von Umrandung
+ } // Ende von if (StatA==1)
+ x0=short(x); y0=short(y); // die letzten Koordinaten merken
+ bFirst=FALSE;
+ t=t+Step;
+ } // Ende von Teilpolynom
+ i++; // n„chstes Teilpolynom
+ }
+ if (StatA==1) {
+ rOut.DrawPolygon(aFP);
+ } else {
+ if (!bThin && Periodic) { // nun die letzte M„useecke fllen
+ Polygon aMP(4);
+ aMP.SetPoint(aLP[3],1);
+ aMP.SetPoint(aLP[4],2);
+ aMP.SetPoint(P100,3);
+ aMP.SetPoint(P200,4);
+ rOut.DrawPolygon(aMP);
+ }
+ }
+ StatA++;
+ } // Ende von while (StatA<=StatB)
+ rOut.SetPen(aPenMerk);
+ rOut.SetFillInBrush(aBrushMerk);
+ delete ax,ay,bx,by,cx,cy,dx,dy,tv;
+ return TRUE;
+ } // Ende von if (bOk)
+ return FALSE;
+} */
+
+
+
+
diff --git a/svtools/source/filter.vcl/filter/sgvtext.cxx b/svtools/source/filter.vcl/filter/sgvtext.cxx
new file mode 100644
index 000000000000..67302778a8bc
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/sgvtext.cxx
@@ -0,0 +1,1370 @@
+/*************************************************************************
+ *
+ * $RCSfile: sgvtext.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef MAC
+#include <mac_start.h>
+#include <math.h>
+#include <mac_end.h>
+#else
+#include <math.h>
+#endif
+
+#include <vcl/config.hxx>
+#include <filter.hxx>
+#include "sgffilt.hxx"
+#include "sgfbram.hxx"
+#include "sgvmain.hxx"
+// #include "Debug.c"
+
+extern SgfFontLst* pSgfFonts;
+
+#if defined( WIN ) && defined( MSC )
+#pragma code_seg( "SVTOOLS_FILTER1", "SVTOOLS_CODE" )
+#endif
+
+#ifndef abs
+#define abs(x) ((x)<0 ? -(x) : (x))
+#endif
+
+
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// Einschränkungen: Schatten nur grau, 2D und mit fixem Abstand.
+//
+//
+//
+//
+////////////////////////////////////////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+// AbsBase.Pas
+
+// die folgenden Werte sind in % vom maximalen Schriftgrad der Zeile */
+#define UndlSpace 5 /* Untersteichungsabstand von der Baseline */
+#define UndlWidth 6 /* Untersteichungsdicke */
+#define UndlSpac2 7 /* Zwischenraum bei doppelter Unterstreichung */
+#define StrkSpace 25 /* Abstand der Durchstreichlinie von der Baseline*/
+#define StrkWidth 5 /* Durchstreichungsliniendicke */
+#define StrkSpac2 7 /* Zwischenraum bei doppelter Durchstreichung */
+#define OutlWidth 2 /* Strichstärke ist 2% vom Schriftgrad */
+
+// vvv Sonderzeichen im TextBuffer vvv
+#define TextEnd 0 /* ^@ Ende der Zeichenkette */
+#define HardSpace 6 /* ^F Hartspace (wird nicht umbrochen) ,' ' */
+#define GrafText 7 /* ^G Im Text eingebundene Grafik (future) */
+#define Tabulator 9 /* ^I Tabulatorzeichen, Pfeil */
+#define LineFeed 10 /* ^J Neue Zeile */
+#define SoftTrennK 11 /* ^K Zeichen für k-c-Austausch bei Trennung, 'k' */
+#define AbsatzEnd 13 /* ^M Neuer Absatz =CR */
+#define HardTrenn 16 /* ^P Hartes Trennzeichen (wird nicht umbrochen), '-' */
+#define SoftTrennAdd 19 /* ^S Zusatz-Zeichen Trennung von z.b."Schiff-fahrt" */
+#define Paragraf 21 /* ^U Zeichen welches für Paragraf-Zeichen */
+#define Escape 27 /* ^[ Escapesequenz einleiten */
+#define SoftTrenn 31 /* ^_ Weiches Trennzeichen, '-' nur Zeilenende */
+#define MaxEscValLen 8
+#define MaxEscLen (MaxEscValLen+3)
+
+//ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
+// Escapesequenzen: [Esc]<Ident><Value>[Esc] also mind. 4 Char
+// Max. Länge von Value soll sein: 8 Char (7+Vorzeichen). Demnach max. Länge
+// einer Escapesequenz: 11 Char.
+// Identifer:
+
+#define EscFont 'F' /* FontID, z.B. 92500 für CG Times */
+#define EscGrad 'G' /* Schriftgrad 1..255 für «Pt-127«Pt */
+#define EscBreit 'B' /* Breite 1..255% des Schriftgrades */
+#define EscKaptS 'K' /* Kapitälchengröße 1..255% des Schriftgrades */
+#define EscLFeed 'L' /* Zeilenabstand 1..32767% vom max. Schriftgrad der Zeile */
+ // oder 1..32767 für 1..16383«Pt absolut (Wenn Bit 15=1)
+#define EscSlant 'S' /* Kursiv(Winkel) 1..8999 für 0.01ø..89.99ø */
+#define EscVPos 'V' /* Zeichen Vertikal-Position 1..255 für «Pt..127«Pt */
+#define EscZAbst 'Z' /* Zeichenabstand -128..127% */
+#define EscHJust 'A' /* H-Justify Absatz: Links, Zentr, Rechts, Block, Austreibend, Gesperrt (0..5)*/
+
+#define EscFarbe 'C' /* Farbe 0..7 */
+#define EscBFarb 'U' /* BackFarbe 0..7 */
+#define EscInts 'I' /* Farbintensität 0..100% */
+#define EscMustr 'M' /* Muster 0..? inkl. Transp... */
+#define EscMFarb 'O' /* Musterfarbe 0..7 */
+#define EscMBFrb 'P' /* 2. Musterfarbe 0..7 */
+#define EscMInts 'W' /* Musterintensität 0..7 */
+
+#define EscSMstr 'E' /* Schattenmuster 0..? inkl. Transp... */
+#define EscSFarb 'R' /* Schattenfarbe 0..7 */
+#define EscSBFrb 'T' /* 2. Schattenfarbe 0..7 */
+#define EscSInts 'Q' /* Schattenintensität 0..7 */
+
+#define EscSXDst 'X' /* Schattenversatz X 0..100% */
+#define EscSYDst 'Y' /* Schattenversatz Y 0..100% */
+#define EscSDist 'D' /* Schattenversatz X-Y 0..100% */
+
+#define EscBold 'f' /* Fett // */
+#define EscLSlnt 'l' /* LKursiv // */
+#define EscRSlnt 'r' /* RKursiv // */
+#define EscUndln 'u' /* Unterstrichen // */
+#define EscDbUnd 'p' /* doppelt Unterstrichen // */
+#define EscKaptF 'k' /* Kapitälchenflag // */
+#define EscStrik 'd' /* Durchgestrichen // */
+#define EscDbStk 'e' /* doppelt Durchgestrichen // */
+#define EscSupSc 'h' /* Hochgestellt // */
+#define EscSubSc 't' /* Tiefgestellt // */
+#define Esc2DShd 's' /* 2D-Schatten // */
+#define Esc3DShd 'j' /* 3D-Schatten // */
+#define Esc4DShd 'i' /* 4D-Schatten // */
+#define EscEbShd 'b' /* Embossed // */
+
+// AllEscIdent =[EscFont, EscGrad, EscBreit,EscKaptS,EscLFeed,EscSlant,EscVPos, EscZAbst,EscHJust,
+// EscFarbe,EscBFarb,EscInts, EscMustr,EscMFarb,EscMBFrb,EscMInts,
+// EscSMstr,EscSFarb,EscSBFrb,EscSInts,EscSXDst,EscSYDst,EscSDist,
+// EscBold, EscLSlnt,EscRSlnt,EscUndln,EscDbUnd,EscKaptF,EscStrik,EscDbStk,
+// EscSupSc,EscSubSc,Esc2DShd,Esc3DShd,Esc4DShd];
+// Justify muß spätestens am Anfang des Absatzes stehen
+#define EscSet '' /* Flag setzen */
+#define EscReset '' /* Flag löschen */
+#define EscDeflt '' /* Flag auf default setzen */
+#define EscToggl '' /* Flag Toggeln */
+#define EscRelat '%'
+#define EscNoFlg 0
+#define EscNoVal -2147483647 /* -MaxLongInt */
+//ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
+#define NoTrenn 0xFFFF /* Wert für Parameter 'Rest' von GetTextChar(), wenn auf keinen Fall getrennt werden soll */
+#define DoTrenn 0xFFFE /* Wert für Parameter 'Rest' von GetTextChar(), wenn getrennt werden soll */
+
+#define MaxLineChars 1024
+
+#define ChrXPosArrSize (MaxLineChars+1+1) /* 2k - Beginnt mit 0 im gegensatz zu StarDraw */
+#define CharLineSize (MaxLineChars+1+1)
+#define EscStr (UCHAR[MaxEscLen+1]);
+
+#define MinChar 32
+#define MaxChar 255
+
+
+//ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
+
+#define DefaultCharWidth 4800
+#define GradDiv 2
+#define CharTopToBase 100 /* wegen Apostrophe und Umlaute mehr als 75% */
+#define CharTopToBtm 120 /* Zeilenhöhe ist größer als Schriftgrad */
+ // bei Avanti-Bold '' eigentlich sogar 130%
+
+// end of AbsBase.Pas
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+// DefBase.Pas
+
+#define TextBoldBit 0x0001 /* Fett */
+#define TextRSlnBit 0x0002 /* Kursiv */
+#define TextUndlBit 0x0004 /* Unterstrichen */
+#define TextStrkBit 0x0008 /* Durchgesteichen */
+#define TextSupSBit 0x0010 /* Hocgestellt */
+#define TextSubSBit 0x0020 /* Tiefgestellt */
+#define TextKaptBit 0x0040 /* Kapitälchen */
+#define TextLSlnBit 0x0080 /* Linkskursiv */
+#define TextDbUnBit 0x0100 /* Doppelt unterstrichen */
+#define TextDbStBit 0x0200 /* Doppelt durchgestrichen */
+#define TextSh2DBit 0x0400 /* 2D-Schatten 2.0 */
+#define TextSh3DBit 0x0800 /* 3D-Schatten 2.0 */
+#define TextSh4DBit 0x1000 /* 4D-Schatten 2.0 */
+#define TextShEbBit 0x2000 /* Embossed-Schatten 2.0 */
+#define FontAtrBits (TextBoldBit | TextRSlnBit)
+
+#define THJustLeft 0x00
+#define THJustCenter 0x01
+#define THJustRight 0x02
+#define THJustBlock 0x03
+#define THJustDrvOut 0x04 /* Austreibend Formatiert */
+#define THJustLocked 0x05 /* A l s S p e r r s c h r i f t */
+#define TVJustTop 0x00 /* Future */
+#define TVJustCenter 0x10 /* Future */
+#define TVJustBottom 0x20 /* Future */
+#define TVJustBlock 0x30 /* Future */
+
+#define MaxCharSlant 4200 /* Maximal 42ø kursiv ! */
+
+// end of DefBase.Pas
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+
+
+BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L);
+
+BOOL CheckTextOutl(ObjAreaType& F, ObjLineType& L)
+{
+ return (F.FIntens!=L.LIntens) ||
+ ((F.FFarbe!=L.LFarbe) && (F.FIntens>0)) ||
+ ((F.FBFarbe!=L.LBFarbe) && (F.FIntens<100));
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+// Misc.Pas
+
+short hPoint2Sgf(short a)
+{
+ long b;
+ b=long(a)*127*SgfDpmm/(144*5);
+ return short(b);
+}
+
+short Sgf2hPoint(short a)
+{
+ long b;
+ b=long(a)*5*144/(127*SgfDpmm);
+ return short(b);
+}
+
+// End of Misc.Pas
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+// AbsRead.Pas
+
+// ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+// ³ Function GetTopToBaseLine() Function GetBaseLineToBtm() ³
+// ³ ³
+// ³ Abstand von Zeilenoberkante bis BaseLine bzw. von BaseLine bis ³
+// ³ Unterkante berechnen. Alles in SGF-Units. ³
+// ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+
+USHORT GetTopToBaseLine(USHORT MaxGrad)
+{
+ long ret;
+ ret=long(MaxGrad)*long(CharTopToBase) /long(100);
+ return USHORT(ret);
+}
+
+// ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+// ³ Function GetTextChar() Function GetTextCharConv() ³
+// ³ ³
+// ³ Liest ein Zeichen aus dem Textbuffer, wertet dabei eventuell ³
+// ³ auftretende Escapesequenzen aus und setzt dementsprechend den ³
+// ³ Ein-/Ausgabeparameter AktAtr. Index wird entsprechend erhöht. ³
+// ³ Der Parameter Rest muß immer die Anzahl der Zeichen beinhalten, ³
+// ³ den angeforderten Zeichen in der aktuellen Zeile noch folgen. ³
+// ³ Ansonsten funktioniert die Silbentrennung nicht richtig. Gibt man ³
+// ³ stattdessen die Konstante NoTrenn an, wird in keinem Fall ³
+// ³ getrennt, die Konstante DoTrenn bewirkt dagegen, daß überall dort ³
+// ³ getrennt wird, wo ein SoftTrenner vorkommt. ³
+// ³ ³
+// ³ SoftTrenner werden immer in ein Minuszeichen konvertiert. ³
+// ³ GetTextCharConv() konvertiert zusätzlich HardSpace und AbsatzEnde ³
+// ³ in Spaces sowie HardTrenner in Minuszeichen. TextEnde wird immer ³
+// ³ als Char(0) geliefert. ³
+// ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+
+
+
+UCHAR ConvertTextChar(UCHAR c)
+{
+ if (c<32) {
+ switch (c) {
+ case HardSpace : c=' '; break;
+ case AbsatzEnd : c=' '; break;
+ case SoftTrenn : c='-'; break;
+ case HardTrenn : c='-'; break;
+ case SoftTrennK : c='-'; break;
+ case SoftTrennAdd: c='-';
+ }
+ }
+ return c;
+}
+
+
+
+USHORT GetSchnittBit(UCHAR c)
+{
+ USHORT r=0;
+ switch (c) {
+ case EscBold : r=TextBoldBit; break;
+ case EscRSlnt: r=TextRSlnBit; break;
+ case EscUndln: r=TextUndlBit; break;
+ case EscStrik: r=TextStrkBit; break;
+ case EscDbUnd: r=TextDbUnBit; break;
+ case EscDbStk: r=TextDbStBit; break;
+ case EscSupSc: r=TextSupSBit; break;
+ case EscSubSc: r=TextSubSBit; break;
+ case EscKaptF: r=TextKaptBit; break;
+ case EscLSlnt: r=TextLSlnBit; break;
+ case Esc2DShd: r=TextSh2DBit; break;
+ case Esc3DShd: r=TextSh3DBit; break;
+ case Esc4DShd: r=TextSh4DBit; break;
+ case EscEbShd: r=TextShEbBit;
+ }
+ return r;
+}
+
+
+
+long ChgValue(long Def, long Min, long Max, UCHAR FlgVal, long NumVal)
+{
+ long r=0;
+
+ if (FlgVal==EscDeflt) {
+ r=Def; // zurück auf Default
+ } else {
+ if (NumVal!=EscNoVal) r=NumVal; // Hart setzen
+ }
+
+ if (Min!=0 || Max!=0) {
+ if (r>Max) r=Max;
+ if (r<Min) r=Min;
+ }
+ return r;
+}
+
+
+
+void ChgSchnittBit(USHORT Bit, USHORT Radio1, USHORT Radio2, USHORT Radio3,
+ UCHAR FlgVal, USHORT Schnitt0, USHORT& Schnitt)
+{
+ USHORT All,Rad;
+
+ Rad=Radio1 | Radio2 | Radio3;
+ All=Bit | Rad;
+
+ switch (FlgVal) {
+ case EscSet : Schnitt=(Schnitt & ~All) | Bit; break;
+ case EscReset: Schnitt=(Schnitt & ~All); break;
+ case EscDeflt: Schnitt=(Schnitt & ~All) | (Schnitt0 & All); break;
+ case EscToggl: Schnitt=(Schnitt & ~Rad) ^ Bit;
+ }
+}
+
+
+
+UCHAR GetNextChar(UCHAR* TBuf, USHORT Index)
+{
+ USHORT Cnt;
+ while (TBuf[Index]==Escape) {
+ Index++;
+ Cnt=0;
+ while (TBuf[Index]!=Escape && Cnt<=MaxEscLen) {
+ Index++; Cnt++; }
+ Index++;
+ }
+ return TBuf[Index];
+}
+
+
+
+UCHAR ProcessOne(UCHAR* TBuf, USHORT& Index,
+ ObjTextType& Atr0, ObjTextType& AktAtr,
+ BOOL ScanEsc)
+{
+ UCHAR c;
+ UCHAR Ident;
+ BOOL Ende;
+ BOOL q;
+ UCHAR FlgVal;
+ long NumVal;
+ long Sgn;
+ short i;
+ BOOL EoVal;
+
+ do {
+ c=TBuf[Index]; Index++;
+ Ende=(c!=Escape);
+ if (Ende==FALSE) {
+ c=TBuf[Index]; Index++;
+ Ident=c; // Identifer merken
+ FlgVal=EscNoFlg;
+ NumVal=EscNoVal;
+ c=TBuf[Index]; Index++; // Hier fängt der Wert an
+ if (c==EscSet || c==EscReset || c==EscDeflt || c==EscToggl) FlgVal=c; else {
+ if (c=='-') Sgn=-1; else Sgn=1;
+ if (c=='+' || c=='-') { c=TBuf[Index]; Index++; }
+ i=MaxEscValLen;
+ NumVal=0;
+ do {
+ NumVal=10*NumVal+c-'0';
+ EoVal=(TBuf[Index]<'0' || TBuf[Index]>'9');
+ if (EoVal==FALSE) { c=TBuf[Index]; Index++; }
+ i--;
+ } while (i>0 && EoVal==FALSE);
+ NumVal=Sgn*NumVal;
+ }
+ q=!CheckTextOutl(AktAtr.F,AktAtr.L);
+
+ switch (Ident) {
+ case EscFont : AktAtr.SetFont(ULONG (ChgValue(Atr0.GetFont(),0,0 ,FlgVal,NumVal)));break;
+ case EscGrad : AktAtr.Grad =USHORT(ChgValue(Atr0.Grad, 2,2000 ,FlgVal,NumVal)); break;
+ case EscBreit: AktAtr.Breite =USHORT(ChgValue(Atr0.Breite, 1,1000 ,FlgVal,NumVal)); break;
+ case EscKaptS: AktAtr.Kapit =(BYTE)(ChgValue(Atr0.Kapit, 1,255 ,FlgVal,NumVal)); break;
+ case EscLFeed: AktAtr.LnFeed =USHORT(ChgValue(Atr0.LnFeed, 1,65535 ,FlgVal,NumVal)); break;
+ case EscSlant: AktAtr.Slant =USHORT(ChgValue(Atr0.Slant, 1,MaxCharSlant ,FlgVal,NumVal)); break;
+ case EscVPos : AktAtr.ChrVPos=char (ChgValue(Atr0.ChrVPos,-128,127 ,FlgVal,NumVal)); break;
+ case EscZAbst: AktAtr.ZAbst =(BYTE)(ChgValue(Atr0.ZAbst, 1,255 ,FlgVal,NumVal)); break;
+ case EscHJust: AktAtr.Justify=(BYTE)(ChgValue(Atr0.Justify & 0x0F,0,5 ,FlgVal,NumVal)); break;
+ case EscFarbe: { AktAtr.L.LFarbe =(BYTE)(ChgValue(Atr0.L.LFarbe,0,7 ,FlgVal,NumVal)); if (q) AktAtr.F.FFarbe =AktAtr.L.LFarbe; } break;
+ case EscBFarb: { AktAtr.L.LBFarbe=(BYTE)(ChgValue(Atr0.L.LBFarbe,0,255,FlgVal,NumVal)); if (q) AktAtr.F.FBFarbe=AktAtr.L.LBFarbe; } break;
+ case EscInts : { AktAtr.L.LIntens=(BYTE)(ChgValue(Atr0.L.LIntens,0,100,FlgVal,NumVal)); if (q) AktAtr.F.FIntens=AktAtr.L.LIntens; } break;
+
+ case EscMustr: { AktAtr.F.FMuster=USHORT(ChgValue(Atr0.F.FMuster,0,65535,FlgVal,NumVal)); } break;
+ case EscMFarb: { AktAtr.F.FFarbe =(BYTE)(ChgValue(Atr0.F.FFarbe,0,7 ,FlgVal,NumVal)); } break;
+ case EscMBFrb: { AktAtr.F.FBFarbe=(BYTE)(ChgValue(Atr0.F.FBFarbe,0,255,FlgVal,NumVal)); } break;
+ case EscMInts: { AktAtr.F.FIntens=(BYTE)(ChgValue(Atr0.F.FIntens,0,100,FlgVal,NumVal)); } break;
+
+ case EscSMstr: { AktAtr.ShdF.FMuster=USHORT(ChgValue(Atr0.ShdF.FMuster,0,65535,FlgVal,NumVal)); } break;
+ case EscSFarb: { AktAtr.ShdL.LFarbe =(BYTE)(ChgValue(Atr0.ShdL.LFarbe,0,7 ,FlgVal,NumVal)); AktAtr.ShdF.FFarbe =AktAtr.ShdL.LFarbe; } break;
+ case EscSBFrb: { AktAtr.ShdL.LBFarbe=(BYTE)(ChgValue(Atr0.ShdL.LBFarbe,0,255,FlgVal,NumVal)); AktAtr.ShdF.FBFarbe=AktAtr.ShdL.LBFarbe; } break;
+ case EscSInts: { AktAtr.ShdL.LIntens=(BYTE)(ChgValue(Atr0.ShdL.LIntens,0,100,FlgVal,NumVal)); AktAtr.ShdF.FIntens=AktAtr.ShdL.LIntens; } break;
+ case EscSDist: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); AktAtr.ShdVers.y=AktAtr.ShdVers.x; } break;
+ case EscSXDst: { AktAtr.ShdVers.x=(short)ChgValue(Atr0.ShdVers.x,0,30000,FlgVal,NumVal); } break;
+ case EscSYDst: { AktAtr.ShdVers.y=(short)ChgValue(Atr0.ShdVers.y,0,30000,FlgVal,NumVal); } break;
+
+ case EscBold : ChgSchnittBit(TextBoldBit,0,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscRSlnt: ChgSchnittBit(TextRSlnBit,TextLSlnBit,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscUndln: ChgSchnittBit(TextUndlBit,TextDbUnBit,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscStrik: ChgSchnittBit(TextStrkBit,TextDbStBit,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscDbUnd: ChgSchnittBit(TextDbUnBit,TextUndlBit,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscDbStk: ChgSchnittBit(TextDbStBit,TextStrkBit,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscSupSc: ChgSchnittBit(TextSupSBit,TextSubSBit,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscSubSc: ChgSchnittBit(TextSubSBit,TextSupSBit,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscKaptF: ChgSchnittBit(TextKaptBit,0,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscLSlnt: ChgSchnittBit(TextLSlnBit,TextRSlnBit,0,0 ,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case Esc2DShd: ChgSchnittBit(TextSh2DBit,TextSh3DBit,TextSh4DBit,TextShEbBit,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case Esc3DShd: ChgSchnittBit(TextSh3DBit,TextSh2DBit,TextSh4DBit,TextShEbBit,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case Esc4DShd: ChgSchnittBit(TextSh4DBit,TextSh2DBit,TextSh3DBit,TextShEbBit,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ case EscEbShd: ChgSchnittBit(TextShEbBit,TextSh2DBit,TextSh3DBit,TextSh4DBit,FlgVal,Atr0.Schnitt,AktAtr.Schnitt); break;
+ } //endcase
+ if (TBuf[Index]==Escape) Index++; // zweites Esc weglesen }
+ } // if Ende==FALSE
+ } while (Ende==FALSE && ScanEsc==FALSE);
+ if (Ende==FALSE) c=Escape;
+ return c;
+} // end of ProcessOne
+
+
+UCHAR GetTextChar(UCHAR* TBuf, USHORT& Index,
+ ObjTextType& Atr0, ObjTextType& AktAtr,
+ USHORT Rest, BOOL ScanEsc)
+{
+ UCHAR c,c0,nc;
+
+ c=ProcessOne(TBuf,Index,Atr0,AktAtr,ScanEsc);
+ if (ScanEsc==FALSE) {
+ if (c==SoftTrennAdd || c==SoftTrennK || c==SoftTrenn) {
+ nc=GetNextChar(TBuf,Index);
+ c0=c;
+ if (Rest==0 || Rest==DoTrenn ||
+ nc==' ' || nc==AbsatzEnd || nc==TextEnd) c='-';
+ else {
+ c=ProcessOne(TBuf,Index,Atr0,AktAtr,ScanEsc); // den Trenner überspringen
+ if (c0==SoftTrennAdd) {
+ if (c>=32) c=ProcessOne(TBuf,Index,Atr0,AktAtr,ScanEsc); // und hier noch 'nen Buchstaben überspringen
+ }
+ }
+ }
+ if ((Rest==1 || Rest==DoTrenn) && GetNextChar(TBuf,Index)==SoftTrennK) {
+ if (c=='c') c='k';
+ else if (c=='C') c='K';
+ }
+ }
+ return c;
+}
+
+ // HardSpace und HardTrenn müssen explizit konvertiert werden ! }
+ // if AktAtr.Schnitt and TextKaptBit =TextKaptBit then c:=UpCase(c);(explizit) }
+
+ // Bei der Trennmethode SoftTrennAdd wird davon ausgegangen, daß der zu }
+ // trennende Konsonant bereits 3x mal im TextBuf vorhanden ist, z.b.: }
+ // "Schiff-fahrt". Wenn nicht getrennt, dann wird "-f" entfernt. }
+
+
+
+UCHAR GetTextCharConv(UCHAR* TBuf, USHORT& Index,
+ ObjTextType& Atr0, ObjTextType& AktAtr,
+ USHORT Rest, BOOL ScanEsc)
+{
+ UCHAR c;
+
+ c=GetTextChar(TBuf,Index,Atr0,AktAtr,Rest,ScanEsc);
+ if (c<32) {
+ switch (c) {
+ case HardSpace : c=' '; break;
+ case AbsatzEnd : c=' '; break;
+ case HardTrenn : c='-';
+ }
+ }
+ return c;
+}
+
+
+// ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
+// ³ Function GetLineFeed() ³
+// ³ ³
+// ³ Benötigter Zeilenabstand in SGF-Units. ChrVPos wird berücksichtigt.³
+// ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
+USHORT GetLineFeed(UCHAR* TBuf, USHORT Index, ObjTextType Atr0, ObjTextType AktAtr,
+ USHORT nChar, USHORT& LF, USHORT& MaxGrad)
+{
+ UCHAR c=0;
+ BOOL AbsEnd=FALSE;
+ ULONG LF100=0;
+ ULONG MaxLF100=0;
+ BOOL LFauto=0;
+ BOOL First=TRUE;
+ USHORT Grad;
+ USHORT i=0;
+ USHORT r=1;
+
+ MaxGrad=0;
+ while (!AbsEnd && nChar>0) {
+ nChar--;
+ c=GetTextChar(TBuf,Index,Atr0,AktAtr,nChar,FALSE);
+ i++;
+ AbsEnd=(c==TextEnd || c==AbsatzEnd);
+ if (First || (!AbsEnd && c!=' ' && c!=HardTrenn)) {
+ LFauto=(AktAtr.LnFeed & 0x8000)==0;
+ LF100=AktAtr.LnFeed & 0x7FFF;
+ if (LFauto) LF100=LF100*AktAtr.Grad; else LF100*=LF100;
+ if (AktAtr.ChrVPos>0) LF100-=AktAtr.ChrVPos*100;
+ if (LF100>MaxLF100) MaxLF100=LF100;
+ Grad=AktAtr.Grad;
+ if (AktAtr.ChrVPos>0) Grad-=AktAtr.ChrVPos;
+ if (Grad>MaxGrad) MaxGrad=Grad;
+ First=FALSE;
+ }
+ if (!AbsEnd && c!=' ') r=i;
+ }
+ MaxGrad=hPoint2Sgf(MaxGrad);
+ if (MaxLF100<=4000) { // sonst Overflowgefahr
+ LF=USHORT(hPoint2Sgf(short(MaxLF100)) /100);
+ } else {
+ LF=USHORT(hPoint2Sgf(short(MaxLF100) /100));
+ }
+
+ return r;
+}
+
+// End of AbsRead.Pas
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+
+
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+// iFont.Pas
+
+#define DefaultSlant 1500 /* Default: Italic ist 15ø */
+#define SuperSubFact 60 /* SuperScript/SubScript: 60% vom Schriftgrad */
+#define DefaultSpace 40 /* Default: Space ist 40% vom SchriftGrad */
+
+USHORT SetTextContext(OutputDevice& rOut, ObjTextType& Atr, BOOL Kapt, USHORT Dreh,
+ USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv)
+{
+ SgfFontOne* pSgfFont; // Font aus dem IniFile
+ Font aFont;
+ Color aColor;
+ ULONG Grad;
+ ULONG Brei;
+ String FNam;
+ USHORT StdBrei=50; // Durchschnittliche Zeichenbreite in % von Schriftgrad
+ BOOL bFit=(FitXMul!=1 || FitXDiv!=1 || FitYMul!=1 || FitYDiv!=1);
+
+ pSgfFont = pSgfFonts->GetFontDesc(Atr.GetFont());
+
+ if ( pSgfFont!=NULL )
+ {
+ FNam =pSgfFont->SVFName;
+ StdBrei=pSgfFont->SVWidth;
+ if (pSgfFont->Fixd) aFont.SetPitch(PITCH_FIXED); else aFont.SetPitch(PITCH_VARIABLE);
+ aFont.SetFamily(pSgfFont->SVFamil);
+ aFont.SetCharSet(pSgfFont->SVChSet);
+ aFont.SetName(FNam);
+ }
+ else
+ { // Falls nich im Inifile, sind hier einige Fonts hart kodiert
+ aFont.SetPitch(PITCH_VARIABLE);
+ switch (Atr.GetFont()) {
+ case 92500: case 92501: case 92504: case 92505:
+ {
+#if defined(WIN) || defined(WNT) || defined(PM2)
+ FNam=String::CreateFromAscii( "Times New Roman" ); // CG Times ist unter Windows und OS/2 Times New Roman
+#else
+ FNam=String::CreateFromAscii( "Times" ); // ansonsten ist das einfach Times
+#endif
+ StdBrei=40;
+ aFont.SetFamily(FAMILY_ROMAN);
+ } break;
+ case 94021: case 94022: case 94023: case 94024: {
+#if defined(WIN) || defined(WNT)
+ FNam=String::CreateFromAscii( "Arial", 5 ); // Univers ist unter Windows Arial
+#else
+ FNam=String::CreateFromAscii( "Helvetica" ); // und ansonsten Helvetica
+#endif
+ aFont.SetFamily(FAMILY_SWISS);
+ StdBrei=47;
+ } break;
+ case 93950: case 93951: case 93952: case 93953: {
+#if defined(WIN) || defined(WNT)
+ FNam=String::CreateFromAscii( "Courier New" ); // Der Vector-Courierfont unter Windows heißt Courier New
+#else
+ FNam=String::CreateFromAscii( "Courier" ); // ansonsten ist und bleibt Courier immer Courier
+#endif
+ aFont.SetFamily(FAMILY_ROMAN);
+ aFont.SetPitch(PITCH_FIXED);
+ } break;
+ default: FNam=String::CreateFromAscii( "Helvetica", 9 );
+ }
+ aFont.SetName(FNam);
+ //aFont.SetCharSet(CHARSET_SYSTEM);
+ }
+
+ Grad=ULONG(Atr.Grad);
+ if ((Atr.Schnitt & TextKaptBit) !=0 && Kapt) Grad=Grad*ULONG(Atr.Kapit)/100;
+ if ((Atr.Schnitt & TextSupSBit) !=0 || (Atr.Schnitt & TextSubSBit) !=0) Grad=Grad*SuperSubFact/100;
+ Brei=Grad;
+ if (Atr.Breite!=100 || bFit) {
+ if (bFit) {
+ Grad=Grad*ULONG(FitYMul)/ULONG(FitYDiv);
+ Brei=Brei*ULONG(FitXMul)/ULONG(FitXDiv);
+ }
+ Brei=Brei*ULONG(Atr.Breite)/100;
+ Brei=Brei*ULONG(StdBrei)/100;
+ aFont.SetSize(Size(hPoint2Sgf(USHORT(Brei)),hPoint2Sgf(USHORT(Grad))));
+ } else {
+ aFont.SetSize(Size(0,hPoint2Sgf(USHORT(Grad))));
+ }
+
+ aColor=Sgv2SvFarbe(Atr.L.LFarbe,Atr.L.LBFarbe,Atr.L.LIntens); aFont.SetColor(aColor);
+ aColor=Sgv2SvFarbe(Atr.F.FFarbe,Atr.F.FBFarbe,Atr.F.FIntens); aFont.SetFillColor(aColor);
+ aFont.SetTransparent(TRUE);
+ aFont.SetAlign(ALIGN_BASELINE);
+
+ Dreh/=10; Dreh=3600-Dreh; if (Dreh==3600) Dreh=0;
+ aFont.SetOrientation(Dreh);
+
+ if ((Atr.Schnitt & TextBoldBit) !=0) aFont.SetWeight(WEIGHT_BOLD);
+ if ((Atr.Schnitt & TextRSlnBit) !=0) aFont.SetItalic(ITALIC_NORMAL);
+ if ((Atr.Schnitt & TextUndlBit) !=0) aFont.SetUnderline(UNDERLINE_SINGLE);
+ if ((Atr.Schnitt & TextDbUnBit) !=0) aFont.SetUnderline(UNDERLINE_DOUBLE);
+ if ((Atr.Schnitt & TextStrkBit) !=0) aFont.SetStrikeout(STRIKEOUT_SINGLE);
+ if ((Atr.Schnitt & TextDbStBit) !=0) aFont.SetStrikeout(STRIKEOUT_DOUBLE);
+ if ((Atr.Schnitt & TextSh2DBit) !=0) aFont.SetShadow(TRUE);
+ if ((Atr.Schnitt & TextSh3DBit) !=0) aFont.SetShadow(TRUE);
+ if ((Atr.Schnitt & TextSh4DBit) !=0) aFont.SetShadow(TRUE);
+ if ((Atr.Schnitt & TextShEbBit) !=0) aFont.SetShadow(TRUE);
+ if (CheckTextOutl(Atr.F,Atr.L)) aFont.SetOutline(TRUE);
+
+ if (aFont!=rOut.GetFont()) rOut.SetFont(aFont);
+
+ return 0;
+}
+
+// iFont.Pas
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+// Absatz.Pas
+
+struct ProcChrSta {
+ USHORT Index;
+ USHORT ChrXP;
+ UCHAR OutCh;
+ BOOL Kapt;
+ ObjTextType Attrib;
+};
+
+void InitProcessCharState(ProcChrSta& State, ObjTextType& AktAtr, USHORT IndexA)
+{
+ State.Attrib=AktAtr;
+ State.OutCh=0;
+ State.Index=IndexA;
+ State.ChrXP=0;
+ State.Kapt=FALSE;
+}
+
+BOOL UpcasePossible(UCHAR c)
+{
+ if ((c>='a' && c<='z') || c=='ä' || c=='ö' || c=='ü') return TRUE;
+ else return FALSE;
+}
+
+UCHAR Upcase(UCHAR c)
+{
+ if ((c>=(UCHAR)'a' && c<=(UCHAR)'z')) c=(c-(UCHAR)'a')+(UCHAR)'A';
+ else if (c==(UCHAR)'ä') c=(UCHAR)'Ä';
+ else if (c==(UCHAR)'ö') c=(UCHAR)'Ö';
+ else if (c==(UCHAR)'ü') c=(UCHAR)'Ü';
+ return c;
+}
+
+USHORT GetCharWidth(OutputDevice& rOut, UCHAR c)
+{
+ UCHAR c1;
+ USHORT ChrWidth;
+
+ c1 = ByteString::Convert((char)c,RTL_TEXTENCODING_IBM_437, gsl_getSystemTextEncoding() );
+ if (c==' ')
+ {
+ ChrWidth=(USHORT)rOut.GetTextWidth( String('A') );
+ if (rOut.GetFont().GetPitch()!=PITCH_FIXED) {
+ ChrWidth=MulDiv(ChrWidth,DefaultSpace,100);
+ }
+ } else {
+ if (c>=MinChar && c<=MaxChar) {
+ ChrWidth=(USHORT)rOut.GetTextWidth(String((char)c1));
+ } else {
+ ChrWidth=(USHORT)rOut.GetTextWidth(String('A'));
+ }
+ }
+ return ChrWidth;
+}
+
+UCHAR ProcessChar(OutputDevice& rOut, UCHAR* TBuf, ProcChrSta& R, ObjTextType& Atr0,
+ USHORT& nChars, USHORT Rest,
+ short* Line, UCHAR* cLine)
+{
+ USHORT KernDist=0; // Wert für Kerning
+ USHORT ChrWidth;
+ UCHAR c;
+ UCHAR c1;
+ BOOL AbsEnd;
+
+ c=GetTextChar(TBuf,R.Index,Atr0,R.Attrib,Rest,FALSE); // versucht evtl. zu trennen, wenn Rest entsprechenden Wert besitzt
+
+ AbsEnd=(c==AbsatzEnd || c==TextEnd);
+ if (AbsEnd==FALSE) {
+ R.OutCh=ConvertTextChar(c); // von HardTrenn nach '-', ...
+ R.Kapt=(R.Attrib.Schnitt & TextKaptBit) !=0 && UpcasePossible(R.OutCh);
+ if (R.Kapt) R.OutCh=Upcase(R.OutCh);
+ SetTextContext(rOut,R.Attrib,R.Kapt,0,1,1,1,1);
+
+ if (R.Kapt) c1=Upcase(c); else c1=c;
+ ChrWidth=GetCharWidth(rOut,c1);
+
+ if (R.Attrib.ZAbst!=100) { // Spezial-Zeichenabstand ?
+ ULONG Temp;
+ Temp=ULONG(ChrWidth)*ULONG(R.Attrib.ZAbst)/100;
+ ChrWidth=USHORT(Temp);
+ }
+ nChars++;
+ if (R.ChrXP>32000) R.ChrXP=32000;
+ Line[nChars]=R.ChrXP-KernDist;
+ cLine[nChars]=c;
+ R.ChrXP+=ChrWidth-KernDist; // Position für den nächsten Character
+ }
+ return c;
+}
+
+void FormatLine(UCHAR* TBuf, USHORT& Index, ObjTextType& Atr0, ObjTextType& AktAtr,
+ USHORT UmbWdt, USHORT AdjWdt,
+ short* Line, USHORT& nChars,
+ double rSn, double rCs,
+ UCHAR* cLine, BOOL TextFit)
+{
+ VirtualDevice vOut;
+ UCHAR c,c0;
+ UCHAR ct;
+ BOOL First; // erster Char ?
+ BYTE Just; // Absatzformatierung
+ BOOL Border; // Rand der Box erreicht ?
+ BOOL Border0;
+ BOOL AbsEnd; // Ende des Absatzes erreicht ?
+ ProcChrSta* R=new ProcChrSta;
+ ProcChrSta* R0=new ProcChrSta;
+ ProcChrSta* WErec=new ProcChrSta;
+ USHORT WEnChar;
+ ProcChrSta* WErec0=new ProcChrSta;
+ USHORT WEnChar0;
+ ProcChrSta* TRrec=new ProcChrSta;
+ USHORT TRnChar;
+
+ USHORT WordEndCnt; // Justieren und Trennen
+ BOOL WordEnd;
+ BOOL Trenn;
+
+ short BoxRest; // zum Quetschen und formatieren
+ USHORT i,j,k,h;
+ USHORT re,li;
+
+ vOut.SetMapMode(MapMode(MAP_10TH_MM,Point(),Fraction(1,4),Fraction(1,4)));
+
+ nChars=0;
+ SetTextContext(vOut,AktAtr,FALSE,0,1,1,1,1);
+ InitProcessCharState(*R,AktAtr,Index);
+ (*R0)=(*R); (*WErec)=(*R); WEnChar=0; c0=0; Border0=FALSE;
+ Border=FALSE; First=TRUE;
+ WordEndCnt=0;
+
+ do { // mal schauen, wieviele Worte so in die Zeile passen
+ if (Border) c=ProcessChar(vOut,TBuf,*R,Atr0,nChars,DoTrenn,Line,cLine);
+ else c=ProcessChar(vOut,TBuf,*R,Atr0,nChars,NoTrenn,Line,cLine);
+ AbsEnd=(c==AbsatzEnd || c==TextEnd);
+ //if not AbsEnd then
+ {
+ if (First) {
+ Just=R->Attrib.Justify & 0x0F; // Absatzformat steht wenn, dann am Anfang
+ }
+ Border=R->ChrXP>UmbWdt;
+ WordEnd=(AbsEnd || (c==' ')) && (c0!=' ') && (c0!=0);
+ Trenn=c=='-';
+ if (WordEnd && !Border0) {
+ WordEndCnt++;
+ (*WErec)=(*R0);
+ WEnChar=nChars-1;
+ }
+ if (Trenn && !Border) {
+ WordEndCnt++;
+ (*WErec)=(*R);
+ WEnChar=nChars;
+ }
+ }
+ (*R0)=(*R); c0=c;
+ Border0=Border;
+ First=FALSE;
+ AbsEnd=AbsEnd || (nChars>=MaxLineChars);
+ } while (!(AbsEnd || (Border && ((WordEndCnt>0) || WordEnd || Trenn))));
+
+ if (Border) { // Trennen und Quetschen
+ (*WErec0)=(*WErec); WEnChar0=WEnChar;
+ AbsEnd=FALSE; c0=0;
+ (*R)=(*WErec); nChars=WEnChar;
+ (*TRrec)=(*R); TRnChar=nChars;
+ Border0=FALSE; Border=FALSE;
+ do { // erst mal gucken wieviele Silben noch reinpassen
+ ct=ProcessChar(vOut,TBuf,*TRrec,Atr0,TRnChar,DoTrenn,Line,cLine);
+ c=ProcessChar(vOut,TBuf,*R,Atr0,nChars,NoTrenn,Line,cLine);
+ AbsEnd=(ct==AbsatzEnd) || (ct==TextEnd) || (nChars>=MaxLineChars);
+
+ Border=TRrec->ChrXP>UmbWdt;
+ WordEnd=AbsEnd || ((AbsEnd || (c==' ')) && (c0!=' ') && (c0!=0));
+ Trenn=ct=='-';
+ if (WordEnd && (!Border0 || (WordEndCnt==0))) {
+ WordEndCnt++;
+ (*WErec)=(*R0);
+ if (AbsEnd) WEnChar=nChars; else WEnChar=nChars-1;
+ (*TRrec)=(*R); TRnChar=nChars; // zum weitersuchen
+ }
+ if (Trenn && (!Border || (WordEndCnt==0))) {
+ WordEndCnt++; // merken, daß man hier trennen kann
+ (*WErec)=(*TRrec);
+ WEnChar=TRnChar;
+ (*TRrec)=(*R); TRnChar=nChars; // zum weitersuchen
+ }
+ (*R0)=(*R); c0=c;
+ Border0=Border;
+ Border=R->ChrXP>UmbWdt;
+ } while (!(AbsEnd || (Border && ((WordEndCnt>0) || WordEnd || Trenn))));
+
+ while (WErec0->Index<WErec->Index) { // damit Line[] auch garantiert stimmt }
+ c=ProcessChar(vOut,TBuf,*WErec0,Atr0,WEnChar0,WEnChar-WEnChar0-1,Line,cLine);
+ }
+
+ (*R)=(*WErec); nChars=WEnChar;
+
+ if (UmbWdt>=R->ChrXP) {
+ BoxRest=UmbWdt-R->ChrXP;
+ } else { // Zusammenquetschen
+ BoxRest=R->ChrXP-UmbWdt; // um soviel muß gequetscht werden
+ for (i=2;i<=nChars;i++) { // 1. CharPosition bleibt !
+ Line[i]-=(i-1)*(BoxRest) /(nChars-1);
+ }
+ R->ChrXP=UmbWdt;
+ Line[nChars+1]=UmbWdt;
+ }
+ }
+
+ if (!AbsEnd) {
+ do { // Leerzeichen weglesen
+ (*WErec)=(*R);
+ c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE);
+ nChars++;
+ Line[nChars]=R->ChrXP;
+ cLine[nChars]=c;
+ } while (c==' ');
+ if (c!=' ' && c!=AbsatzEnd && c!=TextEnd) {
+ nChars--;
+ (*R)=(*WErec);
+ }
+ }
+
+ if (AbsEnd && nChars<MaxLineChars) { // Ausrichten, statt Blocksatz aber linksbündig
+ if (Just==3) Just=0;
+ nChars++; Line[nChars]=R->ChrXP; // Damit AbsatzEnde auch weggelesen wird
+ Line[nChars+1]=R->ChrXP; // denn die Breite von CR oder #0 ist nun mal sehr klein
+ if (TBuf[R->Index-1]!=AbsatzEnd && TBuf[R->Index-1]!=TextEnd) {
+ c=GetTextChar(TBuf,R->Index,Atr0,R->Attrib,NoTrenn,FALSE); // Kleine Korrektur. Notig, wenn nur 1 Wort in
+ }
+ }
+
+ BoxRest=AdjWdt-R->ChrXP;
+ if (TextFit) Just=THJustLeft;
+
+ switch (Just) {
+ case THJustLeft: break; // Links
+ case THJustCenter: {
+ BoxRest=BoxRest /2; // Mitte
+ for (i=1;i<=nChars;i++) Line[i]+=BoxRest;
+ } break;
+ case THJustRight: { // Rechts
+ for (i=1;i<=nChars;i++) Line[i]+=BoxRest;
+ } break;
+ case THJustDrvOut:
+ case THJustBlock: { // Block und Austreibend
+ re=nChars;
+ if (Just==THJustDrvOut) re--;
+ while (re>=1 && (cLine[re]==' ' || cLine[re]==TextEnd || cLine[re]==AbsatzEnd)) re--;
+ li=1;
+ while (li<=re && (cLine[li]==' ' || cLine[li]==TextEnd || cLine[li]==AbsatzEnd)) li++;
+ if (Just==THJustDrvOut) BoxRest=AdjWdt-Line[re+1];
+
+ j=0; // Anzahl der Spaces ermitteln
+ for (i=li;i<=re;i++) {
+ if (cLine[i]==' ') {
+ j++;
+ }
+ }
+
+ if (j==0) { // nur 1 Wort ? -> Strecken !
+ for (i=li+1;i<=re;i++) { // von links nach rechts
+ Line[i]+=MulDiv(i-li,BoxRest,re-li+1-1);
+ }
+ } else {
+ k=0; h=0;
+ for (i=li;i<=re;i++) { // j Spaces aufbohren !
+ if (cLine[i]==' ') { // Space gefunden !
+ k++;
+ h=MulDiv(k,BoxRest,j);
+ }
+ Line[i]+=h;
+ }
+ }
+ for (i=re+1;i<=nChars;i++) Line[i]+=BoxRest; // und den Rest anpassen
+ Line[nChars+1]=AdjWdt;
+ } break;
+ case THJustLocked: { //Gesperrt
+ re=nChars-1;
+ while (re>=1 && (cLine[re]==' ' || cLine[re]==TextEnd || cLine[re]==AbsatzEnd)) re--;
+ li=1;
+ while (li<=re && (cLine[li]==' ' || cLine[li]==TextEnd || cLine[li]==AbsatzEnd)) li++;
+ BoxRest=AdjWdt-Line[re+1];
+ for (i=li+1;i<=re;i++) { // Strecken von links nach rechts
+ Line[i]+=MulDiv(i-li,BoxRest,re-li+1-1);
+ }
+ for (i=re+1;i<=nChars;i++) Line[i]+=BoxRest; // und den Rest anpassen
+ Line[nChars+1]=AdjWdt;
+ } break;
+ }
+ Index=R->Index;
+ AktAtr=R->Attrib;
+ delete R;
+ delete R0;
+ delete WErec;
+ delete WErec0;
+ delete TRrec;
+}
+
+
+
+// End of Absatz.Pas
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+// DrawText.Pas
+
+void DrawChar(OutputDevice& rOut, UCHAR c, ObjTextType T, PointType Pos, USHORT DrehWink,
+ USHORT FitXMul, USHORT FitXDiv, USHORT FitYMul, USHORT FitYDiv)
+{
+ SetTextContext(rOut,T,UpcasePossible(c),DrehWink,FitXMul,FitXDiv,FitYMul,FitYDiv);
+ if ((T.Schnitt & TextKaptBit)!=0 && UpcasePossible(c)) c=Upcase(c);
+ String s( (char)c, RTL_TEXTENCODING_IBM_437 );
+ rOut.DrawText( Point( Pos.x, Pos.y ), s );
+}
+
+/*************************************************************************
+|*
+|* TextType::Draw()
+|*
+|* Beschreibung
+|* Ersterstellung JOE 09.08.93
+|* Letzte Aenderung JOE 09.08.93
+|*
+*************************************************************************/
+void TextType::Draw(OutputDevice& rOut)
+{
+ if ((Flags & TextOutlBit)!=0) return; // Sourcetext für Outliner !!
+
+ ObjTextType T1,T2;
+ USHORT Index1;
+ USHORT Index2;
+ UCHAR c;
+ USHORT l; // Anzahl der Zeichen in der Zeile
+ USHORT i;
+ short yPos0;
+ short xPos;
+ short yPos;
+ USHORT LF;
+ USHORT MaxGrad;
+ short xSize;
+ short xSAdj;
+ short ySize;
+ double sn,cs;
+ USHORT TopToBase;
+ BOOL Ende;
+ USHORT lc;
+ BOOL LineFit; // FitSize.x=0? oder Flags -> jede Zeile stretchen
+ BOOL TextFit;
+ short* xLine;
+ UCHAR* cLine; // Buffer für FormatLine
+ USHORT FitXMul;
+ USHORT FitXDiv;
+ USHORT FitYMul;
+ USHORT FitYDiv;
+ BOOL Fehler;
+ UCHAR* Buf=Buffer; // Zeiger auf die Buchstaben
+
+ pSgfFonts->ReadList();
+ xLine=new short[ChrXPosArrSize];
+ cLine=new UCHAR[CharLineSize];
+
+ TextFit=(Flags & TextFitBits)!=0;
+ LineFit=FALSE;
+ LineFit=((Flags & TextFitZBit)!=0);
+ if (TextFit && FitSize.x==0) LineFit=TRUE;
+
+ if (DrehWink==0) {
+ sn=0.0;
+ cs=1.0;
+ } else {
+ sn=sin(double(DrehWink)*3.14159265359/18000);
+ cs=cos(double(DrehWink)*3.14159265359/18000);
+ }
+
+ T1=T; Index1=0; yPos=0; xPos=0;
+ if (TextFit) {
+ ySize=Pos2.y-Pos1.y;
+ xSize=32000 /2; // Umbruch
+ xSAdj=Pos2.x-Pos1.x; // zum Ausrichten bei Zentriert/Blocksatz
+ //if (xSize<=0) { xSize=32000 /2; LineFit=TRUE; }
+ FitXMul=abs(Pos2.x-Pos1.x); FitXDiv=FitSize.x; if (FitXDiv==0) FitXDiv=1;
+ FitYMul=abs(Pos2.y-Pos1.y); FitYDiv=FitSize.y; if (FitYDiv==0) FitYDiv=1;
+ } else {
+ xSize=Pos2.x-Pos1.x;
+ xSAdj=xSize;
+ ySize=Pos2.y-Pos1.y;
+ FitXMul=1; FitXDiv=1;
+ FitYMul=1; FitYDiv=1;
+ }
+ if (xSize<0) xSize=0;
+ if (xSAdj<0) xSAdj=0;
+
+ do {
+ T2=T1; Index2=Index1;
+ FormatLine(Buf,Index2,T,T2,xSize,xSAdj,xLine,l,sn,cs,cLine,LineFit);
+ Fehler=(Index2==Index1);
+ if (!Fehler) {
+ lc=GetLineFeed(Buf,Index1,T,T1,l,LF,MaxGrad);
+ if (TextFit) {
+ if (LineFit) FitXDiv=xLine[lc+1];
+ if (FitXDiv>0) {
+ long Temp;
+ for (i=1;i<=l+1;i++) {
+ Temp=long(xLine[i])*long(FitXMul) /long(FitXDiv);
+ xLine[i]=short(Temp);
+ }
+ LF=MulDiv(LF,FitYMul,FitYDiv);
+ MaxGrad=MulDiv(MaxGrad,FitYMul,FitYDiv);
+ } else {
+ FitXDiv=1; // 0 gibts nicht
+ }
+ }
+ yPos0=yPos;
+ TopToBase=GetTopToBaseLine(MaxGrad);
+ yPos+=TopToBase;
+ Ende=(yPos0+short(MulDiv(MaxGrad,CharTopToBtm,100))>ySize) && !TextFit;
+ if (!Ende) {
+ T2=T1; Index2=Index1;
+ i=1;
+ while (i<=l) {
+ c=GetTextCharConv(Buf,Index2,T,T2,l-i,FALSE);
+ long xp1,yp1; // wegen Overflowgefahr
+ PointType Pos;
+ xp1=long(Pos1.x)+xPos+long(xLine[i]);
+ yp1=long(Pos1.y)+yPos;
+ if (xp1>32000) xp1=32000; if (xp1<-12000) xp1=-12000;
+ if (yp1>32000) yp1=32000; if (yp1<-12000) yp1=-12000;
+ Pos.x=short(xp1);
+ Pos.y=short(yp1);
+
+ if (DrehWink!=0) RotatePoint(Pos,Pos1.x,Pos1.y,sn,cs);
+ DrawChar(rOut,c,T2,Pos,DrehWink,FitXMul,FitXDiv,FitYMul,FitYDiv);
+ i++;
+ } // while i<=l
+ yPos=yPos0+LF;
+ T1=T2; Index1=Index2; // Für die nächste Zeile
+ } // if ObjMin.y+yPos<=Obj_Max.y
+ } // if !Fehler
+ } while (c!=TextEnd && !Ende && !Fehler);
+ delete cLine;
+ delete xLine;
+}
+
+// End of DrawText.Pas
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+
+// nicht mehr benötigt, da der Pointer nun extra geführt wird
+// (DEC Alpha hat nämlich 64Bit-Pointer!)
+//UCHAR* TextType::GetBufPtr()
+//{
+// ULONG Temp;
+// Temp=ULONG(BufLo)+0x00010000*ULONG(BufHi);
+// return (UCHAR*)Temp;
+//}
+//
+//void TextType::SetBufPtr(UCHAR* Ptr)
+//{
+// ULONG Temp=(ULONG)Ptr;
+// BufLo=USHORT(Temp & 0x0000FFFF);
+// BufHi=USHORT((Temp & 0xFFFF0000)>>16);
+//}
+
+UINT32 ObjTextType::GetFont()
+{
+ return ULONG(FontLo)+0x00010000*ULONG(FontHi);
+}
+
+void ObjTextType::SetFont(UINT32 FontID)
+{
+ FontLo=USHORT(FontID & 0x0000FFFF);
+ FontHi=USHORT((FontID & 0xFFFF0000)>>16);
+}
+
+
+/////////////////////////////////////////////////////////////////////////////////
+// SGF.Ini lesen ////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////////////////////
+SgfFontOne::SgfFontOne()
+{
+ Next=NULL;
+ IFID=0;
+ Bold=FALSE;
+ Ital=FALSE;
+ Sans=FALSE;
+ Serf=FALSE;
+ Fixd=FALSE;
+ SVFamil=FAMILY_DONTKNOW;
+ SVChSet=RTL_TEXTENCODING_DONTKNOW;
+ SVWidth=40;
+}
+
+void SgfFontOne::ReadOne( ByteString& ID, ByteString& Dsc )
+{
+ USHORT i,j,n;
+ ByteString s;
+
+ if ( Dsc.Len() < 4 || ( Dsc.GetChar( 0 ) != '(' ) )
+ return;
+ i=1; // Erster Buchstabe des IF-Fontnamen. Davor ist eine '('
+ while ( i < Dsc.Len() && ( Dsc.GetChar( i ) !=')' ) )
+ i++;
+ Dsc.Erase(0,i+1); // IF-Fontname löschen inkl. ()
+
+ if ( Dsc.Len() < 2 || ( Dsc.GetChar( Dsc.Len() - 1 ) !=')' ) )
+ return;
+ i=Dsc.Len()-2; // hier ist die ')' des SV-Fontnames
+ j=0;
+ while ( i > 0 && ( Dsc.GetChar( i ) != '(' ) )
+ {
+ i--;
+ j++;
+ }
+ SVFName=String(Dsc,i+1,j); // SV-Fontname rausholen
+ Dsc.Erase(i,j);
+
+ IFID = (UINT32)ID.ToInt32();
+ n=Dsc.GetTokenCount(' ');
+ for (i=0;i<n;i++)
+ {
+ s = Dsc.GetToken( i,' ' );
+ if ( s.Len() )
+ {
+ s.ToUpperAscii();
+ if ( s.CompareTo( "BOLD", 4 ) == COMPARE_EQUAL ) Bold=TRUE;
+ else if ( s.CompareTo( "ITAL", 4 ) == COMPARE_EQUAL ) Ital=TRUE;
+ else if ( s.CompareTo( "SERF", 4 ) == COMPARE_EQUAL ) Serf=TRUE;
+ else if ( s.CompareTo( "SANS", 4 ) == COMPARE_EQUAL ) Sans=TRUE;
+ else if ( s.CompareTo( "FIXD", 4 ) == COMPARE_EQUAL ) Fixd=TRUE;
+ else if ( s.CompareTo( "ROMAN", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_ROMAN;
+ else if ( s.CompareTo( "SWISS", 5 ) == COMPARE_EQUAL ) SVFamil=FAMILY_SWISS;
+ else if ( s.CompareTo( "MODERN", 6 ) == COMPARE_EQUAL ) SVFamil=FAMILY_MODERN;
+ else if ( s.CompareTo( "SCRIPT", 6 ) == COMPARE_EQUAL ) SVFamil=FAMILY_SCRIPT;
+ else if ( s.CompareTo( "DECORA", 6 ) == COMPARE_EQUAL ) SVFamil=FAMILY_DECORATIVE;
+ else if ( s.CompareTo( "ANSI", 4 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_MS_1252;
+ else if ( s.CompareTo( "IBMPC", 5 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_IBM_850;
+ else if ( s.CompareTo( "MAC", 3 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_APPLE_ROMAN;
+ else if ( s.CompareTo( "SYMBOL", 6 ) == COMPARE_EQUAL ) SVChSet=RTL_TEXTENCODING_SYMBOL;
+ else if ( s.CompareTo( "SYSTEM", 6 ) == COMPARE_EQUAL ) SVChSet = gsl_getSystemTextEncoding();
+ else if ( s.IsNumericAscii() ) SVWidth=s.ToInt32();
+ }
+ }
+}
+
+/////////////////////////////////////////////////////////////////////////////////
+
+SgfFontLst::SgfFontLst()
+{
+ pList=NULL;
+ Last=NULL;
+ LastID=0;
+ LastLn=NULL;
+ Tried=FALSE;
+}
+
+SgfFontLst::~SgfFontLst()
+{
+ RausList();
+}
+
+void SgfFontLst::RausList()
+{
+ SgfFontOne* P;
+ SgfFontOne* P1;
+ P=pList;
+ while (P!=NULL) {
+ P1=P->Next;
+ delete P;
+ P=P1;
+ }
+ pList=NULL;
+ Last=NULL;
+ Tried=FALSE;
+ LastID=0;
+ LastLn=NULL;
+}
+
+void SgfFontLst::AssignFN(const String& rFName)
+{ FNam=rFName; }
+
+void SgfFontLst::ReadList()
+{
+ if (!Tried) {
+ Tried=TRUE;
+ LastID=0;
+ LastLn=NULL;
+ SgfFontOne* P,P1;
+ Config aCfg(FNam);
+ aCfg.SetGroup("SGV Fonts fuer StarView");
+ USHORT Anz=aCfg.GetKeyCount();
+ USHORT i;
+ ByteString FID,Dsc;
+
+ for (i=0;i<Anz;i++)
+ {
+ FID = aCfg.GetKeyName( i );
+ FID = FID.EraseAllChars(); // Leerzeichen weg
+ Dsc = aCfg.ReadKey( i );
+ if ( FID.IsNumericAscii() )
+ {
+ P=new SgfFontOne; // neuer Eintrag
+ if (Last!=NULL) Last->Next=P; else pList=P; Last=P; // einklinken
+ P->ReadOne(FID,Dsc); // und Zeile interpretieren
+ }
+ }
+ }
+}
+
+SgfFontOne* SgfFontLst::GetFontDesc(UINT32 ID)
+{
+ if (ID!=LastID) {
+ SgfFontOne* P;
+ P=pList;
+ while (P!=NULL && P->IFID!=ID) P=P->Next;
+ LastID=ID;
+ LastLn=P;
+ }
+ return LastLn;
+}
diff --git a/svtools/source/filter.vcl/filter/strings.hrc b/svtools/source/filter.vcl/filter/strings.hrc
new file mode 100644
index 000000000000..feee7a0eb9df
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/strings.hrc
@@ -0,0 +1,61 @@
+/*************************************************************************
+ *
+ * $RCSfile: strings.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "svtools.hrc"
diff --git a/svtools/source/filter.vcl/filter/strings.src b/svtools/source/filter.vcl/filter/strings.src
new file mode 100644
index 000000000000..7fd31d283077
--- /dev/null
+++ b/svtools/source/filter.vcl/filter/strings.src
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * $RCSfile: strings.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "strings.hrc"
+
+String EXPORT_DIALOG_TITLE
+{
+ Text = " Optionen" ;
+ Text [ ENGLISH ] = " options" ;
+ Text [ english_us ] = " Options" ;
+ Text [ italian ] = " Opzioni" ;
+ Text [ spanish ] = " Opciones" ;
+ Text [ french ] = "[_]Options" ;
+ Text [ dutch ] = " Opties" ;
+ Text [ swedish ] = " Alternativ" ;
+ Text [ danish ] = " Alternativer" ;
+ Text [ portuguese_brazilian ] = " Optionen" ;
+ Text [ portuguese ] = " Opções" ;
+ Text[ chinese_simplified ] = " Ñ¡Ïî";
+ Text[ russian ] = " Ïàðàìåòðû";
+ Text[ polish ] = " Opcje";
+ Text[ japanese ] = " µÌß¼®Ý";
+ Text[ chinese_traditional ] = " ¿ï¶µ";
+ Text[ arabic ] = " ÇáÎíÇÑÇÊ";
+ Text[ greek ] = " ÅðéëïãÝò";
+ Text[ korean ] = " ¿É¼Ç";
+ Text[ turkish ] = " Seçenekler";
+ Text[ language_user1 ] = " ";
+};
+
+String KEY_MODE
+{
+ Text = "-EXPORT-MODE" ;
+};
+
+String KEY_RES
+{
+ Text = "-EXPORT-RES" ;
+};
+
+String KEY_SIZEX
+{
+ Text = "-EXPORT-SIZEX" ;
+};
+
+String KEY_SIZEY
+{
+ Text = "-EXPORT-SIZEY" ;
+};
+
+String KEY_COLORS
+{
+ Text = "-COLORS" ;
+};
+
+String KEY_RLE_CODING
+{
+ Text = "-RLE_CODING" ;
+};
diff --git a/svtools/source/filter.vcl/igif/decode.cxx b/svtools/source/filter.vcl/igif/decode.cxx
new file mode 100644
index 000000000000..f7d9198d5bfa
--- /dev/null
+++ b/svtools/source/filter.vcl/igif/decode.cxx
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * $RCSfile: decode.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <tools/new.hxx>
+#include "decode.hxx"
+
+// ------------------------------------------------------------------------
+
+struct GIFLZWTableEntry
+{
+ GIFLZWTableEntry* pPrev;
+ GIFLZWTableEntry* pFirst;
+ BYTE nData;
+};
+
+// ------------------------------------------------------------------------
+
+GIFLZWDecompressor::GIFLZWDecompressor( BYTE cDataSize ) :
+ nDataSize ( cDataSize ),
+ bEOIFound ( FALSE ),
+ nOutBufDataLen ( 0 ),
+ nInputBitsBuf ( 0 ),
+ nInputBitsBufSize ( 0 )
+{
+ pTable = new GIFLZWTableEntry[ 4096 ];
+ pOutBuf = new BYTE[ 4096 ];
+
+ nClearCode = 1 << nDataSize;
+ nEOICode = nClearCode + 1;
+ nTableSize = nEOICode + 1;
+ nCodeSize = nDataSize + 1;
+ nOldCode = 0xffff;
+ pOutBufData = pOutBuf + 4096;
+
+ for( USHORT i = 0; i < nTableSize; i++ )
+ {
+ pTable[i].pPrev = NULL;
+ pTable[i].pFirst = pTable + i;
+ pTable[i].nData = (BYTE) i;
+ }
+}
+
+// ------------------------------------------------------------------------
+
+GIFLZWDecompressor::~GIFLZWDecompressor()
+{
+ delete[] pOutBuf;
+ delete[] pTable;
+}
+
+// ------------------------------------------------------------------------
+
+HPBYTE GIFLZWDecompressor::DecompressBlock( HPBYTE pSrc, BYTE cBufSize,
+ ULONG& rCount, BOOL& rEOI )
+{
+ ULONG nTargetSize = 4096;
+ ULONG nCount = 0;
+ HPBYTE pTarget = (HPBYTE) SvMemAlloc( nTargetSize );
+ HPBYTE pTmpTarget = pTarget;
+
+ nBlockBufSize = cBufSize;
+ nBlockBufPos = 0;
+ pBlockBuf = pSrc;
+
+ while( ProcessOneCode() )
+ {
+ nCount += nOutBufDataLen;
+
+ if( nCount > nTargetSize )
+ {
+ ULONG nNewSize = nTargetSize << 1;
+ ULONG nOffset = pTmpTarget - pTarget;
+ HPBYTE pTmp = (HPBYTE) SvMemAlloc( nNewSize );
+
+ HMEMCPY( pTmp, pTarget, nTargetSize );
+ SvMemFree( pTarget );
+
+ nTargetSize = nNewSize;
+ pTmpTarget = ( pTarget = pTmp ) + nOffset;
+ }
+
+ HMEMCPY( pTmpTarget, pOutBufData, nOutBufDataLen );
+ pTmpTarget += nOutBufDataLen;
+ pOutBufData += nOutBufDataLen;
+ nOutBufDataLen = 0;
+
+ if ( bEOIFound )
+ break;
+ }
+
+ rCount = nCount;
+ rEOI = bEOIFound;
+
+ return pTarget;
+}
+
+// ------------------------------------------------------------------------
+
+void GIFLZWDecompressor::AddToTable( USHORT nPrevCode, USHORT nCodeFirstData )
+{
+ GIFLZWTableEntry* pE;
+
+ if( nTableSize < 4096 )
+ {
+ pE = pTable + nTableSize;
+ pE->pPrev = pTable + nPrevCode;
+ pE->pFirst = pE->pPrev->pFirst;
+ pE->nData = pTable[ nCodeFirstData ].pFirst->nData;
+ nTableSize++;
+
+ if ( ( nTableSize == (USHORT) (1 << nCodeSize) ) && ( nTableSize < 4096 ) )
+ nCodeSize++;
+ }
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GIFLZWDecompressor::ProcessOneCode()
+{
+ GIFLZWTableEntry* pE;
+ USHORT nCode;
+ BOOL bRet = FALSE;
+ BOOL bEndOfBlock = FALSE;
+
+ while( nInputBitsBufSize < nCodeSize )
+ {
+ if( nBlockBufPos >= nBlockBufSize )
+ {
+ bEndOfBlock = TRUE;
+ break;
+ }
+
+ nInputBitsBuf |= ( (ULONG) pBlockBuf[ nBlockBufPos++ ] ) << nInputBitsBufSize;
+ nInputBitsBufSize += 8;
+ }
+
+ if ( !bEndOfBlock )
+ {
+ // Einen Code aus dem Eingabe-Buffer holen:
+ nCode = ( (USHORT) nInputBitsBuf ) & ( ~( 0xffff << nCodeSize ) );
+ nInputBitsBuf >>= nCodeSize;
+ nInputBitsBufSize -= nCodeSize;
+
+ if ( nCode < nClearCode )
+ {
+ if ( nOldCode != 0xffff )
+ AddToTable( nOldCode, nCode );
+ }
+ else if ( ( nCode > nEOICode ) && ( nCode <= nTableSize ) )
+ {
+ if ( nCode == nTableSize )
+ AddToTable( nOldCode, nOldCode );
+ else
+ AddToTable( nOldCode, nCode );
+ }
+ else
+ {
+ if ( nCode == nClearCode )
+ {
+ nTableSize = nEOICode + 1;
+ nCodeSize = nDataSize + 1;
+ nOldCode = 0xffff;
+ nOutBufDataLen = 0;
+ }
+ else
+ bEOIFound = TRUE;
+
+ return TRUE;
+ }
+
+ nOldCode = nCode;
+
+ // Zeichen(/-folge) des Codes nCode in den Ausgabe-Buffer schreiben:
+ pE = pTable + nCode;
+ do
+ {
+ nOutBufDataLen++;
+ *(--pOutBufData) = pE->nData;
+ pE = pE->pPrev;
+ }
+ while( pE );
+
+ bRet = TRUE;
+ }
+
+ return bRet;
+}
diff --git a/svtools/source/filter.vcl/igif/decode.hxx b/svtools/source/filter.vcl/igif/decode.hxx
new file mode 100644
index 000000000000..da5d06157533
--- /dev/null
+++ b/svtools/source/filter.vcl/igif/decode.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * $RCSfile: decode.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _DECODE_HXX
+#define _DECODE_HXX
+
+#ifndef _BMPACC_HXX
+#include <vcl/bmpacc.hxx>
+#endif
+
+struct GIFLZWTableEntry;
+
+class GIFLZWDecompressor
+{
+ GIFLZWTableEntry* pTable;
+ HPBYTE pOutBuf;
+ HPBYTE pOutBufData;
+ HPBYTE pBlockBuf;
+ ULONG nInputBitsBuf;
+ USHORT nTableSize;
+ USHORT nClearCode;
+ USHORT nEOICode;
+ USHORT nCodeSize;
+ USHORT nOldCode;
+ USHORT nOutBufDataLen;
+ USHORT nInputBitsBufSize;
+ BOOL bEOIFound;
+ BYTE nDataSize;
+ BYTE nBlockBufSize;
+ BYTE nBlockBufPos;
+
+ void AddToTable(USHORT nPrevCode, USHORT nCodeFirstData);
+ BOOL ProcessOneCode();
+
+
+public:
+
+ GIFLZWDecompressor( BYTE cDataSize );
+ ~GIFLZWDecompressor();
+
+ HPBYTE DecompressBlock( HPBYTE pSrc, BYTE cBufSize, ULONG& rCount, BOOL& rEOI );
+};
+
+#endif
diff --git a/svtools/source/filter.vcl/igif/gifread.cxx b/svtools/source/filter.vcl/igif/gifread.cxx
new file mode 100644
index 000000000000..b605173656ea
--- /dev/null
+++ b/svtools/source/filter.vcl/igif/gifread.cxx
@@ -0,0 +1,890 @@
+/*************************************************************************
+ *
+ * $RCSfile: gifread.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _GIFPRIVATE
+
+#include <tools/new.hxx>
+#include "decode.hxx"
+#include "gifread.hxx"
+
+// -----------
+// - Defines -
+// -----------
+
+#define NO_PENDING( rStm ) ( ( rStm ).GetError() != ERRCODE_IO_PENDING )
+
+// -------------
+// - GIFReader -
+// -------------
+
+GIFReader::GIFReader( SvStream& rStm, void* pCallData ) :
+ rIStm ( rStm ),
+ aGPalette ( 256 ),
+ aLPalette ( 256 ),
+ pAcc8 ( NULL ),
+ pAcc1 ( NULL ),
+ nLastPos ( rStm.Tell() ),
+ eActAction ( GLOBAL_HEADER_READING ),
+ bImGraphicReady ( FALSE ),
+ nLoops ( 1 ),
+ bGCTransparent ( FALSE ),
+ nLogWidth100 ( 0UL ),
+ nLogHeight100 ( 0UL )
+{
+ maUpperName = UniString::CreateFromAscii( "SVIGIF", 6 );
+ pSrcBuf = new BYTE[ 256 ];
+ ClearImageExtensions();
+}
+
+// ------------------------------------------------------------------------
+
+GIFReader::~GIFReader()
+{
+ aImGraphic.SetContext( NULL );
+
+ if( pAcc1 )
+ aBmp1.ReleaseAccess( pAcc1 );
+
+ if( pAcc8 )
+ aBmp8.ReleaseAccess( pAcc8 );
+
+ delete[] pSrcBuf;
+}
+
+// ------------------------------------------------------------------------
+
+void GIFReader::ClearImageExtensions()
+{
+ nGCDisposalMethod = 0;
+ bGCTransparent = FALSE;
+ nTimer = 0;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GIFReader::CreateBitmaps( long nWidth, long nHeight, BitmapPalette* pPal,
+ BOOL bWatchForBackgroundColor )
+{
+ const Size aSize( nWidth, nHeight );
+
+ if( bGCTransparent )
+ {
+ const Color aWhite( COL_WHITE );
+
+ aBmp1 = Bitmap( aSize, 1 );
+
+ if( !aAnimation.Count() )
+ aBmp1.Erase( aWhite );
+
+ pAcc1 = aBmp1.AcquireWriteAccess();
+
+ if( pAcc1 )
+ {
+ cTransIndex1 = (BYTE) pAcc1->GetBestPaletteIndex( aWhite );
+ cNonTransIndex1 = cTransIndex1 ? 0 : 1;
+ }
+ else
+ bStatus = FALSE;
+ }
+
+ if( bStatus )
+ {
+ aBmp8 = Bitmap( aSize, 8, pPal );
+
+ if( !!aBmp8 && bWatchForBackgroundColor && aAnimation.Count() )
+ aBmp8.Erase( (*pPal)[ nBackgroundColor ] );
+ else
+ aBmp8.Erase( Color( COL_WHITE ) );
+
+ pAcc8 = aBmp8.AcquireWriteAccess();
+ bStatus = ( pAcc8 != NULL );
+ }
+
+ return bStatus;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GIFReader::ReadGlobalHeader()
+{
+ char pBuf[ 7 ];
+ BYTE nRF;
+ BYTE nAspect;
+ BOOL bRet = FALSE;
+
+ rIStm.Read( pBuf, 6 );
+ if( NO_PENDING( rIStm ) )
+ {
+ pBuf[ 6 ] = 0;
+ if( !strcmp( pBuf, "GIF87a" ) || !strcmp( pBuf, "GIF89a" ) )
+ {
+ rIStm.Read( pBuf, 7 );
+ if( NO_PENDING( rIStm ) )
+ {
+ SvMemoryStream aMemStm;
+
+ aMemStm.SetBuffer( pBuf, 7, FALSE, 7 );
+ aMemStm >> nGlobalWidth;
+ aMemStm >> nGlobalHeight;
+ aMemStm >> nRF;
+ aMemStm >> nBackgroundColor;
+ aMemStm >> nAspect;
+
+ bGlobalPalette = (BOOL) ( nRF & 0x80 );
+
+ if( bGlobalPalette )
+ ReadPaletteEntries( &aGPalette, 1 << ( ( nRF & 7 ) + 1 ) );
+ else
+ nBackgroundColor = 0;
+
+ if( NO_PENDING( rIStm ) )
+ bRet = TRUE;
+ }
+ }
+ else
+ bStatus = FALSE;
+ }
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+
+void GIFReader::ReadPaletteEntries( BitmapPalette* pPal, ULONG nCount )
+{
+ const ULONG nLen = 3UL * nCount;
+ BYTE* pBuf = new BYTE[ nLen ];
+
+ rIStm.Read( pBuf, nLen );
+ if( NO_PENDING( rIStm ) )
+ {
+ BYTE* pTmp = pBuf;
+
+ for( ULONG i = 0UL; i < nCount; )
+ {
+ BitmapColor& rColor = (*pPal)[ (USHORT) i++ ];
+
+ rColor.SetRed( *pTmp++ );
+ rColor.SetGreen( *pTmp++ );
+ rColor.SetBlue( *pTmp++ );
+ }
+
+ // nach Moeglichkeit noch einige Standardfarben unterbringen
+ if( nCount < 256UL )
+ {
+ (*pPal)[ 255UL ] = Color( COL_WHITE );
+
+ if( nCount < 255UL )
+ (*pPal)[ 254UL ] = Color( COL_BLACK );
+ }
+ }
+
+ delete[] pBuf;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GIFReader::ReadExtension()
+{
+ BYTE cFunction;
+ BYTE cSize;
+ BYTE cByte;
+ BOOL bRet = FALSE;
+ BOOL bOverreadDataBlocks = FALSE;
+
+ // Extension-Label
+ rIStm >> cFunction;
+ if( NO_PENDING( rIStm ) )
+ {
+ // Block-Laenge
+ rIStm >> cSize;
+
+ switch( cFunction )
+ {
+ // 'Graphic Control Extension'
+ case( 0xf9 ) :
+ {
+ BYTE cFlags;
+
+ rIStm >> cFlags;
+ rIStm >> nTimer;
+ rIStm >> nGCTransparentIndex;
+ rIStm >> cByte;
+
+ if ( NO_PENDING( rIStm ) )
+ {
+ nGCDisposalMethod = ( cFlags >> 2) & 7;
+ bGCTransparent = ( cFlags & 1 ) ? TRUE : FALSE;
+ bStatus = ( cSize == 4 ) && ( cByte == 0 );
+ bRet = TRUE;
+ }
+ }
+ break;
+
+ // Application-Extension
+ case ( 0xff ) :
+ {
+ if ( NO_PENDING( rIStm ) )
+ {
+ // default diese Extension ueberlesen
+ bOverreadDataBlocks = TRUE;
+
+ // Appl.-Extension hat Laenge 11
+ if ( cSize == 0x0b )
+ {
+ ByteString aAppId;
+ ByteString aAppCode;
+
+ rIStm.Read( aAppId.AllocBuffer( 8 ), 8 );
+ rIStm.Read( aAppCode.AllocBuffer( 3 ), 3 );
+ rIStm >> cSize;
+
+ // NetScape-Extension
+ if( aAppId == "NETSCAPE" && aAppCode == "2.0" && cSize == 3 )
+ {
+ rIStm >> cByte;
+
+ // Loop-Extension
+ if ( cByte == 0x01 )
+ {
+ rIStm >> cByte;
+ nLoops = cByte;
+ rIStm >> cByte;
+ nLoops |= ( (USHORT) cByte << 8 );
+ rIStm >> cByte;
+
+ bStatus = ( cByte == 0 );
+ bRet = NO_PENDING( rIStm );
+ bOverreadDataBlocks = FALSE;
+
+ // Netscape interpretiert den LoopCount
+ // als reine Anzahl der _Wiederholungen_;
+ // bei uns ist es die Gesamtanzahl der
+ // Durchlaeufe
+ if( nLoops )
+ nLoops++;
+ }
+ else
+ rIStm.SeekRel( -1 );
+ }
+ else if ( aAppId == "STARDIV " && aAppCode == "5.0" && cSize == 9 )
+ {
+ rIStm >> cByte;
+
+ // Loop-Extension
+ if ( cByte == 0x01 )
+ {
+ rIStm >> nLogWidth100 >> nLogHeight100;
+ rIStm >> cByte;
+ bStatus = ( cByte == 0 );
+ bRet = NO_PENDING( rIStm );
+ bOverreadDataBlocks = FALSE;
+ }
+ else
+ rIStm.SeekRel( -1 );
+ }
+
+ }
+ }
+ }
+ break;
+
+ // alles andere ueberlesen
+ default:
+ bOverreadDataBlocks = TRUE;
+ break;
+ }
+
+ // Sub-Blocks ueberlesen
+ if ( bOverreadDataBlocks )
+ {
+ bRet = TRUE;
+ while( cSize && bStatus && !rIStm.IsEof() )
+ {
+ USHORT nCount = (USHORT) cSize + 1;
+ char* pBuffer = new char[ nCount ];
+
+ bRet = FALSE;
+ rIStm.Read( pBuffer, nCount );
+ if( NO_PENDING( rIStm ) )
+ {
+ cSize = (BYTE) pBuffer[ cSize ];
+ bRet = TRUE;
+ }
+ else
+ cSize = 0;
+
+ delete[] pBuffer;
+ }
+ }
+ }
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GIFReader::ReadLocalHeader()
+{
+ BYTE pBuf[ 9 ];
+ BOOL bRet = FALSE;
+
+ rIStm.Read( pBuf, 9 );
+ if( NO_PENDING( rIStm ) )
+ {
+ SvMemoryStream aMemStm;
+ BitmapPalette* pPal;
+ BYTE nFlags;
+
+ aMemStm.SetBuffer( (char*) pBuf, 9, FALSE, 9 );
+ aMemStm >> nImagePosX;
+ aMemStm >> nImagePosY;
+ aMemStm >> nImageWidth;
+ aMemStm >> nImageHeight;
+ aMemStm >> nFlags;
+
+ // Falls Interlaced, ersten Startwert vorgeben
+ bInterlaced = ( ( nFlags & 0x40 ) == 0x40 );
+ nLastInterCount = 7;
+ nLastImageY = 0;
+
+ if( nFlags & 0x80 )
+ {
+ pPal = &aLPalette;
+ ReadPaletteEntries( pPal, 1 << ( (nFlags & 7 ) + 1 ) );
+ }
+ else
+ pPal = &aGPalette;
+
+ // Falls alles soweit eingelesen werden konnte, kann
+ // nun das lokale Bild angelegt werden;
+ // es wird uebergeben, ob der BackgroundColorIndex evtl.
+ // beruecksichtigt werden soll ( wenn Globale Farbtab. und
+ // diese auch fuer dieses Bild gilt )
+ if( NO_PENDING( rIStm ) )
+ {
+ CreateBitmaps( nImageWidth, nImageHeight, pPal, bGlobalPalette && ( pPal == &aGPalette ) );
+ bRet = TRUE;
+ }
+ }
+
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+
+ULONG GIFReader::ReadNextBlock()
+{
+ ULONG nRet = 0UL;
+ ULONG nRead;
+ BYTE cBlockSize;
+
+ rIStm >> cBlockSize;
+
+ if ( rIStm.IsEof() )
+ nRet = 4UL;
+ else if ( NO_PENDING( rIStm ) )
+ {
+ if ( cBlockSize == 0 )
+ nRet = 2UL;
+ else
+ {
+ rIStm.Read( pSrcBuf, cBlockSize );
+
+ if( NO_PENDING( rIStm ) )
+ {
+ if( bOverreadBlock )
+ nRet = 3UL;
+ else
+ {
+ BOOL bEOI;
+ HPBYTE pTarget = pDecomp->DecompressBlock( pSrcBuf, cBlockSize, nRead, bEOI );
+
+ nRet = ( bEOI ? 3 : 1 );
+
+ if( nRead && !bOverreadBlock )
+ FillImages( pTarget, nRead );
+
+ SvMemFree( pTarget );
+ }
+ }
+ }
+ }
+
+ return nRet;
+}
+
+// ------------------------------------------------------------------------
+
+void GIFReader::FillImages( HPBYTE pBytes, ULONG nCount )
+{
+ for( ULONG i = 0UL; i < nCount; i++ )
+ {
+ if( nImageX >= nImageWidth )
+ {
+ if( bInterlaced )
+ {
+ long nT1, nT2;
+
+ // falls Interlaced, werden die Zeilen kopiert
+ if( nLastInterCount )
+ {
+ long nMinY = Min( (long) nLastImageY + 1, (long) nImageHeight - 1 );
+ long nMaxY = Min( (long) nLastImageY + nLastInterCount, (long) nImageHeight - 1 );
+
+ // letzte gelesene Zeile kopieren, wenn Zeilen
+ // nicht zusanmmenfallen ( kommt vorm wenn wir am Ende des Bildes sind )
+ if( ( nMinY > nLastImageY ) && ( nLastImageY < ( nImageHeight - 1 ) ) )
+ {
+ HPBYTE pScanline8 = pAcc8->GetScanline( nYAcc );
+ ULONG nSize8 = pAcc8->GetScanlineSize();
+ HPBYTE pScanline1;
+ ULONG nSize1;
+
+ if( bGCTransparent )
+ {
+ pScanline1 = pAcc1->GetScanline( nYAcc );
+ nSize1 = pAcc1->GetScanlineSize();
+ }
+
+ for( long j = nMinY; j <= nMaxY; j++ )
+ {
+ HMEMCPY( pAcc8->GetScanline( j ), pScanline8, nSize8 );
+
+ if( bGCTransparent )
+ HMEMCPY( pAcc1->GetScanline( j ), pScanline1, nSize1 );
+ }
+ }
+ }
+
+ nT1 = ( ++nImageY ) << 3;
+ nLastInterCount = 7;
+
+ if( nT1 >= nImageHeight )
+ {
+ nT2 = nImageY - ( ( nImageHeight + 7 ) >> 3 );
+ nT1 = ( nT2 << 3 ) + 4;
+ nLastInterCount = 3;
+
+ if( nT1 >= nImageHeight )
+ {
+ nT2 -= ( nImageHeight + 3 ) >> 3;
+ nT1 = ( nT2 << 2 ) + 2;
+ nLastInterCount = 1;
+
+ if( nT1 >= nImageHeight )
+ {
+ nT2 -= ( nImageHeight + 1 ) >> 2;
+ nT1 = ( nT2 << 1 ) + 1;
+ nLastInterCount = 0;
+ }
+ }
+ }
+
+ nLastImageY = (USHORT) nT1;
+ nYAcc = nT1;
+ }
+ else
+ {
+ nLastImageY = ++nImageY;
+ nYAcc = nImageY;
+ }
+
+ // Zeile faengt von vorne an
+ nImageX = 0;
+ }
+
+ if( nImageY < nImageHeight )
+ {
+ const BYTE cTmp = pBytes[ i ];
+
+ if( bGCTransparent )
+ {
+ if( cTmp == nGCTransparentIndex )
+ pAcc1->SetPixel( nYAcc, nImageX++, cTransIndex1 );
+ else
+ {
+ pAcc8->SetPixel( nYAcc, nImageX, cTmp );
+ pAcc1->SetPixel( nYAcc, nImageX++, cNonTransIndex1 );
+ }
+ }
+ else
+ pAcc8->SetPixel( nYAcc, nImageX++, cTmp );
+ }
+ else
+ {
+ bOverreadBlock = TRUE;
+ break;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
+void GIFReader::CreateNewBitmaps()
+{
+ AnimationBitmap aAnimBmp;
+
+ aBmp8.ReleaseAccess( pAcc8 );
+ pAcc8 = NULL;
+
+ if( bGCTransparent )
+ {
+ aBmp1.ReleaseAccess( pAcc1 );
+ pAcc1 = NULL;
+ aAnimBmp.aBmpEx = BitmapEx( aBmp8, aBmp1 );
+ }
+ else
+ aAnimBmp.aBmpEx = BitmapEx( aBmp8 );
+
+ aAnimBmp.aPosPix = Point( nImagePosX, nImagePosY );
+ aAnimBmp.aSizePix = Size( nImageWidth, nImageHeight );
+ aAnimBmp.nWait = ( nTimer != 65535 ) ? nTimer : ANIMATION_TIMEOUT_ON_CLICK;
+ aAnimBmp.bUserInput = FALSE;
+
+ if( nGCDisposalMethod == 2 )
+ aAnimBmp.eDisposal = DISPOSE_BACK;
+ else if( nGCDisposalMethod == 3 )
+ aAnimBmp.eDisposal = DISPOSE_PREVIOUS;
+ else
+ aAnimBmp.eDisposal = DISPOSE_NOT;
+
+ aAnimation.Insert( aAnimBmp );
+
+ if( aAnimation.Count() == 1 )
+ {
+ aAnimation.SetDisplaySizePixel( Size( nGlobalWidth, nGlobalHeight ) );
+ aAnimation.SetLoopCount( nLoops );
+ }
+}
+
+// ------------------------------------------------------------------------
+
+const Graphic& GIFReader::GetIntermediateGraphic()
+{
+ // Intermediate-Graphic nur erzeugen, wenn schon
+ // Daten vorliegen, aber die Graphic noch nicht
+ // vollstaendig eingelesen wurde
+ if ( bImGraphicReady && !aAnimation.Count() )
+ {
+ Bitmap aBmp;
+
+ aBmp8.ReleaseAccess( pAcc8 );
+
+ if ( bGCTransparent )
+ {
+ aBmp1.ReleaseAccess( pAcc1 );
+ aImGraphic = BitmapEx( aBmp8, aBmp1 );
+
+ pAcc1 = aBmp1.AcquireWriteAccess();
+ bStatus = bStatus && ( pAcc1 != NULL );
+ }
+ else
+ aImGraphic = aBmp8;
+
+ pAcc8 = aBmp8.AcquireWriteAccess();
+ bStatus = bStatus && ( pAcc8 != NULL );
+ }
+
+ return aImGraphic;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL GIFReader::ProcessGIF()
+{
+ BOOL bRead = FALSE;
+ BOOL bEnd = FALSE;
+
+ if ( !bStatus )
+ eActAction = ABORT_READING;
+
+ // Stream an die richtige Stelle bringen
+ rIStm.Seek( nLastPos );
+
+ switch( eActAction )
+ {
+ // naechsten Marker lesen
+ case( MARKER_READING ):
+ {
+ BYTE cByte;
+
+ rIStm >> cByte;
+
+ if( rIStm.IsEof() )
+ eActAction = END_READING;
+ else if( NO_PENDING( rIStm ) )
+ {
+ bRead = TRUE;
+
+ if( cByte == '!' )
+ eActAction = EXTENSION_READING;
+ else if( cByte == ',' )
+ eActAction = LOCAL_HEADER_READING;
+ else if( cByte == ';' )
+ eActAction = END_READING;
+ else
+ eActAction = ABORT_READING;
+ }
+ }
+ break;
+
+ // ScreenDescriptor lesen
+ case( GLOBAL_HEADER_READING ):
+ {
+ if( ( bRead = ReadGlobalHeader() ) == TRUE )
+ {
+ ClearImageExtensions();
+ eActAction = MARKER_READING;
+ }
+ }
+ break;
+
+
+ // Extension lesen
+ case( EXTENSION_READING ):
+ {
+ if( ( bRead = ReadExtension() ) == TRUE )
+ eActAction = MARKER_READING;
+ }
+ break;
+
+
+ // Image-Descriptor lesen
+ case( LOCAL_HEADER_READING ):
+ {
+ if( ( bRead = ReadLocalHeader() ) == TRUE )
+ {
+ nYAcc = nImageX = nImageY = 0;
+ eActAction = FIRST_BLOCK_READING;
+ }
+ }
+ break;
+
+
+ // ersten Datenblock lesen
+ case( FIRST_BLOCK_READING ):
+ {
+ BYTE cDataSize;
+
+ rIStm >> cDataSize;
+
+ if( rIStm.IsEof() )
+ eActAction = ABORT_READING;
+ else if( cDataSize > 12 )
+ bStatus = FALSE;
+ else if( NO_PENDING( rIStm ) )
+ {
+ bRead = TRUE;
+ pDecomp = new GIFLZWDecompressor( cDataSize );
+ eActAction = NEXT_BLOCK_READING;
+ bOverreadBlock = FALSE;
+ }
+ else
+ eActAction = FIRST_BLOCK_READING;
+ }
+ break;
+
+ // naechsten Datenblock lesen
+ case( NEXT_BLOCK_READING ):
+ {
+ USHORT nLastImageX = nImageX;
+ USHORT nLastImageY = nImageY;
+ ULONG nRet = ReadNextBlock();
+
+ // Return: 0:Pending / 1:OK; / 2:OK und letzter Block: / 3:EOI / 4:HardAbort
+ if( nRet )
+ {
+ bRead = TRUE;
+
+ if ( nRet == 1UL )
+ {
+ bImGraphicReady = TRUE;
+ eActAction = NEXT_BLOCK_READING;
+ bOverreadBlock = FALSE;
+ }
+ else
+ {
+ if( nRet == 2UL )
+ {
+ delete pDecomp;
+ CreateNewBitmaps();
+ eActAction = MARKER_READING;
+ ClearImageExtensions();
+ }
+ else if( nRet == 3UL )
+ {
+ eActAction = NEXT_BLOCK_READING;
+ bOverreadBlock = TRUE;
+ }
+ else
+ {
+ delete pDecomp;
+ CreateNewBitmaps();
+ eActAction = ABORT_READING;
+ ClearImageExtensions();
+ }
+ }
+ }
+ else
+ {
+ nImageX = nLastImageX;
+ nImageY = nLastImageY;
+ }
+ }
+ break;
+
+ // ein Fehler trat auf
+ case( ABORT_READING ):
+ {
+ bEnd = TRUE;
+ eActAction = END_READING;
+ }
+ break;
+
+ default:
+ break;
+ }
+
+ // Stream an die richtige Stelle bringen,
+ // falls Daten gelesen werden konnten
+ // entweder alte Position oder aktuelle Position
+ if( bRead || bEnd )
+ nLastPos = rIStm.Tell();
+
+ return bRead;
+}
+
+// ------------------------------------------------------------------------
+
+ReadState GIFReader::ReadGIF( Graphic& rGraphic )
+{
+ ReadState eReadState;
+
+ bStatus = TRUE;
+
+ while( ProcessGIF() && ( eActAction != END_READING ) ) {}
+
+ if( !bStatus )
+ eReadState = GIFREAD_ERROR;
+ else if( eActAction == END_READING )
+ eReadState = GIFREAD_OK;
+ else
+ {
+ if ( rIStm.GetError() == ERRCODE_IO_PENDING )
+ rIStm.ResetError();
+
+ eReadState = GIFREAD_NEED_MORE;
+ }
+
+ if( aAnimation.Count() == 1 )
+ {
+ rGraphic = aAnimation.Get( 0 ).aBmpEx;
+
+ if( nLogWidth100 && nLogHeight100 )
+ {
+ rGraphic.SetPrefSize( Size( nLogWidth100, nLogHeight100 ) );
+ rGraphic.SetPrefMapMode( MAP_100TH_MM );
+ }
+ }
+ else
+ rGraphic = aAnimation;
+
+ return eReadState;
+}
+
+
+// -------------
+// - ImportGIF -
+// -------------
+
+BOOL ImportGIF( SvStream & rStm, Graphic& rGraphic, void* pCallerData )
+{
+ GIFReader* pGIFReader = (GIFReader*) rGraphic.GetContext();
+ USHORT nOldFormat = rStm.GetNumberFormatInt();
+ ReadState eReadState;
+ BOOL bRet = TRUE;
+
+ rStm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+
+ if( !pGIFReader )
+ pGIFReader = new GIFReader( rStm, pCallerData );
+
+ rGraphic.SetContext( NULL );
+ eReadState = pGIFReader->ReadGIF( rGraphic );
+
+ if( eReadState == GIFREAD_ERROR )
+ {
+ bRet = FALSE;
+ delete pGIFReader;
+ }
+ else if( eReadState == GIFREAD_OK )
+ delete pGIFReader;
+ else
+ {
+ rGraphic = pGIFReader->GetIntermediateGraphic();
+ rGraphic.SetContext( pGIFReader );
+ }
+
+ rStm.SetNumberFormatInt( nOldFormat );
+
+ return bRet;
+}
diff --git a/svtools/source/filter.vcl/igif/makefile.mk b/svtools/source/filter.vcl/igif/makefile.mk
new file mode 100644
index 000000000000..39cd875fd527
--- /dev/null
+++ b/svtools/source/filter.vcl/igif/makefile.mk
@@ -0,0 +1,96 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=VCL
+TARGET=igif
+DEPTARGET=vigif
+
+
+# --- Settings -----------------------------------------------------
+
+.IF "$(VCL)" != ""
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+
+# --- Files --------------------------------------------------------
+
+
+CXXFILES= gifread.cxx \
+ decode.cxx
+
+SLOFILES= $(SLO)$/gifread.obj \
+ $(SLO)$/decode.obj
+
+
+.INCLUDE : target.mk
+
+.ELSE
+
+dummy:
+ @+echo VCL not set. nothing to do!
+
+.ENDIF #VCL
diff --git a/svtools/source/filter.vcl/ixbm/makefile.mk b/svtools/source/filter.vcl/ixbm/makefile.mk
new file mode 100644
index 000000000000..6d3c4bf1bfec
--- /dev/null
+++ b/svtools/source/filter.vcl/ixbm/makefile.mk
@@ -0,0 +1,95 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=VCL
+TARGET=ixbm
+DEPTARGET=vixbm
+VERSION=$(UPD)
+
+
+# --- Settings -----------------------------------------------------
+
+.IF "$(VCL)" != ""
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+
+# --- Files --------------------------------------------------------
+
+
+CXXFILES= xbmread.cxx
+
+SLOFILES= $(SLO)$/xbmread.obj
+
+
+.INCLUDE : target.mk
+
+.ELSE
+
+dummy:
+ @+echo VCL not set. nothing to do!
+
+.ENDIF #VCL
diff --git a/svtools/source/filter.vcl/ixbm/xbmread.cxx b/svtools/source/filter.vcl/ixbm/xbmread.cxx
new file mode 100644
index 000000000000..4ede60dfa508
--- /dev/null
+++ b/svtools/source/filter.vcl/ixbm/xbmread.cxx
@@ -0,0 +1,429 @@
+/*************************************************************************
+ *
+ * $RCSfile: xbmread.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define XBMMINREAD 512
+
+#define _XBMPRIVATE
+#include <ctype.h>
+#include "xbmread.hxx"
+
+// -------------
+// - XBMReader -
+// -------------
+
+XBMReader::XBMReader( SvStream& rStm, void* pCallData ) :
+ rIStm ( rStm ),
+ nWidth ( 0 ),
+ nHeight ( 0 ),
+ nLastPos ( rStm.Tell() ),
+ pAcc1 ( NULL ),
+ bStatus ( TRUE )
+{
+ pHexTable = new short[ 256 ];
+ maUpperName = String::CreateFromAscii( "SVIXBM", 6 );
+ InitTable();
+}
+
+// ------------------------------------------------------------------------
+
+XBMReader::~XBMReader()
+{
+ delete[] pHexTable;
+
+ if( pAcc1 )
+ aBmp1.ReleaseAccess( pAcc1 );
+}
+
+// ------------------------------------------------------------------------
+
+void XBMReader::InitTable()
+{
+ memset( pHexTable, 0, sizeof( short ) );
+
+ pHexTable['0'] = 0;
+ pHexTable['1'] = 1;
+ pHexTable['2'] = 2;
+ pHexTable['3'] = 3;
+ pHexTable['4'] = 4;
+ pHexTable['5'] = 5;
+ pHexTable['6'] = 6;
+ pHexTable['7'] = 7;
+ pHexTable['8'] = 8;
+ pHexTable['9'] = 9;
+ pHexTable['A'] = 10;
+ pHexTable['B'] = 11;
+ pHexTable['C'] = 12;
+ pHexTable['D'] = 13;
+ pHexTable['E'] = 14;
+ pHexTable['F'] = 15;
+ pHexTable['X'] = 0;
+ pHexTable['a'] = 10;
+ pHexTable['b'] = 11;
+ pHexTable['c'] = 12;
+ pHexTable['d'] = 13;
+ pHexTable['e'] = 14;
+ pHexTable['f'] = 15;
+ pHexTable['x'] = 0;
+ pHexTable[' '] = -1;
+ pHexTable[','] = -1;
+ pHexTable['}'] = -1;
+ pHexTable['\n'] = -1;
+ pHexTable['\t'] = -1;
+ pHexTable['\0'] = -1;
+}
+
+// ------------------------------------------------------------------------
+
+ByteString XBMReader::FindTokenLine( SvStream* pInStm, const char* pTok1,
+ const char* pTok2, const char* pTok3 )
+{
+ ByteString aRet;
+ long nPos1;
+ long nPos2;
+ long nPos3;
+
+ bStatus = FALSE;
+
+ do
+ {
+ if( !pInStm->ReadLine( aRet ) )
+ break;
+
+ if( pTok1 )
+ {
+ if( ( nPos1 = aRet.Search( pTok1 ) ) != STRING_NOTFOUND )
+ {
+ bStatus = TRUE;
+
+ if( pTok2 )
+ {
+ bStatus = FALSE;
+
+ if( ( ( nPos2 = aRet.Search( pTok2 ) ) != STRING_NOTFOUND ) &&
+ ( nPos2 > nPos1 ) )
+ {
+ bStatus = TRUE;
+
+ if( pTok3 )
+ {
+ bStatus = FALSE;
+
+ if( ( ( nPos3 = aRet.Search( pTok3 ) ) != STRING_NOTFOUND ) && ( nPos3 > nPos2 ) )
+ bStatus = TRUE;
+ }
+ }
+ }
+ }
+ }
+ }
+ while( !bStatus );
+
+ return aRet;
+}
+
+// ------------------------------------------------------------------------
+
+long XBMReader::ParseDefine( const sal_Char* pDefine )
+{
+ long nRet = 0;
+ char* pTmp = (char*) pDefine;
+ char cTmp;
+
+ // bis zum Ende gehen
+ pTmp += ( strlen( pDefine ) - 1 );
+ cTmp = *pTmp--;
+
+ // letzte Ziffer suchen
+ while( pHexTable[ cTmp ] == -1 )
+ cTmp = *pTmp--;
+
+ // bis vor die Zahl laufen
+ while( pHexTable[ cTmp ] != -1 )
+ cTmp = *pTmp--;
+
+ // auf Anfang der Zahl gehen
+ pTmp += 2;
+
+ // Hex lesen
+ if( ( pTmp[0] == '0' ) && ( ( pTmp[1] == 'X' ) || ( pTmp[1] == 'x' ) ) )
+ {
+ pTmp += 2;
+ cTmp = *pTmp++;
+
+ while ( pHexTable[ cTmp ] != -1 )
+ {
+ nRet = ( nRet << 4 ) + pHexTable[ cTmp ];
+ cTmp = *pTmp++;
+ }
+ }
+ // Dezimal lesen
+ else
+ {
+ cTmp = *pTmp++;
+ while( ( cTmp >= '0' ) && ( cTmp <= '9' ) )
+ {
+ nRet = nRet * 10 + ( cTmp - '0' );
+ cTmp = *pTmp++;
+ }
+ }
+
+ return nRet;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL XBMReader::ParseData( SvStream* pInStm, const ByteString& aLastLine, XBMFormat eFormat )
+{
+ ByteString aLine;
+ long nRow = 0;
+ long nCol = 0;
+ long nBits = ( eFormat == XBM10 ) ? 16 : 8;
+ long nBit;
+ USHORT nValue;
+ USHORT nDigits;
+ BOOL bFirstLine = TRUE;
+
+ while( nRow < nHeight )
+ {
+ if( bFirstLine )
+ {
+ long nPos;
+
+ // einfuehrende geschweifte Klammer loeschen
+ if( (nPos = ( aLine = aLastLine ).Search( '{' ) ) != STRING_NOTFOUND )
+ aLine.Erase( 0, nPos + 1 );
+
+ bFirstLine = FALSE;
+ }
+ else if( !pInStm->ReadLine( aLine ) )
+ break;
+
+ if( aLine.Len() )
+ {
+ const USHORT nCount = aLine.GetTokenCount( ',' );
+
+ for( USHORT i = 0; ( i < nCount ) && ( nRow < nHeight ); i++ )
+ {
+ const ByteString aToken( aLine.GetToken( i, ',' ) );
+ const ULONG nLen = aToken.Len();
+ BOOL bProcessed = FALSE;
+
+ nBit = nDigits = nValue = 0;
+
+ for( ULONG n = 0UL; n < nLen; n++ )
+ {
+ const unsigned char cChar = aToken.GetChar( n );
+ const short nTable = pHexTable[ cChar ];
+
+ if( isxdigit( cChar ) || !nTable )
+ {
+ nValue = ( nValue << 4 ) + nTable;
+ nDigits++;
+ bProcessed = TRUE;
+ }
+ else if( ( nTable < 0 ) && nDigits )
+ {
+ bProcessed = TRUE;
+ break;
+ }
+ }
+
+ if( bProcessed )
+ {
+ while( ( nCol < nWidth ) && ( nBit < nBits ) )
+ pAcc1->SetPixel( nRow, nCol++, ( nValue & ( 1 << nBit++ ) ) ? aBlack : aWhite );
+
+ if( nCol == nWidth )
+ nCol = 0, nRow++;
+ }
+ }
+ }
+ }
+
+ return TRUE;
+}
+
+// ------------------------------------------------------------------------
+
+ReadState XBMReader::ReadXBM( Graphic& rGraphic )
+{
+ ReadState eReadState;
+ BYTE cDummy;
+
+ // sehen, ob wir _alles_ lesen koennen
+ rIStm.Seek( STREAM_SEEK_TO_END );
+ rIStm >> cDummy;
+
+ // falls wir nicht alles lesen koennen
+ // kehren wir zurueck und warten auf neue Daten
+ if ( rIStm.GetError() != ERRCODE_IO_PENDING )
+ {
+ ByteString aLine;
+ int nValue;
+
+ rIStm.Seek( nLastPos );
+ bStatus = FALSE;
+ aLine = FindTokenLine( &rIStm, "#define", "_width" );
+
+ if ( bStatus )
+ {
+ if ( ( nValue = (int) ParseDefine( aLine.GetBuffer() ) ) > 0 )
+ {
+ nWidth = nValue;
+ aLine = FindTokenLine( &rIStm, "#define", "_height" );
+
+ // Falls die Hoehe nicht folgt, suchen wir noch
+ // einmal vom Anfang der Datei an
+ if ( !bStatus )
+ {
+ rIStm.Seek( nLastPos );
+ aLine = FindTokenLine( &rIStm, "#define", "_height" );
+ }
+ }
+ else
+ bStatus = FALSE;
+
+ if ( bStatus )
+ {
+ if ( ( nValue = (int) ParseDefine( aLine.GetBuffer() ) ) > 0 )
+ {
+ nHeight = nValue;
+ aLine = FindTokenLine( &rIStm, "static", "_bits" );
+
+ if ( bStatus )
+ {
+ XBMFormat eFormat;
+
+ if ( aLine.Search( "short" ) != STRING_NOTFOUND )
+ eFormat = XBM10;
+ else if ( aLine.Search( "char" ) != STRING_NOTFOUND )
+ eFormat = XBM11;
+ else
+ bStatus = FALSE;
+
+ if ( bStatus && nWidth && nHeight )
+ {
+ aBmp1 = Bitmap( Size( nWidth, nHeight ), 1 );
+ pAcc1 = aBmp1.AcquireWriteAccess();
+
+ if( pAcc1 )
+ {
+ aWhite = pAcc1->GetBestMatchingColor( Color( COL_WHITE ) );
+ aBlack = pAcc1->GetBestMatchingColor( Color( COL_BLACK ) );
+ bStatus = ParseData( &rIStm, aLine, eFormat );
+ }
+ else
+ bStatus = FALSE;
+ }
+ }
+ }
+ }
+ }
+
+ if( bStatus )
+ {
+ Bitmap aBlackBmp( Size( pAcc1->Width(), pAcc1->Height() ), 1 );
+
+ aBmp1.ReleaseAccess( pAcc1 ), pAcc1 = NULL;
+ aBlackBmp.Erase( Color( COL_BLACK ) );
+ rGraphic = BitmapEx( aBlackBmp, aBmp1 );
+ eReadState = XBMREAD_OK;
+ }
+ else
+ eReadState = XBMREAD_ERROR;
+ }
+ else
+ {
+ rIStm.ResetError();
+ eReadState = XBMREAD_NEED_MORE;
+ }
+
+ return eReadState;
+}
+
+// -------------
+// - ImportXBM -
+// -------------
+
+BOOL ImportXBM( SvStream& rStm, Graphic& rGraphic, void* pCallerData )
+{
+ XBMReader* pXBMReader = (XBMReader*) rGraphic.GetContext();
+ ReadState eReadState;
+ BOOL bRet = TRUE;
+
+ if( !pXBMReader )
+ pXBMReader = new XBMReader( rStm, pCallerData );
+
+ rGraphic.SetContext( NULL );
+ eReadState = pXBMReader->ReadXBM( rGraphic );
+
+ if( eReadState == XBMREAD_ERROR )
+ {
+ bRet = FALSE;
+ delete pXBMReader;
+ }
+ else if( eReadState == XBMREAD_OK )
+ delete pXBMReader;
+ else
+ rGraphic.SetContext( pXBMReader );
+
+ return bRet;
+}
diff --git a/svtools/source/filter.vcl/ixpm/makefile.mk b/svtools/source/filter.vcl/ixpm/makefile.mk
new file mode 100644
index 000000000000..7c4ed303c09b
--- /dev/null
+++ b/svtools/source/filter.vcl/ixpm/makefile.mk
@@ -0,0 +1,95 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:58:59 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=VCL
+TARGET=ixpm
+DEPTARGET=vixpm
+VERSION=$(UPD)
+
+
+# --- Settings -----------------------------------------------------
+
+.IF "$(VCL)" != ""
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+
+# --- Files --------------------------------------------------------
+
+
+CXXFILES= xpmread.cxx
+
+SLOFILES= $(SLO)$/xpmread.obj
+
+
+.INCLUDE : target.mk
+
+.ELSE
+
+dummy:
+ @+echo VCL not set. nothing to do!
+
+.ENDIF #VCL
diff --git a/svtools/source/filter.vcl/ixpm/rgbtable.hxx b/svtools/source/filter.vcl/ixpm/rgbtable.hxx
new file mode 100644
index 000000000000..d7425faa8068
--- /dev/null
+++ b/svtools/source/filter.vcl/ixpm/rgbtable.hxx
@@ -0,0 +1,729 @@
+/*************************************************************************
+ *
+ * $RCSfile: rgbtable.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+struct XPMRGBTab
+{
+ char* name;
+ BYTE red;
+ BYTE green;
+ BYTE blue;
+};
+
+static XPMRGBTab pRGBTable[] = {
+{ "white", 255, 255, 255 },
+{ "black", 0, 0, 0 },
+{ "snow", 255, 250, 250 },
+{ "GhostWhite", 248, 248, 255 },
+{ "WhiteSmoke", 245, 245, 245 },
+{ "gainsboro", 220, 220, 220 },
+{ "FloralWhite", 255, 250, 240 },
+{ "OldLace", 253, 245, 230 },
+{ "linen", 250, 240, 230 },
+{ "AntiqueWhite", 250, 235, 215 },
+{ "PapayaWhip", 255, 239, 213 },
+{ "BlanchedAlmond", 255, 235, 205 },
+{ "bisque", 255, 228, 196 },
+{ "PeachPuff", 255, 218, 185 },
+{ "NavajoWhite", 255, 222, 173 },
+{ "moccasin", 255, 228, 181 },
+{ "cornsilk", 255, 248, 220 },
+{ "ivory", 255, 255, 240 },
+{ "LemonChiffon", 255, 250, 205 },
+{ "seashell", 255, 245, 238 },
+{ "honeydew", 240, 255, 240 },
+{ "MintCream", 245, 255, 250 },
+{ "azure", 240, 255, 255 },
+{ "AliceBlue", 240, 248, 255 },
+{ "lavender", 230, 230, 250 },
+{ "LavenderBlush", 255, 240, 245 },
+{ "MistyRose", 255, 228, 225 },
+{ "DarkSlateGray", 47, 79, 79 },
+{ "DarkSlateGrey", 47, 79, 79 },
+{ "DimGray", 105, 105, 105 },
+{ "DimGrey", 105, 105, 105 },
+{ "SlateGray", 112, 128, 144 },
+{ "SlateGrey", 112, 128, 144 },
+{ "LightSlateGray", 119, 136, 153 },
+{ "LightSlateGrey", 119, 136, 153 },
+{ "gray", 190, 190, 190 },
+{ "grey", 190, 190, 190 },
+{ "LightGrey", 211, 211, 211 },
+{ "LightGray", 211, 211, 211 },
+{ "MidnightBlue", 25, 25, 112 },
+{ "navy", 0, 0, 128 },
+{ "NavyBlue", 0, 0, 128 },
+{ "CornflowerBlue", 100, 149, 237 },
+{ "DarkSlateBlue", 72, 61, 139 },
+{ "SlateBlue", 106, 90, 205 },
+{ "MediumSlateBlue", 123, 104, 238 },
+{ "LightSlateBlue", 132, 112, 255 },
+{ "MediumBlue", 0, 0, 205 },
+{ "RoyalBlue", 65, 105, 225 },
+{ "blue", 0, 0, 255 },
+{ "DodgerBlue", 30, 144, 255 },
+{ "DeepSkyBlue", 0, 191, 255 },
+{ "SkyBlue", 135, 206, 235 },
+{ "LightSkyBlue", 135, 206, 250 },
+{ "SteelBlue", 70, 130, 180 },
+{ "LightSteelBlue", 176, 196, 222 },
+{ "LightBlue", 173, 216, 230 },
+{ "PowderBlue", 176, 224, 230 },
+{ "PaleTurquoise", 175, 238, 238 },
+{ "DarkTurquoise", 0, 206, 209 },
+{ "MediumTurquoise", 72, 209, 204 },
+{ "turquoise", 64, 224, 208 },
+{ "cyan", 0, 255, 255 },
+{ "LightCyan", 224, 255, 255 },
+{ "CadetBlue", 95, 158, 160 },
+{ "MediumAquamarine", 102, 205, 170 },
+{ "aquamarine", 127, 255, 212 },
+{ "DarkGreen", 0, 100, 0 },
+{ "DarkOliveGreen", 85, 107, 47 },
+{ "DarkSeaGreen", 143, 188, 143 },
+{ "SeaGreen", 46, 139, 87 },
+{ "MediumSeaGreen", 60, 179, 113 },
+{ "LightSeaGreen", 32, 178, 170 },
+{ "PaleGreen", 152, 251, 152 },
+{ "SpringGreen", 0, 255, 127 },
+{ "LawnGreen", 124, 252, 0 },
+{ "green", 0, 255, 0 },
+{ "chartreuse", 127, 255, 0 },
+{ "MediumSpringGreen", 0, 250, 154 },
+{ "GreenYellow", 173, 255 , 47 },
+{ "LimeGreen", 50, 205, 50 },
+{ "YellowGreen", 154, 205, 50 },
+{ "ForestGreen", 34, 139, 34 },
+{ "OliveDrab", 107, 142, 35 },
+{ "DarkKhaki", 189, 183, 107 },
+{ "khaki", 240, 230, 140 },
+{ "PaleGoldenrod", 238, 232, 170 },
+{ "LightGoldenrodYellow", 250, 250, 210 },
+{ "LightYellow", 255, 255, 224 },
+{ "yellow", 255, 255, 0 },
+{ "gold", 255, 215, 0 },
+{ "LightGoldenrod", 238, 221, 130 },
+{ "goldenrod", 218, 165, 32 },
+{ "DarkGoldenrod", 184, 134, 11 },
+{ "RosyBrown", 188, 143, 143 },
+{ "IndianRed", 205, 92, 92 },
+{ "SaddleBrown", 139, 69, 19 },
+{ "sienna", 160, 82, 45 },
+{ "peru", 205, 133, 63 },
+{ "burlywood", 222, 184, 135 },
+{ "beige", 245, 245, 220 },
+{ "wheat", 245, 222, 179 },
+{ "SandyBrown", 244, 164, 96 },
+{ "tan", 210, 180, 140 },
+{ "chocolate", 210, 105, 30 },
+{ "firebrick", 178, 34, 34 },
+{ "brown", 165, 42, 42 },
+{ "DarkSalmon", 233, 150, 122 },
+{ "salmon", 250, 128, 114 },
+{ "LightSalmon", 255, 160, 122 },
+{ "orange", 255, 165, 0 },
+{ "DarkOrange", 255, 140, 0 },
+{ "coral", 255, 127, 80 },
+{ "LightCoral", 240, 128, 128 },
+{ "tomato", 255, 99, 71 },
+{ "OrangeRed", 255, 69, 0 },
+{ "red", 255, 0, 0 },
+{ "HotPink", 255, 105, 180 },
+{ "DeepPink", 255, 20, 147 },
+{ "pink", 255, 192, 203 },
+{ "LightPink", 255, 182, 193 },
+{ "PaleVioletRed", 219, 112, 147 },
+{ "maroon", 176, 48, 96 },
+{ "MediumVioletRed", 199, 21, 133 },
+{ "VioletRed", 208, 32, 144 },
+{ "magenta", 255, 0, 255 },
+{ "violet", 238, 130, 238 },
+{ "plum", 221, 160, 221 },
+{ "orchid", 218, 112, 214 },
+{ "MediumOrchid", 186, 85, 211 },
+{ "DarkOrchid", 153, 50, 204 },
+{ "DarkViolet", 148, 0, 211 },
+{ "BlueViolet", 138, 43, 226 },
+{ "purple", 160, 32, 240 },
+{ "MediumPurple", 147, 112, 219 },
+{ "thistle", 216, 191, 216 },
+{ "snow1", 255, 250, 250 },
+{ "snow2", 238, 233, 233 },
+{ "snow3", 205, 201, 201 },
+{ "snow4", 139, 137, 137 },
+{ "seashell1", 255, 245, 238 },
+{ "seashell2", 238, 229, 222 },
+{ "seashell3", 205, 197, 191 },
+{ "seashell4", 139, 134, 130 },
+{ "AntiqueWhite1", 255, 239, 219 },
+{ "AntiqueWhite2", 238, 223, 204 },
+{ "AntiqueWhite3", 205, 192, 176 },
+{ "AntiqueWhite4", 139, 131, 120 },
+{ "bisque1", 255, 228, 196 },
+{ "bisque2", 238, 213, 183 },
+{ "bisque3", 205, 183, 158 },
+{ "bisque4", 139, 125, 107 },
+{ "PeachPuff1", 255, 218, 185 },
+{ "PeachPuff2", 238, 203, 173 },
+{ "PeachPuff3", 205, 175, 149 },
+{ "PeachPuff4", 139, 119, 101 },
+{ "NavajoWhite1", 255, 222, 173 },
+{ "NavajoWhite2", 238, 207, 161 },
+{ "NavajoWhite3", 205, 179, 139 },
+{ "NavajoWhite4", 139, 121, 94 },
+{ "LemonChiffon1", 255, 250, 205 },
+{ "LemonChiffon2", 238, 233, 191 },
+{ "LemonChiffon3", 205, 201, 165 },
+{ "LemonChiffon4", 139, 137, 112 },
+{ "cornsilk1", 255, 248, 220 },
+{ "cornsilk2", 238, 232, 205 },
+{ "cornsilk3", 205, 200, 177 },
+{ "cornsilk4", 139, 136, 120 },
+{ "ivory1", 255, 255, 240 },
+{ "ivory2", 238, 238, 224 },
+{ "ivory3", 205, 205, 193 },
+{ "ivory4", 139, 139, 131 },
+{ "honeydew1", 240, 255, 240 },
+{ "honeydew2", 224, 238, 224 },
+{ "honeydew3", 193, 205, 193 },
+{ "honeydew4", 131, 139, 131 },
+{ "LavenderBlush1", 255, 240, 245 },
+{ "LavenderBlush2", 238, 224, 229 },
+{ "LavenderBlush3", 205, 193, 197 },
+{ "LavenderBlush4", 139, 131, 134 },
+{ "MistyRose1", 255, 228, 225 },
+{ "MistyRose2", 238, 213, 210 },
+{ "MistyRose3", 205, 183, 181 },
+{ "MistyRose4", 139, 125, 123 },
+{ "azure1", 240, 255, 255 },
+{ "azure2", 224, 238, 238 },
+{ "azure3", 193, 205, 205 },
+{ "azure4", 131, 139, 139 },
+{ "SlateBlue1", 131, 111, 255 },
+{ "SlateBlue2", 122, 103, 238 },
+{ "SlateBlue3", 105, 89, 205 },
+{ "SlateBlue4", 71, 60, 139 },
+{ "RoyalBlue1", 72, 118, 255 },
+{ "RoyalBlue2", 67, 110, 238 },
+{ "RoyalBlue3", 58, 95, 205 },
+{ "RoyalBlue4", 39, 64, 139 },
+{ "blue1", 0, 0, 255 },
+{ "blue2", 0, 0, 238 },
+{ "blue3", 0, 0, 205 },
+{ "blue4", 0, 0, 139 },
+{ "DodgerBlue1", 30, 144, 255 },
+{ "DodgerBlue2", 28, 134, 238 },
+{ "DodgerBlue3", 24, 116, 205 },
+{ "DodgerBlue4", 16, 78, 139 },
+{ "SteelBlue1", 99, 184, 255 },
+{ "SteelBlue2", 92, 172, 238 },
+{ "SteelBlue3", 79, 148, 205 },
+{ "SteelBlue4", 54, 100, 139 },
+{ "DeepSkyBlue1", 0, 191, 255 },
+{ "DeepSkyBlue2", 0, 178, 238 },
+{ "DeepSkyBlue3", 0, 154, 205 },
+{ "DeepSkyBlue4", 0, 104, 139 },
+{ "SkyBlue1", 135, 206, 255 },
+{ "SkyBlue2", 126, 192, 238 },
+{ "SkyBlue3", 108, 166, 205 },
+{ "SkyBlue4", 74, 112, 139 },
+{ "LightSkyBlue1", 176, 226, 255 },
+{ "LightSkyBlue2", 164, 211, 238 },
+{ "LightSkyBlue3", 141, 182, 205 },
+{ "LightSkyBlue4", 96, 123, 139 },
+{ "SlateGray1", 198, 226, 255 },
+{ "SlateGray2", 185, 211, 238 },
+{ "SlateGray3", 159, 182, 205 },
+{ "SlateGray4", 108, 123, 139 },
+{ "LightSteelBlue1", 202, 225, 255 },
+{ "LightSteelBlue2", 188, 210, 238 },
+{ "LightSteelBlue3", 162, 181, 205 },
+{ "LightSteelBlue4", 110, 123, 139 },
+{ "LightBlue1", 191, 239, 255 },
+{ "LightBlue2", 178, 223, 238 },
+{ "LightBlue3", 154, 192, 205 },
+{ "LightBlue4", 104, 131, 139 },
+{ "LightCyan1", 224, 255, 255 },
+{ "LightCyan2", 209, 238, 238 },
+{ "LightCyan3", 180, 205, 205 },
+{ "LightCyan4", 122, 139, 139 },
+{ "PaleTurquoise1", 187, 255, 255 },
+{ "PaleTurquoise2", 174, 238, 238 },
+{ "PaleTurquoise3", 150, 205, 205 },
+{ "PaleTurquoise4", 102, 139, 139 },
+{ "CadetBlue1", 152, 245, 255 },
+{ "CadetBlue2", 142, 229, 238 },
+{ "CadetBlue3", 122, 197, 205 },
+{ "CadetBlue4", 83, 134, 139 },
+{ "turquoise1", 0, 245, 255 },
+{ "turquoise2", 0, 229, 238 },
+{ "turquoise3", 0, 197, 205 },
+{ "turquoise4", 0, 134, 139 },
+{ "cyan1", 0, 255, 255 },
+{ "cyan2", 0, 238, 238 },
+{ "cyan3", 0, 205, 205 },
+{ "cyan4", 0, 139, 139 },
+{ "DarkSlateGray1", 151, 255, 255 },
+{ "DarkSlateGray2", 141, 238, 238 },
+{ "DarkSlateGray3", 121, 205, 205 },
+{ "DarkSlateGray4", 82, 139, 139 },
+{ "aquamarine1", 127, 255, 212 },
+{ "aquamarine2", 118, 238, 198 },
+{ "aquamarine3", 102, 205, 170 },
+{ "aquamarine4", 69, 139, 116 },
+{ "DarkSeaGreen1", 193, 255, 193 },
+{ "DarkSeaGreen2", 180, 238, 180 },
+{ "DarkSeaGreen3", 155, 205, 155 },
+{ "DarkSeaGreen4", 105, 139, 105 },
+{ "SeaGreen1", 84, 255, 159 },
+{ "SeaGreen2", 78, 238, 148 },
+{ "SeaGreen3", 67, 205, 128 },
+{ "SeaGreen4", 46, 139, 87 },
+{ "PaleGreen1", 154, 255, 154 },
+{ "PaleGreen2", 144, 238, 144 },
+{ "PaleGreen3", 124, 205, 124 },
+{ "PaleGreen4", 84, 139, 84 },
+{ "SpringGreen1", 0, 255, 127 },
+{ "SpringGreen2", 0, 238, 118 },
+{ "SpringGreen3", 0, 205, 102 },
+{ "SpringGreen4", 0, 139, 69 },
+{ "green1", 0, 255, 0 },
+{ "green2", 0, 238, 0 },
+{ "green3", 0, 205, 0 },
+{ "green4", 0, 139, 0 },
+{ "chartreuse1", 127, 255, 0 },
+{ "chartreuse2", 118, 238, 0 },
+{ "chartreuse3", 102, 205, 0 },
+{ "chartreuse4", 69, 139, 0 },
+{ "OliveDrab1", 192, 255, 62 },
+{ "OliveDrab2", 179, 238, 58 },
+{ "OliveDrab3", 154, 205, 50 },
+{ "OliveDrab4", 105, 139, 34 },
+{ "DarkOliveGreen1", 202, 255, 112 },
+{ "DarkOliveGreen2", 188, 238, 104 },
+{ "DarkOliveGreen3", 162, 205, 90 },
+{ "DarkOliveGreen4", 110, 139, 61 },
+{ "khaki1", 255, 246, 143 },
+{ "khaki2", 238, 230, 133 },
+{ "khaki3", 205, 198, 115 },
+{ "khaki4", 139, 134, 78 },
+{ "LightGoldenrod1", 255, 236, 139 },
+{ "LightGoldenrod2", 238, 220, 130 },
+{ "LightGoldenrod3", 205, 190, 112 },
+{ "LightGoldenrod4", 139, 129, 76 },
+{ "LightYellow1", 255, 255, 224 },
+{ "LightYellow2", 238, 238, 209 },
+{ "LightYellow3", 205, 205, 180 },
+{ "LightYellow4", 139, 139, 122 },
+{ "yellow1", 255, 255, 0 },
+{ "yellow2", 238, 238, 0 },
+{ "yellow3", 205, 205, 0 },
+{ "yellow4", 139, 139, 0 },
+{ "gold1", 255, 215, 0 },
+{ "gold2", 238, 201, 0 },
+{ "gold3", 205, 173, 0 },
+{ "gold4", 139, 117, 0 },
+{ "goldenrod1", 255, 193, 37 },
+{ "goldenrod2", 238, 180, 34 },
+{ "goldenrod3", 205, 155, 29 },
+{ "goldenrod4", 139, 105, 20 },
+{ "DarkGoldenrod1", 255, 185, 15 },
+{ "DarkGoldenrod2", 238, 173, 14 },
+{ "DarkGoldenrod3", 205, 149, 12 },
+{ "DarkGoldenrod4", 139, 101, 8 },
+{ "RosyBrown1", 255, 193, 193 },
+{ "RosyBrown2", 238, 180, 180 },
+{ "RosyBrown3", 205, 155, 155 },
+{ "RosyBrown4", 139, 105, 105 },
+{ "IndianRed1", 255, 106, 106 },
+{ "IndianRed2", 238, 99, 99 },
+{ "IndianRed3", 205, 85, 85 },
+{ "IndianRed4", 139, 58, 58 },
+{ "sienna1", 255, 130, 71 },
+{ "sienna2", 238, 121, 66 },
+{ "sienna3", 205, 104, 57 },
+{ "sienna4", 139, 71, 38 },
+{ "burlywood1", 255, 211, 155 },
+{ "burlywood2", 238, 197, 145 },
+{ "burlywood3", 205, 170, 125 },
+{ "burlywood4", 139, 115, 85 },
+{ "wheat1", 255, 231, 186 },
+{ "wheat2", 238, 216, 174 },
+{ "wheat3", 205, 186, 150 },
+{ "wheat4", 139, 126, 102 },
+{ "tan1", 255, 165, 79 },
+{ "tan2", 238, 154, 73 },
+{ "tan3", 205, 133, 63 },
+{ "tan4", 139 , 90, 43 },
+{ "chocolate1", 255, 127, 36 },
+{ "chocolate2", 238, 118, 33 },
+{ "chocolate3", 205, 102, 29 },
+{ "chocolate4", 139, 69, 19 },
+{ "firebrick1", 255, 48, 48 },
+{ "firebrick2", 238, 44, 44 },
+{ "firebrick3", 205, 38, 38 },
+{ "firebrick4", 139, 26, 26 },
+{ "brown1", 255, 64, 64 },
+{ "brown2", 238, 59, 59 },
+{ "brown3", 205, 51, 51 },
+{ "brown4", 139, 35, 35 },
+{ "salmon1", 255, 140, 105 },
+{ "salmon2", 238, 130, 98 },
+{ "salmon3", 205, 112, 84 },
+{ "salmon4", 139, 76, 57 },
+{ "LightSalmon1", 255, 160, 122 },
+{ "LightSalmon2", 238, 149, 114 },
+{ "LightSalmon3", 205, 129, 98 },
+{ "LightSalmon4", 139, 87, 66 },
+{ "orange1", 255, 165, 0 },
+{ "orange2", 238, 154, 0 },
+{ "orange3", 205, 133, 0 },
+{ "orange4", 139 , 90, 0 },
+{ "DarkOrange1", 255, 127, 0 },
+{ "DarkOrange2", 238, 118, 0 },
+{ "DarkOrange3", 205, 102, 0 },
+{ "DarkOrange4", 139 , 69, 0 },
+{ "coral1", 255, 114, 86 },
+{ "coral2", 238, 106, 80 },
+{ "coral3", 205, 91, 69 },
+{ "coral4", 139, 62, 47 },
+{ "tomato1", 255, 99, 71 },
+{ "tomato2", 238, 92, 66 },
+{ "tomato3", 205, 79, 57 },
+{ "tomato4", 139, 54, 38 },
+{ "OrangeRed1", 255, 69, 0 },
+{ "OrangeRed2", 238, 64, 0 },
+{ "OrangeRed3", 205, 55, 0 },
+{ "OrangeRed4", 139, 37, 0 },
+{ "red1", 255, 0, 0 },
+{ "red2", 238, 0, 0 },
+{ "red3", 205, 0, 0 },
+{ "red4", 139, 0, 0 },
+{ "DeepPink1", 255, 20, 147 },
+{ "DeepPink2", 238, 18, 137 },
+{ "DeepPink3", 205, 16, 118 },
+{ "DeepPink4", 139, 10, 80 },
+{ "HotPink1", 255, 110, 180 },
+{ "HotPink2", 238, 106, 167 },
+{ "HotPink3", 205, 96, 144 },
+{ "HotPink4", 139, 58, 98 },
+{ "pink1", 255, 181, 197 },
+{ "pink2", 238, 169, 184 },
+{ "pink3", 205, 145, 158 },
+{ "pink4", 139, 99, 108 },
+{ "LightPink1", 255, 174, 185 },
+{ "LightPink2", 238, 162, 173 },
+{ "LightPink3", 205, 140, 149 },
+{ "LightPink4", 139, 95, 101 },
+{ "PaleVioletRed1", 255, 130, 171 },
+{ "PaleVioletRed2", 238, 121, 159 },
+{ "PaleVioletRed3", 205, 104, 137 },
+{ "PaleVioletRed4", 139, 71, 93 },
+{ "maroon1", 255, 52, 179 },
+{ "maroon2", 238, 48, 167 },
+{ "maroon3", 205, 41, 144 },
+{ "maroon4", 139, 28, 98 },
+{ "VioletRed1", 255, 62, 150 },
+{ "VioletRed2", 238, 58, 140 },
+{ "VioletRed3", 205, 50, 120 },
+{ "VioletRed4", 139, 34, 82 },
+{ "magenta1", 255, 0, 255 },
+{ "magenta2", 238, 0, 238 },
+{ "magenta3", 205, 0, 205 },
+{ "magenta4", 139, 0, 139 },
+{ "orchid1", 255, 131, 250 },
+{ "orchid2", 238, 122, 233 },
+{ "orchid3", 205, 105, 201 },
+{ "orchid4", 139, 71, 137 },
+{ "plum1", 255, 187, 255 },
+{ "plum2", 238, 174, 238 },
+{ "plum3", 205, 150, 205 },
+{ "plum4", 139, 102, 139 },
+{ "MediumOrchid1", 224, 102, 255 },
+{ "MediumOrchid2", 209, 95, 238 },
+{ "MediumOrchid3", 180, 82, 205 },
+{ "MediumOrchid4", 122, 55, 139 },
+{ "DarkOrchid1", 191, 62, 255 },
+{ "DarkOrchid2", 178, 58, 238 },
+{ "DarkOrchid3", 154, 50, 205 },
+{ "DarkOrchid4", 104, 34, 139 },
+{ "purple1", 155, 48, 255 },
+{ "purple2", 145, 44, 238 },
+{ "purple3", 125, 38, 205 },
+{ "purple4", 85, 26, 139 },
+{ "MediumPurple1", 171, 130, 255 },
+{ "MediumPurple2", 159, 121, 238 },
+{ "MediumPurple3", 137, 104, 205 },
+{ "MediumPurple4", 93, 71, 139 },
+{ "thistle1", 255, 225, 255 },
+{ "thistle2", 238, 210, 238 },
+{ "thistle3", 205, 181, 205 },
+{ "thistle4", 139, 123, 139 },
+{ "gray0", 0, 0, 0 },
+{ "grey0", 0, 0, 0 },
+{ "gray1", 3, 3, 3 },
+{ "grey1", 3, 3, 3 },
+{ "gray2", 5, 5, 5 },
+{ "grey2", 5, 5, 5 },
+{ "gray3", 8, 8, 8 },
+{ "grey3", 8, 8, 8 },
+{ "gray4", 10, 10, 10 },
+{ "grey4", 10, 10, 10 },
+{ "gray5", 13, 13, 13 },
+{ "grey5", 13, 13, 13 },
+{ "gray6", 15, 15, 15 },
+{ "grey6", 15, 15, 15 },
+{ "gray7", 18, 18, 18 },
+{ "grey7", 18, 18, 18 },
+{ "gray8", 20, 20, 20 },
+{ "grey8", 20, 20, 20 },
+{ "gray9", 23, 23, 23 },
+{ "grey9", 23, 23, 23 },
+{ "gray10", 26, 26, 26 },
+{ "grey10", 26, 26, 26 },
+{ "gray11", 28, 28, 28 },
+{ "grey11", 28, 28, 28 },
+{ "gray12", 31, 31, 31 },
+{ "grey12", 31, 31, 31 },
+{ "gray13", 33, 33, 33 },
+{ "grey13", 33, 33, 33 },
+{ "gray14", 36, 36, 36 },
+{ "grey14", 36, 36, 36 },
+{ "gray15", 38, 38, 38 },
+{ "grey15", 38, 38, 38 },
+{ "gray16", 41, 41, 41 },
+{ "grey16", 41, 41, 41 },
+{ "gray17", 43, 43, 43 },
+{ "grey17", 43, 43, 43 },
+{ "gray18", 46, 46, 46 },
+{ "grey18", 46, 46, 46 },
+{ "gray19", 48, 48, 48 },
+{ "grey19", 48, 48, 48 },
+{ "gray20", 51, 51, 51 },
+{ "grey20", 51, 51, 51 },
+{ "gray21", 54, 54, 54 },
+{ "grey21", 54, 54, 54 },
+{ "gray22", 56, 56, 56 },
+{ "grey22", 56, 56, 56 },
+{ "gray23", 59, 59, 59 },
+{ "grey23", 59, 59, 59 },
+{ "gray24", 61, 61, 61 },
+{ "grey24", 61, 61, 61 },
+{ "gray25", 64, 64, 64 },
+{ "grey25", 64, 64, 64 },
+{ "gray26", 66, 66, 66 },
+{ "grey26", 66, 66, 66 },
+{ "gray27", 69, 69, 69 },
+{ "grey27", 69, 69, 69 },
+{ "gray28", 71, 71, 71 },
+{ "grey28", 71, 71, 71 },
+{ "gray29", 74, 74, 74 },
+{ "grey29", 74, 74, 74 },
+{ "gray30", 77, 77, 77 },
+{ "grey30", 77, 77, 77 },
+{ "gray31", 79, 79, 79 },
+{ "grey31", 79, 79, 79 },
+{ "gray32", 82, 82, 82 },
+{ "grey32", 82, 82, 82 },
+{ "gray33", 84, 84, 84 },
+{ "grey33", 84, 84, 84 },
+{ "gray34", 87, 87, 87 },
+{ "grey34", 87, 87, 87 },
+{ "gray35", 89, 89, 89 },
+{ "grey35", 89, 89, 89 },
+{ "gray36", 92, 92, 92 },
+{ "grey36", 92, 92, 92 },
+{ "gray37", 94, 94, 94 },
+{ "grey37", 94, 94, 94 },
+{ "gray38", 97, 97, 97 },
+{ "grey38", 97, 97, 97 },
+{ "gray39", 99, 99, 99 },
+{ "grey39", 99, 99, 99 },
+{ "gray40", 102, 102, 102 },
+{ "grey40", 102, 102, 102 },
+{ "gray41", 105, 105, 105 },
+{ "grey41", 105, 105, 105 },
+{ "gray42", 107, 107, 107 },
+{ "grey42", 107, 107, 107 },
+{ "gray43", 110, 110, 110 },
+{ "grey43", 110, 110, 110 },
+{ "gray44", 112, 112, 112 },
+{ "grey44", 112, 112, 112 },
+{ "gray45", 115, 115, 115 },
+{ "grey45", 115, 115, 115 },
+{ "gray46", 117, 117, 117 },
+{ "grey46", 117, 117, 117 },
+{ "gray47", 120, 120, 120 },
+{ "grey47", 120, 120, 120 },
+{ "gray48", 122, 122, 122 },
+{ "grey48", 122, 122, 122 },
+{ "gray49", 125, 125, 125 },
+{ "grey49", 125, 125, 125 },
+{ "gray50", 127, 127, 127 },
+{ "grey50", 127, 127, 127 },
+{ "gray51", 130, 130, 130 },
+{ "grey51", 130, 130, 130 },
+{ "gray52", 133, 133, 133 },
+{ "grey52", 133, 133, 133 },
+{ "gray53", 135, 135, 135 },
+{ "grey53", 135, 135, 135 },
+{ "gray54", 138, 138, 138 },
+{ "grey54", 138, 138, 138 },
+{ "gray55", 140, 140, 140 },
+{ "grey55", 140, 140, 140 },
+{ "gray56", 143, 143, 143 },
+{ "grey56", 143, 143, 143 },
+{ "gray57", 145, 145, 145 },
+{ "grey57", 145, 145, 145 },
+{ "gray58", 148, 148, 148 },
+{ "grey58", 148, 148, 148 },
+{ "gray59", 150, 150, 150 },
+{ "grey59", 150, 150, 150 },
+{ "gray60", 153, 153, 153 },
+{ "grey60", 153, 153, 153 },
+{ "gray61", 156, 156, 156 },
+{ "grey61", 156, 156, 156 },
+{ "gray62", 158, 158, 158 },
+{ "grey62", 158, 158, 158 },
+{ "gray63", 161, 161, 161 },
+{ "grey63", 161, 161, 161 },
+{ "gray64", 163, 163, 163 },
+{ "grey64", 163, 163, 163 },
+{ "gray65", 166, 166, 166 },
+{ "grey65", 166, 166, 166 },
+{ "gray66", 168, 168, 168 },
+{ "grey66", 168, 168, 168 },
+{ "gray67", 171, 171, 171 },
+{ "grey67", 171, 171, 171 },
+{ "gray68", 173, 173, 173 },
+{ "grey68", 173, 173, 173 },
+{ "gray69", 176, 176, 176 },
+{ "grey69", 176, 176, 176 },
+{ "gray70", 179, 179, 179 },
+{ "grey70", 179, 179, 179 },
+{ "gray71", 181, 181, 181 },
+{ "grey71", 181, 181, 181 },
+{ "gray72", 184, 184, 184 },
+{ "grey72", 184, 184, 184 },
+{ "gray73", 186, 186, 186 },
+{ "grey73", 186, 186, 186 },
+{ "gray74", 189, 189, 189 },
+{ "grey74", 189, 189, 189 },
+{ "gray75", 191, 191, 191 },
+{ "grey75", 191, 191, 191 },
+{ "gray76", 194, 194, 194 },
+{ "grey76", 194, 194, 194 },
+{ "gray77", 196, 196, 196 },
+{ "grey77", 196, 196, 196 },
+{ "gray78", 199, 199, 199 },
+{ "grey78", 199, 199, 199 },
+{ "gray79", 201, 201, 201 },
+{ "grey79", 201, 201, 201 },
+{ "gray80", 204, 204, 204 },
+{ "grey80", 204, 204, 204 },
+{ "gray81", 207, 207, 207 },
+{ "grey81", 207, 207, 207 },
+{ "gray82", 209, 209, 209 },
+{ "grey82", 209, 209, 209 },
+{ "gray83", 212, 212, 212 },
+{ "grey83", 212, 212, 212 },
+{ "gray84", 214, 214, 214 },
+{ "grey84", 214, 214, 214 },
+{ "gray85", 217, 217, 217 },
+{ "grey85", 217, 217, 217 },
+{ "gray86", 219, 219, 219 },
+{ "grey86", 219, 219, 219 },
+{ "gray87", 222, 222, 222 },
+{ "grey87", 222, 222, 222 },
+{ "gray88", 224, 224, 224 },
+{ "grey88", 224, 224, 224 },
+{ "gray89", 227, 227, 227 },
+{ "grey89", 227, 227, 227 },
+{ "gray90", 229, 229, 229 },
+{ "grey90", 229, 229, 229 },
+{ "gray91", 232, 232, 232 },
+{ "grey91", 232, 232, 232 },
+{ "gray92", 235, 235, 235 },
+{ "grey92", 235, 235, 235 },
+{ "gray93", 237, 237, 237 },
+{ "grey93", 237, 237, 237 },
+{ "gray94", 240, 240, 240 },
+{ "grey94", 240, 240, 240 },
+{ "gray95", 242, 242, 242 },
+{ "grey95", 242, 242, 242 },
+{ "gray96", 245, 245, 245 },
+{ "grey96", 245, 245, 245 },
+{ "gray97", 247, 247, 247 },
+{ "grey97", 247, 247, 247 },
+{ "gray98", 250, 250, 250 },
+{ "grey98", 250, 250, 250 },
+{ "gray99", 252, 252, 252 },
+{ "grey99", 252, 252, 252 },
+{ "gray100", 255, 255, 255 },
+{ "grey100", 255, 255, 255 },
+{ "DarkGrey", 169, 169, 169 },
+{ "DarkGray", 169, 169, 169 },
+{ "DarkBlue", 0, 0, 139 },
+{ "DarkCyan", 0, 139, 139 },
+{ "DarkMagenta", 139, 0, 139 },
+{ "DarkRed", 139, 0, 0 },
+{ "LightGreen", 144, 238, 144 },
+{ NULL, 0 , 0, 0}
+};
diff --git a/svtools/source/filter.vcl/ixpm/xpmread.cxx b/svtools/source/filter.vcl/ixpm/xpmread.cxx
new file mode 100644
index 000000000000..af267eb0d961
--- /dev/null
+++ b/svtools/source/filter.vcl/ixpm/xpmread.cxx
@@ -0,0 +1,714 @@
+/*************************************************************************
+ *
+ * $RCSfile: xpmread.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _BMPACC_HXX
+#include <vcl/bmpacc.hxx>
+#endif
+#ifndef _GRAPH_HXX
+#include <vcl/graph.hxx>
+#endif
+#include "rgbtable.hxx"
+#define _XPMPRIVATE
+#include "xpmread.hxx"
+
+// -------------
+// - XPMReader -
+// -------------
+
+XPMReader::XPMReader( SvStream& rStm, void* pCallData ) :
+ mrIStm ( rStm ),
+ mnIdentifier ( XPMIDENTIFIER ),
+ mnTempAvail ( 0 ),
+ mnStatus ( 0 ),
+ mbTransparent ( FALSE ),
+ mnCpp ( 0 ),
+ mnWidth ( 0 ),
+ mnHeight ( 0 ),
+ mnColors ( 0 ),
+ mcThisByte ( 0 ),
+ mnLastPos ( rStm.Tell() ),
+ mpFastColorTable( NULL ),
+ mpColMap ( NULL ),
+ mpAcc ( NULL ),
+ mpMaskAcc ( NULL ),
+ mbStatus ( TRUE )
+{
+
+}
+
+// ------------------------------------------------------------------------
+
+XPMReader::~XPMReader()
+{
+ if( mpAcc )
+ maBmp.ReleaseAccess( mpAcc );
+}
+
+// ------------------------------------------------------------------------
+
+#ifdef WNT
+#pragma optimize ("",off)
+#endif
+
+ReadState XPMReader::ReadXPM( Graphic& rGraphic )
+{
+ ReadState eReadState;
+ BYTE cDummy;
+
+ // sehen, ob wir _alles_ lesen koennen
+ mrIStm.Seek( STREAM_SEEK_TO_END );
+ mrIStm >> cDummy;
+
+ // falls wir nicht alles lesen koennen
+ // kehren wir zurueck und warten auf neue Daten
+ if ( mrIStm.GetError() != ERRCODE_IO_PENDING )
+ {
+ mrIStm.Seek( mnLastPos );
+ mbStatus = TRUE;
+
+ if ( mbStatus )
+ {
+ mpStringBuf = new BYTE [ XPMSTRINGBUF ];
+ mpTempBuf = new BYTE [ XPMTEMPBUFSIZE ];
+
+ if ( ( mbStatus = ImplGetString() ) == TRUE )
+ {
+ mnIdentifier = XPMVALUES; // Bitmap informationen einholen
+ mnWidth = ImplGetULONG( 0 );
+ mnHeight = ImplGetULONG( 1 );
+ mnColors = ImplGetULONG( 2 );
+ mnCpp = ImplGetULONG( 3 );
+ }
+ if ( mbStatus && mnWidth && mnHeight && mnColors && mnCpp )
+ {
+ mnIdentifier = XPMCOLORS;
+
+ // mpColMap beinhaltet für jede vorhandene
+ // Farbe: ( mnCpp )Byte(s)-> ASCII Eintrag der der Farbe zugeordnet ist
+ // 1 Byte -> 0xff wenn Farbe transparent ist
+ // 3 Bytes -> RGB Wert der Farbe
+ mpColMap = new BYTE[ mnColors * ( 4 + mnCpp ) ];
+
+ for ( ULONG i = 0; i < mnColors; i++ )
+ {
+ if ( ImplGetColor( i ) == FALSE )
+ {
+ mbStatus = FALSE;
+ break;
+ }
+ }
+ if ( mbStatus )
+ {
+ // bei mehr als 256 Farben wird eine 24 Bit Grafik erstellt
+ maBmp = Bitmap( Size( mnWidth, mnHeight ), ( mnColors > 256 ) ? 24 : 8 );
+ mpAcc = maBmp.AcquireWriteAccess();
+
+ // mbTransparent ist TRUE wenn mindestens eine Farbe Transparent ist
+ if ( mbTransparent )
+ {
+ maMaskBmp = Bitmap( Size( mnWidth, mnHeight ), 1 );
+ if ( ( mpMaskAcc = maMaskBmp.AcquireWriteAccess() ) == NULL )
+ mbStatus = FALSE;
+ }
+ if( mpAcc && mbStatus )
+ {
+ ULONG i;
+ if ( mnColors <=256 ) // palette is only needed by using less than 257
+ { // colors
+
+ BYTE* pPtr = &mpColMap[mnCpp];
+
+ for ( i = 0; i < mnColors; i++ )
+ {
+ mpAcc->SetPaletteColor( (BYTE)i, Color( pPtr[1], pPtr[2], pPtr[3] ) );
+ pPtr += ( mnCpp + 4 );
+ }
+ // using 2 charakters per pixel and less than 257 Colors we speed up
+ if ( mnCpp == 2 ) // by using a 64kb indexing table
+ {
+ mpFastColorTable = new BYTE[ 256 * 256 ];
+ for ( pPtr = mpColMap, i = 0; i < mnColors; i++, pPtr += mnCpp + 4 )
+ {
+ ULONG j = pPtr[ 0 ] << 8;
+ j += pPtr[ 1 ];
+ mpFastColorTable[ j ] = (BYTE)i;
+ }
+ }
+ }
+ // now we get the bitmap data
+ mnIdentifier = XPMPIXELS;
+ for ( i = 0; i < mnHeight; i++ )
+ {
+ if ( ImplGetScanLine( i ) == FALSE )
+ {
+ mbStatus = FALSE;
+ break;
+ }
+ }
+ mnIdentifier = XPMEXTENSIONS;
+ }
+ }
+ }
+
+ delete[] mpFastColorTable;
+ delete[] mpColMap;
+ delete[] mpStringBuf;
+ delete[] mpTempBuf;
+
+ }
+ if( mbStatus )
+ {
+ if ( mpMaskAcc )
+ {
+ maMaskBmp.ReleaseAccess ( mpMaskAcc), mpMaskAcc = NULL;
+ maBmp.ReleaseAccess( mpAcc ), mpAcc = NULL;
+ rGraphic = Graphic( BitmapEx( maBmp, maMaskBmp ) );
+ }
+ else
+ {
+ maBmp.ReleaseAccess( mpAcc ), mpAcc = NULL;
+ rGraphic = maBmp;
+ }
+ eReadState = XPMREAD_OK;
+ }
+ else
+ {
+ if ( mpMaskAcc ) maMaskBmp.ReleaseAccess ( mpMaskAcc), mpMaskAcc = NULL;
+ if ( mpAcc ) maBmp.ReleaseAccess( mpAcc ), mpAcc = NULL;
+ eReadState = XPMREAD_ERROR;
+ }
+ }
+ else
+ {
+ mrIStm.ResetError();
+ eReadState = XPMREAD_NEED_MORE;
+ }
+ return eReadState;
+}
+
+#ifdef WNT
+#pragma optimize ("",on)
+#endif
+
+// ------------------------------------------------------------------------
+// ImplGetColor ermittelt sämtliche Farbwerte,
+// die Rückgabe ist TRUE wenn sämtliche Farben zugeordnet werden konnten
+
+BOOL XPMReader::ImplGetColor( ULONG nNumb )
+{
+ BYTE* pString = mpStringBuf;
+ BYTE* pPtr = ( mpColMap + nNumb * ( 4 + mnCpp ) );
+ BOOL bStatus = ImplGetString();
+
+ if ( bStatus )
+ {
+ for ( ULONG i = 0; i < mnCpp; i++ )
+ *pPtr++ = *pString++;
+ bStatus = ImplGetColSub ( pPtr );
+ }
+ return bStatus;
+}
+
+// ------------------------------------------------------------------------
+// ImpGetScanLine liest den String mpBufSize aus und schreibt die Pixel in die
+// Bitmap. Der Parameter nY gibt die horizontale Position an.
+
+BOOL XPMReader::ImplGetScanLine( ULONG nY )
+{
+ BOOL bStatus = ImplGetString();
+ BYTE* pString = mpStringBuf;
+ BYTE* pColor;
+ BitmapColor aWhite;
+ BitmapColor aBlack;
+
+ if ( bStatus )
+ {
+ if ( mpMaskAcc )
+ {
+ aWhite = mpMaskAcc->GetBestMatchingColor( Color( COL_WHITE ) );
+ aBlack = mpMaskAcc->GetBestMatchingColor( Color( COL_BLACK ) );
+ }
+ if ( mnStringSize != ( mnWidth * mnCpp ))
+ bStatus = FALSE;
+ else
+ {
+ ULONG i, j;
+ if ( mpFastColorTable )
+ {
+ for ( i = 0; i < mnWidth; i++ )
+ {
+ j = (*pString++) << 8;
+ j += *pString++;
+ BYTE k = (BYTE)mpFastColorTable[ j ];
+ mpAcc->SetPixel( nY, i, BitmapColor( (BYTE)k ) );
+
+ if ( mpMaskAcc )
+ mpMaskAcc->SetPixel( nY, i,
+ ( mpColMap[ k * (mnCpp + 4) + mnCpp] ) ? aWhite : aBlack );
+ }
+ }
+ else for ( i = 0; i < mnWidth; i++ )
+ {
+ pColor = mpColMap;
+ for ( j = 0; j < mnColors; j++ )
+ {
+ if ( ImplCompare( pString, pColor, mnCpp, XPMCASESENSITIVE ) == TRUE )
+ {
+ if ( mnColors > 256 )
+ mpAcc->SetPixel( nY, i, Color ( pColor[3], pColor[4], pColor[5] ) );
+ else
+ mpAcc->SetPixel( nY, i, BitmapColor( (BYTE) j ) );
+
+ if ( mpMaskAcc )
+ mpMaskAcc->SetPixel( nY, i, (
+ pColor[ mnCpp ] ) ? aWhite : aBlack );
+
+ break;
+ }
+ pColor += ( mnCpp + 4 );
+ }
+ pString += mnCpp;
+ }
+
+ }
+ }
+ return bStatus;
+}
+
+// ------------------------------------------------------------------------
+// versucht aus mpStringBuf einen Farbwert zu übermitteln
+// wurde eine Farbe gefunden wird an pDest[1]..pDest[2] der RGB wert geschrieben
+// pDest[0] enthält 0xff wenn die Farbe transparent ist sonst 0
+
+BOOL XPMReader::ImplGetColSub( BYTE* pDest )
+{
+ unsigned char cTransparent[] = "None";
+
+ BOOL bColStatus = FALSE;
+
+ if ( ImplGetColKey( 'c' ) || ImplGetColKey( 'm' ) || ImplGetColKey( 'g' ) )
+ {
+ // hexentry for RGB or HSV color ?
+ if ( *mpPara == '#' )
+ {
+ *pDest++ = 0;
+ bColStatus = TRUE;
+ switch ( mnParaSize )
+ {
+ case 25 :
+ ImplGetRGBHex ( pDest, 6 );
+ break;
+ case 13 :
+ ImplGetRGBHex ( pDest, 2 );
+ break;
+ case 7 :
+ ImplGetRGBHex ( pDest, 0 );
+ break;
+ default:
+ bColStatus = FALSE;
+ break;
+ }
+ }
+ // maybe pixel is transparent
+ else if ( ImplCompare( &cTransparent[0], mpPara, 4 ))
+ {
+ *pDest++ = 0xff;
+ bColStatus = TRUE;
+ mbTransparent = TRUE;
+ }
+ // last we will try to get the colorname
+ else if ( mnParaSize > 2 ) // name must enlarge the minimum size
+ {
+ ULONG i = 0;
+ while ( TRUE )
+ {
+ if ( pRGBTable[ i ].name == NULL )
+ break;
+ if ( pRGBTable[ i ].name[ mnParaSize ] == 0 )
+ {
+ if ( ImplCompare ( (unsigned char*)pRGBTable[ i ].name,
+ mpPara, mnParaSize, XPMCASENONSENSITIVE ) )
+ {
+ bColStatus = TRUE;
+ *pDest++ = 0;
+ *pDest++ = pRGBTable[ i ].red;
+ *pDest++ = pRGBTable[ i ].green;
+ *pDest++ = pRGBTable[ i ].blue;
+ }
+ }
+ i++;
+ }
+ }
+ }
+ return bColStatus;
+}
+
+// ------------------------------------------------------------------------
+// ImplGetColKey durchsuch den String mpStringBuf nach einem Parameter 'nKey'
+// und gibt einen BOOL zurück. ( wenn TRUE werden mpPara und mnParaSize gesetzt )
+
+BOOL XPMReader::ImplGetColKey( BYTE nKey )
+{
+ BYTE nTemp, nPrev = ' ';
+
+ mpPara = mpStringBuf + mnCpp + 1;
+ mnParaSize = 0;
+
+ while ( *mpPara != 0 )
+ {
+ if ( *mpPara == nKey )
+ {
+ nTemp = *( mpPara + 1 );
+ if ( nTemp == ' ' || nTemp == 0x09 )
+ {
+ if ( nPrev == ' ' || nPrev == 0x09 )
+ break;
+ }
+ }
+ nPrev = *mpPara;
+ *mpPara++;
+ }
+ if ( *mpPara )
+ {
+ mpPara++;
+ while ( (*mpPara == ' ') || (*mpPara == 0x09) )
+ {
+ mpPara++;
+ }
+ if ( *mpPara != 0 )
+ {
+ while ( *(mpPara+mnParaSize) != ' ' && *(mpPara+mnParaSize) != 0x09 &&
+ *(mpPara+mnParaSize) != 0 )
+ {
+ mnParaSize++;
+ }
+ }
+ }
+ return ( mnParaSize ) ? TRUE : FALSE;
+}
+
+// ------------------------------------------------------------------------
+// ImplGetRGBHex übersetzt den ASCII-Hexadezimalwert der sich bei mpPara befindet
+// in einen RGB wert und schreibt diesen nach pDest
+// folgende Formate müssen sich bei mpPara befinden:
+// wenn nAdd = 0 : '#12ab12' -> RGB = 0x12, 0xab, 0x12
+// 2 : '#1234abcd1234' " " " "
+// 6 : '#12345678abcdefab12345678' " " " "
+
+
+void XPMReader::ImplGetRGBHex( BYTE* pDest,ULONG nAdd )
+{
+ BYTE* pPtr = mpPara+1;
+ BYTE nHex, nTemp;
+
+ for ( ULONG i = 0; i < 3; i++ )
+ {
+ nHex = (*pPtr++) - '0';
+ if ( nHex > 9 )
+ nHex = ((nHex - 'A' + '0') & 7) + 10;
+
+ nTemp = (*pPtr++) - '0';
+ if ( nTemp > 9 )
+ nTemp = ((nTemp - 'A' + '0') & 7) + 10;
+ nHex = ( nHex << 4 ) + nTemp;
+
+ pPtr += nAdd;
+ *pDest++ = (BYTE)nHex;
+ }
+}
+
+// ------------------------------------------------------------------------
+// ImplGetUlong gibt den wert einer bis zu 6stelligen ASCII-Dezimalzahl zurück.
+
+ULONG XPMReader::ImplGetULONG( ULONG nPara )
+{
+ if ( ImplGetPara ( nPara ) )
+ {
+ ULONG nRetValue = 0;
+ BYTE* pPtr = mpPara;
+
+ if ( ( mnParaSize > 6 ) || ( mnParaSize == 0 ) ) return 0;
+ for ( ULONG i = 0; i < mnParaSize; i++ )
+ {
+ BYTE j = (*pPtr++) - 48;
+ if ( j > 9 ) return 0; // ascii is invalid
+ nRetValue*=10;
+ nRetValue+=j;
+ }
+ return nRetValue;
+ }
+ else return 0;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL XPMReader::ImplCompare( BYTE* pSource, BYTE* pDest, ULONG nSize, ULONG nMode )
+{
+ BOOL bRet = TRUE;
+
+ if ( nMode == XPMCASENONSENSITIVE )
+ {
+ for ( ULONG i = 0; i < nSize; i++ )
+ {
+ if ( ( pSource[i]&~0x20 ) != ( pDest[i]&~0x20 ) )
+ {
+ bRet = FALSE;
+ break;
+ }
+ }
+ }
+ else
+ {
+ for ( ULONG i = 0; i < nSize; i++ )
+ {
+ if ( pSource[i] != pDest[i] )
+ {
+ bRet = FALSE;
+ break;
+ }
+ }
+ }
+ return bRet;
+}
+
+// ------------------------------------------------------------------------
+// ImplGetPara versucht den nNumb ( 0...x ) Parameter aus mpStringBuf zu ermitteln.
+// Ein Parameter ist durch Spaces oder Tabs von den anderen getrennt.
+// Konnte der Parameter gefunden werden ist der Rückgabewert TRUE und mpPara + mnParaSize
+// werden gesetzt.
+
+BOOL XPMReader::ImplGetPara ( ULONG nNumb )
+{
+ BYTE nByte;
+ ULONG pSize = 0;
+ BYTE* pPtr = mpStringBuf;
+ ULONG nCount = 0;
+
+ if ( ( *pPtr != ' ' ) && ( *pPtr != 0x09 ) )
+ {
+ mpPara = pPtr;
+ mnParaSize = 0;
+ nCount = 0;
+ }
+ else
+ {
+ mpPara = NULL;
+ nCount = 0xffffffff;
+ }
+
+ while ( pSize < mnStringSize )
+ {
+ nByte = *pPtr;
+
+ if ( mpPara )
+ {
+ if ( ( nByte == ' ' ) || ( nByte == 0x09 ) )
+ {
+ if ( nCount == nNumb )
+ break;
+ else
+ mpPara = NULL;
+ }
+ else
+ mnParaSize++;
+ }
+ else
+ {
+ if ( ( nByte != ' ' ) && ( nByte != 0x09 ) )
+ {
+ mpPara = pPtr;
+ mnParaSize = 1;
+ nCount++;
+ }
+ }
+ pSize++;
+ pPtr++;
+ }
+ return ( ( nCount == nNumb ) && ( mpPara ) ) ? TRUE : FALSE;
+}
+
+// ------------------------------------------------------------------------
+// Der nächste String wird ausgelesen und in mpStringBuf (mit 0 abgeschloßen) abgelegt;
+// mnStringSize enthält die Größe des gelesenen Strings.
+// Bemerkungen wie '//' und '/*.....*/' werden übersprungen.
+
+BOOL XPMReader::ImplGetString( void )
+{
+ BYTE sID[] = "/* XPM */";
+ BYTE* pString = mpStringBuf;
+
+ mnStringSize = 0;
+ mpStringBuf[0] = 0;
+
+ while( mbStatus && ( mnStatus != XPMFINISHED ) )
+ {
+ if ( mnTempAvail == 0 )
+ {
+ mnTempAvail = mrIStm.Read( mpTempBuf, XPMTEMPBUFSIZE );
+ if ( mnTempAvail == 0 )
+ break;
+
+ mpTempPtr = mpTempBuf;
+
+ if ( mnIdentifier == XPMIDENTIFIER )
+ {
+ if ( mnTempAvail <= 50 )
+ {
+ mbStatus = FALSE; // file is too short to be a correct XPM format
+ break;
+ }
+ for ( int i = 0; i < 9; i++ ) // searching for "/* XPM */"
+ if ( *mpTempPtr++ != sID[i] )
+ {
+ mbStatus = FALSE;
+ break;
+ }
+ mnTempAvail-=9;
+ mnIdentifier++;
+ }
+ }
+ mcLastByte = mcThisByte;
+ mcThisByte = *mpTempPtr++;
+ mnTempAvail--;
+
+ if ( mnStatus & XPMDOUBLE )
+ {
+ if ( mcThisByte == 0x0a )
+ mnStatus &=~XPMDOUBLE;
+ continue;
+ }
+ if ( mnStatus & XPMREMARK )
+ {
+ if ( ( mcThisByte == '/' ) && ( mcLastByte == '*' ) )
+ mnStatus &=~XPMREMARK;
+ continue;
+ }
+ if ( mnStatus & XPMSTRING ) // characters in string
+ {
+ if ( mcThisByte == '"' )
+ {
+ mnStatus &=~XPMSTRING; // end of parameter by eol
+ break;
+ }
+ if ( mnStringSize >= XPMSTRINGBUF )
+ {
+ mbStatus = FALSE;
+ break;
+ }
+ *pString++ = mcThisByte;
+ pString[0] = 0;
+ mnStringSize++;
+ continue;
+ }
+ else
+ { // characters beside string
+ switch ( mcThisByte )
+ {
+ case '*' :
+ if ( mcLastByte == '/' ) mnStatus |= XPMREMARK;
+ break;
+ case '/' :
+ if ( mcLastByte == '/' ) mnStatus |= XPMDOUBLE;
+ break;
+ case '"' : mnStatus |= XPMSTRING;
+ break;
+ case '{' :
+ if ( mnIdentifier == XPMDEFINITION )
+ mnIdentifier++;
+ break;
+ case '}' :
+ if ( mnIdentifier == XPMENDEXT )
+ mnStatus = XPMFINISHED;
+ break;
+ }
+ }
+ }
+ return mbStatus;
+}
+
+// -------------
+// - ImportXPM -
+// -------------
+
+BOOL ImportXPM( SvStream& rStm, Graphic& rGraphic, void* pCallerData )
+{
+ XPMReader* pXPMReader = (XPMReader*) rGraphic.GetContext();
+ ReadState eReadState;
+ BOOL bRet = TRUE;
+
+ if( !pXPMReader )
+ pXPMReader = new XPMReader( rStm, pCallerData );
+
+ rGraphic.SetContext( NULL );
+ eReadState = pXPMReader->ReadXPM( rGraphic );
+
+ if( eReadState == XPMREAD_ERROR )
+ {
+ bRet = FALSE;
+ delete pXPMReader;
+ }
+ else if( eReadState == XPMREAD_OK )
+ delete pXPMReader;
+ else
+ rGraphic.SetContext( pXPMReader );
+
+ return bRet;
+}
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx
new file mode 100644
index 000000000000..36865f13210f
--- /dev/null
+++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx
@@ -0,0 +1,565 @@
+/*************************************************************************
+ *
+ * $RCSfile: jpeg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+extern "C"
+{
+ #include "jpeg/jpeg.h"
+}
+
+#define _JPEGPRIVATE
+
+#include <vcl/config.hxx>
+#include <tools/new.hxx>
+#include <vcl/bmpacc.hxx>
+#include "jpeg.hxx"
+
+// -----------
+// - Defines -
+// -----------
+
+#define JPEGMINREAD 512
+
+// -------------
+// - (C-Calls) -
+// -------------
+
+extern "C" void* JPEGMalloc( size_t nSize )
+{
+ return (void*) new BYTE[ nSize ];
+}
+
+// ------------------------------------------------------------------------
+
+extern "C" void JPEGFree( void* pBuf )
+{
+ delete[] (BYTE*) pBuf;
+}
+
+// ------------------------------------------------------------------------
+
+extern "C" long StreamRead( void* pIStm, void* pBuffer, long nBufferSize )
+{
+ SvStream* pSvStm = (SvStream*) pIStm;
+ long nRead;
+
+ if( pSvStm->GetError() != ERRCODE_IO_PENDING )
+ {
+ long nActPos = pSvStm->Tell();
+
+ nRead = (long) pSvStm->Read( pBuffer, nBufferSize );
+
+ if( pSvStm->GetError() == ERRCODE_IO_PENDING )
+ {
+ nRead = 0;
+
+ // Damit wir wieder an die alte Position
+ // seeken koennen, setzen wir den Error temp.zurueck
+ pSvStm->ResetError();
+ pSvStm->Seek( nActPos );
+ pSvStm->SetError( ERRCODE_IO_PENDING );
+ }
+ }
+ else
+ nRead = 0;
+
+ return nRead;
+}
+
+// ------------------------------------------------------------------------
+
+extern "C" long StreamWrite( void* pOStm, void* pBuffer, long nBufferSize )
+{
+ return (long) ( (SvStream*) pOStm )->Write( pBuffer, nBufferSize );
+}
+
+// ------------------------------------------------------------------------
+
+extern "C" void* CreateBitmap( void* pJPEGReader, long nWidth, long nHeight, long bGray,
+ long* pAlignedWidth, long* pTopDown )
+
+{
+ return ( (JPEGReader*) pJPEGReader )->CreateBitmap( Size( nWidth, nHeight ), (BOOL) bGray,
+ *pAlignedWidth, *pTopDown );
+}
+
+// ------------------------------------------------------------------------
+
+extern "C" void* GetScanline( void* pJPEGWriter, long nY )
+{
+ return ( (JPEGWriter*) pJPEGWriter )->GetScanline( nY );
+}
+
+// ------------------------------------------------------------------------
+
+extern "C" long JPEGCallback( void* pCallbackData, long nPercent )
+{
+/*
+ MyCallbackHandler* pH = (MyCallbackHandler*) pCallbackData;
+
+ if ( pH->pCallback )
+ {
+ return (short) (pH->pCallback) ( pH->pCallerData,
+ (USHORT) (pH->nMinPercent+(pH->nMaxPercent-pH->nMinPercent) * nPercent / 100 ) );
+ }
+*/
+
+ return 0L;
+}
+
+// --------------
+// - JPEGReader -
+// --------------
+
+JPEGReader::JPEGReader( SvStream& rStm, void* pCallData ) :
+ rIStm ( rStm ),
+ pAcc ( NULL ),
+ pAcc1 ( NULL ),
+ pBuffer ( NULL ),
+ nLastPos ( rStm.Tell() ),
+ nLastLines ( 0 )
+{
+ maUpperName = String::CreateFromAscii( "SVIJPEG", 7 );
+ nFormerPos = nLastPos;
+}
+
+// ------------------------------------------------------------------------
+
+JPEGReader::~JPEGReader()
+{
+ if( pBuffer )
+ SvMemFree( pBuffer );
+
+ if( pAcc )
+ aBmp.ReleaseAccess( pAcc );
+
+ if( pAcc1 )
+ aBmp1.ReleaseAccess( pAcc1 );
+}
+
+// ------------------------------------------------------------------------
+
+void* JPEGReader::CreateBitmap( const Size& rSize, BOOL bGray,
+ long& rAlignedWidth, long& rTopDown )
+{
+ void* pBmpBuf = NULL;
+
+ if( pAcc )
+ aBmp.ReleaseAccess( pAcc );
+
+ if( bGray )
+ {
+ BitmapPalette aGrayPal( 256 );
+
+ for( USHORT n = 0; n < 256; n++ )
+ {
+ const BYTE cGray = (BYTE) n;
+ aGrayPal[ n ] = BitmapColor( cGray, cGray, cGray );
+ }
+
+ aBmp = Bitmap( rSize, 8, &aGrayPal );
+ }
+ else
+ aBmp = Bitmap( rSize, 24 );
+
+ pAcc = aBmp.AcquireWriteAccess();
+
+ if( pAcc )
+ {
+ const ULONG nFormat = pAcc->GetScanlineFormat();
+
+ if( ( bGray && ( BMP_FORMAT_8BIT_PAL == nFormat ) ) ||
+ ( !bGray && ( BMP_FORMAT_24BIT_TC_BGR == nFormat ) ) )
+ {
+ pBmpBuf = pAcc->GetBuffer();
+ rAlignedWidth = pAcc->GetScanlineSize();
+ rTopDown = pAcc->IsTopDown();
+ }
+ else
+ {
+ rAlignedWidth = AlignedWidth4Bytes( rSize.Width() * ( bGray ? 8 : 24 ) );
+ rTopDown = TRUE;
+ pBmpBuf = pBuffer = SvMemAlloc( rAlignedWidth * rSize.Height() );
+ }
+ }
+
+ return pBmpBuf;
+}
+
+// ------------------------------------------------------------------------
+
+void JPEGReader::FillBitmap()
+{
+ if( pBuffer && pAcc )
+ {
+ HPBYTE pTmp;
+ BitmapColor aColor;
+ long nAlignedWidth;
+ long nWidth = pAcc->Width();
+ long nHeight = pAcc->Height();
+
+ if( pAcc->GetBitCount() == 8 )
+ {
+ BitmapColor* pCols = new BitmapColor[ 256 ];
+
+ for( USHORT n = 0; n < 256; n++ )
+ {
+ const BYTE cGray = (BYTE) n;
+ pCols[ n ] = pAcc->GetBestMatchingColor( BitmapColor( cGray, cGray, cGray ) );
+ }
+
+ nAlignedWidth = AlignedWidth4Bytes( pAcc->Width() * 8L );
+
+ for( long nY = 0L; nY < nHeight; nY++ )
+ {
+ pTmp = (BYTE*) pBuffer + nY * nAlignedWidth;
+
+ for( long nX = 0L; nX < nWidth; nX++ )
+ pAcc->SetPixel( nY, nX, pCols[ *pTmp++ ] );
+ }
+
+ delete[] pCols;
+ }
+ else
+ {
+ nAlignedWidth = AlignedWidth4Bytes( pAcc->Width() * 24L );
+
+ for( long nY = 0L; nY < nHeight; nY++ )
+ {
+ pTmp = (BYTE*) pBuffer + nY * nAlignedWidth;
+
+ for( long nX = 0L; nX < nWidth; nX++ )
+ {
+ aColor.SetBlue( *pTmp++ );
+ aColor.SetGreen( *pTmp++ );
+ aColor.SetRed( *pTmp++ );
+ pAcc->SetPixel( nY, nX, aColor );
+ }
+ }
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
+Graphic JPEGReader::CreateIntermediateGraphic( const Bitmap& rBitmap, long nLines )
+{
+ Graphic aGraphic;
+ const Size aSizePix( rBitmap.GetSizePixel() );
+
+ if( !nLastLines )
+ {
+ if( pAcc1 )
+ aBmp1.ReleaseAccess( pAcc1 );
+
+ aBmp1 = Bitmap( rBitmap.GetSizePixel(), 1 );
+ aBmp1.Erase( Color( COL_WHITE ) );
+ pAcc1 = aBmp1.AcquireWriteAccess();
+ }
+
+ if( nLines && ( nLines < aSizePix.Height() ) )
+ {
+ if( pAcc1 )
+ {
+ const long nNewLines = nLines - nLastLines;
+
+ if( nNewLines )
+ {
+ pAcc1->SetFillColor( Color( COL_BLACK ) );
+ pAcc1->FillRect( Rectangle( Point( 0, nLastLines ),
+ Size( pAcc1->Width(), nNewLines ) ) );
+ }
+
+ aBmp1.ReleaseAccess( pAcc1 );
+ aGraphic = BitmapEx( rBitmap, aBmp1 );
+ pAcc1 = aBmp1.AcquireWriteAccess();
+ }
+ else
+ aGraphic = rBitmap;
+ }
+ else
+ aGraphic = rBitmap;
+
+ nLastLines = nLines;
+
+ return aGraphic;
+}
+
+// ------------------------------------------------------------------------
+
+ReadState JPEGReader::Read( Graphic& rGraphic )
+{
+ long nEndPos;
+ long nLines;
+ ReadState eReadState;
+ BOOL bRet = FALSE;
+ BYTE cDummy;
+
+ // sehen, ob wir _alles_ lesen koennen
+ rIStm.Seek( STREAM_SEEK_TO_END );
+ rIStm >> cDummy;
+ nEndPos = rIStm.Tell();
+
+ // falls wir nicht alles lesen koennen, gucken wir,
+ // ob min. JPEGMINREAD Bytes gelesen werden koennen
+ if( rIStm.GetError() == ERRCODE_IO_PENDING )
+ {
+ rIStm.ResetError();
+ if( ( nEndPos - nFormerPos ) < JPEGMINREAD )
+ {
+ rIStm.Seek( nLastPos );
+ return JPEGREAD_NEED_MORE;
+ }
+ }
+
+ // an Anfang springen
+ rIStm.Seek( nLastPos );
+
+ // (Teil-) Bild einlesen
+ ReadJPEG( this, &rIStm, &nLines );
+
+ if( pAcc )
+ {
+ if( pBuffer )
+ {
+ FillBitmap();
+ SvMemFree( pBuffer );
+ pBuffer = NULL;
+ }
+
+ aBmp.ReleaseAccess( pAcc );
+ pAcc = NULL;
+
+ if( rIStm.GetError() == ERRCODE_IO_PENDING )
+ rGraphic = CreateIntermediateGraphic( aBmp, nLines );
+ else
+ rGraphic = aBmp;
+
+ bRet = TRUE;
+ }
+ else if( rIStm.GetError() == ERRCODE_IO_PENDING )
+ bRet = TRUE;
+
+ // Status setzen ( Pending hat immer Vorrang )
+ if( rIStm.GetError() == ERRCODE_IO_PENDING )
+ {
+ eReadState = JPEGREAD_NEED_MORE;
+ rIStm.ResetError();
+ nFormerPos = rIStm.Tell();
+ }
+ else
+ {
+ if( bRet )
+ eReadState = JPEGREAD_OK;
+ else
+ eReadState = JPEGREAD_ERROR;
+ }
+
+ return eReadState;
+}
+
+
+// --------------
+// - JPEGWriter -
+// --------------
+
+JPEGWriter::JPEGWriter( SvStream& rStm, PFilterCallback pClb, void* pData, Config* pCfg ) :
+ rOStm ( rStm ),
+ pAcc ( NULL ),
+ pBuffer ( NULL ),
+ pCallback ( pClb ),
+ pCallerData ( pData ),
+ pConfig ( pCfg )
+{
+}
+
+// ------------------------------------------------------------------------
+
+void* JPEGWriter::GetScanline( long nY )
+{
+ void* pScanline = NULL;
+
+ if( pAcc )
+ {
+ if( bNative )
+ pScanline = pAcc->GetScanline( nY );
+ else if( pBuffer )
+ {
+ BitmapColor aColor;
+ long nWidth = pAcc->Width();
+ BYTE* pTmp = pBuffer;
+
+ if( pAcc->HasPalette() )
+ {
+ for( long nX = 0L; nX < nWidth; nX++ )
+ {
+ aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
+ *pTmp++ = aColor.GetBlue();
+ *pTmp++ = aColor.GetGreen();
+ *pTmp++ = aColor.GetRed();
+ }
+ }
+ else
+ {
+ for( long nX = 0L; nX < nWidth; nX++ )
+ {
+ aColor = pAcc->GetPixel( nY, nX );
+ *pTmp++ = aColor.GetBlue();
+ *pTmp++ = aColor.GetGreen();
+ *pTmp++ = aColor.GetRed();
+ }
+ }
+
+ pScanline = pBuffer;
+ }
+ }
+
+ return pScanline;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL JPEGWriter::Write( const Graphic& rGraphic )
+{
+ BOOL bRet;
+
+ aBmp = rGraphic.GetBitmap();
+ pAcc = aBmp.AcquireReadAccess();
+
+ if( pAcc )
+ {
+// MyCallbackHandler aCbH;
+
+// aCbH.pCallback = pCallback;
+// aCbH.pCallerData = pCallerData;
+// aCbH.nMinPercent = 0;
+// aCbH.nMaxPercent = 99;
+
+ long nQuality = 75;
+
+ if( pConfig )
+ nQuality = Min( pConfig->ReadKey( "JPG-EXPORT-QUALITY", ByteString::CreateFromInt32(nQuality) ).ToInt32(), (INT32)100 );
+
+ bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR );
+
+ if( !bNative )
+ pBuffer = new BYTE[ AlignedWidth4Bytes( pAcc->Width() * 24L ) ];
+
+ bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), nQuality, NULL );
+// bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), nQuality, &aCbH );
+
+ delete[] pBuffer;
+ pBuffer = NULL;
+
+ aBmp.ReleaseAccess( pAcc );
+ pAcc = NULL;
+ }
+ else
+ bRet = FALSE;
+
+ return bRet;
+}
+
+// --------------
+// - ImportJPEG -
+// --------------
+
+BOOL ImportJPEG( SvStream& rStm, Graphic& rGraphic, void* pCallerData )
+{
+ JPEGReader* pJPEGReader = (JPEGReader*) rGraphic.GetContext();
+ ReadState eReadState;
+ BOOL bRet = TRUE;
+
+ if( !pJPEGReader )
+ pJPEGReader = new JPEGReader( rStm, pCallerData );
+
+ rGraphic.SetContext( NULL );
+ eReadState = pJPEGReader->Read( rGraphic );
+
+ if( eReadState == JPEGREAD_ERROR )
+ {
+ bRet = FALSE;
+ delete pJPEGReader;
+ }
+ else if( eReadState == JPEGREAD_OK )
+ delete pJPEGReader;
+ else
+ rGraphic.SetContext( pJPEGReader );
+
+ const GraphicType eType = rGraphic.GetType();
+
+ if( eType != GRAPHIC_BITMAP )
+ {
+ ;
+ }
+
+ return bRet;
+}
+
+// --------------
+// - ExportJPEG -
+// --------------
+
+BOOL ExportJPEG( SvStream& rOStm, const Graphic& rGraphic,
+ PFilterCallback pCallback, void* pCallerData, Config* pOptionsConfig )
+{
+ JPEGWriter aJPEGWriter( rOStm, pCallback, pCallerData, pOptionsConfig );
+ return aJPEGWriter.Write( rGraphic );
+}
diff --git a/svtools/source/filter.vcl/jpeg/makefile.mk b/svtools/source/filter.vcl/jpeg/makefile.mk
new file mode 100644
index 000000000000..5a714ad0fb73
--- /dev/null
+++ b/svtools/source/filter.vcl/jpeg/makefile.mk
@@ -0,0 +1,96 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=SVTOOLS
+TARGET=jpeg
+DEPTARGET=vjpeg
+TARGET2=jpg
+
+
+# --- Settings -----------------------------------------------------------
+
+.IF "$(VCL)" != ""
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+
+.IF "$(GUI)$(CPU)"=="WNTP"
+CFLAGS=$(CFLAGS) -Od
+.ENDIF
+
+# --- Files --------------------------------------------------------
+
+
+SLOFILES= $(SLO)$/jpeg.obj
+
+.INCLUDE : target.mk
+
+.ELSE
+
+dummy:
+ @+echo VCL not set. nothing to do!
+
+.ENDIF #VCL
diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx
new file mode 100644
index 000000000000..3e504f830b0e
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/emfwr.cxx
@@ -0,0 +1,1207 @@
+/*************************************************************************
+ *
+ * $RCSfile: emfwr.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "emfwr.hxx"
+#include <vcl/salbtype.hxx>
+
+// -----------
+// - Defines -
+// -----------
+
+#define WIN_EMR_HEADER 1
+#define WIN_EMR_POLYBEZIER 2
+#define WIN_EMR_POLYGON 3
+#define WIN_EMR_POLYLINE 4
+#define WIN_EMR_POLYBEZIERTO 5
+#define WIN_EMR_POLYLINETO 6
+#define WIN_EMR_POLYPOLYLINE 7
+#define WIN_EMR_POLYPOLYGON 8
+#define WIN_EMR_SETWINDOWEXTEX 9
+#define WIN_EMR_SETWINDOWORGEX 10
+#define WIN_EMR_SETVIEWPORTEXTEX 11
+#define WIN_EMR_SETVIEWPORTORGEX 12
+#define WIN_EMR_SETBRUSHORGEX 13
+#define WIN_EMR_EOF 14
+#define WIN_EMR_SETPIXELV 15
+#define WIN_EMR_SETMAPPERFLAGS 16
+#define WIN_EMR_SETMAPMODE 17
+#define WIN_EMR_SETBKMODE 18
+#define WIN_EMR_SETPOLYFILLMODE 19
+#define WIN_EMR_SETROP2 20
+#define WIN_EMR_SETSTRETCHBLTMODE 21
+#define WIN_EMR_SETTEXTALIGN 22
+#define WIN_EMR_SETCOLORADJUSTMENT 23
+#define WIN_EMR_SETTEXTCOLOR 24
+#define WIN_EMR_SETBKCOLOR 25
+#define WIN_EMR_OFFSETCLIPRGN 26
+#define WIN_EMR_MOVETOEX 27
+#define WIN_EMR_SETMETARGN 28
+#define WIN_EMR_EXCLUDECLIPRECT 29
+#define WIN_EMR_INTERSECTCLIPRECT 30
+#define WIN_EMR_SCALEVIEWPORTEXTEX 31
+#define WIN_EMR_SCALEWINDOWEXTEX 32
+#define WIN_EMR_SAVEDC 33
+#define WIN_EMR_RESTOREDC 34
+#define WIN_EMR_SETWORLDTRANSFORM 35
+#define WIN_EMR_MODIFYWORLDTRANSFORM 36
+#define WIN_EMR_SELECTOBJECT 37
+#define WIN_EMR_CREATEPEN 38
+#define WIN_EMR_CREATEBRUSHINDIRECT 39
+#define WIN_EMR_DELETEOBJECT 40
+#define WIN_EMR_ANGLEARC 41
+#define WIN_EMR_ELLIPSE 42
+#define WIN_EMR_RECTANGLE 43
+#define WIN_EMR_ROUNDRECT 44
+#define WIN_EMR_ARC 45
+#define WIN_EMR_CHORD 46
+#define WIN_EMR_PIE 47
+#define WIN_EMR_SELECTPALETTE 48
+#define WIN_EMR_CREATEPALETTE 49
+#define WIN_EMR_SETPALETTEENTRIES 50
+#define WIN_EMR_RESIZEPALETTE 51
+#define WIN_EMR_REALIZEPALETTE 52
+#define WIN_EMR_EXTFLOODFILL 53
+#define WIN_EMR_LINETO 54
+#define WIN_EMR_ARCTO 55
+#define WIN_EMR_POLYDRAW 56
+#define WIN_EMR_SETARCDIRECTION 57
+#define WIN_EMR_SETMITERLIMIT 58
+#define WIN_EMR_BEGINPATH 59
+#define WIN_EMR_ENDPATH 60
+#define WIN_EMR_CLOSEFIGURE 61
+#define WIN_EMR_FILLPATH 62
+#define WIN_EMR_STROKEANDFILLPATH 63
+#define WIN_EMR_STROKEPATH 64
+#define WIN_EMR_FLATTENPATH 65
+#define WIN_EMR_WIDENPATH 66
+#define WIN_EMR_SELECTCLIPPATH 67
+#define WIN_EMR_ABORTPATH 68
+
+#define WIN_EMR_GDICOMMENT 70
+#define WIN_EMR_FILLRGN 71
+#define WIN_EMR_FRAMERGN 72
+#define WIN_EMR_INVERTRGN 73
+#define WIN_EMR_PAINTRGN 74
+#define WIN_EMR_EXTSELECTCLIPRGN 75
+#define WIN_EMR_BITBLT 76
+#define WIN_EMR_STRETCHBLT 77
+#define WIN_EMR_MASKBLT 78
+#define WIN_EMR_PLGBLT 79
+#define WIN_EMR_SETDIBITSTODEVICE 80
+#define WIN_EMR_STRETCHDIBITS 81
+#define WIN_EMR_EXTCREATEFONTINDIRECTW 82
+#define WIN_EMR_EXTTEXTOUTA 83
+#define WIN_EMR_EXTTEXTOUTW 84
+#define WIN_EMR_POLYBEZIER16 85
+#define WIN_EMR_POLYGON16 86
+#define WIN_EMR_POLYLINE16 87
+#define WIN_EMR_POLYBEZIERTO16 88
+#define WIN_EMR_POLYLINETO16 89
+#define WIN_EMR_POLYPOLYLINE16 90
+#define WIN_EMR_POLYPOLYGON16 91
+#define WIN_EMR_POLYDRAW16 92
+#define WIN_EMR_CREATEMONOBRUSH 93
+#define WIN_EMR_CREATEDIBPATTERNBRUSHPT 94
+#define WIN_EMR_EXTCREATEPEN 95
+#define WIN_EMR_POLYTEXTOUTA 96
+#define WIN_EMR_POLYTEXTOUTW 97
+
+#define WIN_SRCCOPY 0x00CC0020L
+#define WIN_SRCPAINT 0x00EE0086L
+#define WIN_SRCAND 0x008800C6L
+#define WIN_SRCINVERT 0x00660046L
+
+#define HANDLE_INVALID 0xffffffff
+#define MAXHANDLES 65000
+
+#define LINE_SELECT 0x00000001
+#define FILL_SELECT 0x00000002
+#define TEXT_SELECT 0x00000004
+
+// -------------
+// - EMFWriter -
+// -------------
+
+BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm,
+ PFilterCallback pCallback, void* pCallerData )
+{
+ const ULONG nHeaderPos = rOStm.Tell();
+
+ mpHandlesUsed = new BOOL[ MAXHANDLES ];
+ HMEMSET( mpHandlesUsed, 0, MAXHANDLES * sizeof( BOOL ) );
+ mnHandleCount = mnLastPercent = mnRecordPos = mnRecordCount = 0;
+ mnLineHandle = mnFillHandle = mnTextHandle = HANDLE_INVALID;
+ mbRecordOpen = FALSE;
+
+ mpStm = &rOStm;
+ mpCallback = pCallback;
+ mpCallerData = pCallerData;
+ maVDev.EnableOutput( FALSE );
+ maVDev.SetMapMode( rMtf.GetPrefMapMode() );
+
+ const Size aMtfSizePix( maVDev.LogicToPixel( rMtf.GetPrefSize(), rMtf.GetPrefMapMode() ) );
+ const Size aMtfSizeLog( maVDev.LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MAP_100TH_MM ) );
+
+ // seek over header
+ rOStm.SeekRel( 100 );
+
+ // write initial values
+ ImplBeginRecord( WIN_EMR_SETWINDOWORGEX );
+ (*mpStm) << (INT32) 0 << (INT32) 0;
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_SETWINDOWEXTEX );
+ (*mpStm) << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height();
+ ImplEndRecord();
+
+ ImplWriteRasterOp( ROP_OVERPAINT );
+
+ ImplBeginRecord( WIN_EMR_SETBKMODE );
+ (*mpStm) << (UINT32) 1; // TRANSPARENT
+ ImplEndRecord();
+
+ // write emf data
+ ImplWrite( rMtf );
+
+ // write header
+ const ULONG nEndPos = mpStm->Tell(); mpStm->Seek( nHeaderPos );
+
+ (*mpStm) << (UINT32) 0x00000001 << (UINT32) 100;
+ (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 );
+ (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 );
+ (*mpStm) << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos );
+ (*mpStm) << (UINT32) mnRecordCount << (UINT16) ( mnHandleCount + 1 ) << (UINT16) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0;
+ (*mpStm) << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height();
+ (*mpStm) << (INT32) ( aMtfSizeLog.Width() / 100 ) << (INT32) ( aMtfSizeLog.Height() / 100 );
+ (*mpStm) << (UINT32) 0 << (UINT32) 0 << (UINT32) 0;
+
+ mpStm->Seek( nEndPos );
+ delete[] mpHandlesUsed;
+
+ return( mpStm->GetError() == ERRCODE_NONE );
+}
+
+// -----------------------------------------------------------------------------
+
+ULONG EMFWriter::ImplAcquireHandle()
+{
+ ULONG nHandle = HANDLE_INVALID;
+
+ for( ULONG i = 0; i < MAXHANDLES && ( HANDLE_INVALID == nHandle ); i++ )
+ {
+ if( !mpHandlesUsed[ i ] )
+ {
+ mpHandlesUsed[ i ] = TRUE;
+
+ if( ( nHandle = i ) == mnHandleCount )
+ mnHandleCount++;
+ }
+ }
+
+ DBG_ASSERT( nHandle != HANDLE_INVALID, "No more handles available" );
+ return( nHandle != HANDLE_INVALID ? nHandle + 1 : HANDLE_INVALID );
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplReleaseHandle( ULONG nHandle )
+{
+ DBG_ASSERT( nHandle && ( nHandle < MAXHANDLES ), "Handle out of range" );
+ mpHandlesUsed[ nHandle - 1 ] = FALSE;
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplBeginRecord( ULONG nType )
+{
+ DBG_ASSERT( !mbRecordOpen, "Another record is already opened!" );
+
+ if( !mbRecordOpen )
+ {
+ mbRecordOpen = TRUE;
+ mnRecordPos = mpStm->Tell();
+
+ (*mpStm) << nType;
+ mpStm->SeekRel( 4 );
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplEndRecord()
+{
+ DBG_ASSERT( mbRecordOpen, "Record was not opened!" );
+
+ if( mbRecordOpen )
+ {
+ const ULONG nActPos = mpStm->Tell();
+
+ mpStm->Seek( mnRecordPos + 4 );
+ ( *mpStm ) << ( nActPos - mnRecordPos );
+ mpStm->Seek( nActPos );
+
+ mnRecordCount++;
+ mbRecordOpen = FALSE;
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+BOOL EMFWriter::ImplPrepareHandleSelect( ULONG& rHandle, ULONG nSelectType )
+{
+ if( rHandle != HANDLE_INVALID )
+ {
+ UINT32 nStockObject = 0x80000000;
+
+ if( LINE_SELECT == nSelectType )
+ nStockObject |= 0x00000007;
+ else if( FILL_SELECT == nSelectType )
+ nStockObject |= 0x00000001;
+ else if( TEXT_SELECT == nSelectType )
+ nStockObject |= 0x0000000a;
+
+ // select stock object first
+ ImplBeginRecord( WIN_EMR_SELECTOBJECT );
+ ( *mpStm ) << nStockObject;
+ ImplEndRecord();
+
+ // destroy handle of created object
+ ImplBeginRecord( WIN_EMR_DELETEOBJECT );
+ ( *mpStm ) << rHandle;
+ ImplEndRecord();
+
+ // mark handle as free
+ ImplReleaseHandle( rHandle );
+ }
+
+ rHandle = ImplAcquireHandle();
+
+ return( HANDLE_INVALID != rHandle );
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplCheckLineAttr()
+{
+ if( mbLineChanged && ImplPrepareHandleSelect( mnLineHandle, LINE_SELECT ) )
+ {
+ ULONG nStyle = maVDev.IsLineColor() ? 0 : 5;
+ ULONG nWidth = 0, nHeight = 0;
+
+ ImplBeginRecord( WIN_EMR_CREATEPEN );
+ (*mpStm) << mnLineHandle << nStyle << nWidth << nHeight;
+ ImplWriteColor( maVDev.GetLineColor() );
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_SELECTOBJECT );
+ (*mpStm) << mnLineHandle;
+ ImplEndRecord();
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplCheckFillAttr()
+{
+ if( mbFillChanged && ImplPrepareHandleSelect( mnFillHandle, FILL_SELECT ) )
+ {
+ ULONG nStyle = maVDev.IsFillColor() ? 0 : 1;
+ ULONG nPatternStyle = 0;
+
+ ImplBeginRecord( WIN_EMR_CREATEBRUSHINDIRECT );
+ (*mpStm) << mnFillHandle << nStyle;
+ ImplWriteColor( maVDev.GetFillColor() );
+ (*mpStm) << nPatternStyle;
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_SELECTOBJECT );
+ (*mpStm) << mnFillHandle;
+ ImplEndRecord();
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplCheckTextAttr()
+{
+ if( mbTextChanged && ImplPrepareHandleSelect( mnTextHandle, TEXT_SELECT ) )
+ {
+ const Font& rFont = maVDev.GetFont();
+ String aFontName( rFont.GetName() );
+ INT32 i, nWeight;
+ BYTE nPitchAndFamily;
+
+ ImplBeginRecord( WIN_EMR_EXTCREATEFONTINDIRECTW );
+ (*mpStm) << mnTextHandle;
+ ImplWriteExtent( rFont.GetSize().Height() );
+ ImplWriteExtent( rFont.GetSize().Width() );
+ (*mpStm) << (INT32) rFont.GetOrientation() << (INT32) rFont.GetOrientation();
+
+ switch( rFont.GetWeight() )
+ {
+ case WEIGHT_THIN: nWeight = 100; break;
+ case WEIGHT_ULTRALIGHT: nWeight = 200; break;
+ case WEIGHT_LIGHT: nWeight = 300; break;
+ case WEIGHT_SEMILIGHT: nWeight = 300; break;
+ case WEIGHT_NORMAL: nWeight = 400; break;
+ case WEIGHT_MEDIUM: nWeight = 500; break;
+ case WEIGHT_SEMIBOLD: nWeight = 600; break;
+ case WEIGHT_BOLD: nWeight = 700; break;
+ case WEIGHT_ULTRABOLD: nWeight = 800; break;
+ case WEIGHT_BLACK: nWeight = 900; break;
+ default: nWeight = 0; break;
+ }
+
+ (*mpStm) << nWeight;
+ (*mpStm) << (BYTE) ( ( ITALIC_NONE == rFont.GetItalic() ) ? 0 : 1 );
+ (*mpStm) << (BYTE) ( ( UNDERLINE_NONE == rFont.GetUnderline() ) ? 0 : 1 );
+ (*mpStm) << (BYTE) ( ( STRIKEOUT_NONE == rFont.GetStrikeout() ) ? 0 : 1 );
+ (*mpStm) << (BYTE) ( ( RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet() ) ? 2 : 0 );
+ (*mpStm) << (BYTE) 0 << (BYTE) 0 << (BYTE) 0;
+
+ switch( rFont.GetPitch() )
+ {
+ case PITCH_FIXED: nPitchAndFamily = 0x01; break;
+ case PITCH_VARIABLE: nPitchAndFamily = 0x02; break;
+ default: nPitchAndFamily = 0x00; break;
+ }
+
+ switch( rFont.GetFamily() )
+ {
+ case FAMILY_DECORATIVE: nPitchAndFamily |= 0x50; break;
+ case FAMILY_MODERN: nPitchAndFamily |= 0x30; break;
+ case FAMILY_ROMAN: nPitchAndFamily |= 0x10; break;
+ case FAMILY_SCRIPT: nPitchAndFamily |= 0x40; break;
+ case FAMILY_SWISS: nPitchAndFamily |= 0x20; break;
+ default: break;
+ }
+
+ (*mpStm) << nPitchAndFamily;
+
+ for( i = 0; i < 32; i++ )
+ (*mpStm) << (sal_Unicode) ( ( i < aFontName.Len() ) ? aFontName.GetChar( i ) : 0 );
+
+ // dummy elfFullName
+ for( i = 0; i < 64; i++ )
+ (*mpStm) << (sal_Unicode) 0;
+
+ // dummy elfStyle
+ for( i = 0; i < 32; i++ )
+ (*mpStm) << (sal_Unicode) 0;
+
+ // dummy elfVersion, elfStyleSize, elfMatch, elfReserved
+ (*mpStm) << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0 ;
+
+ // dummy elfVendorId
+ (*mpStm) << (UINT32) 0;
+
+ // dummy elfCulture
+ (*mpStm) << (UINT32) 0;
+
+ // dummy elfPanose
+ (*mpStm) << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0 << (BYTE) 0;
+
+ // fill record to get a record size divideable by 4
+ (*mpStm) << (UINT16) 0;
+
+ ImplEndRecord();
+
+ // TextAlign
+ UINT32 nTextAlign;
+
+ switch( rFont.GetAlign() )
+ {
+ case ALIGN_TOP: nTextAlign = 0; break;
+ case ALIGN_BOTTOM: nTextAlign = 8; break;
+ default: nTextAlign = 24; break;
+ }
+
+ ImplBeginRecord( WIN_EMR_SETTEXTALIGN );
+ (*mpStm) << nTextAlign;
+ ImplEndRecord();
+
+ // Text color
+ ImplBeginRecord( WIN_EMR_SETTEXTCOLOR );
+ ImplWriteColor( rFont.GetColor() );
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_SELECTOBJECT );
+ (*mpStm) << mnTextHandle;
+ ImplEndRecord();
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWriteColor( const Color& rColor )
+{
+ UINT32 nCol = rColor.GetRed();
+
+ nCol |= ( (UINT32) rColor.GetGreen() ) << 8;
+ nCol |= ( (UINT32) rColor.GetBlue() ) << 16;
+
+ (*mpStm) << nCol;
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWriteRasterOp( RasterOp eRop )
+{
+ UINT32 nROP2;
+
+ switch( eRop )
+ {
+ case ROP_INVERT: nROP2 = 6; break;
+ case ROP_XOR: nROP2 = 7; break;
+ default: nROP2 = 13;break;
+ }
+
+ ImplBeginRecord( WIN_EMR_SETROP2 );
+ (*mpStm) << nROP2;
+ ImplEndRecord();
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWriteExtent( long nExtent )
+{
+ const Size aSize( maVDev.LogicToPixel( Size( nExtent, nExtent ) ) );
+ (*mpStm) << (INT32) aSize.Width();
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWritePoint( const Point& rPoint )
+{
+ const Point aPoint( maVDev.LogicToPixel( rPoint ) );
+
+ (*mpStm) << (INT32) aPoint.X() << (INT32) aPoint.Y();
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWriteSize( const Size& rSize)
+{
+ const Size aSize( maVDev.LogicToPixel( rSize ) );
+
+ (*mpStm) << (INT32) aSize.Width() << (INT32) aSize.Height();
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWriteRect( const Rectangle& rRect )
+{
+ const Rectangle aRect( maVDev.LogicToPixel( rRect ) );
+
+ (*mpStm) << aRect.Left() << aRect.Top() << aRect.Right() << aRect.Bottom();
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose )
+{
+ if( rPoly.GetSize() )
+ {
+ if( bClose )
+ ImplCheckFillAttr();
+
+ ImplCheckLineAttr();
+
+ ImplBeginRecord( bClose ? WIN_EMR_POLYGON : WIN_EMR_POLYLINE );
+ ImplWriteRect( rPoly.GetBoundRect() );
+ (*mpStm) << (UINT32) rPoly.GetSize();
+
+ for( USHORT i = 0; i < rPoly.GetSize(); i++ )
+ ImplWritePoint( rPoly[ i ] );
+
+ ImplEndRecord();
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly )
+{
+ const UINT32 nPolyCount = rPolyPoly.Count();
+
+ if( nPolyCount )
+ {
+ if( 1 == nPolyCount )
+ ImplWritePolygonRecord( rPolyPoly[ 0 ], TRUE );
+ else
+ {
+ UINT32 nTotalPoints = 0, i;
+
+ for( i = 0; i < nPolyCount; i++ )
+ nTotalPoints += rPolyPoly[ i ].GetSize();
+
+ if( nTotalPoints )
+ {
+ ImplCheckFillAttr();
+ ImplCheckLineAttr();
+
+ ImplBeginRecord( WIN_EMR_POLYPOLYGON );
+ ImplWriteRect( rPolyPoly.GetBoundRect() );
+ (*mpStm) << nPolyCount << nTotalPoints;
+
+ for( i = 0; i < nPolyCount; i++ )
+ (*mpStm) << (UINT32) rPolyPoly[ i ].GetSize();
+
+ for( i = 0; i < nPolyCount; i++ )
+ {
+ const Polygon& rPoly = rPolyPoly[ i ];
+
+ for( USHORT n = 0; n < rPoly.GetSize(); n++ )
+ ImplWritePoint( rPoly[ n ] );
+ }
+
+ ImplEndRecord();
+ }
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt,
+ const Size& rSz, UINT32 nROP )
+{
+ if( !!rBmp )
+ {
+ SvMemoryStream aMemStm( 65535, 65535 );
+ const Size aBmpSizePixel( rBmp.GetSizePixel() );
+
+ ImplBeginRecord( WIN_EMR_STRETCHDIBITS );
+ ImplWriteRect( Rectangle( rPt, rSz ) );
+ ImplWritePoint( rPt );
+ (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) aBmpSizePixel.Width() << (INT32) aBmpSizePixel.Height();
+
+ // write offset positions and sizes later
+ const ULONG nOffPos = mpStm->Tell();
+ mpStm->SeekRel( 16 );
+
+ (*mpStm) << (UINT32) 0 << ( ( ROP_XOR == maVDev.GetRasterOp() && WIN_SRCCOPY == nROP ) ? WIN_SRCINVERT : nROP );
+ ImplWriteSize( rSz );
+
+ rBmp.Write( aMemStm, TRUE, FALSE );
+
+ UINT32 nDIBSize = aMemStm.Tell(), nHeaderSize, nCompression, nColsUsed, nPalCount, nImageSize;
+ UINT16 nBitCount;
+
+ // get DIB parameters
+ aMemStm.Seek( 0 );
+ aMemStm >> nHeaderSize;
+ aMemStm.SeekRel( 10 );
+ aMemStm >> nBitCount >> nCompression >> nImageSize;
+ aMemStm.SeekRel( 8 );
+ aMemStm >> nColsUsed;
+
+ nPalCount = ( nBitCount <= 8 ) ? ( nColsUsed ? nColsUsed : ( 1 << (UINT32) nBitCount ) ) :
+ ( ( 3 == nCompression ) ? 12 : 0 );
+
+ mpStm->Write( aMemStm.GetData(), nDIBSize );
+
+ const ULONG nEndPos = mpStm->Tell();
+ mpStm->Seek( nOffPos );
+ (*mpStm) << (UINT32) 80 << (UINT32)( nHeaderSize + ( nPalCount << 2 ) );
+ (*mpStm) << (UINT32)( 80 + ( nHeaderSize + ( nPalCount << 2 ) ) ) << nImageSize;
+ mpStm->Seek( nEndPos );
+
+ ImplEndRecord();
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWriteTextRecord( const Point& rPos, const String rText, const long* pDXArray, UINT32 nWidth )
+{
+ UINT32 nLen = rText.Len(), i;
+
+ if( nLen )
+ {
+ sal_Int32 nNormWidth;
+ long* pOwnArray;
+ long* pDX;
+
+ // get text sizes
+ if( pDXArray )
+ {
+ pOwnArray = NULL;
+ nNormWidth = maVDev.GetTextWidth( rText );
+ pDX = (long*) pDXArray;
+ }
+ else
+ {
+ pOwnArray = new long[ nLen ];
+ nNormWidth = maVDev.GetTextArray( rText, pOwnArray );
+ pDX = pOwnArray;
+ }
+
+ if( nLen > 1 )
+ {
+ nNormWidth = pDX[ nLen - 2 ] + maVDev.GetTextWidth( rText.GetChar( nLen - 1 ) );
+
+ if( nWidth && nNormWidth && ( nWidth != nNormWidth ) )
+ {
+ const double fFactor = (double) nWidth / nNormWidth;
+
+ for( i = 0; i < ( nLen - 1 ); i++ )
+ pDX[ i ] = FRound( pDX[ i ] * fFactor );
+ }
+ }
+
+ // write text record
+ ImplBeginRecord( WIN_EMR_EXTTEXTOUTW );
+
+ ImplWriteRect( Rectangle( rPos, Size( nNormWidth, maVDev.GetTextHeight() ) ) );
+ (*mpStm) << (UINT32) 2; // GM_ADVANCED
+ (*mpStm) << (INT32) 0 << (INT32) 0;
+ ImplWritePoint( rPos );
+ (*mpStm) << (UINT32) nLen << (UINT32) 76 << (UINT32) 2;
+ (*mpStm) << (INT32) 0 << (INT32) 0 << (INT32) 0 << (INT32) 0;
+ (*mpStm) << (UINT32) ( 76 + ( nLen << 1 ) + ( (nLen & 1 ) ? 2 : 0 ) );
+
+ // write text
+ for( i = 0; i < nLen; i++ )
+ (*mpStm) << (sal_Unicode)rText.GetChar( i );
+
+ // padding word
+ if( nLen & 1 )
+ (*mpStm) << (UINT16) 0;
+
+ // write DX array
+ ImplWriteExtent( pDX[ 0 ] );
+
+ if( nLen > 1 )
+ {
+ for( i = 1; i < ( nLen - 1 ); i++ )
+ ImplWriteExtent( pDX[ i ] - pDX[ i - 1 ] );
+
+ ImplWriteExtent( pDX[ nLen - 2 ] / ( nLen - 1 ) );
+ }
+
+ ImplEndRecord();
+ delete[] pOwnArray;
+ }
+}
+
+// -----------------------------------------------------------------------------
+
+void EMFWriter::ImplWrite( const GDIMetaFile& rMtf )
+{
+ for( ULONG i = 0, nCount = rMtf.GetActionCount(); i < nCount; i++ )
+ {
+ const MetaAction* pAction = rMtf.GetAction( i );
+ const USHORT nType = pAction->GetType();
+
+ switch( nType )
+ {
+ case( META_PIXEL_ACTION ):
+ {
+ const MetaPixelAction* pA = (const MetaPixelAction*) pAction;
+
+ ImplCheckLineAttr();
+ ImplBeginRecord( WIN_EMR_SETPIXELV );
+ ImplWritePoint( pA->GetPoint() );
+ ImplWriteColor( pA->GetColor() );
+ ImplEndRecord();
+ }
+ break;
+
+ case( META_POINT_ACTION ):
+ {
+ if( maVDev.IsLineColor() )
+ {
+ const MetaPointAction* pA = (const MetaPointAction*) pAction;
+
+ ImplCheckLineAttr();
+ ImplBeginRecord( WIN_EMR_SETPIXELV );
+ ImplWritePoint( pA->GetPoint() );
+ ImplWriteColor( maVDev.GetLineColor() );
+ ImplEndRecord();
+ }
+ }
+ break;
+
+ case( META_LINE_ACTION ):
+ {
+ if( maVDev.IsLineColor() )
+ {
+ const MetaLineAction* pA = (const MetaLineAction*) pAction;
+
+ ImplCheckLineAttr();
+
+ ImplBeginRecord( WIN_EMR_MOVETOEX );
+ ImplWritePoint( pA->GetStartPoint() );
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_LINETO );
+ ImplWritePoint( pA->GetEndPoint() );
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_SETPIXELV );
+ ImplWritePoint( pA->GetEndPoint() );
+ ImplWriteColor( maVDev.GetLineColor() );
+ ImplEndRecord();
+ }
+ }
+ break;
+
+ case( META_RECT_ACTION ):
+ {
+ if( maVDev.IsLineColor() || maVDev.IsFillColor() )
+ {
+ const MetaRectAction* pA = (const MetaRectAction*) pAction;
+
+ ImplCheckFillAttr();
+ ImplCheckLineAttr();
+
+ ImplBeginRecord( WIN_EMR_RECTANGLE );
+ ImplWriteRect( pA->GetRect() );
+ ImplEndRecord();
+ }
+ }
+ break;
+
+ case( META_ROUNDRECT_ACTION ):
+ {
+ if( maVDev.IsLineColor() || maVDev.IsFillColor() )
+ {
+ const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pAction;
+
+ ImplCheckFillAttr();
+ ImplCheckLineAttr();
+
+ ImplBeginRecord( WIN_EMR_ROUNDRECT );
+ ImplWriteRect( pA->GetRect() );
+ ImplWriteSize( Size( pA->GetHorzRound(), pA->GetVertRound() ) );
+ ImplEndRecord();
+ }
+ }
+ break;
+
+ case( META_ELLIPSE_ACTION ):
+ {
+ if( maVDev.IsLineColor() || maVDev.IsFillColor() )
+ {
+ const MetaEllipseAction* pA = (const MetaEllipseAction*) pAction;
+
+ ImplCheckFillAttr();
+ ImplCheckLineAttr();
+
+ ImplBeginRecord( WIN_EMR_ELLIPSE );
+ ImplWriteRect( pA->GetRect() );
+ ImplEndRecord();
+ }
+ }
+ break;
+
+ case( META_ARC_ACTION ):
+ case( META_PIE_ACTION ):
+ case( META_CHORD_ACTION ):
+ case( META_POLYGON_ACTION ):
+ {
+ if( maVDev.IsLineColor() || maVDev.IsFillColor() )
+ {
+ Polygon aPoly;
+
+ switch( nType )
+ {
+ case( META_ARC_ACTION ):
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pAction;
+ aPoly = Polygon( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_ARC );
+ }
+ break;
+
+ case( META_PIE_ACTION ):
+ {
+ const MetaPieAction* pA = (const MetaPieAction*) pAction;
+ aPoly = Polygon( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_PIE );
+ }
+ break;
+
+ case( META_CHORD_ACTION ):
+ {
+ const MetaChordAction* pA = (const MetaChordAction*) pAction;
+ aPoly = Polygon( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint(), POLY_CHORD );
+ }
+ break;
+
+ case( META_POLYGON_ACTION ):
+ aPoly = ( (const MetaPolygonAction*) pAction )->GetPolygon();
+ break;
+ }
+
+ ImplWritePolygonRecord( aPoly, nType != META_ARC_ACTION );
+ }
+ }
+ break;
+
+ case( META_POLYLINE_ACTION ):
+ {
+ if( maVDev.IsLineColor() )
+ ImplWritePolygonRecord( ( (const MetaPolyLineAction*) pAction )->GetPolygon(), FALSE );
+ }
+ break;
+
+ case( META_POLYPOLYGON_ACTION ):
+ {
+ if( maVDev.IsLineColor() || maVDev.IsFillColor() )
+ ImplWritePolyPolygonRecord( ( (const MetaPolyPolygonAction*) pAction )->GetPolyPolygon() );
+ }
+ break;
+
+ case( META_GRADIENT_ACTION ):
+ {
+ const MetaGradientAction* pA = (const MetaGradientAction*) pAction;
+ GDIMetaFile aTmpMtf;
+
+ maVDev.AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf );
+ ImplWrite( aTmpMtf );
+ }
+ break;
+
+ case META_HATCH_ACTION:
+ {
+ const MetaHatchAction* pA = (const MetaHatchAction*) pAction;
+ GDIMetaFile aTmpMtf;
+
+ maVDev.AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf );
+ ImplWrite( aTmpMtf );
+ }
+ break;
+
+ case META_TRANSPARENT_ACTION:
+ {
+ ImplCheckFillAttr();
+ ImplCheckLineAttr();
+ ImplWritePolyPolygonRecord( ( (MetaTransparentAction*) pAction )->GetPolyPolygon() );
+ }
+ break;
+
+ case META_FLOATTRANSPARENT_ACTION:
+ {
+ const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pAction;
+
+ GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() );
+ Point aSrcPt( aTmpMtf.GetPrefMapMode().GetOrigin() );
+ const Size aSrcSize( aTmpMtf.GetPrefSize() );
+ const Point aDestPt( pA->GetPoint() );
+ const Size aDestSize( pA->GetSize() );
+ const double fScaleX = aSrcSize.Width() ? (double) aDestSize.Width() / aSrcSize.Width() : 1.0;
+ const double fScaleY = aSrcSize.Height() ? (double) aDestSize.Height() / aSrcSize.Height() : 1.0;
+ long nMoveX, nMoveY;
+
+ if( fScaleX != 1.0 || fScaleY != 1.0 )
+ {
+ aTmpMtf.Scale( fScaleX, fScaleY );
+ aSrcPt.X() = FRound( aSrcPt.X() * fScaleX ), aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY );
+ }
+
+ nMoveX = aDestPt.X() - aSrcPt.X(), nMoveY = aDestPt.Y() - aSrcPt.Y();
+
+ if( nMoveX || nMoveY )
+ aTmpMtf.Move( nMoveX, nMoveY );
+
+ ImplCheckFillAttr();
+ ImplCheckLineAttr();
+ ImplCheckTextAttr();
+ ImplWrite( aTmpMtf );
+ }
+ break;
+
+ case( META_EPS_ACTION ):
+ {
+ const MetaEPSAction* pA = (const MetaEPSAction*) pAction;
+ const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
+ sal_Bool bFound = sal_False;
+
+ for( ULONG i = 0, nCount = aGDIMetaFile.GetActionCount(); ( i < nCount ) && !bFound; i++ )
+ {
+ const MetaAction* pSubstAct = aGDIMetaFile.GetAction( i );
+
+ if( pSubstAct->GetType() == META_BMPSCALE_ACTION )
+ {
+ bFound = sal_True;
+ const MetaBmpScaleAction* pBmpScaleAction = (const MetaBmpScaleAction*) pAction;
+ ImplWriteBmpRecord( pBmpScaleAction->GetBitmap(), pBmpScaleAction->GetPoint(),
+ pBmpScaleAction->GetSize(), WIN_SRCCOPY );
+ }
+ }
+ }
+ break;
+
+ case META_BMP_ACTION:
+ {
+ const MetaBmpAction* pA = (const MetaBmpAction *) pAction;
+ ImplWriteBmpRecord( pA->GetBitmap(), pA->GetPoint(), pA->GetBitmap().GetSizePixel(), WIN_SRCCOPY );
+ }
+ break;
+
+ case META_BMPSCALE_ACTION:
+ {
+ const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pAction;
+ ImplWriteBmpRecord( pA->GetBitmap(), pA->GetPoint(), pA->GetSize(), WIN_SRCCOPY );
+ }
+ break;
+
+ case META_BMPSCALEPART_ACTION:
+ {
+ const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pAction;
+ Bitmap aTmp( pA->GetBitmap() );
+
+ if( aTmp.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ) )
+ ImplWriteBmpRecord( aTmp, pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCCOPY );
+ }
+ break;
+
+ case META_BMPEX_ACTION:
+ {
+ const MetaBmpExAction* pA = (const MetaBmpExAction *) pAction;
+ Bitmap aBmp( pA->GetBitmapEx().GetBitmap() );
+ Bitmap aMsk( pA->GetBitmapEx().GetMask() );
+
+ if( !!aMsk )
+ {
+ aBmp.Replace( aMsk, COL_WHITE );
+ aMsk.Invert();
+ ImplWriteBmpRecord( aMsk, pA->GetPoint(), aMsk.GetSizePixel(), WIN_SRCPAINT );
+ ImplWriteBmpRecord( aBmp, pA->GetPoint(), aBmp.GetSizePixel(), WIN_SRCAND );
+ }
+ else
+ ImplWriteBmpRecord( aBmp, pA->GetPoint(), aBmp.GetSizePixel(), WIN_SRCCOPY );
+ }
+ break;
+
+ case META_BMPEXSCALE_ACTION:
+ {
+ const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pAction;
+ Bitmap aBmp( pA->GetBitmapEx().GetBitmap() );
+ Bitmap aMsk( pA->GetBitmapEx().GetMask() );
+
+ if( !!aMsk )
+ {
+ aBmp.Replace( aMsk, COL_WHITE );
+ aMsk.Invert();
+ ImplWriteBmpRecord( aMsk, pA->GetPoint(), pA->GetSize(), WIN_SRCPAINT );
+ ImplWriteBmpRecord( aBmp, pA->GetPoint(), pA->GetSize(), WIN_SRCAND );
+ }
+ else
+ ImplWriteBmpRecord( aBmp, pA->GetPoint(), pA->GetSize(), WIN_SRCCOPY );
+ }
+ break;
+
+ case META_BMPEXSCALEPART_ACTION:
+ {
+ const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pAction;
+ BitmapEx aBmpEx( pA->GetBitmapEx() );
+ aBmpEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ Bitmap aBmp( aBmpEx.GetBitmap() );
+ Bitmap aMsk( aBmpEx.GetMask() );
+
+ if( !!aMsk )
+ {
+ aBmp.Replace( aMsk, COL_WHITE );
+ aMsk.Invert();
+ ImplWriteBmpRecord( aMsk, pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCPAINT );
+ ImplWriteBmpRecord( aBmp, pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCAND );
+ }
+ else
+ ImplWriteBmpRecord( aBmp, pA->GetDestPoint(), pA->GetDestSize(), WIN_SRCCOPY );
+ }
+ break;
+
+ case META_TEXT_ACTION:
+ {
+ const MetaTextAction* pA = (const MetaTextAction*) pAction;
+ const String aText( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+
+ ImplCheckTextAttr();
+ ImplWriteTextRecord( pA->GetPoint(), aText, NULL, 0 );
+ }
+ break;
+
+ case META_TEXTRECT_ACTION:
+ {
+ const MetaTextRectAction* pA = (const MetaTextRectAction*) pAction;
+ const String aText( pA->GetText() );
+
+ ImplCheckTextAttr();
+ ImplWriteTextRecord( pA->GetRect().TopLeft(), aText, NULL, 0 );
+ }
+ break;
+
+ case META_TEXTARRAY_ACTION:
+ {
+ const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pAction;
+ const String aText( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+
+ ImplCheckTextAttr();
+ ImplWriteTextRecord( pA->GetPoint(), aText, pA->GetDXArray(), 0 );
+ }
+ break;
+
+ case META_STRETCHTEXT_ACTION:
+ {
+ const MetaStretchTextAction* pA = (const MetaStretchTextAction*) pAction;
+ const String aText( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+
+ ImplCheckTextAttr();
+ ImplWriteTextRecord( pA->GetPoint(), aText, NULL, pA->GetWidth() );
+ }
+ break;
+
+ case( META_LINECOLOR_ACTION ):
+ {
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+ mbLineChanged = TRUE;
+ }
+ break;
+
+ case( META_FILLCOLOR_ACTION ):
+ {
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+ mbFillChanged = TRUE;
+ }
+ break;
+
+ case( META_TEXTCOLOR_ACTION ):
+ case( META_TEXTLINECOLOR_ACTION ):
+ case( META_TEXTFILLCOLOR_ACTION ):
+ case( META_TEXTALIGN_ACTION ):
+ case( META_FONT_ACTION ):
+ {
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+ mbTextChanged = TRUE;
+ }
+ break;
+
+ case( META_ISECTRECTCLIPREGION_ACTION ):
+ {
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+
+ ImplBeginRecord( WIN_EMR_INTERSECTCLIPRECT );
+ ImplWriteRect( ( (MetaISectRectClipRegionAction*) pAction )->GetRect() );
+ ImplEndRecord();
+ }
+ break;
+
+ case( META_CLIPREGION_ACTION ):
+ case( META_ISECTREGIONCLIPREGION_ACTION ):
+ case( META_MOVECLIPREGION_ACTION ):
+ {
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+ }
+ break;
+
+ case( META_REFPOINT_ACTION ):
+ case( META_MAPMODE_ACTION ):
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+ break;
+
+ case( META_PUSH_ACTION ):
+ {
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+
+ ImplBeginRecord( WIN_EMR_SAVEDC );
+ ImplEndRecord();
+ }
+ break;
+
+ case( META_POP_ACTION ):
+ {
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+
+ ImplBeginRecord( WIN_EMR_RESTOREDC );
+ (*mpStm) << (INT32) -1;
+ ImplEndRecord();
+
+ ImplWriteRasterOp( maVDev.GetRasterOp() );
+ mbLineChanged = mbFillChanged = mbTextChanged = TRUE;
+ }
+ break;
+
+ case( META_RASTEROP_ACTION ):
+ {
+ ( (MetaAction*) pAction )->Execute( &maVDev );
+ ImplWriteRasterOp( ( (MetaRasterOpAction*) pAction )->GetRasterOp() );
+ }
+ break;
+
+ case( META_MASK_ACTION ):
+ case( META_MASKSCALE_ACTION ):
+ case( META_MASKSCALEPART_ACTION ):
+ case( META_WALLPAPER_ACTION ):
+ case( META_TEXTLINE_ACTION ):
+ case( META_COMMENT_ACTION ):
+ case( META_GRADIENTEX_ACTION ):
+ {
+ // !!! >>> we don't want to support these actions
+ }
+ break;
+
+ default:
+ DBG_ERROR( ( ByteString( "SVGActionWriter::ImplWriteActions: unsupported MetaAction #" ) += ByteString( nType ) ).GetBuffer() );
+ break;
+ }
+ }
+}
diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx
new file mode 100644
index 000000000000..f88edaeb92a6
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/emfwr.hxx
@@ -0,0 +1,129 @@
+/*************************************************************************
+ *
+ * $RCSfile: emfwr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _EMFWR_HXX
+#define _EMFWR_HXX
+
+#include <tools/debug.hxx>
+#include <vcl/metaact.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/gdimtf.hxx>
+#include <vcl/virdev.hxx>
+#include "fltcall.hxx"
+
+// -------------
+// - EMFWriter -
+// -------------
+
+class EMFWriter
+{
+private:
+
+ VirtualDevice maVDev;
+ PFilterCallback mpCallback;
+ void* mpCallerData;
+ SvStream* mpStm;
+ BOOL* mpHandlesUsed;
+ ULONG mnHandleCount;
+ ULONG mnLastPercent;
+ ULONG mnRecordCount;
+ ULONG mnRecordPos;
+ BOOL mbRecordOpen;
+ BOOL mbLineChanged;
+ ULONG mnLineHandle;
+ BOOL mbFillChanged;
+ ULONG mnFillHandle;
+ BOOL mbTextChanged;
+ ULONG mnTextHandle;
+
+ void ImplBeginRecord( ULONG nType );
+ void ImplEndRecord();
+
+ ULONG ImplAcquireHandle();
+ void ImplReleaseHandle( ULONG nHandle );
+
+ BOOL ImplPrepareHandleSelect( ULONG& rHandle, ULONG nSelectType );
+ void ImplCheckLineAttr();
+ void ImplCheckFillAttr();
+ void ImplCheckTextAttr();
+
+ void ImplWriteColor( const Color& rColor );
+ void ImplWriteRasterOp( RasterOp eRop );
+ void ImplWriteExtent( long nExtent );
+ void ImplWritePoint( const Point& rPoint );
+ void ImplWriteSize( const Size& rSize);
+ void ImplWriteRect( const Rectangle& rRect );
+ void ImplWritePolygonRecord( const Polygon& rPoly, BOOL bClose );
+ void ImplWritePolyPolygonRecord( const PolyPolygon& rPolyPoly );
+ void ImplWriteBmpRecord( const Bitmap& rBmp, const Point& rPt, const Size& rSz, UINT32 nROP );
+ void ImplWriteTextRecord( const Point& rPos, const String rText, const long* pDXArray, UINT32 nWidth );
+
+ void ImplWrite( const GDIMetaFile& rMtf );
+
+public:
+
+ EMFWriter() {}
+
+ BOOL WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm,
+ PFilterCallback pCallback, void* pCallerData );
+};
+
+#endif // _EMFWR_HXX
diff --git a/svtools/source/filter.vcl/wmf/enhwmf.cxx b/svtools/source/filter.vcl/wmf/enhwmf.cxx
new file mode 100644
index 000000000000..ed2c10be2dd7
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/enhwmf.cxx
@@ -0,0 +1,1077 @@
+/*************************************************************************
+ *
+ * $RCSfile: enhwmf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "winmtf.hxx"
+
+//=========================== GDI-Array ===================================
+
+#define EMR_HEADER 1
+#define EMR_POLYBEZIER 2
+#define EMR_POLYGON 3
+#define EMR_POLYLINE 4
+#define EMR_POLYBEZIERTO 5
+#define EMR_POLYLINETO 6
+#define EMR_POLYPOLYLINE 7
+#define EMR_POLYPOLYGON 8
+#define EMR_SETWINDOWEXTEX 9
+#define EMR_SETWINDOWORGEX 10
+#define EMR_SETVIEWPORTEXTEX 11
+#define EMR_SETVIEWPORTORGEX 12
+#define EMR_SETBRUSHORGEX 13
+#define EMR_EOF 14
+#define EMR_SETPIXELV 15
+#define EMR_SETMAPPERFLAGS 16
+#define EMR_SETMAPMODE 17
+#define EMR_SETBKMODE 18
+#define EMR_SETPOLYFILLMODE 19
+#define EMR_SETROP2 20
+#define EMR_SETSTRETCHBLTMODE 21
+#define EMR_SETTEXTALIGN 22
+#define EMR_SETCOLORADJUSTMENT 23
+#define EMR_SETTEXTCOLOR 24
+#define EMR_SETBKCOLOR 25
+#define EMR_OFFSETCLIPRGN 26
+#define EMR_MOVETOEX 27
+#define EMR_SETMETARGN 28
+#define EMR_EXCLUDECLIPRECT 29
+#define EMR_INTERSECTCLIPRECT 30
+#define EMR_SCALEVIEWPORTEXTEX 31
+#define EMR_SCALEWINDOWEXTEX 32
+#define EMR_SAVEDC 33
+#define EMR_RESTOREDC 34
+#define EMR_SETWORLDTRANSFORM 35
+#define EMR_MODIFYWORLDTRANSFORM 36
+#define EMR_SELECTOBJECT 37
+#define EMR_CREATEPEN 38
+#define EMR_CREATEBRUSHINDIRECT 39
+#define EMR_DELETEOBJECT 40
+#define EMR_ANGLEARC 41
+#define EMR_ELLIPSE 42
+#define EMR_RECTANGLE 43
+#define EMR_ROUNDRECT 44
+#define EMR_ARC 45
+#define EMR_CHORD 46
+#define EMR_PIE 47
+#define EMR_SELECTPALETTE 48
+#define EMR_CREATEPALETTE 49
+#define EMR_SETPALETTEENTRIES 50
+#define EMR_RESIZEPALETTE 51
+#define EMR_REALIZEPALETTE 52
+#define EMR_EXTFLOODFILL 53
+#define EMR_LINETO 54
+#define EMR_ARCTO 55
+#define EMR_POLYDRAW 56
+#define EMR_SETARCDIRECTION 57
+#define EMR_SETMITERLIMIT 58
+#define EMR_BEGINPATH 59
+#define EMR_ENDPATH 60
+#define EMR_CLOSEFIGURE 61
+#define EMR_FILLPATH 62
+#define EMR_STROKEANDFILLPATH 63
+#define EMR_STROKEPATH 64
+#define EMR_FLATTENPATH 65
+#define EMR_WIDENPATH 66
+#define EMR_SELECTCLIPPATH 67
+#define EMR_ABORTPATH 68
+
+#define EMR_GDICOMMENT 70
+#define EMR_FILLRGN 71
+#define EMR_FRAMERGN 72
+#define EMR_INVERTRGN 73
+#define EMR_PAINTRGN 74
+#define EMR_EXTSELECTCLIPRGN 75
+#define EMR_BITBLT 76
+#define EMR_STRETCHBLT 77
+#define EMR_MASKBLT 78
+#define EMR_PLGBLT 79
+#define EMR_SETDIBITSTODEVICE 80
+#define EMR_STRETCHDIBITS 81
+#define EMR_EXTCREATEFONTINDIRECTW 82
+#define EMR_EXTTEXTOUTA 83
+#define EMR_EXTTEXTOUTW 84
+#define EMR_POLYBEZIER16 85
+#define EMR_POLYGON16 86
+#define EMR_POLYLINE16 87
+#define EMR_POLYBEZIERTO16 88
+#define EMR_POLYLINETO16 89
+#define EMR_POLYPOLYLINE16 90
+#define EMR_POLYPOLYGON16 91
+#define EMR_POLYDRAW16 92
+#define EMR_CREATEMONOBRUSH 93
+#define EMR_CREATEDIBPATTERNBRUSHPT 94
+#define EMR_EXTCREATEPEN 95
+#define EMR_POLYTEXTOUTA 96
+#define EMR_POLYTEXTOUTW 97
+#define EMR_SETICMMODE 98
+#define EMR_CREATECOLORSPACE 99
+#define EMR_SETCOLORSPACE 100
+#define EMR_DELETECOLORSPACE 101
+#define EMR_GLSRECORD 102
+#define EMR_GLSBOUNDEDRECORD 103
+#define EMR_PIXELFORMAT 104
+
+//-----------------------------------------------------------------------------------
+
+BOOL EnhWMFReader::ReadEnhWMF() // SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, PFilterCallback pcallback, void * pcallerdata)
+{
+ UINT32 nStretchBltMode = 0;
+ UINT32 nRecType, nRecSize, nNextPos;
+ UINT32 nWidth, nHeight, nPoints, nColor, nIndex;
+ UINT32 nDat32, nNom1, nDen1, nNom2, nDen2;
+ INT32 nX32, nY32, nx32, ny32;
+ INT16 nX16, nY16;
+
+ BOOL bFlag, bStatus = ReadHeader();
+
+ while( bStatus && nRecordCount-- )
+ {
+ *pWMF >> nRecType >> nRecSize;
+
+ if ( ( nRecSize < 8 ) || ( nRecSize & 3 ) ) // Parameter sind immer durch 4 teilbar
+ {
+ bStatus = FALSE;
+ break;
+ }
+ nNextPos = pWMF->Tell() + ( nRecSize - 8 );
+
+ if( aBmpSaveList.Count() && ( nRecType != EMR_STRETCHBLT ) && ( nRecType != EMR_STRETCHDIBITS ) )
+ pOut->ResolveBitmapActions( aBmpSaveList );
+
+ bFlag = FALSE;
+
+ switch( nRecType )
+ {
+ case EMR_HEADER : // wir haben schon laengst einen header eingelesen
+ break;
+
+ case EMR_POLYBEZIER :
+ break;
+
+ case EMR_POLYGON :
+ {
+ pWMF->SeekRel( 16 );
+ *pWMF >> nPoints;
+ Polygon aPoly( (UINT16)nPoints );
+ for( UINT16 k = 0; k < (UINT16)nPoints; k++ )
+ {
+ *pWMF >> nX32 >> nY32;
+ aPoly[ k ] = Point( nX32, nY32 );
+ }
+ pOut->DrawPolygon( aPoly );
+ }
+ break;
+
+ case EMR_POLYBEZIERTO :
+ break;
+
+ case EMR_POLYLINETO :
+ bFlag = TRUE;
+ case EMR_POLYLINE :
+ {
+ pWMF->SeekRel( 0x10 );
+ *pWMF >> nPoints;
+ UINT16 i = 0;
+ if ( bFlag )
+ {
+ i++;
+ nPoints++;
+ }
+ Polygon aPolygon( (UINT16)nPoints );
+ for ( ; i < (UINT16)nPoints; i++ )
+ {
+ *pWMF >> nX32 >> nY32;
+ aPolygon[ i ] = Point( nX32, nY32 );
+ }
+ pOut->DrawPolyLine( aPolygon, bFlag );
+ }
+ break;
+
+ case EMR_POLYPOLYLINE :
+ {
+ UINT16* pnPoints;
+
+ INT32 i, nPoly;
+ pWMF->SeekRel( 0x10 );
+
+ // Anzahl der Polygone:
+ *pWMF >> nPoly >> i;
+
+ // Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln:
+ pnPoints = new UINT16[ nPoly ];
+
+ for ( i = 0; i < nPoly; i++ )
+ {
+ *pWMF >> nPoints;
+ pnPoints[ i ] = (UINT16)nPoints;
+ }
+
+ // Polygonpunkte holen:
+
+ for ( i = 0; i < nPoly; i++ )
+ {
+ Polygon aPoly( pnPoints[ i ] );
+ for( UINT16 k = 0; k < pnPoints[ i ]; k++ )
+ {
+ *pWMF >> nX32 >> nY32;
+ aPoly[ k ] = Point( nX32, nY32 );
+ }
+ pOut->DrawPolyLine( aPoly, FALSE );
+ }
+ delete pnPoints;
+ }
+ break;
+
+ case EMR_POLYPOLYGON :
+ {
+ UINT16* pnPoints;
+ Point* pPtAry;
+
+ INT32 i, nPoly, nGesPoints;
+ pWMF->SeekRel( 0x10 );
+
+ // Anzahl der Polygone:
+ *pWMF >> nPoly >> nGesPoints;
+
+ // Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln:
+ pnPoints = new UINT16[ nPoly ];
+
+ for ( i = 0; i < nPoly; i++ )
+ {
+ *pWMF >> nPoints;
+ pnPoints[ i ] = (UINT16)nPoints;
+ }
+ // Polygonpunkte holen:
+ pPtAry = (Point*) new char[ nGesPoints * sizeof(Point) ];
+
+ for ( i = 0; i < nGesPoints; i++ )
+ {
+ *pWMF >> nX32 >> nY32;
+ pPtAry[ i ] = Point( nX32, nY32 );
+ }
+ // PolyPolygon Actions erzeugen
+ PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry );
+
+ pOut->DrawPolyPolygon( aPolyPoly );
+ delete (char*) pPtAry;
+ delete pnPoints;
+ }
+ break;
+
+ case EMR_SETWINDOWEXTEX :
+ { // #75383#
+ *pWMF >> nWidth >> nHeight;
+ if( nWidth > 1 && nHeight > 1 )
+ pOut->SetWinExt( Size( nWidth, nHeight ) );
+ }
+ break;
+
+ case EMR_SETWINDOWORGEX :
+ {
+ *pWMF >> nX32 >> nY32;
+ pOut->SetWinOrg( Point( nX32, nY32 ) );
+ }
+ break;
+
+ case EMR_SETVIEWPORTEXTEX :
+ case EMR_SETVIEWPORTORGEX :
+ break;
+
+ case EMR_SCALEVIEWPORTEXTEX :
+ {
+ *pWMF >> nNom1 >> nDen1 >> nNom2 >> nDen2;
+ pOut->ScaleDevExt( (double)nNom1 / nDen1, (double)nNom2 / nDen2 );
+ }
+ break;
+
+ case EMR_SCALEWINDOWEXTEX :
+ {
+ *pWMF >> nNom1 >> nDen1 >> nNom2 >> nDen2;
+ pOut->ScaleWinExt( (double)nNom1 / nDen1, (double)nNom2 / nDen2 );
+ }
+ break;
+
+ case EMR_SETBRUSHORGEX :
+ break;
+ case EMR_EOF :
+ nRecordCount = 0; // #76846#
+ break;
+
+ case EMR_SETPIXELV :
+ {
+ *pWMF >> nX32 >> nY32;
+ pOut->DrawPixel( Point( nX32, nY32 ), ReadColor() );
+ }
+ break;
+
+ case EMR_SETMAPPERFLAGS :
+ break;
+
+ case EMR_SETMAPMODE :
+ {
+ UINT32 nMapMode;
+ *pWMF >> nMapMode;
+ if ( nMapMode )
+ break;
+ }
+ break;
+
+ case EMR_SETBKMODE :
+ {
+ *pWMF >> nDat32;
+ pOut->SetBkMode( nDat32 );
+ }
+ break;
+
+ case EMR_SETPOLYFILLMODE :
+ break;
+
+ case EMR_SETROP2 :
+ {
+ *pWMF >> nDat32;
+ pOut->SetRasterOp( nDat32 );
+ }
+ break;
+
+ case EMR_SETSTRETCHBLTMODE :
+ {
+ *pWMF >> nStretchBltMode;
+ }
+ break;
+
+ case EMR_SETTEXTALIGN :
+ {
+ *pWMF >> nDat32;
+ pOut->SetTextAlign( nDat32 );
+ }
+ break;
+
+ case EMR_SETCOLORADJUSTMENT :
+ break;
+
+ case EMR_SETTEXTCOLOR :
+ {
+ pOut->SetTextColor( ReadColor() );
+ }
+ break;
+
+ case EMR_SETBKCOLOR :
+ {
+ pOut->SetBkColor( ReadColor() );
+ }
+ break;
+
+ case EMR_OFFSETCLIPRGN :
+ {
+ *pWMF >> nX32 >> nY32;
+ pOut->MoveClipRegion( Size( nX32, nY32 ) );
+ }
+ break;
+
+ case EMR_MOVETOEX :
+ {
+ *pWMF >> nX32 >> nY32;
+ pOut->MoveTo( Point( nX32, nY32 ) );
+ }
+ break;
+
+ case EMR_SETMETARGN :
+ case EMR_EXCLUDECLIPRECT :
+ break;
+
+ case EMR_INTERSECTCLIPRECT :
+ {
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32;
+ pOut->IntersectClipRect( ReadRectangle( nX32, nY32, nx32, ny32 ) );
+ }
+ break;
+
+ case EMR_SAVEDC :
+ {
+ pOut->Push();
+ }
+ break;
+
+ case EMR_RESTOREDC :
+ {
+ pOut->Pop();
+ }
+ break;
+
+ case EMR_SETWORLDTRANSFORM :
+ {
+ XForm aTempXForm;
+ *pWMF >> aTempXForm.eM11 >> aTempXForm.eM12 >> aTempXForm.eM21 >> aTempXForm.eM22 >> aTempXForm.eDx >> aTempXForm.eDy;
+ pOut->SetWorldTransform( aTempXForm );
+ }
+ break;
+
+ case EMR_MODIFYWORLDTRANSFORM :
+ {
+ UINT32 nMode;
+ XForm aTempXForm;
+ *pWMF >> aTempXForm.eM11 >> aTempXForm.eM12 >> aTempXForm.eM21 >> aTempXForm.eM22 >> aTempXForm.eDx >> aTempXForm.eDy >> nMode;
+ pOut->ModifyWorldTransform( aTempXForm, nMode );
+ }
+ break;
+
+ case EMR_SELECTOBJECT :
+ {
+ *pWMF >> nIndex;
+ pOut->SelectObject( nIndex );
+ }
+ break;
+
+ case EMR_CREATEPEN :
+ {
+ *pWMF >> nIndex;
+ if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
+ {
+
+ LineInfo aLineInfo;
+ UINT32 nStyle;
+ Size aSize;
+
+ *pWMF >> nStyle >> aSize.Width() >> aSize.Height();
+
+ if ( aSize.Width() )
+ aLineInfo.SetWidth( aSize.Width() );
+
+ BOOL bTransparent = FALSE;
+ UINT16 nDashCount = 0;
+ UINT16 nDotCount = 0;
+ switch( nStyle )
+ {
+ case PS_DASHDOTDOT :
+ nDotCount++;
+ case PS_DASHDOT :
+ nDashCount++;
+ case PS_DOT :
+ nDotCount++;
+ break;
+ case PS_DASH :
+ nDashCount++;
+ break;
+ case PS_NULL :
+ bTransparent = TRUE;
+ aLineInfo.SetStyle( LINE_NONE );
+ break;
+ default :
+ case PS_INSIDEFRAME :
+ case PS_SOLID :
+ aLineInfo.SetStyle( LINE_SOLID );
+ }
+ if ( nDashCount | nDotCount )
+ {
+ aLineInfo.SetStyle( LINE_DASH );
+ aLineInfo.SetDashCount( nDashCount );
+ aLineInfo.SetDotCount( nDotCount );
+ }
+ pOut->CreateObject( nIndex, GDI_PEN, new WinMtfLineStyle( ReadColor(), aLineInfo, bTransparent ) );
+ }
+ }
+ break;
+ case EMR_CREATEBRUSHINDIRECT :
+ {
+ UINT32 nStyle;
+ *pWMF >> nIndex;
+ if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
+ {
+ *pWMF >> nStyle;
+ pOut->CreateObject( nIndex, GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) );
+ }
+ }
+ break;
+ case EMR_DELETEOBJECT :
+ {
+ *pWMF >> nIndex;
+ if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
+ pOut->DeleteObject( nIndex );
+ }
+ break;
+
+ case EMR_ANGLEARC :
+ break;
+
+ case EMR_ELLIPSE :
+ {
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32;
+ pOut->DrawEllipse( ReadRectangle( nX32, nY32, nx32, ny32 ) );
+ }
+ break;
+
+ case EMR_RECTANGLE :
+ {
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32;
+ pOut->DrawRect( ReadRectangle( nX32, nY32, nx32, ny32 ) );
+ }
+ break;
+
+ case EMR_ROUNDRECT :
+ {
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nWidth >> nHeight;
+ Size aSize( Size( nWidth, nHeight ) );
+ pOut->DrawRoundRect( ReadRectangle( nX32, nY32, nx32, ny32 ), aSize );
+ }
+ break;
+
+ case EMR_ARC :
+ {
+ UINT32 nStartX, nStartY, nEndX, nEndY;
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
+ pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) );
+ }
+ break;
+
+ case EMR_CHORD :
+ {
+ UINT32 nStartX, nStartY, nEndX, nEndY;
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
+ pOut->DrawChord( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) );
+ }
+ break;
+
+ case EMR_PIE :
+ {
+ UINT32 nStartX, nStartY, nEndX, nEndY;
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
+ pOut->DrawPie( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ) );
+ }
+ break;
+
+ case EMR_SELECTPALETTE :
+ case EMR_CREATEPALETTE :
+ case EMR_SETPALETTEENTRIES :
+ case EMR_RESIZEPALETTE :
+ case EMR_REALIZEPALETTE :
+ case EMR_EXTFLOODFILL :
+ break;
+
+ case EMR_LINETO :
+ {
+ *pWMF >> nX32 >> nY32;
+ pOut->LineTo( Point( nX32, nY32 ) );
+ }
+ break;
+
+ case EMR_ARCTO :
+ {
+ UINT32 nStartX, nStartY, nEndX, nEndY;
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nStartX >> nStartY >> nEndX >> nEndY;
+ pOut->DrawArc( ReadRectangle( nX32, nY32, nx32, ny32 ), Point( nStartX, nStartY ), Point( nEndX, nEndY ), TRUE );
+ }
+ break;
+ case EMR_POLYDRAW :
+ case EMR_SETARCDIRECTION :
+ case EMR_SETMITERLIMIT :
+ case EMR_BEGINPATH :
+ case EMR_ENDPATH :
+ case EMR_CLOSEFIGURE :
+ case EMR_FILLPATH :
+ case EMR_STROKEANDFILLPATH :
+ case EMR_STROKEPATH :
+ case EMR_FLATTENPATH :
+ case EMR_WIDENPATH :
+ case EMR_SELECTCLIPPATH :
+ case EMR_ABORTPATH :
+
+ case EMR_GDICOMMENT :
+ case EMR_FILLRGN :
+ case EMR_FRAMERGN :
+ case EMR_INVERTRGN :
+ case EMR_PAINTRGN :
+ case EMR_EXTSELECTCLIPRGN :
+ break;
+ case EMR_BITBLT :
+ {
+ UINT32 nRasterOp;
+ Size aDestExt;
+ Point aDestOrg;
+ Bitmap aBmp;
+
+ pWMF->SeekRel( 0x10 );
+ *pWMF >> nX32 >> nY32 >> nx32 >> ny32 >> nRasterOp;
+ aDestOrg = Point( nX32, nY32 );
+ aDestExt = Size( nx32, ny32 );
+ *pWMF >> nX32 >> nY32 >> nColor;
+
+ UINT32 nNewRop = R2_BLACK;
+ switch( nRasterOp )
+ {
+ case DSTINVERT :
+ nNewRop = R2_NOT;
+ break;
+ case 0x00990066 :
+ case SRCINVERT:
+ nNewRop = R2_XORPEN;
+ break;
+ case BLACKNESS :
+ nColor = 0;
+ break;
+ case WHITENESS :
+ nColor = 0xffffff;
+ break;
+ }
+ pOut->Push();
+ UINT32 nOldRop = pOut->SetRasterOp( nNewRop );
+ pOut->DrawRect( Rectangle( aDestOrg, aDestExt ) );
+ pOut->SetRasterOp( nOldRop );
+ pOut->Pop();
+ }
+ break;
+
+ case EMR_STRETCHBLT :
+ {
+ INT32 xDest, yDest, cxDest, cyDest, xSrc, ySrc, cxSrc, cySrc;
+ UINT32 dwRop, iUsageSrc, offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc;
+ XForm xformSrc;
+
+ UINT32 nStartPos = pWMF->Tell() - 8;
+
+ pWMF->SeekRel( 0x10 );
+ *pWMF >> xDest >> yDest >> cxDest >> cyDest >> dwRop >> xSrc >> ySrc >> xformSrc.eM11 >> xformSrc.eM12 >>
+ xformSrc.eM21 >> xformSrc.eM22 >> xformSrc.eDx >> xformSrc.eDy >> nColor >> iUsageSrc >> offBmiSrc >>
+ cbBmiSrc >> offBitsSrc >> cbBitsSrc >> cxSrc >> cySrc;
+
+ if ( offBmiSrc )
+ {
+ Bitmap aBitmap;
+ Rectangle aRect( Point( xDest, yDest ), Size( cxDest+1, cyDest+1 ) );
+
+ UINT32 nSize = cbBmiSrc + cbBitsSrc + 14;
+ char* pBuf = new char[ nSize ];
+ SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
+ aTmp.ObjectOwnsMemory( TRUE );
+ aTmp << (BYTE)'B'
+ << (BYTE)'M'
+ << (UINT32)cbBitsSrc
+ << (UINT16)0
+ << (UINT16)0
+ << (UINT32)cbBmiSrc + 14;
+ pWMF->Seek( nStartPos + offBmiSrc );
+ pWMF->Read( pBuf + 14, cbBmiSrc );
+ pWMF->Seek( nStartPos + offBitsSrc );
+ pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc );
+ aTmp.Seek( 0 );
+ aBitmap.Read( aTmp, TRUE );
+ aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop ), LIST_APPEND );
+ }
+ else
+ {
+ if( aBmpSaveList.Count() )
+ pOut->ResolveBitmapActions( aBmpSaveList );
+
+ Point aDestOrg = Point( xDest, yDest );
+ Size aDestExt = Size( cxDest, cyDest );
+
+ UINT32 nNewRop = R2_BLACK;
+ switch( dwRop )
+ {
+ case DSTINVERT :
+ nNewRop = R2_NOT;
+ break;
+ case 0x00990066 :
+ case SRCINVERT:
+ nNewRop = R2_XORPEN;
+ break;
+ case BLACKNESS :
+ nColor = 0;
+ break;
+ case WHITENESS :
+ nColor = 0xffffff;
+ break;
+ }
+ pOut->Push();
+ UINT32 nOldRop = pOut->SetRasterOp( nNewRop );
+ pOut->DrawRect( Rectangle( aDestOrg, aDestExt ), FALSE );
+ pOut->SetRasterOp( nOldRop );
+ pOut->Pop();
+ }
+ }
+ break;
+
+ case EMR_STRETCHDIBITS :
+ {
+ INT32 xDest, yDest, xSrc, ySrc, cxSrc, cySrc, cxDest, cyDest;
+ UINT32 offBmiSrc, cbBmiSrc, offBitsSrc, cbBitsSrc, iUsageSrc, dwRop;
+ UINT32 nStartPos = pWMF->Tell() - 8;
+
+ pWMF->SeekRel( 0x10 );
+ *pWMF >> xDest >> yDest >> xSrc >> ySrc >> cxSrc >> cySrc >> offBmiSrc >> cbBmiSrc >> offBitsSrc
+ >> cbBitsSrc >> iUsageSrc >> dwRop >> cxDest >> cyDest;
+
+ Bitmap aBitmap;
+ Rectangle aRect( Point( xDest, yDest ), Size( cxDest+1, cyDest+1 ) );
+
+ UINT32 nSize = cbBmiSrc + cbBitsSrc + 14;
+ char* pBuf = new char[ nSize ];
+ SvMemoryStream aTmp( pBuf, nSize, STREAM_READ | STREAM_WRITE );
+ aTmp.ObjectOwnsMemory( TRUE );
+ aTmp << (BYTE)'B'
+ << (BYTE)'M'
+ << (UINT32)cbBitsSrc
+ << (UINT16)0
+ << (UINT16)0
+ << (UINT32)cbBmiSrc + 14;
+ pWMF->Seek( nStartPos + offBmiSrc );
+ pWMF->Read( pBuf + 14, cbBmiSrc );
+ pWMF->Seek( nStartPos + offBitsSrc );
+ pWMF->Read( pBuf + 14 + cbBmiSrc, cbBitsSrc );
+ aTmp.Seek( 0 );
+ aBitmap.Read( aTmp, TRUE );
+ aBmpSaveList.Insert( new BSaveStruct( aBitmap, aRect, dwRop ), LIST_APPEND );
+ }
+ break;
+
+ case EMR_MASKBLT :
+ case EMR_PLGBLT :
+ case EMR_SETDIBITSTODEVICE :
+ break;
+
+ case EMR_EXTCREATEFONTINDIRECTW :
+ {
+ *pWMF >> nIndex;
+ if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
+ {
+ LOGFONTW aLogFont;
+ *pWMF >> aLogFont.lfHeight >> aLogFont.lfWidth >> aLogFont.lfEscapement >> aLogFont.lfOrientation >> aLogFont.lfWeight >> aLogFont.lfItalic
+ >> aLogFont.lfUnderline >> aLogFont.lfStrikeOut >> aLogFont.lfCharSet >> aLogFont.lfOutPrecision >> aLogFont.lfClipPrecision
+ >> aLogFont.lfQuality >> aLogFont.lfPitchAndFamily;
+
+ for ( int i = 0; i < LF_FACESIZE; i++ )
+ {
+ UINT16 nChar;
+ *pWMF >> nChar;
+ aLogFont.lfFaceName[ i ] = (BYTE)nChar;
+ }
+ pOut->CreateObject( nIndex, GDI_FONT, new WinMtfFontStyle( aLogFont ) );
+ }
+ }
+ break;
+ case EMR_EXTTEXTOUTA :
+ bFlag = TRUE;
+ case EMR_EXTTEXTOUTW :
+ {
+ INT32 nLeft, nTop, nRight, nBottom, ptlReferenceX, ptlReferenceY, nGfxMode, nXScale, nYScale;
+ UINT32 nCurPos, nLen, nOffString, nOptions, offDx;
+
+ nCurPos = pWMF->Tell() - 8;
+
+ *pWMF >> nLeft >> nTop >> nRight >> nBottom >> nGfxMode >> nXScale >> nYScale
+ >> ptlReferenceX >> ptlReferenceY >> nLen >> nOffString >> nOptions;
+
+ pWMF->SeekRel( 0x10 );
+ *pWMF >> offDx;
+
+ Point aPos;
+
+ if ( nGfxMode != GM_COMPATIBLE )
+ aPos = Point( nLeft, nTop );
+ else
+ aPos = Point( ptlReferenceX, ptlReferenceY );
+
+ UINT32 nSize = nLen;
+
+ if ( nLen )
+ {
+ if ( !bFlag )
+ nSize <<= 1;
+
+ BYTE* pBuf = new BYTE[ nSize + 1 ];
+
+ pWMF->Seek( nCurPos + nOffString );
+ pWMF->Read( pBuf, nSize );
+
+ String aText;
+ if( bFlag )
+ aText = String( (char*)pBuf, (USHORT)nLen, pOut->GetCharSet() );
+ else
+ {
+ #ifdef __BIGENDIAN
+ pBuf += nSize;
+ BYTE nTemp;
+ for( UINT32 i = 0; i < nLen; i++ )
+ {
+ pBuf -= 2;
+ pBuf[ 2 ] = *pBuf;
+ }
+ pBuf++;
+ #endif
+ aText = String( (sal_Unicode*)pBuf, (xub_StrLen)nLen );
+ }
+ #ifdef __BIGENDIAN
+ pBuf--;
+ #endif
+ delete[] pBuf;
+ pOut->DrawText( aPos, aText );
+ }
+ }
+ break;
+
+ case EMR_POLYBEZIERTO16 :
+ bFlag = TRUE;
+ case EMR_POLYBEZIER16 :
+ {
+ pWMF->SeekRel( 16 );
+ *pWMF >> nPoints;
+ UINT16 i = 0;
+ if ( bFlag )
+ {
+ i++;
+ nPoints++;
+ }
+ Polygon aPoly( (UINT16)nPoints );
+ for( ; i < (UINT16)nPoints; i++ )
+ {
+ *pWMF >> nX16 >> nY16;
+ aPoly[ i ] = Point( nX16, nY16 );
+ }
+ pOut->DrawPolyBezier( aPoly, bFlag ); // Line( aPoly, bFlag );
+ }
+ break;
+ case EMR_POLYGON16 :
+ {
+ pWMF->SeekRel( 16 );
+ *pWMF >> nPoints;
+ Polygon aPoly( (UINT16)nPoints );
+ for( UINT16 k = 0; k < (UINT16)nPoints; k++ )
+ {
+ *pWMF >> nX16 >> nY16;
+ aPoly[ k ] = Point( nX16, nY16 );
+ }
+ pOut->DrawPolygon( aPoly );
+ }
+ break;
+ case EMR_POLYLINETO16 :
+ bFlag = TRUE;
+ case EMR_POLYLINE16 :
+ {
+ pWMF->SeekRel( 16 );
+ *pWMF >> nPoints;
+ UINT16 i = 0;
+ if ( bFlag )
+ {
+ i++;
+ nPoints++;
+ }
+
+ Polygon aPoly( (UINT16)nPoints );
+ for( ; i < (UINT16)nPoints; i++ )
+ {
+ *pWMF >> nX16 >> nY16;
+ aPoly[ i ] = Point( nX16, nY16 );
+ }
+ pOut->DrawPolyLine( aPoly, bFlag );
+ }
+ break;
+
+ case EMR_POLYPOLYLINE16 :
+ {
+ UINT16* pnPoints;
+
+ INT32 i, nPoly, nGesPoints;
+ pWMF->SeekRel( 0x10 );
+ // Anzahl der Polygone:
+ *pWMF >> nPoly >> nGesPoints;
+ // Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln:
+ pnPoints = new UINT16[ nPoly ];
+ for ( i = 0; i < nPoly; i++ )
+ {
+ *pWMF >> nPoints;
+ pnPoints[ i ] = (UINT16)nPoints;
+ }
+ // Polygonpunkte holen:
+ for ( i = 0; i < nPoly; i++ )
+ {
+ Polygon aPolygon( pnPoints[ i ] );
+ for ( UINT16 k = 0; k < pnPoints[ i ]; k++ )
+ {
+ *pWMF >> nX16 >> nY16;
+ aPolygon[ k ] = Point( nX16, nY16 );
+ }
+ pOut->DrawPolyLine( aPolygon );
+ }
+ delete pnPoints;
+ }
+ break;
+
+ case EMR_POLYPOLYGON16 :
+ {
+ UINT16* pnPoints;
+ Point* pPtAry;
+
+ INT32 i, nPoly, nGesPoints;
+ pWMF->SeekRel( 0x10 );
+ // Anzahl der Polygone:
+ *pWMF >> nPoly >> nGesPoints;
+ // Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln:
+ pnPoints = new UINT16[ nPoly ];
+ for ( i = 0; i < nPoly; i++ )
+ {
+ *pWMF >> nPoints;
+ pnPoints[ i ] = (UINT16)nPoints;
+ }
+ // Polygonpunkte holen:
+ pPtAry = (Point*) new char[ nGesPoints * sizeof(Point) ];
+ for ( i = 0; i < nGesPoints; i++ )
+ {
+ *pWMF >> nX16 >> nY16;
+ pPtAry[ i ] = Point( nX16, nY16 );
+ }
+
+ // PolyPolygon Actions erzeugen
+ PolyPolygon aPolyPoly( (UINT16)nPoly, pnPoints, pPtAry );
+ pOut->DrawPolyPolygon( aPolyPoly );
+ delete (char*) pPtAry;
+ delete pnPoints;
+ };
+ break;
+ case EMR_POLYDRAW16 :
+ break;
+ case EMR_CREATEMONOBRUSH :
+ case EMR_CREATEDIBPATTERNBRUSHPT :
+ case EMR_EXTCREATEPEN :
+ case EMR_POLYTEXTOUTA :
+ case EMR_POLYTEXTOUTW :
+ case EMR_SETICMMODE :
+ break;
+ case EMR_CREATECOLORSPACE :
+ case EMR_SETCOLORSPACE :
+ case EMR_DELETECOLORSPACE :
+ break;
+ case EMR_GLSRECORD :
+ case EMR_GLSBOUNDEDRECORD :
+ case EMR_PIXELFORMAT :
+ break;
+
+ default :
+// bStatus = FALSE;
+ break;
+ }
+ pWMF->Seek( nNextPos );
+ }
+ if( aBmpSaveList.Count() )
+ pOut->ResolveBitmapActions( aBmpSaveList );
+
+ if ( bStatus )
+ pWMF->Seek(nEndPos);
+
+ return bStatus;
+};
+
+//-----------------------------------------------------------------------------------
+
+BOOL EnhWMFReader::ReadHeader()
+{
+ Rectangle aPlaceableBound;
+ UINT32 nUINT32, nHeaderSize, nPalEntries;
+ INT32 nLeft, nTop, nRight, nBottom;
+ INT32 nPixX, nPixY, nMillX, nMillY;
+
+ // METAFILEHEADER SPARE ICH MIR HIER
+ // Einlesen des METAHEADER
+ *pWMF >> nUINT32 >> nHeaderSize;
+ if ( nUINT32 != 1 ) // Typ
+ return FALSE;
+
+ // bound size
+ pWMF->SeekRel( 16 );
+
+ // picture frame size
+ *pWMF >> nLeft >> nTop >> nRight >> nBottom;
+ aPlaceableBound.Left() = nLeft;
+ aPlaceableBound.Top() = nTop;
+ aPlaceableBound.Right() = nRight;
+ aPlaceableBound.Bottom() = nBottom;
+
+ *pWMF >> nUINT32; // signature
+
+ if ( nUINT32 != 0x464d4520 )
+ return FALSE;
+
+ *pWMF >> nUINT32; // nVersion
+ *pWMF >> nEndPos; // size of metafile
+ nEndPos += nStartPos;
+ *pWMF >> nRecordCount;
+
+ if ( !nRecordCount )
+ return FALSE;
+
+ pWMF->SeekRel( 0xc );
+ *pWMF >> nPalEntries >> nPixX >> nPixY >> nMillX >> nMillY;
+
+ pOut->SetDevExt( aPlaceableBound.GetSize() );
+ pOut->SetWinOrg( Point( FRound( ( (double) aPlaceableBound.Left() * nPixX ) / ( nMillX * 100.0 ) ),
+ FRound( ( (double) aPlaceableBound.Top() * nPixY ) / ( nMillY * 100.0 ) ) ) );
+ pOut->SetWinExt( Size( FRound( ( (double) aPlaceableBound.GetWidth() * nPixX ) / ( nMillX * 100.0 ) ),
+ FRound( ( (double) aPlaceableBound.GetHeight() * nPixY ) / ( nMillY * 100.0 ) ) ) );
+ pWMF->Seek( nStartPos + nHeaderSize );
+ return TRUE;
+}
+
+//-----------------------------------------------------------------------------------
+
+Rectangle EnhWMFReader::ReadRectangle( INT32 x1, INT32 y1, INT32 x2, INT32 y2 )
+{
+ Point aTL ( Point( x1, y1 ) );
+ Point aBR( Point( --x2, --y2 ) );
+ return Rectangle( aTL, aBR );
+}
+
diff --git a/svtools/source/filter.vcl/wmf/makefile.mk b/svtools/source/filter.vcl/wmf/makefile.mk
new file mode 100644
index 000000000000..090588e12bdf
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/makefile.mk
@@ -0,0 +1,97 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=SVTOOLS
+TARGET=wmf
+VERSION=$(UPD)
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+.IF "$(GUI)"=="WIN"
+LINKFLAGS=$(LINKFLAGS) /PACKC:32768
+.ENDIF
+
+# --- Files --------------------------------------------------------
+
+CXXFILES= wmf.cxx \
+ winmtf.cxx \
+ winwmf.cxx \
+ enhwmf.cxx \
+ emfwr.cxx \
+ wmfwr.cxx
+
+SLOFILES= $(SLO)$/wmf.obj \
+ $(SLO)$/winmtf.obj \
+ $(SLO)$/winwmf.obj \
+ $(SLO)$/enhwmf.obj \
+ $(SLO)$/emfwr.obj \
+ $(SLO)$/wmfwr.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
new file mode 100644
index 000000000000..e00ff00c7c78
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -0,0 +1,1262 @@
+/*************************************************************************
+ *
+ * $RCSfile: winmtf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#include "winmtf.hxx"
+#include <vcl/metaact.hxx>
+
+// ------------------------------------------------------------------------
+
+WinMtfFontStyle::WinMtfFontStyle( LOGFONTW& rFont )
+{
+ Size aFontSize( Size( 0, rFont.lfHeight ) );
+
+ aFont.SetName( UniString( (char*)rFont.lfFaceName, RTL_TEXTENCODING_UTF8 ) );
+ aFont.SetSize( aFontSize );
+
+ CharSet eCharSet;
+ switch ( rFont.lfCharSet )
+ {
+ case ANSI_CHARSET:
+ eCharSet = RTL_TEXTENCODING_MS_1252;
+ break;
+
+ case SYMBOL_CHARSET:
+ eCharSet = RTL_TEXTENCODING_SYMBOL;
+ break;
+
+ case OEM_CHARSET:
+ case DEFAULT_CHARSET:
+ case SHIFTJIS_CHARSET:
+ case HANGEUL_CHARSET:
+ case CHINESEBIG5_CHARSET:
+ default:
+ eCharSet = gsl_getSystemTextEncoding();
+ break;
+ }
+ aFont.SetCharSet( eCharSet );
+
+ FontFamily eFamily;
+ switch ( rFont.lfPitchAndFamily & 0xf0 )
+ {
+ case FF_ROMAN:
+ eFamily = FAMILY_ROMAN;
+ break;
+
+ case FF_SWISS:
+ eFamily = FAMILY_SWISS;
+ break;
+
+ case FF_MODERN:
+ eFamily = FAMILY_MODERN;
+ break;
+
+ case FF_SCRIPT:
+ eFamily = FAMILY_SCRIPT;
+ break;
+
+ case FF_DECORATIVE:
+ eFamily = FAMILY_DECORATIVE;
+ break;
+
+ default:
+ eFamily = FAMILY_DONTKNOW;
+ break;
+ }
+ aFont.SetFamily( eFamily );
+
+ FontPitch ePitch;
+ switch ( rFont.lfPitchAndFamily & 0x0f )
+ {
+ case FIXED_PITCH:
+ ePitch = PITCH_FIXED;
+ break;
+
+ case DEFAULT_PITCH:
+ case VARIABLE_PITCH:
+ default:
+ ePitch = PITCH_VARIABLE;
+ break;
+ }
+ aFont.SetPitch( ePitch );
+
+ FontWeight eWeight;
+ if( rFont.lfWeight <= FW_THIN )
+ eWeight = WEIGHT_THIN;
+ else if( rFont.lfWeight <= FW_ULTRALIGHT )
+ eWeight = WEIGHT_ULTRALIGHT;
+ else if( rFont.lfWeight <= FW_LIGHT )
+ eWeight = WEIGHT_LIGHT;
+ else if( rFont.lfWeight < FW_MEDIUM )
+ eWeight = WEIGHT_NORMAL;
+ else if( rFont.lfWeight == FW_MEDIUM )
+ eWeight = WEIGHT_MEDIUM;
+ else if( rFont.lfWeight <= FW_SEMIBOLD )
+ eWeight = WEIGHT_SEMIBOLD;
+ else if( rFont.lfWeight <= FW_BOLD )
+ eWeight = WEIGHT_BOLD;
+ else if( rFont.lfWeight <= FW_ULTRABOLD )
+ eWeight = WEIGHT_ULTRABOLD;
+ else
+ eWeight = WEIGHT_BLACK;
+ aFont.SetWeight( eWeight );
+
+ if( rFont.lfItalic )
+ aFont.SetItalic( ITALIC_NORMAL );
+
+ if( rFont.lfUnderline )
+ aFont.SetUnderline( UNDERLINE_SINGLE );
+
+ if( rFont.lfStrikeOut )
+ aFont.SetStrikeout( STRIKEOUT_SINGLE );
+
+ if ( rFont.lfOrientation )
+ aFont.SetOrientation( (short)rFont.lfOrientation );
+ else
+ aFont.SetOrientation( (short)rFont.lfEscapement );
+};
+
+// ------------------------------------------------------------------------
+
+WinMtf::WinMtf( WinMtfOutput* pWinMtfOutput, SvStream& rStreamWMF, PFilterCallback pcallback, void * pcallerdata ) :
+ pOut ( pWinMtfOutput ),
+ pCallback ( pcallback ),
+ pCallerData ( pcallerdata ),
+ pWMF ( &rStreamWMF )
+{
+ SvLockBytes *pLB = pWMF->GetLockBytes();
+ if ( pLB )
+ pLB->SetSynchronMode( TRUE );
+
+ nStartPos = pWMF->Tell();
+
+ pOut->SetDevOrg( Point() );
+}
+
+// ------------------------------------------------------------------------
+
+WinMtf::~WinMtf()
+{
+ delete pOut;
+}
+
+// ------------------------------------------------------------------------
+
+BOOL WinMtf::Callback( USHORT nPercent )
+{
+ if ( pCallback != NULL )
+ {
+ if( (*pCallback)( pCallerData, nPercent ) )
+ {
+ pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+// ------------------------------------------------------------------------
+
+Color WinMtf::ReadColor()
+{
+ UINT32 nColor;
+ *pWMF >> nColor;
+ return Color( (BYTE)nColor, (BYTE)( nColor >> 8 ), (BYTE)( nColor >> 16 ) );
+};
+
+//-----------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------
+
+WinMtfOutput::WinMtfOutput() :
+ mnActTextAlign ( TA_LEFT | TA_TOP | TA_NOUPDATECP ),
+ mnBkMode ( OPAQUE ),
+ maBkColor ( COL_WHITE ),
+ mbNopMode ( FALSE ),
+ mbFontChanged ( FALSE ),
+ maActPos ( Point() ),
+ meRasterOp ( ROP_OVERPAINT ),
+ mnEntrys ( 16 )
+{
+ maFont.SetCharSet( gsl_getSystemTextEncoding() );
+ mpGDIObj = new GDIObj*[ mnEntrys ];
+ for ( UINT32 i = 0; i < mnEntrys; i++ )
+ {
+ mpGDIObj[ i ] = NULL;
+ }
+};
+
+//-----------------------------------------------------------------------------------
+
+WinMtfOutput::~WinMtfOutput()
+{
+ while( maSaveStack.Count() )
+ delete maSaveStack.Pop();
+
+ for ( UINT32 i = 0; i < mnEntrys; i++ )
+ {
+ delete mpGDIObj[ i ];
+ }
+ delete mpGDIObj;
+};
+
+//-----------------------------------------------------------------------------------
+
+Point WinMtfOutput::ImplMap( const Point& rPt )
+{
+ if( mnWinExtX && mnWinExtY )
+ {
+ return Point( FRound( ( ( (double) rPt.X() - mnWinOrgX ) * mnDevWidth / mnWinExtX + mnDevOrgX ) * maXForm.eM11 ),
+ FRound( ( ( (double) rPt.Y() - mnWinOrgY ) * mnDevHeight / mnWinExtY + mnDevOrgY ) * maXForm.eM12 ) );
+ }
+ else
+ return Point();
+};
+
+// ------------------------------------------------------------------------
+
+Size WinMtfOutput::ImplMap( const Size& rSz )
+{
+ if( mnWinExtX && mnWinExtY )
+ {
+ return Size( FRound( ( (double) rSz.Width() * mnDevWidth / mnWinExtX ) * maXForm.eM11 ),
+ FRound( ( (double) rSz.Height() * mnDevHeight / mnWinExtY ) * maXForm.eM12 ) );
+ }
+ else
+ return Size();
+}
+
+//-----------------------------------------------------------------------------------
+
+Rectangle WinMtfOutput::ImplMap( const Rectangle& rRect )
+{
+ return Rectangle( ImplMap( rRect.TopLeft() ), ImplMap( rRect.GetSize() ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::ImplMap( Font& rFont )
+{
+ // !!! HACK: Wir setzen die Breite jetzt immer auf Null,
+ // da OS die Breite unterschiedlich interpretieren;
+ // muss spaeter in SV portabel gemacht werden ( KA 08.02.96 )
+ Size aFontSize = ImplMap ( rFont.GetSize() );
+
+ if( aFontSize.Height() < 0 )
+ aFontSize.Height() *= -1;
+
+ rFont.SetSize( Size( 0, aFontSize.Height() ) );
+
+ if( ( mnWinExtX * mnWinExtY ) < 0 )
+ rFont.SetOrientation( 3600 - rFont.GetOrientation() );
+}
+
+//-----------------------------------------------------------------------------------
+
+Polygon& WinMtfOutput::ImplMap( Polygon& rPolygon )
+{
+ UINT16 nPoints = rPolygon.GetSize();
+ for ( UINT16 i = 0; i < nPoints; i++ )
+ {
+ rPolygon[ i ] = ImplMap( rPolygon[ i ] );
+ }
+ return rPolygon;
+}
+
+//-----------------------------------------------------------------------------------
+
+PolyPolygon& WinMtfOutput::ImplMap( PolyPolygon& rPolyPolygon )
+{
+ UINT16 nPolys = rPolyPolygon.Count();
+ for ( UINT16 i = 0; i < nPolys; ImplMap( rPolyPolygon[ i++ ] ) );
+ return rPolyPolygon;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::SelectObject( INT32 nIndex )
+{
+ GDIObj* pGDIObj = NULL;
+
+ if ( nIndex & ENHMETA_STOCK_OBJECT )
+ pGDIObj = new GDIObj();
+ else
+ {
+ nIndex &= 0xffff; // zur Sicherheit: mehr als 65535 nicht zulassen
+
+ if ( (UINT32)nIndex < mnEntrys )
+ pGDIObj = mpGDIObj[ nIndex ];
+ }
+
+ if( pGDIObj == NULL )
+ return;
+
+ if ( nIndex & ENHMETA_STOCK_OBJECT )
+ {
+ UINT16 nStockId = (BYTE)nIndex;
+ switch( nStockId )
+ {
+ case WHITE_BRUSH :
+ {
+ pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ) ) );
+ }
+ break;
+ case LTGRAY_BRUSH :
+ {
+ pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_LIGHTGRAY ) ) );
+ }
+ break;
+ case GRAY_BRUSH :
+ case DKGRAY_BRUSH :
+ {
+ pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_GRAY ) ) );
+ }
+ break;
+ case BLACK_BRUSH :
+ {
+ pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_BLACK ) ) );
+ }
+ break;
+ case NULL_BRUSH :
+ {
+ pGDIObj->Set( GDI_BRUSH, new WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE ) );
+ }
+ break;
+ case WHITE_PEN :
+ {
+ pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_WHITE ) ) );
+ }
+ break;
+ case BLACK_PEN :
+ {
+ pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_BLACK ) ) );
+ }
+ break;
+ case NULL_PEN :
+ {
+ pGDIObj->Set( GDI_PEN, new WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE ) );
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if ( pGDIObj->pStyle )
+ {
+ switch( pGDIObj->eType )
+ {
+ case GDI_PEN :
+ maLineStyle = (WinMtfLineStyle*)pGDIObj->pStyle;
+ break;
+ case GDI_BRUSH :
+ maFillStyle = (WinMtfFillStyle*)pGDIObj->pStyle;
+ break;
+ case GDI_FONT :
+ {
+ maFont = ((WinMtfFontStyle*)pGDIObj->pStyle)->aFont;
+ if ( ( mnActTextAlign & TA_BASELINE) == TA_BASELINE )
+ maFont.SetAlign( ALIGN_BASELINE );
+ else if( ( mnActTextAlign & TA_BOTTOM) == TA_BOTTOM )
+ maFont.SetAlign( ALIGN_BOTTOM );
+ else
+ maFont.SetAlign( ALIGN_TOP );
+
+ if( mnBkMode == TRANSPARENT )
+ maFont.SetTransparent( TRUE );
+ else
+ {
+ maFont.SetFillColor( maBkColor );
+ maFont.SetTransparent( FALSE );
+ }
+ maFont.SetColor( maTextColor );
+ mbFontChanged = TRUE;
+ }
+ break;
+ }
+ }
+ if ( nIndex & ENHMETA_STOCK_OBJECT )
+ delete pGDIObj;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::Push( BOOL bWinExtSet )
+{
+ SaveStruct* pSave = new SaveStruct;
+
+ pSave->aActPos = maActPos;
+ pSave->nActTextAlign = mnActTextAlign;
+ pSave->nBkMode = mnBkMode;
+ pSave->aBkColor = maBkColor;
+ pSave->bWinExtSet = bWinExtSet;
+ pSave->aLineStyle = maLineStyle;
+ pSave->aFillStyle = maFillStyle;
+ pSave->aTextColor = maTextColor;
+ pSave->aFont = maFont;
+ pSave->bFontChanged = mbFontChanged;
+
+ if ( bWinExtSet )
+ {
+ pSave->nWinOrgX = mnWinOrgX;
+ pSave->nWinOrgY = mnWinOrgY;
+ pSave->nWinExtX = mnWinExtX;
+ pSave->nWinExtY = mnWinExtY;
+ pSave->nDevOrgX = mnDevOrgX;
+ pSave->nDevOrgY = mnDevOrgY;
+ pSave->nDevWidth = mnDevWidth;
+ pSave->nDevHeight = mnDevHeight;
+ }
+ maSaveStack.Push( pSave );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::Pop()
+{
+ // Die aktuellen Daten vom Stack holen
+ if( maSaveStack.Count() )
+ {
+ // Die aktuelle Daten auf dem Stack sichern
+ SaveStruct* pSave = maSaveStack.Pop();
+
+ mnBkMode = pSave->nBkMode;
+ maBkColor = pSave->aBkColor;
+ maActPos = pSave->aActPos;
+ mnActTextAlign = pSave->nActTextAlign;
+ maLineStyle = pSave->aLineStyle;
+ maFillStyle = pSave->aFillStyle;
+ maTextColor = pSave->aTextColor;
+ maFont = pSave->aFont;
+ mbFontChanged = pSave->bFontChanged;
+
+ if ( pSave->bWinExtSet )
+ {
+ mnWinOrgX = pSave->nWinOrgX;
+ mnWinOrgY = pSave->nWinOrgY;
+ mnWinExtX = pSave->nWinExtX;
+ mnWinExtY = pSave->nWinExtY;
+ mnDevOrgX = pSave->nDevOrgX;
+ mnDevOrgY = pSave->nDevOrgY;
+ mnDevWidth = pSave->nDevWidth;
+ mnDevHeight = pSave->nDevHeight;
+ }
+ delete pSave;
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::SetBkMode( UINT32 nMode )
+{
+ maFont.SetTransparent( ( mnBkMode = nMode ) == TRANSPARENT );
+ mbFontChanged = TRUE;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::SetBkColor( const Color& rColor )
+{
+ maBkColor = rColor;
+ maFont.SetFillColor( rColor );
+ maFont.SetTransparent( mnBkMode == TRANSPARENT );
+ mbFontChanged = TRUE;
+}
+
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::SetTextColor( const Color& rColor )
+{
+ maTextColor = rColor;
+ maFont.SetColor( rColor );
+ mbFontChanged = TRUE;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::SetTextAlign( UINT32 nAlign )
+{
+ mnActTextAlign = nAlign;
+
+ if ( ( mnActTextAlign & TA_BASELINE ) == TA_BASELINE )
+ maFont.SetAlign( ALIGN_BASELINE );
+ else if( ( mnActTextAlign & TA_BOTTOM ) == TA_BOTTOM )
+ maFont.SetAlign( ALIGN_BOTTOM );
+ else
+ maFont.SetAlign( ALIGN_TOP );
+
+ mbFontChanged = TRUE;
+}
+
+//-----------------------------------------------------------------------------------
+
+UINT32 WinMtfOutput::SetRasterOp( UINT32 nROP2 )
+{
+ UINT32 nRetROP = mnRop;
+ if ( nROP2 != mnRop )
+ {
+ mnRop = nROP2;
+ static WinMtfFillStyle aNopFillStyle;
+ static WinMtfLineStyle aNopLineStyle;
+
+ if ( mbNopMode && ( nROP2 != R2_NOP ) )
+ { // beim uebergang von R2_NOP auf anderen Modus
+ // gesetzten Pen und Brush aktivieren
+ maFillStyle = aNopFillStyle;
+ maLineStyle = aNopLineStyle;
+ mbNopMode = FALSE;
+ }
+ switch( nROP2 )
+ {
+ case R2_NOT:
+ meRasterOp = ROP_INVERT;
+ break;
+
+ case R2_XORPEN:
+ meRasterOp = ROP_XOR;
+ break;
+
+ case R2_NOP:
+ {
+ meRasterOp = ROP_OVERPAINT;
+ if( mbNopMode = FALSE )
+ {
+ aNopFillStyle = maFillStyle;
+ aNopLineStyle = maLineStyle;
+ maFillStyle = WinMtfFillStyle( Color( COL_TRANSPARENT ), TRUE );
+ maLineStyle = WinMtfLineStyle( Color( COL_TRANSPARENT ), TRUE );
+ mbNopMode = TRUE;
+ }
+ }
+ break;
+
+ default:
+ meRasterOp = ROP_OVERPAINT;
+ break;
+ }
+ }
+ return nRetROP;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::ImplResizeObjectArry( UINT32 nNewEntrys )
+{
+ GDIObj** pGDIObj = new GDIObj*[ mnEntrys << 1 ];
+ UINT32 nIndex;
+ for ( nIndex = 0; nIndex < mnEntrys; nIndex++ )
+ pGDIObj[ nIndex ] = mpGDIObj[ nIndex ];
+ for ( mnEntrys = nNewEntrys; nIndex < mnEntrys; pGDIObj[ nIndex++ ] = NULL );
+ delete mpGDIObj, mpGDIObj = pGDIObj;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::CreateObject( GDIObjectType eType, void* pStyle )
+{
+ if ( pStyle )
+ {
+ if ( eType == GDI_FONT )
+ ImplMap( ((WinMtfFontStyle*)pStyle)->aFont );
+ else if ( eType == GDI_PEN )
+ {
+ Size aSize( ((WinMtfLineStyle*)pStyle)->aLineInfo.GetWidth(), 0 );
+ ((WinMtfLineStyle*)pStyle)->aLineInfo.SetWidth( ImplMap( aSize ).Width() );
+ if ( ((WinMtfLineStyle*)pStyle)->aLineInfo.GetStyle() == LINE_DASH )
+ {
+ aSize.Width() += 1;
+ long nDotLen = ImplMap( aSize ).Width();
+ ((WinMtfLineStyle*)pStyle)->aLineInfo.SetDistance( nDotLen );
+ ((WinMtfLineStyle*)pStyle)->aLineInfo.SetDotLen( nDotLen );
+ ((WinMtfLineStyle*)pStyle)->aLineInfo.SetDashLen( nDotLen * 4 );
+ }
+ }
+ }
+ UINT32 nIndex;
+ for ( nIndex = 0; nIndex < mnEntrys; nIndex++ )
+ {
+ if ( mpGDIObj[ nIndex ] == NULL )
+ break;
+ }
+ if ( nIndex == mnEntrys )
+ ImplResizeObjectArry( mnEntrys << 1 );
+
+ mpGDIObj[ nIndex ] = new GDIObj( eType, pStyle );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::CreateObject( INT32 nIndex, GDIObjectType eType, void* pStyle )
+{
+ if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
+ {
+ nIndex &= 0xffff; // zur Sicherheit: mehr als 65535 nicht zulassen
+ if ( pStyle )
+ {
+ if ( eType == GDI_FONT )
+ ImplMap( ((WinMtfFontStyle*)pStyle)->aFont );
+ else if ( eType == GDI_PEN )
+ {
+ Size aSize( ((WinMtfLineStyle*)pStyle)->aLineInfo.GetWidth(), 0 );
+ ((WinMtfLineStyle*)pStyle)->aLineInfo.SetWidth( ImplMap( aSize ).Width() );
+ if ( ((WinMtfLineStyle*)pStyle)->aLineInfo.GetStyle() == LINE_DASH )
+ {
+ aSize.Width() += 1;
+ long nDotLen = ImplMap( aSize ).Width();
+ ((WinMtfLineStyle*)pStyle)->aLineInfo.SetDistance( nDotLen );
+ ((WinMtfLineStyle*)pStyle)->aLineInfo.SetDotLen( nDotLen );
+ ((WinMtfLineStyle*)pStyle)->aLineInfo.SetDashLen( nDotLen * 4 );
+ }
+ }
+ }
+ if ( (UINT32)nIndex >= mnEntrys )
+ ImplResizeObjectArry( nIndex + 16 );
+
+ if ( mpGDIObj[ nIndex ] != NULL )
+ delete mpGDIObj[ nIndex ];
+
+ mpGDIObj[ nIndex ] = new GDIObj( eType, pStyle );
+ }
+ else
+ delete pStyle;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::DeleteObject( INT32 nIndex )
+{
+ if ( ( nIndex & ENHMETA_STOCK_OBJECT ) == 0 )
+ {
+ nIndex &= 0xffff; // zur Sicherheit: mehr als 65535 nicht zulassen
+ delete mpGDIObj[ nIndex ], mpGDIObj[ nIndex ] = NULL;
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfOutput::DrawText( Point& rPosition, String& rText, INT32* pDXArry )
+{
+ rPosition = ImplMap( rPosition );
+
+ if ( pDXArry )
+ {
+ INT32 i, nSum, nLen = rText.Len();
+
+ for( i = 0, nSum = 0; i < nLen; i++ )
+ {
+ INT32 nTemp = ImplMap( Size( pDXArry[ i ], 0 ) ).Width();
+ nSum += nTemp;
+ pDXArry[ i ] = nSum;
+ }
+ }
+}
+
+//-----------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------
+//-----------------------------------------------------------------------------------
+
+WinMtfMetaOutput::WinMtfMetaOutput( GDIMetaFile& rGDIMetaFile ) : WinMtfOutput()
+{
+ maLatestLineStyle.aLineColor = Color( 0x12, 0x34, 0x56 );
+ maLatestFillStyle.aFillColor = Color( 0x12, 0x34, 0x56 );
+ mpGDIMetaFile = &rGDIMetaFile;
+ mnPushPopCount = 0;
+
+ mnRop = R2_BLACK + 1;
+ SetRasterOp( R2_BLACK );
+};
+
+//-----------------------------------------------------------------------------------
+
+WinMtfMetaOutput::~WinMtfMetaOutput()
+{
+ while( mnPushPopCount > 0 )
+ {
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
+ mnPushPopCount--;
+ }
+ mpGDIMetaFile->SetPrefMapMode( MAP_100TH_MM );
+ mpGDIMetaFile->SetPrefSize( Size( mnDevWidth, mnDevHeight ) );
+};
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::UpdateLineStyle()
+{
+ if (!( maLatestLineStyle == maLineStyle ) )
+ {
+ maLatestLineStyle = maLineStyle;
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, !maLineStyle.bTransparent ) );
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::UpdateFillStyle()
+{
+ if (!( maLatestFillStyle == maFillStyle ) )
+ {
+ maLatestFillStyle = maFillStyle;
+ mpGDIMetaFile->AddAction( new MetaFillColorAction( maFillStyle.aFillColor, !maFillStyle.bTransparent ) );
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+UINT32 WinMtfMetaOutput::SetRasterOp( UINT32 nRasterOp )
+{
+ UINT32 nRetROP = WinMtfOutput::SetRasterOp( nRasterOp );
+ if ( nRetROP != nRasterOp )
+ mpGDIMetaFile->AddAction( new MetaRasterOpAction( meRasterOp ) );
+ return nRetROP;
+};
+
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawPixel( const Point& rSource, const Color& rColor )
+{
+ mpGDIMetaFile->AddAction( new MetaPixelAction( ImplMap( rSource), rColor ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::LineTo( const Point& rPoint )
+{
+ Point aDest( ImplMap( rPoint ) );
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaLineAction( maActPos, aDest, maLineStyle.aLineInfo ) );
+ maActPos = aDest;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawLine( const Point& rSource, const Point& rDest )
+{
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaLineAction( ImplMap( rSource), ImplMap( rDest ), maLineStyle.aLineInfo ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawRect( const Rectangle& rRect, BOOL bEdge )
+{
+ UpdateFillStyle();
+ if ( bEdge )
+ {
+ if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) )
+ {
+ mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, FALSE ) );
+ mpGDIMetaFile->AddAction( new MetaRectAction( ImplMap( rRect ) ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, !maLineStyle.bTransparent ) );
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( Polygon( ImplMap( rRect ) ),maLineStyle.aLineInfo ) );
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
+ }
+ else
+ {
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaRectAction( ImplMap( rRect ) ) );
+ }
+ }
+ else
+ {
+ mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( Color(), FALSE ) );
+ mpGDIMetaFile->AddAction( new MetaRectAction( ImplMap( rRect ) ) );
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawRoundRect( const Rectangle& rRect, const Size& rSize )
+{
+ UpdateLineStyle();
+ UpdateFillStyle();
+ mpGDIMetaFile->AddAction( new MetaRoundRectAction( ImplMap( rRect ), labs( ImplMap( rSize ).Width() ), labs( ImplMap( rSize ).Height() ) ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawEllipse( const Rectangle& rRect )
+{
+ UpdateFillStyle();
+
+ if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) )
+ {
+ Point aCenter( ImplMap( rRect.Center() ) );
+ Size aRad( ImplMap( Size( rRect.GetWidth() / 2, rRect.GetHeight() / 2 ) ) );
+
+ mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, FALSE ) );
+ mpGDIMetaFile->AddAction( new MetaEllipseAction( ImplMap( rRect ) ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, !maLineStyle.bTransparent ) );
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( Polygon( aCenter, aRad.Width(), aRad.Height() ), maLineStyle.aLineInfo ) );
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
+ }
+ else
+ {
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaEllipseAction( ImplMap( rRect ) ) );
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawArc( const Rectangle& rRect, const Point& rStart, const Point& rEnd, BOOL bTo )
+{
+ UpdateLineStyle();
+ UpdateFillStyle();
+
+ Rectangle aRect( ImplMap( rRect ) );
+ Point aStart( ImplMap( rStart ) );
+ Point aEnd( ImplMap( rEnd ) );
+
+ if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) )
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( Polygon( aRect, aStart, aEnd, POLY_ARC ), maLineStyle.aLineInfo ) );
+ else
+ mpGDIMetaFile->AddAction( new MetaArcAction( aRect, aStart, aEnd ) );
+
+ if ( bTo )
+ maActPos = aEnd;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawPie( const Rectangle& rRect, const Point& rStart, const Point& rEnd )
+{
+ UpdateFillStyle();
+
+ Rectangle aRect( ImplMap( rRect ) );
+ Point aStart( ImplMap( rStart ) );
+ Point aEnd( ImplMap( rEnd ) );
+
+ if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) )
+ {
+ mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, FALSE ) );
+ mpGDIMetaFile->AddAction( new MetaPieAction( aRect, aStart, aEnd ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, !maLineStyle.bTransparent ) );
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( Polygon( aRect, aStart, aEnd, POLY_PIE ), maLineStyle.aLineInfo ) );
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
+ }
+ else
+ {
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaPieAction( aRect, aStart, aEnd ) );
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawChord( const Rectangle& rRect, const Point& rStart, const Point& rEnd )
+{
+ UpdateFillStyle();
+
+ Rectangle aRect( ImplMap( rRect ) );
+ Point aStart( ImplMap( rStart ) );
+ Point aEnd( ImplMap( rEnd ) );
+
+ if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) )
+ {
+ mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, FALSE ) );
+ mpGDIMetaFile->AddAction( new MetaChordAction( aRect, aStart, aEnd ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, !maLineStyle.bTransparent ) );
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( Polygon( aRect, aStart, aEnd, POLY_CHORD ), maLineStyle.aLineInfo ) );
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
+ }
+ else
+ {
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaChordAction( aRect, aStart, aEnd ) );
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawPolygon( Polygon& rPolygon )
+{
+ UpdateFillStyle();
+
+ if ( maLineStyle.aLineInfo.GetWidth() || ( maLineStyle.aLineInfo.GetStyle() == LINE_DASH ) )
+ {
+ USHORT nCount = rPolygon.GetSize();
+ if ( nCount )
+ {
+ if ( rPolygon[ nCount - 1 ] != rPolygon[ 0 ] )
+ {
+ Point aPoint( rPolygon[ 0 ] );
+ rPolygon.Insert( nCount, aPoint );
+ }
+ }
+ mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_LINECOLOR ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, FALSE ) );
+ mpGDIMetaFile->AddAction( new MetaPolygonAction( ImplMap( rPolygon ) ) );
+ mpGDIMetaFile->AddAction( new MetaLineColorAction( maLineStyle.aLineColor, !maLineStyle.bTransparent ) );
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) );
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
+ }
+ else
+ {
+ UpdateLineStyle();
+ mpGDIMetaFile->AddAction( new MetaPolygonAction( ImplMap( rPolygon ) ) );
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawPolyPolygon( PolyPolygon& rPolyPolygon )
+{
+ UpdateLineStyle();
+ UpdateFillStyle();
+ mpGDIMetaFile->AddAction( new MetaPolyPolygonAction( ImplMap( rPolyPolygon ) ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawPolyLine( Polygon& rPolygon, BOOL bTo )
+{
+ UpdateLineStyle();
+ ImplMap( rPolygon );
+ if ( bTo )
+ {
+ rPolygon[ 0 ] = maActPos;
+ maActPos = rPolygon[ rPolygon.GetSize() - 1 ];
+ }
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( rPolygon, maLineStyle.aLineInfo ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawPolyBezier( Polygon& rPolygon, BOOL bTo )
+{
+ UpdateLineStyle();
+ UINT16 nPoints = rPolygon.GetSize();
+ if ( ( nPoints >= 4 ) && ( ( ( nPoints - 4 ) % 3 ) == 0 ) )
+ {
+ ImplMap( rPolygon );
+ if ( bTo )
+ {
+ rPolygon[ 0 ] = maActPos;
+ maActPos = rPolygon[ nPoints - 1 ];
+ }
+ // create bezier polygon
+ const USHORT nSegPoints = 25;
+ const USHORT nSegments = ( ( nPoints - 4 ) / 3 ) + 1;
+ Polygon aBezPoly( nSegments * nSegPoints );
+
+ USHORT nSeg, nBezPos, nStartPos;
+ for( nSeg = 0, nBezPos = 0, nStartPos = 0; nSeg < nSegments; nSeg++, nStartPos += 3 )
+ {
+ const Polygon aSegPoly( rPolygon[ nStartPos ], rPolygon[ nStartPos + 1 ],
+ rPolygon[ nStartPos + 3 ], rPolygon[ nStartPos + 2 ],
+ nSegPoints );
+ for( USHORT nSegPos = 0; nSegPos < nSegPoints; )
+ aBezPoly[ nBezPos++ ] = aSegPoly[ nSegPos++ ];
+ }
+
+ if( nBezPos != aBezPoly.GetSize() )
+ aBezPoly.SetSize( nBezPos );
+ mpGDIMetaFile->AddAction( new MetaPolyLineAction( aBezPoly, maLineStyle.aLineInfo ) );
+ }
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::DrawText( Point& rPosition, String& rText, INT32* pDXArry )
+{
+ WinMtfOutput::DrawText( rPosition, rText, pDXArry );
+
+ if( mbFontChanged )
+ {
+ mpGDIMetaFile->AddAction( new MetaFontAction( maFont ) );
+ mpGDIMetaFile->AddAction( new MetaTextAlignAction( maFont.GetAlign() ) );
+ mpGDIMetaFile->AddAction( new MetaTextColorAction( maFont.GetColor() ) );
+ mpGDIMetaFile->AddAction( new MetaTextFillColorAction( maFont.GetFillColor(), !maFont.IsTransparent() ) );
+ mbFontChanged = FALSE;
+ }
+
+ if( mnActTextAlign & ( TA_UPDATECP | TA_RIGHT_CENTER ) )
+ {
+ VirtualDevice aVDev;
+ sal_Int32 nTextWidth;
+
+ aVDev.SetMapMode( MapMode( MAP_100TH_MM ) );
+ aVDev.SetFont( maFont );
+
+ if( pDXArry )
+ {
+ UINT32 nLen = rText.Len();
+ nTextWidth = aVDev.GetTextWidth( rText.GetChar( nLen - 1 ) );
+ if( nLen > 1 )
+ nTextWidth += pDXArry[ nLen - 2 ];
+ }
+ else
+ nTextWidth = aVDev.GetTextWidth( rText );
+
+ if( mnActTextAlign & TA_UPDATECP )
+ rPosition = maActPos;
+
+ if( mnActTextAlign & TA_RIGHT_CENTER )
+ rPosition.X() -= ( ( mnActTextAlign & TA_RIGHT_CENTER ) == TA_RIGHT ) ? nTextWidth : ( nTextWidth >> 1 );
+
+ if( mnActTextAlign & TA_UPDATECP )
+ maActPos.X() = rPosition.X() + nTextWidth;
+ }
+
+ if( pDXArry )
+ mpGDIMetaFile->AddAction( new MetaTextArrayAction( rPosition, rText, pDXArry, 0, STRING_LEN ) );
+ else
+ mpGDIMetaFile->AddAction( new MetaTextAction( rPosition, rText, 0, STRING_LEN ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::ResolveBitmapActions( List& rSaveList )
+{
+ for( ULONG i = 0, nCount = rSaveList.Count(); i < nCount; i++ )
+ {
+ BSaveStruct* pSave1 = (BSaveStruct*) rSaveList.GetObject( i );
+ BOOL bDrawn = FALSE;
+
+ UpdateFillStyle();
+
+ if( i < ( nCount - 1 ) )
+ {
+ BSaveStruct* pSave2 = (BSaveStruct*) rSaveList.GetObject( i + 1 );
+
+ if( ( pSave1->aOutRect == pSave2->aOutRect ) &&
+ ( pSave1->nWinRop == SRCPAINT) && ( pSave2->nWinRop == SRCAND ) )
+ {
+ Bitmap aMask( pSave1->aBmp ); aMask.Invert();
+ BitmapEx aBmpEx( pSave2->aBmp, aMask );
+ mpGDIMetaFile->AddAction( new MetaBmpExScaleAction( ImplMap( pSave1->aOutRect.TopLeft() ), ImplMap( pSave1->aOutRect.GetSize() ), aBmpEx ) );
+ bDrawn = TRUE;
+ i++;
+ delete pSave2;
+ }
+ }
+ if( !bDrawn )
+ {
+ UINT32 nNewROP, nOldROP;
+ switch( pSave1->nWinRop )
+ {
+ case DSTINVERT: nNewROP = R2_NOT; break;
+ case SRCINVERT: nNewROP = R2_XORPEN; break;
+ default: nNewROP = R2_BLACK; break;
+ }
+ nOldROP = SetRasterOp( nNewROP );
+ mpGDIMetaFile->AddAction( new MetaBmpScaleAction( ImplMap( pSave1->aOutRect.TopLeft() ), ImplMap( pSave1->aOutRect.GetSize() ), pSave1->aBmp ) );
+ SetRasterOp( nOldROP );
+ }
+ delete pSave1;
+ }
+ rSaveList.Clear();
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::IntersectClipRect( const Rectangle& rRect )
+{
+ mpGDIMetaFile->AddAction( new MetaISectRectClipRegionAction( ImplMap( rRect ) ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::MoveClipRegion( const Size& rSize )
+{
+ Size aSize( ImplMap( rSize ) );
+ mpGDIMetaFile->AddAction( new MetaMoveClipRegionAction( aSize.Width(), aSize.Height() ) );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::SetDevOrg( const Point& rPoint )
+{
+ mnDevOrgX = rPoint.X();
+ mnDevOrgY = rPoint.Y();
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd )
+{
+ mnDevOrgX += nXAdd;
+ mnDevOrgY += nYAdd;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::SetDevExt( const Size& rSize )
+{
+ mnDevWidth = rSize.Width();
+ mnDevHeight = rSize.Height();
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::ScaleDevExt( double fX, double fY )
+{
+ mnDevWidth = FRound( mnDevWidth * fX );
+ mnDevHeight = FRound( mnDevHeight * fY );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::SetWinOrg( const Point& rPoint )
+{
+ mnWinOrgX = rPoint.X();
+ mnWinOrgY = rPoint.Y();
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::SetWinOrgOffset( INT32 nXAdd, INT32 nYAdd )
+{
+ mnWinOrgX += nXAdd;
+ mnWinOrgY += nYAdd;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::SetWinExt( const Size& rSize )
+{
+ mnWinExtX = rSize.Width();
+ mnWinExtY = rSize.Height();
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::ScaleWinExt( double fX, double fY )
+{
+ mnWinExtX = FRound( mnWinExtX * fX );
+ mnWinExtY = FRound( mnWinExtY * fY );
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::SetWorldTransform( const XForm& rXForm )
+{
+ maXForm.eM11 = rXForm.eM11;
+ maXForm.eM12 = rXForm.eM12;
+ maXForm.eM21 = rXForm.eM21;
+ maXForm.eM22 = rXForm.eM22;
+ maXForm.eDx = rXForm.eDx;
+ maXForm.eDy = rXForm.eDy;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::ModifyWorldTransform( const XForm& rXForm, UINT32 nMode )
+{
+ switch( nMode )
+ {
+ case MWT_IDENTITY :
+ {
+ maXForm.eM11 = maXForm.eM12 = maXForm.eM21 = maXForm.eM22 = 1.0f;
+ maXForm.eDx = maXForm.eDx = 0.0f;
+ }
+ break;
+
+ case MWT_LEFTMULTIPLY :
+ case MWT_RIGHTMULTIPLY :
+ break;
+ }
+ }
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::Push( BOOL bExtSet )
+{
+ WinMtfOutput::Push( bExtSet );
+ // bei SaveDC muessen wir die verzoegerte Selektion
+ // von Objekten umgehen, damit beim RestoreDC wieder
+ // die richtigen Objekte selektiert werden
+ UpdateLineStyle();
+ UpdateFillStyle();
+ if( mbFontChanged )
+ {
+ mpGDIMetaFile->AddAction( new MetaFontAction( maFont ) );
+ mpGDIMetaFile->AddAction( new MetaTextAlignAction( maFont.GetAlign() ) );
+ mpGDIMetaFile->AddAction( new MetaTextColorAction( maFont.GetColor() ) );
+ mpGDIMetaFile->AddAction( new MetaTextFillColorAction( maFont.GetFillColor(), !maFont.IsTransparent() ) );
+ mbFontChanged = FALSE;
+ }
+ mpGDIMetaFile->AddAction( new MetaPushAction( PUSH_ALL ) );
+ mnPushPopCount++;
+}
+
+//-----------------------------------------------------------------------------------
+
+void WinMtfMetaOutput::Pop()
+{
+ WinMtfOutput::Pop();
+ maLatestLineStyle = maLineStyle;
+ maLatestFillStyle = maFillStyle;
+ if( mnPushPopCount > 0 )
+ {
+ mpGDIMetaFile->AddAction( new MetaPopAction() );
+ mnPushPopCount--;
+ }
+}
+
diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx
new file mode 100644
index 000000000000..2d129a55ab6b
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/winmtf.hxx
@@ -0,0 +1,687 @@
+/*************************************************************************
+ *
+ * $RCSfile: winmtf.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _WINMTF_HXX
+#define _WINMTF_HXX
+
+#include <math.h>
+#include <stdlib.h>
+#include <sot/object.hxx>
+#ifndef _TOOL_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _STACK_HXX
+#include <tools/stack.hxx>
+#endif
+#ifndef _TOOLS_TABLE_HXX
+#include <tools/table.hxx>
+#endif
+#ifndef _DYNARY_HXX
+#include <tools/dynary.hxx>
+#endif
+#ifndef _SV_GRAPH_HXX
+#include <vcl/graph.hxx>
+#endif
+#ifndef _SV_VIRDEV_HXX
+#include <vcl/virdev.hxx>
+#endif
+#ifndef _SV_POLY_HXX
+#include <vcl/poly.hxx>
+#endif
+#ifndef _SV_FONT_HXX
+#include <vcl/font.hxx>
+#endif
+#ifndef _SV_BMPACC_HXX
+#include <vcl/bmpacc.hxx>
+#endif
+#ifndef _SV_LINEINFO_HXX
+#include <vcl/lineinfo.hxx>
+#endif
+#ifndef _FLTCALL_HXX
+#include <fltcall.hxx>
+#endif
+
+
+#define TRANSPARENT 1
+#define OPAQUE 2
+#define BKMODE_LAST 2
+
+/* xform stuff */
+#define MWT_IDENTITY 1
+#define MWT_LEFTMULTIPLY 2
+#define MWT_RIGHTMULTIPLY 3
+
+#define ENHMETA_STOCK_OBJECT 0x80000000
+
+/* Stock Logical Objects */
+#define WHITE_BRUSH 0
+#define LTGRAY_BRUSH 1
+#define GRAY_BRUSH 2
+#define DKGRAY_BRUSH 3
+#define BLACK_BRUSH 4
+#define NULL_BRUSH 5
+#define HOLLOW_BRUSH NULL_BRUSH
+#define WHITE_PEN 6
+#define BLACK_PEN 7
+#define NULL_PEN 8
+#define OEM_FIXED_FONT 10
+#define ANSI_FIXED_FONT 11
+#define ANSI_VAR_FONT 12
+#define SYSTEM_FONT 13
+#define DEVICE_DEFAULT_FONT 14
+#define DEFAULT_PALETTE 15
+#define SYSTEM_FIXED_FONT 16
+
+
+#define R2_BLACK 1
+#define R2_NOTMERGEPEN 2
+#define R2_MASKNOTPEN 3
+#define R2_NOTCOPYPEN 4
+#define R2_MASKPENNOT 5
+#define R2_NOT 6
+#define R2_XORPEN 7
+#define R2_NOTMASKPEN 8
+#define R2_MASKPEN 9
+#define R2_NOTXORPEN 10
+#define R2_NOP 11
+#define R2_MERGENOTPEN 12
+#define R2_COPYPEN 13
+#define R2_MERGEPENNOT 14
+#define R2_MERGEPEN 15
+#define R2_WHITE 16
+
+/* Mapping Modes */
+#define MM_TEXT 1
+#define MM_LOMETRIC 2
+#define MM_HIMETRIC 3
+#define MM_LOENGLISH 4
+#define MM_HIENGLISH 5
+#define MM_TWIPS 6
+#define MM_ISOTROPIC 7
+#define MM_ANISOTROPIC 8
+
+
+/* Graphics Modes */
+#define GM_COMPATIBLE 1
+#define GM_ADVANCED 2
+#define GM_LAST 2
+
+/* StretchBlt() Modes */
+#define BLACKONWHITE 1
+#define WHITEONBLACK 2
+#define COLORONCOLOR 3
+#define HALFTONE 4
+#define MAXSTRETCHBLTMODE 4
+#define STRETCH_ANDSCANS BLACKONWHITE
+#define STRETCH_ORSCANS WHITEONBLACK
+#define STRETCH_DELETESCANS COLORONCOLOR
+#define STRETCH_HALFTONE HALFTONE
+
+#define LF_FACESIZE 32
+
+struct LOGFONTW
+{
+ INT32 lfHeight;
+ INT32 lfWidth;
+ INT32 lfEscapement;
+ INT32 lfOrientation;
+ INT32 lfWeight;
+ BYTE lfItalic;
+ BYTE lfUnderline;
+ BYTE lfStrikeOut;
+ BYTE lfCharSet;
+ BYTE lfOutPrecision;
+ BYTE lfClipPrecision;
+ BYTE lfQuality;
+ BYTE lfPitchAndFamily;
+ BYTE lfFaceName[ LF_FACESIZE ];
+};
+
+#define TA_NOUPDATECP 0x0000
+#define TA_UPDATECP 0x0001
+#define TA_LEFT 0x0000
+#define TA_RIGHT 0x0002
+#define TA_CENTER 0x0006
+#define TA_RIGHT_CENTER (TA_RIGHT | TA_CENTER)
+#define TA_TOP 0x0000
+#define TA_BOTTOM 0x0008
+#define TA_BASELINE 0x0018
+
+#define SRCCOPY 0x00CC0020L
+#define SRCPAINT 0x00EE0086L
+#define SRCAND 0x008800C6L
+#define SRCINVERT 0x00660046L
+#define SRCERASE 0x00440328L
+#define NOTSRCCOPY 0x00330008L
+#define NOTSRCERASE 0x001100A6L
+#define MERGECOPY 0x00C000CAL
+#define MERGEPAINT 0x00BB0226L
+#define PATCOPY 0x00F00021L
+#define PATPAINT 0x00FB0A09L
+#define PATINVERT 0x005A0049L
+#define DSTINVERT 0x00550009L
+#define BLACKNESS 0x00000042L
+#define WHITENESS 0x00FF0062L
+
+#define PS_SOLID 0
+#define PS_DASH 1
+#define PS_DOT 2
+#define PS_DASHDOT 3
+#define PS_DASHDOTDOT 4
+#define PS_NULL 5
+#define PS_INSIDEFRAME 6
+
+#define ANSI_CHARSET 0
+#define DEFAULT_CHARSET 1
+#define SYMBOL_CHARSET 2
+#define SHIFTJIS_CHARSET 128
+#define HANGEUL_CHARSET 129
+#define CHINESEBIG5_CHARSET 136
+#define OEM_CHARSET 255
+
+#define DEFAULT_PITCH 0x00
+#define FIXED_PITCH 0x01
+#define VARIABLE_PITCH 0x02
+
+/* Font Families */
+#define FF_DONTCARE 0x00
+#define FF_ROMAN 0x10
+#define FF_SWISS 0x20
+#define FF_MODERN 0x30
+#define FF_SCRIPT 0x40
+#define FF_DECORATIVE 0x50
+
+#define FW_DONTCARE 0
+#define FW_THIN 100
+#define FW_EXTRALIGHT 200
+#define FW_LIGHT 300
+#define FW_NORMAL 400
+#define FW_MEDIUM 500
+#define FW_SEMIBOLD 600
+#define FW_BOLD 700
+#define FW_EXTRABOLD 800
+#define FW_HEAVY 900
+#define FW_ULTRALIGHT 200
+#define FW_REGULAR 400
+#define FW_DEMIBOLD 600
+#define FW_ULTRABOLD 800
+#define FW_BLACK 900
+
+#define BS_SOLID 0
+#define BS_NULL 1
+#define BS_HOLLOW 1
+#define BS_HATCHED 2
+#define BS_PATTERN 3
+#define BS_INDEXED 4
+#define BS_DIBPATTERN 5
+#define BS_DIBPATTERNPT 6
+#define BS_PATTERN8X8 7
+#define BS_DIBPATTERN8X8 8
+#define BS_MONOPATTERN 9
+
+#define W_HS_HORIZONTAL 0
+#define W_HS_VERTICAL 1
+#define W_HS_FDIAGONAL 2
+#define W_HS_BDIAGONAL 3
+#define W_HS_CROSS 4
+#define W_HS_DIAGCROSS 5
+
+//============================ WMFReader ==================================
+
+// -----------------------------------------------------------------------------
+
+struct WinMtfFontStyle
+{
+ Font aFont;
+
+ WinMtfFontStyle( LOGFONTW& rLogFont );
+};
+
+// -----------------------------------------------------------------------------
+
+struct WinMtfFillStyle
+{
+ Color aFillColor;
+ BOOL bTransparent;
+
+ WinMtfFillStyle() :
+ aFillColor ( Color( COL_BLACK ) ),
+ bTransparent( FALSE )
+ {
+ };
+
+ WinMtfFillStyle( const Color& rColor, BOOL bTrans = FALSE ) :
+ aFillColor ( rColor ),
+ bTransparent( bTrans )
+ {
+ };
+
+ BOOL operator==( const WinMtfFillStyle& rStyle )
+ { return ( ( aFillColor == rStyle.aFillColor ) && ( bTransparent == rStyle.bTransparent ) ); };
+ BOOL operator==( WinMtfFillStyle* pStyle )
+ { return ( ( aFillColor == pStyle->aFillColor ) && ( bTransparent == pStyle->bTransparent ) ); };
+ void operator=( const WinMtfFillStyle& rStyle ) { aFillColor = rStyle.aFillColor; bTransparent = rStyle.bTransparent; };
+ void operator=( WinMtfFillStyle* pStyle ) { aFillColor = pStyle->aFillColor; bTransparent = pStyle->bTransparent; };
+};
+
+// -----------------------------------------------------------------------------
+
+struct WinMtfLineStyle
+{
+ Color aLineColor;
+ LineInfo aLineInfo;
+ BOOL bTransparent;
+
+ WinMtfLineStyle() :
+ aLineColor ( COL_BLACK ),
+ bTransparent( FALSE ) {};
+
+ WinMtfLineStyle( const Color& rColor, BOOL bTrans = FALSE ) :
+ aLineColor ( rColor ),
+ bTransparent( bTrans ) {};
+
+ WinMtfLineStyle( const Color& rColor, const LineInfo rStyle, BOOL bTrans = FALSE ) :
+ aLineColor ( rColor ),
+ aLineInfo ( rStyle ),
+ bTransparent( bTrans ) {};
+
+ BOOL operator==( const WinMtfLineStyle& rStyle ) { return ( ( aLineColor == rStyle.aLineColor ) && ( bTransparent == rStyle.bTransparent ) && ( aLineInfo == rStyle.aLineInfo ) ); };
+ BOOL operator==( WinMtfLineStyle* pStyle ) { return ( ( aLineColor == pStyle->aLineColor ) && ( bTransparent == pStyle->bTransparent ) && ( aLineInfo == pStyle->aLineInfo ) ); };
+ void operator=( const WinMtfLineStyle& rStyle )
+ {
+ aLineColor = rStyle.aLineColor;
+ bTransparent = rStyle.bTransparent;
+ aLineInfo = rStyle.aLineInfo;
+ };
+
+ void operator=( WinMtfLineStyle* pStyle )
+ {
+ aLineColor = pStyle->aLineColor;
+ bTransparent = pStyle->bTransparent;
+ aLineInfo = pStyle->aLineInfo;
+ };
+};
+
+// -----------------------------------------------------------------------------
+
+struct SaveStruct
+{
+ UINT32 nBkMode;
+ BOOL bWinExtSet;
+ long nWinOrgX, nWinOrgY, nWinExtX, nWinExtY;
+ long nDevOrgX, nDevOrgY, nDevWidth, nDevHeight;
+ WinMtfLineStyle aLineStyle;
+ WinMtfFillStyle aFillStyle;
+ Color aBkColor;
+ Color aTextColor;
+ Point aActPos;
+ BOOL bFontChanged;
+ Font aFont;
+ UINT32 nActTextAlign;
+};
+
+DECLARE_STACK( SaveStack, SaveStruct* );
+
+// -----------------------------------------------------------------------------
+
+struct BSaveStruct
+{
+ Bitmap aBmp;
+ Rectangle aOutRect;
+ UINT32 nWinRop;
+
+ BSaveStruct( const Bitmap& rBmp, const Rectangle& rOutRect, UINT32 nRop ) :
+ aBmp( rBmp ), aOutRect( rOutRect ), nWinRop( nRop ){};
+};
+
+// -----------------------------------------------------------------------------
+
+enum GDIObjectType { GDI_DUMMY = 0, GDI_PEN = 1, GDI_BRUSH = 2, GDI_FONT = 3, GDI_PALETTE = 4, GDI_BITMAP = 5, GDI_REGION = 6 };
+
+struct GDIObj
+{
+ void* pStyle;
+ GDIObjectType eType;
+
+ GDIObj() :
+ pStyle ( NULL ),
+ eType ( GDI_DUMMY )
+ {
+ };
+
+ GDIObj( GDIObjectType eT, void* pS ) { pStyle = pS; eType = eT; };
+ void Set( GDIObjectType eT, void* pS ) { pStyle = pS; eType = eT; };
+ void Delete()
+ {
+ if ( pStyle )
+ {
+ switch ( eType )
+ {
+ case GDI_PEN :
+ delete (WinMtfLineStyle*)pStyle;
+ break;
+ case GDI_BRUSH :
+ delete (WinMtfFillStyle*)pStyle;
+ break;
+ case GDI_FONT :
+ delete (WinMtfFontStyle*)pStyle;
+ break;
+
+ default:
+ delete pStyle;
+ }
+ pStyle = NULL;
+ }
+ };
+
+ ~GDIObj()
+ {
+ Delete();
+ }
+};
+
+// -----------------------------------------------------------------------------
+
+struct XForm
+{
+ float eM11;
+ float eM12;
+ float eM21;
+ float eM22;
+ float eDx;
+ float eDy;
+ XForm()
+ {
+ eM11 = eM12 = eM21 = eM22 = 1.0f;
+ eDx = eDx = 0.0f;
+ };
+};
+
+// -----------------------------------------------------------------------------
+
+class WinMtfOutput
+{
+ protected:
+
+ GDIObj** mpGDIObj;
+ UINT32 mnEntrys;
+ UINT32 mnActTextAlign; // Aktuelle Textausrichtung (im MS-Windows-Format)
+ UINT32 mnBkMode; // Aktueller Modus, wie der Hintergrund uebermalt
+ Point maActPos; // wird. (ist gleich TRANSPARENT oder nicht)
+
+
+ BOOL mbFontChanged;
+ Font maFont;
+ WinMtfLineStyle maLineStyle;
+ WinMtfFillStyle maFillStyle;
+
+ Color maTextColor;
+ Color maBkColor;
+
+ UINT32 mnRop;
+ RasterOp meRasterOp;
+ BOOL mbNopMode;
+
+ SaveStack maSaveStack; // Stapel fuer aktuelle Zustaende bzw. DCs (Drawing-Contexts)
+
+ XForm maXForm;
+ long mnDevOrgX, mnDevOrgY;
+ long mnDevWidth, mnDevHeight;
+ long mnWinOrgX, mnWinOrgY; // aktuelles Window-Origin
+ long mnWinExtX, mnWinExtY; // aktuelles Window-Extent
+
+ Point ImplMap( const Point& rPt );
+ Size ImplMap( const Size& rSz );
+ Rectangle ImplMap( const Rectangle& rRectangle );
+ void ImplMap( Font& rFont );
+ Polygon& ImplMap( Polygon& rPolygon );
+ PolyPolygon& ImplMap( PolyPolygon& rPolyPolygon );
+ void ImplResizeObjectArry( UINT32 nNewEntry );
+
+ public:
+
+ virtual void SetDevOrg( const Point& rPoint ) {};
+ virtual void SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd ){};
+ virtual void SetDevExt( const Size& rSize ){};
+ virtual void ScaleDevExt( double fX, double fY ){};
+
+ virtual void SetWinOrg( const Point& rPoint ){};
+ virtual void SetWinOrgOffset( INT32 nX, INT32 nY ){};
+ virtual void SetWinExt( const Size& rSize ){};
+ virtual void ScaleWinExt( double fX, double fY ){};
+
+ virtual void SetWorldTransform( const XForm& rXForm ){};
+ virtual void ModifyWorldTransform( const XForm& rXForm, UINT32 nMode ){};
+
+ virtual void Push( BOOL bWinExtSet = TRUE );
+ virtual void Pop();
+
+ void SetBkMode( UINT32 nMode );
+ void SetBkColor( const Color& rColor );
+ void SetTextColor( const Color& rColor );
+ void SetTextAlign( UINT32 nAlign );
+ virtual UINT32 SetRasterOp( UINT32 nRasterOp );
+ void CreateObject( GDIObjectType, void* pStyle = NULL );
+ void CreateObject( INT32 nIndex, GDIObjectType, void* pStyle = NULL );
+ void DeleteObject( INT32 nIndex );
+ void SelectObject( INT32 nIndex );
+ CharSet GetCharSet(){ return maFont.GetCharSet(); };
+
+ virtual void DrawPixel( const Point& rSource, const Color& rColor ){};
+ void MoveTo( const Point& rPoint ) { maActPos = ImplMap( rPoint ); };
+ virtual void LineTo( const Point& rPoint ){};
+ virtual void DrawLine( const Point& rSource, const Point& rDest ){};
+ virtual void DrawRect( const Rectangle& rRect, BOOL bEdge = TRUE ){};
+ virtual void DrawRoundRect( const Rectangle& rRect, const Size& rSize ){};
+ virtual void DrawEllipse( const Rectangle& rRect ){};
+ virtual void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, BOOL bDrawTo = FALSE ){};
+ virtual void DrawPie( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle ){};
+ virtual void DrawChord( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle ){};
+ virtual void DrawPolygon( Polygon& rPolygon ){};
+ virtual void DrawPolyPolygon( PolyPolygon& rPolyPolygon ){};
+ virtual void DrawPolyLine( Polygon& rPolygon, BOOL bDrawTo = FALSE ){};
+ virtual void DrawPolyBezier( Polygon& rPolygin, BOOL bDrawTo = FALSE ){};
+ virtual void DrawText( Point& rPosition, String& rString, INT32* pDXArry = NULL );
+ virtual void ResolveBitmapActions( List& rSaveList ){};
+ virtual void IntersectClipRect( const Rectangle& rRectangle ){};
+ virtual void MoveClipRegion( const Size& rSize ){};
+
+ WinMtfOutput();
+ virtual ~WinMtfOutput();
+};
+
+// -----------------------------------------------------------------------------
+
+class WinMtfMetaOutput : public WinMtfOutput
+{
+ UINT32 mnPushPopCount; // hoehe des Stapels
+ GDIMetaFile* mpGDIMetaFile;
+ WinMtfLineStyle maLatestLineStyle;
+ WinMtfFillStyle maLatestFillStyle;
+
+ void UpdateLineStyle();
+ void UpdateFillStyle();
+
+ public:
+
+ virtual void SetDevOrg( const Point& rPoint );
+ virtual void SetDevOrgOffset( INT32 nXAdd, INT32 nYAdd );
+ virtual void SetDevExt( const Size& rSize );
+ virtual void ScaleDevExt( double fX, double fY );
+
+ virtual void SetWinOrg( const Point& rPoint );
+ virtual void SetWinOrgOffset( INT32 nX, INT32 nY );
+ virtual void SetWinExt( const Size& rSize );
+ virtual void ScaleWinExt( double fX, double fY );
+
+ virtual void SetWorldTransform( const XForm& rXForm );
+ virtual void ModifyWorldTransform( const XForm& rXForm, UINT32 nMode );
+
+ virtual void Push( BOOL bWinExtSet = TRUE );
+ virtual void Pop();
+
+ virtual UINT32 SetRasterOp( UINT32 nRasterOp );
+
+ virtual void LineTo( const Point& rPoint );
+ virtual void DrawPixel( const Point& rSource, const Color& rColor );
+ virtual void DrawLine( const Point& rSource, const Point& rDest );
+ virtual void DrawRect( const Rectangle& rRect, BOOL bEdge = TRUE );
+ virtual void DrawRoundRect( const Rectangle& rRect, const Size& rSize );
+ virtual void DrawEllipse( const Rectangle& rRect );
+ virtual void DrawArc( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle, BOOL bDrawTo = FALSE );
+ virtual void DrawPie( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle );
+ virtual void DrawChord( const Rectangle& rRect, const Point& rStartAngle, const Point& rEndAngle );
+ virtual void DrawPolygon( Polygon& rPolygon );
+ virtual void DrawPolyPolygon( PolyPolygon& rPolyPolygon );
+ virtual void DrawPolyLine( Polygon& rPolygon, BOOL bDrawTo = FALSE );
+ virtual void DrawPolyBezier( Polygon& rPolygin, BOOL bDrawTo = FALSE );
+ virtual void DrawText( Point& rPosition, String& rString, INT32* pDXArry = NULL );
+ virtual void ResolveBitmapActions( List& rSaveList );
+ virtual void IntersectClipRect( const Rectangle& rRectangle );
+ virtual void MoveClipRegion( const Size& rSize );
+
+
+ WinMtfMetaOutput( GDIMetaFile& rGDIMetaFile );
+ virtual ~WinMtfMetaOutput();
+};
+
+// -----------------------------------------------------------------------------
+
+class WinMtf
+{
+ protected:
+
+ WinMtfOutput* pOut; //
+ SvStream* pWMF; // Die einzulesende WMF/EMF-Datei
+
+ UINT32 nStartPos, nEndPos;
+ List aBmpSaveList;
+
+ PFilterCallback pCallback;
+ void* pCallerData;
+
+ // Sorgt dafuer, das aSampledBrush der aktuelle Brush des GDIMetaFiles ist.
+
+ Color ReadColor();
+ BOOL Callback( USHORT nPercent );
+
+ WinMtf( WinMtfOutput* pOut, SvStream& rStreamWMF, PFilterCallback pcallback, void * pcallerdata );
+ ~WinMtf();
+
+ public:
+
+};
+
+//============================ EMFReader ==================================
+
+class EnhWMFReader : public WinMtf
+{
+
+private:
+
+ INT32 nRecordCount;
+
+ BOOL ReadHeader();
+ Rectangle ReadRectangle( INT32, INT32, INT32, INT32 ); // Liesst und konvertiert ein Rechteck
+ void ImplExtTextOut( BOOL bWideCharakter );
+
+public:
+ EnhWMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile,
+ PFilterCallback pcallback, void * pcallerdata ) : WinMtf( new WinMtfMetaOutput( rGDIMetaFile ), rStreamWMF,
+ pcallback, pcallerdata ) {};
+
+ BOOL ReadEnhWMF();
+};
+
+//============================ WMFReader ==================================
+
+class WMFReader : public WinMtf
+{
+private:
+
+ BOOL bWinExtSet;
+ UINT16 nUnitsPerInch;
+
+ // Liesst den Kopf der WMF-Datei
+ BOOL ReadHeader();
+
+ // Liesst die Parameter des Rocords mit der Funktionsnummer nFunction.
+ void ReadRecordParams( USHORT nFunction );
+
+ Point ReadPoint(); // Liesst und konvertiert einen Punkt (erst X dann Y)
+ Point ReadYX(); // Liesst und konvertiert einen Punkt (erst Y dann X)
+ Rectangle ReadRectangle(); // Liesst und konvertiert ein Rechteck
+ Size ReadYXExt();
+ void ImplSetWMFSize( const Size& rSize );
+
+public:
+
+ WMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile,
+ PFilterCallback pcallback, void * pcallerdata ) : WinMtf( new WinMtfMetaOutput( rGDIMetaFile ), rStreamWMF,
+ pcallback, pcallerdata ) {};
+
+ // Liesst aus dem Stream eine WMF-Datei und fuellt das GDIMetaFile
+ void ReadWMF();
+};
+
+#endif
+
+
diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx
new file mode 100644
index 000000000000..6e352ae8ecfd
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/winwmf.cxx
@@ -0,0 +1,886 @@
+/*************************************************************************
+ *
+ * $RCSfile: winwmf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "winmtf.hxx"
+
+//====================== MS-Windows-defines ===============================
+
+#define W_META_SETBKCOLOR 0x0201
+#define W_META_SETBKMODE 0x0102
+#define W_META_SETMAPMODE 0x0103
+#define W_META_SETROP2 0x0104
+#define W_META_SETRELABS 0x0105
+#define W_META_SETPOLYFILLMODE 0x0106
+#define W_META_SETSTRETCHBLTMODE 0x0107
+#define W_META_SETTEXTCHAREXTRA 0x0108
+#define W_META_SETTEXTCOLOR 0x0209
+#define W_META_SETTEXTJUSTIFICATION 0x020A
+#define W_META_SETWINDOWORG 0x020B
+#define W_META_SETWINDOWEXT 0x020C
+#define W_META_SETVIEWPORTORG 0x020D
+#define W_META_SETVIEWPORTEXT 0x020E
+#define W_META_OFFSETWINDOWORG 0x020F
+#define W_META_SCALEWINDOWEXT 0x0410
+#define W_META_OFFSETVIEWPORTORG 0x0211
+#define W_META_SCALEVIEWPORTEXT 0x0412
+#define W_META_LINETO 0x0213
+#define W_META_MOVETO 0x0214
+#define W_META_EXCLUDECLIPRECT 0x0415
+#define W_META_INTERSECTCLIPRECT 0x0416
+#define W_META_ARC 0x0817
+#define W_META_ELLIPSE 0x0418
+#define W_META_FLOODFILL 0x0419
+#define W_META_PIE 0x081A
+#define W_META_RECTANGLE 0x041B
+#define W_META_ROUNDRECT 0x061C
+#define W_META_PATBLT 0x061D
+#define W_META_SAVEDC 0x001E
+#define W_META_SETPIXEL 0x041F
+#define W_META_OFFSETCLIPRGN 0x0220
+#define W_META_TEXTOUT 0x0521
+#define W_META_BITBLT 0x0922
+#define W_META_STRETCHBLT 0x0B23
+#define W_META_POLYGON 0x0324
+#define W_META_POLYLINE 0x0325
+#define W_META_ESCAPE 0x0626
+#define W_META_RESTOREDC 0x0127
+#define W_META_FILLREGION 0x0228
+#define W_META_FRAMEREGION 0x0429
+#define W_META_INVERTREGION 0x012A
+#define W_META_PAINTREGION 0x012B
+#define W_META_SELECTCLIPREGION 0x012C
+#define W_META_SELECTOBJECT 0x012D
+#define W_META_SETTEXTALIGN 0x012E
+#define W_META_DRAWTEXT 0x062F
+#define W_META_CHORD 0x0830
+#define W_META_SETMAPPERFLAGS 0x0231
+#define W_META_EXTTEXTOUT 0x0a32
+#define W_META_SETDIBTODEV 0x0d33
+#define W_META_SELECTPALETTE 0x0234
+#define W_META_REALIZEPALETTE 0x0035
+#define W_META_ANIMATEPALETTE 0x0436
+#define W_META_SETPALENTRIES 0x0037
+#define W_META_POLYPOLYGON 0x0538
+#define W_META_RESIZEPALETTE 0x0139
+#define W_META_DIBBITBLT 0x0940
+#define W_META_DIBSTRETCHBLT 0x0b41
+#define W_META_DIBCREATEPATTERNBRUSH 0x0142
+#define W_META_STRETCHDIB 0x0f43
+#define W_META_EXTFLOODFILL 0x0548
+#define W_META_RESETDC 0x014C
+#define W_META_STARTDOC 0x014D
+#define W_META_STARTPAGE 0x004F
+#define W_META_ENDPAGE 0x0050
+#define W_META_ABORTDOC 0x0052
+#define W_META_ENDDOC 0x005E
+#define W_META_DELETEOBJECT 0x01f0
+#define W_META_CREATEPALETTE 0x00f7
+#define W_META_CREATEBRUSH 0x00F8
+#define W_META_CREATEPATTERNBRUSH 0x01F9
+#define W_META_CREATEPENINDIRECT 0x02FA
+#define W_META_CREATEFONTINDIRECT 0x02FB
+#define W_META_CREATEBRUSHINDIRECT 0x02FC
+#define W_META_CREATEBITMAPINDIRECT 0x02FD
+#define W_META_CREATEBITMAP 0x06FE
+#define W_META_CREATEREGION 0x06FF
+
+//=================== Methoden von WMFReader ==============================
+
+inline Point WMFReader::ReadPoint()
+{
+ short nX, nY;
+ *pWMF >> nX >> nY;
+ return Point( nX, nY );
+}
+
+// ------------------------------------------------------------------------
+
+inline Point WMFReader::ReadYX()
+{
+ short nX, nY;
+ *pWMF >> nY >> nX;
+ return Point( nX, nY );
+}
+
+// ------------------------------------------------------------------------
+
+Rectangle WMFReader::ReadRectangle()
+{
+ Point aBR, aTL;
+ aBR = ReadYX();
+ aTL = ReadYX();
+ aBR.X()--;
+ aBR.Y()--;
+ return Rectangle( aTL, aBR );
+}
+
+// ------------------------------------------------------------------------
+
+Size WMFReader::ReadYXExt()
+{
+ short nW, nH;
+ *pWMF >> nH >> nW;
+ return Size( nW, nH );
+}
+
+// ------------------------------------------------------------------------
+
+void WMFReader::ReadRecordParams( USHORT nFunction )
+{
+ switch( nFunction )
+ {
+ case W_META_SETBKCOLOR:
+ {
+ pOut->SetBkColor( ReadColor() );
+ }
+ break;
+
+ case W_META_SETBKMODE:
+ {
+ USHORT nDat;
+ *pWMF >> nDat;
+ pOut->SetBkMode( nDat );
+ }
+ break;
+
+ // !!!
+ case W_META_SETMAPMODE:
+ {
+ short nMapMode;
+ *pWMF >> nMapMode;
+#ifdef DBG_ASSERT
+ if ( nMapMode != 8 ) // nur MM_ANISOTROPHIC == 8 wird unterstuetzt
+ {
+ DBG_ASSERT(0,"WMF-Import: MapMode ignored");
+ }
+#endif
+ }
+ break;
+
+ case W_META_SETROP2:
+ {
+ UINT16 nROP2;
+ *pWMF >> nROP2;
+ pOut->SetRasterOp( nROP2 );
+ }
+ break;
+
+ case W_META_SETTEXTCOLOR:
+ {
+ pOut->SetTextColor( ReadColor() );
+ }
+ break;
+
+ case W_META_SETWINDOWORG:
+ {
+ pOut->SetWinOrg( ReadYX() );
+ }
+ break;
+
+ case W_META_SETWINDOWEXT:
+ {
+ short nWidth, nHeight;
+ *pWMF >> nHeight >> nWidth;
+ ImplSetWMFSize( Size( nWidth, nHeight ) );
+ }
+ break;
+
+ case W_META_OFFSETWINDOWORG:
+ {
+ short nXAdd, nYAdd;
+ *pWMF >> nYAdd >> nXAdd;
+ pOut->SetWinOrgOffset( nXAdd, nYAdd );
+ }
+ break;
+
+ case W_META_SCALEWINDOWEXT:
+ {
+ short nXNum, nXDenom, nYNum, nYDenom;
+ *pWMF >> nYDenom >> nYNum >> nXDenom >> nXNum;
+ pOut->ScaleWinExt( (double)nXNum / nXDenom, (double)nYNum / nYDenom );
+ }
+ break;
+
+ case W_META_SETVIEWPORTORG:
+ case W_META_SETVIEWPORTEXT:
+ break;
+
+ case W_META_OFFSETVIEWPORTORG:
+ {
+ short nXAdd, nYAdd;
+ *pWMF >> nYAdd >> nXAdd;
+ pOut->SetDevOrgOffset( nXAdd, nYAdd );
+ }
+ break;
+
+ case W_META_SCALEVIEWPORTEXT:
+ {
+ short nXNum, nXDenom, nYNum, nYDenom;
+ *pWMF >> nYDenom >> nYNum >> nXDenom >> nXNum;
+ pOut->ScaleDevExt( (double)nXNum / nXDenom, (double)nYNum / nYDenom );
+ }
+ break;
+
+ case W_META_LINETO:
+ {
+ pOut->LineTo( ReadYX() );
+ }
+ break;
+
+ case W_META_MOVETO:
+ {
+ pOut->MoveTo( ReadYX() );
+ }
+ break;
+
+ case W_META_INTERSECTCLIPRECT:
+ {
+ pOut->IntersectClipRect( ReadRectangle() );
+ }
+ break;
+
+ case W_META_RECTANGLE:
+ {
+ pOut->DrawRect( ReadRectangle() );
+ }
+ break;
+
+ case W_META_ROUNDRECT:
+ {
+ Size aSize( ReadYXExt() );
+ pOut->DrawRoundRect( ReadRectangle(), aSize );
+ }
+ break;
+
+ case W_META_ELLIPSE:
+ {
+ pOut->DrawEllipse( ReadRectangle() );
+ }
+ break;
+
+ case W_META_ARC:
+ {
+ Point aEnd( ReadYX() );
+ Point aStart( ReadYX() );
+ pOut->DrawArc( ReadRectangle(), aStart, aEnd );
+ }
+ break;
+
+ case W_META_PIE:
+ {
+ Point aEnd( ReadYX() );
+ Point aStart( ReadYX() );
+ pOut->DrawPie( ReadRectangle(), aStart, aEnd );
+ }
+ break;
+
+ case W_META_CHORD:
+ {
+ Point aEnd( ReadYX() );
+ Point aStart( ReadYX() );
+ pOut->DrawChord( ReadRectangle(), aStart, aEnd );
+ }
+ break;
+
+ case W_META_POLYGON:
+ {
+ USHORT i,nPoints;
+ *pWMF >> nPoints;
+ Polygon aPoly( nPoints );
+ for( i = 0; i < nPoints; i++ )
+ aPoly[ i ] = ReadPoint();
+ pOut->DrawPolygon( aPoly );
+ }
+ break;
+
+ case W_META_POLYPOLYGON:
+ {
+ USHORT i, nPoly, nPoints;
+ USHORT* pnPoints;
+ Point* pPtAry;
+ // Anzahl der Polygone:
+ *pWMF >> nPoly;
+ // Anzahl der Punkte eines jeden Polygons holen, Gesammtzahl der Punkte ermitteln:
+ pnPoints = new USHORT[ nPoly ];
+ nPoints = 0;
+ for( i = 0; i < nPoly; i++ )
+ {
+ *pWMF >> pnPoints[i];
+ nPoints += pnPoints[i];
+ }
+ // Polygonpunkte holen:
+ pPtAry = (Point*) new char[ nPoints * sizeof(Point) ];
+ for ( i = 0; i < nPoints; i++ )
+ pPtAry[ i ] = ReadPoint();
+ // PolyPolygon Actions erzeugen
+ PolyPolygon aPolyPoly( nPoly, pnPoints, pPtAry );
+ pOut->DrawPolyPolygon( aPolyPoly );
+ delete (char*) pPtAry;
+ delete pnPoints;
+ }
+ break;
+
+ case W_META_POLYLINE:
+ {
+ USHORT i,nPoints;
+ *pWMF >> nPoints;
+ Polygon aPoly( nPoints );
+ for( i = 0; i < nPoints; i++ )
+ aPoly[ i ] = ReadPoint();
+ pOut->DrawPolyLine( aPoly );
+ }
+ break;
+
+ case W_META_SAVEDC:
+ {
+ pOut->Push( bWinExtSet );
+ }
+ break;
+
+ case W_META_RESTOREDC:
+ {
+ pOut->Pop();
+ }
+ break;
+
+ case W_META_SETPIXEL:
+ {
+ const Color aColor = ReadColor();
+ pOut->DrawPixel( ReadYX(), aColor );
+ }
+ break;
+
+ case W_META_OFFSETCLIPRGN:
+ {
+ pOut->MoveClipRegion( ReadYXExt() );
+ }
+ break;
+
+ case W_META_TEXTOUT:
+ {
+ USHORT nLength;
+ *pWMF >> nLength;
+ if ( nLength )
+ {
+ char* pChar = new char[ ( nLength + 1 ) &~ 1 ];
+ pWMF->Read( pChar, ( nLength + 1 ) &~ 1 );
+ String aText( pChar, nLength, pOut->GetCharSet() );
+ delete pChar;
+ Point aPosition( ReadYX() );
+ pOut->DrawText( aPosition, aText );
+ }
+ }
+ break;
+
+ case W_META_EXTTEXTOUT:
+ {
+ USHORT i,nLen,nOptions,nData;
+ long nRecordSize,nRecSizeLeft, *pDXAry;
+ Point aPosition;
+ Rectangle aRect;
+
+ pWMF->SeekRel(-6);
+ *pWMF >> nRecordSize;
+ pWMF->SeekRel(2);
+ aPosition = ReadYX();
+ *pWMF >> nLen >> nOptions;
+ // Nur wenn der Text auch Zeichen enthaelt, macht die Ausgabe Sinn
+ if( nLen )
+ {
+ if( nOptions )
+ {
+ const Point aPt1( ReadPoint() );
+ const Point aPt2( ReadPoint() );
+ aRect = Rectangle( aPt1, aPt2 );
+ }
+ char* pChar = new char[ ( nLen + 1 ) &~ 1 ];
+ pWMF->Read( pChar, ( nLen + 1 ) &~ 1 );
+ String aText( pChar, nLen, pOut->GetCharSet() );
+ delete pChar;
+
+ nRecSizeLeft=(nRecordSize-7-(((long)nLen+1)>>1))<<1;
+
+ if( nOptions )
+ nRecSizeLeft-=8;
+
+ if( nRecSizeLeft >= (long) nLen )
+ {
+ pDXAry = new long[ nLen ];
+
+ for( i = 0; i < nLen; i++ )
+ {
+ *pWMF >> nData;
+ pDXAry[ i ] = nData;
+ }
+ pOut->DrawText( aPosition, aText, pDXAry );
+ delete[] pDXAry;
+ }
+ else
+ pOut->DrawText( aPosition, aText );
+ }
+ }
+ break;
+
+ case W_META_SELECTOBJECT:
+ {
+ INT16 nObjIndex;
+ *pWMF >> nObjIndex;
+ pOut->SelectObject( nObjIndex );
+ }
+ break;
+
+ case W_META_SETTEXTALIGN:
+ {
+ UINT16 nAlign;
+ *pWMF >> nAlign;
+ pOut->SetTextAlign( nAlign );
+ }
+ break;
+
+ case W_META_BITBLT:
+ case W_META_STRETCHBLT:
+ case W_META_DIBBITBLT:
+ case W_META_DIBSTRETCHBLT:
+ case W_META_STRETCHDIB:
+ {
+ long nWinROP;
+ short nSx, nSy, nSxe, nSye, nUsage;
+ Bitmap aBmp;
+
+ *pWMF >> nWinROP;
+
+ if( nFunction == W_META_STRETCHDIB )
+ *pWMF >> nUsage;
+
+ if( nFunction==W_META_STRETCHDIB || nFunction==W_META_STRETCHBLT || nFunction==W_META_DIBSTRETCHBLT )
+ *pWMF >> nSye >> nSxe;
+
+ *pWMF >> nSy >> nSx;
+
+ if( nFunction == W_META_STRETCHDIB || nFunction == W_META_DIBBITBLT || nFunction == W_META_DIBSTRETCHBLT )
+ {
+ switch( nWinROP )
+ {
+ case PATCOPY :
+ {
+ *pWMF >> nUsage; // i don't know anything of this parameter, so its called nUsage
+ Size aDestSize( ReadYXExt() );
+ pOut->DrawRect( Rectangle( ReadYX(), aDestSize ), FALSE );
+ }
+ break;
+ default :
+ {
+ Size aDestSize( ReadYXExt() );
+ Rectangle aDestRect( ReadYX(), aDestSize );
+ aBmp.Read( *pWMF, FALSE );
+ aBmpSaveList.Insert( new BSaveStruct( aBmp, aDestRect, nWinROP ), LIST_APPEND );
+ }
+ break;
+ }
+ }
+ else
+ {
+ if( aBmpSaveList.Count() )
+ pOut->ResolveBitmapActions( aBmpSaveList );
+ }
+ }
+ break;
+
+ case W_META_DIBCREATEPATTERNBRUSH:
+ {
+ Bitmap aBmp;
+ BitmapReadAccess* pBmp;
+ UINT32 nRed = 0, nGreen = 0, nBlue = 0, nCount = 1;
+ UINT16 nFunction;
+
+ *pWMF >> nFunction >> nFunction;
+
+ aBmp.Read( *pWMF, FALSE );
+ pBmp = aBmp.AcquireReadAccess();
+ if ( pBmp )
+ {
+ for ( INT32 y = 0; y < pBmp->Height(); y++ )
+ {
+ for ( INT32 x = 0; x < pBmp->Width(); x++ )
+ {
+ const BitmapColor aColor( pBmp->GetColor( y, x ) );
+
+ nRed += aColor.GetRed();
+ nGreen += aColor.GetGreen();
+ nBlue += aColor.GetBlue();
+ }
+ }
+ nCount = pBmp->Height() * pBmp->Width();
+ if ( !nCount )
+ nCount++;
+ aBmp.ReleaseAccess( pBmp );
+ }
+ Color aColor( (BYTE)( nRed / nCount ), (BYTE)( nGreen / nCount ), (BYTE)( nBlue / nCount ) );
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( aColor, FALSE ) );
+ }
+ break;
+
+ case W_META_DELETEOBJECT:
+ {
+ INT16 nIndex;
+ *pWMF >> nIndex;
+ pOut->DeleteObject( nIndex );
+ }
+ break;
+
+ case W_META_CREATEPALETTE:
+ {
+ pOut->CreateObject( GDI_DUMMY );
+ }
+ break;
+
+ case W_META_CREATEBRUSH:
+ {
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) );
+ }
+ break;
+
+ case W_META_CREATEPATTERNBRUSH:
+ {
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( Color( COL_WHITE ), FALSE ) );
+ }
+ break;
+
+ case W_META_CREATEPENINDIRECT:
+ {
+ LineInfo aLineInfo;
+ USHORT nStyle, nWidth, nHeight;
+
+ *pWMF >> nStyle >> nWidth >> nHeight;
+
+ if ( nWidth )
+ aLineInfo.SetWidth( nWidth );
+
+ BOOL bTransparent = FALSE;
+ UINT16 nDashCount = 0;
+ UINT16 nDotCount = 0;
+ switch( nStyle )
+ {
+ case PS_DASHDOTDOT :
+ nDotCount++;
+ case PS_DASHDOT :
+ nDashCount++;
+ case PS_DOT :
+ nDotCount++;
+ break;
+ case PS_DASH :
+ nDashCount++;
+ break;
+ case PS_NULL :
+ bTransparent = TRUE;
+ aLineInfo.SetStyle( LINE_NONE );
+ break;
+ default :
+ case PS_INSIDEFRAME :
+ case PS_SOLID :
+ aLineInfo.SetStyle( LINE_SOLID );
+ }
+ if ( nDashCount | nDotCount )
+ {
+ aLineInfo.SetStyle( LINE_DASH );
+ aLineInfo.SetDashCount( nDashCount );
+ aLineInfo.SetDotCount( nDotCount );
+ }
+ pOut->CreateObject( GDI_PEN, new WinMtfLineStyle( ReadColor(), aLineInfo, bTransparent ) );
+ }
+ break;
+
+ case W_META_CREATEBRUSHINDIRECT:
+ {
+ USHORT nStyle;
+ *pWMF >> nStyle;
+ pOut->CreateObject( GDI_BRUSH, new WinMtfFillStyle( ReadColor(), ( nStyle == BS_HOLLOW ) ? TRUE : FALSE ) );
+ }
+ break;
+
+ case W_META_CREATEFONTINDIRECT:
+ {
+ Size aFontSize;
+ INT16 lfEscapement, lfOrientation, lfWeight; // ( ehemals USHORT )
+
+ LOGFONTW aLogFont;
+ aFontSize = ReadYXExt();
+ *pWMF >> lfEscapement >> lfOrientation >> lfWeight
+ >> aLogFont.lfItalic >> aLogFont.lfUnderline >> aLogFont.lfStrikeOut >> aLogFont.lfCharSet >> aLogFont.lfOutPrecision
+ >> aLogFont.lfClipPrecision >> aLogFont.lfQuality >> aLogFont.lfPitchAndFamily;
+ pWMF->Read( aLogFont.lfFaceName, LF_FACESIZE );
+ aLogFont.lfWidth = aFontSize.Width();
+ aLogFont.lfHeight = aFontSize.Height();
+ aLogFont.lfEscapement = lfEscapement;
+ aLogFont.lfOrientation = lfOrientation;
+ aLogFont.lfWeight = lfWeight;
+ pOut->CreateObject( GDI_FONT, new WinMtfFontStyle( aLogFont ) );
+ }
+ break;
+
+ case W_META_CREATEBITMAPINDIRECT:
+ {
+ pOut->CreateObject( GDI_DUMMY );
+ }
+ break;
+
+ case W_META_CREATEBITMAP:
+ {
+ pOut->CreateObject( GDI_DUMMY );
+ }
+ break;
+
+ case W_META_CREATEREGION:
+ {
+ pOut->CreateObject( GDI_DUMMY );
+ }
+ break;
+
+ case W_META_SETRELABS:
+ case W_META_SETPOLYFILLMODE:
+ case W_META_SETSTRETCHBLTMODE:
+ case W_META_SETTEXTCHAREXTRA:
+ case W_META_SETTEXTJUSTIFICATION:
+ case W_META_EXCLUDECLIPRECT:
+ case W_META_FLOODFILL:
+ break;
+ case W_META_PATBLT:
+ {
+ UINT32 nROP, nOldROP;
+ *pWMF >> nROP;
+ Size aSize = ReadYXExt();
+ nOldROP = pOut->SetRasterOp( nROP );
+ pOut->DrawRect( Rectangle( ReadYX(), aSize ), FALSE );
+ pOut->SetRasterOp( nOldROP );
+ }
+ break;
+ case W_META_ESCAPE:
+ case W_META_FILLREGION:
+ case W_META_FRAMEREGION:
+ case W_META_INVERTREGION:
+ case W_META_PAINTREGION:
+ case W_META_SELECTCLIPREGION:
+ case W_META_DRAWTEXT:
+ case W_META_SETMAPPERFLAGS:
+ case W_META_SETDIBTODEV:
+ case W_META_SELECTPALETTE:
+ case W_META_REALIZEPALETTE:
+ case W_META_ANIMATEPALETTE:
+ case W_META_SETPALENTRIES:
+ case W_META_RESIZEPALETTE:
+ case W_META_EXTFLOODFILL:
+ case W_META_RESETDC:
+ case W_META_STARTDOC:
+ case W_META_STARTPAGE:
+ case W_META_ENDPAGE:
+ case W_META_ABORTDOC:
+ case W_META_ENDDOC:
+ break;
+ }
+}
+
+// ------------------------------------------------------------------------
+
+BOOL WMFReader::ReadHeader()
+{
+ Rectangle aPlaceableBound;
+ ULONG nl;
+
+ // Einlesen des METAFILEHEADER, falls vorhanden
+ *pWMF >> nl;
+
+ if ( nl == 0x9ac6cdd7L )
+ {
+ INT16 nVal;
+
+ // hmf (Unused) ueberlesen wir
+ pWMF->SeekRel(2);
+
+ // BoundRect
+ *pWMF >> nVal; aPlaceableBound.Left() = nVal;
+ *pWMF >> nVal; aPlaceableBound.Top() = nVal;
+ *pWMF >> nVal; aPlaceableBound.Right() = nVal;
+ *pWMF >> nVal; aPlaceableBound.Bottom() = nVal;
+
+ // inch
+ *pWMF >> nUnitsPerInch;
+
+ // reserved
+ pWMF->SeekRel( 4 );
+
+ // checksum pruefen wir lieber nicht
+ pWMF->SeekRel( 2 );
+ }
+ else
+ {
+ // Unit wird bei den alten MTF's als MM_TEXT angenommen
+ nUnitsPerInch = 96;
+ pWMF->SeekRel( -4 ); // zurueck zum Anfang
+ }
+
+ // Einlesen des METAHEADER
+ *pWMF >> nl; // Typ und Headergroesse
+
+ if( nl != 0x00090001 )
+ {
+ pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
+ return FALSE;
+ }
+
+ pWMF->SeekRel( 2 ); // Version (von Windows)
+ pWMF->SeekRel( 4 ); // Size (der Datei in Words)
+ pWMF->SeekRel( 2 ); // NoObjects (Maximale Anzahl der gleichzeitigen Objekte)
+ pWMF->SeekRel( 4 ); // MaxRecord (Groesse des groessten Records in Words)
+ pWMF->SeekRel( 2 ); // NoParameters (Unused
+
+ pOut->SetWinOrg( aPlaceableBound.TopLeft() );
+
+ ImplSetWMFSize( aPlaceableBound.GetSize() );
+
+ return TRUE;
+}
+
+// ------------------------------------------------------------------------
+
+void WMFReader::ImplSetWMFSize( const Size& rSize )
+{
+ pOut->SetWinExt( rSize );
+
+ // try to calculate size of WMF
+ if( !bWinExtSet && rSize.Width() > 1 && rSize.Height() > 1 )
+ {
+ const Fraction aFrac( 1, nUnitsPerInch );
+ MapMode aWMFMap( MAP_INCH, Point(), aFrac, aFrac );
+ Size aSize100( OutputDevice::LogicToLogic( rSize, aWMFMap, MAP_100TH_MM ) );
+ pOut->SetDevExt( Size( labs( aSize100.Width() ), labs( aSize100.Height() ) ) );
+ bWinExtSet = TRUE;
+ }
+}
+
+// ------------------------------------------------------------------------
+
+void WMFReader::ReadWMF() // SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile, PFilterCallback pcallback, void * pcallerdata)
+{
+ USHORT nFunction;
+ ULONG nRecSize;
+ ULONG nPos, nPercent, nLastPercent;
+
+ pOut->SetWinOrg( Point() );
+ pOut->SetWinExt( Size( 1, 1 ) );
+ pOut->SetDevExt( Size( 10000, 10000 ) );
+ bWinExtSet = FALSE;
+
+ nEndPos=pWMF->Seek( STREAM_SEEK_TO_END );
+ pWMF->Seek( nStartPos );
+ Callback( (USHORT) ( nLastPercent = 0 ) );
+
+ if ( ReadHeader() )
+ {
+
+ nPos = pWMF->Tell();
+
+ if( nEndPos - nStartPos )
+ {
+ while( TRUE )
+ {
+ nPercent = ( nPos - nStartPos ) * 100 / ( nEndPos - nStartPos );
+
+ if( nLastPercent + 4 <= nPercent )
+ {
+ if( Callback( (USHORT) nPercent ) )
+ break;
+
+ nLastPercent = nPercent;
+ }
+
+ *pWMF >> nRecSize >> nFunction;
+
+ if( pWMF->GetError() || ( nRecSize < 3 ) || ( nRecSize==3 && nFunction==0 ) || pWMF->IsEof() )
+ {
+
+ if( pWMF->IsEof() )
+ pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
+
+ break;
+ }
+
+ if( aBmpSaveList.Count() &&
+ ( nFunction != W_META_STRETCHDIB ) &&
+ ( nFunction != W_META_DIBBITBLT ) &&
+ ( nFunction != W_META_DIBSTRETCHBLT ) )
+ {
+ pOut->ResolveBitmapActions( aBmpSaveList );
+ }
+
+ ReadRecordParams( nFunction );
+ pWMF->Seek( nPos += nRecSize * 2 );
+ }
+ }
+ else
+ pWMF->SetError( SVSTREAM_GENERALERROR );
+
+ if( !pWMF->GetError() && aBmpSaveList.Count() )
+ pOut->ResolveBitmapActions( aBmpSaveList );
+ }
+ if ( pWMF->GetError() )
+ pWMF->Seek( nStartPos );
+}
+
diff --git a/svtools/source/filter.vcl/wmf/wmf.cxx b/svtools/source/filter.vcl/wmf/wmf.cxx
new file mode 100644
index 000000000000..d085bfc45e21
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/wmf.cxx
@@ -0,0 +1,147 @@
+/*************************************************************************
+ *
+ * $RCSfile: wmf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "winmtf.hxx"
+#include "emfwr.hxx"
+#include "wmfwr.hxx"
+#include "wmf.hxx"
+
+// -----------------------------------------------------------------------------
+
+BOOL ConvertWMFToGDIMetaFile( SvStream & rStreamWMF, GDIMetaFile & rGDIMetaFile,
+ PFilterCallback pCallback, void * pCallerData)
+{
+ UINT32 nMetaType;
+ UINT32 nOrgPos = rStreamWMF.Tell();
+ UINT16 nOrigNumberFormat = rStreamWMF.GetNumberFormatInt();
+ rStreamWMF.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ rStreamWMF.Seek( 0x28 );
+ rStreamWMF >> nMetaType;
+ rStreamWMF.Seek( nOrgPos );
+ if ( nMetaType == 0x464d4520 )
+ {
+ if ( EnhWMFReader( rStreamWMF, rGDIMetaFile, pCallback, pCallerData ).ReadEnhWMF() == FALSE )
+ rStreamWMF.SetError( SVSTREAM_FILEFORMAT_ERROR );
+ }
+ else
+ {
+ WMFReader( rStreamWMF, rGDIMetaFile, pCallback, pCallerData ).ReadWMF();
+ }
+ rStreamWMF.SetNumberFormatInt( nOrigNumberFormat );
+ return !rStreamWMF.GetError();
+}
+
+// -----------------------------------------------------------------------------
+
+BOOL ReadWindowMetafile( SvStream& rStream, GDIMetaFile& rMTF )
+{
+ UINT32 nMetaType;
+ UINT32 nOrgPos = rStream.Tell();
+ UINT16 nOrigNumberFormat = rStream.GetNumberFormatInt();
+ rStream.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN );
+ rStream.Seek( 0x28 );
+ rStream >> nMetaType;
+ rStream.Seek( nOrgPos );
+ if ( nMetaType == 0x464d4520 )
+ {
+ if ( EnhWMFReader( rStream, rMTF, NULL, NULL ).ReadEnhWMF() == FALSE )
+ rStream.SetError( SVSTREAM_FILEFORMAT_ERROR );
+ }
+ else
+ {
+ WMFReader( rStream, rMTF, NULL, NULL ).ReadWMF();
+ }
+ rStream.SetNumberFormatInt( nOrigNumberFormat );
+ return !rStream.GetError();
+}
+
+// -----------------------------------------------------------------------------
+
+BOOL ConvertGDIMetaFileToWMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
+ PFilterCallback pCallback, void * pCallerData,
+ BOOL bPlaceable)
+{
+ WMFWriter aWMFWriter;
+ return aWMFWriter.WriteWMF(rMTF,rTargetStream,pCallback,pCallerData,bPlaceable);
+}
+
+// -----------------------------------------------------------------------------
+
+BOOL ConvertGDIMetaFileToEMF( const GDIMetaFile & rMTF, SvStream & rTargetStream,
+ PFilterCallback pCallback, void * pCallerData )
+{
+ EMFWriter aEMFWriter;
+ return aEMFWriter.WriteEMF( rMTF, rTargetStream, pCallback, pCallerData );
+}
+
+// -----------------------------------------------------------------------------
+
+BOOL WriteWindowMetafile( SvStream& rStream, const GDIMetaFile& rMTF )
+{
+ return WMFWriter().WriteWMF( rMTF, rStream, NULL, NULL );
+}
+
+// -----------------------------------------------------------------------------
+
+BOOL WriteWindowMetafileBits( SvStream& rStream, const GDIMetaFile& rMTF )
+{
+ return WMFWriter().WriteWMF( rMTF, rStream, NULL, NULL, FALSE );
+}
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx
new file mode 100644
index 000000000000..ad860a457d7d
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx
@@ -0,0 +1,1787 @@
+/*************************************************************************
+ *
+ * $RCSfile: wmfwr.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <vcl/salbtype.hxx>
+#include "wmfwr.hxx"
+
+//====================== MS-Windows-defines ===============================
+
+#define W_META_SETBKCOLOR 0x0201
+#define W_META_SETBKMODE 0x0102
+#define W_META_SETMAPMODE 0x0103
+#define W_META_SETROP2 0x0104
+#define W_META_SETRELABS 0x0105
+#define W_META_SETPOLYFILLMODE 0x0106
+#define W_META_SETSTRETCHBLTMODE 0x0107
+#define W_META_SETTEXTCHAREXTRA 0x0108
+#define W_META_SETTEXTCOLOR 0x0209
+#define W_META_SETTEXTJUSTIFICATION 0x020A
+#define W_META_SETWINDOWORG 0x020B
+#define W_META_SETWINDOWEXT 0x020C
+#define W_META_SETVIEWPORTORG 0x020D
+#define W_META_SETVIEWPORTEXT 0x020E
+#define W_META_OFFSETWINDOWORG 0x020F
+#define W_META_SCALEWINDOWEXT 0x0410
+#define W_META_OFFSETVIEWPORTORG 0x0211
+#define W_META_SCALEVIEWPORTEXT 0x0412
+#define W_META_LINETO 0x0213
+#define W_META_MOVETO 0x0214
+#define W_META_EXCLUDECLIPRECT 0x0415
+#define W_META_INTERSECTCLIPRECT 0x0416
+#define W_META_ARC 0x0817
+#define W_META_ELLIPSE 0x0418
+#define W_META_FLOODFILL 0x0419
+#define W_META_PIE 0x081A
+#define W_META_RECTANGLE 0x041B
+#define W_META_ROUNDRECT 0x061C
+#define W_META_PATBLT 0x061D
+#define W_META_SAVEDC 0x001E
+#define W_META_SETPIXEL 0x041F
+#define W_META_OFFSETCLIPRGN 0x0220
+#define W_META_TEXTOUT 0x0521
+#define W_META_BITBLT 0x0922
+#define W_META_STRETCHBLT 0x0B23
+#define W_META_POLYGON 0x0324
+#define W_META_POLYLINE 0x0325
+#define W_META_ESCAPE 0x0626
+#define W_META_RESTOREDC 0x0127
+#define W_META_FILLREGION 0x0228
+#define W_META_FRAMEREGION 0x0429
+#define W_META_INVERTREGION 0x012A
+#define W_META_PAINTREGION 0x012B
+#define W_META_SELECTCLIPREGION 0x012C
+#define W_META_SELECTOBJECT 0x012D
+#define W_META_SETTEXTALIGN 0x012E
+#define W_META_DRAWTEXT 0x062F
+#define W_META_CHORD 0x0830
+#define W_META_SETMAPPERFLAGS 0x0231
+#define W_META_EXTTEXTOUT 0x0a32
+#define W_META_SETDIBTODEV 0x0d33
+#define W_META_SELECTPALETTE 0x0234
+#define W_META_REALIZEPALETTE 0x0035
+#define W_META_ANIMATEPALETTE 0x0436
+#define W_META_SETPALENTRIES 0x0037
+#define W_META_POLYPOLYGON 0x0538
+#define W_META_RESIZEPALETTE 0x0139
+#define W_META_DIBBITBLT 0x0940
+#define W_META_DIBSTRETCHBLT 0x0b41
+#define W_META_DIBCREATEPATTERNBRUSH 0x0142
+#define W_META_STRETCHDIB 0x0f43
+#define W_META_EXTFLOODFILL 0x0548
+#define W_META_RESETDC 0x014C
+#define W_META_STARTDOC 0x014D
+#define W_META_STARTPAGE 0x004F
+#define W_META_ENDPAGE 0x0050
+#define W_META_ABORTDOC 0x0052
+#define W_META_ENDDOC 0x005E
+#define W_META_DELETEOBJECT 0x01f0
+#define W_META_CREATEPALETTE 0x00f7
+#define W_META_CREATEBRUSH 0x00F8
+#define W_META_CREATEPATTERNBRUSH 0x01F9
+#define W_META_CREATEPENINDIRECT 0x02FA
+#define W_META_CREATEFONTINDIRECT 0x02FB
+#define W_META_CREATEBRUSHINDIRECT 0x02FC
+#define W_META_CREATEBITMAPINDIRECT 0x02FD
+#define W_META_CREATEBITMAP 0x06FE
+#define W_META_CREATEREGION 0x06FF
+
+#define W_TRANSPARENT 1
+#define W_OPAQUE 2
+
+#define W_R2_BLACK 1
+#define W_R2_NOTMERGEPEN 2
+#define W_R2_MASKNOTPEN 3
+#define W_R2_NOTCOPYPEN 4
+#define W_R2_MASKPENNOT 5
+#define W_R2_NOT 6
+#define W_R2_XORPEN 7
+#define W_R2_NOTMASKPEN 8
+#define W_R2_MASKPEN 9
+#define W_R2_NOTXORPEN 10
+#define W_R2_NOP 11
+#define W_R2_MERGENOTPEN 12
+#define W_R2_COPYPEN 13
+#define W_R2_MERGEPENNOT 14
+#define W_R2_MERGEPEN 15
+#define W_R2_WHITE 16
+
+#define W_TA_NOUPDATECP 0x0000
+#define W_TA_UPDATECP 0x0001
+#define W_TA_LEFT 0x0000
+#define W_TA_RIGHT 0x0002
+#define W_TA_CENTER 0x0006
+#define W_TA_TOP 0x0000
+#define W_TA_BOTTOM 0x0008
+#define W_TA_BASELINE 0x0018
+
+#define W_SRCCOPY 0x00CC0020L
+#define W_SRCPAINT 0x00EE0086L
+#define W_SRCAND 0x008800C6L
+#define W_SRCINVERT 0x00660046L
+#define W_SRCERASE 0x00440328L
+#define W_NOTSRCCOPY 0x00330008L
+#define W_NOTSRCERASE 0x001100A6L
+#define W_MERGECOPY 0x00C000CAL
+#define W_MERGEPAINT 0x00BB0226L
+#define W_PATCOPY 0x00F00021L
+#define W_PATPAINT 0x00FB0A09L
+#define W_PATINVERT 0x005A0049L
+#define W_DSTINVERT 0x00550009L
+#define W_BLACKNESS 0x00000042L
+#define W_WHITENESS 0x00FF0062L
+
+#define W_PS_SOLID 0
+#define W_PS_DASH 1
+#define W_PS_DOT 2
+#define W_PS_DASHDOT 3
+#define W_PS_DASHDOTDOT 4
+#define W_PS_NULL 5
+#define W_PS_INSIDEFRAME 6
+
+#define W_LF_FACESIZE 32
+
+#define W_ANSI_CHARSET 0
+#define W_DEFAULT_CHARSET 1
+#define W_SYMBOL_CHARSET 2
+#define W_SHIFTJIS_CHARSET 128
+#define W_HANGEUL_CHARSET 129
+#define W_CHINESEBIG5_CHARSET 136
+#define W_OEM_CHARSET 255
+
+#define W_DEFAULT_PITCH 0x00
+#define W_FIXED_PITCH 0x01
+#define W_VARIABLE_PITCH 0x02
+
+#define W_FF_DONTCARE 0x00
+#define W_FF_ROMAN 0x10
+#define W_FF_SWISS 0x20
+#define W_FF_MODERN 0x30
+#define W_FF_SCRIPT 0x40
+#define W_FF_DECORATIVE 0x50
+
+#define W_FW_DONTCARE 0
+#define W_FW_THIN 100
+#define W_FW_EXTRALIGHT 200
+#define W_FW_LIGHT 300
+#define W_FW_NORMAL 400
+#define W_FW_MEDIUM 500
+#define W_FW_SEMIBOLD 600
+#define W_FW_BOLD 700
+#define W_FW_EXTRABOLD 800
+#define W_FW_HEAVY 900
+#define W_FW_ULTRALIGHT 200
+#define W_FW_REGULAR 400
+#define W_FW_DEMIBOLD 600
+#define W_FW_ULTRABOLD 800
+#define W_FW_BLACK 900
+
+#define W_BS_SOLID 0
+#define W_BS_HOLLOW 1
+#define W_BS_HATCHED 2
+#define W_BS_PATTERN 3
+#define W_BS_INDEXED 4
+#define W_BS_DIBPATTERN 5
+
+#define W_HS_HORIZONTAL 0
+#define W_HS_VERTICAL 1
+#define W_HS_FDIAGONAL 2
+#define W_HS_BDIAGONAL 3
+#define W_HS_CROSS 4
+#define W_HS_DIAGCROSS 5
+
+//========================== Methoden von WMFWriter ==========================
+
+void WMFWriter::MayCallback()
+{
+ ULONG nPercent;
+
+ // Wir gehen mal einfach so davon aus, dass 16386 Actions einer Bitmap entsprechen
+ // (in der Regel wird ein Metafile entweder nur Actions oder einige Bitmaps und fast
+ // keine Actions enthalten. Dann ist das Verhaeltnis ziemlich unwichtig)
+
+ nPercent=((nWrittenBitmaps<<14)+(nActBitmapPercent<<14)/100+nWrittenActions)
+ *100
+ /((nNumberOfBitmaps<<14)+nNumberOfActions);
+
+ if (nPercent>=nLastPercent+3) {
+ nLastPercent=nPercent;
+ if(pCallback!=NULL && nPercent<=100) {
+ if (((*pCallback)(pCallerData,(USHORT)nPercent))==TRUE) bStatus=FALSE;
+ }
+ }
+}
+
+
+void WMFWriter::CountActionsAndBitmaps( const GDIMetaFile & rMTF )
+{
+ ULONG nAction, nActionCount;
+
+ nActionCount = rMTF.GetActionCount();
+
+ for ( nAction=0; nAction<nActionCount; nAction++ )
+ {
+ MetaAction* pMA = rMTF.GetAction( nAction );
+
+ switch( pMA->GetType() )
+ {
+ case META_BMP_ACTION:
+ case META_BMPSCALE_ACTION:
+ case META_BMPSCALEPART_ACTION:
+ case META_BMPEX_ACTION:
+ case META_BMPEXSCALE_ACTION:
+ case META_BMPEXSCALEPART_ACTION:
+ nNumberOfBitmaps++;
+ break;
+ }
+ nNumberOfActions++;
+ }
+}
+
+
+void WMFWriter::WritePointXY(const Point & rPoint)
+{
+ Point aPt( pVirDev->LogicToLogic(rPoint,aSrcMapMode,aTargetMapMode) );
+ *pWMF << ((short)aPt.X()) << ((short)aPt.Y());
+}
+
+
+void WMFWriter::WritePointYX(const Point & rPoint)
+{
+ Point aPt( pVirDev->LogicToLogic(rPoint,aSrcMapMode,aTargetMapMode) );
+ *pWMF << ((short)aPt.Y()) << ((short)aPt.X());
+}
+
+
+void WMFWriter::WriteDX(long nDX)
+{
+ Size aSz( pVirDev->LogicToLogic(Size(nDX,0),aSrcMapMode,aTargetMapMode) );
+ *pWMF << ((short)aSz.Width());
+}
+
+
+void WMFWriter::WriteSize(const Size & rSize)
+{
+ Size aSz( pVirDev->LogicToLogic(rSize,aSrcMapMode,aTargetMapMode) );
+ *pWMF << ((short)aSz.Width()) << ((short)aSz.Height());
+}
+
+
+void WMFWriter::WriteHeightWidth(const Size & rSize)
+{
+ Size aSz( pVirDev->LogicToLogic(rSize,aSrcMapMode,aTargetMapMode) );
+ *pWMF << ((short)aSz.Height()) << ((short)aSz.Width());
+}
+
+
+void WMFWriter::WriteRectangle(const Rectangle & rRect)
+{
+ WritePointYX(Point(rRect.Right()+1,rRect.Bottom()+1));
+ WritePointYX(rRect.TopLeft());
+}
+
+
+void WMFWriter::WriteColor(const Color & rColor)
+{
+ *pWMF << (BYTE) rColor.GetRed() << (BYTE) rColor.GetGreen() << (BYTE) rColor.GetBlue() << (BYTE) 0;
+}
+
+
+void WMFWriter::WriteRecordHeader(ULONG nSizeWords, USHORT nType)
+{
+ nActRecordPos=pWMF->Tell();
+ if (nSizeWords>nMaxRecordSize) nMaxRecordSize=nSizeWords;
+ *pWMF << nSizeWords << nType;
+}
+
+
+void WMFWriter::UpdateRecordHeader()
+{
+ ULONG nPos,nSize;
+
+ nPos=pWMF->Tell(); nSize=nPos-nActRecordPos;
+ if ((nSize & 1)!=0) {
+ *pWMF << (BYTE)0;
+ nPos++; nSize++;
+ }
+ nSize/=2;
+ if (nSize>nMaxRecordSize) nMaxRecordSize=nSize;
+ pWMF->Seek(nActRecordPos);
+ *pWMF << nSize;
+ pWMF->Seek(nPos);
+}
+
+
+void WMFWriter::WMFRecord_Arc(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt)
+{
+ WriteRecordHeader(0x0000000b,W_META_ARC);
+ WritePointYX(rEndPt);
+ WritePointYX(rStartPt);
+ WriteRectangle(rRect);
+}
+
+void WMFWriter::WMFRecord_Chord(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt)
+{
+ WriteRecordHeader(0x0000000b,W_META_CHORD);
+ WritePointYX(rEndPt);
+ WritePointYX(rStartPt);
+ WriteRectangle(rRect);
+}
+
+
+void WMFWriter::WMFRecord_CreateBrushIndirect(const Color& rColor)
+{
+ WriteRecordHeader(0x00000007,W_META_CREATEBRUSHINDIRECT);
+
+ if( rColor==Color(COL_TRANSPARENT) )
+ *pWMF << (UINT16) W_BS_HOLLOW;
+ else
+ *pWMF << (UINT16) W_BS_SOLID;
+
+ WriteColor( rColor );
+ *pWMF << (UINT16) 0;
+}
+
+
+void WMFWriter::WMFRecord_CreateFontIndirect(const Font & rFont)
+{
+ USHORT nWeight,i;
+ BYTE nCharSet,nPitchFamily;
+
+ WriteRecordHeader(0x00000000,W_META_CREATEFONTINDIRECT);
+
+ WriteHeightWidth(Size(rFont.GetSize().Width(),-rFont.GetSize().Height()));
+
+ *pWMF << (short)rFont.GetOrientation() << (short)rFont.GetOrientation();
+
+ switch (rFont.GetWeight()) {
+ case WEIGHT_THIN: nWeight=W_FW_THIN; break;
+ case WEIGHT_ULTRALIGHT: nWeight=W_FW_ULTRALIGHT; break;
+ case WEIGHT_LIGHT: nWeight=W_FW_LIGHT; break;
+ case WEIGHT_SEMILIGHT: nWeight=W_FW_LIGHT; break;
+ case WEIGHT_NORMAL: nWeight=W_FW_NORMAL; break;
+ case WEIGHT_MEDIUM: nWeight=W_FW_MEDIUM; break;
+ case WEIGHT_SEMIBOLD: nWeight=W_FW_SEMIBOLD; break;
+ case WEIGHT_BOLD: nWeight=W_FW_BOLD; break;
+ case WEIGHT_ULTRABOLD: nWeight=W_FW_ULTRABOLD; break;
+ case WEIGHT_BLACK: nWeight=W_FW_BLACK; break;
+ default: nWeight=W_FW_DONTCARE;
+ }
+ *pWMF << nWeight;
+
+ if (rFont.GetItalic()==ITALIC_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
+ if (rFont.GetUnderline()==UNDERLINE_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
+ if (rFont.GetStrikeout()==STRIKEOUT_NONE) *pWMF << (BYTE)0; else *pWMF << (BYTE)1;
+
+ switch (rFont.GetCharSet())
+ {
+ case RTL_TEXTENCODING_SYMBOL : nCharSet = W_SYMBOL_CHARSET; break;
+ default: nCharSet = W_ANSI_CHARSET;
+ }
+ *pWMF << nCharSet;
+
+ *pWMF << (BYTE)0 << (BYTE)0 << (BYTE)0;
+
+ switch (rFont.GetPitch()) {
+ case PITCH_FIXED: nPitchFamily=W_FIXED_PITCH; break;
+ case PITCH_VARIABLE: nPitchFamily=W_VARIABLE_PITCH; break;
+ default: nPitchFamily=W_DEFAULT_PITCH;
+ }
+ switch (rFont.GetFamily()) {
+ case FAMILY_DECORATIVE: nPitchFamily|=W_FF_DECORATIVE; break;
+ case FAMILY_MODERN: nPitchFamily|=W_FF_MODERN; break;
+ case FAMILY_ROMAN: nPitchFamily|=W_FF_ROMAN; break;
+ case FAMILY_SCRIPT: nPitchFamily|=W_FF_SCRIPT; break;
+ case FAMILY_SWISS: nPitchFamily|=W_FF_SWISS; break;
+ default: nPitchFamily|=W_FF_DONTCARE;
+ }
+ *pWMF << nPitchFamily;
+
+ ByteString aFontName( rFont.GetName(), RTL_TEXTENCODING_UTF8 );
+ for ( i = 0; i < W_LF_FACESIZE; i++ )
+ {
+ if ( i < aFontName.Len() )
+ *pWMF << (BYTE)aFontName.GetChar( i );
+ else
+ *pWMF << (BYTE)0;
+ }
+
+ UpdateRecordHeader();
+}
+
+
+void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor)
+{
+ WriteRecordHeader(0x00000008,W_META_CREATEPENINDIRECT);
+
+ if( rColor == Color( COL_TRANSPARENT ) )
+ *pWMF << (UINT16) W_PS_NULL;
+ else
+ *pWMF << (UINT16) W_PS_SOLID;
+
+ WriteSize( Size() );
+ WriteColor(rColor);
+}
+
+void WMFWriter::WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo )
+{
+ WriteRecordHeader(0x00000008,W_META_CREATEPENINDIRECT);
+
+ USHORT nStyle = W_PS_SOLID;
+ switch( rLineInfo.GetStyle() )
+ {
+ case LINE_DASH :
+ {
+ if ( rLineInfo.GetDotCount() )
+ {
+ if ( !rLineInfo.GetDashCount() )
+ nStyle = W_PS_DOT;
+ else
+ {
+ if ( !rLineInfo.GetDotCount() == 1 )
+ nStyle = W_PS_DASHDOT;
+ else
+ nStyle = W_PS_DASHDOTDOT;
+ }
+ }
+ else
+ nStyle = W_PS_DASH;
+ }
+ break;
+ case LINE_NONE :
+ nStyle = W_PS_NULL;
+ break;
+ }
+ *pWMF << nStyle;
+
+ WriteSize( Size( rLineInfo.GetWidth(), 0 ) );
+ WriteColor( rColor );
+}
+
+void WMFWriter::WMFRecord_DeleteObject(USHORT nObjectHandle)
+{
+ WriteRecordHeader(0x00000004,W_META_DELETEOBJECT);
+ *pWMF << nObjectHandle;
+}
+
+
+void WMFWriter::WMFRecord_Ellipse(const Rectangle & rRect)
+{
+ WriteRecordHeader(0x00000007,W_META_ELLIPSE);
+ WriteRectangle(rRect);
+}
+
+
+void WMFWriter::WMFRecord_ExtTextOut(const Point & rPoint, const ByteString & rString, const long * pDXAry)
+{
+ USHORT nLen,i;
+
+ nLen=rString.Len();
+ if (nLen<=1 || pDXAry==NULL)
+ {
+ WMFRecord_TextOut(rPoint,rString);
+ return;
+ }
+
+ WriteRecordHeader(0,W_META_EXTTEXTOUT);
+ WritePointYX(rPoint);
+ *pWMF << nLen << (USHORT)0;
+
+ for ( i = 0; i < nLen; i++ )
+ *pWMF << (BYTE)rString.GetChar( i );
+ if ((nLen&1)!=0) *pWMF << (BYTE)0;
+ WriteDX(pDXAry[0]);
+ for (i=1; i<(nLen-1); i++) WriteDX(pDXAry[i]-pDXAry[i-1]);
+ WriteDX(pDXAry[nLen-2]/(nLen-1));
+ UpdateRecordHeader();
+}
+
+
+void WMFWriter::WMFRecord_ExtTextOut(const Point & rPoint, const ByteString & rString, ULONG nWidth)
+{
+ USHORT nLen,i;
+ long * pDXAry;
+ sal_Int32 nNormSize;
+
+ pVirDev->SetFont(aSrcFont);
+ nLen=rString.Len();
+ pDXAry=new long[nLen];
+ nNormSize = pVirDev->GetTextArray( UniString( rString, RTL_TEXTENCODING_UTF8 ),pDXAry );
+ if (nLen<=1 || nNormSize ==(long)nWidth )
+ {
+ WMFRecord_TextOut(rPoint,rString);
+ delete pDXAry;
+ return;
+ }
+ for (i=0; i<(nLen-1); i++) pDXAry[i]=pDXAry[i]*((long)nWidth)/nNormSize;
+ WMFRecord_ExtTextOut(rPoint,rString,pDXAry);
+ delete pDXAry;
+}
+
+
+void WMFWriter::WMFRecord_LineTo(const Point & rPoint)
+{
+ WriteRecordHeader(0x00000005,W_META_LINETO);
+ WritePointYX(rPoint);
+}
+
+
+void WMFWriter::WMFRecord_MoveTo(const Point & rPoint)
+{
+ WriteRecordHeader(0x00000005,W_META_MOVETO);
+ WritePointYX(rPoint);
+}
+
+
+void WMFWriter::WMFRecord_Pie(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt)
+{
+ WriteRecordHeader(0x0000000b,W_META_PIE);
+ WritePointYX(rEndPt);
+ WritePointYX(rStartPt);
+ WriteRectangle(rRect);
+}
+
+
+void WMFWriter::WMFRecord_Polygon(const Polygon & rPoly)
+{
+ USHORT nSize,i;
+ nSize=rPoly.GetSize();
+
+ WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYGON);
+ *pWMF << nSize;
+ for (i=0; i<nSize; i++) WritePointXY(rPoly.GetPoint(i));
+}
+
+
+void WMFWriter::WMFRecord_PolyLine(const Polygon & rPoly)
+{
+ USHORT nSize,i;
+ nSize=rPoly.GetSize();
+
+ WriteRecordHeader(((ULONG)nSize)*2+4,W_META_POLYLINE);
+ *pWMF << nSize;
+ for (i=0; i<nSize; i++) WritePointXY(rPoly.GetPoint(i));
+}
+
+
+void WMFWriter::WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly)
+{
+ const Polygon * pPoly;
+ USHORT nCount,nSize,i,j;
+
+ WriteRecordHeader(0,W_META_POLYPOLYGON);
+ nCount=rPolyPoly.Count();
+ *pWMF << nCount;
+ for (i=0; i<nCount; i++) *pWMF << ((USHORT)(rPolyPoly.GetObject(i).GetSize()));
+ for (i=0; i<nCount; i++) {
+ pPoly=&(rPolyPoly.GetObject(i));
+ nSize=pPoly->GetSize();
+ for (j=0; j<nSize; j++) WritePointXY(pPoly->GetPoint(j));
+ }
+ UpdateRecordHeader();
+}
+
+
+void WMFWriter::WMFRecord_Rectangle(const Rectangle & rRect)
+{
+ WriteRecordHeader( 0x00000007,W_META_RECTANGLE );
+ WriteRectangle( rRect );
+}
+
+
+void WMFWriter::WMFRecord_RestoreDC()
+{
+ WriteRecordHeader(0x00000004,W_META_RESTOREDC);
+ *pWMF << (short)-1;
+}
+
+
+void WMFWriter::WMFRecord_RoundRect(const Rectangle & rRect, long nHorzRound, long nVertRound)
+{
+ WriteRecordHeader(0x00000009,W_META_ROUNDRECT);
+ WriteHeightWidth(Size(nHorzRound,nVertRound));
+ WriteRectangle(rRect);
+}
+
+
+void WMFWriter::WMFRecord_SaveDC()
+{
+ WriteRecordHeader(0x00000003,W_META_SAVEDC);
+}
+
+
+void WMFWriter::WMFRecord_SelectObject(USHORT nObjectHandle)
+{
+ WriteRecordHeader(0x00000004,W_META_SELECTOBJECT);
+ *pWMF << nObjectHandle;
+}
+
+
+void WMFWriter::WMFRecord_SetBkColor(const Color & rColor)
+{
+ WriteRecordHeader(0x00000005,W_META_SETBKCOLOR);
+ WriteColor(rColor);
+}
+
+
+void WMFWriter::WMFRecord_SetBkMode(BOOL bTransparent)
+{
+ WriteRecordHeader(0x00000004,W_META_SETBKMODE);
+ if (bTransparent==TRUE) *pWMF << (USHORT)W_TRANSPARENT;
+ else *pWMF << (USHORT)W_OPAQUE;
+}
+
+void WMFWriter::WMFRecord_SetStretchBltMode()
+{
+ WriteRecordHeader( 0x00000004, W_META_SETSTRETCHBLTMODE );
+ *pWMF << (USHORT) 3; // STRETCH_DELETESCANS
+}
+
+void WMFWriter::WMFRecord_SetPixel(const Point & rPoint, const Color & rColor)
+{
+ WriteRecordHeader(0x00000007,W_META_SETPIXEL);
+ WriteColor(rColor);
+ WritePointYX(rPoint);
+}
+
+
+void WMFWriter::WMFRecord_SetROP2(RasterOp eROP)
+{
+ USHORT nROP2;
+
+ switch (eROP) {
+ case ROP_INVERT: nROP2=W_R2_NOT; break;
+ case ROP_XOR: nROP2=W_R2_XORPEN; break;
+ default: nROP2=W_R2_COPYPEN;
+ }
+ WriteRecordHeader(0x00000004,W_META_SETROP2);
+ *pWMF << nROP2;
+}
+
+
+void WMFWriter::WMFRecord_SetTextAlign(FontAlign eFontAlign)
+{
+ USHORT nAlign;
+
+ switch (eFontAlign) {
+ case ALIGN_TOP: nAlign=W_TA_TOP; break;
+ case ALIGN_BOTTOM: nAlign=W_TA_BOTTOM; break;
+ default: nAlign=W_TA_BASELINE;
+ }
+ nAlign|=W_TA_LEFT;
+ nAlign|=W_TA_NOUPDATECP;
+
+ WriteRecordHeader(0x00000004,W_META_SETTEXTALIGN);
+ *pWMF << nAlign;
+}
+
+
+void WMFWriter::WMFRecord_SetTextColor(const Color & rColor)
+{
+ WriteRecordHeader(0x00000005,W_META_SETTEXTCOLOR);
+ WriteColor(rColor);
+}
+
+
+void WMFWriter::WMFRecord_SetWindowExt(const Size & rSize)
+{
+ WriteRecordHeader(0x00000005,W_META_SETWINDOWEXT);
+ WriteHeightWidth(rSize);
+}
+
+
+void WMFWriter::WMFRecord_SetWindowOrg(const Point & rPoint)
+{
+ WriteRecordHeader(0x00000005,W_META_SETWINDOWORG);
+ WritePointYX(rPoint);
+}
+
+
+void WMFWriter::WMFRecord_StretchDIB( const Point & rPoint, const Size & rSize,
+ const Bitmap & rBitmap, ULONG nROP )
+{
+ ULONG nPosAnf,nPosEnd;
+
+ nActBitmapPercent=50;
+ MayCallback();
+
+ WriteRecordHeader(0x00000000,W_META_STRETCHDIB);
+
+ // Die Reihenfolge im Metafile soll jetzt sein:
+ // einige Parameter (laenge 22), dann die Bitmap ohne FILEHEADER.
+ // Da aber *pWMF << rBitmap einen FILEHEADER der Laenge 14
+ // erzeugt, schreiben wir zuerst die Bitmap an die richtige Position
+ // Und ueberschreiben hinterher den FILEHEADER mit den Parametern.
+ nPosAnf=pWMF->Tell(); // Position merken, wo Parameter hin sollen
+ *pWMF << (long)0 << (long)0; // 8 bytes auffuellen (diese 8 bytes +
+ // 14 bytes ueberfluessigen FILEHEADER
+ // = 22 bytes Parameter)
+ *pWMF << rBitmap; // Bitmap schreiben
+
+ // Parameter schreiben:
+ nPosEnd=pWMF->Tell();
+ pWMF->Seek(nPosAnf);
+
+ // Raster-Op bestimmen, falls nichts uebergeben wurde
+ if( !nROP )
+ {
+ switch( eSrcRasterOp )
+ {
+ case ROP_INVERT: nROP = W_DSTINVERT; break;
+ case ROP_XOR: nROP = W_SRCINVERT; break;
+ default: nROP = W_SRCCOPY;
+ }
+ }
+
+ *pWMF << nROP <<
+ (short) 0 <<
+ (short) rBitmap.GetSizePixel().Height() <<
+ (short) rBitmap.GetSizePixel().Width() <<
+ (short) 0 <<
+ (short) 0;
+
+ WriteHeightWidth(rSize);
+ WritePointYX(rPoint);
+ pWMF->Seek(nPosEnd);
+
+ UpdateRecordHeader();
+
+ nWrittenBitmaps++;
+ nActBitmapPercent=0;
+}
+
+
+void WMFWriter::WMFRecord_TextOut(const Point & rPoint, const ByteString & rString)
+{
+ USHORT nLen,i;
+
+ WriteRecordHeader(0,W_META_TEXTOUT);
+ nLen=rString.Len();
+ *pWMF << nLen;
+ for ( i = 0; i < nLen; i++ )
+ *pWMF << (BYTE)rString.GetChar( i );
+ if ((nLen&1)!=0) *pWMF << (BYTE)0;
+ WritePointYX(rPoint);
+ UpdateRecordHeader();
+}
+
+
+void WMFWriter::WMFRecord_EndOfFile()
+{
+ WriteRecordHeader(0x00000003,0x0000);
+}
+
+
+void WMFWriter::WMFRecord_IntersectClipRect( const Rectangle& rRect )
+{
+ WriteRecordHeader( 0x00000007, W_META_INTERSECTCLIPRECT );
+ WriteRectangle(rRect);
+}
+
+
+USHORT WMFWriter::AllocHandle()
+{
+ USHORT i;
+
+ for (i=0; i<MAXOBJECTHANDLES; i++) {
+ if (bHandleAllocated[i]==FALSE) {
+ bHandleAllocated[i]=TRUE;
+ return i;
+ }
+ }
+ bStatus=FALSE;
+ return 0xffff;
+}
+
+
+void WMFWriter::FreeHandle(USHORT nObjectHandle)
+{
+ if (nObjectHandle<MAXOBJECTHANDLES) bHandleAllocated[nObjectHandle]=FALSE;
+}
+
+
+void WMFWriter::CreateSelectDeletePen(const Color& rColor)
+{
+ USHORT nOldHandle;
+
+ nOldHandle=nDstPenHandle;
+ nDstPenHandle=AllocHandle();
+ WMFRecord_CreatePenIndirect(rColor);
+ WMFRecord_SelectObject(nDstPenHandle);
+ if (nOldHandle<MAXOBJECTHANDLES) {
+ WMFRecord_DeleteObject(nOldHandle);
+ FreeHandle(nOldHandle);
+ }
+}
+
+
+void WMFWriter::CreateSelectDeleteFont(const Font & rFont)
+{
+ USHORT nOldHandle;
+
+ nOldHandle=nDstFontHandle;
+ nDstFontHandle=AllocHandle();
+ WMFRecord_CreateFontIndirect(rFont);
+ WMFRecord_SelectObject(nDstFontHandle);
+ if (nOldHandle<MAXOBJECTHANDLES) {
+ WMFRecord_DeleteObject(nOldHandle);
+ FreeHandle(nOldHandle);
+ }
+}
+
+
+void WMFWriter::CreateSelectDeleteBrush(const Color& rColor)
+{
+ USHORT nOldHandle;
+
+ nOldHandle=nDstBrushHandle;
+ nDstBrushHandle=AllocHandle();
+ WMFRecord_CreateBrushIndirect(rColor);
+ WMFRecord_SelectObject(nDstBrushHandle);
+ if (nOldHandle<MAXOBJECTHANDLES) {
+ WMFRecord_DeleteObject(nOldHandle);
+ FreeHandle(nOldHandle);
+ }
+}
+
+
+void WMFWriter::SetAttrForLines()
+{
+
+ if (bAttrReadyForLines==TRUE) return;
+
+ if (bDstGraphicsInvalid || eDstROP2!=eSrcRasterOp) {
+ eDstROP2=eSrcRasterOp;
+ WMFRecord_SetROP2(eDstROP2);
+ }
+ if (bDstGraphicsInvalid || aDstLineColor!=aSrcLineColor) {
+ aDstLineColor=aSrcLineColor;
+ CreateSelectDeletePen(aDstLineColor);
+ }
+ if (bDstGraphicsInvalid || aDstFillColor!=aSrcFillColor) {
+ aDstFillColor=aSrcFillColor;
+ CreateSelectDeleteBrush(aDstFillColor);
+ }
+ if (bDstGraphicsInvalid || bDstIsClipping!=bSrcIsClipping ||
+ (bSrcIsClipping==TRUE && aDstClipRegion!=aSrcClipRegion)) {
+ bDstIsClipping=bSrcIsClipping;
+ aDstClipRegion=aSrcClipRegion;
+ if (bDstGraphicsInvalid==FALSE || bSrcIsClipping==TRUE) {
+ //...???...
+ }
+ }
+
+ bAttrReadyForLines=TRUE;
+ bAttrReadyForAreas=FALSE;
+ bAttrReadyForText=FALSE;
+ bDstGraphicsInvalid=FALSE;
+}
+
+
+void WMFWriter::SetAttrForAreas()
+{
+ if( aSrcFillColor == Color( COL_TRANSPARENT ) )
+ {
+ SetAttrForLines();
+ return;
+ }
+
+ if (bAttrReadyForAreas==TRUE) return;
+
+ if (bDstGraphicsInvalid || eDstROP2!=eSrcRasterOp) {
+ eDstROP2=eSrcRasterOp;
+ WMFRecord_SetROP2(eDstROP2);
+ }
+ if (bDstGraphicsInvalid || aDstLineColor!=aSrcLineColor) {
+ aDstLineColor=aSrcLineColor;
+ CreateSelectDeletePen(aDstLineColor);
+ }
+ if (bDstGraphicsInvalid || aDstFillColor!=aSrcFillColor) {
+ aDstFillColor=aSrcFillColor;
+ CreateSelectDeleteBrush(aDstFillColor);
+ }
+ if (bDstGraphicsInvalid || bDstIsClipping!=bSrcIsClipping ||
+ (bSrcIsClipping==TRUE && aDstClipRegion!=aSrcClipRegion)) {
+ bDstIsClipping=bSrcIsClipping;
+ aDstClipRegion=aSrcClipRegion;
+ if (bDstGraphicsInvalid==FALSE || bSrcIsClipping==TRUE) {
+ //...???...
+ }
+ }
+
+ bAttrReadyForAreas=TRUE;
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForText=FALSE;
+ bDstGraphicsInvalid=FALSE;
+}
+
+
+void WMFWriter::SetAttrForText()
+{
+ if (bAttrReadyForText==TRUE) return;
+
+ if (bDstGraphicsInvalid==FALSE) SetAttrForLines();
+
+ if (bDstTextInvalid || aDstTextColor!=aSrcFont.GetColor()) {
+ aDstTextColor=aSrcFont.GetColor();
+ WMFRecord_SetTextColor(aDstTextColor);
+ }
+ if (bDstTextInvalid || eDstTextAlign!=aSrcFont.GetAlign()) {
+ eDstTextAlign=aSrcFont.GetAlign();
+ WMFRecord_SetTextAlign(eDstTextAlign);
+ }
+ if (bDstTextInvalid || aDstFont!=aSrcFont) {
+ aDstFont=aSrcFont;
+ CreateSelectDeleteFont(aDstFont);
+ }
+
+ bAttrReadyForText=TRUE;
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ bDstTextInvalid=FALSE;
+}
+
+
+void WMFWriter::WriteRecords( const GDIMetaFile & rMTF )
+{
+ ULONG nA, nACount;
+ MetaAction* pMA;
+
+ if( bStatus )
+ {
+ nACount = rMTF.GetActionCount();
+
+ WMFRecord_SetStretchBltMode();
+
+ for( nA=0; nA<nACount; nA++ )
+ {
+ pMA = rMTF.GetAction( nA );
+
+ switch( pMA->GetType() )
+ {
+ case META_PIXEL_ACTION:
+ {
+ const MetaPixelAction* pA = (const MetaPixelAction *) pMA;
+ SetAttrForLines();
+ WMFRecord_SetPixel( pA->GetPoint(), pA->GetColor() );
+ }
+ break;
+
+ case META_POINT_ACTION:
+ {
+ const MetaPointAction* pA = (const MetaPointAction*) pMA;
+ const Point& rPt = pA->GetPoint();
+ SetAttrForLines();
+ WMFRecord_MoveTo( rPt);
+ WMFRecord_LineTo( rPt );
+ }
+ break;
+
+ case META_LINE_ACTION:
+ {
+ const MetaLineAction* pA = (const MetaLineAction *) pMA;
+ const LineInfo& rLineInfo = pA->GetLineInfo();
+ SetAttrForLines();
+ if ( rLineInfo.IsDefault() )
+ {
+ WMFRecord_MoveTo( pA->GetStartPoint() );
+ WMFRecord_LineTo( pA->GetEndPoint() );
+ }
+ else
+ {
+ USHORT nCurrentHandle = AllocHandle();
+ WMFRecord_CreatePenIndirect( aSrcLineColor, rLineInfo );
+ WMFRecord_SelectObject(nCurrentHandle);
+ WMFRecord_MoveTo( pA->GetStartPoint() );
+ WMFRecord_LineTo( pA->GetEndPoint() );
+ WMFRecord_DeleteObject(nCurrentHandle);
+ FreeHandle(nCurrentHandle);
+ WMFRecord_SelectObject(nDstPenHandle);
+ }
+ }
+ break;
+
+ case META_RECT_ACTION:
+ {
+ const MetaRectAction* pA = (const MetaRectAction*) pMA;
+ SetAttrForAreas();
+ WMFRecord_Rectangle( pA->GetRect() );
+ }
+ break;
+
+ case META_ROUNDRECT_ACTION:
+ {
+ const MetaRoundRectAction* pA = (const MetaRoundRectAction*) pMA;
+ SetAttrForAreas();
+ WMFRecord_RoundRect( pA->GetRect(), pA->GetHorzRound(), pA->GetVertRound() );
+ }
+ break;
+
+ case META_ELLIPSE_ACTION:
+ {
+ const MetaEllipseAction* pA = (const MetaEllipseAction*) pMA;
+ SetAttrForAreas();
+ WMFRecord_Ellipse( pA->GetRect() );
+ }
+ break;
+
+ case META_ARC_ACTION:
+ {
+ const MetaArcAction* pA = (const MetaArcAction*) pMA;
+ SetAttrForLines();
+ WMFRecord_Arc( pA->GetRect(),pA->GetStartPoint(),pA->GetEndPoint() );
+ }
+ break;
+
+ case META_PIE_ACTION:
+ {
+ const MetaPieAction* pA = (const MetaPieAction*) pMA;
+ SetAttrForAreas();
+ WMFRecord_Pie( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+
+ case META_CHORD_ACTION:
+ {
+ const MetaChordAction* pA = (const MetaChordAction*) pMA;
+ SetAttrForAreas();
+ WMFRecord_Chord( pA->GetRect(), pA->GetStartPoint(), pA->GetEndPoint() );
+ }
+ break;
+
+ case META_POLYLINE_ACTION:
+ {
+ const MetaPolyLineAction* pA = (const MetaPolyLineAction*) pMA;
+ const LineInfo& rLineInfo = pA->GetLineInfo();
+ SetAttrForLines();
+
+ if ( rLineInfo.IsDefault() )
+ WMFRecord_PolyLine( pA->GetPolygon() );
+ else
+ {
+ USHORT nCurrentHandle = AllocHandle();
+ WMFRecord_CreatePenIndirect( aSrcLineColor, rLineInfo );
+ WMFRecord_SelectObject(nCurrentHandle);
+ WMFRecord_PolyLine( pA->GetPolygon() );
+ WMFRecord_DeleteObject(nCurrentHandle);
+ FreeHandle(nCurrentHandle);
+ WMFRecord_SelectObject(nDstPenHandle);
+ }
+ }
+ break;
+
+ case META_POLYGON_ACTION:
+ {
+ const MetaPolygonAction* pA = (const MetaPolygonAction*) pMA;
+ SetAttrForAreas();
+ WMFRecord_Polygon( pA->GetPolygon() );
+ }
+ break;
+
+ case META_POLYPOLYGON_ACTION:
+ {
+ const MetaPolyPolygonAction* pA = (const MetaPolyPolygonAction*) pMA;
+ SetAttrForAreas();
+ WMFRecord_PolyPolygon( pA->GetPolyPolygon() );
+ }
+ break;
+
+ case META_TEXT_ACTION:
+ case META_TEXTRECT_ACTION:
+ {
+ const MetaTextAction * pA = (const MetaTextAction*) pMA;
+ String aTemp( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ rtl_TextEncoding eChrSet = aSrcFont.GetCharSet();
+ rtl_TextEncoding eTargetChrSet = RTL_TEXTENCODING_MS_1252;
+ if ( eChrSet == RTL_TEXTENCODING_DONTKNOW )
+ eChrSet = gsl_getSystemTextEncoding();
+ if ( eChrSet != RTL_TEXTENCODING_SYMBOL )
+ eTargetChrSet = RTL_TEXTENCODING_SYMBOL;
+ ByteString aStr( aTemp, eChrSet, eTargetChrSet );
+ SetAttrForText();
+ WMFRecord_TextOut( pA->GetPoint(), aStr );
+ }
+ break;
+
+ case META_TEXTARRAY_ACTION:
+ {
+ const MetaTextArrayAction* pA = (const MetaTextArrayAction*) pMA;
+
+ String aTemp( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ rtl_TextEncoding eChrSet = aSrcFont.GetCharSet();
+ rtl_TextEncoding eTargetChrSet = RTL_TEXTENCODING_MS_1252;
+ if ( eChrSet == RTL_TEXTENCODING_DONTKNOW )
+ eChrSet = gsl_getSystemTextEncoding();
+ if ( eChrSet != RTL_TEXTENCODING_SYMBOL )
+ eTargetChrSet = RTL_TEXTENCODING_SYMBOL;
+ ByteString aStr( aTemp, eChrSet, eTargetChrSet );
+ SetAttrForText();
+ WMFRecord_ExtTextOut( pA->GetPoint(), aStr,pA->GetDXArray() );
+ }
+ break;
+
+ case META_STRETCHTEXT_ACTION:
+ {
+ const MetaStretchTextAction* pA = (const MetaStretchTextAction *) pMA;
+ String aTemp( pA->GetText(), pA->GetIndex(), pA->GetLen() );
+ rtl_TextEncoding eChrSet = aSrcFont.GetCharSet();
+ rtl_TextEncoding eTargetChrSet = RTL_TEXTENCODING_MS_1252;
+ if ( eChrSet == RTL_TEXTENCODING_DONTKNOW )
+ eChrSet = gsl_getSystemTextEncoding();
+ if ( eChrSet != RTL_TEXTENCODING_SYMBOL )
+ eTargetChrSet = RTL_TEXTENCODING_SYMBOL;
+ ByteString aStr( aTemp, eChrSet, eTargetChrSet );
+ SetAttrForText();
+ WMFRecord_ExtTextOut( pA->GetPoint(),aStr,pA->GetWidth() );
+ }
+ break;
+
+ case META_BMP_ACTION:
+ {
+ const MetaBmpAction* pA = (const MetaBmpAction *) pMA;
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetBitmap().GetSizePixel(), pA->GetBitmap() );
+ }
+ break;
+
+ case META_BMPSCALE_ACTION:
+ {
+ const MetaBmpScaleAction* pA = (const MetaBmpScaleAction*) pMA;
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), pA->GetBitmap() );
+ }
+ break;
+
+ case META_BMPSCALEPART_ACTION:
+ {
+ const MetaBmpScalePartAction* pA = (const MetaBmpScalePartAction*) pMA;
+ Bitmap aTmp( pA->GetBitmap() );
+
+ if( aTmp.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) ) )
+ WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aTmp );
+ }
+
+ case META_BMPEX_ACTION:
+ {
+ const MetaBmpExAction* pA = (const MetaBmpExAction *) pMA;
+ Bitmap aBmp( pA->GetBitmapEx().GetBitmap() );
+ Bitmap aMsk( pA->GetBitmapEx().GetMask() );
+
+ if( !!aMsk )
+ {
+ aBmp.Replace( aMsk, COL_WHITE );
+ aMsk.Invert();
+ WMFRecord_StretchDIB( pA->GetPoint(), aMsk.GetSizePixel(), aBmp, W_SRCPAINT );
+ WMFRecord_StretchDIB( pA->GetPoint(), aBmp.GetSizePixel(), aBmp, W_SRCAND );
+ }
+ else
+ WMFRecord_StretchDIB( pA->GetPoint(), aBmp.GetSizePixel(), aBmp );
+ }
+ break;
+
+ case META_BMPEXSCALE_ACTION:
+ {
+ const MetaBmpExScaleAction* pA = (const MetaBmpExScaleAction*) pMA;
+ Bitmap aBmp( pA->GetBitmapEx().GetBitmap() );
+ Bitmap aMsk( pA->GetBitmapEx().GetMask() );
+
+ if( !!aMsk )
+ {
+ aBmp.Replace( aMsk, COL_WHITE );
+ aMsk.Invert();
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aMsk, W_SRCPAINT );
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aBmp, W_SRCAND );
+ }
+ else
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), aBmp );
+ }
+ break;
+
+ case META_BMPEXSCALEPART_ACTION:
+ {
+ const MetaBmpExScalePartAction* pA = (const MetaBmpExScalePartAction*) pMA;
+ BitmapEx aBmpEx( pA->GetBitmapEx() );
+ aBmpEx.Crop( Rectangle( pA->GetSrcPoint(), pA->GetSrcSize() ) );
+ Bitmap aBmp( aBmpEx.GetBitmap() );
+ Bitmap aMsk( aBmpEx.GetMask() );
+
+ if( !!aMsk )
+ {
+ aBmp.Replace( aMsk, COL_WHITE );
+ aMsk.Invert();
+ WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aMsk, W_SRCPAINT );
+ WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aBmp, W_SRCAND );
+ }
+ else
+ WMFRecord_StretchDIB( pA->GetDestPoint(), pA->GetDestSize(), aBmp );
+ }
+
+ case META_GRADIENT_ACTION:
+ {
+ const MetaGradientAction* pA = (const MetaGradientAction*) pMA;
+ GDIMetaFile aTmpMtf;
+
+ pVirDev->AddGradientActions( pA->GetRect(), pA->GetGradient(), aTmpMtf );
+ WriteRecords( aTmpMtf );
+ }
+ break;
+
+ case META_HATCH_ACTION:
+ {
+ const MetaHatchAction* pA = (const MetaHatchAction*) pMA;
+ GDIMetaFile aTmpMtf;
+
+ pVirDev->AddHatchActions( pA->GetPolyPolygon(), pA->GetHatch(), aTmpMtf );
+ WriteRecords( aTmpMtf );
+ }
+ break;
+
+ case META_WALLPAPER_ACTION:
+ {
+ const MetaWallpaperAction* pA = (const MetaWallpaperAction*) pMA;
+ const Color& rColor = pA->GetWallpaper().GetColor();
+ const Color aOldLineColor( aSrcLineColor );
+ const Color aOldFillColor( aSrcFillColor );
+
+ aSrcLineColor = rColor;
+ aSrcFillColor = rColor;
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ SetAttrForAreas();
+ WMFRecord_Rectangle( pA->GetRect() );
+ aSrcLineColor = aOldLineColor;
+ aSrcFillColor = aOldFillColor;
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ }
+ break;
+
+ case META_ISECTRECTCLIPREGION_ACTION:
+ {
+ const MetaISectRectClipRegionAction* pA = (const MetaISectRectClipRegionAction*) pMA;
+ WMFRecord_IntersectClipRect( pA->GetRect() );
+ }
+ break;
+
+ case META_LINECOLOR_ACTION:
+ {
+ const MetaLineColorAction* pA = (const MetaLineColorAction*) pMA;
+
+ if( pA->IsSetting() )
+ aSrcLineColor = pA->GetColor();
+ else
+ aSrcLineColor = Color( COL_TRANSPARENT );
+
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ }
+ break;
+
+ case META_FILLCOLOR_ACTION:
+ {
+ const MetaFillColorAction* pA = (const MetaFillColorAction*) pMA;
+
+ if( pA->IsSetting() )
+ aSrcFillColor = pA->GetColor();
+ else
+ aSrcFillColor = Color( COL_TRANSPARENT );
+
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ }
+ break;
+
+ case META_TEXTCOLOR_ACTION:
+ {
+ const MetaTextColorAction* pA = (const MetaTextColorAction*) pMA;
+ aSrcFont.SetColor( pA->GetColor() );
+ bAttrReadyForText = FALSE;
+ }
+ break;
+
+ case META_TEXTFILLCOLOR_ACTION:
+ {
+ const MetaTextFillColorAction* pA = (const MetaTextFillColorAction*) pMA;
+
+ if( pA->IsSetting() )
+ aSrcFont.SetFillColor( pA->GetColor() );
+ else
+ aSrcFont.SetFillColor( Color( COL_TRANSPARENT ) );
+
+ bAttrReadyForText = FALSE;
+ }
+ break;
+
+ case META_TEXTALIGN_ACTION:
+ {
+ const MetaTextAlignAction* pA = (const MetaTextAlignAction*) pMA;
+ WMFRecord_SetTextAlign( pA->GetTextAlign() );
+ }
+ break;
+
+
+ case META_MAPMODE_ACTION:
+ {
+ const MetaMapModeAction* pA = (const MetaMapModeAction*) pMA;
+
+ if (aSrcMapMode!=pA->GetMapMode())
+ {
+ if( pA->GetMapMode().GetMapUnit() == MAP_RELATIVE )
+ {
+ MapMode aMM = pA->GetMapMode();
+ Fraction aScaleX = aMM.GetScaleX();
+ Fraction aScaleY = aMM.GetScaleY();
+
+ Point aOrigin = aSrcMapMode.GetOrigin();
+ BigInt aX( aOrigin.X() );
+ aX *= BigInt( aScaleX.GetDenominator() );
+ if( aOrigin.X() >= 0 )
+ if( aScaleX.GetNumerator() >= 0 )
+ aX += BigInt( aScaleX.GetNumerator()/2 );
+ else
+ aX -= BigInt( (aScaleX.GetNumerator()+1)/2 );
+ else
+ if( aScaleX.GetNumerator() >= 0 )
+ aX -= BigInt( (aScaleX.GetNumerator()-1)/2 );
+ else
+ aX += BigInt( aScaleX.GetNumerator()/2 );
+ aX /= BigInt( aScaleX.GetNumerator() );
+ aOrigin.X() = (long)aX + aMM.GetOrigin().X();
+ BigInt aY( aOrigin.Y() );
+ aY *= BigInt( aScaleY.GetDenominator() );
+ if( aOrigin.Y() >= 0 )
+ if( aScaleY.GetNumerator() >= 0 )
+ aY += BigInt( aScaleY.GetNumerator()/2 );
+ else
+ aY -= BigInt( (aScaleY.GetNumerator()+1)/2 );
+ else
+ if( aScaleY.GetNumerator() >= 0 )
+ aY -= BigInt( (aScaleY.GetNumerator()-1)/2 );
+ else
+ aY += BigInt( aScaleY.GetNumerator()/2 );
+ aY /= BigInt( aScaleY.GetNumerator() );
+ aOrigin.Y() = (long)aY + aMM.GetOrigin().Y();
+ aSrcMapMode.SetOrigin( aOrigin );
+
+ aScaleX *= aSrcMapMode.GetScaleX();
+ aScaleY *= aSrcMapMode.GetScaleY();
+ aSrcMapMode.SetScaleX( aScaleX );
+ aSrcMapMode.SetScaleY( aScaleY );
+ }
+ else
+ aSrcMapMode=pA->GetMapMode();
+
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ bAttrReadyForText=FALSE;
+ bDstGraphicsInvalid=TRUE;
+ bDstTextInvalid=TRUE;
+ }
+ }
+ break;
+
+ case META_FONT_ACTION:
+ {
+ const MetaFontAction* pA = (const MetaFontAction*) pMA;
+ aSrcFont=pA->GetFont();
+ bAttrReadyForText=FALSE;
+ }
+ break;
+
+ case META_PUSH_ACTION:
+ {
+ WMFWriterAttrStackMember* pAt = new WMFWriterAttrStackMember;
+
+ pAt->aLineColor=aSrcLineColor;
+ pAt->aFillColor=aSrcFillColor;
+ pAt->eRasterOp=eSrcRasterOp;
+ pAt->aFont=aSrcFont;
+ pAt->aMapMode=aSrcMapMode;
+ pAt->aClipRegion=aSrcClipRegion;
+ pAt->pSucc=pAttrStack;
+ pAttrStack=pAt;
+
+ // Fuer das SaveDC muessen wir ggf. alle Objekte
+ // sofort selektieren, damit beim RestoreDC im ::Pop
+ // alles wieder richtig restauriert wird
+ SetAttrForLines();
+ SetAttrForAreas();
+ SetAttrForText();
+
+ // Das machen wir nur, um die ClipRegion nach einem evtl.
+ // IntersectClipRect wieder zuruecksetzen zu koennen
+ WMFRecord_SaveDC();
+ }
+ break;
+
+ case META_POP_ACTION:
+ {
+ WMFWriterAttrStackMember * pAt=pAttrStack;
+
+ if( pAt )
+ {
+ aSrcLineColor=pAt->aLineColor;
+ aSrcFillColor=pAt->aFillColor;
+ eSrcRasterOp=pAt->eRasterOp;
+ aSrcFont=pAt->aFont;
+ aSrcMapMode=pAt->aMapMode;
+ aSrcClipRegion=pAt->aClipRegion;
+ pAttrStack=pAt->pSucc;
+ delete pAt;
+
+ WMFRecord_RestoreDC();
+
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ bAttrReadyForText=FALSE;
+ bDstGraphicsInvalid=TRUE;
+ }
+ }
+ break;
+
+ case META_EPS_ACTION :
+ {
+ const MetaEPSAction* pA = (const MetaEPSAction*)pMA;
+ const GDIMetaFile aGDIMetaFile( pA->GetSubstitute() );
+
+ INT32 nCount = aGDIMetaFile.GetActionCount();
+ for ( INT32 i = 0; i < nCount; i++ )
+ {
+ const MetaAction* pMetaAct = aGDIMetaFile.GetAction( i );
+ if ( pMetaAct->GetType() == META_BMPSCALE_ACTION )
+ {
+ const MetaBmpScaleAction* pBmpScaleAction = (const MetaBmpScaleAction*)pMetaAct;
+ WMFRecord_StretchDIB( pA->GetPoint(), pA->GetSize(), pBmpScaleAction->GetBitmap() );
+ break;
+ }
+ }
+ }
+ break;
+
+ case META_RASTEROP_ACTION:
+ {
+ const MetaRasterOpAction* pA = (const MetaRasterOpAction*) pMA;
+ eSrcRasterOp=pA->GetRasterOp();
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ bAttrReadyForText=FALSE;
+ }
+ break;
+
+ case META_TRANSPARENT_ACTION:
+ {
+ SetAttrForAreas();
+ WMFRecord_PolyPolygon( ( (MetaTransparentAction*) pMA )->GetPolyPolygon() );
+ }
+ break;
+
+ case META_FLOATTRANSPARENT_ACTION:
+ {
+ const MetaFloatTransparentAction* pA = (const MetaFloatTransparentAction*) pMA;
+
+ GDIMetaFile aTmpMtf( pA->GetGDIMetaFile() );
+ Point aSrcPt( aTmpMtf.GetPrefMapMode().GetOrigin() );
+ const Size aSrcSize( aTmpMtf.GetPrefSize() );
+ const Point aDestPt( pA->GetPoint() );
+ const Size aDestSize( pA->GetSize() );
+ const double fScaleX = aSrcSize.Width() ? (double) aDestSize.Width() / aSrcSize.Width() : 1.0;
+ const double fScaleY = aSrcSize.Height() ? (double) aDestSize.Height() / aSrcSize.Height() : 1.0;
+ long nMoveX, nMoveY;
+
+ SetAttrForLines();
+ SetAttrForAreas();
+ SetAttrForText();
+
+ if( fScaleX != 1.0 || fScaleY != 1.0 )
+ {
+ aTmpMtf.Scale( fScaleX, fScaleY );
+ aSrcPt.X() = FRound( aSrcPt.X() * fScaleX ), aSrcPt.Y() = FRound( aSrcPt.Y() * fScaleY );
+ }
+
+ nMoveX = aDestPt.X() - aSrcPt.X(), nMoveY = aDestPt.Y() - aSrcPt.Y();
+
+ if( nMoveX || nMoveY )
+ aTmpMtf.Move( nMoveX, nMoveY );
+
+ WriteRecords( aTmpMtf );
+ }
+ break;
+
+ // Unsupported Actions
+ case META_MASK_ACTION:
+ case META_MASKSCALE_ACTION:
+ case META_MASKSCALEPART_ACTION:
+ {
+ DBG_ERROR( "Unsupported action: MetaMask...Action!" );
+ }
+ break;
+
+ case META_CLIPREGION_ACTION:
+ break;
+
+ case META_ISECTREGIONCLIPREGION_ACTION:
+ {
+ DBG_ERROR( "Unsupported action: MetaISectRegionClipRegionAction!" );
+ }
+ break;
+
+ case META_MOVECLIPREGION_ACTION:
+ {
+ DBG_ERROR( "Unsupported action: MetaMoveClipRegionAction!" );
+ }
+ break;
+ }
+
+ nWrittenActions++;
+ MayCallback();
+
+ if (pWMF->GetError())
+ bStatus=FALSE;
+
+ if(bStatus==FALSE)
+ break;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
+void WMFWriter::WriteHeader( const GDIMetaFile & rMTF, BOOL bPlaceable )
+{
+ if( bPlaceable )
+ {
+ USHORT nCheckSum, nValue;
+ Size aSize( pVirDev->LogicToLogic(Size(1,1),MapMode(MAP_INCH), aTargetMapMode) );
+ USHORT nUnitsPerInch = (USHORT) ( ( aSize.Width() + aSize.Height() ) >> 1 );
+
+ nCheckSum=0;
+ nValue=0xcdd7; nCheckSum^=nValue; *pWMF << nValue;
+ nValue=0x9ac6; nCheckSum^=nValue; *pWMF << nValue;
+ nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
+ nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
+ nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
+ nValue=(USHORT) aTargetSize.Width(); nCheckSum^=nValue; *pWMF << nValue;
+ nValue=(USHORT) aTargetSize.Height(); nCheckSum^=nValue; *pWMF << nValue;
+ nValue=nUnitsPerInch; nCheckSum^=nValue; *pWMF << nValue;
+ nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
+ nValue=0x0000; nCheckSum^=nValue; *pWMF << nValue;
+ *pWMF << nCheckSum;
+ }
+
+ nMetafileHeaderPos=pWMF->Tell();
+ *pWMF << (USHORT)0x0001 // Typ: Datei
+ << (USHORT)0x0009 // Headerlaenge in Worten
+ << (USHORT)0x0300 // Version als BCD-Zahl
+ << (ULONG) 0x00000000 // Dateilaenge (ohne 1. Header), wird spaeter durch UpdateHeader() berichtigt
+ << (USHORT)MAXOBJECTHANDLES // Maximalezahl der gleichzeitigen Objekte
+ << (ULONG) 0x00000000 // Maximale Record-laenge, wird spaeter durch UpdateHeader() berichtigt
+ << (USHORT)0x0000; // Reserved
+}
+
+// ------------------------------------------------------------------------
+
+void WMFWriter::UpdateHeader()
+{
+ ULONG nPos,nFileSize;
+
+ nPos=pWMF->Tell(); // Endposition = Gesammtgroesse der Datei
+ nFileSize=nPos-nMetafileHeaderPos; // Groesse des 1. Headers abziehen
+ if ((nFileSize&1)!=0) { // ggf. auf ganze Worte aufrunden
+ *pWMF << (BYTE)0;
+ nPos++;
+ nFileSize++;
+ }
+ nFileSize>>=1; // In Anzahl Worte umrechnen
+ pWMF->Seek(nMetafileHeaderPos+6); // Zum Dateigroessen-Eintrag im zweiten Header
+ *pWMF << nFileSize; // Dateigroesse berichtigen
+ pWMF->SeekRel(2); // Zum Max-Record-Laenge-Eintrag im zweiten Header
+ *pWMF << nMaxRecordSize; // und berichtigen
+ pWMF->Seek(nPos);
+}
+
+// ------------------------------------------------------------------------
+
+BOOL WMFWriter::WriteWMF(const GDIMetaFile& rMTF, SvStream& rTargetStream,
+ PFilterCallback pcallback, void* pcallerdata,
+ BOOL bPlaceable)
+{
+ WMFWriterAttrStackMember * pAt;
+
+ bStatus=TRUE;
+ pVirDev = new VirtualDevice;
+ pCallback=pcallback;
+ pCallerData=pcallerdata;
+ nLastPercent=0;
+
+ pWMF=&rTargetStream;
+ pWMF->SetNumberFormatInt(NUMBERFORMAT_INT_LITTLEENDIAN);
+
+ nMaxRecordSize=0;
+
+ aSrcMapMode=rMTF.GetPrefMapMode();
+
+ if( bPlaceable )
+ {
+ aTargetMapMode = aSrcMapMode;
+ aTargetSize = rMTF.GetPrefSize();
+ nTargetDivisor = CalcSaveTargetMapMode(aTargetMapMode, aTargetSize);
+ aTargetSize.Width() /= nTargetDivisor;
+ aTargetSize.Height() /= nTargetDivisor;
+ }
+ else
+ {
+ aTargetMapMode = MapMode( MAP_INCH );
+
+ const long nUnit = pVirDev->LogicToPixel( Size( 1, 1 ), aTargetMapMode ).Width();
+ const Fraction aFrac( 1, nUnit );
+
+ aTargetMapMode.SetScaleX( aFrac );
+ aTargetMapMode.SetScaleY( aFrac );
+ aTargetSize = pVirDev->LogicToLogic( rMTF.GetPrefSize(), aSrcMapMode, aTargetMapMode );
+ }
+
+ pVirDev->SetMapMode( aTargetMapMode );
+
+ aSrcLineColor = Color( COL_BLACK );
+ aSrcFillColor = Color( COL_WHITE );
+ eSrcRasterOp=ROP_OVERPAINT;
+ aSrcFont=Font();
+ bSrcIsClipping=FALSE;
+ aSrcClipRegion=Region();
+ pAttrStack=NULL;
+
+ aDstLineColor = Color( COL_BLACK );
+ aDstFillColor = Color( COL_WHITE );
+ eDstROP2=ROP_OVERPAINT;
+ aDstTextColor=Color(COL_BLACK);
+ eDstTextAlign=ALIGN_BASELINE;
+ aDstFont=Font();
+ bDstIsClipping=FALSE;
+ aDstClipRegion=Region();
+
+ for (USHORT i=0; i<MAXOBJECTHANDLES; i++)
+ bHandleAllocated[i]=FALSE;
+
+ nDstPenHandle=0xffff;
+ nDstFontHandle=0xffff;
+ nDstBrushHandle=0xffff;
+
+ bDstTextInvalid=TRUE;
+ bDstGraphicsInvalid=TRUE;
+
+ bAttrReadyForLines=FALSE;
+ bAttrReadyForAreas=FALSE;
+ bAttrReadyForText=FALSE;
+
+ nNumberOfActions=0;
+ nNumberOfBitmaps=0;
+ nWrittenActions=0;
+ nWrittenBitmaps=0;
+ nActBitmapPercent=0;
+
+ CountActionsAndBitmaps(rMTF);
+
+ WriteHeader(rMTF,bPlaceable);
+ WMFRecord_SetWindowOrg(Point(0,0));
+ WMFRecord_SetWindowExt(rMTF.GetPrefSize());
+ WMFRecord_SetBkMode( TRUE );
+
+ // Write records
+ WriteRecords(rMTF);
+
+ WMFRecord_EndOfFile();
+ UpdateHeader();
+
+ while(pAttrStack)
+ {
+ pAt=pAttrStack;
+ pAttrStack=pAt->pSucc;
+ delete pAt;
+ }
+
+ delete pVirDev;
+
+ return bStatus;
+}
+
+// ------------------------------------------------------------------------
+
+USHORT WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode,
+ const Size& rPrefSize)
+{
+ Fraction aDivFrac(2, 1);
+ USHORT nDivisor = 1;
+
+ Size aSize = pVirDev->LogicToLogic( rPrefSize, aSrcMapMode, rMapMode );
+
+ while( nDivisor <= 64 && (aSize.Width() > 32767 || aSize.Height() > 32767) )
+ {
+ Fraction aFrac = rMapMode.GetScaleX();
+
+ aFrac *= aDivFrac;
+ rMapMode.SetScaleX(aFrac);
+ aFrac = rMapMode.GetScaleY();
+ aFrac *= aDivFrac;
+ rMapMode.SetScaleY(aFrac);
+ nDivisor <<= 1;
+ aSize = pVirDev->LogicToLogic( rPrefSize, aSrcMapMode, rMapMode );
+ }
+
+ return nDivisor;
+}
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx
new file mode 100644
index 000000000000..1ac7603c1ba9
--- /dev/null
+++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx
@@ -0,0 +1,245 @@
+/*************************************************************************
+ *
+ * $RCSfile: wmfwr.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _WMFWR_HXX
+#define _WMFWR_HXX
+
+#include <tools/bigint.hxx>
+#include <tools/debug.hxx>
+#include <vcl/metaact.hxx>
+#include <vcl/graph.hxx>
+#include <vcl/gdimtf.hxx>
+#include <vcl/virdev.hxx>
+#include "fltcall.hxx"
+
+// -----------------------------------------------------------------------------
+
+#define MAXOBJECTHANDLES 16
+
+// -----------------------------------------------------------------------------
+
+struct WMFWriterAttrStackMember
+{
+ struct WMFWriterAttrStackMember * pSucc;
+ Color aLineColor;
+ Color aFillColor;
+ RasterOp eRasterOp;
+ Font aFont;
+ MapMode aMapMode;
+ Region aClipRegion;
+};
+
+// -------------
+// - WMFWriter -
+// -------------
+
+class WMFWriter
+{
+private:
+
+ BOOL bStatus;
+
+ PFilterCallback pCallback;
+ void* pCallerData;
+ ULONG nLastPercent; // Mit welcher Zahl pCallback zuletzt aufgerufen wurde.
+
+ SvStream* pWMF;
+ VirtualDevice* pVirDev;
+ MapMode aTargetMapMode;
+ Size aTargetSize;
+ USHORT nTargetDivisor;
+
+ ULONG nMetafileHeaderPos;
+ ULONG nMaxRecordSize; // in Worten
+ ULONG nActRecordPos;
+
+ // Aktuelle Attribute im Quell-Metafile:
+ Color aSrcLineColor;
+ Color aSrcFillColor;
+ RasterOp eSrcRasterOp;
+ Font aSrcFont;
+ MapMode aSrcMapMode;
+ BOOL bSrcIsClipping;
+ Region aSrcClipRegion;
+ WMFWriterAttrStackMember * pAttrStack;
+
+ // Aktuelle Attribute im Ziel-Metafile:
+ RasterOp eDstROP2;
+ Color aDstTextColor;
+ FontAlign eDstTextAlign;
+ Color aDstLineColor;
+ Color aDstFillColor;
+ Font aDstFont;
+ BOOL bDstIsClipping; // ???: derzeit unberuecksichtigt
+ Region aDstClipRegion; // ???: derzeit unberuecksichtigt
+ BOOL bHandleAllocated[MAXOBJECTHANDLES]; // Welche Handles vergeben sind
+ USHORT nDstPenHandle,nDstFontHandle,nDstBrushHandle; // Welche Handles die jeweiligen
+ // Selected-Objects besitzen
+ // 0xffff = keines:
+ BOOL bDstTextInvalid; // ist TRUE, wenn die Variablen aDstTextColor, eDstTextAlign
+ // und aDstFont nicht mit den Attributen im Ziel-Metafile
+ // uebereinstimmen (Das ist am Anfang der Fall)
+ BOOL bDstGraphicsInvalid; // dito fuer alle anderen Attribute
+
+ // Damit nicht bei jeder Operation alle Attribute verglichen werden muessen:
+ BOOL bAttrReadyForLines; // Ist TRUE, wenn die Attribute im Ziel-Metafile so
+ // gesetzt sind, dass Linien ausgegeben werden koennen.
+ BOOL bAttrReadyForAreas; // Ist TRUE, wenn die Attribute im Ziel-Metafile so
+ // gesetzt sind, dass gefuellte Polygone, Rechtecke etc.
+ // (einschliesslich Umrahmung) ausgegeben werden koennen.
+ BOOL bAttrReadyForText; // Ist TRUE, wenn die Attribute im Ziel-Metafile so
+ // gesetzt sind, dass Text ausgegeben werden kann.
+
+ ULONG nNumberOfActions; // Anzahl der Actions im GDIMetafile
+ ULONG nNumberOfBitmaps; // Anzahl der Bitmaps
+ ULONG nWrittenActions; // Anzahl der bereits verarbeiteten Actions beim Schreiben der Orders
+ ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
+ ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
+
+ void MayCallback();
+ // Berechnet anhand der obigen 5 Parameter eine Prozentzahl
+ // und macht dann ggf. einen Callback. Setzt bStatus auf FALSE wenn User abbrechen
+ // moechte.
+
+ void CountActionsAndBitmaps(const GDIMetaFile & rMTF);
+ // Zaehlt die Bitmaps und Actions (nNumberOfActions und nNumberOfBitmaps muessen
+ // zu Anfang auf 0 gesetzt werden, weil diese Methode rekursiv ist)
+
+ void WritePointXY(const Point & rPoint);
+ void WritePointYX(const Point & rPoint);
+ void WriteDX(long nDX);
+ void WriteSize(const Size & rSize);
+ void WriteHeightWidth(const Size & rSize);
+ void WriteRectangle(const Rectangle & rRect);
+ void WriteColor(const Color & rColor);
+
+ void WriteRecordHeader(ULONG nSizeWords, USHORT nType);
+ // nSizeWords ist die Groesse des gesammten Records in Anzahl Worte.
+ // Wenn nSizeWords unbekannt ist, dann 0 einsetzen (siehe UpdateRecordHeader()).
+
+ void UpdateRecordHeader();
+ // berichtig die Groesse des Records nach dem Schreiben der Parameter, wenn
+ // nSizeWords bei Aufruf von WriteRecordHeader(..) unbekannt war.
+ // fuegt ggf. noch ein BYTE 0 ein damit Anzahl Bytes immer gerade.
+
+ void WMFRecord_Arc(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt);
+ void WMFRecord_Chord(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt);
+ void WMFRecord_CreateBrushIndirect(const Color& rColor);
+ void WMFRecord_CreateFontIndirect(const Font & rFont);
+ void WMFRecord_CreatePenIndirect(const Color& rColor);
+ void WMFRecord_CreatePenIndirect(const Color& rColor, const LineInfo& rLineInfo );
+ void WMFRecord_DeleteObject(USHORT nObjectHandle);
+ void WMFRecord_Ellipse(const Rectangle & rRect);
+ void WMFRecord_ExtTextOut(const Point & rPoint, const ByteString & rString, const long * pDXAry);
+ void WMFRecord_ExtTextOut(const Point & rPoint, const ByteString & rString, ULONG nWidth);
+ void WMFRecord_LineTo(const Point & rPoint);
+ void WMFRecord_MoveTo(const Point & rPoint);
+ void WMFRecord_Pie(const Rectangle & rRect, const Point & rStartPt, const Point & rEndPt);
+ void WMFRecord_Polygon(const Polygon & rPoly);
+ void WMFRecord_PolyLine(const Polygon & rPoly);
+ void WMFRecord_PolyPolygon(const PolyPolygon & rPolyPoly);
+ void WMFRecord_Rectangle(const Rectangle & rRect);
+ void WMFRecord_RestoreDC();
+ void WMFRecord_RoundRect(const Rectangle & rRect, long nHorzRound, long nVertRound);
+ void WMFRecord_SaveDC();
+ void WMFRecord_SelectObject(USHORT nObjectHandle);
+ void WMFRecord_SetBkColor(const Color & rColor);
+ void WMFRecord_SetBkMode(BOOL bTransparent);
+ void WMFRecord_SetStretchBltMode();
+ void WMFRecord_SetPixel(const Point & rPoint, const Color & rColor);
+ void WMFRecord_SetROP2(RasterOp eROP);
+ void WMFRecord_SetTextAlign(FontAlign eFontAlign);
+ void WMFRecord_SetTextColor(const Color & rColor);
+ void WMFRecord_SetWindowExt(const Size & rSize);
+ void WMFRecord_SetWindowOrg(const Point & rPoint);
+ void WMFRecord_StretchDIB(const Point & rPoint, const Size & rSize, const Bitmap & rBitmap, ULONG nROP = 0UL );
+ void WMFRecord_TextOut(const Point & rPoint, const ByteString & rString);
+ void WMFRecord_EndOfFile();
+ void WMFRecord_IntersectClipRect( const Rectangle& rRect);
+
+ USHORT AllocHandle();
+ void FreeHandle(USHORT nObjectHandle);
+ void CreateSelectDeletePen(const Color& rColor);
+ void CreateSelectDeleteFont(const Font & rFont);
+ void CreateSelectDeleteBrush(const Color& rColor);
+
+ void SetAttrForLines(); // Setzt die Dst-Attribute fuer Linien
+ void SetAttrForAreas(); // Setzt die Dst-Attribute fuer gefuellte Dinge.
+ // Macht automatisch SetAttrForLines, wenn BrushStyle NULL
+ void SetAttrForText(); // Setzt die Dst-Attribute fuer Text-Ausgabe
+
+ void WriteRecords(const GDIMetaFile & rMTF);
+
+ void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable);
+ void UpdateHeader();
+
+ USHORT CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize);
+
+public:
+
+ WMFWriter() {}
+
+ BOOL WriteWMF(const GDIMetaFile & rMTF, SvStream & rTargetStream,
+ PFilterCallback pcallback, void * pcallerdata,
+ BOOL bPlaceable=TRUE);
+};
+
+#endif
diff --git a/svtools/source/items/aeitem.cxx b/svtools/source/items/aeitem.cxx
new file mode 100644
index 000000000000..aebb93af79a8
--- /dev/null
+++ b/svtools/source/items/aeitem.cxx
@@ -0,0 +1,296 @@
+/*************************************************************************
+ *
+ * $RCSfile: aeitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <tools/string.hxx>
+
+#include <svarray.hxx>
+#include "aeitem.hxx"
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxAllEnumItem);
+
+// -----------------------------------------------------------------------
+
+struct SfxAllEnumValue_Impl
+{
+ USHORT nValue;
+ XubString aText;
+};
+
+SV_DECL_PTRARR_DEL(SfxAllEnumValueArr, SfxAllEnumValue_Impl*, 0, 8);
+SV_IMPL_PTRARR(SfxAllEnumValueArr, SfxAllEnumValue_Impl*);
+
+// -----------------------------------------------------------------------
+
+SfxAllEnumItem::SfxAllEnumItem( USHORT nWhich, USHORT nVal, const XubString &rText ):
+ SfxEnumItem(nWhich, nVal),
+ pValues( 0 )
+{
+ DBG_CTOR(SfxAllEnumItem, 0);
+ InsertValue( nVal, rText );
+}
+
+// -----------------------------------------------------------------------
+
+SfxAllEnumItem::SfxAllEnumItem(USHORT nWhich, USHORT nVal):
+ SfxEnumItem(nWhich, nVal),
+ pValues( 0 )
+{
+ DBG_CTOR(SfxAllEnumItem, 0);
+ InsertValue( nVal );
+}
+
+// -----------------------------------------------------------------------
+
+SfxAllEnumItem::SfxAllEnumItem( USHORT nWhich, SvStream &rStream ):
+ SfxEnumItem(nWhich, rStream),
+ pValues( 0 )
+{
+ DBG_CTOR(SfxAllEnumItem, 0);
+ InsertValue( GetValue() );
+}
+
+// -----------------------------------------------------------------------
+
+
+SfxAllEnumItem::SfxAllEnumItem(USHORT nWhich):
+ SfxEnumItem(nWhich, 0),
+ pValues( 0 )
+{
+ DBG_CTOR(SfxAllEnumItem, 0);
+}
+
+
+// -----------------------------------------------------------------------
+
+SfxAllEnumItem::SfxAllEnumItem(const SfxAllEnumItem &rCopy):
+ SfxEnumItem(rCopy),
+ pValues(0)
+{
+ DBG_CTOR(SfxAllEnumItem, 0);
+ if ( !rCopy.pValues )
+ return;
+
+ pValues = new SfxAllEnumValueArr;
+ for ( USHORT nPos = 0; nPos < rCopy.pValues->Count(); ++nPos )
+ {
+ SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
+ pVal->nValue = rCopy.pValues->GetObject(nPos)->nValue;
+ pVal->aText = rCopy.pValues->GetObject(nPos)->aText;
+ const SfxAllEnumValue_Impl *pTemp = pVal;
+ pValues->Insert( pTemp, nPos );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+SfxAllEnumItem::~SfxAllEnumItem()
+{
+ DBG_DTOR(SfxAllEnumItem, 0);
+ delete pValues;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT SfxAllEnumItem::GetValueCount() const
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ return pValues ? pValues->Count() : 0;
+}
+
+// -----------------------------------------------------------------------
+
+XubString SfxAllEnumItem::GetValueTextByPos( USHORT nPos ) const
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ DBG_ASSERT( pValues && nPos < pValues->Count(), "enum overflow" );
+ return pValues->GetObject(nPos)->aText;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT SfxAllEnumItem::GetValueByPos( USHORT nPos ) const
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ DBG_ASSERT( pValues && nPos < pValues->Count(), "enum overflow" );
+ return pValues->GetObject(nPos)->nValue;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxAllEnumItem::Clone( SfxItemPool * ) const
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ return new SfxAllEnumItem(*this);
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxAllEnumItem::Create( SvStream & rStream, USHORT nVersion ) const
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ return new SfxAllEnumItem( Which(), rStream );
+}
+
+
+// -----------------------------------------------------------------------
+
+USHORT SfxAllEnumItem::_GetPosByValue( USHORT nVal ) const
+
+/* [Beschreibung]
+
+ Im Ggs. zu <SfxEnumItemInterface::GetPosByValue(USHORT)const> liefert
+ diese interne Methode bei nicht vorhandenen Values die Position,
+ an der der Wert liegen w"urde.
+*/
+
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+
+ if ( !pValues )
+ return 0;
+
+ //!O: binaere Suche oder SortArray verwenden
+ USHORT nPos;
+ for ( nPos = 0; nPos < pValues->Count(); ++nPos )
+ if ( pValues->GetObject(nPos)->nValue >= nVal )
+ return nPos;
+ return nPos;
+}
+
+// -----------------------------------------------------------------------
+
+USHORT SfxAllEnumItem::GetPosByValue( USHORT nValue ) const
+
+/* [Beschreibung]
+
+ Liefert im Gegensatz zu <SfxEnumItemInterface::GetPosByValue(USHORT)const>
+ immer nValue zur"uck, solange nicht mindestens ein Wert mit einer der
+ Methoden <SfxAllEnumItem::InsertValue()> eingef"ugt wurde.
+*/
+
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+
+ if ( !pValues || !pValues->Count() )
+ return nValue;
+
+ return SfxEnumItem::GetPosByValue( nValue );
+}
+
+// -----------------------------------------------------------------------
+
+void SfxAllEnumItem::InsertValue( USHORT nValue, const XubString &rValue )
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
+ pVal->nValue = nValue;
+ pVal->aText = rValue;
+ const SfxAllEnumValue_Impl *pTemp = pVal;
+ if ( !pValues )
+ pValues = new SfxAllEnumValueArr;
+ else if ( GetPosByValue( nValue ) != USHRT_MAX )
+ // remove when exists
+ RemoveValue( nValue );
+ // then insert
+ pValues->Insert( pTemp, _GetPosByValue(nValue) ); //! doppelte?!
+}
+
+// -----------------------------------------------------------------------
+
+void SfxAllEnumItem::InsertValue( USHORT nValue )
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ SfxAllEnumValue_Impl *pVal = new SfxAllEnumValue_Impl;
+ pVal->nValue = nValue;
+ pVal->aText = XubString::CreateFromInt32( nValue );
+ const SfxAllEnumValue_Impl *pTemp = pVal;
+ if ( !pValues )
+ pValues = new SfxAllEnumValueArr;
+
+ pValues->Insert( pTemp, _GetPosByValue(nValue) ); //! doppelte?!
+}
+
+// -----------------------------------------------------------------------
+
+void SfxAllEnumItem::RemoveValue( USHORT nValue )
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ USHORT nPos = GetPosByValue(nValue);
+ DBG_ASSERT( nPos != USHRT_MAX, "removing value not in enum" );
+ pValues->Remove( nPos );
+}
+
+// -----------------------------------------------------------------------
+
+
+void SfxAllEnumItem::RemoveAllValues()
+{
+ DBG_CHKTHIS(SfxAllEnumItem, 0);
+ if ( pValues )
+ pValues->DeleteAndDestroy( 0, pValues->Count() );
+}
+
+
+
diff --git a/svtools/source/items/eitem.cxx b/svtools/source/items/eitem.cxx
new file mode 100644
index 000000000000..bc3a5f84e9db
--- /dev/null
+++ b/svtools/source/items/eitem.cxx
@@ -0,0 +1,81 @@
+/*************************************************************************
+ *
+ * $RCSfile: eitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXENUMITEM_HXX
+#include <eitem.hxx>
+#endif
+//============================================================================
+//
+// class SfxEnumItem
+//
+//============================================================================
+
+TYPEINIT1(SfxEnumItem, CntEnumItem);
+
+//============================================================================
+//
+// class SfxBoolItem
+//
+//============================================================================
+
+TYPEINIT1_AUTOFACTORY(SfxBoolItem, CntBoolItem);
+
+
diff --git a/svtools/source/items/flagitem.cxx b/svtools/source/items/flagitem.cxx
new file mode 100644
index 000000000000..bfa4a816084a
--- /dev/null
+++ b/svtools/source/items/flagitem.cxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * $RCSfile: flagitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+#pragma hdrstop
+
+#include "args.hxx"
+#include "poolitem.hxx"
+#include "flagitem.hxx"
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxFlagItem);
+
+USHORT nSfxFlagVal[16] =
+{
+ 0x0001, 0x0002, 0x0004, 0x0008,
+ 0x0010, 0x0020, 0x0040, 0x0080,
+ 0x0100, 0x0200, 0x0400, 0x0800,
+ 0x1000, 0x2000, 0x4000, 0x8000
+};
+
+
+// -----------------------------------------------------------------------
+
+TYPEINIT1(SfxFlagItem, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+SfxFlagItem::SfxFlagItem( USHORT nW, USHORT nV ) :
+ SfxPoolItem( nW ),
+ nVal(nV)
+{
+ DBG_CTOR(SfxFlagItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxFlagItem::SfxFlagItem( USHORT nW, SvStream &rStream) :
+ SfxPoolItem( nW )
+{
+ DBG_CTOR(SfxFlagItem, 0);
+ rStream >> nVal;
+}
+
+// -----------------------------------------------------------------------
+
+SfxFlagItem::SfxFlagItem( const SfxFlagItem& rItem ) :
+ SfxPoolItem( rItem ),
+ nVal( rItem.nVal )
+{
+ DBG_CTOR(SfxFlagItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SvStream& SfxFlagItem::Store(SvStream &rStream, USHORT nItemVersion) const
+{
+ DBG_CHKTHIS(SfxFlagItem, 0);
+ rStream << nVal;
+ return rStream;
+}
+
+// -----------------------------------------------------------------------
+
+SfxItemPresentation SfxFlagItem::GetPresentation
+(
+ SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ XubString& rText,
+ const International *
+) const
+{
+ DBG_CHKTHIS(SfxFlagItem, 0);
+ rText.Erase();
+ for ( int nFlag = 0; nFlag < GetFlagCount(); ++nFlag )
+#ifndef ENABLEUNICODE
+ rText += String( GetFlag(nFlag) );
+#else
+ rText += UniString::CreateFromInt32( GetFlag(nFlag) );
+#endif
+ return SFX_ITEM_PRESENTATION_NAMELESS;
+}
+
+// -----------------------------------------------------------------------
+
+XubString SfxFlagItem::GetFlagText( BYTE nV ) const
+{
+ DBG_CHKTHIS(SfxFlagItem, 0);
+ DBG_WARNING( "calling GetValueText(USHORT) on SfxFlagItem -- overload!" );
+ return XubString();
+}
+
+// -----------------------------------------------------------------------
+
+
+BYTE SfxFlagItem::GetFlagCount() const
+{
+ DBG_CHKTHIS(SfxFlagItem, 0);
+ DBG_WARNING( "calling GetValueText(USHORT) on SfxFlagItem -- overload!" );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxFlagItem::Create(SvStream &rStream, USHORT nVersion) const
+{
+ DBG_CHKTHIS(SfxFlagItem, 0);
+ DBG_WARNING( "calling Create() on SfxFlagItem -- overload!" );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+int SfxFlagItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_CHKTHIS(SfxFlagItem, 0);
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
+ return (((SfxFlagItem&)rItem).nVal == nVal);
+}
+
+// -----------------------------------------------------------------------
+
+void SfxFlagItem::SetFlag( BYTE nFlag, int bVal )
+{
+ if ( bVal )
+ nVal |= nSfxFlagVal[nFlag];
+ else
+ nVal &= ~nSfxFlagVal[nFlag];
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxFlagItem::Clone(SfxItemPool *) const
+{
+ DBG_CHKTHIS(SfxFlagItem, 0);
+ return new SfxFlagItem( *this );
+}
+
+
+
+
+
diff --git a/svtools/source/items/intitem.cxx b/svtools/source/items/intitem.cxx
new file mode 100644
index 000000000000..a5db1767f543
--- /dev/null
+++ b/svtools/source/items/intitem.cxx
@@ -0,0 +1,306 @@
+/*************************************************************************
+ *
+ * $RCSfile: intitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+
+#ifndef _BIGINT_HXX
+#include <tools/bigint.hxx>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+
+#ifndef _SFXINTITEM_HXX
+#include <intitem.hxx>
+#endif
+#ifndef _SFXMETRICITEM_HXX
+#include <metitem.hxx>
+#endif
+#ifndef _SBXVAR_HXX
+#include <sbxvar.hxx>
+#endif
+
+//============================================================================
+//
+// class SfxByteItem
+//
+//============================================================================
+
+TYPEINIT1_AUTOFACTORY(SfxByteItem, CntByteItem);
+
+//============================================================================
+// virtual
+SfxPoolItem * SfxByteItem::Create(SvStream & rStream, USHORT) const
+{
+ short nValue = 0;
+ rStream >> nValue;
+ return new SfxByteItem(Which(), BYTE(nValue));
+}
+
+//============================================================================
+//
+// class SfxInt16Item
+//
+//============================================================================
+
+DBG_NAME(SfxInt16Item);
+
+//============================================================================
+TYPEINIT1_AUTOFACTORY(SfxInt16Item, SfxPoolItem);
+
+//============================================================================
+SfxInt16Item::SfxInt16Item(USHORT nWhich, SvStream & rStream):
+ SfxPoolItem(nWhich)
+{
+ DBG_CTOR(SfxInt16Item, 0);
+ short nTheValue = 0;
+ rStream >> nTheValue;
+ m_nValue = nTheValue;
+}
+
+//============================================================================
+// virtual
+int SfxInt16Item::operator ==(const SfxPoolItem & rItem) const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ DBG_ASSERT(SfxPoolItem::operator ==(rItem), "unequal type");
+ return m_nValue == SAL_STATIC_CAST(const SfxInt16Item *, &rItem)->
+ m_nValue;
+}
+
+//============================================================================
+// virtual
+int SfxInt16Item::Compare(const SfxPoolItem & rWith) const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ DBG_ASSERT(SfxPoolItem::operator ==(rWith), "unequal type");
+ return SAL_STATIC_CAST(const SfxInt16Item *, &rWith)->m_nValue
+ < m_nValue ?
+ -1 :
+ SAL_STATIC_CAST(const SfxInt16Item *, &rWith)->m_nValue
+ == m_nValue ?
+ 0 : 1;
+}
+
+//============================================================================
+// virtual
+SfxItemPresentation SfxInt16Item::GetPresentation(SfxItemPresentation,
+ SfxMapUnit, SfxMapUnit,
+ XubString & rText,
+ const International *) const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ rText = UniString::CreateFromInt32(m_nValue);
+ return SFX_ITEM_PRESENTATION_NAMELESS;
+}
+
+
+//============================================================================
+// virtual
+BOOL SfxInt16Item::QueryValue(com::sun::star::uno::Any& rVal,
+ BYTE nMemberId) const
+{
+ sal_Int16 nValue = m_nValue;
+ rVal <<= nValue;
+ return TRUE;
+}
+
+//============================================================================
+// virtual
+BOOL SfxInt16Item::PutValue(const com::sun::star::uno::Any& rVal,
+ BYTE nMemberId)
+{
+ sal_Int16 nValue;
+ if (rVal >>= nValue)
+ {
+ m_nValue = nValue;
+ return TRUE;
+ }
+
+ DBG_ERROR( "SfxInt16Item::PutValue - Wrong type!" );
+ return FALSE;
+}
+
+//============================================================================
+// virtual
+SfxPoolItem * SfxInt16Item::Create(SvStream & rStream, USHORT) const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ return new SfxInt16Item(Which(), rStream);
+}
+
+//============================================================================
+// virtual
+SvStream & SfxInt16Item::Store(SvStream & rStream, USHORT) const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ rStream << short(m_nValue);
+ return rStream;
+}
+
+//============================================================================
+SfxPoolItem * SfxInt16Item::Clone(SfxItemPool *) const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ return new SfxInt16Item(*this);
+}
+
+//============================================================================
+INT16 SfxInt16Item::GetMin() const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ return -32768;
+}
+
+//============================================================================
+INT16 SfxInt16Item::GetMax() const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ return 32767;
+}
+
+//============================================================================
+SfxFieldUnit SfxInt16Item::GetUnit() const
+{
+ DBG_CHKTHIS(SfxInt16Item, 0);
+ return SFX_FUNIT_NONE;
+}
+
+//============================================================================
+//
+// class SfxUInt16Item
+//
+//============================================================================
+
+TYPEINIT1_AUTOFACTORY(SfxUInt16Item, CntUInt16Item);
+
+
+//============================================================================
+//
+// class SfxInt32Item
+//
+//============================================================================
+
+TYPEINIT1_AUTOFACTORY(SfxInt32Item, CntInt32Item);
+
+
+//============================================================================
+//
+// class SfxUInt32Item
+//
+//============================================================================
+
+TYPEINIT1_AUTOFACTORY(SfxUInt32Item, CntUInt32Item);
+
+
+//============================================================================
+//
+// class SfxMetricItem
+//
+//============================================================================
+
+DBG_NAME(SfxMetricItem);
+
+//============================================================================
+TYPEINIT1_AUTOFACTORY(SfxMetricItem, SfxInt32Item);
+
+//============================================================================
+SfxMetricItem::SfxMetricItem(USHORT nWhich, UINT32 nValue):
+ SfxInt32Item(nWhich, nValue)
+{
+ DBG_CTOR(SfxMetricItem, 0);
+}
+
+//============================================================================
+SfxMetricItem::SfxMetricItem(USHORT nWhich, SvStream & rStream):
+ SfxInt32Item(nWhich, rStream)
+{
+ DBG_CTOR(SfxMetricItem, 0);
+}
+
+//============================================================================
+SfxMetricItem::SfxMetricItem(const SfxMetricItem & rItem):
+ SfxInt32Item(rItem)
+{
+ DBG_CTOR(SfxMetricItem, 0);
+}
+
+//============================================================================
+// virtual
+int SfxMetricItem::ScaleMetrics(long nMult, long nDiv)
+{
+ BigInt aTheValue(GetValue());
+ aTheValue *= nMult;
+ aTheValue += nDiv / 2;
+ aTheValue /= nDiv;
+ SetValue(aTheValue);
+ return 1;
+}
+
+//============================================================================
+// virtual
+int SfxMetricItem::HasMetrics() const
+{
+ return 1;
+}
+
diff --git a/svtools/source/items/itemdel.cxx b/svtools/source/items/itemdel.cxx
new file mode 100644
index 000000000000..d3acda749a45
--- /dev/null
+++ b/svtools/source/items/itemdel.cxx
@@ -0,0 +1,175 @@
+/*************************************************************************
+ *
+ * $RCSfile: itemdel.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:00 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _ERRCODE_HXX //autogen
+#include <tools/errcode.hxx>
+#endif
+#include <limits.h>
+
+#include <sbx.hxx>
+
+#include "svtdata.hxx"
+#include "svarray.hxx"
+#include "args.hxx"
+#include "itempool.hxx"
+#include "itemdel.hxx"
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxItemDesruptor_Impl);
+
+// -----------------------------------------------------------------------
+
+class SfxItemDesruptor_Impl
+{
+ SfxPoolItem *pItem;
+ Link aLink;
+
+private:
+ DECL_LINK( Delete, void * );
+ SfxItemDesruptor_Impl( const SfxItemDesruptor_Impl& ); // n.i.
+
+public:
+ SfxItemDesruptor_Impl( SfxPoolItem *pItemToDesrupt );
+ ~SfxItemDesruptor_Impl();
+};
+
+SV_DECL_PTRARR( SfxItemDesruptorList_Impl, SfxItemDesruptor_Impl*, 4, 4 );
+
+// ------------------------------------------------------------------------
+SfxItemDesruptor_Impl::SfxItemDesruptor_Impl( SfxPoolItem *pItemToDesrupt ):
+ pItem(pItemToDesrupt),
+ aLink( LINK(this, SfxItemDesruptor_Impl, Delete) )
+{
+ DBG_CTOR(SfxItemDesruptor_Impl, 0);
+
+ pItem->SetRef( SFX_ITEMS_DELETEONIDLE );
+
+ // im Idle abarbeiten
+ GetpApp()->InsertIdleHdl( aLink, 1 );
+
+ // und in Liste eintragen (damit geflusht werden kann)
+ SfxItemDesruptorList_Impl* &rpList
+ = ImpSvtData::GetSvtData().pItemDesruptList;
+ if ( !rpList )
+ rpList = new SfxItemDesruptorList_Impl;
+ const SfxItemDesruptor_Impl *pThis = this;
+ rpList->Insert( pThis, rpList->Count() );
+}
+
+// ------------------------------------------------------------------------
+SfxItemDesruptor_Impl::~SfxItemDesruptor_Impl()
+{
+ DBG_DTOR(SfxItemDesruptor_Impl, 0);
+
+ // aus Idle-Handler austragen
+ GetpApp()->RemoveIdleHdl( aLink );
+
+ // und aus Liste austragen
+ SfxItemDesruptorList_Impl* &rpList
+ = ImpSvtData::GetSvtData().pItemDesruptList;
+ DBG_ASSERT( rpList, "no DesruptorList" );
+ const SfxItemDesruptor_Impl *pThis = this;
+ if ( rpList ) HACK(warum?)
+ rpList->Remove( rpList->GetPos(pThis) );
+
+ // Item l"oschen
+ pItem->SetRef( 0 );
+ DBG_CHKOBJ( pItem, SfxPoolItem, 0 );
+ DBG_ASSERT( 0 == pItem->GetRef(), "desrupting pooled item" );
+ delete pItem;
+}
+
+// ------------------------------------------------------------------------
+IMPL_LINK( SfxItemDesruptor_Impl, Delete, void *, pvoid )
+{
+ {DBG_CHKTHIS(SfxItemDesruptor_Impl, 0);}
+ delete this;
+ return 0;
+}
+
+// ------------------------------------------------------------------------
+SfxPoolItem* DeleteItemOnIdle( SfxPoolItem* pItem )
+{
+ DBG_ASSERT( 0 == pItem->GetRef(), "deleting item in use" );
+ new SfxItemDesruptor_Impl( pItem );
+ return pItem;
+}
+
+// ------------------------------------------------------------------------
+void DeleteOnIdleItems()
+{
+ SfxItemDesruptorList_Impl* &rpList
+ = ImpSvtData::GetSvtData().pItemDesruptList;
+ if ( rpList )
+ {
+ USHORT n;
+ while ( 0 != ( n = rpList->Count() ) )
+ // Remove ist implizit im Dtor
+ delete rpList->GetObject( n-1 );
+ DELETEZ(rpList);
+ }
+}
+
+
diff --git a/svtools/source/items/macitem.cxx b/svtools/source/items/macitem.cxx
new file mode 100644
index 000000000000..17c831ad167c
--- /dev/null
+++ b/svtools/source/items/macitem.cxx
@@ -0,0 +1,395 @@
+/*************************************************************************
+ *
+ * $RCSfile: macitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#pragma hdrstop
+#define ITEMID_MACRO 0
+
+#include "macitem.hxx"
+#include <segmentc.hxx>
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SvxMacroItem);
+
+SEG_EOFGLOBALS()
+
+// -----------------------------------------------------------------------
+
+TYPEINIT1_AUTOFACTORY(SvxMacroItem, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+
+SjJSbxObjectBase::~SjJSbxObjectBase()
+{
+}
+
+SjJSbxObjectBase* SjJSbxObjectBase::Clone( void )
+{
+ return NULL;
+}
+
+SvxMacro::SvxMacro( const String &rMacName, const String &rLanguage)
+ : aMacName( rMacName ), aLibName( rLanguage),
+ pFunctionObject(NULL), eType( EXTENDED_STYPE)
+{
+ if (rLanguage.EqualsAscii(SVX_MACRO_LANGUAGE_STARBASIC))
+ eType=STARBASIC;
+ else if (rLanguage.EqualsAscii(SVX_MACRO_LANGUAGE_JAVASCRIPT))
+ eType=JAVASCRIPT;
+}
+
+
+SvxMacro::~SvxMacro()
+{
+ delete pFunctionObject;
+}
+
+String SvxMacro::GetLanguage()const
+{
+ if(eType==STARBASIC)
+ {
+ return UniString::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_STARBASIC));
+ }
+ else if(eType==JAVASCRIPT)
+ {
+ return UniString::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM(SVX_MACRO_LANGUAGE_JAVASCRIPT));
+ }
+
+ return aLibName;
+}
+
+
+
+SvxMacro& SvxMacro::operator=( const SvxMacro& rBase )
+{
+ if( this != &rBase )
+ {
+ aMacName = rBase.aMacName;
+ aLibName = rBase.aLibName;
+ delete pFunctionObject;
+ pFunctionObject = rBase.pFunctionObject ? rBase.pFunctionObject->Clone() : NULL;
+ eType = rBase.eType;
+ }
+ return *this;
+}
+
+
+#pragma SEG_FUNCDEF(macitem_02)
+
+SvxMacroTableDtor& SvxMacroTableDtor::operator=( const SvxMacroTableDtor& rTbl )
+{
+ DelDtor();
+ SvxMacro* pTmp = ((SvxMacroTableDtor&)rTbl).First();
+ while( pTmp )
+ {
+ SvxMacro *pNew = new SvxMacro( *pTmp );
+ Insert( rTbl.GetCurKey(), pNew );
+ pTmp = ((SvxMacroTableDtor&)rTbl).Next();
+ }
+ return *this;
+}
+
+#pragma SEG_FUNCDEF(macitem_03)
+
+SvStream& SvxMacroTableDtor::Read( SvStream& rStrm, USHORT nVersion )
+{
+ if( SVX_MACROTBL_VERSION40 <= nVersion )
+ rStrm >> nVersion;
+ short nMacro;
+ rStrm >> nMacro;
+
+ for( short i = 0; i < nMacro; ++i )
+ {
+ USHORT nCurKey, eType = STARBASIC;
+ String aLibName, aMacName;
+ rStrm >> nCurKey;
+ SfxPoolItem::readByteString(rStrm, aLibName);
+ SfxPoolItem::readByteString(rStrm, aMacName);
+
+ if( SVX_MACROTBL_VERSION40 <= nVersion )
+ rStrm >> eType;
+
+ SvxMacro* pNew = new SvxMacro( aMacName, aLibName, (ScriptType)eType );
+
+ SvxMacro *pOld = Get( nCurKey );
+ if( pOld )
+ {
+ delete pOld;
+ Replace( nCurKey, pNew );
+ }
+ else
+ Insert( nCurKey, pNew );
+ }
+ return rStrm;
+}
+
+#pragma SEG_FUNCDEF(macitem_04)
+
+SvStream& SvxMacroTableDtor::Write( SvStream& rStream ) const
+{
+ USHORT nVersion = SOFFICE_FILEFORMAT_31 == rStream.GetVersion()
+ ? SVX_MACROTBL_VERSION31
+ : SVX_MACROTBL_AKTVERSION;
+
+ if( SVX_MACROTBL_VERSION40 <= nVersion )
+ rStream << nVersion;
+
+ rStream << (USHORT)Count();
+
+ SvxMacro* pMac = ((SvxMacroTableDtor*)this)->First();
+ while( pMac && rStream.GetError() == SVSTREAM_OK )
+ {
+ rStream << (short)GetCurKey();
+ SfxPoolItem::writeByteString(rStream, pMac->GetLibName());
+ SfxPoolItem::writeByteString(rStream, pMac->GetMacName());
+
+ if( SVX_MACROTBL_VERSION40 <= nVersion )
+ rStream << (USHORT)pMac->GetScriptType();
+ pMac = ((SvxMacroTableDtor*)this)->Next();
+ }
+ return rStream;
+}
+
+// -----------------------------------------------------------------------
+#pragma SEG_FUNCDEF(macitem_05)
+
+void SvxMacroTableDtor::DelDtor()
+{
+ SvxMacro* pTmp = First();
+ while( pTmp )
+ {
+ delete pTmp;
+ pTmp = Next();
+ }
+ Clear();
+}
+
+// -----------------------------------------------------------------------
+#pragma SEG_FUNCDEF(macitem_06)
+
+int SvxMacroItem::operator==( const SfxPoolItem& rAttr ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==(rAttr), "unequal types" );
+
+ const SvxMacroTableDtor& rOwn = aMacroTable;
+ const SvxMacroTableDtor& rOther = ( (SvxMacroItem&) rAttr ).aMacroTable;
+
+ // Anzahl unterschiedlich => auf jeden Fall ungleich
+ if ( rOwn.Count() != rOther.Count() )
+ return FALSE;
+
+ // einzeln verleichen; wegen Performance ist die Reihenfolge wichtig
+ for ( USHORT nNo = 0; nNo < rOwn.Count(); ++nNo )
+ {
+ const SvxMacro *pOwnMac = rOwn.GetObject(nNo);
+ const SvxMacro *pOtherMac = rOther.GetObject(nNo);
+ if ( rOwn.GetKey(pOwnMac) != rOther.GetKey(pOtherMac) ||
+ pOwnMac->GetLibName() != pOtherMac->GetLibName() ||
+ pOwnMac->GetMacName() != pOtherMac->GetMacName() )
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+#pragma SEG_FUNCDEF(macitem_07)
+
+SfxPoolItem* SvxMacroItem::Clone( SfxItemPool* ) const
+{
+ return new SvxMacroItem( *this );
+}
+
+//------------------------------------------------------------------------
+#pragma SEG_FUNCDEF(macitem_08)
+
+SfxItemPresentation SvxMacroItem::GetPresentation
+(
+ SfxItemPresentation ePres,
+ SfxMapUnit eCoreUnit,
+ SfxMapUnit ePresUnit,
+ XubString& rText,
+ const International *
+) const
+{
+/*!!!
+ SvxMacroTableDtor& rTbl = (SvxMacroTableDtor&)GetMacroTable();
+ SvxMacro* pMac = rTbl.First();
+
+ while ( pMac )
+ {
+ rText += pMac->GetLibName();
+ rText += cpDelim;
+ rText += pMac->GetMacName();
+ pMac = rTbl.Next();
+ if ( pMac )
+ rText += cpDelim;
+ }
+*/
+ rText.Erase();
+ return SFX_ITEM_PRESENTATION_NONE;
+}
+
+// -----------------------------------------------------------------------
+#pragma SEG_FUNCDEF(macitem_09)
+
+SvStream& SvxMacroItem::Store( SvStream& rStrm , USHORT nItemVersion ) const
+{
+ return aMacroTable.Write( rStrm );
+}
+
+// -----------------------------------------------------------------------
+#pragma SEG_FUNCDEF(macitem_0a)
+
+SfxPoolItem* SvxMacroItem::Create( SvStream& rStrm, USHORT nVersion ) const
+{
+ SvxMacroItem* pAttr = new SvxMacroItem( Which() );
+ pAttr->aMacroTable.Read( rStrm, nVersion );
+ return pAttr;
+}
+
+// -----------------------------------------------------------------------
+#pragma SEG_FUNCDEF(macitem_0b)
+
+void SvxMacroItem::SetMacro( USHORT nEvent, const SvxMacro& rMacro )
+{
+ SvxMacro *pMacro;
+ if ( 0 != (pMacro=aMacroTable.Get(nEvent)) )
+ {
+ delete pMacro;
+ aMacroTable.Replace(nEvent, new SvxMacro( rMacro ) );
+ }
+ else
+ aMacroTable.Insert(nEvent, new SvxMacro( rMacro ) );
+}
+
+// -----------------------------------------------------------------------
+#pragma SEG_FUNCDEF(macitem_0c)
+
+USHORT SvxMacroItem::GetVersion( USHORT nFileFormatVersion ) const
+{
+ return SOFFICE_FILEFORMAT_31 == nFileFormatVersion
+ ? 0 : aMacroTable.GetVersion();
+}
+
+/*------------------------------------------------------------------------
+
+ $Log: not supported by cvs2svn $
+ Revision 1.15 2000/09/18 14:13:34 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.14 2000/08/31 13:41:28 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.13 2000/04/12 08:01:39 sb
+ Adapted to Unicode.
+
+ Revision 1.12 2000/02/09 16:23:32 hr
+ #70473# changes for unicode ( patched by automated patchtool )
+
+ Revision 1.11 1999/09/01 06:52:36 sb
+ #66082# Added International param to SfxPoolItem::GetPresentation().
+
+ Revision 1.10 1998/07/23 11:54:38 ANK
+ #53261# SvxMacro- Konstruktor geaendert setzt jetzt auch eType
+
+
+ Rev 1.9 23 Jul 1998 13:54:38 ANK
+ #53261# SvxMacro- Konstruktor geaendert setzt jetzt auch eType
+
+ Rev 1.8 08 Jul 1998 16:06:16 MIB
+ Get(JavaScript|StarBasic)String
+
+ Rev 1.7 27 May 1998 19:33:56 ANK
+ neuer Konstruktor fuer SvxMacro
+
+ Rev 1.6 15 May 1998 19:42:42 ANK
+ neue Fkt SvxMacro::GetLanguage
+
+ Rev 1.5 19 Jan 1998 19:18:06 MH
+ chg: header
+
+ Rev 1.4 04 Mar 1997 12:36:00 WP
+ WTC Anpassungen verallgemeinert
+
+ Rev 1.3 05 Feb 1997 14:55:24 AB
+ SvxMacro geaendert
+
+ Rev 1.2 06 Dec 1996 14:39:18 TRI
+ WTC Anpassung
+
+ Rev 1.1 05 Dec 1996 10:28:12 JP
+ GetScripType -> GetScriptType
+
+ Rev 1.0 03 Dec 1996 19:39:56 JP
+ Initial revision.
+
+------------------------------------------------------------------------*/
+
+#pragma SEG_EOFMODULE
+
diff --git a/svtools/source/items/makefile.mk b/svtools/source/items/makefile.mk
new file mode 100644
index 000000000000..19c14890907f
--- /dev/null
+++ b/svtools/source/items/makefile.mk
@@ -0,0 +1,176 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PROJECTPCH=items
+PROJECTPCHSOURCE=items
+
+PRJNAME=SVTOOLS
+TARGET=items
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+UNOUCRDEP=$(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/applicat.rdb
+# Every source directory generates headers in a own output directory to
+# enable parallel building of the source directories within a project!
+UNOUCROUT=$(OUT)$/inc$/$(PRJNAME)$/$(TARGET)
+INCPRE+=$(UNOUCROUT)
+
+UNOTYPES=\
+ com.sun.star.awt.Point \
+ com.sun.star.awt.Rectangle \
+ com.sun.star.awt.Size \
+ com.sun.star.beans.PropertyAttribute \
+ com.sun.star.beans.PropertyState \
+ com.sun.star.beans.XPropertySetInfo \
+ com.sun.star.chaos.ContentType \
+ com.sun.star.chaos.MenuDescriptor \
+ com.sun.star.chaos.MenuItemDescriptor \
+ com.sun.star.chaos.WallPaper \
+ com.sun.star.container.XNameAccess \
+ com.sun.star.container.XNameContainer \
+ com.sun.star.io.XActiveDataControl \
+ com.sun.star.io.XActiveDataSource \
+ com.sun.star.io.XOutputStream \
+ com.sun.star.lang.IllegalArgumentException \
+ com.sun.star.lang.XMultiServiceFactory\
+ com.sun.star.lang.XTypeProvider\
+ com.sun.star.lang.XServiceInfo\
+ com.sun.star.lang.XUnoTunnel\
+ com.sun.star.ucb.TransferResult \
+ com.sun.star.uno.TypeClass \
+ com.sun.star.uno.XAggregation \
+ com.sun.star.uno.XInterface \
+ com.sun.star.uno.XWeak \
+ com.sun.star.util.DateTime \
+ com.sun.star.util.DateTimeRange
+
+# --- Files --------------------------------------------------------
+
+.IF "$(header)" == ""
+
+LIB2TARGET=$(SLB)$/items1.lib
+LIB2OBJFILES=\
+ $(SLO)$/bintitem.obj \
+ $(SLO)$/cenumitm.obj \
+ $(SLO)$/cintitem.obj \
+ $(SLO)$/cntcmpmn.obj \
+ $(SLO)$/cntwall.obj \
+ $(SLO)$/cstitem.obj \
+ $(SLO)$/ctypeitm.obj \
+ $(SLO)$/custritm.obj \
+ $(SLO)$/dateitem.obj \
+ $(SLO)$/dtritem.obj \
+ $(SLO)$/frqitem.obj \
+ $(SLO)$/itemiter.obj \
+ $(SLO)$/itempool.obj \
+ $(SLO)$/itemprop.obj \
+ $(SLO)$/itemset.obj \
+ $(SLO)$/lckbitem.obj \
+ $(SLO)$/poolio.obj \
+ $(SLO)$/poolitem.obj \
+ $(SLO)$/sfontitm.obj \
+ $(SLO)$/sitem.obj \
+ $(SLO)$/slstitm.obj \
+ $(SLO)$/tfrmitem.obj \
+ $(SLO)$/tresitem.obj \
+ $(SLO)$/whiter.obj
+
+LIB3TARGET=$(SLB)$/items2.lib
+LIB3OBJFILES=\
+ $(SLO)$/aeitem.obj \
+ $(SLO)$/args.obj \
+ $(SLO)$/compat.obj \
+ $(SLO)$/eitem.obj \
+ $(SLO)$/flagitem.obj \
+ $(SLO)$/intitem.obj \
+ $(SLO)$/itemdel.obj \
+ $(SLO)$/macitem.obj \
+ $(SLO)$/poolcach.obj \
+ $(SLO)$/ptitem.obj \
+ $(SLO)$/rectitem.obj \
+ $(SLO)$/rngitem.obj \
+ $(SLO)$/stritem.obj \
+ $(SLO)$/style.obj \
+ $(SLO)$/szitem.obj \
+ $(SLO)$/wallitem.obj
+
+SLOFILES=\
+ $(LIB2OBJFILES) \
+ $(LIB3OBJFILES)
+
+.ENDIF
+
+SRCFILES=\
+ cstitem.src
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/items/poolcach.cxx b/svtools/source/items/poolcach.cxx
new file mode 100644
index 000000000000..d50edbf56614
--- /dev/null
+++ b/svtools/source/items/poolcach.cxx
@@ -0,0 +1,186 @@
+/*************************************************************************
+ *
+ * $RCSfile: poolcach.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <limits.h>
+
+#pragma hdrstop
+
+#include "itempool.hxx"
+#include "itemset.hxx"
+#include "poolcach.hxx"
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxItemPoolCache);
+
+
+//------------------------------------------------------------------------
+
+struct SfxItemModifyImpl
+{
+ const SfxSetItem *pOrigItem;
+ SfxSetItem *pPoolItem;
+};
+
+SV_DECL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl, 8, 8 );
+SV_IMPL_VARARR( SfxItemModifyArr_Impl, SfxItemModifyImpl);
+
+//------------------------------------------------------------------------
+
+SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool,
+ const SfxPoolItem *pPutItem ):
+ pPool(pItemPool),
+ pCache(new SfxItemModifyArr_Impl),
+ pItemToPut( &pItemPool->Put(*pPutItem) ),
+ pSetToPut( 0 )
+{
+ DBG_CTOR(SfxItemPoolCache, 0);
+ DBG_ASSERT(pItemPool, "kein Pool angegeben");
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPoolCache::SfxItemPoolCache( SfxItemPool *pItemPool,
+ const SfxItemSet *pPutSet ):
+ pPool(pItemPool),
+ pCache(new SfxItemModifyArr_Impl),
+ pItemToPut( 0 ),
+ pSetToPut( pPutSet )
+{
+ DBG_CTOR(SfxItemPoolCache, 0);
+ DBG_ASSERT(pItemPool, "kein Pool angegeben");
+}
+
+//------------------------------------------------------------------------
+
+SfxItemPoolCache::~SfxItemPoolCache()
+{
+ DBG_DTOR(SfxItemPoolCache, 0);
+ for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos ) {
+ pPool->Remove( *(*pCache)[nPos].pPoolItem );
+ pPool->Remove( *(*pCache)[nPos].pOrigItem );
+ }
+ delete pCache; pCache = 0;
+
+ if ( pItemToPut )
+ pPool->Remove( *pItemToPut );
+}
+
+//------------------------------------------------------------------------
+
+const SfxSetItem& SfxItemPoolCache::ApplyTo( const SfxSetItem &rOrigItem, BOOL bNew )
+{
+ DBG_CHKTHIS(SfxItemPoolCache, 0);
+ DBG_ASSERT( pPool == rOrigItem.GetItemSet().GetPool(), "invalid Pool" );
+ DBG_ASSERT( IsDefaultItem( &rOrigItem ) || IsPooledItem( &rOrigItem ),
+ "original not in pool" );
+
+ // Suchen, ob diese Transformations schon einmal vorkam
+ for ( USHORT nPos = 0; nPos < pCache->Count(); ++nPos )
+ {
+ SfxItemModifyImpl &rMapEntry = (*pCache)[nPos];
+ if ( rMapEntry.pOrigItem == &rOrigItem )
+ {
+ // aendert sich ueberhaupt etwas?
+ if ( rMapEntry.pPoolItem != &rOrigItem )
+ {
+ rMapEntry.pPoolItem->AddRef(2); // einen davon fuer den Cache
+ if ( bNew )
+ pPool->Put( rOrigItem ); //! AddRef??
+ }
+ return *rMapEntry.pPoolItem;
+ }
+ }
+
+ // die neue Attributierung in einem neuen Set eintragen
+ SfxSetItem *pNewItem = (SfxSetItem *)rOrigItem.Clone();
+ if ( pItemToPut )
+ {
+ pNewItem->GetItemSet().PutDirect( *pItemToPut );
+ DBG_ASSERT( &pNewItem->GetItemSet().Get( pItemToPut->Which() ) == pItemToPut,
+ "wrong item in temporary set" );
+ }
+ else
+ pNewItem->GetItemSet().Put( *pSetToPut );
+ const SfxSetItem* pNewPoolItem = (const SfxSetItem*) &pPool->Put( *pNewItem );
+ DBG_ASSERT( pNewPoolItem != pNewItem, "Pool: rein == raus?" );
+ delete pNewItem;
+
+ // Refernzzaehler anpassen, je einen davon fuer den Cache
+ pNewPoolItem->AddRef( pNewPoolItem != &rOrigItem ? 2 : 1 );
+ if ( bNew )
+ pPool->Put( rOrigItem ); //! AddRef??
+
+ // die Transformation im Cache eintragen
+ SfxItemModifyImpl aModify;
+ aModify.pOrigItem = &rOrigItem;
+ aModify.pPoolItem = (SfxSetItem*) pNewPoolItem;
+ pCache->Insert( aModify, pCache->Count() );
+
+ DBG_ASSERT( !pItemToPut ||
+ &pNewPoolItem->GetItemSet().Get( pItemToPut->Which() ) == pItemToPut,
+ "wrong item in resulting set" );
+
+ return *pNewPoolItem;
+}
+
+
+
diff --git a/svtools/source/items/ptitem.cxx b/svtools/source/items/ptitem.cxx
new file mode 100644
index 000000000000..158ac4b6954a
--- /dev/null
+++ b/svtools/source/items/ptitem.cxx
@@ -0,0 +1,204 @@
+/*************************************************************************
+ *
+ * $RCSfile: ptitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_AWT_POINT_HPP_
+#include <com/sun/star/awt/Point.hpp>
+#endif
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#include "sbx.hxx"
+#include "args.hxx"
+#include "poolitem.hxx"
+#include "ptitem.hxx"
+#include "memberid.hrc"
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxPointItem);
+
+
+// -----------------------------------------------------------------------
+
+TYPEINIT1_AUTOFACTORY(SfxPointItem, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+SfxPointItem::SfxPointItem()
+{
+ DBG_CTOR(SfxPointItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxPointItem::SfxPointItem( USHORT nW, const Point& rVal ) :
+ SfxPoolItem( nW ),
+ aVal( rVal )
+{
+ DBG_CTOR(SfxPointItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxPointItem::SfxPointItem( USHORT nW, SvStream &rStream ) :
+ SfxPoolItem( nW )
+{
+ DBG_CTOR(SfxPointItem, 0);
+ rStream >> aVal;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPointItem::SfxPointItem( const SfxPointItem& rItem ) :
+ SfxPoolItem( rItem ),
+ aVal( rItem.aVal )
+{
+ DBG_CTOR(SfxPointItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxItemPresentation SfxPointItem::GetPresentation
+(
+ SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ XubString& rText,
+ const International *
+) const
+{
+ DBG_CHKTHIS(SfxPointItem, 0);
+ rText = UniString::CreateFromInt32(aVal.X());
+ rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ rText += UniString::CreateFromInt32(aVal.Y());
+ rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ return SFX_ITEM_PRESENTATION_NAMELESS;
+}
+
+// -----------------------------------------------------------------------
+
+int SfxPointItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_CHKTHIS(SfxPointItem, 0);
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
+ return ((SfxPointItem&)rItem).aVal == aVal;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxPointItem::Clone(SfxItemPool *) const
+{
+ DBG_CHKTHIS(SfxPointItem, 0);
+ return new SfxPointItem( *this );
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxPointItem::Create(SvStream &rStream, USHORT nVersion ) const
+{
+ DBG_CHKTHIS(SfxPointItem, 0);
+ Point aStr;
+ rStream >> aStr;
+ return new SfxPointItem(Which(), aStr);
+}
+
+// -----------------------------------------------------------------------
+
+SvStream& SfxPointItem::Store(SvStream &rStream, USHORT nItemVersion) const
+{
+ DBG_CHKTHIS(SfxPointItem, 0);
+ rStream << aVal;
+ return rStream;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxPointItem::QueryValue( com::sun::star::uno::Any& rVal,
+ BYTE nMemberId ) const
+{
+ rVal <<= com::sun::star::awt::Point( aVal.getX(), aVal.getY() );
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxPointItem::PutValue( const com::sun::star::uno::Any& rVal,
+ BYTE nMemberId )
+{
+ BOOL bRet = FALSE;
+ com::sun::star::awt::Point aValue;
+ if ( rVal >>= aValue )
+ {
+ aVal.setX( aValue.X );
+ aVal.setY( aValue.Y );
+ bRet = TRUE;
+ }
+ return bRet;
+}
+
+
+
diff --git a/svtools/source/items/rectitem.cxx b/svtools/source/items/rectitem.cxx
new file mode 100644
index 000000000000..7d143e90ff61
--- /dev/null
+++ b/svtools/source/items/rectitem.cxx
@@ -0,0 +1,211 @@
+/*************************************************************************
+ *
+ * $RCSfile: rectitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_AWT_RECTANGLE_HPP_
+#include <com/sun/star/awt/Rectangle.hpp>
+#endif
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#include "sbx.hxx"
+#include "args.hxx"
+#include "poolitem.hxx"
+#include "rectitem.hxx"
+#include "memberid.hrc"
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxRectangleItem);
+
+
+// -----------------------------------------------------------------------
+
+TYPEINIT1_AUTOFACTORY(SfxRectangleItem, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+SfxRectangleItem::SfxRectangleItem()
+{
+ DBG_CTOR(SfxRectangleItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxRectangleItem::SfxRectangleItem( USHORT nW, const Rectangle& rVal ) :
+ SfxPoolItem( nW ),
+ aVal( rVal )
+{
+ DBG_CTOR(SfxRectangleItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxRectangleItem::SfxRectangleItem( USHORT nW, SvStream &rStream ) :
+ SfxPoolItem( nW )
+{
+ DBG_CTOR(SfxRectangleItem, 0);
+ rStream >> aVal;
+}
+
+// -----------------------------------------------------------------------
+
+SfxRectangleItem::SfxRectangleItem( const SfxRectangleItem& rItem ) :
+ SfxPoolItem( rItem ),
+ aVal( rItem.aVal )
+{
+ DBG_CTOR(SfxRectangleItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxItemPresentation SfxRectangleItem::GetPresentation
+(
+ SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ XubString& rText,
+ const International *
+) const
+{
+ DBG_CHKTHIS(SfxRectangleItem, 0);
+ rText = UniString::CreateFromInt32(aVal.Top());
+ rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ rText += UniString::CreateFromInt32(aVal.Left());
+ rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ rText += UniString::CreateFromInt32(aVal.Bottom());
+ rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ rText += UniString::CreateFromInt32(aVal.Right());
+ return SFX_ITEM_PRESENTATION_NAMELESS;
+}
+
+// -----------------------------------------------------------------------
+
+int SfxRectangleItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_CHKTHIS(SfxRectangleItem, 0);
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
+ return ((SfxRectangleItem&)rItem).aVal == aVal;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxRectangleItem::Clone(SfxItemPool *) const
+{
+ DBG_CHKTHIS(SfxRectangleItem, 0);
+ return new SfxRectangleItem( *this );
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxRectangleItem::Create(SvStream &rStream, USHORT nVersion ) const
+{
+ DBG_CHKTHIS(SfxRectangleItem, 0);
+ Rectangle aStr;
+ rStream >> aStr;
+ return new SfxRectangleItem(Which(), aStr);
+}
+
+// -----------------------------------------------------------------------
+
+SvStream& SfxRectangleItem::Store(SvStream &rStream, USHORT nItemVersion) const
+{
+ DBG_CHKTHIS(SfxRectangleItem, 0);
+ rStream << aVal;
+ return rStream;
+}
+
+
+// -----------------------------------------------------------------------
+BOOL SfxRectangleItem::QueryValue( com::sun::star::uno::Any& rVal,
+ BYTE nMemberId) const
+{
+ rVal <<= com::sun::star::awt::Rectangle( aVal.getX(),
+ aVal.getY(),
+ aVal.getWidth(),
+ aVal.getHeight() );
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+BOOL SfxRectangleItem::PutValue( const com::sun::star::uno::Any& rVal,
+ BYTE nMemberId )
+{
+ BOOL bRet = FALSE;
+ com::sun::star::awt::Rectangle aValue;
+ if ( rVal >>= aValue )
+ {
+ aVal.setX( aValue.X );
+ aVal.setY( aValue.Y );
+ aVal.setWidth( aValue.Width );
+ aVal.setHeight( aValue.Height );
+ bRet = TRUE;
+ }
+ return bRet;
+}
+
+
+
diff --git a/svtools/source/items/rngitem.cxx b/svtools/source/items/rngitem.cxx
new file mode 100644
index 000000000000..c59640318186
--- /dev/null
+++ b/svtools/source/items/rngitem.cxx
@@ -0,0 +1,383 @@
+/*************************************************************************
+ *
+ * $RCSfile: rngitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#pragma hdrstop
+
+#ifndef NUMTYPE
+
+#include "rngitem.hxx"
+#include "sbx.hxx"
+#include "args.hxx"
+
+#if SUPD<355
+DBG_NAME(SfxRangeItem);
+#endif
+
+
+#define NUMTYPE USHORT
+#define SfxXRangeItem SfxRangeItem
+#define SfxXRangesItem SfxUShortRangesItem
+#include "rngitem.cxx"
+
+#define NUMTYPE ULONG
+#define SfxXRangeItem SfxULongRangeItem
+#define SfxXRangesItem SfxULongRangesItem
+#include "rngitem.cxx"
+
+#else
+
+static inline NUMTYPE Count_Impl(const NUMTYPE * pRanges)
+{
+ NUMTYPE nCount = 0;
+ for (; *pRanges; pRanges += 2) nCount += 2;
+ return nCount;
+}
+
+// -----------------------------------------------------------------------
+
+TYPEINIT1_AUTOFACTORY(SfxXRangeItem, SfxPoolItem);
+TYPEINIT1_AUTOFACTORY(SfxXRangesItem, SfxPoolItem);
+
+NUMTYPE Count_Impl( const NUMTYPE *pRanges );
+
+// -----------------------------------------------------------------------
+
+SfxXRangeItem::SfxXRangeItem()
+{
+ nFrom = 0;
+ nTo = 0;
+}
+
+// -----------------------------------------------------------------------
+
+SfxXRangeItem::SfxXRangeItem( USHORT nWhich, NUMTYPE from, NUMTYPE to ):
+ SfxPoolItem( nWhich ),
+ nFrom( from ),
+ nTo( to )
+{
+}
+
+
+// -----------------------------------------------------------------------
+
+SfxXRangeItem::SfxXRangeItem( USHORT nW, SvStream &rStream ) :
+ SfxPoolItem( nW )
+{
+ rStream >> nFrom;
+ rStream >> nTo;
+}
+
+// -----------------------------------------------------------------------
+
+SfxXRangeItem::SfxXRangeItem( const SfxXRangeItem& rItem ) :
+ SfxPoolItem( rItem )
+{
+ nFrom = rItem.nFrom;
+ nTo = rItem.nTo;
+}
+
+// -----------------------------------------------------------------------
+
+SfxItemPresentation SfxXRangeItem::GetPresentation
+(
+ SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ XubString& rText,
+ const International *
+) const
+{
+ rText = UniString::CreateFromInt64(nFrom);
+ rText += ':';
+ rText += UniString::CreateFromInt64(nTo);
+ return SFX_ITEM_PRESENTATION_NAMELESS;
+}
+
+// -----------------------------------------------------------------------
+
+int SfxXRangeItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
+ SfxXRangeItem* pT = (SfxXRangeItem*)&rItem;
+ if( nFrom==pT->nFrom && nTo==pT->nTo )
+ return 1;
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxXRangeItem::Clone(SfxItemPool *) const
+{
+ return new SfxXRangeItem( Which(), nFrom, nTo );
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxXRangeItem::Create(SvStream &rStream, USHORT nVersion ) const
+{
+ NUMTYPE nVon, nBis;
+ rStream >> nVon;
+ rStream >> nBis;
+ return new SfxXRangeItem( Which(), nVon, nBis );
+}
+
+// -----------------------------------------------------------------------
+
+SvStream& SfxXRangeItem::Store(SvStream &rStream, USHORT nItemVersion) const
+{
+ rStream << nFrom;
+ rStream << nTo;
+ return rStream;
+}
+
+//=========================================================================
+
+SfxXRangesItem::SfxXRangesItem()
+: _pRanges(0)
+{
+}
+
+//-------------------------------------------------------------------------
+
+SfxXRangesItem::SfxXRangesItem( USHORT nWID, const NUMTYPE *pRanges )
+: SfxPoolItem( nWID )
+{
+ NUMTYPE nCount = Count_Impl(pRanges) + 1;
+ _pRanges = new NUMTYPE[nCount];
+ memcpy( _pRanges, pRanges, sizeof(NUMTYPE) * nCount );
+}
+
+//-------------------------------------------------------------------------
+
+SfxXRangesItem::SfxXRangesItem( USHORT nWID, SvStream &rStream )
+: SfxPoolItem( nWID )
+{
+ NUMTYPE nCount;
+ rStream >> nCount;
+ _pRanges = new NUMTYPE[nCount + 1];
+ for ( NUMTYPE n = 0; n < nCount; ++n )
+ rStream >> _pRanges[n];
+ _pRanges[nCount] = 0;
+}
+
+//-------------------------------------------------------------------------
+
+SfxXRangesItem::SfxXRangesItem( const SfxXRangesItem& rItem )
+: SfxPoolItem( rItem )
+{
+ NUMTYPE nCount = Count_Impl(rItem._pRanges) + 1;
+ _pRanges = new NUMTYPE[nCount];
+ memcpy( _pRanges, rItem._pRanges, sizeof(NUMTYPE) * nCount );
+}
+
+//-------------------------------------------------------------------------
+
+SfxXRangesItem::~SfxXRangesItem()
+{
+ delete _pRanges;
+}
+
+//-------------------------------------------------------------------------
+
+int SfxXRangesItem::operator==( const SfxPoolItem &rItem ) const
+{
+ const SfxXRangesItem &rOther = (const SfxXRangesItem&) rItem;
+ if ( !_pRanges && !rOther._pRanges )
+ return TRUE;
+ if ( _pRanges || rOther._pRanges )
+ return FALSE;
+
+ NUMTYPE n;
+ for ( n = 0; _pRanges[n] && rOther._pRanges[n]; ++n )
+ if ( *_pRanges != rOther._pRanges[n] )
+ return 0;
+
+ return !_pRanges[n] && !rOther._pRanges[n];
+}
+
+//-------------------------------------------------------------------------
+
+SfxItemPresentation SfxXRangesItem::GetPresentation( SfxItemPresentation ePres,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresMetric,
+ XubString &rText,
+ const International * ) const
+{
+ HACK(n. i.)
+ return SFX_ITEM_PRESENTATION_NONE;
+}
+
+//-------------------------------------------------------------------------
+
+SfxPoolItem* SfxXRangesItem::Clone( SfxItemPool *pPool ) const
+{
+ return new SfxXRangesItem( *this );
+}
+
+//-------------------------------------------------------------------------
+
+SfxPoolItem* SfxXRangesItem::Create( SvStream &rStream, USHORT nVersion ) const
+{
+ return new SfxXRangesItem( Which(), rStream );
+}
+
+//-------------------------------------------------------------------------
+
+SvStream& SfxXRangesItem::Store( SvStream &rStream, USHORT nItemVersion ) const
+{
+ NUMTYPE nCount = Count_Impl( _pRanges );
+ rStream >> nCount;
+ for ( NUMTYPE n = 0; _pRanges[n]; ++n )
+ rStream >> _pRanges[n];
+ return rStream;
+}
+
+
+/*------------------------------------------------------------------------
+
+ $Log: not supported by cvs2svn $
+ Revision 1.24 2000/09/18 14:13:35 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.23 2000/08/31 13:41:28 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.22 2000/05/26 16:38:31 os
+ Set/FillVariable removed
+
+ Revision 1.21 2000/04/12 08:01:39 sb
+ Adapted to Unicode.
+
+ Revision 1.20 2000/02/09 16:23:50 hr
+ #70473# changes for unicode ( patched by automated patchtool )
+
+ Revision 1.19 1999/09/27 12:16:04 hr
+ for-scope
+
+ Revision 1.18 1999/09/08 15:35:16 sb
+ #66082# Copied Count_Impl from nranges.cxx.
+
+ Revision 1.17 1999/09/01 06:52:36 sb
+ #66082# Added International param to SfxPoolItem::GetPresentation().
+
+ Revision 1.16 1998/01/09 11:17:06 MH
+ chg: header
+
+
+ Rev 1.15 09 Jan 1998 12:17:06 MH
+ chg: header
+
+ Rev 1.14 05 Mar 1997 13:44:56 MI
+ falsche Var verwendet daher op== falsch
+
+ Rev 1.13 03 Feb 1997 10:00:14 MI
+ Typeinfo fuer Ranges
+
+ Rev 1.12 03 Feb 1997 09:13:22 MI
+ NUMTYPE durch USHORT ersetzt
+
+ Rev 1.11 02 Feb 1997 16:46:32 MI
+ compilebar
+
+ Rev 1.10 02 Feb 1997 13:29:24 MI
+ jetzt auch Sfx..RangesItem (mehrere Ranges)
+
+ Rev 1.9 02 Feb 1997 12:23:56 MI
+ jetzt auch LongRange
+
+ Rev 1.8 14 Nov 1996 18:49:12 MI
+ FileFirmat 4.0
+
+ Rev 1.7 14 Mar 1996 17:40:46 MH
+ del: S_VERSION
+
+ Rev 1.6 12 Mar 1996 12:49:42 OV
+ ein fehlendes DBG_CTOR eingefuegt
+
+ Rev 1.5 21 Nov 1995 15:50:52 MI
+ FillVariable fuer strukturierte Items
+
+ Rev 1.4 20 Nov 1995 15:44:20 AB
+ Unicode-Anpassung
+
+ Rev 1.3 15 Nov 1995 20:16:36 MI
+ GetVariable/SetVariable
+
+ Rev 1.2 05 Jul 1995 18:11:38 MI
+ GetValueText raus #pragmas rein
+
+ Rev 1.1 29 Jun 1995 17:16:30 MI
+ GetPresentation impl.
+
+ Rev 1.0 22 Feb 1995 16:26:28 OV
+ Initial revision.
+
+------------------------------------------------------------------------*/
+#undef NUMTYPE
+#undef SfxXRangeItem
+#undef SfxXRangesItem
+
+
+#endif
+
diff --git a/svtools/source/items/stritem.cxx b/svtools/source/items/stritem.cxx
new file mode 100644
index 000000000000..0829221cc1db
--- /dev/null
+++ b/svtools/source/items/stritem.cxx
@@ -0,0 +1,106 @@
+/*************************************************************************
+ *
+ * $RCSfile: stritem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SFXSTRITEM_HXX
+#include <stritem.hxx>
+#endif
+
+//============================================================================
+//
+// class SfxStringItem
+//
+//============================================================================
+
+TYPEINIT1_AUTOFACTORY(SfxStringItem, CntUnencodedStringItem)
+
+//============================================================================
+// virtual
+SfxStringItem::SfxStringItem(USHORT nWhich, SvStream & rStream):
+ CntUnencodedStringItem(nWhich)
+{
+ UniString aValue;
+ readByteString(rStream, aValue);
+ SetValue(aValue);
+}
+
+
+//============================================================================
+// virtual
+SfxPoolItem * SfxStringItem::Create(SvStream & rStream, USHORT) const
+{
+ return new SfxStringItem(Which(), rStream);
+}
+
+//============================================================================
+// virtual
+SvStream & SfxStringItem::Store(SvStream & rStream, USHORT) const
+{
+ writeByteString(rStream, GetValue());
+ return rStream;
+}
+
+//============================================================================
+// virtual
+SfxPoolItem * SfxStringItem::Clone(SfxItemPool *) const
+{
+ return new SfxStringItem(*this);
+}
+
diff --git a/svtools/source/items/style.cxx b/svtools/source/items/style.cxx
new file mode 100644
index 000000000000..f62020536731
--- /dev/null
+++ b/svtools/source/items/style.cxx
@@ -0,0 +1,1201 @@
+/*************************************************************************
+ *
+ * $RCSfile: style.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#pragma hdrstop
+
+#include <smplhint.hxx>
+#include <poolitem.hxx>
+#include <itemset.hxx>
+#include <itempool.hxx>
+#include <poolio.hxx>
+#include <filerec.hxx>
+#include <itemiter.hxx>
+#include "style.hxx"
+
+#define STYLESTREAM "SfxStyleSheets"
+#define STYLESTREAM_VERSION USHORT(50)
+
+
+
+TYPEINIT0(SfxStyleSheetBase)
+
+TYPEINIT3(SfxStyleSheet, SfxStyleSheetBase, SfxListener, SfxBroadcaster)
+
+
+//=========================================================================
+
+TYPEINIT1(SfxStyleSheetHint, SfxHint);
+TYPEINIT1(SfxStyleSheetHintExtended, SfxStyleSheetHint);
+TYPEINIT1(SfxStyleSheetPoolHint, SfxHint);
+
+SfxStyleSheetHintExtended::SfxStyleSheetHintExtended
+(
+ USHORT nAction, // SFX_STYLESHEET_... (s.o.)
+ const String& rOldName,
+ SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer
+)
+: SfxStyleSheetHint( nAction, rStyleSheet ),
+ aName( rOldName )
+{}
+
+//-------------------------------------------------------------------------
+
+SfxStyleSheetHint::SfxStyleSheetHint
+(
+ USHORT nAction, // SFX_STYLESHEET_... (s.o.)
+ SfxStyleSheetBase& rStyleSheet // geh"ort weiterhin dem Aufrufer
+)
+: pStyleSh( &rStyleSheet ),
+ nHint( nAction )
+{}
+
+//=========================================================================
+
+class SfxStyleSheetBasePool_Impl
+{
+ public:
+ SfxStyles aStyles;
+ SfxStyleSheetIterator *pIter;
+ SfxStyleSheetBasePool_Impl() : pIter(0){}
+ ~SfxStyleSheetBasePool_Impl(){delete pIter;}
+};
+
+
+//////////////////////////// SfxStyleSheetBase ///////////////////////////////
+
+// Konstruktoren
+
+SfxStyleSheetBase::SfxStyleSheetBase
+ ( const XubString& rName, SfxStyleSheetBasePool& r, SfxStyleFamily eFam, USHORT mask )
+ : aName( rName ), aParent(), aFollow( rName ),
+ nFamily( eFam ), nMask(mask), rPool( r ),
+ nHelpId( 0 ), pSet( NULL ), bMySet( FALSE )
+{
+}
+
+SfxStyleSheetBase::SfxStyleSheetBase( const SfxStyleSheetBase& r )
+ : aName( r.aName ), aParent( r.aParent ), aFollow( r.aFollow ),
+ nFamily( r.nFamily ),
+ nMask( r.nMask ),
+ rPool( r.rPool ),
+ nHelpId( r.nHelpId ), aHelpFile( r.aHelpFile ), bMySet( r.bMySet )
+{
+ if( r.pSet )
+ pSet = bMySet ? new SfxItemSet( *r.pSet ) : r.pSet;
+ else
+ pSet = NULL;
+}
+
+SfxStyleSheetBase::~SfxStyleSheetBase()
+{
+ if( bMySet )
+ {
+ delete pSet;
+ pSet = 0;
+ }
+}
+
+USHORT SfxStyleSheetBase::GetVersion() const
+{
+ return 0x0000;
+}
+
+// Namen aendern
+
+const XubString& SfxStyleSheetBase::GetName() const
+{
+ return aName;
+}
+
+BOOL SfxStyleSheetBase::SetName( const XubString& rName )
+{
+ if(rName.Len() == 0)
+ return FALSE;
+ if( aName != rName )
+ {
+ String aOldName = aName;
+ SfxStyleSheetBase *pOther = rPool.Find( rName, nFamily ) ;
+ if ( pOther && pOther != this )
+ return FALSE;
+
+ SfxStyleFamily eTmpFam=rPool.GetSearchFamily();
+ USHORT nTmpMask=rPool.GetSearchMask();
+
+ rPool.SetSearchMask(nFamily);
+
+ if ( aName.Len() )
+ rPool.ChangeParent( aName, rName, FALSE );
+ if ( aFollow.Equals( aName ) )
+ aFollow = rName;
+ aName = rName;
+ rPool.SetSearchMask(eTmpFam, nTmpMask);
+ rPool.Broadcast( SfxStyleSheetHintExtended(
+ SFX_STYLESHEET_MODIFIED, aOldName, *this ) );
+ }
+ return TRUE;
+}
+
+// Parent aendern
+
+const XubString& SfxStyleSheetBase::GetParent() const
+{
+ return aParent;
+}
+
+BOOL SfxStyleSheetBase::SetParent( const XubString& rName )
+{
+ if( aParent != rName )
+ {
+ SfxStyleSheetBase* pIter = rPool.Find(rName, nFamily);
+ if( rName.Len() && !pIter )
+ {
+ DBG_ERROR( "StyleSheet-Parent nicht gefunden" );
+ return FALSE;
+ }
+ // rekursive Verknuepfungen verhindern
+ if( aName.Len() )
+ while(pIter)
+ {
+ if(pIter->GetName() == aName && aName != rName)
+ return FALSE;
+ pIter = rPool.Find(pIter->GetParent(), nFamily);
+ }
+ aParent = rName;
+ }
+ rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) );
+ return TRUE;
+}
+
+// Follow aendern
+
+const XubString& SfxStyleSheetBase::GetFollow() const
+{
+ return aFollow;
+}
+
+BOOL SfxStyleSheetBase::SetFollow( const XubString& rName )
+{
+ if( aFollow != rName )
+ {
+ if( !rPool.Find( rName, nFamily ) )
+ {
+ DBG_ERROR( "StyleSheet-Follow nicht gefunden" );
+ return FALSE;
+ }
+ aFollow = rName;
+ }
+ rPool.Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_MODIFIED, *this ) );
+ return TRUE;
+}
+
+// Itemset setzen. Die Dflt-Implementation legt ein neues Set an.
+
+SfxItemSet& SfxStyleSheetBase::GetItemSet()
+{
+ if( !pSet )
+ {
+ pSet = new SfxItemSet( rPool.GetPool() );
+ bMySet = TRUE;
+ }
+ return *pSet;
+}
+
+// Hilfe-Datei und -ID setzen und abfragen
+
+ULONG SfxStyleSheetBase::GetHelpId( String& rFile )
+{
+ rFile = aHelpFile;
+ return nHelpId;
+}
+
+void SfxStyleSheetBase::SetHelpId( const String& rFile, ULONG nId )
+{
+ aHelpFile = rFile;
+ nHelpId = nId;
+}
+
+// Folgevorlage m"oglich? Default: Ja
+
+BOOL SfxStyleSheetBase::HasFollowSupport() const
+{
+ return TRUE;
+}
+
+// Basisvorlage m"oglich? Default: Ja
+
+BOOL SfxStyleSheetBase::HasParentSupport() const
+{
+ return TRUE;
+}
+
+// Basisvorlage uf NULL setzen m"oglich? Default: Nein
+
+BOOL SfxStyleSheetBase::HasClearParentSupport() const
+{
+ return FALSE;
+}
+
+// Defaultmaessig sind alle StyleSheets Used
+
+BOOL SfxStyleSheetBase::IsUsed() const
+{
+ return TRUE;
+}
+
+// eingestellte Attribute ausgeben
+
+
+XubString SfxStyleSheetBase::GetDescription()
+{
+#if SUPD >= 368
+ return GetDescription( SFX_MAPUNIT_CM );
+
+/*!!!
+ if ( !pSet )
+ GetItemSet();
+ SfxItemIter aIter( *pSet );
+ XubString aDesc;
+ const SfxPoolItem* pItem = aIter.FirstItem();
+
+ while ( pItem )
+ {
+ XubString aItemPresentation;
+
+ if ( !IsInvalidItem( pItem ) &&
+ rPool.GetPool().GetPresentation(
+ *pItem, SFX_ITEM_PRESENTATION_COMPLETE,
+ SFX_MAPUNIT_CM, aItemPresentation ) )
+ {
+ if ( aDesc.Len() && aItemPresentation.Len() )
+#ifndef ENABLEUNICODE
+ aDesc += " + ";
+#else
+ aDesc += L" + ";
+#endif
+ if ( aItemPresentation.Len() )
+ aDesc += aItemPresentation;
+ }
+ pItem = aIter.NextItem();
+ }
+ return aDesc;
+*/
+}
+
+// eingestellte Attribute ausgeben
+
+XubString SfxStyleSheetBase::GetDescription( SfxMapUnit eMetric )
+{
+#endif
+ SfxItemIter aIter( GetItemSet() );
+ XubString aDesc;
+ const SfxPoolItem* pItem = aIter.FirstItem();
+
+ while ( pItem )
+ {
+ XubString aItemPresentation;
+
+#if SUPD >= 368
+ if ( !IsInvalidItem( pItem ) &&
+ rPool.GetPool().GetPresentation(
+ *pItem, SFX_ITEM_PRESENTATION_COMPLETE,
+ eMetric, aItemPresentation ) )
+#else
+ if ( !IsInvalidItem( pItem ) &&
+ rPool.GetPool().GetPresentation(
+ *pItem, SFX_ITEM_PRESENTATION_COMPLETE,
+ SFX_MAPUNIT_CM, aItemPresentation ) )
+#endif
+ {
+ if ( aDesc.Len() && aItemPresentation.Len() )
+ aDesc.AppendAscii(RTL_CONSTASCII_STRINGPARAM(" + "));
+ if ( aItemPresentation.Len() )
+ aDesc += aItemPresentation;
+ }
+ pItem = aIter.NextItem();
+ }
+ return aDesc;
+}
+
+/////////////////////////// SfxStyleSheetIterator ///////////////////////////////
+
+SfxStyleFamily SfxStyleSheetIterator::GetSearchFamily() const
+{
+ return nSearchFamily;
+}
+
+inline BOOL SfxStyleSheetIterator::IsTrivialSearch()
+{
+ return nMask == 0xFFFF && GetSearchFamily() == SFX_STYLE_FAMILY_ALL;
+}
+
+BOOL SfxStyleSheetIterator::DoesStyleMatch(SfxStyleSheetBase *pStyle)
+{
+ return ((GetSearchFamily() == SFX_STYLE_FAMILY_ALL) ||
+ ( pStyle->GetFamily() == GetSearchFamily() ))
+ && (( pStyle->GetMask() & ( GetSearchMask() & ~SFXSTYLEBIT_USED )) ||
+ ( bSearchUsed ? pStyle->IsUsed() : FALSE ) ||
+ GetSearchMask() == SFXSTYLEBIT_ALL );
+}
+
+
+SfxStyleSheetIterator::SfxStyleSheetIterator(SfxStyleSheetBasePool *pBase,
+ SfxStyleFamily eFam, USHORT n)
+{
+ pBasePool=pBase;
+ nSearchFamily=eFam;
+ bSearchUsed=FALSE;
+ int nn=SFXSTYLEBIT_USED;
+ int nnn=SFXSTYLEBIT_ALL;
+ if((n != SFXSTYLEBIT_ALL ) && ((n & SFXSTYLEBIT_USED) == SFXSTYLEBIT_USED))
+ {
+ bSearchUsed = TRUE;
+ n &= ~SFXSTYLEBIT_USED;
+ }
+ nMask=n;
+}
+
+SfxStyleSheetIterator::~SfxStyleSheetIterator()
+{
+}
+
+
+USHORT SfxStyleSheetIterator::Count()
+{
+ USHORT n = 0;
+ if( IsTrivialSearch())
+ n = (USHORT) pBasePool->aStyles.Count();
+ else
+ for(USHORT i=0; i<pBasePool->aStyles.Count(); i++)
+ {
+ SfxStyleSheetBase* pStyle = pBasePool->aStyles.GetObject(i);
+ if(DoesStyleMatch(pStyle))
+ n++;
+ }
+ return n;
+}
+
+SfxStyleSheetBase* SfxStyleSheetIterator::operator[](USHORT nIdx)
+{
+ if( IsTrivialSearch())
+ return pBasePool->aStyles.GetObject(nIdx);
+
+ USHORT z = 0;
+ for(USHORT n=0; n<pBasePool->aStyles.Count(); n++)
+ {
+ SfxStyleSheetBase* pStyle = pBasePool->aStyles.GetObject(n);
+ if( DoesStyleMatch(pStyle))
+ {
+ if(z == nIdx)
+ {
+ nAktPosition=n;
+ return pAktStyle=pStyle;
+ }
+ ++z;
+ }
+ }
+ DBG_ERROR("falscher Index");
+ return 0;
+}
+
+SfxStyleSheetBase* SfxStyleSheetIterator::First()
+{
+ INT32 nIdx = -1;
+
+ if ( IsTrivialSearch() && pBasePool->aStyles.Count() )
+ nIdx = 0;
+ else
+ for( USHORT n = 0; n < pBasePool->aStyles.Count(); n++ )
+ {
+ SfxStyleSheetBase* pStyle = pBasePool->aStyles.GetObject(n);
+
+ if ( DoesStyleMatch( pStyle ) )
+ {
+ nIdx = n;
+ break;
+ }
+ }
+
+ if ( nIdx != -1 )
+ {
+ nAktPosition = (USHORT)nIdx;
+ return pAktStyle = pBasePool->aStyles.GetObject(nIdx);
+ }
+ return 0;
+}
+
+
+SfxStyleSheetBase* SfxStyleSheetIterator::Next()
+{
+ INT32 nIdx = -1;
+
+ if ( IsTrivialSearch() &&
+ (USHORT)pBasePool->aStyles.Count() > nAktPosition + 1 )
+ nIdx = nAktPosition + 1;
+ else
+ for( USHORT n = nAktPosition + 1; n < pBasePool->aStyles.Count(); n++ )
+ {
+ SfxStyleSheetBase* pStyle = pBasePool->aStyles.GetObject(n);
+
+ if ( DoesStyleMatch( pStyle ) )
+ {
+ nIdx = n;
+ break;
+ }
+ }
+
+ if ( nIdx != -1 )
+ {
+ nAktPosition = (USHORT)nIdx;
+ return pAktStyle = pBasePool->aStyles.GetObject(nIdx);
+ }
+ return 0;
+}
+
+
+SfxStyleSheetBase* SfxStyleSheetIterator::Find(const XubString& rStr)
+{
+ for ( USHORT n = 0; n < pBasePool->aStyles.Count(); n++ )
+ {
+ SfxStyleSheetBase* pStyle = pBasePool->aStyles.GetObject(n);
+
+ if ( DoesStyleMatch( pStyle ) &&
+ pStyle->GetName().Equals( rStr ) )
+ {
+ nAktPosition = n;
+ return pAktStyle = pStyle;
+ }
+ }
+ return 0;
+}
+
+
+USHORT SfxStyleSheetIterator::GetSearchMask() const
+{
+ USHORT mask = nMask;
+
+ if ( bSearchUsed )
+ mask |= SFXSTYLEBIT_USED;
+ return mask;
+}
+
+/////////////////////////// SfxStyleSheetBasePool ///////////////////////////////
+
+
+void SfxStyleSheetBasePool::Replace(
+ SfxStyleSheetBase& rSource, SfxStyleSheetBase& rTarget )
+{
+ rTarget.SetFollow( rSource.GetFollow() );
+ rTarget.SetParent( rSource.GetParent() );
+ SfxItemSet& rSourceSet = rSource.GetItemSet();
+ SfxItemSet& rTargetSet = rTarget.GetItemSet();
+ rTargetSet.Intersect( rSourceSet );
+ rTargetSet.Put( rSourceSet );
+}
+
+SfxStyleSheetIterator& SfxStyleSheetBasePool::GetIterator_Impl()
+{
+ SfxStyleSheetIterator*& rpIter = pImp->pIter;
+ if( !rpIter || rpIter->GetSearchMask() != nMask ||
+ rpIter->GetSearchFamily() != nSearchFamily )
+ {
+ delete rpIter;
+#if SUPD > 363
+ rpIter = CreateIterator( nSearchFamily, nMask );
+#else
+ rpIter = new SfxStyleSheetIterator( this, nSearchFamily, nMask );
+#endif
+ }
+ return *rpIter;
+}
+
+
+SfxStyleSheetBasePool::SfxStyleSheetBasePool( SfxItemPool& r )
+: rPool(r), aAppName(r.GetName()),
+ nMask(0xFFFF), nSearchFamily(SFX_STYLE_FAMILY_PARA)
+{
+ pImp = new SfxStyleSheetBasePool_Impl;
+}
+
+SfxStyleSheetBasePool::SfxStyleSheetBasePool( const SfxStyleSheetBasePool& r )
+: rPool(r.rPool),
+ nMask( r.nMask ), nSearchFamily(r.nSearchFamily),aAppName(r.aAppName)
+{
+ pImp = new SfxStyleSheetBasePool_Impl;
+ *this += r;
+}
+
+SfxStyleSheetBasePool::~SfxStyleSheetBasePool()
+{
+ Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
+ Clear();
+ delete pImp;
+}
+
+BOOL SfxStyleSheetBasePool::SetParent(SfxStyleFamily eFam, const XubString& rStyle, const XubString& rParent)
+{
+ SfxStyleSheetIterator aIter(this,eFam,SFXSTYLEBIT_ALL);
+ SfxStyleSheetBase *pStyle =
+ aIter.Find(rStyle);
+ DBG_ASSERT(pStyle, "Vorlage nicht gefunden. Writer mit Solar <2541??");
+ if(pStyle)
+ return pStyle->SetParent(rParent);
+ else
+ return FALSE;
+}
+
+
+void SfxStyleSheetBasePool::SetSearchMask(SfxStyleFamily eFam, USHORT n)
+{
+ nSearchFamily = eFam; nMask = n;
+}
+
+USHORT SfxStyleSheetBasePool::GetSearchMask() const
+{
+ return nMask;
+}
+
+
+// Der Name des Streams
+
+String SfxStyleSheetBasePool::GetStreamName()
+{
+ return String::CreateFromAscii(RTL_CONSTASCII_STRINGPARAM(STYLESTREAM));
+}
+
+/////////////////////////////////// Factory ////////////////////////////////
+
+
+#if SUPD > 363
+
+SfxStyleSheetIterator* SfxStyleSheetBasePool::CreateIterator
+(
+ SfxStyleFamily eFam,
+ USHORT mask
+)
+{
+ return new SfxStyleSheetIterator(this,eFam,mask);
+}
+
+#endif
+
+SfxStyleSheetBase* SfxStyleSheetBasePool::Create
+(
+ const XubString& rName,
+ SfxStyleFamily eFam,
+ USHORT mask
+)
+{
+ return new SfxStyleSheetBase( rName, *this, eFam, mask );
+}
+
+SfxStyleSheetBase* SfxStyleSheetBasePool::Create( const SfxStyleSheetBase& r )
+{
+ return new SfxStyleSheetBase( r );
+}
+
+SfxStyleSheetBase& SfxStyleSheetBasePool::Make( const XubString& rName,
+ SfxStyleFamily eFam, USHORT mask, USHORT nPos)
+{
+ DBG_ASSERT( eFam != SFX_STYLE_FAMILY_ALL, "FamilyAll als Familie nicht erlaubt" );
+
+ SfxStyleSheetIterator aIter(this, eFam, mask);
+ SfxStyleSheetBase* p = aIter.Find( rName );
+ DBG_ASSERT( !p, "StyleSheet bereits vorhanden" );
+ SfxStyleSheetIterator& rIter = GetIterator_Impl();
+
+ if( !p )
+ {
+ p = Create( rName, eFam, mask );
+ if(0xffff == nPos || nPos == aStyles.Count() ||
+ nPos == rIter.Count())
+ aStyles.Insert( p, aStyles.Count() );
+ else
+ {
+ rIter[nPos];
+ aStyles.Insert(p, rIter.GetPos());
+ }
+ Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) );
+ }
+ return *p;
+}
+
+/////////////////////////////// Kopieren ///////////////////////////////////
+
+// Hilfsroutine: Falls eine Vorlage dieses Namens existiert, wird
+// sie neu erzeugt. Alle Vorlagen, die diese Vorlage zum Parent haben,
+// werden umgehaengt.
+
+SfxStyleSheetBase& SfxStyleSheetBasePool::Add( SfxStyleSheetBase& rSheet )
+{
+ SfxStyleSheetIterator aIter(this, rSheet.GetFamily(), nMask);
+ SfxStyleSheetBase* pOld = aIter.Find( rSheet.GetName() );
+ Erase( pOld );
+ SfxStyleSheetBase* pNew = Create( rSheet );
+ aStyles.Insert( pNew, aStyles.Count() );
+ Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CHANGED, *pNew ) );
+ return *pNew;
+}
+
+SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator=( const SfxStyleSheetBasePool& r )
+{
+ if( &r != this )
+ {
+ Clear();
+ *this += r;
+ }
+ return *this;
+}
+
+SfxStyleSheetBasePool& SfxStyleSheetBasePool::operator+=( const SfxStyleSheetBasePool& rP )
+{
+ if( &rP != this )
+ {
+ // kopieren
+ SfxStyleSheetBasePool& r = (SfxStyleSheetBasePool&) rP;
+ for( SfxStyleSheetBase* p = r.aStyles.First(); p; p = r.aStyles.Next() )
+ Add(*p);
+
+ }
+ return *this;
+}
+
+//////////////////////////////// Suchen ////////////////////////////////////
+
+USHORT SfxStyleSheetBasePool::Count()
+{
+ return GetIterator_Impl().Count();
+}
+
+SfxStyleSheetBase *SfxStyleSheetBasePool::operator[](USHORT nIdx)
+{
+ return GetIterator_Impl()[nIdx];
+}
+
+SfxStyleSheetBase* SfxStyleSheetBasePool::Find(const XubString& rName,
+ SfxStyleFamily eFam,
+ USHORT mask)
+{
+ SfxStyleSheetIterator aIter(this,eFam,mask);
+ return aIter.Find(rName);
+}
+
+SfxStyleSheetBase* SfxStyleSheetBasePool::First()
+{
+ return GetIterator_Impl().First();
+}
+
+SfxStyleSheetBase* SfxStyleSheetBasePool::Next()
+{
+ return GetIterator_Impl().Next();
+}
+
+//////////////////////////////// Loeschen /////////////////////////////////
+
+SfxStyleSheetBase* SfxStyleSheetBasePool::Remove( SfxStyleSheetBase* p )
+{
+ if( p )
+ {
+ // Alle Styles umsetzen, deren Parent dieser hier ist
+ ChangeParent( p->GetName(), p->GetParent() );
+ aStyles.Remove( p );
+ Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_ERASED, *p ) );
+ }
+ return p;
+}
+
+void SfxStyleSheetBasePool::Erase( SfxStyleSheetBase* p )
+{
+ if( p )
+ {
+ Remove(p);
+ delete p;
+ }
+}
+
+void SfxStyleSheetBasePool::Insert( SfxStyleSheetBase* p )
+{
+ DBG_ASSERT( p, "Kein StyleSheet?" );
+ SfxStyleSheetIterator aIter(
+ this, p->GetFamily(), p->GetMask());
+ SfxStyleSheetBase* pOld = aIter.Find( p->GetName() );
+ DBG_ASSERT( !pOld, "StyleSheet bereits vorhanden" );
+ if( p->GetParent().Len() )
+ {
+ pOld = aIter.Find( p->GetParent() );
+ DBG_ASSERT( pOld, "Parent nicht mehr vorhanden" );
+ }
+ aStyles.Insert( p, aStyles.Count() );
+ Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_CREATED, *p ) );
+}
+
+void SfxStyleSheetBasePool::Clear()
+{
+ while( aStyles.Count() )
+ {
+ SfxStyleSheetBase* p = aStyles.First();
+ aStyles.Remove( p );
+ Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_ERASED, *p ) );
+ delete p;
+ }
+}
+
+/////////////////////////// Parents umsetzen ////////////////////////////////
+
+void SfxStyleSheetBasePool::ChangeParent(const XubString& rOld,
+ const XubString& rNew,
+ BOOL bVirtual)
+{
+ const ULONG nPos = aStyles.GetCurPos();
+ const USHORT nTmpMask = GetSearchMask();
+ SetSearchMask(GetSearchFamily(), 0xffff);
+ for( SfxStyleSheetBase* p = First(); p; p = Next() )
+ {
+ if( p->GetParent().Equals( rOld ) )
+ {
+ if(bVirtual)
+ p->SetParent( rNew );
+ else
+ p->aParent = rNew;
+ }
+ }
+ SetSearchMask(GetSearchFamily(), nTmpMask);
+ aStyles.Seek(nPos);
+}
+
+/////////////////////////// Laden/Speichern /////////////////////////////////
+
+void SfxStyleSheetBase::Load( SvStream&, USHORT )
+{
+}
+
+void SfxStyleSheetBase::Store( SvStream& )
+{
+}
+
+
+BOOL SfxStyleSheetBasePool::Load( SvStream& rStream )
+{
+ // alte Version?
+ if ( !rPool.IsVer2_Impl() )
+ return Load1_Impl( rStream );
+
+ // gesamten StyleSheetPool in neuer Version aus einem MiniRecord lesen
+ SfxMiniRecordReader aPoolRec( &rStream, SFX_STYLES_REC );
+
+ // Header-Record lesen
+ short nCharSet;
+ if ( !rStream.GetError() )
+ {
+ SfxSingleRecordReader aHeaderRec( &rStream, SFX_STYLES_REC_HEADER );
+ if ( !aHeaderRec.IsValid() )
+ return FALSE;
+
+ aAppName = rPool.GetName();
+ rStream >> nCharSet;
+ }
+
+ // Styles-Record lesen
+ if ( !rStream.GetError() )
+ {
+ SfxMultiRecordReader aStylesRec( &rStream, SFX_STYLES_REC_STYLES );
+ if ( !aStylesRec.IsValid() )
+ return FALSE;
+
+ USHORT nCount;
+ for ( nCount = 0; aStylesRec.GetContent(); nCount++ )
+ {
+ // kann nicht mehr weiterlesen?
+ if ( rStream.GetError() )
+ break;
+
+ // Globale Teile
+ XubString aName, aParent, aFollow;
+ String aHelpFile;
+ USHORT nFamily, nMask,nCount;
+ ULONG nHelpId;
+ rStream.ReadByteString(aName, rtl_TextEncoding(nCharSet));
+ rStream.ReadByteString(aParent, rtl_TextEncoding(nCharSet));
+ rStream.ReadByteString(aFollow, rtl_TextEncoding(nCharSet));
+ rStream >> nFamily >> nMask;
+ SfxPoolItem::readByteString(rStream, aHelpFile);
+ rStream >> nHelpId;
+
+#ifndef ENABLEUNICODE
+ // bei Unicode keine Konvertierung erforderlich
+ aName.Convert( (CharSet) nCharSet );
+ aParent.Convert( (CharSet) nCharSet );
+ aFollow.Convert( (CharSet) nCharSet );
+
+ // #72939# When loading from a different CharSet, several style
+ // names may have been converted to the same string, so the styles
+ // can't be inserted. If a style with this name already exists,
+ // generate an internal name so the information from the styles
+ // isn't lost.
+ if ( nCharSet != ::GetSystemCharSet() &&
+ Find( aName, (SfxStyleFamily)nFamily ) != NULL )
+ {
+ DBG_WARNING("style has to be renamed");
+ USHORT nMax = aStyles.Count() + 1;
+ for ( USHORT nAdd=1; nAdd<=nMax; nAdd++ )
+ {
+ aName = '_';
+ aName += nAdd;
+ if ( Find( aName, (SfxStyleFamily)nFamily ) == NULL )
+ break;
+ }
+ }
+#endif
+ SfxStyleSheetBase& rSheet = Make( aName, (SfxStyleFamily)nFamily , nMask);
+ rSheet.SetHelpId( aHelpFile, nHelpId );
+ // Hier erst einmal Parent und Follow zwischenspeichern
+ rSheet.aParent = aParent;
+ rSheet.aFollow = aFollow;
+ UINT32 nPos = rStream.Tell();
+ rStream >> nCount;
+ if(nCount)
+ {
+ rStream.Seek( nPos );
+ // Das Laden des ItemSets bedient sich der Methode GetItemSet(),
+ // damit eigene ItemSets untergeschoben werden koennen
+ SfxItemSet& rSet = rSheet.GetItemSet();
+ rSet.ClearItem();
+ //! SfxItemSet aTmpSet( *pTmpPool );
+ /*!aTmpSet*/ rSet.Load( rStream );
+ //! rSet.Put( aTmpSet );
+ }
+ // Lokale Teile
+ UINT32 nSize;
+ USHORT nVer;
+ rStream >> nVer >> nSize;
+ nPos = rStream.Tell() + nSize;
+ rSheet.Load( rStream, nVer );
+ rStream.Seek( nPos );
+ }
+
+ // #72939# only loop through the styles that were really inserted
+ nCount = aStyles.Count();
+
+ //! delete pTmpPool;
+ // Jetzt Parent und Follow setzen. Alle Sheets sind geladen.
+ // Mit Setxxx() noch einmal den String eintragen, da diese
+ // virtuellen Methoden evtl. ueberlagert sind.
+ for ( USHORT i = 0; i < nCount; i++ )
+ {
+ SfxStyleSheetBase* p = aStyles.GetObject( i );
+ XubString aText = p->aParent;
+ p->aParent.Erase();
+ p->SetParent( aText );
+ aText = p->aFollow;
+ p->aFollow.Erase();
+ p->SetFollow( aText );
+ }
+ }
+
+ // alles klar?
+ return BOOL( rStream.GetError() == SVSTREAM_OK );
+}
+
+BOOL SfxStyleSheetBasePool::Load1_Impl( SvStream& rStream )
+{
+ aAppName = rPool.GetName();
+ USHORT nVersion;
+ short nCharSet;
+ rStream >> nVersion;
+
+ if(nVersion!=STYLESTREAM_VERSION)
+ nCharSet=nVersion;
+ else
+ rStream >> nCharSet;
+
+ USHORT nCount;
+ rStream >> nCount;
+ USHORT i;
+ for ( i = 0; i < nCount; i++ )
+ {
+ // kann nicht mehr weiterlesen?
+ if ( rStream.GetError() )
+ {
+ nCount = i;
+ break;
+ }
+
+ // Globale Teile
+ XubString aName, aParent, aFollow;
+ String aHelpFile;
+ USHORT nFamily, nMask,nCount;
+ ULONG nHelpId;
+ rStream.ReadByteString(aName, rtl_TextEncoding(nCharSet));
+ rStream.ReadByteString(aParent, rtl_TextEncoding(nCharSet));
+ rStream.ReadByteString(aFollow, rtl_TextEncoding(nCharSet));
+ rStream >> nFamily >> nMask;
+ SfxPoolItem::readByteString(rStream, aHelpFile);
+ if(nVersion!=STYLESTREAM_VERSION)
+ {
+ USHORT nTmpHelpId;
+ rStream >> nTmpHelpId;
+ nHelpId=nTmpHelpId;
+ }
+ else
+ rStream >> nHelpId;
+
+#ifndef ENABLEUNICODE
+ // bei Unicode keine Konvertierung erforderlich
+ aName.Convert( (CharSet) nCharSet );
+ aParent.Convert( (CharSet) nCharSet );
+ aFollow.Convert( (CharSet) nCharSet );
+#endif
+ SfxStyleSheetBase& rSheet = Make( aName, (SfxStyleFamily)nFamily , nMask);
+ rSheet.SetHelpId( aHelpFile, nHelpId );
+ // Hier erst einmal Parent und Follow zwischenspeichern
+ rSheet.aParent = aParent;
+ rSheet.aFollow = aFollow;
+ UINT32 nPos = rStream.Tell();
+ rStream >> nCount;
+ if(nCount) {
+ rStream.Seek( nPos );
+ // Das Laden des ItemSets bedient sich der Methode GetItemSet(),
+ // damit eigene ItemSets untergeschoben werden koennen
+ SfxItemSet& rSet = rSheet.GetItemSet();
+ rSet.ClearItem();
+//! SfxItemSet aTmpSet( *pTmpPool );
+ /*!aTmpSet*/ rSet.Load( rStream );
+ //! rSet.Put( aTmpSet );
+ }
+ // Lokale Teile
+ UINT32 nSize;
+ USHORT nVer;
+ rStream >> nVer >> nSize;
+ nPos = rStream.Tell() + nSize;
+ rSheet.Load( rStream, nVer );
+ rStream.Seek( nPos );
+ }
+
+ //! delete pTmpPool;
+ // Jetzt Parent und Follow setzen. Alle Sheets sind geladen.
+ // Mit Setxxx() noch einmal den String eintragen, da diese
+ // virtuellen Methoden evtl. ueberlagert sind.
+ for ( i = 0; i < nCount; i++ )
+ {
+ SfxStyleSheetBase* p = aStyles.GetObject( i );
+ XubString aText = p->aParent;
+ p->aParent.Erase();
+ p->SetParent( aText );
+ aText = p->aFollow;
+ p->aFollow.Erase();
+ p->SetFollow( aText );
+ }
+ return BOOL( rStream.GetError() == SVSTREAM_OK );
+}
+
+BOOL SfxStyleSheetBasePool::Store( SvStream& rStream, BOOL bUsed )
+{
+ // den ganzen StyleSheet-Pool in einen Mini-Record
+ SfxMiniRecordWriter aPoolRec( &rStream, SFX_STYLES_REC );
+
+ // Erst einmal die Dummies rauszaehlen; die werden nicht gespeichert
+ USHORT nCount = 0;
+ for( SfxStyleSheetBase* p = First(); p; p = Next() )
+ {
+ if(!bUsed || p->IsUsed())
+ nCount++;
+ }
+
+ // einen Header-Record vorweg
+ rtl_TextEncoding eCharSet
+ = ::GetStoreCharSet( rStream.GetStreamCharSet() );
+ {
+ SfxSingleRecordWriter aHeaderRec( &rStream,
+ SFX_STYLES_REC_HEADER,
+ STYLESTREAM_VERSION );
+ rStream << (short) eCharSet;
+ }
+
+ // die StyleSheets in einen MultiVarRecord
+ {
+ SfxMultiVarRecordWriter aStylesRec( &rStream, SFX_STYLES_REC_STYLES, 0 );
+ for( SfxStyleSheetBase* p = First(); p; p = Next() )
+ {
+ if(!bUsed || p->IsUsed())
+ {
+ aStylesRec.NewContent();
+
+ // Globale Teile speichern
+ String aHelpFile;
+ ULONG nHelpId = p->GetHelpId( aHelpFile );
+ rStream.WriteByteString(p->GetName(), eCharSet);
+ rStream.WriteByteString(p->GetParent(), eCharSet);
+ rStream.WriteByteString(p->GetFollow(), eCharSet);
+ rStream << (USHORT)p->GetFamily() << p->GetMask();
+ SfxPoolItem::writeByteString(rStream, aHelpFile);
+ rStream << nHelpId;
+ if(p->pSet)
+ p->pSet->Store( rStream );
+ else
+ rStream << (USHORT)0;
+
+ // Lokale Teile speichern
+ // Vor dem lokalen Teil wird die Laenge der lokalen Daten
+ // als UINT32 sowie die Versionsnummer gespeichert.
+ rStream << (USHORT) p->GetVersion();
+ ULONG nPos1 = rStream.Tell();
+ rStream << (UINT32) 0;
+ p->Store( rStream );
+ ULONG nPos2 = rStream.Tell();
+ rStream.Seek( nPos1 );
+ rStream << (UINT32) ( nPos2 - nPos1 - sizeof( UINT32 ) );
+ rStream.Seek( nPos2 );
+ if( rStream.GetError() != SVSTREAM_OK )
+ break;
+ }
+ }
+ }
+
+ return BOOL( rStream.GetError() == SVSTREAM_OK );
+}
+
+SfxItemPool& SfxStyleSheetBasePool::GetPool()
+{
+ return rPool;
+}
+
+const SfxItemPool& SfxStyleSheetBasePool::GetPool() const
+{
+ return rPool;
+}
+
+/////////////////////// SfxStyleSheet /////////////////////////////////
+
+SfxStyleSheet::SfxStyleSheet(const XubString &rName,
+ SfxStyleSheetBasePool& rPool,
+ SfxStyleFamily eFam,
+ USHORT mask ):
+ SfxStyleSheetBase(rName, rPool, eFam, mask)
+{}
+
+SfxStyleSheet::SfxStyleSheet(const SfxStyleSheet& rStyle) :
+ SfxStyleSheetBase(rStyle)
+{}
+
+SfxStyleSheet::~SfxStyleSheet()
+{
+ Broadcast( SfxStyleSheetHint( SFX_STYLESHEET_INDESTRUCTION, *this ) );
+}
+
+
+BOOL SfxStyleSheet::SetParent( const XubString& rName )
+{
+ if(aParent == rName)
+ return TRUE;
+ const XubString aOldParent(aParent);
+ if(SfxStyleSheetBase::SetParent(rName)) {
+ // aus der Benachrichtigungskette des alten
+ // Parents gfs. austragen
+ if(aOldParent.Len()) {
+ SfxStyleSheet *pParent = (SfxStyleSheet *)rPool.Find(aOldParent, nFamily, 0xffff);
+ if(pParent)
+ EndListening(*pParent);
+ }
+ // in die Benachrichtigungskette des neuen
+ // Parents eintragen
+ if(aParent.Len()) {
+ SfxStyleSheet *pParent = (SfxStyleSheet *)rPool.Find(aParent, nFamily, 0xffff);
+ if(pParent)
+ StartListening(*pParent);
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+// alle Zuhoerer benachtichtigen
+
+void SfxStyleSheet::SFX_NOTIFY(SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType )
+{
+ SFX_FORWARD(rBC, rBCType, rHint, rHintType);
+}
+
+//////////////////////// SfxStyleSheetPool ///////////////////////////////
+
+SfxStyleSheetPool::SfxStyleSheetPool( SfxItemPool& rSet):
+ SfxStyleSheetBasePool(rSet)
+{}
+
+/////////////////////////////////// Factory ////////////////////////////////
+
+SfxStyleSheetBase* SfxStyleSheetPool::Create( const XubString& rName,
+ SfxStyleFamily eFam, USHORT mask )
+{
+ return new SfxStyleSheet( rName, *this, eFam, mask );
+}
+
+SfxStyleSheetBase* SfxStyleSheetPool::Create( const SfxStyleSheet& r )
+{
+ return new SfxStyleSheet( r );
+}
+/*
+BOOL SfxStyleSheetPool::CopyTo(SfxStyleSheetPool &, const String &)
+{
+ return FALSE;
+}
+*/
+
diff --git a/svtools/source/items/szitem.cxx b/svtools/source/items/szitem.cxx
new file mode 100644
index 000000000000..c4c8127fcb68
--- /dev/null
+++ b/svtools/source/items/szitem.cxx
@@ -0,0 +1,214 @@
+/*************************************************************************
+ *
+ * $RCSfile: szitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_UNO_ANY_HXX_
+#include <com/sun/star/uno/Any.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_AWT_SIZE_HPP_
+#include <com/sun/star/awt/Size.hpp>
+#endif
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+#ifndef _GEN_HXX //autogen
+#include <tools/gen.hxx>
+#endif
+
+#include "args.hxx"
+#include "poolitem.hxx"
+#include "szitem.hxx"
+#include "memberid.hrc"
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxSizeItem);
+
+// -----------------------------------------------------------------------
+
+TYPEINIT1_AUTOFACTORY(SfxSizeItem, SfxPoolItem);
+
+// -----------------------------------------------------------------------
+
+SfxSizeItem::SfxSizeItem()
+{
+ DBG_CTOR(SfxSizeItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxSizeItem::SfxSizeItem( USHORT nW, const Size& rVal ) :
+ SfxPoolItem( nW ),
+ aVal( rVal )
+{
+ DBG_CTOR(SfxSizeItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxSizeItem::SfxSizeItem( USHORT nW, SvStream &rStream ) :
+ SfxPoolItem( nW )
+{
+ DBG_CTOR(SfxSizeItem, 0);
+ rStream >> aVal;
+}
+
+// -----------------------------------------------------------------------
+
+SfxSizeItem::SfxSizeItem( const SfxSizeItem& rItem ) :
+ SfxPoolItem( rItem ),
+ aVal( rItem.aVal )
+{
+ DBG_CTOR(SfxSizeItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+SfxItemPresentation SfxSizeItem::GetPresentation
+(
+ SfxItemPresentation ePresentation,
+ SfxMapUnit eCoreMetric,
+ SfxMapUnit ePresentationMetric,
+ XubString& rText,
+ const International *
+) const
+{
+ DBG_CHKTHIS(SfxSizeItem, 0);
+ rText = UniString::CreateFromInt32(aVal.Width());
+ rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ rText += UniString::CreateFromInt32(aVal.Height());
+ rText.AppendAscii(RTL_CONSTASCII_STRINGPARAM(", "));
+ return SFX_ITEM_PRESENTATION_NAMELESS;
+}
+
+// -----------------------------------------------------------------------
+
+int SfxSizeItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_CHKTHIS(SfxSizeItem, 0);
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
+ return ((SfxSizeItem&)rItem).aVal == aVal;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxSizeItem::Clone(SfxItemPool *) const
+{
+ DBG_CHKTHIS(SfxSizeItem, 0);
+ return new SfxSizeItem( *this );
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxSizeItem::Create(SvStream &rStream, USHORT nVersion ) const
+{
+ DBG_CHKTHIS(SfxSizeItem, 0);
+ Size aStr;
+ rStream >> aStr;
+ return new SfxSizeItem(Which(), aStr);
+}
+
+// -----------------------------------------------------------------------
+
+SvStream& SfxSizeItem::Store(SvStream &rStream, USHORT nItemVersion) const
+{
+ DBG_CHKTHIS(SfxSizeItem, 0);
+ rStream << aVal;
+ return rStream;
+}
+
+// -----------------------------------------------------------------------
+BOOL SfxSizeItem::QueryValue( com::sun::star::uno::Any& rVal,
+ BYTE nMemberId ) const
+{
+ Size aTmp(aVal);
+ if(CONVERT_TWIPS&nMemberId)
+ {
+ aTmp.Height() = ( aTmp.Height() * 127 + 36) / 72;
+ aTmp.Width() = ( aTmp.Width() * 127 + 36) / 72;
+ }
+ rVal <<= com::sun::star::awt::Size( aTmp.getWidth(), aTmp.getHeight() );
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+BOOL SfxSizeItem::PutValue( const com::sun::star::uno::Any& rVal,
+ BYTE nMemberId )
+{
+ BOOL bRet = FALSE;
+ com::sun::star::awt::Size aValue;
+ if ( rVal >>= aValue )
+ {
+ Size aTmp( aValue.Width, aValue.Height );
+ if(CONVERT_TWIPS&nMemberId)
+ {
+ aTmp.Height() = ( aTmp.Height() * 72 + 63) / 127;
+ aTmp.Width() = ( aTmp.Width() * 72 + 63) / 127;
+ }
+ aVal = aTmp;
+ bRet = TRUE;
+ }
+ return bRet;
+}
+
+
+
diff --git a/svtools/source/items/wallitem.cxx b/svtools/source/items/wallitem.cxx
new file mode 100644
index 000000000000..d45e9748e950
--- /dev/null
+++ b/svtools/source/items/wallitem.cxx
@@ -0,0 +1,694 @@
+/*************************************************************************
+ *
+ * $RCSfile: wallitem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+#ifndef _COM_SUN_STAR_IO_XOUTPUTSTREAM_HPP_
+#include <com/sun/star/io/XOutputStream.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATASOURCE_HPP_
+#include <com/sun/star/io/XActiveDataSource.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XACTIVEDATACONTROL_HPP_
+#include <com/sun/star/io/XActiveDataControl.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_CHAOS_WALLPAPER_HPP_
+#include <com/sun/star/chaos/WallPaper.hpp>
+#endif
+
+#ifndef _UNOTOOLS_PROCESSFACTORY_HXX_
+#include <unotools/processfactory.hxx>
+#endif
+
+#include <tools/stream.hxx>
+#include <tools/debug.hxx>
+#include <tools/string.hxx>
+
+#ifndef _URLOBJ_HXX //autogen wg. INetURLObject
+#include <tools/urlobj.hxx>
+#endif
+#ifndef _STREAM_HXX //autogen wg. SvMemoryStream
+#include <tools/stream.hxx>
+#endif
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
+#endif
+
+#include <vcl/graph.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/wrkwin.hxx>
+#ifndef _SV_GRADIENT_HXX
+#include <vcl/gradient.hxx>
+#endif
+#ifndef _SV_CVTGRF_HXX //autogen wg. GraphicConverter
+#include <vcl/cvtgrf.hxx>
+#endif
+
+#include "wallitem.hxx"
+#include "cntwall.hxx"
+
+#define WALLITEMFLAG_ERROR 0x0001
+#define WALLITEMFLAG_DITHERED 0x0002
+
+
+DBG_NAME( SfxWallpaperItem );
+TYPEINIT1( SfxWallpaperItem, SfxPoolItem );
+
+// -----------------------------------------------------------------------
+
+class WallpaperSink_Impl: public cppu::OWeakObject,
+ public com::sun::star::io::XOutputStream
+{
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XActiveDataSource > _aSource;
+ SvMemoryStream *_pStream;
+ WallpaperLoader *_pWallpaper;
+
+public:
+
+ WallpaperSink_Impl();
+ virtual ~WallpaperSink_Impl();
+
+ void RequestData( WallpaperLoader *pWallpaper, const String& rURL );
+ void Release();
+
+ // XInterface
+ virtual com::sun::star::uno::Any SAL_CALL
+ queryInterface( const com::sun::star::uno::Type& aType )
+ throw( com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ acquire()
+ throw(::com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ release()
+ throw(::com::sun::star::uno::RuntimeException );
+
+ // XOutputStream
+ virtual void SAL_CALL
+ writeBytes( const com::sun::star::uno::Sequence< sal_Int8 >& aData )
+ throw( com::sun::star::io::NotConnectedException,
+ com::sun::star::io::BufferSizeExceededException,
+ com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ flush()
+ throw( com::sun::star::io::NotConnectedException,
+ com::sun::star::io::BufferSizeExceededException,
+ com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException );
+ virtual void SAL_CALL
+ closeOutput()
+ throw( com::sun::star::io::NotConnectedException,
+ com::sun::star::io::BufferSizeExceededException,
+ com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException );
+};
+
+// -----------------------------------------------------------------------
+
+//static
+void SfxBrushItemLink::Set( SfxBrushItemLink* pLink )
+{
+ SfxBrushItemLink** ppLink = (SfxBrushItemLink**)GetAppData(SHL_BRUSHITEM);
+ if( !*ppLink )
+ *ppLink = pLink;
+ else
+ delete pLink;
+}
+
+// -----------------------------------------------------------------------
+
+SfxWallpaperItem::SfxWallpaperItem( USHORT nWhich ) :
+ SfxPoolItem( nWhich ), _nFlags(0)
+{
+ DBG_CTOR( SfxWallpaperItem, 0 );
+}
+
+SfxWallpaperItem::SfxWallpaperItem( USHORT nWhich, SvStream& rStream, USHORT nVersion )
+ : SfxPoolItem( nWhich )
+{
+ DBG_CTOR( SfxWallpaperItem, 0 );
+ _nFlags = 0;
+ rStream >> _aWallpaper;
+ readByteString(rStream, _aURL);
+ readByteString(rStream, _aFilter);
+}
+// -----------------------------------------------------------------------
+
+SfxWallpaperItem::SfxWallpaperItem( const SfxWallpaperItem& rItem ) :
+ SfxPoolItem( rItem ),
+ _aWallpaper( rItem._aWallpaper ),
+ _aURL( rItem._aURL ),
+ _nFlags( rItem._nFlags )
+{
+ DBG_CTOR( SfxWallpaperItem, 0 );
+}
+
+// -----------------------------------------------------------------------
+
+SfxWallpaperItem::SfxWallpaperItem( USHORT nWhich, const Wallpaper& rPaper ) :
+ SfxPoolItem( nWhich ), _nFlags(0), _aWallpaper( rPaper )
+{
+ DBG_CTOR( SfxWallpaperItem, 0 );
+}
+
+// -----------------------------------------------------------------------
+
+SfxWallpaperItem::~SfxWallpaperItem()
+{
+ DBG_DTOR(SfxWallpaperItem, 0);
+}
+
+// -----------------------------------------------------------------------
+
+int SfxWallpaperItem::operator==( const SfxPoolItem& rItem ) const
+{
+ DBG_CHKTHIS( SfxWallpaperItem, 0 );
+ DBG_ASSERT( SfxPoolItem::operator==( rItem ), "unequal type" );
+ const SfxWallpaperItem& rWallItem = (const SfxWallpaperItem&)rItem;
+ if( rWallItem._aURL != _aURL )
+ return 0;
+ if( !_aURL.Len() )
+ {
+ if( rWallItem._aWallpaper == _aWallpaper )
+ return TRUE;
+ return 0;
+ }
+ else
+ {
+ // Wenn eine URL gesetzt ist, sind die Items auch dann gleich, wenn
+ // das eine Item bereits die Bitmap geladen hat und das andere nicht.
+ // Deshalb kann der Wallpaper-Vergleichsoperator nicht benutzt werden.
+ if( rWallItem._aWallpaper.GetColor() != _aWallpaper.GetColor() )
+ return 0;
+ if( rWallItem._aWallpaper.GetStyle() != _aWallpaper.GetStyle() )
+ return 0;
+ if( rWallItem._aWallpaper.GetGradient() != _aWallpaper.GetGradient() )
+ return 0;
+ if( rWallItem._aWallpaper.GetRect() != _aWallpaper.GetRect() )
+ return 0;
+ }
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxWallpaperItem::Create( SvStream& rStream, USHORT nVersion) const
+{
+ DBG_CHKTHIS(SfxWallpaperItem, 0);
+ return new SfxWallpaperItem( Which(), rStream, nVersion );
+}
+
+// -----------------------------------------------------------------------
+
+SvStream& SfxWallpaperItem::Store( SvStream& rStream, USHORT ) const
+{
+ DBG_CHKTHIS( SfxWallpaperItem, 0 );
+ BitmapEx aBmpTemp;
+ if( _aURL.Len() )
+ {
+ // Bei gesetzter URL die Grafik als Link speichern, und deshalb
+ // temporaer in der Wallpaper zuruecksetzen.
+ aBmpTemp = _aWallpaper.GetBitmap();
+ ((SfxWallpaperItem*)this)->_aWallpaper.SetBitmap();
+ }
+ rStream << _aWallpaper;
+ writeByteString(rStream, _aURL);
+ writeByteString(rStream, _aFilter);
+ if( _aURL.Len() )
+ ((SfxWallpaperItem*)this)->_aWallpaper.SetBitmap( aBmpTemp );
+ return rStream;
+}
+
+// -----------------------------------------------------------------------
+
+SfxPoolItem* SfxWallpaperItem::Clone( SfxItemPool* ) const
+{
+ DBG_CHKTHIS( SfxWallpaperItem, 0 );
+ return new SfxWallpaperItem( *this );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxWallpaperItem::QueryValue( com::sun::star::uno::Any& rVal,
+ BYTE nMemberId ) const
+{
+ com::sun::star::chaos::WallPaper aVal;
+
+ aVal.Style = (com::sun::star::chaos::WallpaperStyle)_aWallpaper.GetStyle();
+ aVal.Color = (sal_Int32) _aWallpaper.GetColor().GetColor();
+ aVal.ImageURL = GetBitmapURL();
+ rVal <<= aVal;
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+BOOL SfxWallpaperItem::PutValue( const com::sun::star::uno::Any& rVal,
+ BYTE nMemberId )
+{
+ com::sun::star::chaos::WallPaper aVal;
+ if ( rVal >>= aVal )
+ {
+ if ( aVal.ImageURL.getLength() )
+ SetBitmapURL( aVal.ImageURL, GetBitmapFilter() );
+
+ SetColor( aVal.Color );
+ SetStyle( (WallpaperStyle)aVal.Style );
+
+ return TRUE;
+ }
+
+ DBG_ERROR( "SfxWallpaperItem::PutValue - Wrong type!" );
+ return FALSE;
+}
+
+// -----------------------------------------------------------------------
+
+void SfxWallpaperItem::SetBitmapURL( const XubString& rURL, const String& rFilter )
+{
+ DBG_CHKTHIS(SfxWallpaperItem, 0);
+ if( rURL != _aURL || rFilter != _aFilter )
+ {
+ _aURL = rURL;
+ _aFilter = rFilter;
+ _nFlags = 0;
+ _aWallpaper.SetBitmap();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+const Wallpaper& SfxWallpaperItem::GetWallpaper( BOOL bNeedsBitmap ) const
+{
+ DBG_CHKTHIS(SfxWallpaperItem, 0);
+ if( bNeedsBitmap && !IsDownloaded() )
+ ((SfxWallpaperItem*)this)->Download();
+ if( !(_nFlags & WALLITEMFLAG_DITHERED ))
+ {
+ if( _aWallpaper.IsBitmap())
+ {
+ BitmapEx aBmp( _aWallpaper.GetBitmap() );
+ OutputDevice* pOutDev = Application::GetDefaultDevice();
+
+ if ( pOutDev->GetBitCount() <= 8 && aBmp.GetBitmap().GetBitCount() >= 8 )
+ {
+ aBmp.Dither( BMP_DITHER_MATRIX );
+ aBmp = BitmapEx( aBmp.GetBitmap().CreateDisplayBitmap( pOutDev ), aBmp.GetMask() );
+ ( (SfxWallpaperItem*)this )->_aWallpaper.SetBitmap( aBmp );
+ }
+ }
+ ( (SfxWallpaperItem*)this )->_nFlags |= WALLITEMFLAG_DITHERED;
+ }
+ return _aWallpaper;
+}
+
+void SfxWallpaperItem::SetGraphic( const Graphic& rGraphic, BOOL bKeepLink )
+{
+ DBG_CHKTHIS(SfxWallpaperItem, 0);
+ BitmapEx aBmp( rGraphic.GetBitmapEx() );
+ _aWallpaper.SetBitmap( aBmp );
+ if( !bKeepLink )
+ {
+ _aURL.Erase();
+ _aFilter.Erase();
+ }
+ _nFlags &= ~( WALLITEMFLAG_ERROR | WALLITEMFLAG_DITHERED );
+}
+
+BOOL SfxWallpaperItem::IsDownloaded() const
+{
+ if( _nFlags & WALLITEMFLAG_ERROR )
+ return TRUE; // Endlos-Downloads verhindern
+ return !_aURL.Len() || _aWallpaper.IsBitmap();
+}
+
+void SfxWallpaperItem::Download()
+{
+ if( _aURL.Len() )
+ {
+ SfxBrushItemLink* pLink = SfxBrushItemLink::Get();
+ if( pLink )
+ {
+ Graphic aGraphic( pLink->GetGraphic( _aURL, _aFilter ) );
+ if( aGraphic.GetType() != GRAPHIC_NONE )
+ {
+ BitmapEx aBmp( aGraphic.GetBitmapEx() );
+ _aWallpaper.SetBitmap( aBmp );
+ _nFlags &= ~WALLITEMFLAG_ERROR;
+ }
+ else
+ _nFlags |= WALLITEMFLAG_ERROR;
+ }
+ }
+ _nFlags &= ~WALLITEMFLAG_DITHERED;
+}
+
+//============================================================================
+class WallpaperLoader_Impl
+{
+public:
+
+ Link _aDoneLink;
+ SfxWallpaperItem _aWallpaper;
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XOutputStream > _xOutputStream;
+ WallpaperSink_Impl* _pWallpaperSink;
+ BOOL _bDone;
+
+ WallpaperLoader_Impl( const SfxWallpaperItem& rItem );
+};
+
+WallpaperLoader_Impl::WallpaperLoader_Impl( const SfxWallpaperItem& rWallpaper )
+ : _aWallpaper( rWallpaper )
+{
+ _pWallpaperSink = NULL;
+ _bDone = FALSE;
+}
+
+WallpaperLoader::WallpaperLoader( const CntWallpaperItem& rWallpaper )
+{
+ SfxWallpaperItem aSfxWallpaper( rWallpaper.Which() );
+
+ aSfxWallpaper.SetBitmapURL( rWallpaper.GetBitmapURL(), String() );
+ aSfxWallpaper.SetColor( rWallpaper.GetColor() );
+ aSfxWallpaper.SetStyle( (WallpaperStyle) rWallpaper.GetStyle() );
+
+ pImp = new WallpaperLoader_Impl( aSfxWallpaper );
+}
+
+WallpaperLoader::~WallpaperLoader()
+{
+ if ( !pImp->_bDone && pImp->_pWallpaperSink )
+ {
+ pImp->_pWallpaperSink->Release();
+ pImp->_pWallpaperSink = NULL;
+ }
+ delete pImp;
+}
+
+void WallpaperLoader::RequestData( const Link& rDoneLink )
+{
+ WallpaperLoaderRef aRef( this );
+
+ pImp->_aDoneLink = rDoneLink;
+
+ if ( pImp->_aWallpaper.GetBitmapURL().Len() )
+ {
+ WallpaperSink_Impl *pStream = new WallpaperSink_Impl();
+ pImp->_xOutputStream = pStream;
+ pImp->_pWallpaperSink = pStream;
+ pStream->RequestData( this, pImp->_aWallpaper.GetBitmapURL() );
+ }
+ else
+ Done();
+}
+
+const Wallpaper& WallpaperLoader::GetWallpaper() const
+{
+ return pImp->_aWallpaper.GetWallpaper();
+}
+
+void WallpaperLoader::Done()
+{
+ WallpaperLoaderRef aRef( this );
+
+ pImp->_bDone = TRUE;
+
+ if ( pImp->_aDoneLink.IsSet() )
+ pImp->_aDoneLink.Call( this );
+}
+
+void WallpaperLoader::SetBitmap( SvStream *pStream )
+{
+ WallpaperLoaderRef aRef( this );
+
+ if( pStream && ! pStream->GetError() )
+ {
+ pStream->Seek( STREAM_SEEK_TO_BEGIN );
+ Graphic aGraphic;
+ GraphicConverter::Import( *pStream, aGraphic );
+
+ if( aGraphic.GetType() != GRAPHIC_NONE )
+ {
+ pImp->_aWallpaper.SetGraphic( aGraphic, TRUE );
+ }
+ }
+
+ Done();
+}
+
+
+//============================================================================
+
+WallpaperSink_Impl::WallpaperSink_Impl()
+{
+ _pStream = NULL;
+ _pWallpaper = NULL;
+}
+
+//--------------------------------------------------------------------------------------------------
+// virtual
+WallpaperSink_Impl::~WallpaperSink_Impl()
+{
+ delete _pStream;
+}
+
+//--------------------------------------------------------------------------------------------------
+void WallpaperSink_Impl::RequestData( WallpaperLoader *pWallpaper,
+ const String& rURL )
+{
+ _pWallpaper = pWallpaper;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > xMgr(
+ utl::getProcessServiceFactory() );
+ if ( !xMgr.is() )
+ return;
+
+ com::sun::star::uno::Reference<
+ com::sun::star::lang::XMultiServiceFactory > xFact(
+ xMgr->createInstance(
+ rtl::OUString::createFromAscii(
+ "com.sun.star.frame.DataSourceFactory" ) ),
+ com::sun::star::uno::UNO_QUERY );
+ if ( xFact.is() )
+ {
+ INetURLObject aURL( rURL );
+ com::sun::star::uno::Sequence< com::sun::star::uno::Any > aArgs( 1 );
+ aArgs.getArray()[ 0 ] <<= rtl::OUString( aURL.GetMainURL() );
+
+ String aProt( INetURLObject::GetScheme( aURL.GetProtocol() ) );
+ _aSource = com::sun::star::uno::Reference<
+ com::sun::star::io::XActiveDataSource >(
+ xFact->createInstanceWithArguments(
+ aProt, aArgs ),
+ com::sun::star::uno::UNO_QUERY );
+ if ( _aSource.is() )
+ {
+ _aSource->setOutputStream( this );
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XActiveDataControl > aControl(
+ _aSource, com::sun::star::uno::UNO_QUERY );
+ if ( aControl.is() )
+ aControl->start();
+ }
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+void WallpaperSink_Impl::Release()
+{
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XOutputStream > aRef( this );
+
+ _pWallpaper = NULL;
+
+ if ( _aSource.is() )
+ {
+ com::sun::star::uno::Reference<
+ com::sun::star::io::XActiveDataControl > aControl(
+ _aSource, com::sun::star::uno::UNO_QUERY );
+ if ( aControl.is() )
+ aControl->terminate();
+
+ _aSource = com::sun::star::uno::Reference<
+ com::sun::star::io::XActiveDataSource >();
+ }
+}
+
+//--------------------------------------------------------------------------------------------------
+// virtual
+com::sun::star::uno::Any SAL_CALL WallpaperSink_Impl::
+ queryInterface( const com::sun::star::uno::Type& aType )
+ throw( com::sun::star::uno::RuntimeException )
+{
+ com::sun::star::uno::Any aRet
+ = cppu::queryInterface( aType,
+ static_cast< com::sun::star::io::XOutputStream * >( this ) );
+ return aRet.hasValue() ? aRet : OWeakObject::queryInterface( aType );
+}
+
+//--------------------------------------------------------------------------------------------------
+// virtual
+void SAL_CALL WallpaperSink_Impl::acquire()
+ throw(::com::sun::star::uno::RuntimeException )
+{
+ OWeakObject::acquire();
+}
+
+//--------------------------------------------------------------------------------------------------
+// virtual
+void SAL_CALL WallpaperSink_Impl::release()
+ throw(::com::sun::star::uno::RuntimeException )
+{
+ OWeakObject::release();
+}
+
+//--------------------------------------------------------------------------------------------------
+// virtual
+void SAL_CALL WallpaperSink_Impl::writeBytes(
+ const com::sun::star::uno::Sequence< sal_Int8 >& aData )
+ throw( com::sun::star::io::NotConnectedException,
+ com::sun::star::io::BufferSizeExceededException,
+ com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException )
+{
+ if ( !_pStream )
+ _pStream = new SvMemoryStream( aData.getLength(), 4096 );
+
+ _pStream->Seek( STREAM_SEEK_TO_END );
+ _pStream->Write( aData.getConstArray(), aData.getLength() );
+}
+
+//--------------------------------------------------------------------------------------------------
+// virtual
+void SAL_CALL WallpaperSink_Impl::flush()
+ throw( com::sun::star::io::NotConnectedException,
+ com::sun::star::io::BufferSizeExceededException,
+ com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException )
+{
+}
+
+//--------------------------------------------------------------------------------------------------
+// virtual
+void SAL_CALL WallpaperSink_Impl::closeOutput()
+ throw( com::sun::star::io::NotConnectedException,
+ com::sun::star::io::BufferSizeExceededException,
+ com::sun::star::io::IOException,
+ com::sun::star::uno::RuntimeException )
+{
+ if ( _pWallpaper )
+ _pWallpaper->SetBitmap( _pStream );
+
+ _aSource = com::sun::star::uno::Reference<
+ com::sun::star::io::XActiveDataSource >();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+/*
+ $Log: not supported by cvs2svn $
+ Revision 1.23 2000/09/18 14:13:36 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.22 2000/08/31 13:41:29 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.21 2000/06/30 11:35:56 pb
+ chg: GetAppWindow() replaced
+
+ Revision 1.20 2000/04/12 08:01:40 sb
+ Adapted to Unicode.
+
+ Revision 1.19 2000/03/22 11:49:38 kso
+ Removed: SmartUno leftovers.
+
+ Revision 1.18 2000/03/21 11:37:55 kso
+ Added: [Put|QueryValue( ... com::sun::star::uno::Any ... )
+
+ Revision 1.17 2000/02/09 16:24:16 hr
+ #70473# changes for unicode ( patched by automated patchtool )
+
+ Revision 1.16 2000/01/28 11:23:43 dv
+ #70466# Changed service name
+
+ Revision 1.15 1999/11/19 17:12:36 sb
+ Module structure transposition.
+
+ Revision 1.14 1999/10/26 12:46:30 dv
+ Don't use GetGlobalServiceMgr() any longer
+
+ Revision 1.13 1999/08/23 13:30:58 dv
+ The CntWallpaperItem now uses the class Color
+
+ Revision 1.12 1999/08/18 14:14:21 dv
+ added: include cntwall.hxx
+
+ Revision 1.11 1999/08/18 09:12:51 dv
+ #66082# The WallpaperLoader is now constructed with a CntWallpaperItem
+
+*/
+
diff --git a/svtools/source/memtools/makefile.mk b/svtools/source/memtools/makefile.mk
new file mode 100644
index 000000000000..502ab08de680
--- /dev/null
+++ b/svtools/source/memtools/makefile.mk
@@ -0,0 +1,118 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=svarray
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES= \
+ svarray.cxx
+
+.IF "$(GUI)"!="DOS"
+CXXFILES+= \
+ hashtab.cxx \
+ hashcont.cxx
+.ENDIF
+
+.IF "$(GUI)"=="WIN" || "$(GUI)"=="DOS"
+OBJFILES= \
+ $(OBJ)$/svarray.obj
+
+.IF "$(GUI)"!="DOS"
+OBJFILES+= \
+ $(OBJ)$/hashtab.obj \
+ $(OBJ)$/hashcont.obj
+.ENDIF
+
+SLOFILES=\
+ $(SLO)$/memempty.obj
+
+.ELSE
+SLOFILES=\
+ $(SLO)$/hashtab.obj \
+ $(SLO)$/hashcont.obj \
+ $(SLO)$/svarray.obj
+
+OBJFILES=\
+ $(OBJ)$/memempty.obj
+
+LIB2TARGET=$(LB)$/ssvmem.lib
+LIB2OBJFILES=\
+ $(OBJ)$/hashtab.obj \
+ $(OBJ)$/hashcont.obj \
+ $(OBJ)$/svarray.obj
+
+.ENDIF #"$(GUI)"=="WIN" || "$(GUI)"=="DOS"
+
+# --- Targets -------------------------------------------------------
+
+
+.INCLUDE : target.mk
diff --git a/svtools/source/memtools/svarray.cxx b/svtools/source/memtools/svarray.cxx
new file mode 100644
index 000000000000..81eeea25cfaa
--- /dev/null
+++ b/svtools/source/memtools/svarray.cxx
@@ -0,0 +1,415 @@
+/*************************************************************************
+ *
+ * $RCSfile: svarray.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SVARRAY_CXX
+
+#define _SVSTDARR_BOOLS
+#define _SVSTDARR_BYTES
+#define _SVSTDARR_ULONGS
+#define _SVSTDARR_USHORTS
+#define _SVSTDARR_LONGS
+#define _SVSTDARR_SHORTS
+#define _SVSTDARR_STRINGS
+#define _SVSTDARR_STRINGSDTOR
+#define _SVSTDARR_STRINGSSORT
+#define _SVSTDARR_STRINGSSORTDTOR
+#define _SVSTDARR_STRINGSISORT
+#define _SVSTDARR_STRINGSISORTDTOR
+#define _SVSTDARR_USHORTSSORT
+
+#define _SVSTDARR_BYTESTRINGS
+#define _SVSTDARR_BYTESTRINGSDTOR
+#define _SVSTDARR_BYTESTRINGSSORT
+#define _SVSTDARR_BYTESTRINGSSORTDTOR
+#define _SVSTDARR_BYTESTRINGSISORT
+#define _SVSTDARR_BYTESTRINGSISORTDTOR
+
+#define _SVSTDARR_XUB_STRLEN
+
+#include <svstdarr.hxx>
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+#ifndef _TOOLS_DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+
+#ifdef MAC
+#pragma segment NEVER_PURGE
+#endif
+
+SV_IMPL_VARARR(SvPtrarr,VoidPtr)
+SV_IMPL_VARARR_PLAIN(SvPtrarrPlain,VoidPtr)
+
+USHORT SvPtrarr::GetPos( const VoidPtr& aElement ) const
+{ USHORT n;
+ for( n=0; n < nA && *(GetData()+n) != aElement; ) n++;
+ return ( n >= nA ? USHRT_MAX : n );
+}
+
+USHORT SvPtrarrPlain::GetPos( const VoidPtr aElement ) const
+{ USHORT n;
+ for( n=0; n < nA && *(GetData()+n) != aElement; ) n++;
+ return ( n >= nA ? USHRT_MAX : n );
+}
+
+
+SV_IMPL_VARARR( SvBools, BOOL )
+SV_IMPL_VARARR( SvBytes, BYTE )
+SV_IMPL_VARARR( SvULongs, ULONG )
+SV_IMPL_VARARR( SvUShorts, USHORT )
+SV_IMPL_VARARR( SvLongs, long)
+SV_IMPL_VARARR( SvShorts, short )
+
+SV_IMPL_VARARR( SvXub_StrLens, xub_StrLen )
+
+SV_IMPL_PTRARR( SvStrings, StringPtr )
+SV_IMPL_PTRARR( SvStringsDtor, StringPtr )
+SV_IMPL_OP_PTRARR_SORT( SvStringsSort, StringPtr )
+SV_IMPL_OP_PTRARR_SORT( SvStringsSortDtor, StringPtr )
+
+SV_IMPL_PTRARR( SvByteStrings, ByteStringPtr )
+SV_IMPL_PTRARR( SvByteStringsDtor, ByteStringPtr )
+SV_IMPL_OP_PTRARR_SORT( SvByteStringsSort, ByteStringPtr )
+SV_IMPL_OP_PTRARR_SORT( SvByteStringsSortDtor, ByteStringPtr )
+
+
+// ---------------- strings -------------------------------------
+
+// Array mit anderer Seek-Methode!
+_SV_IMPL_SORTAR_ALG( SvStringsISort, StringPtr )
+void SvStringsISort::DeleteAndDestroy( USHORT nP, USHORT nL )
+{
+ if( nL )
+ {
+ DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
+ for( USHORT n=nP; n < nP + nL; n++ )
+ delete *((StringPtr*)pData+n);
+ SvPtrarr::Remove( nP, nL );
+ }
+}
+BOOL SvStringsISort::Seek_Entry( const StringPtr aE, USHORT* pP ) const
+{
+ register USHORT nO = SvStringsISort_SAR::Count(),
+ nM,
+ nU = 0;
+ if( nO > 0 )
+ {
+ nO--;
+ while( nU <= nO )
+ {
+ nM = nU + ( nO - nU ) / 2;
+ StringCompare eCmp = (*((StringPtr*)pData + nM))->
+ CompareIgnoreCaseToAscii( *(aE) );
+ if( COMPARE_EQUAL == eCmp )
+ {
+ if( pP ) *pP = nM;
+ return TRUE;
+ }
+ else if( COMPARE_LESS == eCmp )
+ nU = nM + 1;
+ else if( nM == 0 )
+ {
+ if( pP ) *pP = nU;
+ return FALSE;
+ }
+ else
+ nO = nM - 1;
+ }
+ }
+ if( pP ) *pP = nU;
+ return FALSE;
+}
+
+// ---------------- strings -------------------------------------
+
+// Array mit anderer Seek-Methode!
+_SV_IMPL_SORTAR_ALG( SvStringsISortDtor, StringPtr )
+void SvStringsISortDtor::DeleteAndDestroy( USHORT nP, USHORT nL )
+{
+ if( nL )
+ {
+ DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
+ for( USHORT n=nP; n < nP + nL; n++ )
+ delete *((StringPtr*)pData+n);
+ SvPtrarr::Remove( nP, nL );
+ }
+}
+BOOL SvStringsISortDtor::Seek_Entry( const StringPtr aE, USHORT* pP ) const
+{
+ register USHORT nO = SvStringsISortDtor_SAR::Count(),
+ nM,
+ nU = 0;
+ if( nO > 0 )
+ {
+ nO--;
+ while( nU <= nO )
+ {
+ nM = nU + ( nO - nU ) / 2;
+ StringCompare eCmp = (*((StringPtr*)pData + nM))->
+ CompareIgnoreCaseToAscii( *(aE) );
+ if( COMPARE_EQUAL == eCmp )
+ {
+ if( pP ) *pP = nM;
+ return TRUE;
+ }
+ else if( COMPARE_LESS == eCmp )
+ nU = nM + 1;
+ else if( nM == 0 )
+ {
+ if( pP ) *pP = nU;
+ return FALSE;
+ }
+ else
+ nO = nM - 1;
+ }
+ }
+ if( pP ) *pP = nU;
+ return FALSE;
+}
+
+// ---------------- Ushorts -------------------------------------
+
+/* SortArray fuer UShorts */
+BOOL SvUShortsSort::Seek_Entry( const USHORT aE, USHORT* pP ) const
+{
+ register USHORT nO = SvUShorts::Count(),
+ nM,
+ nU = 0;
+ if( nO > 0 )
+ {
+ nO--;
+ while( nU <= nO )
+ {
+ nM = nU + ( nO - nU ) / 2;
+ if( *(pData + nM) == aE )
+ {
+ if( pP ) *pP = nM;
+ return TRUE;
+ }
+ else if( *(pData + nM) < aE )
+ nU = nM + 1;
+ else if( nM == 0 )
+ {
+ if( pP ) *pP = nU;
+ return FALSE;
+ }
+ else
+ nO = nM - 1;
+ }
+ }
+ if( pP ) *pP = nU;
+ return FALSE;
+}
+
+void SvUShortsSort::Insert( const SvUShortsSort * pI, USHORT nS, USHORT nE )
+{
+ if( USHRT_MAX == nE )
+ nE = pI->Count();
+ USHORT nP;
+ const USHORT * pIArr = pI->GetData();
+ for( ; nS < nE; ++nS )
+ {
+ if( ! Seek_Entry( *(pIArr+nS), &nP) )
+ SvUShorts::Insert( *(pIArr+nS), nP );
+ if( ++nP >= Count() )
+ {
+ SvUShorts::Insert( pI, nP, nS+1, nE );
+ nS = nE;
+ }
+ }
+}
+
+BOOL SvUShortsSort::Insert( const USHORT aE )
+{
+ USHORT nP;
+ BOOL bExist;
+ if( ! ( bExist = Seek_Entry( aE, &nP ) ) )
+ SvUShorts::Insert( aE, nP );
+ return !bExist;
+}
+
+BOOL SvUShortsSort::Insert( const USHORT aE, USHORT& rP )
+{
+ BOOL bExist;
+ if( ! ( bExist = Seek_Entry( aE, &rP ) ) )
+ SvUShorts::Insert( aE, rP );
+ return !bExist;
+}
+
+void SvUShortsSort::Insert( const USHORT* pE, USHORT nL)
+{
+ USHORT nP;
+ for( USHORT n = 0; n < nL; ++n )
+ if( ! Seek_Entry( *(pE+n), &nP ))
+ SvUShorts::Insert( *(pE+n), nP );
+}
+
+// remove ab Pos
+void SvUShortsSort::RemoveAt( const USHORT nP, USHORT nL )
+{
+ if( nL )
+ SvUShorts::Remove( nP, nL);
+}
+
+// remove ab dem Eintrag
+void SvUShortsSort::Remove( const USHORT aE, USHORT nL )
+{
+ USHORT nP;
+ if( nL && Seek_Entry( aE, &nP ) )
+ SvUShorts::Remove( nP, nL);
+}
+
+// ---------------- bytestrings -------------------------------------
+
+// Array mit anderer Seek-Methode!
+_SV_IMPL_SORTAR_ALG( SvByteStringsISort, ByteStringPtr )
+void SvByteStringsISort::DeleteAndDestroy( USHORT nP, USHORT nL )
+{
+ if( nL )
+ {
+ DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
+ for( USHORT n=nP; n < nP + nL; n++ )
+ delete *((ByteStringPtr*)pData+n);
+ SvPtrarr::Remove( nP, nL );
+ }
+}
+BOOL SvByteStringsISort::Seek_Entry( const ByteStringPtr aE, USHORT* pP ) const
+{
+ register USHORT nO = SvByteStringsISort_SAR::Count(),
+ nM,
+ nU = 0;
+ if( nO > 0 )
+ {
+ nO--;
+ while( nU <= nO )
+ {
+ nM = nU + ( nO - nU ) / 2;
+ StringCompare eCmp = (*((ByteStringPtr*)pData + nM))->
+ CompareIgnoreCaseToAscii( *(aE) );
+ if( COMPARE_EQUAL == eCmp )
+ {
+ if( pP ) *pP = nM;
+ return TRUE;
+ }
+ else if( COMPARE_LESS == eCmp )
+ nU = nM + 1;
+ else if( nM == 0 )
+ {
+ if( pP ) *pP = nU;
+ return FALSE;
+ }
+ else
+ nO = nM - 1;
+ }
+ }
+ if( pP ) *pP = nU;
+ return FALSE;
+}
+
+
+// Array mit anderer Seek-Methode!
+_SV_IMPL_SORTAR_ALG( SvByteStringsISortDtor, ByteStringPtr )
+void SvByteStringsISortDtor::DeleteAndDestroy( USHORT nP, USHORT nL )
+{
+ if( nL )
+ {
+ DBG_ASSERT( nP < nA && nP + nL <= nA, "ERR_VAR_DEL" );
+ for( USHORT n=nP; n < nP + nL; n++ )
+ delete *((ByteStringPtr*)pData+n);
+ SvPtrarr::Remove( nP, nL );
+ }
+}
+BOOL SvByteStringsISortDtor::Seek_Entry( const ByteStringPtr aE, USHORT* pP ) const
+{
+ register USHORT nO = SvByteStringsISortDtor_SAR::Count(),
+ nM,
+ nU = 0;
+ if( nO > 0 )
+ {
+ nO--;
+ while( nU <= nO )
+ {
+ nM = nU + ( nO - nU ) / 2;
+ StringCompare eCmp = (*((ByteStringPtr*)pData + nM))->
+ CompareIgnoreCaseToAscii( *(aE) );
+ if( COMPARE_EQUAL == eCmp )
+ {
+ if( pP ) *pP = nM;
+ return TRUE;
+ }
+ else if( COMPARE_LESS == eCmp )
+ nU = nM + 1;
+ else if( nM == 0 )
+ {
+ if( pP ) *pP = nU;
+ return FALSE;
+ }
+ else
+ nO = nM - 1;
+ }
+ }
+ if( pP ) *pP = nU;
+ return FALSE;
+}
+
diff --git a/svtools/source/misc/config.src b/svtools/source/misc/config.src
new file mode 100644
index 000000000000..fe948229cfe7
--- /dev/null
+++ b/svtools/source/misc/config.src
@@ -0,0 +1,1005 @@
+/*************************************************************************
+ *
+ * $RCSfile: config.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:01 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "svtools.hrc"
+
+String STR_WARNING_ITEM
+{
+ TEXT = "Eintrag hat falsche Version!" ;
+ TEXT [ English ] = "Item has wrong version!" ;
+ TEXT [ norwegian ] = "Element har feil versjon!" ;
+ TEXT [ italian ] = "La voce ha una versione errata!" ;
+ TEXT [ portuguese_brazilian ] = "Versão errada do item!" ;
+ TEXT [ portuguese ] = "O registo tem a versão errada!" ;
+ TEXT [ finnish ] = "Kohteen versio on väärä!" ;
+ TEXT [ danish ] = "Elementets version er forkert! " ;
+ TEXT [ french ] = "Version incorrecte !" ;
+ TEXT [ swedish ] = "Post har fel version!" ;
+ TEXT [ dutch ] = "Verkeerde versie van item!" ;
+ TEXT [ spanish ] = "¡La entrada contiene una versión incorrecta!" ;
+ TEXT [ english_us ] = "Incorrect Version!" ;
+ TEXT[ chinese_simplified ] = "ÌõÄ¿°æ±¾ÎÞЧ";
+ TEXT[ russian ] = "Íåïðàâèëüíàÿ âåðñèÿ ýëåìåíòà!";
+ TEXT[ polish ] = "Wersja elementu jest nieprawid³owa!";
+ TEXT[ japanese ] = "“ü—Í€–ڂͳ‚µ‚­‚È‚¢ÊÞ°¼Þ®Ý‚Å‚·!";
+ TEXT[ chinese_traditional ] = "¶µ¥Øª©¥»µL®Ä";
+ TEXT[ arabic ] = "ÇáÅÏÎÇá áå ÅÕÏÇÑ ÎÇØÆ!";
+ TEXT[ dutch ] = "Verkeerde versie van item!";
+ TEXT[ chinese_simplified ] = "ÌõÄ¿°æ±¾ÎÞЧ";
+ TEXT[ greek ] = "Ç åããñáöÞ õðÜñ÷åé óå ëÜèïò Ýêäïóç!";
+ TEXT[ korean ] = "¾ÆÀÌÅÛÀÌ À߸øµÈ ¹öÁ¯À» °¡Áö°í ÀÖ½À´Ï´Ù!";
+ TEXT[ turkish ] = "Giriþin sürümü yanlýþ!";
+ TEXT[ language_user1 ] = " ";
+};
+String STR_KEY_SUB_INI
+{
+ Text = "Untergeordnete Ini-Datei" ;
+ Text [ English ] = "Sub ini file" ;
+ Text [ norwegian ] = "+++Sub ini fil" ;
+ Text [ italian ] = "File ini sub" ;
+ Text [ portuguese_brazilian ] = "Arquivo sub ini" ;
+ Text [ portuguese ] = "Ficheiro sub-ini" ;
+ Text [ finnish ] = "ini.alitiedosto" ;
+ Text [ danish ] = "Underordnet Ini-fil" ;
+ Text [ french ] = "Fichier Sub-ini" ;
+ Text [ swedish ] = "Underordnad Ini-fil" ;
+ Text [ dutch ] = "Sub ini bestand" ;
+ Text [ spanish ] = "Archivo sub ini" ;
+ Text [ english_us ] = "Subordinate Ini File" ;
+ Text[ chinese_simplified ] = "ÏÂÊôµÄ Ini-Îļþ";
+ Text[ russian ] = "Ïîäôàéë Ini";
+ Text[ polish ] = "Plik podrzêdny Ini";
+ Text[ japanese ] = "»ÌÞ Ini ̧²Ù";
+ Text[ chinese_traditional ] = "¤UÄݪºIni-ÀÉ®×";
+ Text[ arabic ] = "ãáÝ Ini ÝÑÚí";
+ Text[ dutch ] = "Sub ini bestand";
+ Text[ chinese_simplified ] = "ÏÂÊôµÄ Ini-Îļþ";
+ Text[ greek ] = "ÕöéóôÜìåíï áñ÷åßï Ini";
+ Text[ korean ] = "¼­ºê Ini ÆÄÀÏ";
+ Text[ turkish ] = "Alt ini dosyasý";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_CONFIG_DIR
+{
+ Text = "Konfiguration" ;
+ Text [ English ] = "Configuration" ;
+ Text [ norwegian ] = "Konfigurasjoner" ;
+ Text [ italian ] = "Configurazione" ;
+ Text [ portuguese_brazilian ] = "Configurações" ;
+ Text [ portuguese ] = "Configuração" ;
+ Text [ finnish ] = "Määritykset" ;
+ Text [ danish ] = "Konfigurationer" ;
+ Text [ french ] = "Configuration" ;
+ Text [ swedish ] = "Konfiguration" ;
+ Text [ dutch ] = "Configuraties" ;
+ Text [ spanish ] = "Configuración" ;
+ Text [ english_us ] = "Configuration" ;
+ Text[ chinese_simplified ] = "ÅäÖÃ";
+ Text[ russian ] = "Êîíôèãóðàöèÿ";
+ Text[ polish ] = "Ustawienia";
+ Text[ japanese ] = "Ý’è";
+ Text[ chinese_traditional ] = "°t¸m";
+ Text[ arabic ] = "Êßæíä";
+ Text[ dutch ] = "Configuraties";
+ Text[ chinese_simplified ] = "ÅäÖÃ";
+ Text[ greek ] = "ÐáñÜìåôñïé";
+ Text[ korean ] = "¼³Á¤";
+ Text[ turkish ] = "Konfigürasyon";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_WORK_PATH
+{
+ Text = "Arbeitsverzeichnis" ;
+ Text [ English ] = "Working path" ;
+ Text [ norwegian ] = "Arbeidsbane" ;
+ Text [ italian ] = "Cartella di lavoro" ;
+ Text [ portuguese_brazilian ] = "Caminho de trabalho" ;
+ Text [ portuguese ] = "Pasta de trabalho" ;
+ Text [ finnish ] = "Työhakemisto" ;
+ Text [ danish ] = "Arbejdsmappe" ;
+ Text [ french ] = "Dossier de travail" ;
+ Text [ swedish ] = "Arbetsmapp" ;
+ Text [ dutch ] = "Werkmap" ;
+ Text [ spanish ] = "Directorio de trabajo" ;
+ Text [ english_us ] = "My Documents" ;
+ Text[ chinese_simplified ] = "¹¤×÷Ŀ¼";
+ Text[ russian ] = "Ðàáî÷àÿ ïàïêà";
+ Text[ polish ] = "Folder roboczy";
+ Text[ japanese ] = "Ü°·Ý¸ÞÃÞ¨Ú¸ÄØ";
+ Text[ chinese_traditional ] = "¤u§@¥Ø¿ý";
+ Text[ arabic ] = "ãÓÊäÏÇÊí";
+ Text[ dutch ] = "Werkmap";
+ Text[ chinese_simplified ] = "¹¤×÷Ŀ¼";
+ Text[ greek ] = "ÊáôÜëïãïò åñãáóßáò";
+ Text[ korean ] = "³» ¹®¼­";
+ Text[ turkish ] = "Çalýþma dizini";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_GRAPHICS_PATH
+{
+ Text = "Grafiken" ;
+ Text [ English ] = "Grafics" ;
+ Text [ norwegian ] = "Grafikk" ;
+ Text [ italian ] = "Immagini" ;
+ Text [ portuguese_brazilian ] = "Gráficos" ;
+ Text [ portuguese ] = "Imagens" ;
+ Text [ finnish ] = "Grafiikka" ;
+ Text [ danish ] = "Billeder" ;
+ Text [ french ] = "Images" ;
+ Text [ swedish ] = "Grafiker" ;
+ Text [ dutch ] = "Afbeeldingen" ;
+ Text [ spanish ] = "Imágenes" ;
+ Text [ english_us ] = "Graphics" ;
+ Text[ chinese_simplified ] = "ͼÐÎ";
+ Text[ russian ] = "Ãðàôèêè";
+ Text[ polish ] = "Grafiki";
+ Text[ japanese ] = "¸Þ×̨¯¸½";
+ Text[ chinese_traditional ] = "¹Ï§Î";
+ Text[ arabic ] = "ÕæÑ";
+ Text[ dutch ] = "Afbeeldingen";
+ Text[ chinese_simplified ] = "ͼÐÎ";
+ Text[ greek ] = "ÃñáöéêÜ";
+ Text[ korean ] = "±×·¡ÇÈ";
+ Text[ turkish ] = "Grafik";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_BITMAP_PATH
+{
+ Text = "Symbole" ;
+ Text [ English ] = "Symbols" ;
+ Text [ english_us ] = "Icons" ;
+ Text [ italian ] = "Simboli" ;
+ Text [ spanish ] = "Símbolos" ;
+ Text [ french ] = "Icônes" ;
+ Text [ dutch ] = "Symbolen" ;
+ Text [ swedish ] = "Symboler" ;
+ Text [ danish ] = "Symboler" ;
+ Text [ portuguese ] = "Símbolos" ;
+ Text [ portuguese_brazilian ] = "Symbole" ;
+ Text[ chinese_simplified ] = "ͼ±ê";
+ Text[ russian ] = "Ñèìâîëû";
+ Text[ polish ] = "Symbole";
+ Text[ japanese ] = "¼ÝÎÞÙ";
+ Text[ chinese_traditional ] = "¹Ï¥Ü";
+ Text[ arabic ] = "ÑãæÒ";
+ Text[ dutch ] = "Symbolen";
+ Text[ chinese_simplified ] = "ͼ±ê";
+ Text[ greek ] = "Óýìâïëá";
+ Text[ korean ] = "±âÈ£";
+ Text[ language_user1 ] = "BLG 18.01.00 : Ds la liste des chemin \"Outils - Options - Chemins\"";
+ Text[ turkish ] = "Simgeler";
+};
+String STR_KEY_BASIC_PATH
+{
+ Text = "BASIC" ;
+};
+String STR_KEY_DATABASE_PATH
+{
+ Text = "Datenbankanfragen" ;
+ Text [ English ] = "Database queries" ;
+ Text [ norwegian ] = "Database" ;
+ Text [ italian ] = "Ricerca database" ;
+ Text [ portuguese_brazilian ] = "Base de Dados" ;
+ Text [ portuguese ] = "Consultas à base de dados" ;
+ Text [ finnish ] = "Tietokanta" ;
+ Text [ danish ] = "Databaseforespørgsler" ;
+ Text [ french ] = "Interrogations de B.D." ;
+ Text [ swedish ] = "Databasfrågor" ;
+ Text [ dutch ] = "Database query's" ;
+ Text [ spanish ] = "Consulta de base de datos" ;
+ Text [ english_us ] = "Database Queries" ;
+ Text[ chinese_simplified ] = "²éѯÊý¾Ý¿â";
+ Text[ russian ] = "Çàïðîñû áàçû äàííûõ";
+ Text[ polish ] = "Kwerendy bazy danych";
+ Text[ japanese ] = "ÃÞ°ÀÍÞ°½ ¸´Ø°";
+ Text[ chinese_traditional ] = "¬d¸ß¸ê®Æ®w";
+ Text[ arabic ] = "ÇÓÊÚáÇãÇÊ ÞÇÚÏÉ ÇáÈíÇäÇÊ";
+ Text[ dutch ] = "Database query's";
+ Text[ chinese_simplified ] = "²éѯÊý¾Ý¿â";
+ Text[ greek ] = "ÅñùôÞìáôá âÜóçò äåäïìÝíùí";
+ Text[ korean ] = "µ¥ÀÌÅͺ£À̽º ÁúÀÇ";
+ Text[ turkish ] = "Veritabaný sorgularý";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_PALETTE_PATH
+{
+ Text = "Paletten" ;
+ Text [ English ] = "Pallets" ;
+ Text [ norwegian ] = "Palletter" ;
+ Text [ italian ] = "Tavolozze" ;
+ Text [ portuguese_brazilian ] = "Paletas" ;
+ Text [ portuguese ] = "Paletas" ;
+ Text [ finnish ] = "Paletit" ;
+ Text [ danish ] = "Paletter" ;
+ Text [ french ] = "Palettes" ;
+ Text [ swedish ] = "Paletter" ;
+ Text [ dutch ] = "Paletten" ;
+ Text [ spanish ] = "Paletas" ;
+ Text [ english_us ] = "Palettes" ;
+ Text[ chinese_simplified ] = "µ÷É«°å";
+ Text[ russian ] = "Ïàëèòðà";
+ Text[ polish ] = "Paleta";
+ Text[ japanese ] = "ÊßÚ¯Ä";
+ Text[ chinese_traditional ] = "¦âªO";
+ Text[ arabic ] = "áæÍÇÊ ÃáæÇä ÑÓã";
+ Text[ dutch ] = "Paletten";
+ Text[ chinese_simplified ] = "µ÷É«°å";
+ Text[ greek ] = "ÐáëÝôåò";
+ Text[ korean ] = "ÆÄ·¹Æ®";
+ Text[ turkish ] = "Paletler";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_BACKUP_PATH
+{
+ Text = "Sicherungskopien" ;
+ Text [ English ] = "Backup" ;
+ Text [ norwegian ] = "Sikkerhetskopi" ;
+ Text [ italian ] = "Backup" ;
+ Text [ portuguese_brazilian ] = "Backup" ;
+ Text [ portuguese ] = "Cópias de segurança" ;
+ Text [ finnish ] = "Varmistus" ;
+ Text [ danish ] = "Sikkerhedskopier" ;
+ Text [ french ] = "Copies de sauvegarde" ;
+ Text [ swedish ] = "Säkerhetskopior" ;
+ Text [ dutch ] = "Reservekopieën" ;
+ Text [ spanish ] = "Copias de seguridad" ;
+ Text [ english_us ] = "Backup Copies" ;
+ Text[ chinese_simplified ] = "°²È«±¸¼þ";
+ Text[ russian ] = "Ðåçåðâíûå êîïèè";
+ Text[ polish ] = "Kopie zapasowe";
+ Text[ japanese ] = "ÊÞ¯¸±¯Ìß ºËß°";
+ Text[ chinese_traditional ] = "¦w¥þ³Æ¥ó";
+ Text[ arabic ] = "äÓÎ ÇÍÊíÇØíÉ";
+ Text[ dutch ] = "Reservekopieën";
+ Text[ chinese_simplified ] = "°²È«±¸¼þ";
+ Text[ greek ] = "Áíôßãñáöá áóöáëåßáò";
+ Text[ korean ] = "¹é¾÷ º¹»ç";
+ Text[ turkish ] = "Yedekleme kopyalarý";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_MODULES_PATH
+{
+ Text = "Module" ;
+ Text [ English ] = "Modules" ;
+ Text [ norwegian ] = "Moduler" ;
+ Text [ italian ] = "Moduli" ;
+ Text [ portuguese_brazilian ] = "Módulos" ;
+ Text [ portuguese ] = "Módulos" ;
+ Text [ finnish ] = "Moduulit" ;
+ Text [ danish ] = "Moduler" ;
+ Text [ french ] = "Modules" ;
+ Text [ swedish ] = "Moduler" ;
+ Text [ dutch ] = "Modules" ;
+ Text [ spanish ] = "Módulos" ;
+ Text [ english_us ] = "Modules" ;
+ Text[ chinese_simplified ] = "Ä£¿é";
+ Text[ russian ] = "Ìîäóëè";
+ Text[ polish ] = "Modu³y";
+ Text[ japanese ] = "Ó¼Þ­°Ù";
+ Text[ chinese_traditional ] = "¼Ò¶ô";
+ Text[ arabic ] = "æÍÏÇÊ äãØíÉ";
+ Text[ dutch ] = "Modules";
+ Text[ chinese_simplified ] = "Ä£¿é";
+ Text[ greek ] = "ËåéôïõñãéêÝò ìïíÜäåò";
+ Text[ korean ] = "¸ðµâ";
+ Text[ turkish ] = "Modüller";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_TEMPLATE_PATH
+{
+ Text = "Dokumentvorlagen" ;
+ Text [ English ] = "Dokument templates" ;
+ Text [ norwegian ] = "Dokumentmaler" ;
+ Text [ italian ] = "Modelli" ;
+ Text [ portuguese_brazilian ] = "Modelos de documento" ;
+ Text [ portuguese ] = "Modelos de documentos" ;
+ Text [ finnish ] = "Asiakirjamallit" ;
+ Text [ danish ] = "Dokumentskabeloner" ;
+ Text [ french ] = "Modèles de document" ;
+ Text [ swedish ] = "Dokumentmallar" ;
+ Text [ dutch ] = "Sjablonen" ;
+ Text [ spanish ] = "Plantilla de documento" ;
+ Text [ english_us ] = "Templates" ;
+ Text[ chinese_simplified ] = "ÎĵµÑùʽ";
+ Text[ russian ] = "Øàáëîíû äîêóìåíòà";
+ Text[ polish ] = "Szablony dokumentu";
+ Text[ japanese ] = "ÄÞ·­ÒÝÄ‚ÌÃÝÌßÚ°Ä";
+ Text[ chinese_traditional ] = "¤å¥ó¼Ë¦¡";
+ Text[ arabic ] = "ÞæÇáÈ ãÓÊäÏ";
+ Text[ dutch ] = "Sjablonen";
+ Text[ chinese_simplified ] = "ÎĵµÑùʽ";
+ Text[ greek ] = "Ðñüôõðá åããñÜöùí";
+ Text[ korean ] = "¹®¼­ ÅÛÇø®Æ®";
+ Text[ turkish ] = "Belge þablonlarý";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_GLOSSARY_PATH
+{
+ Text = "AutoText" ;
+ Text [ English ] = "AutoText";
+ Text[ english_us ] = "AutoText";
+ Text[ portuguese ] = "AutoTexto";
+ Text[ russian ] = "Àâòîòåêñò";
+ Text[ greek ] = "ÁõôïÊåßìåíï";
+ Text[ dutch ] = "AutoTekst";
+ Text[ french ] = "AutoTexte";
+ Text[ spanish ] = "AutoText";
+ Text[ italian ] = "Testo automatico";
+ Text[ danish ] = "AutoTekst";
+ Text[ swedish ] = "AutoText";
+ Text[ polish ] = "Autotekst";
+ Text[ portuguese_brazilian ] = "AutoText";
+ Text[ japanese ] = "“ü—ÍŽx‰‡";
+ Text[ korean ] = "AutoText";
+ Text[ chinese_simplified ] = "×Ô¶¯Í¼Îļ¯";
+ Text[ chinese_traditional ] = "¦Û°Ê¹Ï¤å¶°";
+ Text[ turkish ] = "AutoText";
+ Text[ arabic ] = "äÕ ÊáÞÇÆí";
+};
+String STR_KEY_DICTIONARY_PATH
+{
+ Text = "Wörterbücher" ;
+ Text [ English ] = "Dictionaries" ;
+ Text [ norwegian ] = "Ordlister" ;
+ Text [ italian ] = "Dizionari" ;
+ Text [ portuguese_brazilian ] = "Dicionários" ;
+ Text [ portuguese ] = "Dicionários" ;
+ Text [ french ] = "Dictionnaires" ;
+ Text [ dutch ] = "Woordenboeken" ;
+ Text [ spanish ] = "Diccionarios" ;
+ Text [ danish ] = "Ordbøger" ;
+ Text [ swedish ] = "Ordböcker" ;
+ Text [ finnish ] = "Dictionaries" ;
+ Text [ english_us ] = "Dictionaries" ;
+ Text[ chinese_simplified ] = "×Öµä";
+ Text[ russian ] = "Ñëîâàðè";
+ Text[ polish ] = "S³owniki";
+ Text[ japanese ] = "Ž«‘";
+ Text[ chinese_traditional ] = "¦r¨å";
+ Text[ arabic ] = "ÇáÞæÇãíÓ";
+ Text[ dutch ] = "Woordenboeken";
+ Text[ chinese_simplified ] = "×Öµä";
+ Text[ greek ] = "ËåîéêÜ";
+ Text[ korean ] = "ȍ˟";
+ Text[ turkish ] = "Sözlükler";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_DESKTOP_DIR
+{
+ Text = "Desktop" ;
+ Text [ English ] = "Desktop" ;
+ Text [ dutch ] = "Desktop" ;
+ Text [ english_us ] = "Desktop" ;
+ Text [ italian ] = "Desktop" ;
+ Text [ spanish ] = "Escritorio" ;
+ Text [ french ] = "Desktop" ;
+ Text [ swedish ] = "Desktop" ;
+ Text [ danish ] = "Desktop" ;
+ Text [ portuguese ] = "Desktop" ;
+ Text [ portuguese_brazilian ] = "Desktop" ;
+ Text[ chinese_simplified ] = "×ÀÃæ";
+ Text[ russian ] = "Ðàáî÷èé ñòîë";
+ Text[ polish ] = "Pulpit";
+ Text[ japanese ] = "ÃÞ½¸Ä¯Ìß";
+ Text[ chinese_traditional ] = "®à­±";
+ Text[ arabic ] = "ÓØÍ ÇáãßÊÈ";
+ Text[ dutch ] = "Desktop";
+ Text[ chinese_simplified ] = "×ÀÃæ";
+ Text[ greek ] = "Desktop";
+ Text[ korean ] = "µ¥½ºÅ© ž";
+ Text[ turkish ] = "Masaüstü";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_EXPLORER_DIR
+{
+ Text = "Explorer" ;
+ Text [ English ] = "Explorer" ;
+ Text [ portuguese ] = "Explorer" ;
+ Text [ english_us ] = "Explorer" ;
+ Text [ portuguese_brazilian ] = "Explorer" ;
+ Text [ swedish ] = "Explorer" ;
+ Text [ danish ] = "Explorer" ;
+ Text [ italian ] = "Explorer" ;
+ Text [ spanish ] = "Explorador" ;
+ Text [ french ] = "Explorer" ;
+ Text [ dutch ] = "Explorer" ;
+ Text[ chinese_simplified ] = "×ÊÔ´¹ÜÀíÆ÷";
+ Text[ russian ] = "Ïðîâîäíèê";
+ Text[ polish ] = "Eksplorator";
+ Text[ japanese ] = "´¸½ÌßÛ°×";
+ Text[ chinese_traditional ] = "ÀÉ®×Á`ºÞ";
+ Text[ arabic ] = "ÇáãÓÊßÔÝ";
+ Text[ dutch ] = "Explorer";
+ Text[ chinese_simplified ] = "×ÊÔ´¹ÜÀíÆ÷";
+ Text[ greek ] = "Explorer";
+ Text[ korean ] = "ÀͽºÇ÷¯·Î";
+ Text[ turkish ] = "Explorer";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_HELP_DIR
+{
+ Text = "Hilfedateien" ;
+ Text [ English ] = "Helpfiles" ;
+ Text [ english_us ] = "Help" ;
+ Text [ italian ] = "File della Guida" ;
+ Text [ spanish ] = "Archivos de ayuda" ;
+ Text [ french ] = "Fichiers d'aide" ;
+ Text [ dutch ] = "Help-bestanden" ;
+ Text [ swedish ] = "Hjälpfiler" ;
+ Text [ danish ] = "Hjælp-filer" ;
+ Text [ portuguese ] = "Ficheiros de ajuda" ;
+ Text [ portuguese_brazilian ] = "Hilfedateien" ;
+ Text[ chinese_simplified ] = "ÇóÖúÎļþ";
+ Text[ russian ] = "Ôàéëû ñïðàâêè";
+ Text[ polish ] = "Pliki pomocy";
+ Text[ japanese ] = "ÍÙÌß̧²Ù";
+ Text[ chinese_traditional ] = "»¡©úÀÉ®×";
+ Text[ arabic ] = "ãáÝÇÊ ÇáãÓÇÚÏÉ";
+ Text[ dutch ] = "Help-bestanden";
+ Text[ chinese_simplified ] = "ÇóÖúÎļþ";
+ Text[ greek ] = "Áñ÷åßá âïÞèåéáò";
+ Text[ korean ] = "µµ¿ò¸» ÆÄÀÏ";
+ Text[ turkish ] = "Yardým dosyalarý";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_BOOKMARK_DIR
+{
+ Text = "Bookmarks" ;
+ Text [ English ] = "Bookmarks" ;
+ Text [ dutch ] = "Bookmarks" ;
+ Text [ english_us ] = "Bookmarks" ;
+ Text [ italian ] = "Bookmark" ;
+ Text [ spanish ] = "Marcadores" ;
+ Text [ french ] = "Bookmarks" ;
+ Text [ swedish ] = "Bokmärken" ;
+ Text [ danish ] = "Bogmærker" ;
+ Text [ portuguese ] = "Marcadores" ;
+ Text [ portuguese_brazilian ] = "Bookmarks" ;
+ Text[ chinese_simplified ] = "ÊéÇ©";
+ Text[ russian ] = "Çàêëàäêè";
+ Text[ polish ] = "Zak³adki";
+ Text[ japanese ] = "ÌÞ¯¸Ï°¸";
+ Text[ chinese_traditional ] = "®ÑÅÒ";
+ Text[ arabic ] = "ÅÔÇÑÇÊ ãÑÌÚíÉ";
+ Text[ dutch ] = "Bookmarks";
+ Text[ chinese_simplified ] = "ÊéÇ©";
+ Text[ greek ] = "Óåëéäïäåßêôçò";
+ Text[ korean ] = "Ã¥°¥ÇÇ";
+ Text[ turkish ] = "Yer iþareti";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_GALLERY_DIR
+{
+ Text = "Gallery" ;
+ Text [ English ] = "Gallery" ;
+ Text [ dutch ] = "Gallery" ;
+ Text [ english_us ] = "Gallery" ;
+ Text [ italian ] = "Gallery" ;
+ Text [ spanish ] = "Gallery" ;
+ Text [ french ] = "Gallery" ;
+ Text [ swedish ] = "Gallery" ;
+ Text [ danish ] = "Gallery" ;
+ Text [ portuguese ] = "Gallery" ;
+ Text [ portuguese_brazilian ] = "Gallery" ;
+ Text[ chinese_simplified ] = "»­ÀÈ";
+ Text[ russian ] = "Ãàëåðåÿ";
+ Text[ polish ] = "Galeria";
+ Text[ japanese ] = "·Þ¬×Ø°";
+ Text[ chinese_traditional ] = "µe´Y";
+ Text[ arabic ] = "ÇáÌÇáíÑí";
+ Text[ dutch ] = "Gallery";
+ Text[ chinese_simplified ] = "»­ÀÈ";
+ Text[ greek ] = "Gallery";
+ Text[ korean ] = "°¶·¯¸®";
+ Text[ turkish ] = "Galeri";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_NEW_DIR
+{
+ Text = "Standardvorlagen" ;
+ Text [ English ] = "standard templates" ;
+ Text [ dutch ] = "Standaardsjablonen" ;
+ Text [ english_us ] = "Default Templates" ;
+ Text [ swedish ] = "Standardformatmallar" ;
+ Text [ danish ] = "Standardskabeloner" ;
+ Text [ italian ] = "Modelli standard" ;
+ Text [ spanish ] = "Plantillas predeterminadas" ;
+ Text [ french ] = "Modèles par défaut" ;
+ Text [ portuguese ] = "Modelos-padrão" ;
+ Text [ portuguese_brazilian ] = "Standardvorlagen" ;
+ Text[ chinese_simplified ] = "±ê×¼Ñùʽ";
+ Text[ russian ] = "Ñòàíäàðòíûå øàáëîíû";
+ Text[ polish ] = "Szablony standardowe";
+ Text[ japanese ] = "•W€½À²Ù";
+ Text[ chinese_traditional ] = "¼Ð·Ç¼Ë¦¡";
+ Text[ arabic ] = "ÞæÇáÈ ÞíÇÓíÉ";
+ Text[ dutch ] = "Standaardsjablonen";
+ Text[ chinese_simplified ] = "±ê×¼Ñùʽ";
+ Text[ greek ] = "Ðñüôõðá ðñïåðéëïãÞò";
+ Text[ korean ] = "±âº» ÅÛÇø®Æ®";
+ Text[ turkish ] = "Standart þablonlar";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_AGENT_DIR
+{
+ Text = "Agents" ;
+ Text [ English ] = "Agents" ;
+ Text [ dutch ] = "Agenten" ;
+ Text [ english_us ] = "Agents" ;
+ Text [ swedish ] = "Agenter" ;
+ Text [ danish ] = "Agenter" ;
+ Text [ italian ] = "Agents" ;
+ Text [ spanish ] = "Agentes" ;
+ Text [ french ] = "Agents" ;
+ Text [ portuguese_brazilian ] = "Agents" ;
+ Text [ portuguese ] = "Agentes" ;
+ Text[ chinese_simplified ] = "ÖúÀí";
+ Text[ russian ] = "Àññèñòåíòû";
+ Text[ polish ] = "Agenci";
+ Text[ japanese ] = "´°¼ÞªÝÄ";
+ Text[ chinese_traditional ] = "§U²z";
+ Text[ arabic ] = "ÚãáÇÁ";
+ Text[ dutch ] = "Agenten";
+ Text[ chinese_simplified ] = "ÖúÀí";
+ Text[ greek ] = "ÐñïãñÜììáôá Agent";
+ Text[ korean ] = "¿¡ÀÌÀüÆ®";
+ Text[ turkish ] = "Aracý";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_TRASH_DIR
+{
+ Text = "Papierkorb" ;
+ Text [ English ] = "Trash" ;
+ Text [ English_US ] = "Recycle Bin" ;
+ Text [ portuguese ] = "Reciclagem" ;
+ Text [ portuguese_brazilian ] = "Mülleimer" ;
+ Text [ swedish ] = "Papperskorg" ;
+ Text [ danish ] = "Papirkurv" ;
+ Text [ italian ] = "Cestino" ;
+ Text [ spanish ] = "Papelera" ;
+ Text [ french ] = "Corbeille" ;
+ Text [ dutch ] = "Prullenbak" ;
+ Text[ chinese_simplified ] = "»ØÊÕÕ¾";
+ Text[ russian ] = "Êîðçèíà";
+ Text[ polish ] = "Kosz";
+ Text[ japanese ] = "‚²‚Ý” ";
+ Text[ chinese_traditional ] = "¸ê·½¦^¦¬µ©";
+ Text[ arabic ] = "ÓáÉ ÇáãÍÐæÝÇÊ";
+ Text[ dutch ] = "Prullenbak";
+ Text[ chinese_simplified ] = "»ØÊÕÕ¾";
+ Text[ greek ] = "ÊÜäïò áíáêýêëùóçò";
+ Text[ korean ] = "ÈÞÁöÅë";
+ Text[ turkish ] = "Çöp kutusu";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_STORAGE_DIR
+{
+ Text = "Nachrichtenspeicher" ;
+ Text [ English ] = "Mail Storages" ;
+ Text [ portuguese ] = "Memória de mensagens" ;
+ Text [ english_us ] = "Mail/News Storage" ;
+ Text [ portuguese_brazilian ] = "Nachrichtenspeicher" ;
+ Text [ swedish ] = "Meddelandelager" ;
+ Text [ danish ] = "Meddelelseslager" ;
+ Text [ italian ] = "Memoria messaggi" ;
+ Text [ spanish ] = "Memoria de mensajes" ;
+ Text [ french ] = "Mémoire pour messages" ;
+ Text [ dutch ] = "Geheugen voor berichten" ;
+ Text[ chinese_simplified ] = "µç×ÓÓʼþ/ÐÂÎÅ´¢´æÌå";
+ Text[ russian ] = "Íàêîïèòåëü ñîîáùåíèé";
+ Text[ polish ] = "Pamiêæ wiadomoœci";
+ Text[ japanese ] = "Ò¯¾°¼Þ—pÒÓØ";
+ Text[ chinese_traditional ] = "¹q¤l¶l¥ó/·s»DÀx¦sÅé";
+ Text[ arabic ] = "ÍÝÙ ÇáÃÎÈÇÑ";
+ Text[ dutch ] = "Geheugen voor berichten";
+ Text[ chinese_simplified ] = "µç×ÓÓʼþ/ÐÂÎÅ´¢´æÌå";
+ Text[ greek ] = "ÁðïèÞêåõóç ìçíõìÜôùí";
+ Text[ korean ] = "¿ìÆí/´º½º ÀúÀå¼Ò";
+ Text[ turkish ] = "Ýleti depolama alaný";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_STARTMENU_DIR
+{
+ Text = "Start-Menü" ;
+ Text [ English ] = "Start-Menu" ;
+ Text [ portuguese ] = "Menu de início" ;
+ Text [ english_us ] = "Start Menu" ;
+ Text [ portuguese_brazilian ] = "Start-Menü" ;
+ Text [ swedish ] = "Startmeny" ;
+ Text [ danish ] = "Start-menu" ;
+ Text [ italian ] = "Menu di avvio" ;
+ Text [ spanish ] = "Menú de inicio" ;
+ Text [ french ] = "Menu Démarrer" ;
+ Text [ dutch ] = "Startmenu" ;
+ Text[ chinese_simplified ] = "¿ªÊ¼²Ëµ¥ÃüÁî";
+ Text[ russian ] = "Ìåíþ çàïóñêà";
+ Text[ polish ] = "Menu Start";
+ Text[ japanese ] = "½À°ÄÒÆ­°";
+ Text[ chinese_traditional ] = "¶}©l¥\\¯àªí";
+ Text[ arabic ] = "ÞÇÆãÉ ÇáÈÏÁ";
+ Text[ dutch ] = "Startmenu";
+ Text[ chinese_simplified ] = "¿ªÊ¼²Ëµ¥ÃüÁî";
+ Text[ greek ] = "Ìåíïý åêêßíçóçò";
+ Text[ korean ] = "½ÃÀÛ ¸Þ´º";
+ Text[ turkish ] = "Baþlat mönüsü";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_DOWNLOAD_DIR
+{
+ Text = "Download-Verzeichnis" ;
+ Text [ english_us ] = "Downloads" ;
+ Text [ portuguese ] = "Atalho de descarga" ;
+ Text [ portuguese_brazilian ] = "Download-Verzeichnis" ;
+ Text [ swedish ] = "Nerladdningskatalog" ;
+ Text [ danish ] = "Overførsels-bibliotek" ;
+ Text [ italian ] = "Cartella download" ;
+ Text [ spanish ] = "Ruta de descarga" ;
+ Text [ french ] = "Répertoire de Téléchargement (Download)" ;
+ Text [ dutch ] = "Download-map" ;
+ Text[ chinese_simplified ] = "ÏÂÔØĿ¼";
+ Text[ russian ] = "Êàòàëîã çàãðóçêè";
+ Text[ polish ] = "Katalog pobierania";
+ Text[ japanese ] = "ÀÞ³ÝÛ°ÄÞ ÃÞ¨Ú¸ÄØ";
+ Text[ chinese_traditional ] = "¤U¸ü¥Ø¿ý";
+ Text[ arabic ] = "ãÓÇÑÇáÊäÒíá";
+ Text[ dutch ] = "Download-map";
+ Text[ chinese_simplified ] = "ÏÂÔØĿ¼";
+ Text[ greek ] = "ÊáôÜëïãïò ëÞøçò áñ÷åßùí";
+ Text[ korean ] = "´Ù¿î·Îµå °æ·Î";
+ Text[ turkish ] = "Ýndirme dizini";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_AUTOSTART_DIR
+{
+ Text = "Autostart-Verzeichnis" ;
+ Text [ english ] = "Autostart path" ;
+ Text [ english_us ] = "AutoStart" ;
+ Text [ portuguese ] = "Directório Autostart" ;
+ Text [ portuguese_brazilian ] = "Autostart-Verzeichnis" ;
+ Text [ swedish ] = "Autostart-katalog" ;
+ Text [ danish ] = "Autostart-bibliotek" ;
+ Text [ italian ] = "Cartella autostart" ;
+ Text [ spanish ] = "Directorio Inicio" ;
+ Text [ french ] = "Répertoire Autostart" ;
+ Text [ dutch ] = "Autostart-map" ;
+ Text[ chinese_simplified ] = "×Ô¶¯Æô¶¯Ä¿Â¼";
+ Text[ russian ] = "Ïàïêà Àâòîçàïóñêà";
+ Text[ polish ] = "Katalog Autostartu";
+ Text[ japanese ] = "µ°Ä½À°Ä ÃÞ¨Ú¸ÄØ";
+ Text[ chinese_traditional ] = "¦Û°Ê±Ò°Êªº¥Ø¿ý";
+ Text[ arabic ] = "ãÓÇÑ ÇáÈÏÁ ÇáÊáÞÇÆí";
+ Text[ dutch ] = "Autostart-map";
+ Text[ chinese_simplified ] = "×Ô¶¯Æô¶¯Ä¿Â¼";
+ Text[ greek ] = "ÊáôÜëïãïò ÁõôïÅêêßíçóçò";
+ Text[ korean ] = "ÀÚµ¿½ÃÀÛ µð·ºÅ丮";
+ Text[ turkish ] = "Otomatik baþlat dizini";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_QUICKSTART_DIR
+{
+ Text = "Quickstart-Verzeichnis" ;
+ Text [ english ] = "Quickstart path" ;
+ Text [ english_us ] = "Quickstart" ;
+ TEXT[ italian ] = "Cartella quickstart";
+ TEXT[ portuguese_brazilian ] = "Quickstart-Verzeichnis";
+ TEXT[ portuguese ] = "Directório Quickstart";
+ TEXT[ danish ] = "Kvikstart-bibliotek";
+ TEXT[ french ] = "Répertoire Quickstart";
+ TEXT[ swedish ] = "Quickstart-mapp";
+ TEXT[ dutch ] = "Quickstart-pad";
+ TEXT[ spanish ] = "Directorio Quickstart";
+ TEXT[ chinese_simplified ] = "¿ìËÙÆô¶¯Ä¿Â¼";
+ TEXT[ russian ] = "Êàòàëîã áûñòðîãî çàïóñêà";
+ TEXT[ polish ] = "Katalog szybkiego startu";
+ TEXT[ japanese ] = "¸²¯¸½À°Ä ÃÞ¨Ú¸ÄØ";
+ TEXT[ chinese_traditional ] = "¨³³t±Ò°Êªº¥Ø¿ý";
+ TEXT[ arabic ] = "Ïáíá Quickstart";
+ TEXT[ dutch ] = "Quickstart-pad";
+ TEXT[ chinese_simplified ] = "¿ìËÙÆô¶¯Ä¿Â¼";
+ TEXT[ greek ] = "ÄéáäñïìÞ ãñÞãïñçò åêêßíçóçò (Quickstart)";
+ TEXT[ korean ] = "ºü¸¥½ÃÀÛ °æ·Î";
+ TEXT[ turkish ] = "Quickstart dizini";
+ TEXT[ language_user1 ] = " ";
+};
+String STR_KEY_AUTOPILOT_DIR
+{
+ Text = "Autopiloten" ;
+ Text [ English ] = "Autopilots" ;
+ Text [ portuguese ] = "AutoPilotos" ;
+ Text [ english_us ] = "AutoPilots" ;
+ Text [ portuguese_brazilian ] = "Autopiloten" ;
+ Text [ swedish ] = "Autopiloter" ;
+ Text [ danish ] = "AutoPiloter" ;
+ Text [ italian ] = "Piloti automatici" ;
+ Text [ spanish ] = "AutoPilotos" ;
+ Text [ french ] = "AutoPilotes" ;
+ Text [ dutch ] = "AutoPiloot" ;
+ Text[ chinese_simplified ] = "×Ô¶¯ÎļþÖúÀí";
+ Text[ russian ] = "Àâòîïèëîòû";
+ Text[ polish ] = "Autopiloci";
+ Text[ japanese ] = "µ°ÄÊß²Û¯Ä";
+ Text[ chinese_traditional ] = "¦Û°ÊÀɮקU²z";
+ Text[ arabic ] = "ãÑÔÏæä Âáíæä";
+ Text[ dutch ] = "AutoPiloot";
+ Text[ chinese_simplified ] = "×Ô¶¯ÎļþÖúÀí";
+ Text[ greek ] = "AutoPilots";
+ Text[ korean ] = "ÀÚµ¿ ÆÄÀÏ·µ";
+ Text[ turkish ] = "Otopilot";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_GROUP_DIR
+{
+ Text = "Gruppenverzeichnis" ;
+ Text [ English ] = "Group path" ;
+ Text [ english_us ] = "Groups" ;
+ Text[ portuguese ] = "Directório de grupo";
+ Text[ russian ] = "Ãðóïïîâîé êàòàëîã";
+ Text[ dutch ] = "Groepdirectory";
+ Text[ french ] = "Répertoire de groupes";
+ Text[ spanish ] = "Directorio de grupo";
+ Text[ italian ] = "Cartella di gruppo";
+ Text[ danish ] = "Gruppebibliotek";
+ Text[ swedish ] = "Gruppkatalog";
+ Text[ polish ] = "Katalog grup";
+ Text[ portuguese_brazilian ] = "Group path";
+ Text[ japanese ] = "¸ÞÙ°Ìß ÃÞ¨Ú¸ÄØ";
+ Text[ chinese_simplified ] = "С×éĿ¼";
+ Text[ chinese_traditional ] = "¸s²Õ¥Ø¿ý";
+ Text[ arabic ] = "Ïáíá ãÌãæÚÇÊ";
+ Text[ dutch ] = "Groepdirectory";
+ Text[ chinese_simplified ] = "С×éĿ¼";
+ Text[ greek ] = "ÊáôÜëïãïò ïìÜäáò";
+ Text[ korean ] = "±×·ì µð·ºÅ丮";
+ Text[ turkish ] = "Grup dizini";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_PLUGINS_PATH
+{
+ Text = "Plugins-Verzeichnis" ;
+ Text [ English ] = "Plugins directory" ;
+ Text[ english_us ] = "Plug-Ins";
+ Text[ portuguese ] = "Directório de plug-ins";
+ Text[ russian ] = "Êàòàëîã Plugins";
+ Text[ dutch ] = "Plugins directory";
+ Text[ french ] = "Répertoire de Plug-Ins";
+ Text[ spanish ] = "Directorio de Plug-ins";
+ Text[ italian ] = "Cartella plugin";
+ Text[ danish ] = "PlugIn-bibliotek";
+ Text[ swedish ] = "Plugins-mapp";
+ Text[ polish ] = "Katalog dodatków Plugin";
+ Text[ portuguese_brazilian ] = "Plugins directory";
+ Text[ japanese ] = "Ìß×¸Þ²Ý ÃÞ¨Ú¸ÄØ";
+ Text[ chinese_simplified ] = "Plug-In Ŀ¼";
+ Text[ chinese_traditional ] = "Plugins ¥Ø¿ý";
+ Text[ arabic ] = "Ïáíá Plugins";
+ Text[ dutch ] = "Plugins directory";
+ Text[ chinese_simplified ] = "Plug-In Ŀ¼";
+ Text[ greek ] = "ÊáôÜëïãïò Plugins";
+ Text[ korean ] = "Ç÷¯±× ÀÎ µð·ºÅ丮";
+ Text[ turkish ] = "Plug-In dizini";
+};
+String STR_KEY_FAVORITES_DIR
+{
+ Text[ language_user1 ] = " ";
+ Text = "Ordner-Bookmarks" ;
+ Text [ English ] = "Folder Bookmarks" ;
+ Text[ english_us ] = "Folder Bookmarks";
+ Text[ portuguese ] = "Pastas correntes";
+ Text[ greek ] = "Óåëéäïäåßêôåò êáôáëüãùí";
+ Text[ dutch ] = "Bookmarks voor mappen";
+ Text[ french ] = "Répertoires courants";
+ Text[ spanish ] = "Marcadores de carpetas";
+ Text[ swedish ] = "Mappbokmärken";
+ Text[ russian ] = "Çàêëàäêè ê ïàïêàì";
+ Text[ italian ] = "Bookmark della cartella";
+ Text[ danish ] = "Mappe-bogmærker";
+ Text[ polish ] = "Zak³adki folderu";
+ Text[ portuguese_brazilian ] = "User directories";
+ Text[ japanese ] = "Ì«ÙÀÞ‚ÌÌÞ¯¸Ï°¸";
+ Text[ korean ] = "Æú´õ Ã¥°¥ÇÇ";
+ Text[ chinese_simplified ] = "Îļþ¼ÐÊéÇ©";
+ Text[ chinese_traditional ] = "¸ê®Æ§¨®ÑÅÒ";
+ Text[ arabic ] = "ÅÔÇÑÇÊ ãÑÌÚíÉ áãÌáÏÇÊ";
+ Text[ turkish ] = "Yer iþareti klasörü";
+};
+String STR_KEY_FILTER_PATH
+{
+ Text = "Filter" ;
+ Text [ English ] = "Filter" ;
+ Text[ english_us ] = "Filters";
+ Text[ portuguese ] = "Filtros";
+ Text[ greek ] = "Ößëôñï";
+ Text[ dutch ] = "Filter";
+ Text[ french ] = "Filtre";
+ Text[ spanish ] = "Filtros";
+ Text[ swedish ] = "Filter";
+ Text[ russian ] = "Ôèëüòð";
+ Text[ italian ] = "Filtro";
+ Text[ danish ] = "Filtre";
+ Text[ polish ] = "Filtr";
+ Text[ portuguese_brazilian ] = "Filter";
+ Text[ japanese ] = "̨ÙÀ";
+ Text[ korean ] = "ÇÊÅÍ";
+ Text[ chinese_simplified ] = "ɸѡ";
+ Text[ chinese_traditional ] = "¹LÂo¾¹";
+ Text[ arabic ] = "ÝáÊÑ";
+ Text[ turkish ] = "Filtre";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_ADDINS_PATH
+{
+ Text = "AddIns" ;
+ Text [ English ] = "AddIns" ;
+ Text[ english_us ] = "Add-Ins";
+ Text[ portuguese ] = "AddIns";
+ Text[ greek ] = "AddIns";
+ Text[ dutch ] = "AddIns";
+ Text[ french ] = "Add-Ins";
+ Text[ spanish ] = "AddIns";
+ Text[ swedish ] = "AddIns";
+ Text[ russian ] = "AddIns";
+ Text[ italian ] = "AddIns";
+ Text[ danish ] = "AddIns";
+ Text[ polish ] = "AddIns";
+ Text[ portuguese_brazilian ] = "AddIns";
+ Text[ japanese ] = "±ÄÞ²Ý";
+ Text[ korean ] = "¾ÖµåÀÎ";
+ Text[ chinese_simplified ] = "AddIns";
+ Text[ chinese_traditional ] = "AddIns";
+ Text[ arabic ] = "AddIns";
+ Text[ turkish ] = "Add-In";
+};
+String STR_KEY_USERCONFIG_PATH
+{
+ Text = "Benutzer Konfiguration" ;
+ Text [ English ] = "User Settings" ;
+ Text[ english_us ] = "User Configuration";
+ Text[ portuguese ] = "Configuração personalizada";
+ Text[ greek ] = "ÐáñÜìåôñïé ÷ñÞóôç";
+ Text[ dutch ] = "Gebruikerscofiguratie";
+ Text[ french ] = "Configuration d'utilisateur";
+ Text[ spanish ] = "Configuración de usuario";
+ Text[ swedish ] = "Användarkonfiguration";
+ Text[ russian ] = "Êîíôèãóðàöèÿ ïîëüçîâàòåëÿ";
+ Text[ italian ] = "Configurazione utente";
+ Text[ danish ] = "Brugerkonfigurationer";
+ Text[ polish ] = "Konfiguracje u¿ytkownika";
+ Text[ portuguese_brazilian ] = "User Settings";
+ Text[ japanese ] = "Õ°»Þ°Ý’è";
+ Text[ korean ] = "»ç¿ëÀÚ ¼³Á¤";
+ Text[ chinese_simplified ] = "ʹÓÃÕßÅäÖÃ";
+ Text[ chinese_traditional ] = "¨Ï¥ÎªÌ³]©w";
+ Text[ arabic ] = "Êßæíä ÇáãÓÊÎÏã";
+ Text[ turkish ] = "Kullanýcý konfigürasyonu";
+ Text[ language_user1 ] = " ";
+};
+String STR_KEY_USERDICTIONARY_DIR
+{
+ Text = "Benutzerwörterbücher" ;
+ Text [ English ] = "User Dictionaries" ;
+ Text[ english_us ] = "User Dictionaries";
+ Text[ portuguese ] = "Dicionários personalizados";
+ Text[ russian ] = "Ñëîâàðè ïîëüçîâàòåëÿ";
+ Text[ greek ] = "ËåîéêÜ ÷ñÞóôç";
+ Text[ dutch ] = "Gebruikerswoordenboek";
+ Text[ french ] = "Dictionnaires de l'utilisateur";
+ Text[ spanish ] = "Diccionarios de usuario";
+ Text[ italian ] = "Dizionari utente";
+ Text[ danish ] = "Brugerordbøger";
+ Text[ swedish ] = "Användarordböcker";
+ Text[ polish ] = "S³owniki u¿ytkownika";
+ Text[ portuguese_brazilian ] = "User Dictionaries";
+ Text[ japanese ] = "Õ°»Þ°Ž«‘";
+ Text[ korean ] = "»ç¿ëÀÚ »çÀü";
+ Text[ chinese_simplified ] = "Óû§×Öµä";
+ Text[ chinese_traditional ] = "¦Û­q¦r¨å";
+ Text[ arabic ] = "ÞæÇãíÓ ÇáãÓÊÎÏã";
+ Text[ turkish ] = "Kullanýcý sözlükleri";
+};
+String STR_KEY_AUTOCORRECT_DIR
+{
+ Text = "AutoKorrektur" ;
+ Text [ English ] = "AutoCorrect" ;
+ Text[ english_us ] = "AutoCorrect";
+ Text[ portuguese ] = "AutoCorrecção";
+ Text[ russian ] = "Àâòîçàìåíà";
+ Text[ greek ] = "ÁõôïÄéüñèùóç";
+ Text[ dutch ] = "AutoCorrectie";
+ Text[ french ] = "AutoCorrection";
+ Text[ spanish ] = "AutoCorrección";
+ Text[ italian ] = "Correzione automatica";
+ Text[ danish ] = "AutoKorrektur";
+ Text[ swedish ] = "AutoKorrigering";
+ Text[ polish ] = "Autokorekta";
+ Text[ portuguese_brazilian ] = "AutoCorrect";
+ Text[ japanese ] = "µ°ÄºÚ¸Ä";
+ Text[ korean ] = "ÀÚµ¿ °íħ";
+ Text[ chinese_simplified ] = "×Ô¶¯¸üÕý";
+ Text[ chinese_traditional ] = "¦Û°Ê§ó¥¿";
+ Text[ arabic ] = "ÊÕÍíÍ ÊáÞÇÆí";
+ Text[ turkish ] = "Otomatik düzeltme";
+};
+#if defined STR_KEY_LINGUISTIC_DIR
+String STR_KEY_LINGUISTIC_DIR
+{
+ Text = "Linguistik" ;
+ Text [ English ] = "Linguistic" ;
+ Text[ english_us ] = "Language";
+ Text[ portuguese ] = "Linguística";
+ Text[ russian ] = "Ëèíãâèñòèêà";
+ Text[ greek ] = "Ãëþóóá";
+ Text[ dutch ] = "Linguïstiek";
+ Text[ french ] = "Linguistique";
+ Text[ spanish ] = "Lingüística";
+ Text[ italian ] = "Linguistica";
+ Text[ danish ] = "Lingvistik";
+ Text[ swedish ] = "Lingvistik";
+ Text[ polish ] = "Lingwistyka";
+ Text[ portuguese_brazilian ] = "Linguistic";
+ Text[ japanese ] = "Œ¾Œê";
+ Text[ korean ] = "¾ð¾î";
+ Text[ chinese_simplified ] = "ÓïÑÔ";
+ Text[ chinese_traditional ] = "»y¨¥";
+ Text[ arabic ] = "ÇááÛÉ";
+ Text[ turkish ] = "Dil";
+};
+#endif // STR_KEY_LINGUISTIC_DIR
+
diff --git a/svtools/source/misc/errtxt.src b/svtools/source/misc/errtxt.src
new file mode 100644
index 000000000000..8800d1b6ebd9
--- /dev/null
+++ b/svtools/source/misc/errtxt.src
@@ -0,0 +1,2778 @@
+/*************************************************************************
+ *
+ * $RCSfile: errtxt.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define __RSC
+#include "svtools.hrc"
+#include "sfxecode.hxx"
+ // pragma ----------------------------------------------------------------
+Resource RID_ERRCTX
+{
+ String ERRCTX_ERROR
+ {
+ Text = "Fehler" ;
+ Text [ ENGLISH ] = "Error" ;
+ Text [ english_us ] = "Error" ;
+ Text [ italian ] = "Errore" ;
+ Text [ spanish ] = "Error" ;
+ Text [ french ] = "Erreur" ;
+ Text [ dutch ] = "Fout" ;
+ Text [ swedish ] = "Fel" ;
+ Text [ danish ] = "Fejl" ;
+ Text [ portuguese_brazilian ] = "Fehler" ;
+ Text [ portuguese ] = "Erro" ;
+ Text[ chinese_simplified ] = "´íÎó";
+ Text[ russian ] = "Îøèáêà";
+ Text[ polish ] = "B³¹d";
+ Text[ japanese ] = "´×°";
+ Text[ chinese_traditional ] = "¿ù»~";
+ Text[ arabic ] = "ÎØÃ";
+ Text[ dutch ] = "Fout";
+ Text[ chinese_simplified ] = "´íÎó";
+ Text[ greek ] = "ÓöÜëìá";
+ Text[ korean ] = "¿À·ù";
+ Text[ turkish ] = "Hata";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCTX_WARNING
+ {
+ Text = "Warnung" ;
+ Text [ ENGLISH ] = "Warning" ;
+ Text [ dutch ] = "Waarschuwing" ;
+ Text [ english_us ] = "Warning" ;
+ Text [ italian ] = "Avvertenza" ;
+ Text [ spanish ] = "Advertencia" ;
+ Text [ french ] = "Message d'avertissement" ;
+ Text [ swedish ] = "Varning" ;
+ Text [ danish ] = "Advarsel" ;
+ Text [ portuguese ] = "Aviso" ;
+ Text [ portuguese_brazilian ] = "Warnung" ;
+ Text[ chinese_simplified ] = "¾¯¸æ";
+ Text[ russian ] = "Ïðåäóïðåæäåíèå";
+ Text[ polish ] = "Ostrze¿enie";
+ Text[ japanese ] = "Œx";
+ Text[ chinese_traditional ] = "ĵ§i";
+ Text[ arabic ] = "ÊÍÐíÑ";
+ Text[ dutch ] = "Waarschuwing";
+ Text[ chinese_simplified ] = "¾¯¸æ";
+ Text[ greek ] = "Ðñïåéäïðïßçóç";
+ Text[ korean ] = "°æ°í";
+ Text[ turkish ] = "Uyarý";
+ };
+ String ERRCTX_SFX_LOADTEMPLATE
+ {
+ Text = "$(ERR) beim Laden der Vorlage $(ARG1)" ;
+ Text [ ENGLISH ] = "$(ERR) while loading template $(ARG1)" ;
+ Text [ dutch ] = "$(ERR) bij laden van sjabloon $(ARG1)" ;
+ Text [ english_us ] = "$(ERR) loading the template $(ARG1)" ;
+ Text [ italian ] = "$(ERR) nel caricare il modello $(ARG1)" ;
+ Text [ spanish ] = "$(ERR) al cargar la plantilla $(ARG1)" ;
+ Text [ french ] = "$(ERR) lors du chargement du modèle $(ARG1)" ;
+ Text [ swedish ] = "$(ERR) vid laddning av formatmallen $(ARG1)" ;
+ Text [ danish ] = "$(ERR) under indlæsning af skabelonen $(ARG1)" ;
+ Text [ portuguese ] = "$(ERR) ao carregar o modelo $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Laden der Vorlage $(ARG1)" ;
+ Text[ chinese_simplified ] = "$(ERR)·¢ÉúÔÚ×°ÔØÑùʽ$(ARG1)ʱ";
+ Text[ russian ] = "$(ERR) ïðè çàãðóçêå øàáëîíà $(ARG1)";
+ Text[ polish ] = "$(ERR) przy ³adowaniu szablonu $(ARG1)";
+ Text[ japanese ] = "$(ERR)ÃÝÌßÚ°Ä$(ARG1)‚Ì“Ç‚Ýž‚Ý‚ÌÛ";
+ Text[ chinese_traditional ] = "¸Ë¸ü¼Ë¦¡ $(ARG1) ®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÊÍãíá ÇáÞÇáÈ $(ARG1)";
+ Text[ dutch ] = "$(ERR) bij laden van sjabloon $(ARG1)";
+ Text[ chinese_simplified ] = "$(ERR)·¢ÉúÔÚ×°ÔØÑùʽ$(ARG1)ʱ";
+ Text[ greek ] = "$(ERR) êáôÜ ôç öüñôùóç ôïõ ðñïôýðïõ $(ARG1)";
+ Text[ korean ] = "¼­½ÄÆÄÀÏ $(ARG1)À» ·ÎµåÇÏ´øÁß $(ERR)";
+ Text[ turkish ] = "$(ARG1) þablonu yüklenirken $(ERR)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCTX_SFX_SAVEDOC
+ {
+ Text = "$(ERR) beim Speichern des Dokumentes $(ARG1)" ;
+ Text [ italian ] = "$(ERR) nel salvare il documento $(ARG1)";
+ Text [ portuguese_brazilian ] = "$(ERR) beim Speichern des Dokumentes $(ARG1)";
+ Text [ portuguese ] = "$(ERR) ao guardar o documento $(ARG1)";
+ Text [ danish ] = "$(ERR) under forsøg på at gemme dokumentet $(ARG1)";
+ Text [ french ] = "$(ERR) lors de l'enregistrement du document $(ARG1)";
+ Text [ swedish ] = "$(ERR) när dokumentet $(ARG1) sparades";
+ Text [ dutch ] = "$(ERR) bij opslaan van document $(ARG1)";
+ Text [ spanish ] = "$(ERR) al guardar el documento $(ARG1)";
+ Text [ english_us ] = "$(ERR) saving the document $(ARG1)";
+ Text[ chinese_simplified ] = "´æÅÌÎĵµ $(ARG1) ʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè ñîõðàíåíèè äîêóìåíòà $(ARG1)";
+ Text[ polish ] = "$(ERR) przy zapisywaniu dokumentu $(ARG1)";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ$(ARG1)‚Ì•Û‘¶‚ÌÛ";
+ Text[ chinese_traditional ] = "Àx¦s¤å¥ó $(ARG1) ®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÍÝÙ ÇáãÓÊäÏ $(ARG1)";
+ Text[ dutch ] = "$(ERR) bij opslaan van document $(ARG1)";
+ Text[ chinese_simplified ] = "´æÅÌÎĵµ $(ARG1) ʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôçí áðïèÞêåõóçôïõ åããñÜöïõ $(ARG1)";
+ Text[ korean ] = "¹®¼­$(ARG1)¸¦ ÀúÀåÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "$(ARG1) belgesi kaydedilirken $(ERR)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCTX_SFX_SAVEASDOC
+ {
+ Text = "$(ERR) beim Speichern des Dokumentes $(ARG1)";
+ Text [ italian ] = "$(ERR) nel salvare il documento $(ARG1)";
+ Text [ portuguese_brazilian ] = "$(ERR) beim Speichern des Dokumentes $(ARG1)";
+ Text [ portuguese ] = "$(ERR) ao guardar o documento $(ARG1)";
+ Text [ danish ] = "$(ERR) under forsøg på at gemme dokumentet $(ARG1)";
+ Text [ french ] = "$(ERR) lors de l'enregistrement du document $(ARG1)";
+ Text [ swedish ] = "$(ERR) när dokumentet $(ARG1) sparades";
+ Text [ dutch ] = "$(ERR) bij opslaan van document $(ARG1)";
+ Text [ spanish ] = "$(ERR) al guardar el documento $(ARG1)";
+ Text [ english_us ] = "$(ERR) saving the document $(ARG1)";
+ Text[ chinese_simplified ] = "´æÅÌÎĵµ $(ARG1) ʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè ñîõðàíåíèè äîêóìåíòà $(ARG1)";
+ Text[ polish ] = "$(ERR) przy zapisywaniu dokumentu $(ARG1)";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ$(ARG1)‚Ì•Û‘¶‚ÌÛ";
+ Text[ chinese_traditional ] = "Àx¦s¤å¥ó $(ARG1) ®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÍÝÙ ÇáãÓÊäÏ $(ARG1)";
+ Text[ dutch ] = "$(ERR) bij opslaan van document $(ARG1)";
+ Text[ chinese_simplified ] = "´æÅÌÎĵµ $(ARG1) ʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôçí áðïèÞêåõóçôïõ åããñÜöïõ $(ARG1)";
+ Text[ korean ] = "¹®¼­$(ARG1)¸¦ ÀúÀåÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "$(ARG1) belgesi kaydedilirken $(ERR)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCTX_SFX_DOCINFO
+ {
+ Text = "$(ERR) beim Anzeigen der Docinfo des Dokumentes $(ARG1)" ;
+ Text [ ENGLISH ] = "$(ERR) while showing docinfo for document $(ARG1)" ;
+ Text [ dutch ] = "$(ERR) bij weergeven van document info bij document $(ARG1)" ;
+ Text [ english_us ] = "$(ERR) displaying doc. information for document $(ARG1)" ;
+ Text [ italian ] = "$(ERR) nel visualizzare le informazioni riguardanti il documento $(ARG1)" ;
+ Text [ spanish ] = "$(ERR) al mostrar la información del documento $(ARG1)" ;
+ Text [ french ] = "$(ERR) lors de l'affichage des informations sur le document $(ARG1)" ;
+ Text [ swedish ] = "$(ERR) vid visning av dokumentinfo för $(ARG1)" ;
+ Text [ danish ] = "$(ERR) ved visning af dokumentinfo for dokumentet $(ARG1)" ;
+ Text [ portuguese ] = "$(ERR) ao mostrar informações sobre o documento $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Anzeigen der Docinfo des Dokumentes $(ARG1)" ;
+ Text[ chinese_simplified ] = "ÏÔʾÎĵµ $(ARG1) ÎĵµÐÅϢʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè ïîêàçå èíôîðìàöèè ê äîêóìåíòó $(ARG1)";
+ Text[ polish ] = "$(ERR) przy wyœwietlaniu informacji o dokumencie dla dokumentu $(ARG1)";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ$(ARG1)‚ÌÄÞ·­ÒÝÄî•ñ‚Ì•\\Ž¦‚ÌÛ";
+ Text[ chinese_traditional ] = "Åã¥Ü¤å¥ó $(ARG1) ªº¤å¥ó¸ê°T®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÅÙåÇÑ ãÚáæãÇÊ ÇáãÓÊäÏ ÇáÎÇÕÉ ÈÇáãÓÊäÏ $(ARG1)";
+ Text[ dutch ] = "$(ERR) bij weergeven van document info bij document $(ARG1)";
+ Text[ chinese_simplified ] = "ÏÔʾÎĵµ $(ARG1) ÎĵµÐÅϢʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôçí åìöÜíéóç ôçò ðëçñïöïñßáò ôïõ åããñÜöïõ $(ARG1)";
+ Text[ korean ] = "¹®¼­$(ARG1)ÀÇ ¹®¼­ Á¤º¸¸¦ Ç¥½ÃÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "$(ARG1) belgesinin, belge bilgileri görüntülenirken $(ERR)";
+ };
+ String ERRCTX_SFX_DOCTEMPLATE
+ {
+ Text = "$(ERR) beim Schreiben des Dokumentes $(ARG1) als Vorlage" ;
+ Text [ ENGLISH ] = "$(ERR) saving document $(ARG1) as template" ;
+ Text [ dutch ] = "$(ERR) bij opslaan van document $(ARG1) als sjabloon" ;
+ Text [ english_us ] = "$(ERR) writing document $(ARG1) as template" ;
+ Text [ italian ] = "$(ERR) nella scrittura del documento $(ARG1) come modello" ;
+ Text [ spanish ] = "$(ERR) al escribir el documento $(ARG1) como plantilla" ;
+ Text [ french ] = "$(ERR) lors de l'enregistrement du document $(ARG1) en tant que modèle" ;
+ Text [ swedish ] = "$(ERR) vid när dokumentet $(ARG1) skrevs som formatmall" ;
+ Text [ danish ] = "$(ERR) under skrivning af dokumentet $(ARG1) som skabelon" ;
+ Text [ portuguese ] = "$(ERR) ao escrever o documento $(ARG1) como modelo" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Schreiben des Dokumentes $(ARG1) als Vorlage" ;
+ Text[ chinese_simplified ] = "ÔÚ¸²Ð´ÑùʽÎĵµ$(ARG1)ʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè çàïèñè äîêóìåíòà $(ARG1) êàê øàáëîíà";
+ Text[ polish ] = "$(ERR) przy zapisywaniu dokumentu $(ARG1) jako szablonu";
+ Text[ japanese ] = "$(ERR)ÃÝÌßÚ°Ä‚Æ‚µ‚ÄÄÞ·­ÒÝÄ$(ARG1)‚ð‘‚«ž‚ÞÛ";
+ Text[ chinese_traditional ] = "¼g¤J¼Ë¦¡¤å¥ó $(ARG1) ®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ßÊÇÈÉ ÇáãÓÊäÏ $(ARG1) ßÞÇáÈ";
+ Text[ dutch ] = "$(ERR) bij opslaan van document $(ARG1) als sjabloon";
+ Text[ chinese_simplified ] = "ÔÚ¸²Ð´ÑùʽÎĵµ$(ARG1)ʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôçí åããñáöÞ ôïõ åããñÜöïõ $(ARG1) ùò ðñüôõðï";
+ Text[ korean ] = "¹®¼­$(ARG1)¸¦ ¼­½ÄÆÄÀÏ·Î ±â·ÏÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "$(ARG1) belgesi þablon olarak yazýlýrken $(ERR)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCTX_SFX_MOVEORCOPYCONTENTS
+ {
+ Text = "$(ERR) beim Kopieren oder Verschieben von Dokumentinhalten" ;
+ Text [ ENGLISH ] = "$(ERR) beim Kopieren oder Verschieben von Dokumentinhalten" ;
+ Text [ portuguese ] = "$(ERR) ao copiar ou mover conteúdos do documento" ;
+ Text [ english_us ] = "$(ERR) copying or moving document contents" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Kopieren oder Verschieben von Dokumentinhalten" ;
+ Text [ swedish ] = "$(ERR) vid kopiering eller förflyttning av dokumentinnehåll" ;
+ Text [ danish ] = "$(ERR) under kopiering eller flytning af dokumentindhold" ;
+ Text [ italian ] = "$(ERR) nel copiare o spostare i contenuti dei documenti" ;
+ Text [ spanish ] = "$(ERR) al copiar o desplazar los contenidos del documento." ;
+ Text [ french ] = "$(ERR) lors de la copie ou du déplacement du contenu des documents " ;
+ Text [ dutch ] = "$(ERR) bij kopiëren of verplaatsen van documentinhoud" ;
+ Text[ chinese_simplified ] = "¸´ÖÆ»òÒƶ¯ÎĵµÄÚÈÝʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè êîïèðîâàíèè èëè ïåðåìåùåíèè ñîäåðæèìîãî äîêóìåíòà";
+ Text[ polish ] = "$(ERR) przy kopiowaniu lub przenoszeniu zawartoœci wiadomoœci";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ‚Ì“à—e‚ðºËß°‚Ü‚½‚͈ړ®‚·‚éÛ";
+ Text[ chinese_traditional ] = "½Æ»s©M²¾°Ê¤å¥ó¤º®e®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ äÓÎ Ãæ ÅÒÇÍÉ ãÍÊæíÇÊ ÇáãÓÊäÏ";
+ Text[ dutch ] = "$(ERR) bij kopiëren of verplaatsen van documentinhoud";
+ Text[ chinese_simplified ] = "¸´ÖÆ»òÒƶ¯ÎĵµÄÚÈÝʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôçí áíôéãñáöÞ Þ ìåôáêßíçóç ôùí ðåñéå÷ïìÝíùí ôïõ åããñÜöïõ";
+ Text[ korean ] = "¹®¼­ ³»¿ëÀ» º¹»ç ¶Ç´Â À̵¿ÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "Belge içeriði kopyalanýrken ya da taþýnýrken $(ERR)";
+ };
+ String ERRCTX_SFX_DOCMANAGER
+ {
+ Text = "$(ERR) beim Starten des Docmanagers" ;
+ Text [ ENGLISH ] = "$(ERR) starting the docmanager" ;
+ Text [ english_us ] = "$(ERR) starting the Document Manager" ;
+ Text [ italian ] = "$(ERR) nell'avvio del Docmanager" ;
+ Text [ spanish ] = "$(ERR) al inicializar el administrador de documentos" ;
+ Text [ french ] = "$(ERR) lors du démarrage du gestionnaire de documents" ;
+ Text [ dutch ] = "$(ERR) bij het starten van het documentbeheer" ;
+ Text [ swedish ] = "$(ERR) vid start av dokumentmanagern" ;
+ Text [ danish ] = "$(ERR) ved start af dokumentmanageren" ;
+ Text [ portuguese ] = "$(ERR) ao iniciar o Gestor de Documentos" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Starten des Docmanagers" ;
+ Text[ chinese_simplified ] = "Æô¶¯Îĵµ¹ÜÀí³ÌÐòʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè çàïóñêå äèñïåò÷åðà äîêóìåíòà";
+ Text[ polish ] = "$(ERR) przy w³¹czaniu mened¿era dokumentów";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ ÏÈ°¼Þ¬‚ÌŠJŽn‚ÌÛ";
+ Text[ chinese_traditional ] = "±Ò°Ê¤å¥óÁ`ºÞ®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÈÏÁ ãÏíÑ ÇáãÓÊäÏ";
+ Text[ dutch ] = "$(ERR) bij het starten van het documentbeheer";
+ Text[ chinese_simplified ] = "Æô¶¯Îĵµ¹ÜÀí³ÌÐòʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôçí åêêßíçóç ôïõ äéá÷åéñéóôÞ ôùí åããñÜöùí";
+ Text[ korean ] = "¹®¼­°ü¸®ÀÚ¸¦ ½ÃÀÛÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "Belge yöneticisi baþlatýlýrken $(ERR)";
+ };
+ String ERRCTX_SFX_OPENDOC
+ {
+ Text = "$(ERR) beim Laden des Dokumentes $(ARG1)" ;
+ Text [ ENGLISH ] = "$(ERR) opening document $(ARG1)" ;
+ Text [ english_us ] = "$(ERR) loading document $(ARG1)" ;
+ Text [ italian ] = "$(ERR) nel caricare il documento $(ARG1)" ;
+ Text [ spanish ] = "$(ERR) al cargar el documento $(ARG1)" ;
+ Text [ french ] = "$(ERR) lors du chargement du document $(ARG1)" ;
+ Text [ dutch ] = "$(ERR) bij openen van document $(ARG1)" ;
+ Text [ swedish ] = "$(ERR) vid laddning av dokumentet $(ARG1)" ;
+ Text [ danish ] = "$(ERR) under indlæsning af dokumentet $(ARG1)" ;
+ Text [ portuguese ] = "$(ERR) ao carregar o documento $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Laden des Dokumentes $(ARG1)" ;
+ Text[ chinese_simplified ] = "×°ÔØÎĵµ $(ARG1) ʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè çàãðóçêå äîêóìåíòà $(ARG1)";
+ Text[ polish ] = "$(ERR) przy ³adowaniu dokumentu $(ARG1)";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ$(ARG1)‚Ì“Ç‚Ýž‚Ý‚ÌÛ";
+ Text[ chinese_traditional ] = "¸Ë¸ü¤å¥ó $(ARG1) ®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÊÍãíá ÇáãÓÊäÏ $(ARG1)";
+ Text[ dutch ] = "$(ERR) bij openen van document $(ARG1)";
+ Text[ chinese_simplified ] = "×°ÔØÎĵµ $(ARG1) ʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôï öüñôùìá ôïõ åããñÜöïõ $(ARG1)";
+ Text[ korean ] = "¹®¼­$(ARG1)¸¦ ·ÎµåÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "$(ARG1) belgesi yüklenirken $(ERR)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCTX_SFX_NEWDOCDIRECT
+ {
+ Text = "$(ERR) beim Anlegen eines neuen Dokumentes" ;
+ Text [ ENGLISH ] = "$(ERR) creating a new document" ;
+ Text [ english_us ] = "$(ERR) creating a new document" ;
+ Text [ italian ] = "$(ERR) nella creazione di un nuovo documento" ;
+ Text [ spanish ] = "$(ERR) al crear un nuevo documento" ;
+ Text [ french ] = "$(ERR) lors de la création d'un nouveau document" ;
+ Text [ dutch ] = "$(ERR) bij maken van nieuw document" ;
+ Text [ swedish ] = "$(ERR) när ett nytt dokument skapades" ;
+ Text [ danish ] = "$(ERR) under oprettelsen af et nyt dokument" ;
+ Text [ portuguese ] = "$(ERR) ao criar o novo documento" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Anlegen eines neuen Dokumentes" ;
+ Text[ chinese_simplified ] = "н¨ÎĵµÊ±·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè ñîçäàíèè íîâîãî äîêóìåíòà";
+ Text[ polish ] = "$(ERR) przy tworzeniu nowego dokumentu";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ‚ÌV‹K쬂ÌÛ";
+ Text[ chinese_traditional ] = "«Ø¥ß¤@­Ó·s¤å¥ó®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÅäÔÇÁ ãÓÊäÏ ÌÏíÏ";
+ Text[ dutch ] = "$(ERR) bij maken van nieuw document";
+ Text[ chinese_simplified ] = "н¨ÎĵµÊ±·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôç äçìéïõñãßá åíüò íÝïõ åããñÜöïõ";
+ Text[ korean ] = "»õ ¹®¼­¸¦ ÀÛ¼ºÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "Yeni belge oluþturulurken $(ERR)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCTX_SFX_NEWDOC
+ {
+ Text = "$(ERR) beim Anlegen eines neuen Dokumentes" ;
+ Text [ ENGLISH ] = "$(ERR) creating a new document" ;
+ Text [ dutch ] = "$(ERR) bij maken van nieuw document" ;
+ Text [ english_us ] = "$(ERR) creating a new document" ;
+ Text [ italian ] = "$(ERR) nella creazione di un nuovo documento" ;
+ Text [ spanish ] = "$(ERR) al crear un nuevo documento" ;
+ Text [ french ] = "$(ERR) lors de la création d'un nouveau document" ;
+ Text [ swedish ] = "$(ERR) när ett nytt dokument skapades" ;
+ Text [ danish ] = "$(ERR) under oprettelsen af et nyt dokument" ;
+ Text [ portuguese ] = "$(ERR) ao criar o novo documento" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Anlegen eines neuen Dokumentes" ;
+ Text[ chinese_simplified ] = "н¨ÎĵµÊ±·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè ñîçäàíèè íîâîãî äîêóìåíòà";
+ Text[ polish ] = "$(ERR) przy tworzeniu nowego dokumentu";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ‚ÌV‹K쬂ÌÛ";
+ Text[ chinese_traditional ] = "«Ø¥ß¤@­Ó·s¤å¥ó®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÅäÔÇÁ ãÓÊäÏ ÌÏíÏ";
+ Text[ dutch ] = "$(ERR) bij maken van nieuw document";
+ Text[ chinese_simplified ] = "н¨ÎĵµÊ±·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôç äçìéïõñãßá åíüò íÝïõ åããñÜöïõ";
+ Text[ korean ] = "»õ ¹®¼­¸¦ ÀÛ¼ºÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "Yeni belge oluþturulurken $(ERR)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCTX_SFX_CREATEOBJSH
+ {
+ Text = "$(ERR) beim Aufklappen einer Rubrik" ;
+ Text [ ENGLISH ] = "$(ERR) expanding entry" ;
+ Text [ dutch ] = "$(ERR) bij openen van een rubriek" ;
+ Text [ english_us ] = "$(ERR) expanding entry" ;
+ Text [ italian ] = "$(ERR) nell'apertura di una voce" ;
+ Text [ spanish ] = "$(ERR) al abrir una rúbrica" ;
+ Text [ french ] = "$(ERR) lors de l'ouverture d'une rubrique" ;
+ Text [ swedish ] = "$(ERR) när en rubrik öppnades" ;
+ Text [ danish ] = "$(ERR) under åbning af en rubrik" ;
+ Text [ portuguese ] = "$(ERR) ao abrir rubrica" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Aufklappen einer Rubrik" ;
+ Text[ chinese_simplified ] = "´ò¿ª·ÖÀàÌõĿʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè ðàñêðûâàíèè ðóáðèêè";
+ Text[ polish ] = "$(ERR) przy otwieraniu rubryki";
+ Text[ japanese ] = "$(ERR)ÂØ°•\\Ž¦‚ðŠJ‚­Û";
+ Text[ chinese_traditional ] = "ÂX®iÅã¥Ü¤@­Ó¤ÀÄæ®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÝÊÍ ÃÍÏ ÇáÃÚãÏÉ";
+ Text[ dutch ] = "$(ERR) bij openen van een rubriek";
+ Text[ chinese_simplified ] = "´ò¿ª·ÖÀàÌõĿʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôï Üíïéãìá ìéáò åããñáöÞò";
+ Text[ korean ] = "Ç׸ñÀ» Àü°³ÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "Giriþi açarken $(ERR)";
+ };
+ String ERRCTX_SFX_LOADBASIC
+ {
+ Text = "$(ERR) beim Laden des BASIC des Dokuments $(ARG1)" ;
+ Text [ ENGLISH ] = "$(ERR) while loading BASIC of document $(ARG1)" ;
+ Text [ dutch ] = "$(ERR) bij laden van BASIC van document $(ARG1)" ;
+ Text [ english_us ] = "$(ERR) loading BASIC of document $(ARG1)" ;
+ Text [ italian ] = "$(ERR) nel caricare il BASIC del documento $(ARG1)" ;
+ Text [ spanish ] = "$(ERR) al cargar el BASIC del documento $(ARG1)" ;
+ Text [ french ] = "$(ERR) lors du chargement du BASIC du document $(ARG1)" ;
+ Text [ swedish ] = "$(ERR) vid laddning av BASIC i dokumentet $(ARG1)" ;
+ Text [ danish ] = "$(ERR) under indlæsning af BASIC fra dokumentet $(ARG1)" ;
+ Text [ portuguese ] = "$(ERR) ao carregar o BASIC do documento $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "$(ERR) beim Laden des BASIC des Dokuments $(ARG1)" ;
+ Text[ chinese_simplified ] = "×°ÔØÎĵµ $(ARG1) BASIC ʱ·¢Éú $(ERR)";
+ Text[ russian ] = "$(ERR) ïðè çàãðóçêå BASIC äîêóìåíòà $(ARG1)";
+ Text[ polish ] = "$(ERR) przy ³adowaniu dokumentu BASIC $(ARG1)";
+ Text[ japanese ] = "$(ERR)ÄÞ·­ÒÝÄ$(ARG1)‚ÌBASIC‚Ì“Ç‚Ýž‚Ý‚ÌÛ";
+ Text[ chinese_traditional ] = "¸Ë¸ü¤å¥ó $(ARG1) BASIC ®Éµo¥Í $(ERR)";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÊÍãíá BASIC ÇáãÓÊäÏ $(ARG1)";
+ Text[ dutch ] = "$(ERR) bij laden van BASIC van document $(ARG1)";
+ Text[ chinese_simplified ] = "×°ÔØÎĵµ $(ARG1) BASIC ʱ·¢Éú $(ERR)";
+ Text[ greek ] = "$(ERR) êáôÜ ôç öüñôùóç ôïõ BASIC ôïõ åããñÜöïõ $(ARG1)";
+ Text[ korean ] = "¹®¼­$(ARG1)ÀÇ BASICÀ» ·ÎµåÇÏ´ø Áß $(ERR)";
+ Text[ turkish ] = "$(ARG1) belgesi ile ilgili BASIC yüklenirken $(ERR)";
+ };
+ String ERRCTX_SFX_SEARCHADDRESS
+ {
+ Text = "$(ERR) bei der Adressensuche" ;
+ Text [ ENGLISH ] = "$(ERR) searching for an address" ;
+ Text[ english_us ] = "$(ERR) searching for an address";
+ Text[ portuguese ] = "$(ERR) ao procurar o endereço";
+ Text[ russian ] = "$(ERR) searching for an address";
+ Text[ greek ] = "$(ERR) êáôÜ ôçí áíáæÞôçóç äéåýèõíóçò";
+ Text[ dutch ] = "$(ERR) bij zoeken naar een adres";
+ Text[ french ] = "$(ERR) lors de la recherche d'adresse";
+ Text[ spanish ] = "$(ERR) searching for an address";
+ Text[ italian ] = "$(ERR) searching for an address";
+ Text[ danish ] = "$(ERR) under adressesøgningen";
+ Text[ swedish ] = "$(ERR) vid adressökning";
+ Text[ polish ] = "$(ERR) searching for an address";
+ Text[ portuguese_brazilian ] = "$(ERR) searching for an address";
+ Text[ japanese ] = "$(ERR) ±ÄÞÚ½ŒŸõ’†‚É”­¶‚µ‚Ü‚µ‚½";
+ Text[ korean ] = "$(ERR) searching for an address";
+ Text[ chinese_simplified ] = "ÔÚËÑÑ°µØַʱ³öÏÖ$(ERR)";
+ Text[ chinese_traditional ] = "¦b·j´M¦a§}®É¥X²{ $(ERR)";
+ Text[ turkish ] = "$(ERR) searching for an address";
+ Text[ arabic ] = "$(ERR) ÃËäÇÁ ÇáÈÍË Úä ÇáÚäæÇä";
+ };
+};
+Resource RID_ERRHDL
+{
+ String ERRCODE_CLASS_ABORT
+ {
+ Text = "Abbruch" ;
+ Text = "Abort" ;
+ };
+ String ERRCODE_CLASS_NOTEXISTS
+ {
+ Text = "Nichtexistentes Objekt" ;
+ Text [ ENGLISH ] = "Nonexistant object" ;
+ Text [ dutch ] = "Object bestaat niet" ;
+ Text [ english_us ] = "Nonexistent object" ;
+ Text [ italian ] = "Oggetto inesistente" ;
+ Text [ spanish ] = "Objeto no existente" ;
+ Text [ french ] = "Cet objet n'existe pas" ;
+ Text [ swedish ] = "Icke-existerande objekt" ;
+ Text [ danish ] = "Ikke-eksisterende objekt" ;
+ Text [ portuguese ] = "Objecto inexistente" ;
+ Text [ portuguese_brazilian ] = "Nichtexistentes Objekt" ;
+ Text[ chinese_simplified ] = "²»´æÔڵĶÔÏó";
+ Text[ russian ] = "Íåñóùåñòâóþùèé îáúåêò";
+ Text[ polish ] = "Nieistniej¹cy obiekt";
+ Text[ japanese ] = "‘¶Ý‚µ‚È‚¢µÌÞ¼Þª¸Ä";
+ Text[ chinese_traditional ] = "¤£¦s¦bªºª«¥ó";
+ Text[ arabic ] = "ßÇÆä ÛíÑ ãæÌæÏ";
+ Text[ dutch ] = "Object bestaat niet";
+ Text[ chinese_simplified ] = "²»´æÔڵĶÔÏó";
+ Text[ greek ] = "Ìç õðáñêôü áíôéêåßìåíï";
+ Text[ korean ] = "¾ø´Â °³Ã¼";
+ Text[ turkish ] = "Mevcut olmayan nesne";
+ };
+ String ERRCODE_CLASS_ALREADYEXISTS
+ {
+ Text = "Objekt existiert bereits" ;
+ Text [ ENGLISH ] = "Object already exists" ;
+ Text [ dutch ] = "Object bestaat reeds" ;
+ Text [ english_us ] = "Object already exists" ;
+ Text [ italian ] = "L'oggetto esiste già" ;
+ Text [ spanish ] = "El objeto ya existe" ;
+ Text [ french ] = "Cet objet existe déjà" ;
+ Text [ swedish ] = "Objekt existerar redan" ;
+ Text [ danish ] = "Objektet eksisterer allerede" ;
+ Text [ portuguese ] = "Objecto já existe" ;
+ Text [ portuguese_brazilian ] = "Objekt existiert bereits" ;
+ Text[ chinese_simplified ] = "¶ÔÏóÒѾ­´æÔÚ";
+ Text[ russian ] = "Îáúåêò óæå ñóùåñòâóåò";
+ Text[ polish ] = "Obiekt ju¿ istnieje";
+ Text[ japanese ] = "µÌÞ¼Þª¸Ä‚Í‚·‚Å‚É‚ ‚è‚Ü‚·";
+ Text[ chinese_traditional ] = "ª«¥ó¤w¸g¦s¦b";
+ Text[ arabic ] = "ÇáßÇÆä ãæÌæÏ ãÓÈÞÇð";
+ Text[ dutch ] = "Object bestaat reeds";
+ Text[ chinese_simplified ] = "¶ÔÏóÒѾ­´æÔÚ";
+ Text[ greek ] = "Ôï áíôéêåßìåíï õðÜñ÷åé Þäç";
+ Text[ korean ] = "°³Ã¼°¡ ÀÌ¹Ì ÀÖÀ½";
+ Text[ turkish ] = "Nesne mevcut";
+ };
+ String ERRCODE_CLASS_ACCESS
+ {
+ Text = "Kein Zugriff auf Objekt" ;
+ Text [ ENGLISH ] = "object could not be accessed" ;
+ Text [ dutch ] = "Geen toegang tot object" ;
+ Text [ english_us ] = "Object not accessible" ;
+ Text [ italian ] = "Accesso all'oggetto non possibile" ;
+ Text [ spanish ] = "No hay acceso al objeto" ;
+ Text [ french ] = "Impossible d'accéder à l'objet" ;
+ Text [ swedish ] = "Ingen åtkomst till objekt" ;
+ Text [ danish ] = "Ingen adgang til objekt" ;
+ Text [ portuguese ] = "Objecto inacessível" ;
+ Text [ portuguese_brazilian ] = "Kein Zugriff auf Objekt" ;
+ Text[ chinese_simplified ] = "²»Äܹ»¶ÁÈ¡¶ÔÏó";
+ Text[ russian ] = "Îáúåêò íå äîñòóïåí";
+ Text[ polish ] = "Obiekt niedostêpny";
+ Text[ japanese ] = "µÌÞ¼Þª¸Ä‚ɱ¸¾½‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "¤£¯à°÷Ū¨úª«¥ó";
+ Text[ arabic ] = "áÇ íãßä ÇáæÕæá Åáì ÇáßÇÆä";
+ Text[ dutch ] = "Geen toegang tot object";
+ Text[ chinese_simplified ] = "²»Äܹ»¶ÁÈ¡¶ÔÏó";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá ãßíåé ðñüóâáóç óôï áíôéêåßìåíï.";
+ Text[ korean ] = "°³Ã¼¿¡ ¾×¼¼½º ¸øÇÔ";
+ Text[ turkish ] = "Nesneye eriþim saðlanamýyor";
+ };
+ String ERRCODE_CLASS_PATH
+ {
+ Text = "Unzulässiger Pfad" ;
+ Text [ ENGLISH ] = "Invalid path" ;
+ Text [ dutch ] = "Ongeoorloofd pad" ;
+ Text [ english_us ] = "Inadmissable path" ;
+ Text [ italian ] = "Percorso incorretto" ;
+ Text [ spanish ] = "Ruta no autorizada" ;
+ Text [ french ] = "Chemin incorrect" ;
+ Text [ swedish ] = "Otillåten sökväg" ;
+ Text [ danish ] = "Ugyldig sti" ;
+ Text [ portuguese ] = "Atalho não autorizado" ;
+ Text [ portuguese_brazilian ] = "Unzulässiger Pfad" ;
+ Text[ chinese_simplified ] = "·¾¶ÎÞЧ";
+ Text[ russian ] = "Íåäîïóñòèìûé ïóòü";
+ Text[ polish ] = "Niedopuszczalna œcie¿ka";
+ Text[ japanese ] = "•s‹–‰Â‚ÌÊß½";
+ Text[ chinese_traditional ] = "¸ô®|µL®Ä";
+ Text[ arabic ] = "ãÓÇÑ ãÍÙæÑ";
+ Text[ dutch ] = "Ongeoorloofd pad";
+ Text[ chinese_simplified ] = "·¾¶ÎÞЧ";
+ Text[ greek ] = "Ìç Ýãêõñç äéáäñïìÞ";
+ Text[ korean ] = "Çã¿ëµÇÁö ¾Ê´Â °æ·Î";
+ Text[ turkish ] = "Geçersiz veri yolu";
+ };
+ String ERRCODE_CLASS_LOCKING
+ {
+ Text = "Lockingproblem" ;
+ Text [ ENGLISH ] = "Sharing conflict" ;
+ Text [ dutch ] = "Locking-probleem" ;
+ Text [ english_us ] = "Locking problem" ;
+ Text [ italian ] = "Problema di locking" ;
+ Text [ spanish ] = "Problema de bloqueo" ;
+ Text [ french ] = "Problème de verrouillage" ;
+ Text [ swedish ] = "Låsproblem" ;
+ Text [ danish ] = "Låseproblem" ;
+ Text [ portuguese ] = "Problema de bloqueio" ;
+ Text [ portuguese_brazilian ] = "Lockingproblem" ;
+ Text[ chinese_simplified ] = "Ëø¶¨³åÍ»";
+ Text[ russian ] = "Ïðîáëåìà âõîäà â ñèñòåìó";
+ Text[ polish ] = "Problem blokady";
+ Text[ japanese ] = "‹¤—LÕ“Ë";
+ Text[ language_user1 ] = " ";
+ Text[ chinese_traditional ] = "ÀÉ®×Âê©w½Ä¬ð";
+ Text[ arabic ] = "ãÔßáÉ Ýí ÇáÊÃãíä";
+ Text[ dutch ] = "Locking-probleem";
+ Text[ chinese_simplified ] = "Ëø¶¨³åÍ»";
+ Text[ greek ] = "Ðñüâëçìá êëåéäþìáôïò";
+ Text[ korean ] = "Àá±Ý ¹®Á¦";
+ Text[ turkish ] = "Kenetlenme sorunu";
+ };
+ String ERRCODE_CLASS_PARAMETER
+ {
+ Text = "Falscher Parameter" ;
+ Text [ ENGLISH ] = "Wrong parameter" ;
+ Text [ english_us ] = "Wrong parameter" ;
+ Text [ italian ] = "Parametro errato" ;
+ Text [ spanish ] = "Parámetro falso" ;
+ Text [ french ] = "Erreur de paramètre" ;
+ Text [ dutch ] = "Verkeerde parameter" ;
+ Text [ swedish ] = "Felaktig parameter" ;
+ Text [ danish ] = "Forkert parameter" ;
+ Text [ portuguese ] = "Parâmetro incorrecto" ;
+ Text [ portuguese_brazilian ] = "Falscher Parameter" ;
+ Text[ chinese_simplified ] = "ÎÞЧµÄ²ÎÊý";
+ Text[ russian ] = "Íåïðàâèëüíûé ïàðàìåòð";
+ Text[ polish ] = "Nieprawid³owy parametr";
+ Text[ japanese ] = "³‚µ‚­‚È‚¢Êß×Ò°À";
+ Text[ chinese_traditional ] = "§UÅܶqµL®Ä";
+ Text[ arabic ] = "ãÚáãÉ ÎÇØÆÉ";
+ Text[ dutch ] = "Verkeerde parameter";
+ Text[ chinese_simplified ] = "ÎÞЧµÄ²ÎÊý";
+ Text[ greek ] = "ËÜèïò ðáñÜìåôñïò";
+ Text[ korean ] = "Ʋ¸° ÆĶó¹ÌÅÍ";
+ Text[ turkish ] = "Yanlýþ parametre";
+ };
+ String ERRCODE_CLASS_SPACE
+ {
+ Text = "Resource erschöpft" ;
+ Text [ ENGLISH ] = "No space left" ;
+ Text [ dutch ] = "Resource uitgeput" ;
+ Text [ english_us ] = "Resource exhausted" ;
+ Text [ italian ] = "Risorse esaurite" ;
+ Text [ spanish ] = "No hay recursos diponibles" ;
+ Text [ french ] = "Ressource épuisée" ;
+ Text [ swedish ] = "Inga resurser kvar" ;
+ Text [ danish ] = "Ressource opbrugt" ;
+ Text [ portuguese ] = "Recursos esgotados" ;
+ Text [ portuguese_brazilian ] = "Resource erschöpft" ;
+ Text[ chinese_simplified ] = "×ÊÔ´ÒѾ­ÓÃÍê";
+ Text[ russian ] = "Ðåñóðñû èñ÷åðïàíû";
+ Text[ polish ] = "Wyczerpany zasób";
+ Text[ japanese ] = "Ø¿°½‚ªŽg‚¢s‚­‚³‚ê‚Ä‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "¸ê·½¤w¸g¥ÎºÉ";
+ Text[ arabic ] = "Êã ÇÓÊåáÇß ÇáãÕÏÑ ßáå";
+ Text[ dutch ] = "Resource uitgeput";
+ Text[ chinese_simplified ] = "×ÊÔ´ÒѾ­ÓÃÍê";
+ Text[ greek ] = "Ïé ðüñïé åîáíôëÞèçêáí";
+ Text[ korean ] = "¸®¼Ò½º °í°¥";
+ Text[ turkish ] = "Kaynak tükendi";
+ };
+ String ERRCODE_CLASS_NOTSUPPORTED
+ {
+ Text = "Aktion nicht unterstützt" ;
+ Text [ ENGLISH ] = "Action not supported" ;
+ Text [ dutch ] = "Activiteit wordt niet ondersteund" ;
+ Text [ english_us ] = "Action not supported" ;
+ Text [ italian ] = "Operazione non supportata" ;
+ Text [ spanish ] = "Acción no apoyada" ;
+ Text [ french ] = "Action non soutenue" ;
+ Text [ swedish ] = "Åtgärd inte understödd" ;
+ Text [ danish ] = "Handlingen understøttes ikke" ;
+ Text [ portuguese ] = "Acção sem suporte" ;
+ Text [ portuguese_brazilian ] = "Aktion nicht unterstützt" ;
+ Text[ chinese_simplified ] = "²Ù×÷²»ÊÜÖ§³Ö";
+ Text[ russian ] = "Äåéñòâèå íå ïîääåðæèâàåòñÿ";
+ Text[ polish ] = "Akcja nie jest obs³ugiwana";
+ Text[ japanese ] = "±¸¼®Ý‚ÍŽx‰‡‚³‚ê‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "¾Þ§@¤£¨ü¤ä´©";
+ Text[ arabic ] = "åÐÇ ÇáÅÌÑÇÁ áÇ íõÏÚã";
+ Text[ dutch ] = "Activiteit wordt niet ondersteund";
+ Text[ chinese_simplified ] = "²Ù×÷²»ÊÜÖ§³Ö";
+ Text[ greek ] = "Ç åíÝñãåéá äåí õðïóôçñßæåôáé";
+ Text[ korean ] = "ÀÛ¾÷À» Áö¿øÇÏÁö ¾ÊÀ½";
+ Text[ turkish ] = "Ýþlem desteklenmiyor";
+ };
+ String ERRCODE_CLASS_READ
+ {
+ Text = "Leseproblem" ;
+ Text [ ENGLISH ] = "Read problem" ;
+ Text [ english_us ] = "Read Error" ;
+ Text [ italian ] = "Errore di lettura" ;
+ Text [ spanish ] = "Error de lectura" ;
+ Text [ french ] = "Erreur de lecture" ;
+ Text [ dutch ] = "Probleem bij lezen" ;
+ Text [ swedish ] = "Läsproblem" ;
+ Text [ danish ] = "Læsefejl" ;
+ Text [ portuguese ] = "Erro de leitura" ;
+ Text [ portuguese_brazilian ] = "Leseproblem" ;
+ Text[ chinese_simplified ] = "¶ÁÈ¡´íÎó";
+ Text[ russian ] = "Ïðîáëåìà ñ÷èòûâàíèÿ";
+ Text[ polish ] = "B³¹d odczytu";
+ Text[ japanese ] = "“Ç‚ÝŽæ‚è´×°";
+ Text[ chinese_traditional ] = "Ū¨ú¿ù»~";
+ Text[ arabic ] = "ÎØÃ Ýí ÇáÞÑÇÁÉ";
+ Text[ dutch ] = "Probleem bij lezen";
+ Text[ chinese_simplified ] = "¶ÁÈ¡´íÎó";
+ Text[ greek ] = "ÓöÜëìá áíÜãíùóçò";
+ Text[ korean ] = "Àб⠿À·ù";
+ Text[ turkish ] = "Okuma hatasý";
+ };
+ String ERRCODE_CLASS_WRITE
+ {
+ Text = "Schreibproblem" ;
+ Text [ ENGLISH ] = "Write problem" ;
+ Text [ dutch ] = "Probleem bij schrijven" ;
+ Text [ english_us ] = "Write Error" ;
+ Text [ italian ] = "Errore di scrittura" ;
+ Text [ spanish ] = "Error de escritura" ;
+ Text [ french ] = "Erreur d'écriture" ;
+ Text [ swedish ] = "Skrivproblem" ;
+ Text [ danish ] = "Skrivefejl" ;
+ Text [ portuguese ] = "Erro de escrita" ;
+ Text [ portuguese_brazilian ] = "Schreibproblem" ;
+ Text[ chinese_simplified ] = "¸²Ð´´íÎó";
+ Text[ russian ] = "Ïðîáëåìà çàïèñè";
+ Text[ polish ] = "B³¹d zapisu";
+ Text[ japanese ] = "‘‚«ž‚Ý´×°";
+ Text[ chinese_traditional ] = "Âмg¿ù»~";
+ Text[ arabic ] = "ÎØà Ýí ÇáßÊÇÈÉ";
+ Text[ dutch ] = "Probleem bij schrijven";
+ Text[ chinese_simplified ] = "¸²Ð´´íÎó";
+ Text[ greek ] = "ÓöÜëìá åããñáöÞò";
+ Text[ korean ] = "¾²±â ¿À·ù";
+ Text[ turkish ] = "Yazma hatasý";
+ };
+ String ERRCODE_CLASS_UNKNOWN
+ {
+ Text = "Unbekannt" ;
+ Text [ ENGLISH ] = "Error class is unknown" ;
+ Text [ dutch ] = "Onbekend" ;
+ Text [ english_us ] = "unknown" ;
+ Text [ italian ] = "Sconosciuto" ;
+ Text [ spanish ] = "Desconocido" ;
+ Text [ french ] = "Inconnu" ;
+ Text [ swedish ] = "Obekant" ;
+ Text [ danish ] = "Ukendt" ;
+ Text [ portuguese ] = "Desconhecido" ;
+ Text [ portuguese_brazilian ] = "Unbekannt" ;
+ Text[ chinese_simplified ] = "²»Ã÷";
+ Text[ russian ] = "Íåèçâåñòíî";
+ Text[ polish ] = "Nieznany";
+ Text[ japanese ] = "•s–¾";
+ Text[ chinese_traditional ] = "¤£©ú";
+ Text[ arabic ] = "ÛíÑ ãÚÑæÝ";
+ Text[ dutch ] = "Onbekend";
+ Text[ chinese_simplified ] = "²»Ã÷";
+ Text[ greek ] = "¢ãíùóôï";
+ Text[ korean ] = "¾Ë·ÁÁöÁö ¾ÊÀ½";
+ Text[ turkish ] = "Bilinmiyor";
+ };
+ String ERRCODE_CLASS_VERSION
+ {
+ Text = "Versionskonflikt" ;
+ Text [ ENGLISH ] = "Incompatible Version" ;
+ Text [ english_us ] = "Version Incompatibility" ;
+ Text [ italian ] = "Conflitto di versione" ;
+ Text [ spanish ] = "Versiones incompatibles" ;
+ Text [ french ] = "Incompatibilité entre versions" ;
+ Text [ dutch ] = "Incompatibele versie" ;
+ Text [ swedish ] = "Versionskonflikt" ;
+ Text [ danish ] = "Versionskonflikt" ;
+ Text [ portuguese ] = "Incompatibilidade entre versões" ;
+ Text [ portuguese_brazilian ] = "Versionskonflikt" ;
+ Text[ chinese_simplified ] = "°æ±¾³åÍ»";
+ Text[ russian ] = "Íåñîâìåñòèìîñòü âåðñèé";
+ Text[ polish ] = "Niezgodna wersja";
+ Text[ japanese ] = "ÊÞ°¼Þ®Ýˆá”½";
+ Text[ chinese_traditional ] = "ª©¥»½Ä¬ð";
+ Text[ arabic ] = "ÅÕÏÇÑÇÊ ÛíÑ ãÊæÇÝÞÉ";
+ Text[ dutch ] = "Incompatibele versie";
+ Text[ chinese_simplified ] = "°æ±¾³åÍ»";
+ Text[ greek ] = "ÄéÝíåîç Ýêäïóçò";
+ Text[ korean ] = "ȣȯµÇÁö ¾Ê´Â ¹öÀü";
+ Text[ turkish ] = "Sürüm uyumsuzluðu";
+ };
+ String ERRCODE_CLASS_GENERAL
+ {
+ Text = "Allgemeiner Fehler" ;
+ Text [ ENGLISH ] = "General Error" ;
+ Text [ dutch ] = "Algemene fout" ;
+ Text [ english_us ] = "General Error" ;
+ Text [ italian ] = "Errore generale" ;
+ Text [ spanish ] = "Error general" ;
+ Text [ french ] = "Erreur générale" ;
+ Text [ swedish ] = "Allmänt fel" ;
+ Text [ danish ] = "Generel fejl" ;
+ Text [ portuguese ] = "Erro geral" ;
+ Text [ portuguese_brazilian ] = "Allgemeiner Fehler" ;
+ Text[ chinese_simplified ] = "Ò»°ã´íÎó";
+ Text[ russian ] = "Îáùàÿ îøèáêà";
+ Text[ polish ] = "B³¹d ogólny";
+ Text[ japanese ] = "ˆê”Ê“I‚È´×°";
+ Text[ chinese_traditional ] = "¤@¯ë¿ù»~";
+ Text[ arabic ] = "ÎØÃ ÚÇã";
+ Text[ dutch ] = "Algemene fout";
+ Text[ chinese_simplified ] = "Ò»°ã´íÎó";
+ Text[ greek ] = "Ãåíéêü óöÜëìá";
+ Text[ korean ] = "ÀϹÝÀû ¿À·ù";
+ Text[ turkish ] = "Genel hata";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_CLASS_FORMAT
+ {
+ Text = "Falsches Format" ;
+ Text [ ENGLISH ] = "Wrong format" ;
+ Text [ dutch ] = "Foutief formaat" ;
+ Text [ english_us ] = "Incorrect format" ;
+ Text [ italian ] = "Formato errato" ;
+ Text [ spanish ] = "Formato incorrecto" ;
+ Text [ french ] = "Erreur de format" ;
+ Text [ swedish ] = "Felaktigt format" ;
+ Text [ danish ] = "Forkert format" ;
+ Text [ portuguese ] = "Formato incorrecto" ;
+ Text [ portuguese_brazilian ] = "Falsches Format" ;
+ Text[ chinese_simplified ] = "´íÎóµÄ¸ñʽ";
+ Text[ russian ] = "Íåïðàâèëüíûé ôîðìàò";
+ Text[ polish ] = "Nieprawid³owy format";
+ Text[ japanese ] = "³‚µ‚­‚È‚¢‘Ž®";
+ Text[ chinese_traditional ] = "®æ¦¡µL®Ä";
+ Text[ arabic ] = "ÊäÓíÞ ÎÇØÆ";
+ Text[ dutch ] = "Foutief formaat";
+ Text[ chinese_simplified ] = "´íÎóµÄ¸ñʽ";
+ Text[ greek ] = "Ìç áðïäåêôÞ ìïñöÞ";
+ Text[ korean ] = "Ʋ¸° ¼­½Ä";
+ Text[ turkish ] = "Yanlýþ format";
+ };
+ String ERRCODE_CLASS_CREATE
+ {
+ Text = "Fehler beim Anlegen" ;
+ Text [ ENGLISH ] = "Create error" ;
+ Text [ dutch ] = "Fout bij maken van object" ;
+ Text [ english_us ] = "Error creating object" ;
+ Text [ italian ] = "Errore durante la creazione" ;
+ Text [ spanish ] = "Error al crear" ;
+ Text [ french ] = "Erreur lors de la création" ;
+ Text [ swedish ] = "Fel vid uppläggning" ;
+ Text [ danish ] = "Fejl under oprettelsen" ;
+ Text [ portuguese ] = "Erro ao criar" ;
+ Text [ portuguese_brazilian ] = "Fehler beim Anlegen" ;
+ Text[ chinese_simplified ] = "½¨Á¢¶ÔÏóʱ·¢Éú´íÎó";
+ Text[ russian ] = "Îøèáêà ïðè ñîçäàíèè";
+ Text[ polish ] = "B³¹d przy tworzeniu obiektu";
+ Text[ japanese ] = "쬂ÌÛ‚Ì´×°";
+ Text[ chinese_traditional ] = "µo¥Í¿ù»~¦b«Ø¥ß";
+ Text[ arabic ] = "ÎØà ÃËäÇÁ ÇáÅäÔÇÁ";
+ Text[ dutch ] = "Fout bij maken van object";
+ Text[ chinese_simplified ] = "½¨Á¢¶ÔÏóʱ·¢Éú´íÎó";
+ Text[ greek ] = "ÓöÜëìá êáôÜ ôçí äçìéïõñãßá";
+ Text[ korean ] = "°³Ã¼ ÀÛ¼º½Ã ¿À·ù";
+ Text[ turkish ] = "Oluþturma hatasý";
+ };
+ String ERRCODE_CLASS_SBX
+ {
+ Text = "Unzulässiger Wert oder Datentyp" ;
+ Text [ ENGLISH ] = "Invalid value or data type" ;
+ Text [ english_us ] = "Inadmissable value or data type" ;
+ Text [ italian ] = "Valore o tipo di dati non permesso" ;
+ Text [ spanish ] = "Valor o tipo de datos inadmisible" ;
+ Text [ french ] = "Valeur ou type de données incorrect(e)" ;
+ Text [ dutch ] = "Niet toegestane waarde of gegevenstype" ;
+ Text [ swedish ] = "Otillåtet värde eller datatyp" ;
+ Text [ danish ] = "Ikke-tilladt værdi eller datatype" ;
+ Text [ portuguese ] = "Valor ou tipo de dados não autorizados" ;
+ Text [ portuguese_brazilian ] = "Unzulässiger Wert oder Datentyp" ;
+ Text[ chinese_simplified ] = "ÎÞЧµÄÊýÖµ»òÊý¾ÝÀàÐÍ";
+ Text[ russian ] = "Çíà÷åíèå èëè òèï äàííûõ íå äîïóñòèìû";
+ Text[ polish ] = "Niedopuszczalna wartoϾ lub typ pliku";
+ Text[ japanese ] = "•s‹–‰Â‚Ì’l‚Ü‚½‚ÍÃÞ°ÀÀ²Ìß";
+ Text[ chinese_traditional ] = "¼Æ­È©Î¸ê®ÆÃþ«¬µL®Ä";
+ Text[ arabic ] = "ÞãíÉ ãÍÙæÑÉ¡ Ãæ äæÚ ÈíÇäÇÊ ãÍÙæÑ";
+ Text[ dutch ] = "Niet toegestane waarde of gegevenstype";
+ Text[ chinese_simplified ] = "ÎÞЧµÄÊýÖµ»òÊý¾ÝÀàÐÍ";
+ Text[ greek ] = "Ìç áðïäåêôÞ ôéìÞ Þ ôýðïò äåäïìÝíùí";
+ Text[ korean ] = "Çã¿ëµÇÁö ¾Ê´Â °ª ¶Ç´Â µ¥ÀÌÅÍ À¯Çü";
+ Text[ turkish ] = "Geçersiz deðer ya da veri tipi";
+ };
+ String ERRCODE_CLASS_RUNTIME
+ {
+ Text = "BASIC-Laufzeitfehler" ;
+ Text [ ENGLISH ] = "BASIC runtime error" ;
+ Text [ dutch ] = "BASIC runtime error" ;
+ Text [ english_us ] = "BASIC runtime error" ;
+ Text [ italian ] = "Errore di runtime basic" ;
+ Text [ spanish ] = "Error de ejecución de BASIC" ;
+ Text [ french ] = "Runtime error BASIC" ;
+ Text [ swedish ] = "BASIC-runtimefel" ;
+ Text [ danish ] = "BASIC-runtimefejl" ;
+ Text [ portuguese ] = "Erro de rotina BASIC" ;
+ Text [ portuguese_brazilian ] = "Basic-Laufzeitfehler" ;
+ Text[ chinese_simplified ] = "BASIC ÔËÐÐʱ¼ä´íÎó";
+ Text[ russian ] = "Îøèáêà ïðè âûïîëíåíèè BASIC";
+ Text[ polish ] = "B³¹d czasu przebiegu BASIC";
+ Text[ japanese ] = "BASIC‚Ì×ÝÀ²Ñ ´×°";
+ Text[ chinese_traditional ] = "BASIC ¹B¦æ®É¶¡¿ù»~";
+ Text[ arabic ] = "ÎØÃ Ýí æÞÊ ÊÔÛíá BASIC";
+ Text[ dutch ] = "BASIC runtime error";
+ Text[ chinese_simplified ] = "BASIC ÔËÐÐʱ¼ä´íÎó";
+ Text[ greek ] = "ÓöÜëìá ÷ñüíïõ åêôÝëåóçò BASIC";
+ Text[ korean ] = "BASIC ½ÇÇà½Ã°£ ¿À·ù";
+ Text[ turkish ] = "BASIC yürütüm süresi hatasý";
+ };
+ String ERRCODE_CLASS_COMPILER
+ {
+ Text = "BASIC-Syntaxfehler" ;
+ Text [ ENGLISH ] = "BASIC syntax error" ;
+ Text [ portuguese ] = "Erro de sintaxe BASIC" ;
+ Text [ english_us ] = "BASIC syntax error" ;
+ Text [ portuguese_brazilian ] = "Basic-Compilerfehler" ;
+ Text [ swedish ] = "BASIC-syntaxfel" ;
+ Text [ danish ] = "BASIC-syntaksfejl" ;
+ Text [ italian ] = "Errore di sintassi BASIC" ;
+ Text [ spanish ] = "Error de sintaxis de BASIC" ;
+ Text [ french ] = "Syntax error BASIC" ;
+ Text [ dutch ] = "BASIC syntax error" ;
+ Text[ chinese_simplified ] = "BASIC Óï·¨´íÎó";
+ Text[ russian ] = "Ñèíòàêñè÷åñêàÿ îøèáêà BASIC";
+ Text[ polish ] = "B³¹d sk³adni BASIC";
+ Text[ japanese ] = "BASIC‚̼ÝÀ¯¸½´×°";
+ Text[ chinese_traditional ] = "BASIC »yªk¿ù»~";
+ Text[ arabic ] = "ÎØà Ýí ÈäÇÁ ÌãáÉ BASIC";
+ Text[ dutch ] = "BASIC syntax error";
+ Text[ chinese_simplified ] = "BASIC Óï·¨´íÎó";
+ Text[ greek ] = "ÓöÜëìá óýíôáîçò BASIC";
+ Text[ korean ] = "BASIC ¹®Àå ¿À·ù";
+ Text[ turkish ] = "BASIC söz dizimi hatasý";
+ };
+ String 1
+ {
+ Text = "Allgemeiner Fehler" ;
+ Text [ ENGLISH ] = "General Error" ;
+ Text [ dutch ] = "Algemene fout" ;
+ Text [ english_us ] = "General Error" ;
+ Text [ italian ] = "Errore generale" ;
+ Text [ spanish ] = "Error general" ;
+ Text [ french ] = "Erreur générale" ;
+ Text [ swedish ] = "Allmänt fel" ;
+ Text [ danish ] = "Generel fejl" ;
+ Text [ portuguese ] = "Erro geral" ;
+ Text [ portuguese_brazilian ] = "Allgemeiner Fehler" ;
+ Text[ chinese_simplified ] = "Ò»°ã´íÎó";
+ Text[ russian ] = "Îáùàÿ îøèáêà";
+ Text[ polish ] = "B³¹d ogólny";
+ Text[ japanese ] = "ˆê”Ê“I‚È´×°";
+ Text[ chinese_traditional ] = "¤@¯ëªº¿ù»~";
+ Text[ arabic ] = "ÎØÃ ÚÇã";
+ Text[ dutch ] = "Algemene fout";
+ Text[ chinese_simplified ] = "Ò»°ã´íÎó";
+ Text[ greek ] = "Ãåíéêü óöÜëìá";
+ Text[ korean ] = "ÀϹÝÀû ¿À·ù";
+ Text[ turkish ] = "Genel hata";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_IO_GENERAL
+ {
+ Text = "Allgemeiner Ein-/Ausgabefehler" ;
+ Text [ ENGLISH ] = "General input/output error" ;
+ Text [ dutch ] = "Algemene input/output error" ;
+ Text [ english_us ] = "General input/output error" ;
+ Text [ italian ] = "Errore generale di I/O" ;
+ Text [ spanish ] = "Error general de entrada/salida" ;
+ Text [ french ] = "Erreur générale d'entrée/sortie" ;
+ Text [ swedish ] = "Allmänt input-/outputfel" ;
+ Text [ danish ] = "Generel input-/outputfejl" ;
+ Text [ portuguese ] = "Erro geral de entrada/saída." ;
+ Text [ portuguese_brazilian ] = "Allgemeiner Ein-/Ausgabefehler" ;
+ Text[ chinese_simplified ] = "Ò»°ãµÄÊäÈëÓëÊä³ö´íÎó";
+ Text[ russian ] = "Îáùàÿ îøèáêà ââîäà-âûâîäà";
+ Text[ polish ] = "Ogólny b³¹d wejœcia/wyjœcia";
+ Text[ japanese ] = "ˆê”Ê“I‚È I/O ´×°";
+ Text[ chinese_traditional ] = "¤@¯ëªº¿é¤J/¿é¥X¿ù»~";
+ Text[ arabic ] = "ÍÏË ÎØÃ ÅÏÎÇá/ÅÎÑÇÌ ÚÇã";
+ Text[ dutch ] = "Algemene input/output error";
+ Text[ chinese_simplified ] = "Ò»°ãµÄÊäÈëÓëÊä³ö´íÎó";
+ Text[ greek ] = "Ãåíéêü óöÜëìá åéóáãùãÞò/åîáãùãÞò";
+ Text[ korean ] = "ÀϹÝÀû ÀÔ·Â/Ãâ·Â ¿À·ù";
+ Text[ turkish ] = "Genel girdi/çýktý hatasý";
+ };
+ String ERRCODE_IO_MISPLACEDCHAR
+ {
+ Text = "Der Name der Datei ist ungültig" ;
+ Text [ ENGLISH ] = "Invalid filename" ;
+ Text [ dutch ] = "Ongeldige bestandsnaam" ;
+ Text [ english_us ] = "Invalid file name" ;
+ Text [ italian ] = "Il nome del file non è valido" ;
+ Text [ spanish ] = "El nombre del archivo no es válido." ;
+ Text [ french ] = "Nom de fichier incorrect" ;
+ Text [ swedish ] = "Namnet på filen är ogiltigt" ;
+ Text [ danish ] = "Filnavnet er ugyldigt" ;
+ Text [ portuguese ] = "O nome do ficheiro não é válido." ;
+ Text [ portuguese_brazilian ] = "Der Name der Datei ist ungültig" ;
+ Text[ chinese_simplified ] = "ÎÞЧµÄÎļþÃû";
+ Text[ russian ] = "Íåïðàâèëüíîå èìÿ ôàéëà";
+ Text[ polish ] = "Nazwa pliku jest nieprawid³owa";
+ Text[ japanese ] = "̧²Ù–¼‚Í–³Œø‚Å‚·";
+ Text[ chinese_traditional ] = "ÀɮצWµL®Ä";
+ Text[ arabic ] = "ÇÓã ÇáãáÝ ÛíÑ ÕÇáÍ";
+ Text[ dutch ] = "Ongeldige bestandsnaam";
+ Text[ chinese_simplified ] = "ÎÞЧµÄÎļþÃû";
+ Text[ greek ] = "Ôï üíïìá ôïõ áñ÷åßïõ äåí åßíáé Ýãêõñï";
+ Text[ korean ] = "ÆÄÀÏ À̸§ÀÌ À¯È¿ÇÏÁö ¾ÊÀ½";
+ Text[ turkish ] = "Dosyanýn adý geçerli deðil";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_IO_NOTEXISTS
+ {
+ Text = "Die Datei existiert nicht" ;
+ Text [ ENGLISH ] = "Nonexistant file" ;
+ Text [ dutch ] = "Bestand bestaat niet" ;
+ Text [ english_us ] = "Nonexistent file" ;
+ Text [ italian ] = "Il file non esiste" ;
+ Text [ spanish ] = "El archivo no existe" ;
+ Text [ french ] = "Fichier inexistant" ;
+ Text [ swedish ] = "Filen existerar inte" ;
+ Text [ danish ] = "Filen eksisterer ikke" ;
+ Text [ portuguese ] = "O ficheiro não existe." ;
+ Text [ portuguese_brazilian ] = "Die Datei existiert nicht" ;
+ Text[ chinese_simplified ] = "Îļþ²»´æÔÚ";
+ Text[ russian ] = "Ýòîò ôàéë íå ñóùåñòâóåò";
+ Text[ polish ] = "Plik nie istnieje";
+ Text[ japanese ] = "̧²Ù‚Í‚ ‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "Àɮפ£¦s¦b";
+ Text[ arabic ] = "ÇáãáÝ ÛíÑ ãæÌæÏ";
+ Text[ dutch ] = "Bestand bestaat niet";
+ Text[ chinese_simplified ] = "Îļþ²»´æÔÚ";
+ Text[ greek ] = "Ôï áñ÷åßï äåí õðÜñ÷åé";
+ Text[ korean ] = "ÆÄÀÏÀÌ ¾øÀ½";
+ Text[ turkish ] = "Dosya mevcut deðil";
+ };
+ String ERRCODE_IO_ALREADYEXISTS
+ {
+ Text = "Die Datei existiert bereits" ;
+ Text [ ENGLISH ] = "Nonexistant file" ;
+ Text [ dutch ] = "Bestand bestaat reeds" ;
+ Text [ english_us ] = "File already exists" ;
+ Text [ italian ] = "Il file esiste già" ;
+ Text [ spanish ] = "El archivo ya existe" ;
+ Text [ french ] = "Un fichier de ce nom existe déjà." ;
+ Text [ swedish ] = "Filen existerar redan" ;
+ Text [ danish ] = "Filen eksisterer allerede" ;
+ Text [ portuguese ] = "O ficheiro já existe." ;
+ Text [ portuguese_brazilian ] = "Die Datei existiert bereits" ;
+ Text[ chinese_simplified ] = "Õâ¸öÎļþÒѾ­´æÔÚ";
+ Text[ russian ] = "Òàêîé ôàéë óæå ñóùåñòâóåò";
+ Text[ polish ] = "Plik ju¿ istnieje";
+ Text[ japanese ] = "̧²Ù‚Í‚·‚Å‚É‚ ‚è‚Ü‚·";
+ Text[ chinese_traditional ] = "³o­ÓÀɮפw¸g¦s¦b";
+ Text[ arabic ] = "ÇáãáÝ ãæÌæÏ ãÓÈÞÇð";
+ Text[ dutch ] = "Bestand bestaat reeds";
+ Text[ chinese_simplified ] = "Õâ¸öÎļþÒѾ­´æÔÚ";
+ Text[ greek ] = "Ôï áñ÷åßï õðÜñ÷åé Þäç";
+ Text[ korean ] = "ÆÄÀÏÀÌ ÀÌ¹Ì ÀÖÀ½";
+ Text[ turkish ] = "Dosya mevcut";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_IO_NOTADIRECTORY
+ {
+ Text = "Bei dem Objekt handelt es sich nicht um ein Verzeichnis" ;
+ Text [ ENGLISH ] = "The object is not a directory" ;
+ Text [ english_us ] = "The object is not a directory" ;
+ Text [ italian ] = "L'oggetto non è una cartella" ;
+ Text [ spanish ] = "El objeto no es un directorio." ;
+ Text [ french ] = "L'objet indiqué n'est pas un répertoire" ;
+ Text [ dutch ] = "Object is geen directory" ;
+ Text [ swedish ] = "Objektet är ingen katalog" ;
+ Text [ danish ] = "Objektet er ikke et bibliotek" ;
+ Text [ portuguese ] = "O objecto não é um directório." ;
+ Text [ portuguese_brazilian ] = "Bei dem Objekt handelt es sich nicht um ein Verzeichnis" ;
+ Text[ chinese_simplified ] = "¶ÔÏó²»ÊÇÒ»¸öĿ¼";
+ Text[ russian ] = "Ýòîò îáúåêò íå ÿâëÿåòñÿ êàòàëîãîì";
+ Text[ polish ] = "Ten obiekt nie jest katalogiem";
+ Text[ japanese ] = "µÌÞ¼Þª¸Ä‚ÍÃÞ¨Ú¸ÄØ‚Å‚Í‚ ‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "ª«¥ó¤£¬O¤@­Ó¥Ø¿ý";
+ Text[ arabic ] = "åÐÇ ÇáßÇÆä áíÓ ÏáíáÇð";
+ Text[ dutch ] = "Object is geen directory";
+ Text[ chinese_simplified ] = "¶ÔÏó²»ÊÇÒ»¸öĿ¼";
+ Text[ greek ] = "Ôï áíôéêåßìåíï äåí åßíáé êáôÜëïãïò";
+ Text[ korean ] = "°³Ã¼´Â µð·ºÅ丮°¡ ¾Æ´Ô";
+ Text[ turkish ] = "Nesne, dizin deðil";
+ };
+ String ERRCODE_IO_NOTAFILE
+ {
+ Text = "Bei dem Objekt handelt es sich nicht um eine Datei" ;
+ Text [ ENGLISH ] = "The object is not a file" ;
+ Text [ english_us ] = "The object is not a file" ;
+ Text [ italian ] = "L'oggetto non è un file" ;
+ Text [ spanish ] = "El objeto no es ningún archivo." ;
+ Text [ french ] = "L'objet indiqué n'est pas un fichier" ;
+ Text [ dutch ] = "Object is geen bestand" ;
+ Text [ swedish ] = "Objektet är ingen fil" ;
+ Text [ danish ] = "Objektet er ikke en fil" ;
+ Text [ portuguese ] = "O objecto não é um ficheiro." ;
+ Text [ portuguese_brazilian ] = "Bei dem Objekt handelt es sich nicht um eine Datei" ;
+ Text[ chinese_simplified ] = "¶ÔÏó²»ÊÇÒ»¸öÎļþ";
+ Text[ russian ] = "Ýòîò îáúåêò íå ÿâëÿåòñÿ ôàéëîì";
+ Text[ polish ] = "Ten obiekt nie jest plikiem";
+ Text[ japanese ] = "µÌÞ¼Þª¸Ä‚Í̧²Ù‚Å‚Í‚ ‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "ª«¥ó¤£¬O¤@­ÓÀÉ®×";
+ Text[ arabic ] = "åÐÇ ÇáßÇÆä áíÓ ãáÝÇð";
+ Text[ dutch ] = "Object is geen bestand";
+ Text[ chinese_simplified ] = "¶ÔÏó²»ÊÇÒ»¸öÎļþ";
+ Text[ greek ] = "Ôï åðéëåãìÝíï áíôéêåßìåíï äåí åßíáé áñ÷åßï";
+ Text[ korean ] = "°³Ã¼´Â ÆÄÀÏÀÌ ¾Æ´Ô";
+ Text[ turkish ] = "Nesne, dosya deðil";
+ };
+ String ERRCODE_IO_INVALIDDEVICE
+ {
+ Text = "Das angegebene Gerät ist ungültig" ;
+ Text [ ENGLISH ] = "The device is invalid" ;
+ Text [ dutch ] = "Het aangegeven apparaat bestaat niet." ;
+ Text [ english_us ] = "The specified device is invalid" ;
+ Text [ italian ] = "L'apparecchiatura indicata non è valida" ;
+ Text [ spanish ] = "El dispositivo especificado no es válido." ;
+ Text [ french ] = "Le périphérique indiqué est incorrect" ;
+ Text [ swedish ] = "Den angivna apparaten är ogiltig" ;
+ Text [ danish ] = "Den angivne enhed er ugyldig" ;
+ Text [ portuguese ] = "O periférico indicado não é válido." ;
+ Text [ portuguese_brazilian ] = "Das angebene Gerät ist ungültig" ;
+ Text[ chinese_simplified ] = "Ö¸¶¨µÄÉ豸ÎÞЧ";
+ Text[ russian ] = "Çàäàííîå óñòðîéñòâî íå äîñòóïíî";
+ Text[ polish ] = "Podane urz¹dzenie jest nieprawid³owe";
+ Text[ japanese ] = "Žw’肵‚½ÃÞ¨ÊÞ²½‚Í–³Œø‚Å‚·";
+ Text[ chinese_traditional ] = "«ü©wªº³]³ÆµL®Ä";
+ Text[ arabic ] = "ÇáÌåÇÒ ÇáãÚØì ÛíÑ ÕÇáÍ";
+ Text[ dutch ] = "Het aangegeven apparaat bestaat niet.";
+ Text[ chinese_simplified ] = "Ö¸¶¨µÄÉ豸ÎÞЧ";
+ Text[ greek ] = "Ç êáèïñéóìÝíç óõóêåõÞ äåí åßíáé Ýãêõñç";
+ Text[ korean ] = "ÁöÁ¤µÈ ÀåÄ¡°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Belirtilen cihaz geçerli deðil";
+ };
+ String ERRCODE_IO_ACCESSDENIED
+ {
+ Text = "Aufgrund fehlender Rechte kann auf das Objekt\nnicht zugegriffen werden" ;
+ Text [ ENGLISH ] = "The device cannot be accessed because\nof insufficient user rights" ;
+ Text [ dutch ] = "Er bestaat geen recht op toegang\n tot object." ;
+ Text [ english_us ] = "The object cannot be accessed\ndue to insufficient user rights" ;
+ Text [ italian ] = "A causa di diritti mancanti non è possibile\naccedere all'oggetto" ;
+ Text [ spanish ] = "No es posible acceder al objeto\npor falta de derechos." ;
+ Text [ french ] = "Impossible d'accéder à l'objet\ndroits d'accès insuffisants" ;
+ Text [ swedish ] = "Åtkomst till objektet kan inte medges\neftersom rättigheter saknas" ;
+ Text [ danish ] = "Det er ikke muligt at få adgang til objektet,\nfordi de krævede adgangsrettigheder mangler" ;
+ Text [ portuguese ] = "Impossível o acesso ao objecto\npor falta de direitos." ;
+ Text [ portuguese_brazilian ] = "Aufgrund fehlender Rechte kann auf das Objekt\nnicht zugegriffen werden" ;
+ Text[ chinese_simplified ] = "ȱÉÙ¶ÁȡȨÀû£¬\nÎÞ·¨¶ÁÈ¡Õâ¸ö¶ÔÏó";
+ Text[ russian ] = "Èç-çà îòñóòñòâóþùèõ ïðàâ äîñòóï ê îáúåêòó\níå ðàçðåøåí";
+ Text[ polish ] = "Brak dostêpu do obiektu \n z powodu brakuj¹cych praw dostêpu";
+ Text[ japanese ] = "Œ —˜‚ª‚È‚¢‚Ì‚Å\nµÌÞ¼Þª¸Ä‚ɱ¸¾½‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "¯Ê¤ÖŪ¨úÅv§Q¡M\nµLªkŪ¨ú³o­Óª«¥ó";
+ Text[ arabic ] = "áÇ íãßä ÇáæÕæá Åáì ÇáßÇÆä¡\náÚÏã ÊæÝÑ ÇáÍÞæÞ ÇááÇÒãÉ";
+ Text[ dutch ] = "Er bestaat geen recht op toegang\n tot object.";
+ Text[ chinese_simplified ] = "ȱÉÙ¶ÁȡȨÀû£¬\nÎÞ·¨¶ÁÈ¡Õâ¸ö¶ÔÏó";
+ Text[ greek ] = "Ç ðñüóâáóç óôï áíôéêåßìåíï äåí åßíáé äõíáôÞ\nëüãù Ýëëåéøçò äéêáéùìÜôùí";
+ Text[ korean ] = "»ç¿ëÀÚ ±ÇÇÑÀÌ ¾ø¾î °³Ã¼¿¡\n¾×¼¼½ºÇÒ ¼ö ¾øÀ½";
+ Text[ turkish ] = "Gerekli eriþim haklarýnýn olmamasý nedeniyle \nnesneye eriþim saðlanamýyor";
+ };
+ String ERRCODE_IO_LOCKVIOLATION
+ {
+ Text = "Fehler beim gemeinsamen Zugriff auf das Objekt" ;
+ Text [ ENGLISH ] = "Sharing violation while accessing the object" ;
+ Text [ english_us ] = "Sharing violation while accessing the object" ;
+ Text [ italian ] = "Errore nell'accesso comune all'oggetto" ;
+ Text [ spanish ] = "Error al acceder conjuntamente al objeto." ;
+ Text [ french ] = "Erreur lors de la tentative d'accès partagé sur l'objet" ;
+ Text [ dutch ] = "Fout bij gelijktijdige toegang tot object" ;
+ Text [ swedish ] = "Fel vid gemensam åtkomst till objektet" ;
+ Text [ danish ] = "Fejl under fælles adgang til objektet" ;
+ Text [ portuguese ] = "Erro ao tentar acesso partilhado ao objecto." ;
+ Text [ portuguese_brazilian ] = "Fehler beim gemeinsamen Zugriff auf das Objekt" ;
+ Text[ chinese_simplified ] = "ÔÚͬʱ¶ÁÈ¡Õâ¸ö¶ÔÏóʱ·¢Éú´íÎó";
+ Text[ russian ] = "Îøèáêà ïðè êîëëåêòèâíîì äîñòóïå ê îáúåêòó";
+ Text[ polish ] = "Nast¹pi³o naruszenie zasad wspó³u¿ytkowania podczas dostêpu do obiektu";
+ Text[ japanese ] = "µÌÞ¼Þª¸Äã‚Ì‹¤—L±¸¾½‚ÌÛ‚Ì´×°";
+ Text[ chinese_traditional ] = "¦b¦P®ÉŪ¨ú³o­Óª«¥ó®Éµo¥Í¿ù»~";
+ Text[ arabic ] = "ÍÏË ÎØà ÃËäÇÁ ãÍÇæáÉ ÇáæÕæá ÇáãÔÊÑß Åáì ÇáßÇÆä";
+ Text[ dutch ] = "Fout bij gelijktijdige toegang tot object";
+ Text[ chinese_simplified ] = "ÔÚͬʱ¶ÁÈ¡Õâ¸ö¶ÔÏóʱ·¢Éú´íÎó";
+ Text[ greek ] = "ÓöÜëìá êáôÜ ôçí êïéíÞ ðñüóâáóç óôï áíôéêåßìåíï";
+ Text[ korean ] = "°³Ã¼¿¡ °øÀ¯ ¾×¼¼½ºÇÒ ¶§ ¿À·ù";
+ Text[ turkish ] = "Nesneye eriþimde bir paylaþým hatasý oluþtu";
+ };
+ String ERRCODE_IO_OUTOFSPACE
+ {
+ Text = "Auf dem Gerät ist kein Platz mehr verfügbar" ;
+ Text [ ENGLISH ] = "No more space on device" ;
+ Text [ dutch ] = "Onvoldoende opslagruimte" ;
+ Text [ english_us ] = "No more space on device" ;
+ Text [ italian ] = "Sul dispositivo non c'è più posto" ;
+ Text [ spanish ] = "No hay espacio disponible en el dispositivo." ;
+ Text [ french ] = "Les ressources du périphérique sont épuisées" ;
+ Text [ swedish ] = "Det finns ingen plats kvar på apparaten" ;
+ Text [ danish ] = "Der er ikke mere tilgængelig plads på enheden" ;
+ Text [ portuguese ] = "Não há mais espaço no periférico." ;
+ Text [ portuguese_brazilian ] = "Auf dem Gerät ist kein Platz mehr verfügbar" ;
+ Text[ chinese_simplified ] = "É豸ÉϵĿÉÓÿռäÒѾ­ÓÃÍê";
+ Text[ russian ] = "Íà ýòîì óñòðîéñòâå ñâîáîäíîãî ìåñòà áîëüøå íåò";
+ Text[ polish ] = "Nie ma wiêcej miejsca na tym urz¹dzeniu";
+ Text[ japanese ] = "ÃÞ¨ÊÞ²½ã‚É‹ó‚«—e—Ê‚ª‚ ‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "³]³Æªº¥i¥ÎªÅ¶¡¤w¸g¥ÎºÉ";
+ Text[ arabic ] = "áã íÚÏ åäÇß ãßÇä Ýí ÇáÌåÇÒ";
+ Text[ dutch ] = "Onvoldoende opslagruimte";
+ Text[ chinese_simplified ] = "É豸ÉϵĿÉÓÿռäÒѾ­ÓÃÍê";
+ Text[ greek ] = "Äåí åßíáé äéáèÝóéìïò ðåñéóóüôåñïò ÷þñïò óôç óõóêåõÞ";
+ Text[ korean ] = "ÀåÄ¡¿¡ ´õ ÀÌ»ó ÀÌ¿ë °ø°£ÀÌ ¾øÀ½";
+ Text[ turkish ] = "Cihazda yeterli alan kalmadý";
+ };
+ String ERRCODE_IO_ISWILDCARD
+ {
+ Text = "Die Operation kann nicht auf Dateien, welche\nWildcards enthalten, ausgeführt werden" ;
+ Text [ ENGLISH ] = "This operation is not permitted on filenames containing wildcards" ;
+ Text [ dutch ] = "Deze opdracht kan niet worden uitgevoerd bij bestanden \ndie wildcards bevatten" ;
+ Text [ english_us ] = "This operation cannot be run on\nfiles containing wildcards" ;
+ Text [ italian ] = "L'operazione non può essere effettuata su file che \ncontengono wildcards" ;
+ Text [ spanish ] = "La operación no se puede ejecutar en\narchivos que contengan Wildcards." ;
+ Text [ french ] = "Cette action ne peut pas être exécutée sur des fichiers\ncontenant des caractères génériques (Wildcards)" ;
+ Text [ swedish ] = "Operationen kan inte utföras på filer som\ninnehåller jokertecken" ;
+ Text [ danish ] = "Det er ikke muligt at udføre processen på filer,\nsom indeholder jokertegn" ;
+ Text [ portuguese ] = "A operação não pode ser executada em\nficheiros que contenham caracteres polivalentes (wildcards)" ;
+ Text [ portuguese_brazilian ] = "Die Operation kann nicht auf Dateien, welche\nWildcards enthalten, ausgeführt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨ÔÚº¬ÓÐͨÅä·ûµÄ\nÎļþÖÐÖ´ÐÐÕâ¸ö²Ù×÷";
+ Text[ russian ] = "Âûïîëíèòü îïåðàöèþ ñ ôàéëàìè, \nñîäåðæàùèìè ïîäñòàíîâî÷íûå çíàêè, íåâîçìîæíî";
+ Text[ polish ] = "Operacja nie mo¿e byæ wykonana na plikach, które \nzawieraj¹ symbole wieloznaczne (Wildcarts)";
+ Text[ japanese ] = "ܲÙÄÞ¶°ÄÞ‚ðŠÜ‚Þ̧²Ù‚Å\n‘€ì‚ÍŽÀs‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "³o¨ÇÀɮקt¦³³q°t²Å¡M\n¦ÓµLªk°õ¦æ¾Þ§@";
+ Text[ arabic ] = "áÇ íãßä ÊäÝíÐ åÐå ÇáÚãáíÉ Úáì ãáÝÇÊ\nÊÍÊæí Úáì ÃÍÑÝ ÈÏá.";
+ Text[ dutch ] = "Deze opdracht kan niet worden uitgevoerd bij bestanden \ndie wildcards bevatten";
+ Text[ chinese_simplified ] = "ÎÞ·¨ÔÚº¬ÓÐͨÅä·ûµÄ\nÎļþÖÐÖ´ÐÐÕâ¸ö²Ù×÷";
+ Text[ greek ] = "ÁõôÞ ç ëåéôïõñãßá äåí åßíáé äõíáôüí íá åöáñìïóôåß óå áñ÷åßá ôá ïðïßá \n ðåñéÝ÷ïõí ÷áñáêôÞñåò ìðáëáíôÝñ";
+ Text[ korean ] = "ÀÌ ÀÛµ¿Àº ¿ÍÀϵå Ä«µå¸¦ Æ÷ÇÔÇÏ´Â ÆÄÀÏ \n ¿¡¼­ µ¿ÀÛµÇÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Ýþlem, genel arama karakterleri\n içeren dosyalar üzerinde gerçekleþtirilemiyor";
+ };
+ String ERRCODE_IO_NOTSUPPORTED
+ {
+ Text = "Die Operation wird auf dem vorliegenden Betriebssystem nicht unterstützt" ;
+ Text [ ENGLISH ] = "This operation is not supported on this operating system" ;
+ Text [ english_us ] = "This operation is not supported on this operating system" ;
+ Text [ italian ] = "L'operazione non viene supportata sul sistema operativo presente" ;
+ Text [ spanish ] = "La operación no es apoyada por este sistema operativo." ;
+ Text [ french ] = "Cette opération n'est pas supportée sur ce système d'exploitation." ;
+ Text [ dutch ] = "Deze opdracht wordt niet ondersteund door het bestaande besturingssysteem" ;
+ Text [ swedish ] = "Operationen stöds inte av detta operativsystem" ;
+ Text [ danish ] = "Processen understøttes ikke af dette operativsystem" ;
+ Text [ portuguese ] = "A operação não tem suporte neste sistema operativo." ;
+ Text [ portuguese_brazilian ] = "Die Operation wird auf dem vorliegenden Betriebssystem nicht unterstützt" ;
+ Text[ chinese_simplified ] = "µ±Ç°µÄ²Ù×÷ƽ̨²»Ö§³ÖÕâ¸ö²Ù×÷";
+ Text[ russian ] = "Ýòà îïåðàöèÿ íå ïîääåðæèâàåòñÿ äàííîé îïåðàöèîííîé ñèñòåìîé";
+ Text[ polish ] = "Ta operacja nie jest obs³ugiwana w tym systemie operacyjnym.";
+ Text[ japanese ] = "‚±‚Ì‘€ì‚Í‚±‚̵ÍßÚ°¼®Ý ¼½ÃÑ‚Å‚ÍŽx‰‡‚³‚ê‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "·í«e¨Ï¥Îªº¾Þ§@¨t²Î¤£¤ä´©³o­Ó¾Þ§@";
+ Text[ arabic ] = "äÙÇã ÇáÊÔÛíá åÐÇ áÇ íÏÚã åÐå ÇáÚãáíÉ";
+ Text[ dutch ] = "Deze opdracht wordt niet ondersteund door het bestaande besturingssysteem";
+ Text[ chinese_simplified ] = "µ±Ç°µÄ²Ù×÷ƽ̨²»Ö§³ÖÕâ¸ö²Ù×÷";
+ Text[ greek ] = "Ç ëåéôïõñãßá áõôÞ äåí õðïóôçñßæåôáé óå áõôü ôï ëåéôïõñãéêü óýóôçìá";
+ Text[ korean ] = "ÀÌ ÀÛµ¿Àº ÀÌ ¿ÀÆÛ·¹ÀÌÆà ½Ã½ºÅÛ»ó¿¡¼­ Áö¿øµÇÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Bu iþlem, iþletim sistemi tarafýndan desteklenmiyor";
+ };
+ String ERRCODE_IO_TOOMANYOPENFILES
+ {
+ Text = "Es sind bereits zu viele Dateien geöffnet" ;
+ Text [ ENGLISH ] = "The are too many open files" ;
+ Text [ dutch ] = "Te veel bestanden geopend" ;
+ Text [ english_us ] = "There are too many files open" ;
+ Text [ italian ] = "Ci sono già troppi file aperti" ;
+ Text [ spanish ] = "Hay demasiados archivos abiertos." ;
+ Text [ french ] = "Trop de fichiers ouverts !" ;
+ Text [ swedish ] = "För många filer är redan öppnade" ;
+ Text [ danish ] = "Der er for mange åbne filer allerede" ;
+ Text [ portuguese ] = "Demasiados ficheiros abertos." ;
+ Text [ portuguese_brazilian ] = "Es sind bereits zu viele Dateien geöffnet" ;
+ Text[ chinese_simplified ] = "ÒѾ­´ò¿ªµÄÎļþÌ«¶à";
+ Text[ russian ] = "Îòêðûòî ñëèøêîì ìíîãî ôàéëîâ";
+ Text[ polish ] = "Jest otworzonych za du¿o plików";
+ Text[ japanese ] = "‚·‚Å‚Ȩ́²Ù‚ð‚½‚­‚³‚ñŠJ‚«‚·‚¬‚Ä‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "¥´¶}¤F¤Ó¦hÀÉ®×";
+ Text[ arabic ] = "ÚÏÏ ÇáãÓÊäÏÇÊ ÇáãÝÊæÍÉ ßÈíÑ ÌÏÇð";
+ Text[ dutch ] = "Te veel bestanden geopend";
+ Text[ chinese_simplified ] = "ÒѾ­´ò¿ªµÄÎļþÌ«¶à";
+ Text[ greek ] = "Åßíáé Þäç ðïëëÜ áñ÷åßá áíïé÷ôÜ";
+ Text[ korean ] = "³Ê¹« ¸¹Àº ÆÄÀÏÀÌ ¿­·ÁÀÖ½À´Ï´Ù.";
+ Text[ turkish ] = "Çok fazla dosya açýk";
+ };
+ String ERRCODE_IO_CANTREAD
+ {
+ Text = "Von der Datei konnte nicht gelesen werden" ;
+ Text [ ENGLISH ] = "The file could not be read" ;
+ Text [ dutch ] = "Bestand kon niet worden gelezen" ;
+ Text [ english_us ] = "Data could not be read from the file" ;
+ Text [ italian ] = "Non è stato possibile leggere dal file" ;
+ Text [ spanish ] = "No se pudo leer del archivo." ;
+ Text [ french ] = "Impossible de lire à partir de ce fichier" ;
+ Text [ swedish ] = "Det gick inte att läsa från filen" ;
+ Text [ danish ] = "Det var ikke muligt at læse filen" ;
+ Text [ portuguese ] = "Foi impossível ler o ficheiro." ;
+ Text [ portuguese_brazilian ] = "Von der Datei konnte nicht gelesen werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨¶ÁÈ¡Õâ¸öÎļþ";
+ Text[ russian ] = "Ïðî÷èòàòü ôàéë íåâîçìîæíî";
+ Text[ polish ] = "Ten plik nie mog³ zostaæ odczytany";
+ Text[ japanese ] = "̧²Ù‚©‚ç“Ç‚ÝŽæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªkŪ¨ú³o­ÓÀÉ®×";
+ Text[ arabic ] = "ÊÚÐÑÊ ÞÑÇÁÉ ÇáãáÝ";
+ Text[ dutch ] = "Bestand kon niet worden gelezen";
+ Text[ chinese_simplified ] = "ÎÞ·¨¶ÁÈ¡Õâ¸öÎļþ";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá ãßíåé áíÜãíùóç ôïõ áñ÷åßïõ";
+ Text[ korean ] = "µ¥ÀÌÅÍ°¡ ÆÄÀÏ·Î ºÎÅÍ ÀÐÇô Áú¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Dosyadan veri okunamadý";
+ };
+ String ERRCODE_IO_CANTWRITE
+ {
+ Text = "Die Datei konnte nicht geschrieben werden" ;
+ Text [ ENGLISH ] = "The file could not be written" ;
+ Text [ english_us ] = "The file could not be written" ;
+ Text [ italian ] = "Non è stato possibile scrivere il file" ;
+ Text [ spanish ] = "No se pudo guardar el archivo" ;
+ Text [ french ] = "Impossible d'écrire le fichier" ;
+ Text [ dutch ] = "Bestand kon niet worden opgeslagen" ;
+ Text [ swedish ] = "Filen kunde inte skrivas" ;
+ Text [ danish ] = "Det var ikke muligt at skrive filen" ;
+ Text [ portuguese ] = "Foi impossível escrever o ficheiro." ;
+ Text [ portuguese_brazilian ] = "Auf die Datei konnte nicht gespeicherwerden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Ð´ÈëÕâ¸öÎļþ";
+ Text[ russian ] = "Çàïèñü ôàéëà íå óäàåòñÿ";
+ Text[ polish ] = "Pliku nie mo¿na by³o zapisaæ";
+ Text[ japanese ] = "̧²Ù‚ð‘‚«ž‚Ý‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk¼g¤J³o­ÓÀÉ®×";
+ Text[ arabic ] = "ÊÚÐÑÊ ßÊÇÈÉ ÇáãáÝ";
+ Text[ dutch ] = "Bestand kon niet worden opgeslagen";
+ Text[ chinese_simplified ] = "ÎÞ·¨Ð´ÈëÕâ¸öÎļþ";
+ Text[ greek ] = "Äåí Þôáí äõíáôÞ ç åããñáöÞ ôïõ áñ÷åßïõ";
+ Text[ korean ] = "ÆÄÀÏÀÌ ¾µ¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Dosya yazýlamadý";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_IO_OUTOFMEMORY
+ {
+ Text = "Die Operation konnte wegen Speichermangels nicht ausgeführt werden" ;
+ Text [ ENGLISH ] = "The operation could no be completed because there is no memory left" ;
+ Text [ english_us ] = "The operation could not be run due to insufficient memory." ;
+ Text [ italian ] = "A causa di insufficienza di memoria non è stato possibile completare l'operazione" ;
+ Text [ spanish ] = "La operación no se pudo ejecutar por falta de memoria." ;
+ Text [ french ] = "Impossible d'exécuter cette action, mémoire insuffisante !" ;
+ Text [ dutch ] = "De opdracht kon niet worden uitgevoerd bij gebrek aan vrij geheugen." ;
+ Text [ swedish ] = "Operationen kunde inte utföras på grund av för lite minne." ;
+ Text [ danish ] = "Det var ikke muligt at udføre operationen, fordi der ikke er tilstrækkelig hukommelse" ;
+ Text [ portuguese ] = "Foi impossível executar a operação por não existir memória suficiente." ;
+ Text [ portuguese_brazilian ] = "Die Operation konnte wegen Speichermangels nicht ausgeführt werden" ;
+ Text[ chinese_simplified ] = "ÒòΪÄÚ´æ²»×ã¶øÎÞ·¨Ö´ÐÐÕâ¸ö²Ù×÷";
+ Text[ russian ] = "Èç-çà íåäîñòàòêà ïàìÿòè âûïîëíèòü îïåðàöèþ íåâîçìîæíî";
+ Text[ polish ] = "Operacja nie mog³a zostaæ wykonana z powodu braku pamiêci";
+ Text[ japanese ] = "‚±‚Ì‘€ì‚ÍÒÓØ•s‘«‚Ì‚½‚ߎÀs‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "¦]¬°°O¾ÐÅ餣¨¬¦ÓµLªk°õ¦æ³o­Ó¾Þ§@";
+ Text[ arabic ] = "ÊÚÐÑ ÊäÝíÐ ÇáÚãáíÉ¡ ÈÓÈÈ äÞÕ ÇáÐÇßÑÉ";
+ Text[ dutch ] = "De opdracht kon niet worden uitgevoerd bij gebrek aan vrij geheugen.";
+ Text[ chinese_simplified ] = "ÒòΪÄÚ´æ²»×ã¶øÎÞ·¨Ö´ÐÐÕâ¸ö²Ù×÷";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá åêôåëåóôåß ç ëåéôïõñãßá ëüãù Ýëëåéøçò ìíÞìçò";
+ Text[ korean ] = "¸Þ¸ð¸® ºÎÁ·À¸·Î ÀÎÇÏ¿© ÀÛµ¿ÀÌ ½ÇÇàµÉ ¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Ýþlem, bellek yetersizliði nedeniyle yürütülemedi";
+ };
+ String ERRCODE_IO_CANTSEEK
+ {
+ Text = "Die Seekoperation konnte nicht ausgeführt werden" ;
+ Text [ ENGLISH ] = "The seek operation could not be completed" ;
+ Text [ dutch ] = "De zoekopdracht kon niet worden uitgevoerd" ;
+ Text [ english_us ] = "The seek operation could not be run" ;
+ Text [ italian ] = "Non è statopossibile eseguire l'operazione di seek" ;
+ Text [ spanish ] = "No se pudo ejecutar la operación Seek." ;
+ Text [ french ] = "Impossible d'exécuter l'opération Seek" ;
+ Text [ swedish ] = "Seekoperationen kunde inte utföras" ;
+ Text [ danish ] = "Det var ikke muligt at udføre seek-operationen" ;
+ Text [ portuguese ] = "Foi impossível executar a operação de localização." ;
+ Text [ portuguese_brazilian ] = "Die Seekoperation konnte nicht ausgeführt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´ÐÐËÑÑ°²Ù×÷";
+ Text[ russian ] = "Âûïîëíèòü îïåðàöèþ seek íå óäàåòñÿ";
+ Text[ polish ] = "Nie mo¿na by³o wykonaæ operacji pliku (Seek)";
+ Text[ japanese ] = "Seek‘€ì‚ªŽÀs‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "µLªk°õ¦æ·j´M©R¥O";
+ Text[ arabic ] = "ÊÚÐÑ ÊäÝíÐ ÇáÚãáíÉ \"Seek\"";
+ Text[ dutch ] = "De zoekopdracht kon niet worden uitgevoerd";
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´ÐÐËÑÑ°²Ù×÷";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá åêôåëåóôåß ç ëåéôïõñãßá áíáæÞôçóçò";
+ Text[ korean ] = "ã±â ÀÛµ¿ÀÌ ½ÇÇàµÉ¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Arama iþlemi yürütülemedi";
+ };
+ String ERRCODE_IO_CANTTELL
+ {
+ Text = "Die Telloperation konnte nicht ausgeführt werden" ;
+ Text [ ENGLISH ] = "The tell operation could not be completed" ;
+ Text [ english_us ] = "The tell operation could not be run" ;
+ Text [ italian ] = "Non è stato possibile eseguire l'operazione tell" ;
+ Text [ spanish ] = "No se pudo ejecutar la operación Tell" ;
+ Text [ french ] = "Impossible d'exécuter l'opération Tell" ;
+ Text [ dutch ] = "De bestandsopdracht TELL kon niet worden uitgevoerd" ;
+ Text [ swedish ] = "Telloperationen kunde inte utföras" ;
+ Text [ danish ] = "Det var ikke muligt at udføre tell-operationen" ;
+ Text [ portuguese ] = "Foi impossível executar a operação Tell" ;
+ Text [ portuguese_brazilian ] = "Die Telloperation konnte nicht ausgeführt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´ÐÐ tell ÃüÁî";
+ Text[ russian ] = "Âûïîëíèòü îïåðàöèþ tell íåâîçìîæíî";
+ Text[ polish ] = "Nie mo¿na by³o wykonaæ operacji pliku (Tell)";
+ Text[ japanese ] = "Tell‘€ì‚ªŽÀs‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "µLªk°õ¦æ Tell ©R¥O";
+ Text[ arabic ] = "ÊÚÐÑ ÊäÝíÐ ÇáÚãáíÉ \"Tell\"";
+ Text[ dutch ] = "De bestandsopdracht TELL kon niet worden uitgevoerd";
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´ÐÐ tell ÃüÁî";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá åêôåëåóôåß ç ëåéôïõñãßá \"Tell\"";
+ Text[ korean ] = "Tell ÀÛ¾÷À» ½ÇÇàÇÏÁö ¸øÇßÀ½";
+ Text[ turkish ] = "Tell iþlemi yürütülemedi";
+ };
+ String ERRCODE_IO_WRONGVERSION
+ {
+ Text = "Die Datei liegt in einer falschen Version vor" ;
+ Text [ ENGLISH ] = "The file has a wrong version" ;
+ Text [ dutch ] = "Bestand heeft verkeerde versie" ;
+ Text [ english_us ] = "Incorrect file version" ;
+ Text [ italian ] = "Il file è presente in una versione errata" ;
+ Text [ spanish ] = "Versión incorrecta de archivo." ;
+ Text [ french ] = "Version de fichier incorrecte" ;
+ Text [ swedish ] = "Filen föreligger i en felaktig version" ;
+ Text [ danish ] = "Filen foreligger i en forkert version" ;
+ Text [ portuguese ] = "Versão incorrecta do ficheiro." ;
+ Text [ portuguese_brazilian ] = "Die Datei liegt in einer falschen Version vor" ;
+ Text[ chinese_simplified ] = "ÎļþµÄ°æ±¾ÎÞЧ";
+ Text[ russian ] = "Ôàéë ïðåäñòàâëåí â íåïðàâèëüíîé âåðñèè";
+ Text[ polish ] = "Wersja pliku jest nieprawid³owa";
+ Text[ japanese ] = "̧²Ù‚ÌÊÞ°¼Þ®Ý‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "Àɮת©¥»µL®Ä";
+ Text[ arabic ] = "ÅÕÏÇÑ ÇáãáÝ ÛíÑ ÕÍíÍ";
+ Text[ dutch ] = "Bestand heeft verkeerde versie";
+ Text[ chinese_simplified ] = "ÎļþµÄ°æ±¾ÎÞЧ";
+ Text[ greek ] = "ËÜèïò Ýêäïóç ôïõ áñ÷åßïõ";
+ Text[ korean ] = "À߸øµÈ ÆÄÀÏ ¹öÁ¯";
+ Text[ turkish ] = "Yanlýþ dosya sürümü";
+ };
+ String ERRCODE_IO_WRONGFORMAT
+ {
+ Text = "Die Datei liegt in einem falschen Format vor" ;
+ Text [ ENGLISH ] = "The file has a wrong format" ;
+ Text [ dutch ] = "Bestand heeft verkeerd formaat" ;
+ Text [ english_us ] = "Incorrect file format" ;
+ Text [ italian ] = "Il file ha un formato errato" ;
+ Text [ spanish ] = "Formato de archivo incorrecto" ;
+ Text [ french ] = "Format de fichier incorrect" ;
+ Text [ swedish ] = "Filen föreligger i ett felaktigt format" ;
+ Text [ danish ] = "Filen foreligger i et forkert format" ;
+ Text [ portuguese ] = "Formato de ficheiro incorrecto." ;
+ Text [ portuguese_brazilian ] = "Die Datei liegt in einem falschen Format vor" ;
+ Text[ chinese_simplified ] = "ÎļþµÄ¸ñʽ´íÎó";
+ Text[ russian ] = "Ôàéë ïðåäñòàâëåí â íåïðàâèëüíîì ôîðìàòå";
+ Text[ polish ] = "Format pliku jest nieprawid³owy";
+ Text[ japanese ] = "̧²Ù‘Ž®‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "Àɮ׮榡¿ù»~";
+ Text[ arabic ] = "ÊäÓíÞ ÇáãáÝ ÛíÑ ÕÍíÍ";
+ Text[ dutch ] = "Bestand heeft verkeerd formaat";
+ Text[ chinese_simplified ] = "ÎļþµÄ¸ñʽ´íÎó";
+ Text[ greek ] = "Ìç Ýãêõñç ìïñöÞ áñ÷åßïõ";
+ Text[ korean ] = "À߸øµÈ ÆÄÀÏ ¼­½Ä";
+ Text[ turkish ] = "Yanlýþ dosya sürümü";
+ };
+ String ERRCODE_IO_INVALIDCHAR
+ {
+ Text = "Der Dateiname enthält unzulässige Zeichen" ;
+ Text [ ENGLISH ] = "The filename contains invalid characters" ;
+ Text [ dutch ] = "De bestandsnaam bevat ongeoorloofde tekens" ;
+ Text [ english_us ] = "The file name contains invalid characters" ;
+ Text [ italian ] = "Il nome del file contiene caratteri non permessi" ;
+ Text [ spanish ] = "El nombre del archivo contiene caracteres inadmisibles." ;
+ Text [ french ] = "Le nom du fichier contient des caractères incorrectes" ;
+ Text [ swedish ] = "Filnamnet innehåller otillåtna tecken" ;
+ Text [ danish ] = "Filnavnet indeholder ugyldige tegn" ;
+ Text [ portuguese ] = "O nome do ficheiro contém caracteres incorrectos." ;
+ Text [ portuguese_brazilian ] = "Der Dateiname enthält unzulässige Zeichen" ;
+ Text[ chinese_simplified ] = "ÎļþÃûÖк¬ÓÐÎÞЧµÄ×Ö·û";
+ Text[ russian ] = "Èìÿ ôàéëà ñîäåðæèò íåäîïóñòèìûå ñèìâîëû";
+ Text[ polish ] = "Nazwa pliku zawiera nieprawid³owe znaki";
+ Text[ japanese ] = "̧²Ù–¼‚É•s“KØ‚È•¶Žš‚ªŠÜ‚Ü‚ê‚Ä‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "ÀɮצW§t¦³µL®Äªº¦r¤¸";
+ Text[ arabic ] = "íÍÊæí ÇÓã ÇáãáÝ Úáì ÃÍÑÝ ÛíÑ ãÓãæÍ ÈåÇ";
+ Text[ dutch ] = "De bestandsnaam bevat ongeoorloofde tekens";
+ Text[ chinese_simplified ] = "ÎļþÃûÖк¬ÓÐÎÞЧµÄ×Ö·û";
+ Text[ greek ] = "Ôï üíïìá ôïõ áñ÷åßïõ ðåñéÝ÷åé ìç Ýãêõñïõò ÷áñáêôÞñåò";
+ Text[ korean ] = "ÆÄÀÏÀ̸§¿¡ À¯È¿ÇÏÁö ¾ÊÀº ¹®ÀÚ°¡ Æ÷ÇԵǾî ÀÖ½À´Ï´Ù.";
+ Text[ turkish ] = "Dosya adý geçersiz karakterler içeriyor";
+ };
+ String ERRCODE_IO_UNKNOWN
+ {
+ Text = "Es trat ein unbekannter Ein-/Ausgabefehler auf" ;
+ Text [ ENGLISH ] = "The Operation failed due an unknown I/O Error" ;
+ Text [ english_us ] = "An unknown I/O error has occurred" ;
+ Text [ italian ] = "Si è verificato un errore di I/O sconosciuto" ;
+ Text [ spanish ] = "Ha ocurrido un error desconocido de entrada/salida." ;
+ Text [ french ] = "Erreur d'entrée/sortie inconnue" ;
+ Text [ dutch ] = "Onbekende I/O fout" ;
+ Text [ swedish ] = "Ett okänt input-/outputfel uppstod" ;
+ Text [ danish ] = "Der opstod en ukendt input-/outputfejl" ;
+ Text [ portuguese ] = "Surgiu um erro de entrada/saída desconhecido." ;
+ Text [ portuguese_brazilian ] = "Es trat ein unbekannter Ein-/Ausgabefehler auf" ;
+ Text[ chinese_simplified ] = "³öÏÖÒ»¸ö²»Ã÷µÄÊäÈë/Êä³ö´íÎó";
+ Text[ russian ] = "Ïðîèçîøëà íåèçâåñòíàÿ îøèáêà ââîäà-âûâîäà";
+ Text[ polish ] = "Wyst¹pi³ nieznany b³¹d wejœcia/wyjœcia";
+ Text[ japanese ] = "•s–¾‚ÈI/O ´×°‚ª”­¶";
+ Text[ chinese_traditional ] = "¥X²{¤@­Ó¤£©úªº¿é¤J/¿é¥X¿ù»~";
+ Text[ arabic ] = "ÍÏË ÎØà ÅÏÎÇá/ÅÎÑÇÌ ÛíÑ ãÚÑæÝ";
+ Text[ dutch ] = "Onbekende I/O fout";
+ Text[ chinese_simplified ] = "³öÏÖÒ»¸ö²»Ã÷µÄÊäÈë/Êä³ö´íÎó";
+ Text[ greek ] = "ÐáñïõóéÜóôçêå Üãíùóôï óöÜëìá åéóáãùãÞò/åîáãùãÞò";
+ Text[ korean ] = "¾Ë¼ö¾ø´Â ÀÔ/Ãâ·Â ¿À·ù ¹ß»ý";
+ Text[ turkish ] = "Bilinmeyen bir girdi/çýktý hatasý oluþtu";
+ };
+ String ERRCODE_IO_INVALIDACCESS
+ {
+ Text = "Es wurde versucht, in ungültiger Weise auf die Datei zuzugreifen" ;
+ Text [ ENGLISH ] = "The file accessed invalidly" ;
+ Text [ dutch ] = "Ongeldige poging tot openen van bestand" ;
+ Text [ english_us ] = "An invalid attempt was made to access the file" ;
+ Text [ italian ] = "Si è tentato di accedere al file in modo non valido" ;
+ Text [ spanish ] = "Se ha tratado de acceder al archivo de manera no válida." ;
+ Text [ french ] = "La manière dont vous avez essayé d'accéder au fichier est incorrecte" ;
+ Text [ swedish ] = "Ogiltigt försök att få åtkomst till filen" ;
+ Text [ danish ] = "Ugyldigt forsøg på at få adgang til filen" ;
+ Text [ portuguese ] = "Tentativa incorrecta de acesso ao ficheiro." ;
+ Text [ portuguese_brazilian ] = "Es wurde versucht, in ungültiger Weise auf die Datei zuzugreifen" ;
+ Text[ chinese_simplified ] = "¶ÁÈ¡ÎļþµÄ·½Ê½ÎÞЧ";
+ Text[ russian ] = "Áûëà ñîâåðøåíà ïîïûòêà íåçàêîííûì ïóòåì ïîëó÷èòü äîñòóï ê ôàéëó";
+ Text[ polish ] = "Nast¹pi³a próba uzyskania nieprawid³owego dostêpu do pliku";
+ Text[ japanese ] = "–³Œø‚È‚â‚è•û‚Å‚Ì̧²Ù‚ւ̱¸¾½‚ªŽŽ‚Ý‚ç‚ê‚Ü‚µ‚½";
+ Text[ chinese_traditional ] = "Ū¨úÀɮתº¤è¦¡µL®Ä";
+ Text[ arabic ] = "ÊãÊ ãÍÇæáÉ ÇáæÕæá Åáì ÇáãáÝ ÈÔßá ÛíÑ ÕÍíÍ";
+ Text[ dutch ] = "Ongeldige poging tot openen van bestand";
+ Text[ chinese_simplified ] = "¶ÁÈ¡ÎļþµÄ·½Ê½ÎÞЧ";
+ Text[ greek ] = "¸ãéíå ìç Ýãêõñç ðñïóðÜèåéá ðñüóâáóçò óôï áñ÷åßï";
+ Text[ korean ] = "À¯È¿ÇÏÁö ¾ÊÀº ÆÄÀÏ Á¢±Ù ½Ãµµ°¡ ÀÖ¾ú½À´Ï´Ù.";
+ Text[ turkish ] = "Dosyaya yetkisiz eriþim denendi";
+ };
+ String ERRCODE_IO_CANTCREATE
+ {
+ Text = "Die Datei konnte nicht angelegt werden" ;
+ Text [ ENGLISH ] = "The file could not be created" ;
+ Text [ dutch ] = "Bestand kon niet worden gemaakt" ;
+ Text [ english_us ] = "The file could not be created" ;
+ Text [ italian ] = "Non è stato possibile creare il file" ;
+ Text [ spanish ] = "No se pudo crear el archivo." ;
+ Text [ french ] = "Impossible de créer le fichier" ;
+ Text [ swedish ] = "Filen kunde inte skapas" ;
+ Text [ danish ] = "Det var ikke muligt at oprette filen" ;
+ Text [ portuguese ] = "Foi impossível criar o ficheiro." ;
+ Text [ portuguese_brazilian ] = "Die Datei konnte nicht angelegt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨½¨Á¢Õâ¸öÎļþ";
+ Text[ russian ] = "Ñîçäàòü ôàéë íåâîçìîæíî";
+ Text[ polish ] = "Plik nie móg³ zostaæ utworzony";
+ Text[ japanese ] = "̧²Ù‚ÍŠi”[‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk«Ø¥ß³o­ÓÀÉ®×";
+ Text[ arabic ] = "ÊÚÐÑ ÅäÔÇÁ ÇáãáÝ";
+ Text[ dutch ] = "Bestand kon niet worden gemaakt";
+ Text[ chinese_simplified ] = "ÎÞ·¨½¨Á¢Õâ¸öÎļþ";
+ Text[ greek ] = "Ôï áñ÷åßï äåí Þôáí äõíáôüí íá äçìéïõñãçèåß";
+ Text[ korean ] = "ÆÄÀÏÀÌ ¸¸µé¾î Áú¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Dosya oluþturulamadý";
+ };
+ String ERRCODE_IO_INVALIDPARAMETER
+ {
+ Text = "Die Operation wurde mit einem ungültigen Parameter gestartet" ;
+ Text [ ENGLISH ] = "An invalid parameter was passed" ;
+ Text [ english_us ] = "The operation was started under an invalid parameter" ;
+ Text [ italian ] = "L'operazione è stata avviata con un parametro non valido" ;
+ Text [ spanish ] = "La operación se inició con un parámetro no válido." ;
+ Text [ french ] = "L'action a été lancée à l'aide d'un paramètre incorrect" ;
+ Text [ dutch ] = "Activiteit uitgevoerd met ongeldige parameter." ;
+ Text [ swedish ] = "Operationen startades med en ogiltig parameter" ;
+ Text [ danish ] = "Processen blev startet med en ugyldig parameter" ;
+ Text [ portuguese ] = "A operação foi iniciada com um parâmetro incorrecto." ;
+ Text [ portuguese_brazilian ] = "Die Operation wurde mit einem ungültigen Parameter gestartet" ;
+ Text[ chinese_simplified ] = "ʹÓÃÒ»¸öÎÞЧµÄ²ÎÊýÆô¶¯ÁËÕâ¸ö²Ù×÷";
+ Text[ russian ] = "Îïåðàöèÿ çàïóùåíà ïðè ïîìîùè íåïðàâèëüíîãî ïàðàìåòðà";
+ Text[ polish ] = "Przy rozpoczêciu operacji u¿yto nieprawid³owego parametru";
+ Text[ japanese ] = "‚±‚Ì‘€ì‚Í–³Œø‚ÈÊß×Ò°À‚ÅŠJŽn‚µ‚Ü‚µ‚½";
+ Text[ chinese_traditional ] = "¨Ï¥Î¤@­ÓµL®Äªº§UÅܶq±Ò°Ê³o­Ó¾Þ§@";
+ Text[ arabic ] = "Êã ÈÏÁ ÇáÚãáíÉ ÈãÚáãÉ ÛíÑ ÕÇáÍÉ";
+ Text[ dutch ] = "Activiteit uitgevoerd met ongeldige parameter.";
+ Text[ chinese_simplified ] = "ʹÓÃÒ»¸öÎÞЧµÄ²ÎÊýÆô¶¯ÁËÕâ¸ö²Ù×÷";
+ Text[ greek ] = "Ç ëåéôïõñãßá åêêßíçóå ìå ìç Ýãêõñç ðáñÜìåôñï";
+ Text[ korean ] = "À¯È¿ÇÏÁö ¾ÊÀº ÆĶó¹ÌÅÍ ÇÏ¿¡¼­ ÀÛµ¿ÀÌ ½ÃÀ۵Ǿú½À´Ï´Ù.";
+ Text[ turkish ] = "Ýþlem geçersiz bir parametre ile baþlatýldý.";
+ };
+ String ERRCODE_IO_ABORT
+ {
+ Text = "Die Operation auf der Datei wurde abgebrochen" ;
+ Text [ ENGLISH ] = "The operation on the file was aborted" ;
+ Text [ dutch ] = "Activiteit werd gestopt" ;
+ Text [ english_us ] = "The operation on the file was aborted" ;
+ Text [ italian ] = "L'operazione sul file è stata interrotta" ;
+ Text [ spanish ] = "Se ha interrumpido la operación en el archivo." ;
+ Text [ french ] = "L'action tentée sur le fichier a été interrompue" ;
+ Text [ swedish ] = "Operationen på filen avbröts" ;
+ Text [ danish ] = "Processen på filen blev afbrudt" ;
+ Text [ portuguese ] = "Cancelada a operação no ficheiro." ;
+ Text [ portuguese_brazilian ] = "Die Operation auf der Datei wurde abgebrochen" ;
+ Text[ chinese_simplified ] = "Õâ¸öÎļþµÄ²Ù×÷ÒѾ­ÖжÏ";
+ Text[ russian ] = "Îïåðàöèÿ ñ ôàéëîì ïðåðâàíà";
+ Text[ polish ] = "Operacja na pliku zosta³a przerwana";
+ Text[ japanese ] = "̧²Ùã‚Ì‘€ì‚Í’†Ž~‚³‚ê‚Ü‚µ‚½";
+ Text[ chinese_traditional ] = "³o­ÓÀɮתº¾Þ§@¤w¸g¤¤Â_";
+ Text[ arabic ] = "Êã ÞØÚ ÇáÚãáíÉ Ýí ÇáãáÝ";
+ Text[ dutch ] = "Activiteit werd gestopt";
+ Text[ chinese_simplified ] = "Õâ¸öÎļþµÄ²Ù×÷ÒѾ­ÖжÏ";
+ Text[ greek ] = "ÄéáêïðÞ ôçò ëåéôïõñãßáò ðÜíù óôï áñ÷åßï";
+ Text[ korean ] = "ÆÄÀÏ »ó¿¡¼­ ÀÛµ¿ÀÌ ÁßÁö µÇ¾ú½À´Ï´Ù.";
+ Text[ turkish ] = "Dosya ile ilgili iþlem iptal edildi";
+ };
+ String ERRCODE_IO_NOTEXISTSPATH
+ {
+ Text = "Der Pfad zu der Datei existiert nicht" ;
+ Text [ ENGLISH ] = "Path to file not found" ;
+ Text [ english_us ] = "Path to the file does not exist" ;
+ Text [ italian ] = "Il percorso del file non esiste" ;
+ Text [ spanish ] = "No existe la ruta de acceso al archivo." ;
+ Text [ french ] = "Le chemin uindiqué pour le fichier n'existe pas" ;
+ Text [ dutch ] = "Pad naar bestand niet gevonden" ;
+ Text [ swedish ] = "Sökvägen till filen existerar inte" ;
+ Text [ danish ] = "Stien til filen eksisterer ikke" ;
+ Text [ portuguese ] = "O atalho para o ficheiro não existe." ;
+ Text [ portuguese_brazilian ] = "Der Pfad zu der Datei existiert nicht" ;
+ Text[ chinese_simplified ] = "Ö¸ÏòÎļþµÄ·¾¶²»´æÔÚ";
+ Text[ russian ] = "Ïóòü ê ôàéëó íå ñóùåñòâóåò";
+ Text[ polish ] = "Œcie¿ka do pliku nie istnieje";
+ Text[ japanese ] = "̧²Ù‚Ö‚ÌÊß½‚Í‚ ‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "«ü¦VÀɮתº¸ô®|¤£¦s¦b";
+ Text[ arabic ] = "ÇáãÓÇÑ ÇáãÄÏí Åáì ÇáãáÝ ÛíÑ ãæÌæÏ";
+ Text[ dutch ] = "Pad naar bestand niet gevonden";
+ Text[ chinese_simplified ] = "Ö¸ÏòÎļþµÄ·¾¶²»´æÔÚ";
+ Text[ greek ] = "Ç äéáäñïìÞ ðñïò ôï áñ÷åßï äåí õðÜñ÷åé";
+ Text[ korean ] = "ÆÄÀÏ¿¡´ëÇÑ °æ·Î°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Dosya veri yolu mevcut deðil";
+ };
+ String ERRCODE_IO_RECURSIVE
+ {
+ Text = "Ein Objekt kann nicht in sich selbst kopiert werden." ;
+ Text [ ENGLISH ] = "Cannot copy object into itself." ;
+ Text [ portuguese ] = "É impossível copiar um objecto em si próprio." ;
+ Text [ english_us ] = "An object cannot be copied into itself." ;
+ Text [ portuguese_brazilian ] = "Ein Objekt kann nicht in sich selbt kopiert werden." ;
+ Text [ swedish ] = "Ett objekt kan inte kopieras till sig självt." ;
+ Text [ danish ] = "Det er ikke muligt at kopiere et objekt over i sig selv." ;
+ Text [ italian ] = "Un oggetto non può essere copiato su se stesso." ;
+ Text [ spanish ] = "No es posible copiar un objeto en sí mismo." ;
+ Text [ french ] = "Copie impossible : la cible est identique à la source." ;
+ Text [ dutch ] = "Een object kan niet worden gekopieerd naar zichzelf." ;
+ Text[ chinese_simplified ] = "¶ÔÏóÎÞ·¨±»¸´ÖƵ½×ÔÉíÄÚ¡£";
+ Text[ russian ] = "Ñêîïèðîâàòü îáúåêò ñàì â ñåáÿ íåâîçìîæíî.";
+ Text[ polish ] = "Obiekt nie mo¿e zostaæ skopiowany sam w sobie.";
+ Text[ japanese ] = "µÌÞ¼Þª¸Ä‚Í‚»‚Ì‚à‚ÌŽ©‘̂ɺËß°‚Å‚«‚Ü‚¹‚ñB";
+ Text[ chinese_traditional ] = "ª«¥óµLªk³Q½Æ»s¨ì¦Û¨­¡C";
+ Text[ arabic ] = "áÇ íãßä äÓÎ ßÇÆä Åáì äÝÓå.";
+ Text[ dutch ] = "Een object kan niet worden gekopieerd naar zichzelf.";
+ Text[ chinese_simplified ] = "¶ÔÏóÎÞ·¨±»¸´ÖƵ½×ÔÉíÄÚ¡£";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá áíôéãñáöåß Ýíá áíôéêåßìåíï óôïí åáõôü ôïõ.";
+ Text[ korean ] = "°³Ã¼¸¦ ±× ÀÚü¿¡ º¹»çÇÒ ¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Nesne kendi içine kopyalanamaz.";
+ };
+ String ERRCODE_SFX_NOSTDTEMPLATE
+ {
+ Text = "Die Standardvorlage konnte nicht geöffnet werden" ;
+ Text [ ENGLISH ] = "The standard template could not be found" ;
+ Text [ dutch ] = "Standaardsjabloon kon niet worden geopend" ;
+ Text [ english_us ] = "The default template could not be opened" ;
+ Text [ italian ] = "Non è stato possibile aprire il modello standard" ;
+ Text [ spanish ] = "No se pudo abrir la plantilla estándar." ;
+ Text [ french ] = "Impossible d'ouvrir le modèle par défaut" ;
+ Text [ swedish ] = "Standardmallen kunde inte öppnas" ;
+ Text [ danish ] = "Det var ikke muligt at åbne standardskabelonen" ;
+ Text [ portuguese ] = "Foi impossível abrir o modelo padrão." ;
+ Text [ portuguese_brazilian ] = "Die Standardvorlage konnte nicht geöffnet werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨´ò¿ª±ê×¼Ñùʽ";
+ Text[ russian ] = "Íå óäàåòñÿ îòêðûòü ñòàíäàðòíûé øàáëîí";
+ Text[ polish ] = "Nie mo¿na otworzyæ standardowego szablonu";
+ Text[ japanese ] = "•W€½À²Ù‚ÍŠJ‚­‚±‚Æ‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk¶}±Ò¼Ð·Ç¼Ë¦¡";
+ Text[ arabic ] = "ÊÚÐÑ ÝÊÍ ÇáÞÇáÈ ÇáÇÝÊÑÇÖí";
+ Text[ dutch ] = "Standaardsjabloon kon niet worden geopend";
+ Text[ chinese_simplified ] = "ÎÞ·¨´ò¿ª±ê×¼Ñùʽ";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá áíïé÷ôåß ôï ðñüôõðï ðñïåðéëïãÞò.";
+ Text[ korean ] = "±âº» ÅÛÇø®Æ®°¡ ¿­¸®Áö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Standart þablon açýlamadý";
+ };
+ String ERRCODE_SFX_TEMPLATENOTFOUND
+ {
+ Text = "Die angegebene Vorlage wurde nicht gefunden" ;
+ Text [ ENGLISH ] = "The template cannot be found" ;
+ Text [ dutch ] = "Aangegeven sjabloon niet te vinden" ;
+ Text [ english_us ] = "The specified template could not be found" ;
+ Text [ italian ] = "Il modello dato non è stato trovato" ;
+ Text [ spanish ] = "No se encontró la plantilla especificada" ;
+ Text [ french ] = "Le modèle indiqué est introuvable." ;
+ Text [ swedish ] = "Den angivna mallen kunde inte hittas" ;
+ Text [ danish ] = "Den angivne skabelon blev ikke fundet" ;
+ Text [ portuguese ] = "Foi impossível encontrar o modelo indicado." ;
+ Text [ portuguese_brazilian ] = "Die angegebene Vorlage wurde nicht gefunden" ;
+ Text[ chinese_simplified ] = "ûÓÐÕÒµ½Ö¸¶¨µÄÑùʽ";
+ Text[ russian ] = "Çàäàííûé øàáëîí íå íàéäåí";
+ Text[ polish ] = "Podanego szablonu nie znaleziono";
+ Text[ japanese ] = "Žw’肵‚½ÃÝÌßÚ°Ä‚ÍŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "¨S¦³§ä¨ì«ü©wªº¼Ë¦¡";
+ Text[ arabic ] = "ÊÚÐÑ ÇáÚËæÑ Úáì ÇáÞÇáÈ ÇáãõÚØì";
+ Text[ dutch ] = "Aangegeven sjabloon niet te vinden";
+ Text[ chinese_simplified ] = "ûÓÐÕÒµ½Ö¸¶¨µÄÑùʽ";
+ Text[ greek ] = "Äåí âñÝèçêå ôï åðéëåãìÝíï ðñüôõðï";
+ Text[ korean ] = "ÁöÁ¤µÈ ÅÛÇø®Æ®°¡ ¹ß°ßµÇÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Belirtilen þablon bulunamadý";
+ };
+ String ERRCODE_SFX_NOTATEMPLATE
+ {
+ Text = "Die Datei kann nicht als Vorlage verwendet werden" ;
+ Text [ ENGLISH ] = "The file cannot be used as template" ;
+ Text [ dutch ] = "Bestand kan niet worden gebruikt als sjabloon" ;
+ Text [ english_us ] = "The file cannot be used as template" ;
+ Text [ italian ] = "Il file non è utilizzabile come modello" ;
+ Text [ spanish ] = "No se puede usar el archivo como plantilla" ;
+ Text [ french ] = "Impossible d'utiliser ce fichier comme modèle" ;
+ Text [ swedish ] = "Filen kan inte användas som mall" ;
+ Text [ danish ] = "Det er ikke muligt at bruge filen som skabelon" ;
+ Text [ portuguese ] = "Impossível utilizar o ficheiro como modelo." ;
+ Text [ portuguese_brazilian ] = "Die Datei kann nicht als Vorlage verwendet werden" ;
+ Text[ chinese_simplified ] = "Õâ¸öÎļþÎÞ·¨µ±×÷ÑùʽʹÓÃ";
+ Text[ russian ] = "Èñïîëüçîâàòü ôàéë â êà÷åñòâå øàáëîíà íåâîçìîæíî";
+ Text[ polish ] = "Pliku nie mo¿na u¿yæ jako szablonu";
+ Text[ japanese ] = "‚±‚Ì̧²Ù‚ÍÃÝÌßÚ°Ä‚Æ‚µ‚ÄŽg—p‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "³o­ÓÀÉ®×µLªk³Q·í§@¼Ë¦¡¨Ï¥Î";
+ Text[ arabic ] = "áÇ íãßä ÇÓÊÎÏÇã ÇáãáÝ ßÞÇáÈ";
+ Text[ dutch ] = "Bestand kan niet worden gebruikt als sjabloon";
+ Text[ chinese_simplified ] = "Õâ¸öÎļþÎÞ·¨µ±×÷ÑùʽʹÓÃ";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá ÷ñçóéìïðïéçèåß ôï áñ÷åßï ùò ðñüôõðï";
+ Text[ korean ] = "ÆÄÀÏÀÌ ÅÛÇø®Æ®·Î »ç¿ëµÉ¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Dosya, þablon olarak kullanýlamýyor";
+ };
+ String ERRCODE_SFX_CANTREADDOCINFO
+ {
+ Text = "Die Dokumentinformation konnte nicht aus der Datei\ngelesen werden, da das Dokumentinformationsformat\nunbekannt ist oder da keine Dokumentinformation vorhanden\nist" ;
+ Text [ ENGLISH ] = "The document info could not be read because\nthe document does not contain document info\nor because the document info ist not known" ;
+ Text [ dutch ] = "Lezen van documentinfo niet mogelijk.\nDocumentformaat onbekend of geen documentinfo\nvoorhanden" ;
+ Text [ english_us ] = "Document information could not be read from the file because\nthe document information format is unknown or because document information does not\nexist" ;
+ Text [ italian ] = "Non è stato possibile leggere l'informazione sul documento dal file\npoiché il formato del file è sconosciuto o perché non c'è un'informazione sul\ndocumento" ;
+ Text [ spanish ] = "La información del documento no se pudo leer del\narchivo ya que su formato es desconocido o no\nexiste ninguna información acerca del documento." ;
+ Text [ french ] = "Impossible de lire les informations sur le document à partir du fichier :\nsoit le format du fichier d'information est inconnu,\nsoit il n'existe pas d'informations de ce type\n" ;
+ Text [ swedish ] = "Dokumentinformationen kunde inte läsas från\nfilen eftersom dokumentinformationsformatet är\nobekant eller ingen dokumentinformation existerar" ;
+ Text [ danish ] = "Det var ikke muligt at læse dokumentinformationen\nfra filen, fordi dokumentinformationens format er ukendt\neller der ikke er nogen tilgængelig dokumentinformation." ;
+ Text [ portuguese ] = "Impossível ler as informações sobre o documento no ficheiro\n por terem um formato desconhecido ou \npor não existirem." ;
+ Text [ portuguese_brazilian ] = "Die Dokumentinformation konnte nicht aus der Datei\ngelesen werden, da das Dokumentinformationsformat\nunbekannt ist oder da keine Dokumentinformation vorhanden\nist" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨¶Á³öÕâ¸öÎļþµÄÎĵµÐÅÏ¢£¬\nÒòΪÕâ¸öÎĵµÐÅÏ¢µÄ¸ñʽ²»Ã÷»òÎĵµÐÅÏ¢²»´æÔÚ\n";
+ Text[ russian ] = "Ïðî÷èòàòü èíôîðìàöèþ äîêóìåíòà èç ôàéëà\níåâîçìîæíî, ò.ê. ôîðìàò äîêóìåíòà\níåèçâåñòåí èëè èíôîðìàöèè î äîêóìåíòå\níå èìååòñÿ";
+ Text[ polish ] = "Informacji o dokumencie nie mo¿na by³o odczytaæ z pliku\n, poniewa¿ format informacji o dokumencie \njest nieznany lub nie istniej¹ informacje o dokumencie\n.";
+ Text[ japanese ] = "ÄÞ·­ÒÝÄî•ñ‚Ì‘Ž®‚ª•s–¾‚©\nÄÞ·­ÒÝÄî•ñ‚ª‚È‚¢‚©‚Å\ņ²Ù‚©‚çÄÞ·­ÒÝÄî•ñ‚Í“Ç‚ÝŽæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªkŪ¥X³o­ÓÀɮתº¤å¥ó¸ê°T¡M\n¦]¬°³o­Ó¤å¥ó¸ê°T¤£©ú©Î¤å¥ó¸ê°T¤£¦s¦b\n";
+ Text[ arabic ] = "ÊÚÐÑ ÞÑÇÁÉ ãÚáæãÇÊ ÇáãÓÊäÏ ãä ÇáãáÝ¡\náÃä ÊäÓíÞ ãÚáæãÇÊ ÇáãÓÊäÏ\nÛíÑ ãÚÑæÝ¡ Ãæ áÃä ãÚáæãÇÊ ÇáãÓÊäÏ \nÛíÑ ãæÌæÏÉ";
+ Text[ dutch ] = "Lezen van documentinfo niet mogelijk.\nDocumentformaat onbekend of geen documentinfo\nvoorhanden";
+ Text[ chinese_simplified ] = "ÎÞ·¨¶Á³öÕâ¸öÎļþµÄÎĵµÐÅÏ¢£¬\nÒòΪÕâ¸öÎĵµÐÅÏ¢µÄ¸ñʽ²»Ã÷»òÎĵµÐÅÏ¢²»´æÔÚ\n";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá ãßíåé áíÜãíùóç ôùí ðëçñïöïñéþí ôïõ åããñÜöïõ áðü ôï áñ÷åßï\nåßôå åðåéäÞ åßíáé Üãíùóôç ç ìïñöÞ ôïõ åããñÜöïõ ðëçñïöïñéþí\n Þ åðåéäÞ äåí õðÜñ÷ïõí ðëçñïöïñßåò ãéá ôï Ýããñáöï.";
+ Text[ korean ] = "¾Ë¼ö ¾ø´Â ¹®¼­ ¼­½ÄÀ̰ųª \n¹®¼­ Á¤º¸°¡ Á¸ÀçÇÏÁö ¾Ê±â ¶§¹®¿¡ ÆÄÀÏ·Î ºÎÅÍ ¹®¼­ÀÇ Á¤º¸¸¦\nÀÐÀ»¼ö ¾ø½À´Ï´Ù.";
+ Text[ turkish ] = "Belge bilgileri formatý, bilinmediði ya da belge\nbilgisi mevcut olmadýðý için\ndosyadan okunamadý\n";
+ };
+ String ERRCODE_SFX_ALREADYOPEN
+ {
+ Text = "Das Dokument ist bereits zur Bearbeitung geöffnet" ;
+ Text [ English ] = "This document is already opened" ;
+ Text [ dutch ] = "Document reeds geopend" ;
+ Text [ english_us ] = "This document has already been opened for editing" ;
+ Text [ italian ] = "Il documento è già aperto per la modifica" ;
+ Text [ spanish ] = "El documento ya se ha abierto para editarlo." ;
+ Text [ french ] = "Le document est déjà ouvert pour l'édition" ;
+ Text [ swedish ] = "Dokumentet har redan öppnats för redigering" ;
+ Text [ danish ] = "Dokumentet er allerede åbnet til redigering" ;
+ Text [ portuguese ] = "O documento já se encontra aberto para edição." ;
+ Text [ portuguese_brazilian ] = "Das Dokument ist bereits zur Bearbeitung geöffnet" ;
+ Text[ chinese_simplified ] = "Õâ¸öÎĵµÒѾ­´¦Óڱ༭״̬";
+ Text[ russian ] = "Ýòîò äîêóìåíò óæå îòêðûò äëÿ ðåäàêòèðîâàíèÿ";
+ Text[ polish ] = "Dokument jest otwarty do edycji";
+ Text[ japanese ] = "ÄÞ·­ÒÝÄ‚Í‚·‚Å‚É•ÒW—p‚ÉŠJ‚©‚ê‚Ä‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "³o­Ó¤å¥ó¤w¸g³B¤_½s¿èª¬ºA";
+ Text[ arabic ] = "ÇáãÓÊäÏ ãÝÊæÍ ÈÔßá ãÓÈÞ ááÊÍÑíÑ.";
+ Text[ dutch ] = "Document reeds geopend";
+ Text[ chinese_simplified ] = "Õâ¸öÎĵµÒѾ­´¦Óڱ༭״̬";
+ Text[ greek ] = "Ôï Ýããñáöï åßíáé Þäç áíïé÷ôü ãéá åðåîåñãáóßá";
+ Text[ korean ] = "¹®¼­´Â ÀÌ¹Ì ¿­·ÁÀÖ½À´Ï´Ù.";
+ Text[ turkish ] = "Belge zaten düzenlenmek üzere açýldý";
+ };
+ String ERRCODE_SFX_WRONGPASSWORD
+ {
+ Text = "Es wurde ein falsches Passwort gesetzt" ;
+ Text [ English ] = "A wrong password was specified" ;
+ Text [ dutch ] = "Foutief wachtwoord" ;
+ Text [ english_us ] = "The wrong password has been entered" ;
+ Text [ italian ] = "È stata impostata una password errata" ;
+ Text [ spanish ] = "Se empleó una contraseña falsa" ;
+ Text [ french ] = "Le mot de passe spécifié est incorrect" ;
+ Text [ swedish ] = "Ett felaktigt lösenord har definierats" ;
+ Text [ danish ] = "Der blev angivet en forkert adgangskode" ;
+ Text [ portuguese ] = "A senha especificada está errada." ;
+ Text [ portuguese_brazilian ] = "Es wurde ein falsches Passwort gesetzt" ;
+ Text[ chinese_simplified ] = "ÊäÈëÁËÒ»¸ö´íÎóµÄ¿ÚÁî";
+ Text[ russian ] = "Ââåäåí íåïðàâèëüíûé ïàðîëü";
+ Text[ polish ] = "Zosta³o u¿yte nieprawid³owe has³o";
+ Text[ japanese ] = "³‚µ‚­‚È‚¢Ê߽ܰÄÞ‚ª“ü—Í‚³‚ê‚Ü‚µ‚½";
+ Text[ chinese_traditional ] = "¿é¤J¤F¤@­Ó¿ù»~ªº±K½X";
+ Text[ arabic ] = "Êã ÊÚííä ßáãÉ ÓÑ ÛíÑ ÕÍíÍÉ";
+ Text[ dutch ] = "Foutief wachtwoord";
+ Text[ chinese_simplified ] = "ÊäÈëÁËÒ»¸ö´íÎóµÄ¿ÚÁî";
+ Text[ greek ] = "Ïñßóôçêå åóöáëìÝíïò êùäéêüò ðñüóâáóçò";
+ Text[ korean ] = "À߸øµÈ Æнº¿öµå°¡ ÀԷµǾú½À´Ï´Ù.";
+ Text[ turkish ] = "Girilen þifre yanlýþ";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_SFX_DOCUMENTREADONLY
+ {
+ Text = "Das Dokument wurde zum Lesen geöffnet" ;
+ Text [ English ] = "The document was opened readonly" ;
+ Text [ dutch ] = "Document geopend als alleen lezen" ;
+ Text [ english_us ] = "The document was opened as read-only" ;
+ Text [ italian ] = "Il documento è stato aperto per la lettura" ;
+ Text [ spanish ] = "Se ha abierto el documento para lectura." ;
+ Text [ french ] = "Le document a été ouvert en mode de lecture seule" ;
+ Text [ swedish ] = "Dokumentet öppnades för läsning" ;
+ Text [ danish ] = "Dokumentet er blevet åbnet til læsning" ;
+ Text [ portuguese ] = "O documento foi aberto para leitura." ;
+ Text [ portuguese_brazilian ] = "Das Dokument wurde zum Lesen geöffnet" ;
+ Text[ chinese_simplified ] = "Õâ¸ö´ò¿ªµÄÎĵµÊÇ·À¸²Ð´µÄ";
+ Text[ russian ] = "Äîêóìåíò îòêðûò äëÿ ÷òåíèÿ";
+ Text[ polish ] = "Dokument zosta³ otwarty tylko do odczytu";
+ Text[ japanese ] = "ÄÞ·­ÒÝÄ‚Í“Ç‚ÝŽæ‚è—p‚ÉŠJ‚©‚ê‚Ü‚µ‚½";
+ Text[ chinese_traditional ] = "¤w¸g¥´¶}Ū¨ú³o­Ó¤å¥ó";
+ Text[ arabic ] = "Êã ÝÊÍ ÇáãáÝ ááÞÑÇÁÉ ÝÞØ";
+ Text[ dutch ] = "Document geopend als alleen lezen";
+ Text[ chinese_simplified ] = "Õâ¸ö´ò¿ªµÄÎĵµÊÇ·À¸²Ð´µÄ";
+ Text[ greek ] = "Ôï Ýããñáöï áíïß÷èçêå ìüíï ãéá áíÜãíùóç";
+ Text[ korean ] = "¹®¼­´Â Àбâ Àü¿ëÀ¸·Î ¿­·ÁÁ³½À´Ï´Ù.";
+ Text[ turkish ] = "Belge, salt okunur olarak açýldý";
+ };
+ String ERRCODE_SFX_OLEGENERAL
+ {
+ Text = "Allgemeiner OLE Fehler" ;
+ Text [ ENGLISH ] = "General OLE Error" ;
+ Text [ english_us ] = "General OLE Error" ;
+ Text [ italian ] = "Errore generale OLE" ;
+ Text [ spanish ] = "Error OLE general" ;
+ Text [ french ] = "Erreur OLE d'ordre général" ;
+ Text [ dutch ] = "Algemene OLE fout" ;
+ Text [ swedish ] = "Allmänt OLE-fel" ;
+ Text [ danish ] = "Generel OLE-fejl" ;
+ Text [ portuguese ] = "Erro OLE geral" ;
+ Text [ portuguese_brazilian ] = "Allgemeiner OLE Fehler" ;
+ Text[ chinese_simplified ] = "Ò»°ãµÄ OLE ´íÎó";
+ Text[ russian ] = "Îáùàÿ îøèáêà OLE";
+ Text[ polish ] = "B³¹d ogólny OLE";
+ Text[ japanese ] = "ˆê”Ê“I‚È OLE ´×°";
+ Text[ chinese_traditional ] = "¤@¯ë OLE ¿ù»~";
+ Text[ arabic ] = "ÎØÃ OLE ÚÇã";
+ Text[ dutch ] = "Algemene OLE fout";
+ Text[ chinese_simplified ] = "Ò»°ãµÄ OLE ´íÎó";
+ Text[ greek ] = "Ãåíéêü óöÜëìá ôïõ OLE";
+ Text[ korean ] = "ÀϹÝOLE ¿À·ù";
+ Text[ turkish ] = "Genel OLE hatasý";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_INET_NAME_RESOLVE
+ {
+ Text = "Der Rechnername $(ARG1) konnte nicht aufgelöst werden" ;
+ Text [ ENGLISH ] = "Could not resolve hostname $(ARG1)" ;
+ Text [ dutch ] = "Computernaam $(ARG1) kon niet worden herleid" ;
+ Text [ english_us ] = "The host name $(ARG1) could not be resolved" ;
+ Text [ italian ] = "Non è stato possibile risolvere il nome dell'host $(ARG1)" ;
+ Text [ spanish ] = "No se pudo resolver el nombre del ordenador $(ARG1)" ;
+ Text [ french ] = "Impossible de résoudre le nom $(ARG1) de l'ordinateur" ;
+ Text [ swedish ] = "Datornamnet $(ARG1) kunde inte lösas upp" ;
+ Text [ danish ] = "Det var ikke muligt at fortolke computernavnet $(ARG1)" ;
+ Text [ portuguese ] = "Impossível resolver o nome do computador $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "Der Rechnername $(ARG1) konnte nicht aufgelöst werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨ÕÒµ½¼ÆËã»úµØÖ· $(ARG1)";
+ Text[ russian ] = "Íå óäàåòñÿ îïðåäåëèòü èìÿ óçëîâîãî êîìïüþòåðà $(ARG1)";
+ Text[ polish ] = "Nazwa komputera $(ARG1) nie mog³a zostaæ przetworzona";
+ Text[ japanese ] = "νĖ¼$(ARG1)‚ÍŒ©‚‚©‚è‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk§ä¨ì¹q¸£¦a§} $(ARG1)";
+ Text[ arabic ] = "ÊÚÐÑ Íá ÇÓã ÇáãÖíÝ $(ARG1)";
+ Text[ dutch ] = "Computernaam $(ARG1) kon niet worden herleid";
+ Text[ chinese_simplified ] = "ÎÞ·¨ÕÒµ½¼ÆËã»úµØÖ· $(ARG1)";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí ãßíåé áíÜëõóç ôïõ ïíüìáôïò ôïõ õðïëïãéóôÞ $(ARG1)";
+ Text[ korean ] = "È£½ºÆ® À̸§ $(ARG1)ÀÌ È®ÀεÇÁö ¾Ê¾Ò½À´Ï´Ù.";
+ Text[ turkish ] = "$(ARG1) sunucu adý çözülemedi";
+ };
+ String ERRCODE_INET_CONNECT
+ {
+ Text = "Die Internetverbindung zu $(ARG1) konnte nicht hergestellt werden" ;
+ Text [ ENGLISH ] = "The Internetconnection to $(ARG1) could not be established" ;
+ Text [ dutch ] = "Er kon geen Internet-verbinding met $(ARG1) tot stand worden gebracht." ;
+ Text [ english_us ] = "Could not establish Internet connection to $(ARG1)" ;
+ Text [ italian ] = "Non è stato possibile stabilire la connessione a Internet a $(ARG1)" ;
+ Text [ spanish ] = "No se pudo establecer la conexión de Internet a $(ARG1)" ;
+ Text [ french ] = "Impossible d'établir la connexion Internet avec $(ARG1)" ;
+ Text [ swedish ] = "Internetförbindelsen till $(ARG1) kunde inte upprättas" ;
+ Text [ danish ] = "Det var ikke muligt at oprette en Internetforbindelse til $(ARG1)" ;
+ Text [ portuguese ] = "Foi impossível estabelecer a ligação à Internet com $(ARG1)." ;
+ Text [ portuguese_brazilian ] = "Die Internetverbindung zu $(ARG1) konnte nicht hergestellt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨ºÍ $(ARG1) ½¨Á¢¹ú¼Ê»¥ÁªÍøÁ¬½Ó";
+ Text[ russian ] = "Íå óäàåòñÿ íàëàäèòü ñâÿçü Èíòåðíåòà ñ $(ARG1)";
+ Text[ polish ] = "Ustanowienie po³¹czenia internetowego z $(ARG1) by³o niemo¿liwe";
+ Text[ japanese ] = "$(ARG1)‚ւ̲ÝÀ°È¯ÄÚ‘±‚ª‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B";
+ Text[ chinese_traditional ] = "µLªk³s½u¨ì $(ARG1)";
+ Text[ arabic ] = "ÊÚÐÑ Úãá ÇÊÕÇá ÅäÊÑäÊ ãÚ $(ARG1)";
+ Text[ dutch ] = "Er kon geen Internet-verbinding met $(ARG1) tot stand worden gebracht.";
+ Text[ chinese_simplified ] = "ÎÞ·¨ºÍ $(ARG1) ½¨Á¢¹ú¼Ê»¥ÁªÍøÁ¬½Ó";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá ðñáãìáôïðïéçèåß ç óýíäåóç Internet ìå ôï $(ARG1).";
+ Text[ korean ] = "$(ARG1)¿¡ ÀÎÅÍ³Ý ¿¬°áÀ» ÇÏÁö ¸øÇßÀ½";
+ Text[ turkish ] = "$(ARG1) Internet baðlantýsý oluþturulamadý";
+ };
+ String ERRCODE_INET_READ
+ {
+ Text = "Daten konnten nicht über das Internet gelesen werden.\nServerfehlermeldung: $(ARG1)" ;
+ Text [ ENGLISH ] = "Error reading from the internet\n.Server error message: $(ARG1)" ;
+ Text [ english_us ] = "Error reading data from the Internet\n.Server error message: $(ARG1)" ;
+ Text [ italian ] = "Non è stato possibile leggere i dati da Internet.\nMessaggio di errore del server: $(ARG1)" ;
+ Text [ spanish ] = "Los datos no se pudieron leer a través de Internet.\nMensaje de error del servidor: $(ARG1)" ;
+ Text [ french ] = "Erreur de lecture des données à partir de l'Internet.\nMessage d'erreur du serveur : $(ARG1)" ;
+ Text [ dutch ] = "Fout bij lezen van gegevens uit internet\n.Foutmelding van server: $(ARG1)" ;
+ Text [ swedish ] = "Data kunde inte läsas via Internet.\nServerfelmeddelande: $(ARG1)" ;
+ Text [ danish ] = "Det var ikke muligt at læses dataene over Internettet\nServerfejlmelding: $(ARG1)" ;
+ Text [ portuguese ] = "Foi impossível ler os dados via Internet.\nMensagem de erro do servidor: $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "Daten konnten nicht über das Internet gelesen werden.\nServerfehlermeldung: $(ARG1)" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Í¨¹ý¹ú¼Ê»¥ÁªÍø¶ÁÈ¡Êý¾Ý¡£\n·þÎñÆ÷±¨¸æ´íÎó£º$(ARG1)";
+ Text[ russian ] = "Ïðî÷èòàòü äàííûå ÷åðåç Èíòåðíåò íåâîçìîæíî.\nÑîîáùåíèå îøèáêè ñåðâåðà: $(ARG1)";
+ Text[ polish ] = "B³¹d odczytu plików z Internetu.\nKomunikat o b³êdzie serwera: $(ARG1)";
+ Text[ japanese ] = "ÃÞ°À‚ͲÝÀ°È¯Ä‚Å“Ç‚ÝŽæ‚ê‚Ü‚¹‚ñ‚Å‚µ‚½B\n»°ÊÞ° ´×° Ò¯¾°¼Þ: $(ARG1)";
+ Text[ chinese_traditional ] = "µLªk³z¹L Internet Ū¨ú¸ê®Æ¡C\n¦øªA¾¹³ø§i¡G$(ARG1)";
+ Text[ arabic ] = "ÊÚÐÑ ÞÑÇÁÉ ÇáÈíÇäÇÊ ÚÈÑ ÇáÅäÊÑäÊ.\nÑÓÇáÉ ÎØà ãä ÇáãÒæøÏ: $(ARG1)";
+ Text[ dutch ] = "Fout bij lezen van gegevens uit internet\n.Foutmelding van server: $(ARG1)";
+ Text[ chinese_simplified ] = "ÎÞ·¨Í¨¹ý¹ú¼Ê»¥ÁªÍø¶ÁÈ¡Êý¾Ý¡£\n·þÎñÆ÷±¨¸æ´íÎó£º$(ARG1)";
+ Text[ greek ] = "ÓöÜëìá êáôÜ ôçí áíÜãíùóç äåäïìÝíùí áðü ôï Internet.\nÌÞíõìá óöÜëìáôïò ôïõ äéáêïìéóôÞ: $(ARG1)";
+ Text[ korean ] = "µ¥ÀÌÅ͸¦ ÀÎÅͳݿ¡¼­ ÀÐÁö ¸øÇß½À´Ï´Ù.\n¼­¹ö ¿À·ù ¸Þ½ÃÁö: $(ARG1)";
+ Text[ turkish ] = "Internet üzerinden veri okunamadý.\nSunucu hata iletisi: $(ARG1)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_INET_WRITE
+ {
+ Text = "Daten konnten nicht ins Internet übertragen werden.\nServerfehlermeldung: $(ARG1)" ;
+ Text [ ENGLISH ] = "Error writing to the internet.Server error message: $(ARG1)" ;
+ Text [ english_us ] = "Error transferring data to the Internet.\nServer error message: $(ARG1)" ;
+ Text [ italian ] = "Non è stato possibile trasferire i dati in Internet.\nMessaggio di errore del server: $(ARG1)" ;
+ Text [ spanish ] = "No se pudieron transferir los datos a Internet.\nMensaje de error del servidor: $(ARG1)" ;
+ Text [ french ] = "Erreur de transfert de données sur l'Internet.\nMessage d'erreur du serveur : $(ARG1)" ;
+ Text [ dutch ] = "Fout bij gegevenstransfer naar Internet.\nFoutmelding server: $(ARG1)" ;
+ Text [ swedish ] = "Data kunde inte överföras till Internet.\nServerfelmeddelande: $(ARG1)" ;
+ Text [ danish ] = "Det var ikke muligt at overføre dataene til Internettet.\nServerfejlmelding: $(ARG1)" ;
+ Text [ portuguese ] = "Foi impossível transferir dados para a Internet.\nMensagem de erro do servidor: $(ARG1)" ;
+ Text [ portuguese_brazilian ] = "Daten konnten nicht ins Internet übertragen werden.\nServerfehlermeldung: $(ARG1)" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Ïò¹ú¼Ê»¥ÁªÍø´«µÝÊý¾Ý¡£\n·þÎñÆ÷±¨¸æ´íÎó£º$(ARG1)";
+ Text[ russian ] = "Ïåðåäàòü äàííûå â Èíòåðíåò íåâîçìîæíî.\nÑîîáùåíèå îøèáêè ñåðâåðà: $(ARG1)";
+ Text[ polish ] = "Danych nie mo¿na przenieœæ do sieci Internetu.\nKomunikat o b³êdzie z serwera: $(ARG1)";
+ Text[ japanese ] = "ÃÞ°À‚ͲÝÀ°È¯Ä‚É“]‘—‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½B\n»°ÊÞ° ´×° Ò¯¾°¼Þ: $(ARG1)";
+ Text[ chinese_traditional ] = "µLªk¦V Internet µo°e¸ê®Æ¡C\n¦øªA¾¹³ø§i¡G$(ARG1)";
+ Text[ arabic ] = "ÊÚÐÑ äÞá ÇáÈíÇäÇÊ ÚÈÑ ÇáÅäÊÑäÊ.\nÑÓÇáÉ ÎØà ãä ÇáãÒæøÏ: $(ARG1)";
+ Text[ dutch ] = "Fout bij gegevenstransfer naar Internet.\nFoutmelding server: $(ARG1)";
+ Text[ chinese_simplified ] = "ÎÞ·¨Ïò¹ú¼Ê»¥ÁªÍø´«µÝÊý¾Ý¡£\n·þÎñÆ÷±¨¸æ´íÎó£º$(ARG1)";
+ Text[ greek ] = "ÓöÜëìá êáôÜ ôçí ìåôÜäïóç äåäïìÝíùí ìÝóù ôïõ Internet.\nÌÞíõìá óöÜëìáôïò ôïõ äéáêïìéóôÞ: $(ARG1)";
+ Text[ korean ] = "µ¥ÀÌÅ͸¦ ÀÎÅͳÝÀ¸·Î º¸³»Áö ¸øÇß½À´Ï´Ù.\n¼­¹ö ¿À·ù ¸Þ½ÃÁö: $(ARG1)";
+ Text[ turkish ] = "Internet üzerinden veri aktarýlamadý.\nSunucu hata iletisi: $(ARG1)";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_INET_GENERAL
+ {
+ Text = "Ein allgemeiner Fehler im Internetbereich trat auf" ;
+ Text [ ENGLISH ] = "Gereral Internet Error" ;
+ Text [ dutch ] = "Algemene Internet fout" ;
+ Text [ english_us ] = "Gereral Internet error has occurred" ;
+ Text [ italian ] = "Si è verificato un errore generale nell'area Internet" ;
+ Text [ spanish ] = "Error general en Internet" ;
+ Text [ french ] = "Erreur générale Internet" ;
+ Text [ swedish ] = "Ett allmänt Internet-fel uppstod" ;
+ Text [ danish ] = "Der opstod en generel Internetfejl" ;
+ Text [ portuguese ] = "Erro geral na Internet" ;
+ Text [ portuguese_brazilian ] = "Ein allgemeiner Fehler im Internetbereich trat auf" ;
+ Text[ chinese_simplified ] = "ÔÚ¹ú¼Ê»¥ÁªÍøÄÚ·¢ÉúÁËÒ»¸öÒ»°ã´íÎó";
+ Text[ russian ] = "Ïðîèçîøëà îáùàÿ îøèáêà â îáëàñòè Èíòåðíåòà";
+ Text[ polish ] = "Wyst¹pi³ ogólny b³¹d w Internecie";
+ Text[ japanese ] = "²ÝÀ°È¯Ä—̈æ‚Ɉê”Ê“I‚È´×°‚ª”­¶";
+ Text[ chinese_traditional ] = "Internet ¤ºµo¥Í¤@­Ó¤@¯ë¿ù»~";
+ Text[ arabic ] = "ÍÏË ÎØà ÚÇã Ýí äØÇÞ ÇáÅäÊÑäÊ";
+ Text[ dutch ] = "Algemene Internet fout";
+ Text[ chinese_simplified ] = "ÔÚ¹ú¼Ê»¥ÁªÍøÄÚ·¢ÉúÁËÒ»¸öÒ»°ã´íÎó";
+ Text[ greek ] = "ÐáñïõóéÜóôçêå ãåíéêü óöÜëìá ôïõ Internet";
+ Text[ korean ] = "ÀÎÅÍ³Ý ¿µ¿ª¿¡ ÀϹÝÀûÀÎ ¿À·ù ¹ß»ý";
+ Text[ turkish ] = "Genel Internet hatasý";
+ };
+ String ERRCODE_INET_OFFLINE
+ {
+ Text = "Die angeforderten Internetdaten liegen nicht im Cache und können nicht übertragen werden, da der Onlinemodus nicht aktiv ist" ;
+ Text [ ENGLISH ] = "The requestet internet data is not available in the cache and cannot be transfered since the online mode is not active" ;
+ Text [ portuguese ] = "Os dados da Internet necessários não se encontram em Cache e não podem ser carregados porque o modo online não está activo." ;
+ Text [ english_us ] = "The requested Internet data is not available in the cache and cannot be transmitted as the Online mode has not be activated" ;
+ Text [ portuguese_brazilian ] = "Die angeforderten Internetdaten liegen nicht im Cache und können nicht übertragen werden, da der Onlinemodus nicht aktiv ist" ;
+ Text [ swedish ] = "De begärda Internetdata ligger inte i cachen och kan därför inte överföras eftersom onlineläget inte är aktivt" ;
+ Text [ danish ] = "De anmodede Internetdata er ikke tilgængelige i cachen og kan ikke overføres, fordi onlinetilstanden ikke er aktiveret" ;
+ Text [ italian ] = "I dati di Internet richiesti non si trovano nella cache e non possono essere trasmessi poiché il modo online non è attivo" ;
+ Text [ spanish ] = "Los datos de Internet solicitados no se encuentran en el caché y no pueden ser transmitidos ya que el modo en línea no está activo." ;
+ Text [ french ] = "Impossible de transmettre les données provenant d'Internet : vous n'êtes pas en mode en ligne et les données ne se trouvent pas dans le cache." ;
+ Text [ dutch ] = "De opgevraagde Internetgegevens zijn niet voorhanden in het cachegeheugen en kunnen niet worden getransfereerd daar de Onlinemodus niet actief is" ;
+ Text[ chinese_simplified ] = "ÒòΪÄúµÄ¼ÆËã»úºÍ»¹Ã»Óк͹ú¼Ê»¥ÁªÍøÁ¬½Ó£¬¶øÇÒ¼ÆËã»úµÄ»º³åÇøҲûÓÐÄúÇëÇóµÄ¹ú¼Ê»¥ÁªÍøµÄÊý¾Ý£¬Òò´ËÎÞ·¨×°ÔØ´«µÝÊý¾Ý";
+ Text[ russian ] = "Çàòðåáîâàííûå äàííûå Èíòåðíåòà íå íàõîäÿòñÿ â êýø è ïåðåäàòü èõ íåâîçìîæíî, ò.ê. ðåæèì Online íå àêòèâèçèðîâàí.";
+ Text[ polish ] = "Wymaganych danych z sieci Internet nie ma w pamiêci podrêcznej i nie mo¿na ich za³adowaæ, poniewa¿ tryb online nie jest uaktywniony.";
+ Text[ japanese ] = "Žw’肵‚½²ÝÀ°È¯Ä‚ÌÃÞ°À‚Í·¬¯¼­‚É‚È‚­‚ÄAµÝ×²Ý Ó°ÄÞ‚ª±¸Ã¨ÌÞ‚Å‚Í‚È‚¢‚½‚ß‚É“]‘—‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "ÁÙ¨S¦³³s½u¨ì Internet ¡M¦Ó¥B½w¨R°Ï¤]¨S¦³¼È¦s½Ð¨Dªº Internet ¸ê®Æ¦ÓµLªk¶Ç»¼¸ê®Æ";
+ Text[ arabic ] = "ãÚáæãÇÊ ÇáÅäÊÑäÊ ÇáãØáæÈÉ ÛíÑ ãæÌæÏÉ Ýí æÍÏÉ ÇáÊÎÒíä ÇáãÄÞÊÉ¡ æáÇ íãßä äÞáåÇ¡ ÅÐ Ãä æÖÚ ÇáÇÊÕÇá ÛíÑ äÔØ";
+ Text[ dutch ] = "De opgevraagde Internetgegevens zijn niet voorhanden in het cachegeheugen en kunnen niet worden getransfereerd daar de Onlinemodus niet actief is";
+ Text[ chinese_simplified ] = "ÒòΪÄúµÄ¼ÆËã»úºÍ»¹Ã»Óк͹ú¼Ê»¥ÁªÍøÁ¬½Ó£¬¶øÇÒ¼ÆËã»úµÄ»º³åÇøҲûÓÐÄúÇëÇóµÄ¹ú¼Ê»¥ÁªÍøµÄÊý¾Ý£¬Òò´ËÎÞ·¨×°ÔØ´«µÝÊý¾Ý";
+ Text[ greek ] = "Ôá æçôïýìåíá äåäïìÝíá ôïõ Internet äåí âñßóêïíôáé óôçí êñõöÞ ìíÞìç êáé äåí åßíáé äõíáôüí íá ìåôáäïèïýí, åðåéäÞ äåí åñãÜæåóôå óå êáôÜóôáóç áð´ åõèåßáò óýíäåóçò";
+ Text[ korean ] = "¿äûµÈ ÀÎÅÍ³Ý µ¥ÀÌÅÍ°¡ ij½Ã¿¡ ¾øÀ¸¸ç ¿Â¶óÀÎ ¸ðµå°¡ È°¼ºÈ­µÇ¾î ÀÖÁö ¾Ê¾Æ µ¥ÀÌÅ͸¦ º¸³¾ ¼ö ¾øÀ½";
+ Text[ turkish ] = "Ýstenen Internet verileri önbellekte bulunmuyor ve çevrimiçi kipi etkin olmadýðý için aktarýlamýyor";
+ };
+ String ERRCODE_SFXMSG_STYLEREPLACE
+ {
+ Text = "Soll der Style $(ARG1) ersetzt werden?" ;
+ Text [ ENGLISH ] = "Should style $(ARG1) be overwritten?" ;
+ ExtraData = ERRCODE_MSG_ERROR | ERRCODE_BUTTON_OK_CANCEL ;
+ Text [ english_us ] = "Should the $(ARG1) Style be replaced?" ;
+ Text [ italian ] = "Sostituire lo stile $(ARG1) ?" ;
+ Text [ spanish ] = "¿Desea sustituir el estilo $(ARG1)?" ;
+ Text [ french ] = "Souhaitez-vous que le style $(ARG1) soit remplacé ?" ;
+ Text [ dutch ] = "Opmaakprofiel $(ARG1) vervangen?" ;
+ Text [ swedish ] = "Ska formatet $(ARG1) ersättas?" ;
+ Text [ danish ] = "Skal typografien $(ARG1) erstattes?" ;
+ Text [ portuguese ] = "Substituir o estilo $(ARG1)?" ;
+ Text [ portuguese_brazilian ] = "Soll der Style $(ARG1) ersetzt werden?" ;
+ Text[ chinese_simplified ] = "Òª¸üÌæÑùʽ $(ARG1) £¿";
+ Text[ russian ] = "Çàìåíèòü ñòèëü $(ARG1)?";
+ Text[ polish ] = "Zamieniæ styl $(ARG1)?";
+ Text[ japanese ] = "½À²Ù $(ARG1)‚ð’uŠ·‚µ‚Ü‚·‚©?";
+ Text[ chinese_traditional ] = "­n§ó´À³o­Ó¼Ë¦¡ $(ARG1)¡H";
+ Text[ arabic ] = "åá ÊÑíÏ ÇÓÊÈÏÇá ÇáäãØ $(ARG1)¿";
+ Text[ dutch ] = "Opmaakprofiel $(ARG1) vervangen?";
+ Text[ chinese_simplified ] = "Òª¸üÌæÑùʽ $(ARG1) £¿";
+ Text[ greek ] = "Íá áíôéêáôáóôáèåß ôï óôõë $(ARG1);";
+ Text[ korean ] = "À¯Çü$(ARG1)À» ´ëüÇϽðڽÀ´Ï±î?";
+ Text[ turkish ] = "$(ARG1) biçimi deðiþtirilsin mi?";
+ Text[ language_user1 ] = "\"Vorlagen\" Styles are always capitalized no matter where they show up. EM15.5.00 - - - -";
+ };
+ String ERRCODE_SFX_NOFILTER
+ {
+ Text = "Ein Filter wurde nicht gefunden" ;
+ Text [ ENGLISH ] = "Filter not ound " ;
+ Text [ english_us ] = "A filter has not been found" ;
+ Text [ italian ] = "Non è stato trovato un filtro" ;
+ Text [ spanish ] = "No se ha encontrado un filtro" ;
+ Text [ french ] = "Filtre introuvable" ;
+ Text [ dutch ] = "Geen filter gevonden" ;
+ Text [ swedish ] = "Inget filter kunde hittas" ;
+ Text [ danish ] = "Der blev ikke fundet et filter" ;
+ Text [ portuguese ] = "O filtro não foi encontrado." ;
+ Text [ portuguese_brazilian ] = "Ein Filter wurde nicht gefunden" ;
+ Text[ chinese_simplified ] = "ûÓÐÕÒµ½¹ýÂËÆ÷";
+ Text[ russian ] = "Ôèëüòð íå íàéäåí";
+ Text[ polish ] = "Filtru nie znaleziono";
+ Text[ japanese ] = "̨ÙÀ‚ÍŒ©‚‚©‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "¨S¦³§ä¨ì¹LÂo¾¹";
+ Text[ arabic ] = "ÊÚÐÑ ÇáÚËæÑ Úáì ÝáÊÑ";
+ Text[ dutch ] = "Geen filter gevonden";
+ Text[ chinese_simplified ] = "ûÓÐÕÒµ½¹ýÂËÆ÷";
+ Text[ greek ] = "Äåí âñÝèçêå êÜðïéï ößëôñï";
+ Text[ korean ] = "ÇÊÅÍ°¡ ¹ß°ßµÇÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Bir filtre bulunamadý";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_SFX_NODOCRELOAD
+ {
+ Text = "Dokument kann nicht bearbeitet werden" ;
+ };
+ String ERRCODE_SFX_CANTFINDORIGINAL
+ {
+ Text = "Das Original konnte nicht bestimmt werden" ;
+ Text [ English ] = "The original could not be detected" ;
+ Text [ dutch ] = "Het origineel kon niet als zodanig worden herkend." ;
+ Text [ english_us ] = "The original could not be determined." ;
+ Text [ swedish ] = "Originalet kunde inte bestämmas." ;
+ Text [ danish ] = "Det var ikke muligt at bestemme originalen" ;
+ Text [ italian ] = "Impossibile determinare l'originale" ;
+ Text [ spanish ] = "No se pudo determinar el original." ;
+ Text [ french ] = "Impossible de déterminer l'original" ;
+ Text [ portuguese ] = "Foi impossível determinar o original." ;
+ Text [ portuguese_brazilian ] = "Das Original konnte nicht bestimmt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨È·¶¨Ô­¼þ";
+ Text[ russian ] = "Îïðåäåëèòü îðèãèíàë íåâîçìîæíî";
+ Text[ polish ] = "Orygina³u nie mo¿na by³o okreœliæ.";
+ Text[ japanese ] = "µØ¼ÞÅÙ‚ÍŒˆ’è‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk½T©w­ì¥ó";
+ Text[ arabic ] = "ÊÚÐÑ ÊÍÏíÏ ÇáÃÕá";
+ Text[ dutch ] = "Het origineel kon niet als zodanig worden herkend.";
+ Text[ chinese_simplified ] = "ÎÞ·¨È·¶¨Ô­¼þ";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá ïñéóôåß ôï áñ÷éêü.";
+ Text[ korean ] = "¿øº»ÀÌ °áÁ¤µÇÁö ¾Ê¾Ò½À´Ï´Ù.";
+ Text[ turkish ] = "Asýl belirlenemedi";
+ };
+ String ERRCODE_SFX_CANTCREATECONTENT
+ {
+ Text = "Der Inhalt konnte nicht erzeugt werden" ;
+ Text [ English ] = "The content could not be created" ;
+ Text [ dutch ] = "Er kon geen inhoud worden gecreëerd." ;
+ Text [ english_us ] = "The contents could not be created." ;
+ Text [ swedish ] = "Innehållet kunde inte skapas" ;
+ Text [ danish ] = "Det var ikke muligt at oprette indholdet" ;
+ Text [ italian ] = "Impossibile creare il contenuto" ;
+ Text [ spanish ] = "No se pudo crear el contenido." ;
+ Text [ french ] = "Impossible de créer le contenu" ;
+ Text [ portuguese ] = "Foi impossível criar o conteúdo." ;
+ Text [ portuguese_brazilian ] = "Der Inhalt konnte nicht erzeugt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Éú³ÉÄÚÈÝ";
+ Text[ russian ] = "Ñîçäàòü ñîäåðæàíèå íåâîçìîæíî";
+ Text[ polish ] = "Zawartoœæ nie mog³a zostaæ utworzona";
+ Text[ japanese ] = "“à—e‚Í쬂ł«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk¥Í¦¨¤º®e";
+ Text[ arabic ] = "ÊÚÐÑ ÅäÔÇÁ ÇáãÍÊæì";
+ Text[ dutch ] = "Er kon geen inhoud worden gecreëerd.";
+ Text[ chinese_simplified ] = "ÎÞ·¨Éú³ÉÄÚÈÝ";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá äçìéïõñãçèåß ôï ðåñéå÷üìåíï.";
+ Text[ korean ] = "³»¿ëÀÌ ¸¸µé¾îÁöÁö ¾Ê¾Ò½À´Ï´Ù.";
+ Text[ turkish ] = "Ýçerik oluþturulamadý";
+ };
+ String ERRCODE_SFX_CANTCREATELINK
+ {
+ Text = "Die Verknüpfung konnte nicht erzeugt werden" ;
+ Text [ English ] = "The link could not be created" ;
+ Text [ dutch ] = "Er kon geen link worden gecreëerd." ;
+ Text [ english_us ] = "The link could not be created." ;
+ Text [ swedish ] = "Länken kunde inte skapas" ;
+ Text [ danish ] = "Det var ikke muligt at oprette kæden" ;
+ Text [ italian ] = "Impossibile creare il collegamento" ;
+ Text [ spanish ] = "No se pudo crear el vínculo." ;
+ Text [ french ] = "Impossible de créer le lien" ;
+ Text [ portuguese ] = "Foi impossível criar a ligação." ;
+ Text [ portuguese_brazilian ] = "Die Verknüpfung konnte nicht erzeugt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Éú³ÉÁ´½Ó";
+ Text[ russian ] = "Ñîçäàòü ññûëêó íåâîçìîæíî";
+ Text[ polish ] = "£¹cze nie mog³o zostaæ utworzone";
+ Text[ japanese ] = "Øݸ‚Í쬂ł«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk«Ø¥ß±¶®|";
+ Text[ arabic ] = "ÊÚÐÑ ÅäÔÇÁ ÇáÇÑÊÈÇØ";
+ Text[ dutch ] = "Er kon geen link worden gecreëerd.";
+ Text[ chinese_simplified ] = "ÎÞ·¨Éú³ÉÁ´½Ó";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá äçìéïõñãçèåß ç óýíäåóç";
+ Text[ korean ] = "¿¬°áÀÌ ¸¸µé¾îÁöÁö ¾Ê¾Ò½À´Ï´Ù.";
+ Text[ turkish ] = "Baðlantý oluþturulamadý";
+ };
+ String ERRCODE_SFX_WRONGBMKFORMAT
+ {
+ Text = "Das Format der Verknüpfung ist ungültig" ;
+ Text [ English ] = "The format of the link ist invalid" ;
+ Text [ dutch ] = "Ongeldig link-formaat" ;
+ Text [ english_us ] = "The link format is invalid." ;
+ Text [ swedish ] = "Länkens format är ogiltigt" ;
+ Text [ danish ] = "Kædeformatet er ugyldigt" ;
+ Text [ italian ] = "Formato del collegamento non valido" ;
+ Text [ spanish ] = "El formato del vínculo no es válido" ;
+ Text [ french ] = "Le format du lien est incorrect" ;
+ Text [ portuguese ] = "O formato da ligação não é válido." ;
+ Text [ portuguese_brazilian ] = "Das Format der Verknüpfung ist ungültig" ;
+ Text[ chinese_simplified ] = "ÎÞЧµÄÁ´½Ó¸ñʽ";
+ Text[ russian ] = "Íåïðàâèëüíûé ôîðìàò ññûëêè";
+ Text[ polish ] = "Format ³¹cza jest nieprawid³owy";
+ Text[ japanese ] = "Øݸ‚Ì‘Ž®‚Í–³Œø‚Å‚·";
+ Text[ chinese_traditional ] = "±¶®|®æ¦¡µL®Ä";
+ Text[ arabic ] = "ÊäÓíÞ ÇáÇÑÊÈÇØ ÛíÑ ÕÇáÍ";
+ Text[ dutch ] = "Ongeldig link-formaat";
+ Text[ chinese_simplified ] = "ÎÞЧµÄÁ´½Ó¸ñʽ";
+ Text[ greek ] = "Ç ìïñöÞ ôçò óýíäåóçò äåí åßíáé Ýãêõñç.";
+ Text[ korean ] = "¿¬°áÀÇ ¼­½ÄÀÌÀ¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Baðlantýnýn formatý geçerli deðil";
+ };
+ String ERRCODE_SFX_WRONGICONFILE
+ {
+ Text = "Die Konfiguration der Symbolanzeige ist ungültig" ;
+ Text [ English ] = "The configuration of the symbolview is invalid" ;
+ Text [ dutch ] = "Ongeldige configuratie van pictogramweergave" ;
+ Text [ english_us ] = "The configuration of the icon display is invalid." ;
+ Text [ swedish ] = "Konfigurationen för symbolvisningen är ogiltig." ;
+ Text [ danish ] = "Ikonvisningens konfiguration er ugyldig" ;
+ Text [ italian ] = "Configurazione della visualizzazione dei simboli non valida" ;
+ Text [ spanish ] = "La configuración del panel de símbolos no es válida" ;
+ Text [ french ] = "La configuration de l'affichage des icônes est incorrecte" ;
+ Text [ portuguese ] = "A configuração do painel de ícones não é válida." ;
+ Text [ portuguese_brazilian ] = "Die Konfiguration der Symbolanzeige ist ungültig" ;
+ Text[ chinese_simplified ] = "ͼ±êÏÔʾµÄÅäÖÃÎļþÎÞЧ";
+ Text[ russian ] = "Íåïðàâèëüíàÿ êîíôèãóðàöèÿ ïîêàçà ñèìâîëîâ";
+ Text[ polish ] = "Konfiguracja wyœwietlania symboli jest nieprawid³owa.";
+ Text[ japanese ] = "¼ÝÎÞÙ•\\Ž¦‚Ìݒ肪–³Œø‚Å‚·";
+ Text[ chinese_traditional ] = "¥Î©ó¹Ï¼ÐÅã¥Üªº°t¸mÀÉ®×µL®Ä";
+ Text[ arabic ] = "Êßæíä ÚÑÖ ÇáÑãæÒ ÛíÑ ÕÇáÍ";
+ Text[ dutch ] = "Ongeldige configuratie van pictogramweergave";
+ Text[ chinese_simplified ] = "ͼ±êÏÔʾµÄÅäÖÃÎļþÎÞЧ";
+ Text[ greek ] = "Ç äéáìüñöùóç ôçò åìöÜíéóçò ôùí óõìâüëùí äåí åßíáé Ýãêõñç";
+ Text[ korean ] = "¾ÆÀÌÄÜ º¸±â ±¸¼ºÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Simge görüntüleme konfigürasyonu geçerli deðil";
+ };
+ String ERRCODE_SFX_CANTWRITEICONFILE
+ {
+ Text = "Die Konfiguration der Symbolanzeige kann nicht gespeichert werden" ;
+ Text [ English ] = "The configuration of the symbolview could not be written" ;
+ Text [ dutch ] = "Configuration van pictogram kan niet worden opgeslagen" ;
+ Text [ english_us ] = "The configuration of the icon display can not be saved." ;
+ Text [ swedish ] = "Konfigurationen för symbolvisningen kan inte sparas." ;
+ Text [ danish ] = "Det er ikke muligt at gemme ikonvisningens konfiguration" ;
+ Text [ italian ] = "Impossibile salvare la configurazione della rappresentazione dei simboli" ;
+ Text [ spanish ] = "No se puede guardar la configuración del panel de símbolos" ;
+ Text [ french ] = "Impossible d'enregistrer les paramètres d'affichage de l'icône" ;
+ Text [ portuguese ] = "É impossível guardar a configuração do painel de ícones." ;
+ Text [ portuguese_brazilian ] = "Die Konfiguration der Symbolanzeige kann nicht gespeichert werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨´æÅÌͼ±êÏÔʾµÄÅäÖÃÎļþ";
+ Text[ russian ] = "Ñîõðàíèòü êîíôèãóðàöèþ ïîêàçà ñèìâîëà íåâîçìîæíî";
+ Text[ polish ] = "Konfiguracji wyœwietlania symboli nie mo¿na by³o zapisaæ.";
+ Text[ japanese ] = "¼ÝÎÞÙ•\\Ž¦‚ÌÝ’è‚Í•Û‘¶‚Å‚«‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "µLªkÀx¦s¹Ï¼ÐÅã¥Üªº°t¸mÀÉ®×";
+ Text[ arabic ] = "ÊÚÐÑÍÝÙ Êßæíä ÚÑÖ ÇáÑãæÒ";
+ Text[ dutch ] = "Configuration van pictogram kan niet worden opgeslagen";
+ Text[ chinese_simplified ] = "ÎÞ·¨´æÅÌͼ±êÏÔʾµÄÅäÖÃÎļþ";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá áðïèçêåõôåß ç äéáìüñöùóç ôçò åìöÜíéóçò ôùí óõìâüëùí";
+ Text[ korean ] = "¾ÆÀÌÄÜ º¸±â ±¸¼ºÀÌ ÀúÀåµÇÁö ¾Ê¾Ò½À´Ï´Ù.";
+ Text[ turkish ] = "Simge görüntüleme konfigürasyonu kaydedilemiyor";
+ };
+ String ERRCODE_SFX_CANTDELICONFILE
+ {
+ Text = "Die Konfiguration der Symbolanzeige konnte nicht gelöscht werden" ;
+ Text [ English ] = "The configuration of the symbolview could not be removed" ;
+ Text [ dutch ] = "Configuratie van pictogram kon niet worden gewist." ;
+ Text [ english_us ] = "The configuration of the icon display could not be deleted." ;
+ Text [ swedish ] = "Konfigurationen för symbolvisningen kunde inte raderas." ;
+ Text [ danish ] = "Det var ikke muligt at slette ikonvisningens konfiguration" ;
+ Text [ italian ] = "Impossibile cancellare la configurazione della rappresentazione dei simbol" ;
+ Text [ spanish ] = "No se pudo eliminar la configuración del panel de símbolos." ;
+ Text [ french ] = "Impossible de supprimer les paramètres d'affichage de l'icône" ;
+ Text [ portuguese ] = "Foi impossível eliminar a configuração do painel de ícones." ;
+ Text [ portuguese_brazilian ] = "Die Konfiguration der Symbolanzeige konnte nicht gelöscht werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨É¾³ýͼ±êÏÔʾµÄÅäÖÃÎļþ";
+ Text[ russian ] = "Óäàëèòü êîíôèãóðàöèþ ïîêàçà ñèìâîëà íåâîçìîæíî";
+ Text[ polish ] = "Konfiguracja wyœwietlania symboli nie mo¿e zostaæ usuniêta.";
+ Text[ japanese ] = "¼ÝÎÞÙ•\\Ž¦‚ÌÝ’è‚Í휂ł«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk§R°£¹Ï¼ÐÅã¥Üªº°t¸mÀÉ®×";
+ Text[ arabic ] = "ÊÚÐÑ ÍÐÝ Êßæíä ÚÑÖ ÇáÑãæÒ.";
+ Text[ dutch ] = "Configuratie van pictogram kon niet worden gewist.";
+ Text[ chinese_simplified ] = "ÎÞ·¨É¾³ýͼ±êÏÔʾµÄÅäÖÃÎļþ";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá äéáãñáöåß ç äéáìüñöùóç ôçò åìöÜíéóçò ôùí óõìâüëùí";
+ Text[ korean ] = "¾ÆÀÌÄÜ º¸±â ±¸¼ºÀÌ »èÁ¦µÇ¾ú½À´Ï´Ù.";
+ Text[ turkish ] = "Simge görüntüleme konfigürasyonu silinemedi.";
+ };
+ String ERRCODE_SFX_CANTRENAMECONTENT
+ {
+ Text = "Der Inhalt konnte nicht umbenannt werden" ;
+ Text [ English ] = "The content could not be renamed" ;
+ Text [ dutch ] = "De naam van de inhoud kon niet worden gewijzigd." ;
+ Text [ english_us ] = "Contents cannot be renamed" ;
+ Text [ swedish ] = "Innehållet kunde inte döpas om" ;
+ Text [ danish ] = "Det var ikke muligt at omdøbe indholdet" ;
+ Text [ italian ] = "Impossibile rinominare il contenuto" ;
+ Text [ spanish ] = "No se puede cambiar el nombre al contenido." ;
+ Text [ french ] = "Impossible de renommer le contenu" ;
+ Text [ portuguese ] = "Foi impossível mudar o nome do conteúdo." ;
+ Text [ portuguese_brazilian ] = "Der Inhalt konnte nicht umbenannt werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨ÖØÃüÃûÄÚÈÝ";
+ Text[ russian ] = "Ïåðåèìåíîâàòü ñîäåðæèìîå íåâîçìîæíî";
+ Text[ polish ] = "Nazwa zawartoœci nie mog³a zostaæ zmieniona.";
+ Text[ japanese ] = "“à—e‚Ì–¼‘O‚Ì•ÏX‚Í‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk­«·s©R¦W¤º®e";
+ Text[ arabic ] = "ÊÚÐÑÊ ÚãáíÉ ÅÚÇÏÉ ÊÓãíÉ ÇáãÍÊæíÇÊ";
+ Text[ dutch ] = "De naam van de inhoud kon niet worden gewijzigd.";
+ Text[ chinese_simplified ] = "ÎÞ·¨ÖØÃüÃûÄÚÈÝ";
+ Text[ greek ] = "Ôï ðåñéå÷üìåíï äåí Þôáí äõíáôüí íá ìåôïíïìáóôåß.";
+ Text[ korean ] = "³»¿ë À̸§ ¹Ù²Ù±â°¡ ¾ÈµË´Ï´Ù.";
+ Text[ turkish ] = "Ýçerik yeniden adlandýrýlamadý";
+ };
+ String ERRCODE_SFX_INVALIDBMKPATH
+ {
+ Text = "Der Bookmarkordner ist ungültig" ;
+ Text [ English ] = "The bookmarkfolder is invalid" ;
+ Text [ dutch ] = "De bookmark-ordner is ongeldig" ;
+ Text [ english_us ] = "The bookmark folder is invalid." ;
+ Text [ swedish ] = "Bokmärkesmappen är ogiltig" ;
+ Text [ danish ] = "Bogmærkemappen er ugyldig" ;
+ Text [ italian ] = "Cartella bookmark non valida" ;
+ Text [ spanish ] = "Carpeta de marcadores no válida" ;
+ Text [ french ] = "Le dossier de Bookmarks indiqué est incorrect" ;
+ Text [ portuguese ] = "A pasta de bookmarks não é válida." ;
+ Text [ portuguese_brazilian ] = "Der Bookmarkordner ist ungültig" ;
+ Text[ chinese_simplified ] = "ÊéÇ©Îļþ¼ÐÎÞЧ";
+ Text[ russian ] = "Íåïðàâèëüíàÿ ïàïêà çàêëàäîê";
+ Text[ polish ] = "Folder z zak³adkami jest nieprawid³owy";
+ Text[ japanese ] = "ÌÞ¯¸Ï°¸ Ì«ÙÀÞ‚Í–³Œø‚Å‚·";
+ Text[ chinese_traditional ] = "®ÑÅÒ¸ê®Æ§¨µL®Ä";
+ Text[ arabic ] = "ãÌáÏ ÇáÅÔÇÑÇÊ ÇáãÑÌÚíÉ ÛíÑ ÕÇáÍ";
+ Text[ dutch ] = "De bookmark-ordner is ongeldig";
+ Text[ chinese_simplified ] = "ÊéÇ©Îļþ¼ÐÎÞЧ";
+ Text[ greek ] = "Ï öÜêåëïò óåëéäïäåéêôþí äåí åßíáé Ýãêõñïò";
+ Text[ korean ] = "Ã¥°¥ÇÇ Æú´õ°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Yer iþareti klasörü geçersizdir";
+ };
+ String ERRCODE_SFX_CANTWRITEURLCFGFILE
+ {
+ Text = "Die Konfiguration der lokal zu speichernden URLs konnte nicht gespeichert werden" ;
+ Text [ English ] = "The configuration of the URLs to save local could not be saved" ;
+ Text [ dutch ] = "De configuratie van de URLs kon niet lokaal worden opgeslagen" ;
+ Text [ english_us ] = "The configuration of the URLs to be saved locally could not be saved" ;
+ Text [ swedish ] = "Konfigurationen för de URL som skall sparas lokalt kunde inte sparas" ;
+ Text [ danish ] = "Det var ikke muligt at gemme konfigurationen på de URLs, som skulle gemmes lokalt" ;
+ Text [ italian ] = "Non è stato possibile salvare la configurazione delle URL da salvare localmente" ;
+ Text [ spanish ] = "No se pudo guardar la configuración de las URLs a guardar localmente." ;
+ Text [ french ] = "Impossible d'enregistrer la configuration pour l'enregistrement local des URLs" ;
+ Text [ portuguese ] = "Foi impossível guardar a configuração dos URLs a serem guardados localmente." ;
+ Text [ portuguese_brazilian ] = "Die Konfiguration der lokal zu speichernden URLs konnte nicht gespeichert werden" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨´æÅÌÒª¾Ö²¿´¢´æ URL µØÖ·µÄÅäÖÃÎļþ";
+ Text[ russian ] = "Ñîõðàíèòü êîíôèãóðàöèþ ëîêàëüíî ñîõðàíÿåìîãî URL íåâîçìîæíî";
+ Text[ polish ] = "Nie mo¿na by³o zapisaæ konfiguracji adresu URL, który mia³ zostaæ lokalnie zapisany.";
+ Text[ japanese ] = "Û°¶Ù‚Å•Û‘¶‚·‚éURL‚ÌÝ’è‚Í•Û‘¶‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk«O¦s§½³¡Àx¦sªº URL °t¸mÀÉ®×";
+ Text[ arabic ] = "ÊÚÐÑ ÍÝÙ Êßæíä ÇáÚäÇæíä (URLs) ÇáæÇÌÈ ÍÝÙåÇ ãÍáíÇð";
+ Text[ dutch ] = "De configuratie van de URLs kon niet lokaal worden opgeslagen";
+ Text[ chinese_simplified ] = "ÎÞ·¨´æÅÌÒª¾Ö²¿´¢´æ URL µØÖ·µÄÅäÖÃÎļþ";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá áðïèçêåõôåß ç äéáìüñöùóç ôùí URL ðïõ ðñüêåéôáé íá áðïèçêåõôïýí ôïðéêÜ";
+ Text[ korean ] = "·ÎÄÿ¡ ÀúÀåµÈ URLÀÇ ±¸¼ºÀÌ ÀúÀåµÇÁö ¾Ê¾Ò½À´Ï´Ù.";
+ Text[ turkish ] = "Yerel olarak kaydedilecek URL'Lerin konfigürasyonu kaydedilemedi";
+ };
+ String ERRCODE_SFX_WRONGURLCFGFORMAT
+ {
+ Text = "Das Format der Konfiguration der lokal zu speichernden URLs ist ungültig" ;
+ Text [ English ] = "The format of the configuration of the URLs to save local is invalid" ;
+ Text [ dutch ] = "De configuratie van de URLs kon niet lokaal worden opgeslagen daar het formaat ongeldig is." ;
+ Text [ english_us ] = "The configuration format of the URLs to be saved locally is invalid" ;
+ Text [ swedish ] = "Formatet för konfigurationen för de URL som skall sparas lokalt är ogiltigt" ;
+ Text [ danish ] = "Konfigurationsformatet på de URLs, som skulle gemmes lokalt, er ugyldigt" ;
+ Text [ italian ] = "Il formato della configurazione delle URL da salvare localmente non è valido" ;
+ Text [ spanish ] = "No es válido el formato de la configuración de las URLs a guardar localmente." ;
+ Text [ french ] = "Le format configuré pour les URLs à enregistrer localement est incorrect" ;
+ Text [ portuguese ] = "O formato da configuração dos URLs a serem guardados localmente não é válido." ;
+ Text [ portuguese_brazilian ] = "Das Format der Konfiguration der lokal zu speichernden URLs ist ungültig" ;
+ Text[ chinese_simplified ] = "¾Ö²¿´¢´æ URL µØÖ·µÄÅäÖÃÎļþ¸ñʽÎÞЧ";
+ Text[ russian ] = "Íåïðàâèëüíûé ôîðìàò êîíôèãóðàöèè ëîêàëüíî ñîõðàíÿåìîãî URL";
+ Text[ polish ] = "Format konfiguracji adresu URL, który ma zostaæ lokalnie zapisany, jest nieprawid³owy.";
+ Text[ japanese ] = "Û°¶Ù‚Å•Û‘¶‚·‚éURL‚ðÝ’è‚·‚é‘Ž®‚ª–³Œø‚Å‚·";
+ Text[ chinese_traditional ] = "§½³¡Àx¦s URL °t¸mÀɮ׮榡µL®Ä";
+ Text[ arabic ] = "ÊäÓíÞ Êßæíä ÇáÚäÇæíä (URLs) ¡ÇáæÇÌÈ ÍÝÙåÇ ãÍáíÇð¡ ÛíÑ ÕÇáÍ";
+ Text[ dutch ] = "De configuratie van de URLs kon niet lokaal worden opgeslagen daar het formaat ongeldig is.";
+ Text[ chinese_simplified ] = "¾Ö²¿´¢´æ URL µØÖ·µÄÅäÖÃÎļþ¸ñʽÎÞЧ";
+ Text[ greek ] = "Ç ìïñöÞ ôùí ñõèìßóåùí ôïõ URL, ôï ïðïßï ðñüêåéôáé íá áðïèçêåõôåß ôïðéêÜ, äåí åßíáé Ýãêõñç.";
+ Text[ korean ] = "·ÎÄÿ¡ ÀúÀåµÈ URLÀÇ ±¸¼ºÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Yerel olarak kaydedilecek URL'lerin konfigürasyon formatý geçerli deðil";
+ };
+ String ERRCODE_SFX_NODOCUMENT
+ {
+ Text = "Es existiert kein Dokument, auf das die Aktion angewendet werden kann" ;
+ Text [ English ] = "There exists no document to act on" ;
+ Text [ dutch ] = "Er bestaat geen document waarop deze activiteit kan worden toegepast." ;
+ Text [ english_us ] = "This action cannot be applied to a document that does not exist" ;
+ Text [ swedish ] = "Det finns inget dokument som åtgärden kan användas på." ;
+ Text [ danish ] = "Der findes intet dokument, som handlingen kan anvendes på" ;
+ Text [ italian ] = "Non esiste un documento sul quale eseguire tale operazione" ;
+ Text [ spanish ] = "No existe ningún documento al que se le pueda aplicar la acción" ;
+ Text [ french ] = "Il n'existe aucun document auquel l'action peut être appliquée" ;
+ Text [ portuguese ] = "Não existe nenhum documento ao qual possa ser aplicada a acção." ;
+ Text [ portuguese_brazilian ] = "Es existiert kein Dokument, auf das die Aktion angewendet werden kann" ;
+ Text[ chinese_simplified ] = "Ö´ÐвÙ×÷ËùÐèµÄÎĵµ²»´æÔÚ";
+ Text[ russian ] = "Äîêóìåíò, ê êîòîðîìó äîëæíî áûòü ïðèìåíåíî ýòî äåéñòâèå, íå ñóùåñòâóåò";
+ Text[ polish ] = "Nie istnieje ¿aden dokument, do którego mo¿na by zastosowaæ tê akcjê.";
+ Text[ japanese ] = "±¸¼®Ý‚Ì“K—p‚Å‚«‚éÄÞ·­ÒÝÄ‚Í‚ ‚è‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "¥Î¨Ó°õ¦æ¾Þ§@ªº¤å¥ó¤£¦s¦b";
+ Text[ arabic ] = "áÇ íæÌÏ ãÓÊäÏ íãßä ÊØÈíÞ ÇáÅÌÑÇÁ Úáíå";
+ Text[ dutch ] = "Er bestaat geen document waarop deze activiteit kan worden toegepast.";
+ Text[ chinese_simplified ] = "Ö´ÐвÙ×÷ËùÐèµÄÎĵµ²»´æÔÚ";
+ Text[ greek ] = "Äåí õðÜñ÷åé Ýããñáöï óôï ïðïßï íá åöáñìïóôåß ç åíÝñãåéá";
+ Text[ korean ] = "ÀÌ ÀÛ¾÷À» Àû¿ëÇÒ ¼ö ÀÖ´Â ¹®¼­°¡ ¾øÀ½";
+ Text[ turkish ] = "Ýþlemin uygulanabileceði bir belge mevcut deðil";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_SFX_INVALIDLINK
+ {
+ Text = "Die Verknüpfung verweist auf ein ungültiges Ziel" ;
+ Text [ English ] = "Invalid Link Target" ;
+ Text [ dutch ] = "De koppeling verwijst naar een ongeldig doel" ;
+ Text [ english_us ] = "The link refers to an invalid target" ;
+ Text [ swedish ] = "Länken refererar till ett ogiltigt mål" ;
+ Text [ danish ] = "Kæden referer til et ugyldigt mål" ;
+ Text [ italian ] = "Il collegamento si riferisce ad una destinazione non valida" ;
+ Text [ spanish ] = "El vínculo se refiere a un destino no válido" ;
+ Text [ french ] = "Le lien renvoit à une cible incorrecte" ;
+ Text [ portuguese ] = "A ligação remete a um destino não válido." ;
+ Text [ portuguese_brazilian ] = "Die Verknüpfung verweist auf ein ungültiges Ziel" ;
+ Text[ chinese_simplified ] = "Á´½ÓÖ¸ÏòÒ»¸öÎÞЧµÄÄ¿±ê";
+ Text[ russian ] = "Ññûëêà óêàçûâàåò íà íåïðàâèëüíóþ öåëü";
+ Text[ polish ] = "£¹cze odnosi siê do nieprawid³owego celu.";
+ Text[ japanese ] = "Øݸ‚Í–³Œø‚ÈÀ°¹Þ¯Ä‚ðŽQÆ‚µ‚Ä‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "±¶®|«ü¦V¤@­ÓµL®Äªº¥Ø¼Ð";
+ Text[ arabic ] = "íÔíÑ ÇáÇÑÊÈÇØ Åáì åÏÝ ÛíÑ ÕÇáÍ";
+ Text[ dutch ] = "De koppeling verwijst naar een ongeldig doel";
+ Text[ chinese_simplified ] = "Á´½ÓÖ¸ÏòÒ»¸öÎÞЧµÄÄ¿±ê";
+ Text[ greek ] = "Ç óýíäåóç áíáöÝñåôáé óå Ýíáí ìç Ýãêõñï ðñïïñéóìü";
+ Text[ korean ] = "¿¬°áÀÌ À¯È¿ÇÏÁö ¾ÊÀº Ÿ°ÙÀ» ÁöÁ¤ÇÏ°í ÀÖÀ½";
+ Text[ turkish ] = "Baðlantý geçersiz bir hedef gösteriyor";
+ };
+ String ERRCODE_SFX_INVALIDTRASHPATH
+ {
+ Text = "Der Pfad für den Papierkorb ist ungültig" ;
+ Text [ English ] = "The path of the trash is invalid" ;
+ Text [ portuguese ] = "O atalho para Reciclagem não é válido" ;
+ Text [ english_us ] = "The Recycle Bin path is invalid" ;
+ Text [ portuguese_brazilian ] = "Der Pfad für den Papierkorb ist ungültig" ;
+ Text [ swedish ] = "Sökvägen till papperskorgen är ogiltig" ;
+ Text [ danish ] = "Stien til papirkurven er ugyldig" ;
+ Text [ italian ] = "Il percorso per il cestino non è valido" ;
+ Text [ spanish ] = "La ruta para la papelera no es válida." ;
+ Text [ french ] = "Le chemin spécifié pour la corbeille est incorrect" ;
+ Text [ dutch ] = "Het pad naar de prullenbak is ongeldig" ;
+ Text[ chinese_simplified ] = "»ØÊÕվ·¾¶ÎÞЧ";
+ Text[ russian ] = "Íåïðàâèëüíûé ïóòü äëÿ êîðçèíû";
+ Text[ polish ] = "Œcie¿ka dla kosza jest nieprawid³owa.";
+ Text[ japanese ] = "‚²‚Ý” ‚ÌÊß½‚ª–³Œø‚Å‚·";
+ Text[ chinese_traditional ] = "¸ê·½¦^¦¬µ©ªº¸ô®|µL®Ä";
+ Text[ arabic ] = "ãÓÇÑ ÓáÉ ÇáãÍÐæÝÇÊ ÛíÑ ÕÇáÍ";
+ Text[ dutch ] = "Het pad naar de prullenbak is ongeldig";
+ Text[ chinese_simplified ] = "»ØÊÕվ·¾¶ÎÞЧ";
+ Text[ greek ] = "Ç äéáäñïìÞ ôïõ êÜäïõ áíáêýêëùóçò äåí åßíáé Ýãêõñç";
+ Text[ korean ] = "ÈÞÁöÅë °æ·Î°¡ À¯È¿ÇÏÁö ¾ÊÀ½";
+ Text[ turkish ] = "Çöp kutusu veri yolu geçerli deðil";
+ };
+ String ERRCODE_SFX_NOTRESTORABLE
+ {
+ Text = "Der Eintrag konnte nicht wiederhergestellt werden" ;
+ Text [ English ] = "The entry could not be restored" ;
+ Text [ portuguese ] = "Foi impossível restaurar a entrada." ;
+ Text [ english_us ] = "The entry could not be restored" ;
+ Text [ portuguese_brazilian ] = "Der Eintrag konnte nicht wiederhergestellt werden" ;
+ Text [ swedish ] = "Posten kunde inte återställas" ;
+ Text [ danish ] = "Det var ikke muligt at gendanne elementet" ;
+ Text [ italian ] = "Non è stato possibile ripristinare la voce" ;
+ Text [ spanish ] = "No se pudo restaurar la entrada." ;
+ Text [ french ] = "Impossible de restaurer l'entrée" ;
+ Text [ dutch ] = "Het item kon niet worden hersteld" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨ÐÞ¸´Õâ¸öÌõÄ¿";
+ Text[ russian ] = "Âîññòàíîâèòü çàïèñü íåâîçìîæíî";
+ Text[ polish ] = "Wpis nie móg³ zostaæ przywrócony";
+ Text[ japanese ] = "€–Ú‚Í•œŒ³‚Å‚«‚Ü‚¹‚ñ‚Å‚µ‚½";
+ Text[ chinese_traditional ] = "µLªk­×´_³o­Ó¶µ¥Ø";
+ Text[ arabic ] = "ÊÚÐÑÊ ÚãáíÉ ÇÓÊÚÇÏÉ ÇáÅÏÎÇá";
+ Text[ dutch ] = "Het item kon niet worden hersteld";
+ Text[ chinese_simplified ] = "ÎÞ·¨ÐÞ¸´Õâ¸öÌõÄ¿";
+ Text[ greek ] = "Äåí Þôáí äõíáôüí íá ãßíåé åðáíáöïñÜ ôçò åããñáöÞò";
+ Text[ korean ] = "Ç׸ñÀ» º¹±¸ÇÒ ¼ö ¾øÀ½";
+ Text[ turkish ] = "Giriþ geri yüklenemedi";
+ };
+ String ERRCODE_IO_NAMETOOLONG
+ {
+ Text = "Der Dateiname ist für das Ziel-Dateisystem zu lang." ;
+ Text [ ENGLISH ] = "Filename too long for target filesystem." ;
+ Text [ portuguese ] = "O nome do ficheiro é demasiado extenso para o sistema de ficheiros pretendido." ;
+ Text [ english_us ] = "The file name is too long for the target file system." ;
+ Text [ portuguese_brazilian ] = "Der Dateiname ist für das Ziel-Dateisystem zu lang." ;
+ Text [ swedish ] = "Filnamnet är för långt för mål-filsystemet." ;
+ Text [ danish ] = "Filnavnet er for langt til mål-filsystemet." ;
+ Text [ italian ] = "Il nome del file è troppo lungo per il file system di destinazione." ;
+ Text [ spanish ] = "El nombre del archivo es demasiado largo para el sistema de archivos destino." ;
+ Text [ french ] = "Le nom de fichier est trop long pour le système de fichiers cible." ;
+ Text [ dutch ] = "Bestandsnaam te lang voor het doel-bestandssysteem." ;
+ Text[ chinese_simplified ] = "Õâ¸öÎļþÃûµÄ³¤¶È²»ÊÊÓÚÄ¿±êÎļþϵͳ¡£";
+ Text[ russian ] = "Ñëèøêîì äëèííîå èìÿ ôàéëà äëÿ öåëåâîé ñèñòåìû ôàéëà.";
+ Text[ polish ] = "Nazwa pliku jest za d³uga dla docelowego systemu plików.";
+ Text[ japanese ] = "À°¹Þ¯Ä‚Ì̧²Ù ¼½ÃÑ‚Ì̧²Ù–¼‚ª’·‚·‚¬‚Ü‚·";
+ Text[ chinese_traditional ] = "³o­ÓÀɮצWªºªø«×¤£¾A¥Î©ó¥Ø¼ÐÀɮרt²Î¡C";
+ Text[ arabic ] = "ÇÓã ÇáãáÝ Øæíá ÌÏÇð ÈÇáäÓÈÉ áäÙÇã ÇáãáÝÇÊ ÇáåÏÝ.";
+ Text[ dutch ] = "Bestandsnaam te lang voor het doel-bestandssysteem.";
+ Text[ chinese_simplified ] = "Õâ¸öÎļþÃûµÄ³¤¶È²»ÊÊÓÚÄ¿±êÎļþϵͳ¡£";
+ Text[ greek ] = "Ôï üíïìá åßíáé õðåñâïëéêÜ ìåãÜëï ãéá ôï óýóôçìá ðñïÝëåõóçò áñ÷åßùí.";
+ Text[ korean ] = "ÆÄÀϸíÀÌ ´ë»ó ÆÄÀÏ ½Ã½ºÅÛ¿¡ ³Ê¹« ±é´Ï´Ù.";
+ Text[ turkish ] = "Dosya adý, hedef dosya sistemi için fazla uzun.";
+ };
+ String ERRCODE_SFX_CONSULTUSER
+ {
+ Text = "Die Angaben zum Ausführen der Funktion sind unvollständig." ;
+ Text [ ENGLISH ] = "Can't execute function due to incomplete arguments." ;
+ Text [ english_us ] = "The details for running the function are incomplete." ;
+ Text [ portuguese ] = "Os dados para a execução da função estão incompletos." ;
+ Text [ portuguese_brazilian ] = "Zum Angaben zum Ausführen der Funktion sind unvollständig." ;
+ Text [ swedish ] = "Funktionen kan inte utföras på grund av ofullständiga uppgifter." ;
+ Text [ danish ] = "Angivelserne til udførelse af funktionen er ufuldstændige." ;
+ Text [ italian ] = "I dati sono insufficienti per l'esecuzione della funzione." ;
+ Text [ spanish ] = "La función no se puede ejecutar por falta de argumentos." ;
+ Text [ french ] = "Les données indiquées pour l'exécution de la fonction sont incomplètes." ;
+ Text [ dutch ] = "De gegevens voor het uitvoeren van de functie zijn niet compleet.." ;
+ Text[ chinese_simplified ] = "Ö´Ðй¦ÄܵÄÃüÁî²»ÍêÕû¡£";
+ Text[ russian ] = "Äàííûå äëÿ âûïîëíåíèÿ ýòîé ôóíêöèè ÿâëÿþòñÿ íåïîëíûìè.";
+ Text[ polish ] = "Dane do wykonania funkcji s¹ nie kompletne.";
+ Text[ japanese ] = "‹@”\\‚ðŽÀs‚³‚¹‚邽‚ß‚ÌŽwŽ¦‚ª–¢Š®—¹‚Å‚·B";
+ Text[ chinese_traditional ] = "«ü©w°õ¦æ¥\\¯àªº«ü¥O¤£§¹¾ã¡C";
+ Text[ arabic ] = "ÇáÈíÇäÇÊ ÇááÇÒãÉ áÊäÝíÐ ÇáãåãÉ ÛíÑ ãßÊãáÉ.";
+ Text[ dutch ] = "De gegevens voor het uitvoeren van de functie zijn niet compleet..";
+ Text[ chinese_simplified ] = "Ö´Ðй¦ÄܵÄÃüÁî²»ÍêÕû¡£";
+ Text[ greek ] = "Ôá äåäïìÝíá ãéá ôçí åêôÝëåóç ôçò ëåéôïõñãßáò äåí åßíáé ïëïêëçñùìÝíá.";
+ Text[ korean ] = "±â´É ½ÇÇàÀ» À§ÇÑ ÁöÁ¤»çÇ×ÀÌ ºÒ¿ÏÀüÇÕ´Ï´Ù.";
+ Text[ turkish ] = "Ýþlemin yürütülmesi için gereken bilgiler tam deðil.";
+ };
+ String ERRCODE_SFX_INVALIDSYNTAX
+ {
+ Text = "Die Syntax der Eingabe ist ungültig." ;
+ Text [ English ] = "The syntax of the input is invalid." ;
+ Text [ portuguese ] = "A sintaxe da entrada está incorrecta." ;
+ Text [ english_us ] = "The input syntax is invalid." ;
+ Text [ portuguese_brazilian ] = "Die Syntax der Eingabe ist ungültig." ;
+ Text [ swedish ] = "Inmatningens syntax är ogiltig." ;
+ Text [ danish ] = "Inputsyntaksen er ugyldig." ;
+ Text [ italian ] = "La sintassi della digitazione è errata." ;
+ Text [ spanish ] = "La sintaxis de la entrada no es válida" ;
+ Text [ french ] = "La syntaxe de la saisie est incorrecte." ;
+ Text [ dutch ] = "Onjuiste schrijfwijze." ;
+ Text[ chinese_simplified ] = "ÊäÈëµÄÓï·¨ÎÞЧ¡£";
+ Text[ russian ] = "Íåïðàâèëüíûé ñèíòàêñèñ ââîäà";
+ Text[ polish ] = "Sk³adnia wpisu jest niepoprawna.";
+ Text[ japanese ] = "‚±‚Ì“ü—̼͂ÝÀ¯¸½‚Í–³Œø‚Å‚·B";
+ Text[ chinese_traditional ] = "¿é¤J¤º®e»yªkµL®Ä¡C";
+ Text[ arabic ] = "ÈäÇÁ ÌãáÉ ÇáÅÏÎÇá ÛíÑ ÕÇáÍ.";
+ Text[ dutch ] = "Onjuiste schrijfwijze.";
+ Text[ chinese_simplified ] = "ÊäÈëµÄÓï·¨ÎÞЧ¡£";
+ Text[ greek ] = "ËáíèáóìÝíç óýíôáîç åéóáãùãÞò.";
+ Text[ korean ] = "ÀÔ·Â ±¸¹®ÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Giriþ söz dizimi geçerli deðil.";
+ };
+ String ERRCODE_SFX_CANTCREATEFOLDER
+ {
+ Text = "Die Syntax der Eingabe ist falsch." ;
+ Text [ English ] = "The syntax of the input is invalid." ;
+ Text [ portuguese ] = "A sintaxe da entrada está incorrecta." ;
+ Text [ english_us ] = "The input syntax is invalid." ;
+ Text [ portuguese_brazilian ] = "Die Syntax der Eingabe ist falsch." ;
+ Text [ swedish ] = "Inmatningens syntax är felaktig." ;
+ Text [ danish ] = "Inputsyntaksen er forkert" ;
+ Text [ italian ] = "La sintassi della digitazione è errata." ;
+ Text [ spanish ] = "La sintaxis de la entrada es incorrecta." ;
+ Text [ french ] = "La syntaxe de la saisie est incorrecte." ;
+ Text [ dutch ] = "Onjuiste schrijfwijze." ;
+ Text[ chinese_simplified ] = "ÊäÈëµÄÓï·¨´íÎó¡£";
+ Text[ russian ] = "Íåïðàâèëüíûé ñèíòàêñèñ ââîäà.";
+ Text[ polish ] = "Sk³adnia wpisu jest niepoprawna.";
+ Text[ japanese ] = "€–ڂ̼ÝÀ¯¸½‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñB";
+ Text[ chinese_traditional ] = "¿é¤J¤º®e»yªk¿ù»~¡C";
+ Text[ arabic ] = "ÈäÇÁ ÌãáÉ ÇáÅÏÎÇá ÛíÑ ÕÍíÍ.";
+ Text[ dutch ] = "Onjuiste schrijfwijze.";
+ Text[ chinese_simplified ] = "ÊäÈëµÄÓï·¨´íÎó¡£";
+ Text[ greek ] = "ËáíèáóìÝíç óýíôáîç åéóáãùãÞò.";
+ Text[ korean ] = "ÀÔ·Â ±¸¹®ÀÌ Æ²¸³´Ï´Ù.";
+ Text[ turkish ] = "Giriþ söz dizimi yanlýþ.";
+ };
+ String ERRCODE_SFX_CANTRENAMEFOLDER
+ {
+ Text = "Die Syntax der Eingabe ist falsch." ;
+ Text [ English ] = "The syntax of the input is invalid." ;
+ Text [ portuguese ] = "A sintaxe da entrada está incorrecta." ;
+ Text [ english_us ] = "The input syntax is invalid." ;
+ Text [ portuguese_brazilian ] = "Die Syntax der Eingabe ist falsch." ;
+ Text [ swedish ] = "Inmatningens syntax är felaktig." ;
+ Text [ danish ] = "Inputsyntaksen er forkert." ;
+ Text [ italian ] = "La sintassi della digitazione è errata." ;
+ Text [ spanish ] = "La sintaxis de entrada es incorrecta." ;
+ Text [ french ] = "La syntaxe de la saisie est incorrecte." ;
+ Text [ dutch ] = "Onjuiste schrijfwijze." ;
+ Text[ chinese_simplified ] = "ÊäÈëµÄÓï·¨´íÎó¡£";
+ Text[ russian ] = "Íåïðàâèëüíûé ñèíòàêñèñ ââîäà.";
+ Text[ polish ] = "Sk³adnia wpisu jest niepoprawna.";
+ Text[ japanese ] = "€–ڂ̼ÝÀ¯¸½‚ª³‚µ‚­‚ ‚è‚Ü‚¹‚ñB";
+ Text[ chinese_traditional ] = "¿é¤Jªº»yªk¿ù»~¡C";
+ Text[ arabic ] = "ÈäÇÁ ÌãáÉ ÇáÅÏÎÇá ÛíÑ ÕÍíÍ.";
+ Text[ dutch ] = "Onjuiste schrijfwijze.";
+ Text[ chinese_simplified ] = "ÊäÈëµÄÓï·¨´íÎó¡£";
+ Text[ greek ] = "ËáíèáóìÝíç óýíôáîç åéóáãùãÞò.";
+ Text[ korean ] = "ÀÔ·Â ±¸¹®ÀÌ Æ²¸³´Ï´Ù.";
+ Text[ turkish ] = "Giriþ söz dizimi yanlýþ.";
+ Text[ language_user1 ] = " ";
+ };
+ String ERRCODE_SFX_WRONG_CDF_FORMAT
+ {
+ Text = "Das Channeldokument hat kein gültiges Format." ;
+ Text [ ENGLISH ] = "Das Channeldokument hat kein gültiges Format." ;
+ Text [ portuguese ] = "O formato do documento do canal não é válido." ;
+ Text [ english_us ] = "The channel document has an invalid format." ;
+ Text [ portuguese_brazilian ] = "Das Channeldokument hat kein gültiges Format." ;
+ Text [ swedish ] = "Channeldokumentet har inget giltigt format." ;
+ Text [ danish ] = "Channel-dokumentet har ikke et gyldigt format." ;
+ Text [ italian ] = "Il documento di canale non ha un formato valido." ;
+ Text [ spanish ] = "El formato del documento del canal no es válido." ;
+ Text [ french ] = "Le format du document Channel est incorrect." ;
+ Text [ dutch ] = "Het channel-document heeft een ongeldig formaat." ;
+ Text[ chinese_simplified ] = "ƵµÀÎĵµµÄ¸ñʽÎÞЧ¡£";
+ Text[ russian ] = "Íåïðàâèëüíûé ôîðìàò äîêóìåíòà êàíàëà.";
+ Text[ polish ] = "Dokument kana³u nie posiada prawid³owego formatu.";
+ Text[ japanese ] = "Á¬ÝÈÙ ÄÞ·­ÒÝÄ‚Ì‘Ž®‚Í–³Œø‚Å‚·B";
+ Text[ chinese_traditional ] = "ÀW¹D¤å¥ó®æ¦¡µL®Ä";
+ Text[ arabic ] = "ÊäÓíÞ ãÓÊäÏ ÇáÞäÇÉ ÛíÑ ÕÇáÍ.";
+ Text[ dutch ] = "Het channel-document heeft een ongeldig formaat.";
+ Text[ chinese_simplified ] = "ƵµÀÎĵµµÄ¸ñʽÎÞЧ¡£";
+ Text[ greek ] = "Ç ìïñöÞ ôïõ åããñÜöïõ êáíáëéïý äåí åßíáé Ýãêõñç.";
+ Text[ korean ] = "ä³Î ¹®¼­ÀÇ ¼­½ÄÀÌ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Kanal belgesinin formatý geçersiz.";
+ };
+ String ERRCODE_SFX_EMPTY_SERVER
+ {
+ Text = "Der Server darf nicht leer sein" ;
+ Text [ English ] = "The server may not be empty" ;
+ Text [ portuguese ] = "O servidor não pode estar vazio." ;
+ Text [ english_us ] = "The server must not be empty" ;
+ Text [ portuguese_brazilian ] = "Der Server darf nicht leer sein" ;
+ Text [ swedish ] = "Servern får ej vara tom" ;
+ Text [ danish ] = "Serveren må ikke være tom" ;
+ Text [ italian ] = "Il server non può essere vuoto" ;
+ Text [ spanish ] = "El servidor no debe estar vacío." ;
+ Text [ french ] = "Le serveur ne doit pas être vide" ;
+ Text [ dutch ] = "De server mag niet leeg zijn." ;
+ Text[ chinese_simplified ] = "·þÎñÆ÷²»¿ÉÒÔ¿Õȱ";
+ Text[ russian ] = "Ñåðâåð íå äîëæåí áûòü ïóñòûì";
+ Text[ polish ] = "Serwer nie mo¿e byæ pusty";
+ Text[ japanese ] = "»°ÊÞ°‚Í‹ó”’‚Å‚Í‚¢‚¯‚Ü‚¹‚ñ";
+ Text[ chinese_traditional ] = "¦øªA¾¹¤£¥i¥HªÅ¯Ê";
+ Text[ arabic ] = "íÌÈ ÃáÇ íßæä ÇáãÒæøÏ ÝÇÑÛÇð";
+ Text[ dutch ] = "De server mag niet leeg zijn.";
+ Text[ chinese_simplified ] = "·þÎñÆ÷²»¿ÉÒÔ¿Õȱ";
+ Text[ greek ] = "Ï äéáêïìéóôÞò äåí åðéôñÝðåôáé íá åßíáé êåíüò";
+ Text[ korean ] = "¼­¹ö°¡ ºñ¾î¼­´Â ¾ÈµÊ";
+ Text[ turkish ] = "Sunucu boþ olmamalýdýr";
+ };
+ String ERRCODE_SFX_NO_ABOBOX
+ {
+ Text = "Sie benötigen einen Abonnements Ordner, wenn Sie einen Channel installieren wollen." ;
+ Text [ english_us ] = "A subscription folder is required to install a Channel." ;
+ Text [ italian ] = "È necessaria una cartella di sottoscrizione se volete installare un channel.";
+ Text [ portuguese_brazilian ] = "Sie benötigen einen Abonnements Ordner, wenn Sie einen Channel installieren wollen.";
+ Text [ portuguese ] = "Para poder instalar um Channel, necessita de uma pasta para subscrições.";
+ Text [ danish ] = "Du har brug for en abonnement-mappe, hvis du vil installere en channel.";
+ Text [ french ] = "Vous avez besoin d'un dossier d'abonnements pour installer un Channel.";
+ Text [ swedish ] = "Du behöver en prenumerationsmapp om Du vill installera en channel.";
+ Text [ dutch ] = "Om een channel te installeren heeft u een abonnementenmap nodig.";
+ Text [ spanish ] = "Para instalar un canal necesita una carpeta de suscripciones.";
+ Text[ chinese_simplified ] = "Èç¹ûÒª°²×°ÆµµÀ£¬Äú¾ÍÐèÒªÏÈ´´½¨Ò»¸ö¶©ÔÄÎļþ¼Ð¡£";
+ Text[ russian ] = "Äëÿ èíñòàëëÿöèè Channel íåîáõîäèìà ïàïêà ïîäïèñêè.";
+ Text[ polish ] = "Instalacja kana³u wymaga utworzenia folderu subkrypcji.";
+ Text[ japanese ] = "Á¬ÝÈÙ‚ð²Ý½Ä°Ù‚·‚éꇂÍw“ÇÌ«ÙÀÞ‚ª•K—v‚Å‚·B";
+ Text[ chinese_traditional ] = "¦pªG­n¦w¸ËÀW¹D¡M±z´N»Ý­n«Ø¥ß¤@­Ó­q¾\\¸ê®Æ§¨";
+ Text[ arabic ] = "áßí ÊÊãßä ãä ÊËÈíÊ ÞäÇÉ ÃäÊ ÈÍÇÌÉ Åáì ãÌáÏ ÇÔÊÑÇßÇÊ.";
+ Text[ dutch ] = "Om een channel te installeren heeft u een abonnementenmap nodig.";
+ Text[ chinese_simplified ] = "Èç¹ûÒª°²×°ÆµµÀ£¬Äú¾ÍÐèÒªÏÈ´´½¨Ò»¸ö¶©ÔÄÎļþ¼Ð¡£";
+ Text[ greek ] = "Ãéá íá ãßíåé åãêáôÜóôáóç åíüò êáíáëéïý áðáéôåßôáé Ýíáò öÜêåëïò óõíäñïìþí.";
+ Text[ korean ] = "ä³ÎÀ» ¼³Ä¡ÇÏ·Á¸é ¾Ë¸²½Åû Æú´õ°¡ ÇÊ¿äÇÕ´Ï´Ù.";
+ Text[ turkish ] = "Kanal kurmak için bir üyelik klasörünüz olmalý.";
+ };
+#ifdef ERRCODE_IO_INVALIDLENGTH
+ String ERRCODE_IO_INVALIDLENGTH
+ {
+ Text = "Ungültige Datenlänge." ;
+ Text [ english ] = "Invalid data length." ;
+ Text [ portuguese ] = "Extensão de dados incorrecta." ;
+ Text [ english_us ] = "Invalid data length." ;
+ Text [ portuguese_brazilian ] = "Ungültige Datenlänge." ;
+ Text [ swedish ] = "Ogiltig datalängd." ;
+ Text [ danish ] = "Ugyldig datalængde." ;
+ Text [ italian ] = "Lunghezza dati non valida." ;
+ Text [ spanish ] = "Longitud de datos no válida." ;
+ Text [ french ] = "Longueur des données incorrecte." ;
+ Text [ dutch ] = "Onjuiste gegevenslengte" ;
+ Text[ chinese_simplified ] = "ÎÞЧµÄÊý¾Ý³¤¶È¡£";
+ Text[ russian ] = "Íåïðàâèëüíàÿ äëèíà äàííûõ.";
+ Text[ polish ] = "Nieprawid³owa d³ugoœæ danych.";
+ Text[ japanese ] = "–³Œø‚ÈÃÞ°À‚Ì’·‚³B";
+ Text[ chinese_traditional ] = "¸ê®Æªø«×µL®Ä¡C";
+ Text[ arabic ] = "Øæá ÇáÈíÇäÇÊ ÛíÑ ÕÇáÍ.";
+ Text[ dutch ] = "Onjuiste gegevenslengte";
+ Text[ chinese_simplified ] = "ÎÞЧµÄÊý¾Ý³¤¶È¡£";
+ Text[ greek ] = "Ìç Ýãêõñï ìÞêïò äåäïìÝíùí.";
+ Text[ korean ] = "µ¥ÀÌÅÍ ±æÀÌ°¡ À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù.";
+ Text[ turkish ] = "Geçersiz veri uzunluðu.";
+ };
+ String ERRCODE_IO_CURRENTDIR
+ {
+ Text = "Funktion unmöglich: Pfad enthält aktuelles Verzeichnis" ;
+ Text [ english ] = "Funcion impossible: path contains current directory." ;
+ Text [ portuguese ] = "Função impossível: o atalho contém o directório activo." ;
+ Text [ english_us ] = "Function not possible: path contains current directory." ;
+ Text [ portuguese_brazilian ] = "Funktion unmöglich: Pfad enthält aktuelles Verzeichnis" ;
+ Text [ swedish ] = "Funktion omöjlig: Sökväg innehåller aktuell katalog" ;
+ Text [ danish ] = "Funktion ikke mulig: stien indeholder aktuelt bibliotek" ;
+ Text [ italian ] = "Funzione impossibile: il percorso contiene la cartella corrente" ;
+ Text [ spanish ] = "Función imposible: La ruta contiene el directorio actual." ;
+ Text [ french ] = "Impossible d'exécuter la fonction : le chemin indiqué inclut le répertoire actif" ;
+ Text [ dutch ] = "Functie niet mogelijk. Pad bevat actuele directory" ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´Ðй¦ÄÜ£ºÂ·¾¶º¬Óе±Ç°µÄĿ¼";
+ Text[ russian ] = "Íåâîçìîæíàÿ ôóíêöèÿ: ïóòü ñîäåðæèò òåêóùèé êàòàëîã";
+ Text[ polish ] = "Funkcja niemo¿liwa:Œcie¿ka zawiera aktualny katalog";
+ Text[ japanese ] = "‹@”\\•s‰Â”\\FÊß½‚ªŒ»Ý‚ÌÃÞ¨Ú¸ÄØ‚ðŠÜ‚ñ‚Å‚¢‚Ü‚·";
+ Text[ chinese_traditional ] = "µLªk°õ¦æ¥\\¯à¡G¸ô®|§t¦³·í«eªº¥Ø¿ý";
+ Text[ arabic ] = "åÐå ÇáãåãÉ ÛíÑ ããßäÉ: íÍÊæí ÇáãÓÇÑ Úáì ÇáÏáíá ÇáÍÇáí.";
+ Text[ dutch ] = "Functie niet mogelijk. Pad bevat actuele directory";
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´Ðй¦ÄÜ£ºÂ·¾¶º¬Óе±Ç°µÄĿ¼";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá åêôåëåóôåß ç ëåéôïõñãßá: Ç äéáäñïìÞ ðåñéÝ÷åé ôïí ôñÝ÷ùí êáôÜëïãï";
+ Text[ korean ] = "±â´É ºÒ°¡´É: °æ·Î°¡ ÇöÀç µð·ºÅ丮 Æ÷ÇÔ";
+ Text[ turkish ] = "Ýþlev olanaklý deðil: Veri yolu yürürlükteki dizini içeriyor";
+ };
+ String ERRCODE_IO_NOTSAMEDEVICE
+ {
+ Text = "Funktion unmöglich: Nicht dasselbe Gerät (Laufwerk)." ;
+ Text [ english ] = "Function impossible: not same device (drive)." ;
+ Text [ portuguese ] = "Função impossível: periférico não é o mesmo (unidade)." ;
+ Text [ english_us ] = "Function not possible: device (drive) not identical." ;
+ Text [ portuguese_brazilian ] = "Funktion unmöglich: Nicht dasselbe Gerät (Laufwerk)." ;
+ Text [ swedish ] = "Funktion omöjlig: Inte samma apparat (enhet)." ;
+ Text [ danish ] = "Funktion ikke mulig: ikke samme enhed (drev)." ;
+ Text [ italian ] = "Funzione impossibile: apparecchio (drive) diverso." ;
+ Text [ spanish ] = "Función imposible: No es el mismo dispositivo (unidad)." ;
+ Text [ french ] = "Impossible d'exécuter la fonction : il ne s'agit pas du même volume." ;
+ Text [ dutch ] = "Functie niet mogelijk: niet hetzelfde apparaat (station)." ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´Ðй¦ÄÜ£º²»ÊÇͬһ¸öÉ豸(Çý¶¯ÅÌ)¡£";
+ Text[ russian ] = "Íåâîçìîæíàÿ ôóíêöèÿ: äðóãîå óñòðîéñòâî (äèñê).";
+ Text[ polish ] = "Funkcja niemo¿liwa: nie to samo urz¹dzenie (napêd).";
+ Text[ japanese ] = "‹@”\\•s‰Â”\\F“¯‚¶ÃÞ¨ÊÞ²½(ÄÞײÌÞ)‚Å‚Í‚ ‚è‚Ü‚¹‚ñ¡";
+ Text[ chinese_traditional ] = "µLªk°õ¦æ¥\\¯à¡G¤£¬O¦P¤@­Ó³]³Æ(ÅX°Ê½L)¡C";
+ Text[ arabic ] = "åÐå ÇáãåãÉ ÛíÑ ããßäÉ: ÇáÌåÇÒ (ãÍÑß ÇáÃÞÑÇÕ( ÛíÑ ããÇËá.";
+ Text[ dutch ] = "Functie niet mogelijk: niet hetzelfde apparaat (station).";
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´Ðй¦ÄÜ£º²»ÊÇͬһ¸öÉ豸(Çý¶¯ÅÌ)¡£";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá åêôåëåóôåß ç ëåéôïõñãßá: Ç óõóêåõÞ äåí åßíáé ç ßäéá (äßóêïò).";
+ Text[ korean ] = "±â´É ºÒ°¡´É: ÀåÄ¡(µå¶óÀ̺ê)°¡ µ¿ÀÏÇÏÁö ¾ÊÀ½.";
+ Text[ turkish ] = "Ýþlev olanaklý deðil: Chiza (sürücü) ayný deðil.";
+ };
+ String ERRCODE_IO_DEVICENOTREADY
+ {
+ Text = "Gerät (Laufwerk) nicht bereit." ;
+ Text [ english ] = "Device (drive) not ready." ;
+ Text [ portuguese ] = "Periférico (unidade) não está pronto." ;
+ Text [ english_us ] = "Device (drive) not ready." ;
+ Text [ portuguese_brazilian ] = "Gerät (Laufwerk) nicht bereit." ;
+ Text [ swedish ] = "Apparat (enhet) ej redo." ;
+ Text [ danish ] = "Enheden (drevet) er ikke klar." ;
+ Text [ italian ] = "Apparecchio (drive) non pronto." ;
+ Text [ spanish ] = "Dispositivo (unidad) no listo." ;
+ Text [ french ] = "Le périphérique (lecteur) n'est pas prêt." ;
+ Text [ dutch ] = "Apparaat (station) niet gereed." ;
+ Text[ chinese_simplified ] = "É豸(Çý¶¯ÅÌ)»¹Ã»ÓÐ×¼±¸¾ÍÐ÷¡£";
+ Text[ russian ] = "Óñòðîéñòâî (äèñê) íå ãîòîâî.";
+ Text[ polish ] = "Urz¹dzenie (napêd) nie gotowe.";
+ Text[ japanese ] = "ÃÞ¨ÊÞ²½(ÄÞײÌÞ)‚Ì€”õ‚ª‚Å‚«‚Ä‚¢‚Ü‚¹‚ñB";
+ Text[ chinese_traditional ] = "³]³Æ(ÅX°Ê½L)ÁÙ¨S¦³·Ç³Æ´Nºü";
+ Text[ arabic ] = "ÇáÌåÇÒ (ãÍÑß ÇáÃÞÑÇÕ) ÛíÑ ÌÇåÒ.";
+ Text[ dutch ] = "Apparaat (station) niet gereed.";
+ Text[ chinese_simplified ] = "É豸(Çý¶¯ÅÌ)»¹Ã»ÓÐ×¼±¸¾ÍÐ÷¡£";
+ Text[ greek ] = "Ç óõóêåõÞ (ìïíÜäá äßóêïõ) äåí åßíáé Ýôïéìç.";
+ Text[ korean ] = "ÀåÄ¡(µå¶óÀ̺ê)°¡ ÁغñµÇ¾î ÀÖÁö ¾ÊÀ½.";
+ Text[ turkish ] = "Cihaz (sürücü) hazýr deðil.";
+ };
+ String ERRCODE_IO_BADCRC
+ {
+ Text = "Falsche Prüfsumme." ;
+ Text [ english ] = "Bad checksum" ;
+ Text [ portuguese ] = "Soma de revisão errada." ;
+ Text [ english_us ] = "Wrong check amount." ;
+ Text [ portuguese_brazilian ] = "Falsche Prüfsumme." ;
+ Text [ swedish ] = "Fel kontrollsumma." ;
+ Text [ danish ] = "Forkert kontrolsum" ;
+ Text [ italian ] = "Somma da esaminare errata." ;
+ Text [ spanish ] = "Suma errónea de revisión." ;
+ Text [ french ] = "Somme de révision erronée." ;
+ Text [ dutch ] = "Controlegetal niet juist." ;
+ Text[ chinese_simplified ] = "´íÎóµÄ¼ì²éÊýÄ¿¡£";
+ Text[ russian ] = "Íåïðàâèëüíàÿ êîíòðîëüíàÿ ñóììà.";
+ Text[ polish ] = "Nieprawid³owa suma kontrolna.";
+ Text[ japanese ] = "³‚µ‚­‚È‚¢Áª¯¸»Ñ¡";
+ Text[ chinese_traditional ] = "Àˬd¼Æ¥Ø¦³»~";
+ Text[ arabic ] = "ãÌãæÚ ÇÎÊÈÇÑí ÎÇØÆ";
+ Text[ dutch ] = "Controlegetal niet juist.";
+ Text[ chinese_simplified ] = "´íÎóµÄ¼ì²éÊýÄ¿¡£";
+ Text[ greek ] = "ËÜèïò óýíïëï åëÝã÷ïõ";
+ Text[ korean ] = "üũ ÇÕ°è°¡ Ʋ¸³´Ï´Ù.";
+ Text[ turkish ] = "Yanlýþ saðlama toplamý.";
+ };
+ String ERRCODE_IO_WRITEPROTECTED
+ {
+ Text = "Funktion unmöglich: Schreibgeschützt." ;
+ Text [ english ] = "Function impossible: write protected." ;
+ Text [ portuguese ] = "Função impossível: só de leitura." ;
+ Text [ english_us ] = "Function not possible: write protected." ;
+ Text [ portuguese_brazilian ] = "Funktion unmöglich: Schreibgeschützt." ;
+ Text [ swedish ] = "Funktion omöjlig: Skrivskyddad." ;
+ Text [ danish ] = "Funktion ikke mulig: skrivebeskyttet" ;
+ Text [ italian ] = "Funzione impossibile: solo lettura." ;
+ Text [ spanish ] = "Función imposible: Solo lectura." ;
+ Text [ french ] = "Impossible d'exécuter la fonction : en lecture-seule" ;
+ Text [ dutch ] = "Functie niet mogelijk: schrijfbeveiligd." ;
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´Ðй¦ÄÜ£º·À¸²Ð´¡£";
+ Text[ russian ] = "Íåâîçìîæíàÿ ôóíêöèÿ: óñòàíîâëåíà çàùèòà îò çàïèñè.";
+ Text[ polish ] = "Wykonanie funkcji niemo¿liwe: Tylko do odczytu.";
+ Text[ japanese ] = "‹@”\\•s‰Â”\\F‘‚«ž‚Ý•ÛŒìB";
+ Text[ chinese_traditional ] = "µLªk°õ¦æ¥\\¯à¡G¨¾Âмg";
+ Text[ arabic ] = "åÐå ÇáãåãÉ ÛíÑ ããßäÉ: ãÍãí ÖÏ ÇáßÊÇÈÉ.";
+ Text[ dutch ] = "Functie niet mogelijk: schrijfbeveiligd.";
+ Text[ chinese_simplified ] = "ÎÞ·¨Ö´Ðй¦ÄÜ£º·À¸²Ð´¡£";
+ Text[ greek ] = "Äåí åßíáé äõíáôüí íá åêôåëåóôåß ç ëåéôïõñãßá: Ìüíï ãéá áíÜãíùóç";
+ Text[ korean ] = "±â´É ºÒ°¡´É: ¾²±â º¸È£µÊ.";
+ Text[ turkish ] = "Ýþlev olanaklý deðil: Yazma korumalý.";
+ };
+#endif
+};
+
+// eof ------------------------------------------------------------------------
+
diff --git a/svtools/source/misc/makefile.mk b/svtools/source/misc/makefile.mk
new file mode 100644
index 000000000000..c1f3e9c65ef3
--- /dev/null
+++ b/svtools/source/misc/makefile.mk
@@ -0,0 +1,160 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:02 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME= svtools
+TARGET= misc
+LIBTARGET= NO
+USE_LDUMP2= TRUE
+USE_DEFFILE= TRUE
+ENABLE_EXCEPTIONS= TRUE
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+.IF "$(GUI)"=="MAC"
+CFLAGS += -nomapcr
+.ENDIF
+
+# --- Files --------------------------------------------------------
+
+SRS1NAME=misc
+SRC1FILES=\
+ config.src \
+ demo.src \
+ pver.src \
+ iniman.src \
+ ehdl.src
+
+SRS2NAME=ehdl
+SRC2FILES=\
+ errtxt.src
+
+SRS3NAME=mediatyp
+SRC3FILES=\
+ mediatyp.src
+
+SLOFILES=\
+ $(LIB2OBJFILES) \
+ $(LIB3OBJFILES) \
+ $(SLO)$/svtdata.obj
+
+OBJFILES=\
+ $(OBJ)$/filearch.obj \
+ $(OBJ)$/svtdata.obj
+
+LIB2TARGET=$(SLB)$/misc1.lib
+LIB2OBJFILES=\
+ $(SLO)$/adrparse.obj \
+ $(SLO)$/inethist.obj \
+ $(SLO)$/inettype.obj \
+ $(SLO)$/iniadrtk.obj \
+ $(SLO)$/loginerr.obj \
+ $(SLO)$/strcrypt.obj \
+ $(SLO)$/strmadpt.obj
+
+LIB3TARGET=$(SLB)$/misc2.lib
+LIB3OBJFILES=\
+ $(SLO)$/agprop.obj \
+ $(SLO)$/config.obj \
+ $(SLO)$/confitem.obj \
+ $(SLO)$/demo.obj \
+ $(SLO)$/ehdl.obj \
+ $(SLO)$/filearch.obj \
+ $(SLO)$/flbytes.obj \
+ $(SLO)$/imap.obj \
+ $(SLO)$/imap2.obj \
+ $(SLO)$/imap3.obj \
+ $(SLO)$/iniman.obj \
+ $(SLO)$/iniprop.obj \
+ $(SLO)$/ownlist.obj \
+ $(SLO)$/pver.obj \
+ $(SLO)$/urihelper.obj \
+ $(SLO)$/vcldata.obj
+
+EXCEPTIONSFILES=\
+ $(SLO)$/strmadpt.obj \
+ $(SLO)$/iniman.obj
+
+UNOUCRDEP=$(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/applicat.rdb
+UNOUCROUT=$(OUT)$/inc
+UNOTYPES=\
+ com.sun.star.io.XInputStream \
+ com.sun.star.io.XOutputStream \
+ com.sun.star.io.XSeekable \
+ com.sun.star.uno.TypeClass \
+ com.sun.star.uno.XWeak \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.lang.XSingleServiceFactory \
+ com.sun.star.registry.MergeConflictException \
+ com.sun.star.registry.XSimpleRegistry \
+ com.sun.star.frame.XConfigManager
+
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/misc/urihelper.cxx b/svtools/source/misc/urihelper.cxx
new file mode 100644
index 000000000000..ff4eb4a075ea
--- /dev/null
+++ b/svtools/source/misc/urihelper.cxx
@@ -0,0 +1,683 @@
+/*************************************************************************
+ *
+ * $RCSfile: urihelper.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef SVTOOLS_URIHELPER_HXX
+#include <urihelper.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_FILESYSTEMNOTATION_HPP_
+#include <com/sun/star/ucb/FileSystemNotation.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UCB_XCONTENTPROVIDERMANAGER_HPP_
+#include <com/sun/star/ucb/XContentProviderManager.hpp>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef TOOLS_INETMIME_HXX
+#include <tools/inetmime.hxx>
+#endif
+#ifndef _UCBHELPER_CONTENT_HXX
+#include <ucbhelper/content.hxx>
+#endif
+#ifndef _UCBHELPER_CONTENTBROKER_HXX
+#include <ucbhelper/contentbroker.hxx>
+#endif
+#ifndef _UNOTOOLS_CHARCLASS_HXX
+#include <unotools/charclass.hxx>
+#endif
+
+namespace unnamed_svtools_urihelper {}
+using namespace unnamed_svtools_urihelper;
+ // unnamed namespaces don't work well yet...
+
+using namespace com::sun;
+using namespace com::sun::star;
+
+//============================================================================
+//
+// SmartRel2Abs
+//
+//============================================================================
+
+namespace unnamed_svtools_urihelper {
+
+inline UniString toUniString(ByteString const & rString)
+{
+ return UniString(rString, RTL_TEXTENCODING_ISO_8859_1);
+}
+
+inline UniString toUniString(UniString const & rString)
+{
+ return rString;
+}
+
+template< typename Str >
+inline UniString SmartRel2Abs_Impl(INetURLObject const & rTheBaseURIRef,
+ Str const & rTheRelURIRef,
+ Link const & rMaybeFileHdl,
+ bool bCheckFileExists,
+ bool bIgnoreFragment,
+ INetURLObject::EncodeMechanism
+ eEncodeMechanism,
+ INetURLObject::DecodeMechanism
+ eDecodeMechanism,
+ rtl_TextEncoding eCharset,
+ bool bRelativeNonURIs,
+ INetURLObject::FSysStyle eStyle)
+{
+ // Backwards compatibility:
+ if (rTheRelURIRef.Len() != 0 && rTheRelURIRef.GetChar(0) == '#')
+ return toUniString(rTheRelURIRef);
+
+ bool bWasAbsolute;
+ INetURLObject
+ aAbsURIRef(rTheBaseURIRef.smartRel2Abs(rTheRelURIRef, bWasAbsolute,
+ bIgnoreFragment,
+ eEncodeMechanism, eCharset,
+ bRelativeNonURIs, eStyle));
+ if (bCheckFileExists && !bWasAbsolute
+ && aAbsURIRef.GetProtocol() == INET_PROT_FILE)
+ {
+ INetURLObject aNonFileURIRef;
+ aNonFileURIRef.SetSmartURL(rTheRelURIRef, eEncodeMechanism, eCharset,
+ eStyle);
+ if (!aNonFileURIRef.HasError()
+ && aNonFileURIRef.GetProtocol() != INET_PROT_FILE)
+ {
+ bool bMaybeFile = false;
+ if (rMaybeFileHdl.IsSet())
+ {
+ UniString aFilePath(toUniString(rTheRelURIRef));
+ bMaybeFile = rMaybeFileHdl.Call(&aFilePath) != 0;
+ }
+ if (!bMaybeFile)
+ {
+ sal_Bool bExists = false;
+ try
+ {
+ ::ucb::Content(
+ aAbsURIRef.
+ GetMainURL(INetURLObject::NO_DECODE),
+ uno::Reference<
+ com::sun::star::ucb::XCommandEnvironment >
+ ()).
+ getPropertyValue(rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "Exists")))
+ >>= bExists;
+ }
+ catch (::ucb::ContentCreationException const &)
+ {
+ DBG_ERROR("URIHelper::SmartRel2Abs(): UCB Exception");
+ }
+ catch (uno::Exception const &)
+ {
+ DBG_ERROR("URIHelper::SmartRel2Abs(): UCB Exception");
+ }
+ if (!bExists)
+ aAbsURIRef = aNonFileURIRef;
+ }
+ }
+ }
+ return aAbsURIRef.GetMainURL(eDecodeMechanism, eCharset);
+}
+
+}
+
+UniString
+URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
+ ByteString const & rTheRelURIRef,
+ Link const & rMaybeFileHdl,
+ bool bCheckFileExists,
+ bool bIgnoreFragment,
+ INetURLObject::EncodeMechanism eEncodeMechanism,
+ INetURLObject::DecodeMechanism eDecodeMechanism,
+ rtl_TextEncoding eCharset,
+ bool bRelativeNonURIs,
+ INetURLObject::FSysStyle eStyle)
+{
+ return SmartRel2Abs_Impl(rTheBaseURIRef, rTheRelURIRef, rMaybeFileHdl,
+ bCheckFileExists, bIgnoreFragment,
+ eEncodeMechanism, eDecodeMechanism, eCharset,
+ bRelativeNonURIs, eStyle);
+}
+
+UniString
+URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
+ UniString const & rTheRelURIRef,
+ Link const & rMaybeFileHdl,
+ bool bCheckFileExists,
+ bool bIgnoreFragment,
+ INetURLObject::EncodeMechanism eEncodeMechanism,
+ INetURLObject::DecodeMechanism eDecodeMechanism,
+ rtl_TextEncoding eCharset,
+ bool bRelativeNonURIs,
+ INetURLObject::FSysStyle eStyle)
+{
+ return SmartRel2Abs_Impl(rTheBaseURIRef, rTheRelURIRef, rMaybeFileHdl,
+ bCheckFileExists, bIgnoreFragment,
+ eEncodeMechanism, eDecodeMechanism, eCharset,
+ bRelativeNonURIs, eStyle);
+}
+
+//============================================================================
+//
+// SetMaybeFileHdl
+//
+//============================================================================
+
+namespace unnamed_svtools_urihelper {
+
+static Link aMaybeFileHdl;
+
+}
+
+void URIHelper::SetMaybeFileHdl(Link const & rTheMaybeFileHdl)
+{
+ aMaybeFileHdl = rTheMaybeFileHdl;
+}
+
+//============================================================================
+//
+// GetMaybeFileHdl
+//
+//============================================================================
+
+Link URIHelper::GetMaybeFileHdl()
+{
+ return aMaybeFileHdl;
+}
+
+//============================================================================
+//
+// FindFirstURLInText
+//
+//============================================================================
+
+namespace unnamed_svtools_urihelper {
+
+inline xub_StrLen prevChar(UniString const & rStr, xub_StrLen nPos)
+{
+ return INetMIME::isLowSurrogate(rStr.GetChar(nPos - 1))
+ && nPos >= 2
+ && INetMIME::isHighSurrogate(rStr.GetChar(nPos - 2)) ?
+ nPos - 2 : nPos - 1;
+}
+
+inline xub_StrLen nextChar(UniString const & rStr, xub_StrLen nPos)
+{
+ return INetMIME::isHighSurrogate(rStr.GetChar(nPos))
+ && rStr.Len() - nPos >= 2
+ && INetMIME::isLowSurrogate(rStr.GetChar(nPos + 1)) ?
+ nPos + 2 : nPos + 1;
+}
+
+inline bool isWLetter(CharClass const & rCharClass,
+ UniString const & rStr, xub_StrLen nPos)
+{
+ if (rCharClass.isAlphaNumeric(rStr, nPos))
+ return true;
+ sal_Unicode c = rStr.GetChar(nPos);
+ return c == '$' || c == '%' || c == '&' || c == '-' || c == '/'
+ || c == '@' || c == '\\';
+}
+
+inline bool checkWChar(CharClass const & rCharClass, UniString const & rStr,
+ xub_StrLen * pPos, xub_StrLen * pEnd,
+ bool bBackslash = false, bool bPipe = false)
+{
+ sal_Unicode c = rStr.GetChar(*pPos);
+ if (INetMIME::isUSASCII(c))
+ {
+ static sal_uInt8 const aMap[128]
+ = { 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 1, 1, 1, 1, // !"#$%&'
+ 1, 1, 1, 1, 1, 1, 1, 1, // ()*+,-./
+ 4, 4, 4, 4, 4, 4, 4, 4, // 01234567
+ 4, 4, 1, 1, 0, 1, 0, 1, // 89:;<=>?
+ 1, 4, 4, 4, 4, 4, 4, 4, // @ABCDEFG
+ 4, 4, 4, 4, 4, 4, 4, 4, // HIJKLMNO
+ 4, 4, 4, 4, 4, 4, 4, 4, // PQRSTUVW
+ 4, 4, 4, 1, 2, 1, 0, 1, // XYZ[\]^_
+ 0, 4, 4, 4, 4, 4, 4, 4, // `abcdefg
+ 4, 4, 4, 4, 4, 4, 4, 4, // hijklmno
+ 4, 4, 4, 4, 4, 4, 4, 4, // pqrstuvw
+ 4, 4, 4, 0, 3, 0, 1, 0 }; // xyz{|}~
+ switch (aMap[c])
+ {
+ default: // not uric
+ return false;
+
+ case 1: // uric
+ ++(*pPos);
+ return true;
+
+ case 2: // "\"
+ if (bBackslash)
+ {
+ *pEnd = ++(*pPos);
+ return true;
+ }
+ else
+ return false;
+
+ case 3: // "|"
+ if (bPipe)
+ {
+ *pEnd = ++(*pPos);
+ return true;
+ }
+ else
+ return false;
+
+ case 4: // letter, ...
+ *pEnd = ++(*pPos);
+ return true;
+ }
+ }
+ else if (rCharClass.isAlphaNumeric(rStr, *pPos))
+ {
+ *pEnd = *pPos = nextChar(rStr, *pPos);
+ return true;
+ }
+ else
+ return false;
+}
+
+inline sal_uInt32
+scanDomain(UniString const & rStr, xub_StrLen * pPos, xub_StrLen nEnd)
+{
+ sal_Unicode const * pBuffer = rStr.GetBuffer();
+ sal_Unicode const * p = pBuffer + *pPos;
+ sal_uInt32 nLabels = INetURLObject::scanDomain(p, pBuffer + nEnd, false);
+ *pPos = p - pBuffer;
+ return nLabels;
+}
+
+inline bool
+scanIPv6reference(UniString const & rStr, xub_StrLen * pPos, xub_StrLen nEnd)
+{
+ sal_Unicode const * pBuffer = rStr.GetBuffer();
+ sal_Unicode const * p = pBuffer + *pPos;
+ bool bSuccess
+ = INetURLObject::scanIPv6reference(p, pBuffer + nEnd, false);
+ *pPos = p - pBuffer;
+ return bSuccess;
+}
+
+}
+
+UniString
+URIHelper::FindFirstURLInText(UniString const & rText,
+ xub_StrLen & rBegin,
+ xub_StrLen & rEnd,
+ CharClass const & rCharClass,
+ INetURLObject::EncodeMechanism eMechanism,
+ rtl_TextEncoding eCharset,
+ INetURLObject::FSysStyle eStyle)
+{
+ if (!(rBegin <= rEnd && rEnd <= rText.Len()))
+ return UniString();
+
+ // Search for the first (longest possible) substring of [pBegin..pEnd[
+ // that matches any of the following productions (for which the
+ // appropriate style bit is set in eStyle, if applicable). "\W" stands
+ // for a word break, i.e., the begin or end of the block of text, or a
+ // character that is neither a letter nor a digit (according to
+ // rCharClass). The productions use the auxiliary rules
+ //
+ // domain = label *("." label)
+ // label = alphanum [*(alphanum / "-") alphanum]
+ // alphanum = ALPHA / DIGIT
+ // IPv6reference = "[" IPv6address "]"
+ // IPv6address = hexpart [":" IPv4address]
+ // IPv4address = 1*3DIGIT 3("." 1*3DIGIT)
+ // hexpart = (hexseq ["::" [hexseq]]) / ("::" [hexseq])
+ // hexseq = hex4 *(":" hex4)
+ // hex4 = 1*4HEXDIG
+ // wchar = <any uric character (ignoring the escaped rule), or "%", or
+ // a letter or digit (according to rCharClass)>
+ //
+ // 1st Production (file):
+ // \W "file:" 1*(wchar / "\" / "|") ["#" 1*wchar] \W
+ //
+ // 2nd Production (known scheme):
+ // \W <one of the known schemes, ignoring case> ":" 1*wchar
+ // ["#" 1*wchar] \W
+ //
+ // 3rd Production (mailto):
+ // \W domain "@" domain \W
+ //
+ // 4th Production (ftp):
+ // \W "ftp" 2*("." label) ["/" *wchar] ["#" 1*wchar] \W
+ //
+ // 5th Production (http):
+ // \W label 2*("." label) ["/" *wchar] ["#" 1*wchar] \W
+ //
+ // 6th Production (file):
+ // \W "//" (domain / IPv6reference) ["/" *wchar] ["#" 1*wchar] \W
+ //
+ // 7th Production (Unix file; FSYS_UNX only):
+ // \W "/" 1*wchar \W
+ //
+ // 8th Production (UNC file; FSYS_DOS only):
+ // \W "\\" domain ["\" *(wchar / "\")] \W
+ //
+ // 9th Production (Unix-like DOS file; FSYS_DOS only):
+ // \W ALPHA ":/" *wchar \W
+ //
+ // 10th Production (DOS file; FSYS_DOS only):
+ // \W ALPHA ":\" *(wchar / "\") \W
+
+ for (xub_StrLen nPos = rBegin; nPos != rEnd;)
+ {
+ sal_Unicode c = rText.GetChar(nPos);
+ if ((INetMIME::isAlpha(c) || c == '/' || c == '\\')
+ && (nPos == rBegin
+ || !isWLetter(rCharClass, rText, prevChar(rText, nPos))))
+ {
+ xub_StrLen nURIEnd = STRING_NOTFOUND;
+
+ if (INetMIME::isAlpha(c))
+ {
+ xub_StrLen i = nPos;
+ INetProtocol eScheme
+ = INetURLObject::CompareProtocolScheme(UniString(rText, i,
+ rEnd));
+ if (eScheme != INET_PROT_NOT_VALID) // 1st, 2nd
+ {
+ while (rText.GetChar(i++) != ':');
+ xub_StrLen nPrefixEnd = i;
+ if (eScheme == INET_PROT_FILE)
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i, &nURIEnd,
+ true, true));
+ else
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i,
+ &nURIEnd));
+ if (i != nPrefixEnd && rText.GetChar(i) == '#')
+ {
+ ++i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i,
+ &nURIEnd));
+ }
+ }
+ else if (eStyle & INetURLObject::FSYS_DOS
+ && rEnd - i >= 3
+ && rText.GetChar(i + 1) == ':'
+ && rText.GetChar(i + 2) == '/') // 9th
+ {
+ i += 3;
+ nURIEnd = i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i, &nURIEnd));
+ }
+ else if (eStyle & INetURLObject::FSYS_DOS
+ && rEnd - i >= 3
+ && rText.GetChar(i + 1) == ':'
+ && rText.GetChar(i + 2) == '\\') // 10th
+ {
+ i += 3;
+ nURIEnd = i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i, &nURIEnd,
+ true));
+ }
+ else
+ {
+ sal_uInt32 nLabels = scanDomain(rText, &i, rEnd);
+ if (nLabels > 0 && i != rEnd && rText.GetChar(i) == '@')
+ // 3rd
+ {
+ ++i;
+ if (scanDomain(rText, &i, rEnd) > 0)
+ nURIEnd = i;
+ }
+ else if (nLabels >= 3) // 4th, 5th
+ {
+ nURIEnd = i;
+ if (i != rEnd && rText.GetChar(i) == '/')
+ {
+ nURIEnd = ++i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i,
+ &nURIEnd));
+ }
+ if (i != rEnd && rText.GetChar(i) == '#')
+ {
+ ++i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i,
+ &nURIEnd));
+ }
+ }
+ }
+ }
+ else if (c == '/')
+ {
+ xub_StrLen i = nPos;
+ if (rEnd - i >= 2)
+ if (rText.GetChar(i + 1) == '/') // 6th
+ {
+ i += 2;
+ if (scanDomain(rText, &i, rEnd) > 0
+ || scanIPv6reference(rText, &i, rEnd))
+ {
+ nURIEnd = i;
+ if (i != rEnd && rText.GetChar(i) == '/')
+ {
+ nURIEnd = ++i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i,
+ &nURIEnd));
+ }
+ if (i != rEnd && rText.GetChar(i) == '#')
+ {
+ ++i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i,
+ &nURIEnd));
+ }
+ }
+ }
+ else if (eStyle & INetURLObject::FSYS_UNX) // 7th
+ {
+ ++i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i,
+ &nURIEnd));
+ }
+ }
+ else if (eStyle & INetURLObject::FSYS_DOS && c == '\\') // 8th
+ {
+ xub_StrLen i = nPos;
+ if (rEnd - i >= 2 && rText.GetChar(i + 1) == '\\')
+ {
+ i += 2;
+ if (scanDomain(rText, &i, rEnd) > 0)
+ {
+ nURIEnd = i;
+ if (i != rEnd && rText.GetChar(i) == '\\')
+ {
+ nURIEnd = ++i;
+ while (i != rEnd
+ && checkWChar(rCharClass, rText, &i,
+ &nURIEnd, true));
+ }
+ }
+ }
+ }
+
+ if (nURIEnd != STRING_NOTFOUND
+ && (nURIEnd == rEnd
+ || !isWLetter(rCharClass, rText, nURIEnd)))
+ {
+ INetURLObject aURI(UniString(rText, nPos, nURIEnd - nPos),
+ INET_PROT_HTTP, eMechanism, eCharset,
+ eStyle);
+ if (!aURI.HasError())
+ {
+ rBegin = nPos;
+ rEnd = nURIEnd;
+ return aURI.GetMainURL();
+ }
+ }
+
+ ++nPos;
+ while (nPos != rEnd && isWLetter(rCharClass, rText, nPos))
+ nPos = nextChar(rText, nPos);
+ }
+ else
+ nPos = nextChar(rText, nPos);
+ }
+
+ rBegin = rEnd;
+ return UniString();
+}
+
+
+//============================================================================
+//
+// removePassword
+//
+//============================================================================
+
+UniString
+URIHelper::removePassword(UniString const & rURI,
+ INetURLObject::EncodeMechanism eEncodeMechanism,
+ INetURLObject::DecodeMechanism eDecodeMechanism,
+ rtl_TextEncoding eCharset)
+{
+ INetURLObject aObj(rURI, eEncodeMechanism, eCharset);
+ return aObj.HasError() ?
+ rURI :
+ aObj.GetURLNoPass(eDecodeMechanism, eCharset);
+}
+
+//============================================================================
+//
+// queryFSysStyle
+//
+//============================================================================
+
+INetURLObject::FSysStyle URIHelper::queryFSysStyle(UniString const & rFileUrl,
+ bool bAddConvenienceStyles)
+ throw (uno::RuntimeException)
+{
+ ::ucb::ContentBroker const * pBroker = ::ucb::ContentBroker::get();
+ uno::Reference< star::ucb::XContentProviderManager > xManager;
+ if (pBroker)
+ xManager = pBroker->getContentProviderManagerInterface();
+ uno::Reference< beans::XPropertySet > xProperties;
+ if (xManager.is())
+ xProperties
+ = uno::Reference< beans::XPropertySet >(
+ xManager->queryContentProvider(rFileUrl), uno::UNO_QUERY);
+ sal_Int32 nNotation = star::ucb::FileSystemNotation::UNKNOWN_NOTATION;
+ if (xProperties.is())
+ try
+ {
+ xProperties->getPropertyValue(rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM(
+ "FileSystemNotation")))
+ >>= nNotation;
+ }
+ catch (beans::UnknownPropertyException const &) {}
+ catch (lang::WrappedTargetException const &) {}
+
+ // The following code depends on the fact that the
+ // com::sun::star::ucb::FileSystemNotation constants range from UNKNOWN to
+ // MAC, without any holes. The table below has two entries per notation,
+ // the first is used if bAddConvenienceStyles == false, while the second
+ // is used if bAddConvenienceStyles == true:
+ static INetURLObject::FSysStyle const aMap[][2]
+ = { { INetURLObject::FSysStyle(0),
+ INetURLObject::FSYS_DETECT },
+ // UNKNOWN
+ { INetURLObject::FSYS_UNX,
+ INetURLObject::FSysStyle(INetURLObject::FSYS_VOS
+ | INetURLObject::FSYS_UNX) },
+ // UNIX
+ { INetURLObject::FSYS_DOS,
+ INetURLObject::FSysStyle(INetURLObject::FSYS_VOS
+ | INetURLObject::FSYS_UNX
+ | INetURLObject::FSYS_DOS) },
+ // DOS
+ { INetURLObject::FSYS_MAC,
+ INetURLObject::FSysStyle(INetURLObject::FSYS_VOS
+ | INetURLObject::FSYS_UNX
+ | INetURLObject::FSYS_MAC) } };
+ return aMap[nNotation < star::ucb::FileSystemNotation::UNKNOWN_NOTATION
+ || nNotation > star::ucb::FileSystemNotation::MAC_NOTATION ?
+ 0 :
+ nNotation
+ - star::ucb::FileSystemNotation::UNKNOWN_NOTATION]
+ [bAddConvenienceStyles];
+}
diff --git a/svtools/source/misc/vcldata.cxx b/svtools/source/misc/vcldata.cxx
new file mode 100644
index 000000000000..799e64855300
--- /dev/null
+++ b/svtools/source/misc/vcldata.cxx
@@ -0,0 +1,84 @@
+/*************************************************************************
+ *
+ * $RCSfile: vcldata.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_SETTINGS_HXX
+#include <vcl/settings.hxx>
+#endif
+
+#ifndef _SVTOOLS_SVTDATA_HXX
+#include <svtdata.hxx>
+#endif
+
+//============================================================================
+//
+// class ImpSvtData
+//
+//============================================================================
+
+ResMgr * ImpSvtData::GetResMgr()
+{
+ return GetResMgr(Application::GetSettings().GetInternational().
+ GetLanguage());
+}
+
diff --git a/svtools/source/notify/brdcst.cxx b/svtools/source/notify/brdcst.cxx
new file mode 100644
index 000000000000..b0f2fbc7e8a3
--- /dev/null
+++ b/svtools/source/notify/brdcst.cxx
@@ -0,0 +1,281 @@
+/*************************************************************************
+ *
+ * $RCSfile: brdcst.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#ifndef _DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#include "hint.hxx"
+#include "smplhint.hxx"
+#include "lstner.hxx"
+
+SV_DECL_PTRARR( SfxListenerArr_Impl, SfxListener*, 0, 2 );
+
+#define _SFX_BRDCST_CXX
+#include "brdcst.hxx"
+
+#include <segmentc.hxx>
+
+SEG_EOFGLOBALS()
+
+//====================================================================
+DBG_NAME(SfxBroadcaster);
+TYPEINIT0(SfxBroadcaster);
+
+//====================================================================
+
+//====================================================================
+// broadcast immedeately
+
+#pragma SEG_FUNCDEF(brdcst_01)
+
+void SfxBroadcaster::Broadcast( const SfxHint &rHint )
+{
+ DBG_CHKTHIS(SfxBroadcaster, 0);
+
+ // is anybody to notify?
+ if ( aListeners.Count() /*! || aGlobListeners.Count() */ )
+ {
+ // determine the type only once, because of its expensiveness
+ const TypeId& rBCType = Type();
+ const TypeId& rHintType = rHint.Type();
+
+ // notify all registered listeners exactly once
+ for ( USHORT n = 0; n < aListeners.Count(); ++n )
+ {
+ SfxListener* pListener = aListeners[n];
+ if ( pListener )
+ pListener->SFX_NOTIFY( *this, rBCType, rHint, rHintType );
+ }
+ }
+}
+
+//--------------------------------------------------------------------
+
+// broadcast after a timeout
+
+#pragma SEG_FUNCDEF(brdcst_02)
+
+void SfxBroadcaster::BroadcastDelayed( const SfxHint& rHint )
+{
+ DBG_WARNING( "not implemented" );
+ Broadcast(rHint);
+}
+//--------------------------------------------------------------------
+
+// broadcast in idle-handler
+
+#pragma SEG_FUNCDEF(brdcst_03)
+
+void SfxBroadcaster::BroadcastInIdle( const SfxHint& rHint )
+{
+ DBG_WARNING( "not implemented" );
+ Broadcast(rHint);
+}
+//--------------------------------------------------------------------
+
+// unregister all listeners
+
+#pragma SEG_FUNCDEF(brdcst_04)
+
+SfxBroadcaster::~SfxBroadcaster()
+{
+ DBG_DTOR(SfxBroadcaster, 0);
+
+ Broadcast( SfxSimpleHint(SFX_HINT_DYING) );
+
+ // remove all still registered listeners
+ for ( USHORT nPos = 0; nPos < aListeners.Count(); ++nPos )
+ {
+ SfxListener *pListener = aListeners[nPos];
+ if ( pListener )
+ pListener->RemoveBroadcaster_Impl(*this);
+ }
+}
+
+//--------------------------------------------------------------------
+
+// simple ctor of class SfxBroadcaster
+
+#pragma SEG_FUNCDEF(brdcst_05)
+
+SfxBroadcaster::SfxBroadcaster()
+{
+ DBG_CTOR(SfxBroadcaster, 0);
+}
+
+//--------------------------------------------------------------------
+
+// copy ctor of class SfxBroadcaster
+
+#pragma SEG_FUNCDEF(brdcst_06)
+
+SfxBroadcaster::SfxBroadcaster( const SfxBroadcaster &rBC )
+{
+ DBG_CTOR(SfxBroadcaster, 0);
+
+ for ( USHORT n = 0; n < rBC.aListeners.Count(); ++n )
+ {
+ SfxListener *pListener = rBC.aListeners[n];
+ if ( pListener )
+ pListener->StartListening( *this );
+ }
+}
+
+//--------------------------------------------------------------------
+
+// add a new SfxListener to the list
+
+#pragma SEG_FUNCDEF(brdcst_07)
+#if SUPD>=501
+BOOL
+#else
+void
+#endif
+ SfxBroadcaster::AddListener( SfxListener& rListener )
+{
+ DBG_CHKTHIS(SfxBroadcaster, 0);
+ const SfxListener *pListener = &rListener;
+ const SfxListener *pNull = 0;
+ USHORT nFreePos = aListeners.GetPos( pNull );
+ if ( nFreePos < aListeners.Count() )
+ aListeners.GetData()[nFreePos] = pListener;
+ else if ( aListeners.Count() < (USHRT_MAX-1) )
+ aListeners.Insert( pListener, aListeners.Count() );
+ else
+ {
+ DBG_ERROR( "array overflow" );
+#if SUPD>=501
+ return FALSE;
+#endif
+ }
+
+ DBG_ASSERT( USHRT_MAX != aListeners.GetPos(pListener),
+ "AddListener failed" );
+#if SUPD>=501
+ return TRUE;
+#endif
+}
+
+//--------------------------------------------------------------------
+
+// called, if no more listeners exists
+
+#pragma SEG_FUNCDEF(brdcst_08)
+
+void SfxBroadcaster::ListenersGone()
+{
+ DBG_CHKTHIS(SfxBroadcaster,0);
+}
+
+//--------------------------------------------------------------------
+
+// forward a notification to all registered listeners
+
+#pragma SEG_FUNCDEF(brdcst_09)
+
+void SfxBroadcaster::SFX_FORWARD(SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType)
+{
+ const USHORT nCount = aListeners.Count();
+ for ( USHORT i = 0; i < nCount; ++i )
+ {
+ SfxListener *pListener = aListeners[i];
+ if ( pListener )
+ pListener->SFX_NOTIFY( rBC, rBCType, rHint, rHintType);
+ }
+}
+
+//--------------------------------------------------------------------
+
+// remove one SfxListener from the list
+
+#pragma SEG_FUNCDEF(brdcst_0a)
+
+void SfxBroadcaster::RemoveListener( SfxListener& rListener )
+{
+ {DBG_CHKTHIS(SfxBroadcaster, 0);}
+ const SfxListener *pListener = &rListener;
+ USHORT nPos = aListeners.GetPos(pListener);
+ DBG_ASSERT( nPos != USHRT_MAX, "RemoveListener: Listener unknown" );
+ aListeners.GetData()[nPos] = 0;
+ if ( !HasListeners() )
+ ListenersGone();
+}
+
+//--------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(brdcst_0b)
+
+BOOL SfxBroadcaster::HasListeners() const
+{
+ for ( USHORT n = 0; n < aListeners.Count(); ++n )
+ if ( aListeners.GetObject(n) != 0 )
+ return TRUE;
+ return FALSE;
+}
+
+//--------------------------------------------------------------------
+
+#pragma SEG_EOFMODULE
+
diff --git a/svtools/source/notify/cancel.cxx b/svtools/source/notify/cancel.cxx
new file mode 100644
index 000000000000..2e17226fac34
--- /dev/null
+++ b/svtools/source/notify/cancel.cxx
@@ -0,0 +1,221 @@
+/*************************************************************************
+ *
+ * $RCSfile: cancel.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#define _SFX_CANCEL_CXX
+#include <tools/debug.hxx>
+#include "cancel.hxx"
+#include "smplhint.hxx"
+#include "cnclhint.hxx"
+
+#ifndef _SV_SOUND_HXX //autogen
+#include <vcl/sound.hxx>
+#endif
+
+//=========================================================================
+
+SfxCancelManager::SfxCancelManager( SfxCancelManager *pParent )
+: _pParent( pParent )
+{
+}
+
+//-------------------------------------------------------------------------
+
+SfxCancelManager::~SfxCancelManager()
+{
+ DBG_ASSERT( _pParent || !_aJobs.Count(), "deleting SfxCancelManager in use" );
+ for ( USHORT n = _aJobs.Count(); n--; )
+ _aJobs.GetObject(n)->SetManager( _pParent );
+}
+
+//-------------------------------------------------------------------------
+
+BOOL SfxCancelManager::CanCancel() const
+
+/* [Beschreibung]
+
+ Liefert TRUE wenn an diesem CancelManager oder an einem Parent
+ ein Job l"auft.
+*/
+
+{
+ return _aJobs.Count() > 0 || ( _pParent && _pParent->CanCancel() );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCancelManager::Cancel( BOOL bDeep )
+
+/* [Beschreibung]
+
+ Diese Methode markiert alle angemeldeten <SfxCancellable>-Instanzen
+ als suspendiert.
+*/
+
+{
+ SfxCancelManagerWeak xWeak( this );
+ for ( USHORT n = _aJobs.Count(); n-- && xWeak.Is(); )
+ if ( n < _aJobs.Count() )
+ _aJobs.GetObject(n)->Cancel();
+ if ( xWeak.Is() && _pParent )
+ _pParent->Cancel( bDeep );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCancelManager::SFX_INSERT_CANCELLABLE( SfxCancellable *pJob )
+
+/* [Beschreibung]
+
+ Diese interne Methode tr"agt 'pJob' in die Liste der unterbrechbaren
+ Jobs ein und Broadcastet dies. Jeder <SfxCancellable> darf nur
+ maximal einmal angemeldet sein, dies geschiet in seinem Ctor.
+*/
+
+{
+#ifdef GPF_ON_EMPTY_TITLE
+ if ( !pJob->GetTitle() )
+ {
+ DBG_ERROR( "SfxCancellable: empty titles not allowed (Vermummungsverbot)" )
+ *(int*)0 = 0;
+ }
+#endif
+
+ _aJobs.C40_INSERT( SfxCancellable, pJob, _aJobs.Count() );
+ Broadcast( SfxSimpleHint( SFX_HINT_CANCELLABLE ) );
+}
+
+//-------------------------------------------------------------------------
+
+
+void SfxCancelManager::SFX_REMOVE_CANCELLABLE( SfxCancellable *pJob )
+
+/* [Beschreibung]
+
+ Diese interne Methode tr"agt 'pJob' aus die Liste der unterbrechbaren
+ Jobs aus und Broadcastet dies. Dieser Aufruf mu\s paarig nach einem
+ <InsertCancellable> erfolgen und wird im Dtor des <SfxCancellable>
+ ausgel"ost.
+*/
+
+{
+ const SfxCancellable *pTmp = pJob;
+ _aJobs.Remove( _aJobs.GetPos( pTmp ), 1 );
+ Broadcast( SfxSimpleHint( SFX_HINT_CANCELLABLE ) );
+ Broadcast( SfxCancelHint( pJob, SFXCANCELHINT_REMOVED ) );
+}
+
+//-------------------------------------------------------------------------
+
+SfxCancellable::~SfxCancellable()
+{
+ if ( _pMgr )
+ _pMgr->SFX_REMOVE_CANCELLABLE( this );
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCancellable::Cancel()
+
+/* [Description]
+
+ This virtual function is called when the user hits the cancel-button.
+ If you overload it, you can stop your activities. Please always call
+ 'SfxCancellable::Cancel()'.
+*/
+
+{
+#ifdef GFP_ON_NO_CANCEL
+ if ( _bCancelled < 5 )
+ ++_bCancelled;
+ else
+ {
+ Sound::Beep();
+ delete this;
+ }
+#else
+ _bCancelled = TRUE;
+#endif
+}
+
+//-------------------------------------------------------------------------
+
+void SfxCancellable::SetManager( SfxCancelManager *pMgr )
+{
+ if ( _pMgr )
+ _pMgr->SFX_REMOVE_CANCELLABLE( this );
+ _pMgr = pMgr;
+ if ( _pMgr )
+ _pMgr->SFX_INSERT_CANCELLABLE( this );
+}
+
+//-------------------------------------------------------------------------
+
+TYPEINIT1(SfxCancelHint, SfxHint);
+
+SfxCancelHint::SfxCancelHint( SfxCancellable* pJob, USHORT _nAction )
+{
+ pCancellable = pJob;
+ nAction = _nAction;
+}
+
+
diff --git a/svtools/source/notify/hint.cxx b/svtools/source/notify/hint.cxx
new file mode 100644
index 000000000000..465e5a74c219
--- /dev/null
+++ b/svtools/source/notify/hint.cxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: hint.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "hint.hxx"
+#include "segmentc.hxx"
+
+//====================================================================
+
+TYPEINIT0(SfxHint);
+
+//====================================================================
+// virtual dtor for the typical base-class Hint
+
+SfxHint::~SfxHint()
+{
+}
+
+
+
diff --git a/svtools/source/notify/isethint.cxx b/svtools/source/notify/isethint.cxx
new file mode 100644
index 000000000000..a4919b39840e
--- /dev/null
+++ b/svtools/source/notify/isethint.cxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * $RCSfile: isethint.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:02 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "isethint.hxx"
+#include "itemset.hxx"
+#include <segmentc.hxx>
+
+//====================================================================
+
+SEG_EOFGLOBALS()
+
+TYPEINIT1(SfxItemSetHint, SfxHint);
+
+//====================================================================
+
+#pragma SEG_FUNCDEF(isethint_01)
+
+SfxItemSetHint::SfxItemSetHint( SfxItemSet *pItemSet )
+
+/* [Beschreibung]
+
+ Dieser Ctor "ubernimmt das als Parameter "ubergeben <SfxItemSet>,
+ das im Dtor gel"oscht wird.
+*/
+
+: _pItemSet( pItemSet )
+{
+}
+
+//--------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(isethint_02)
+
+SfxItemSetHint::SfxItemSetHint( const SfxItemSet &rItemSet )
+
+/* [Beschreibung]
+
+ Dieser Ctor kopiert das als Parameter "ubergeben <SfxItemSet>.
+*/
+
+: _pItemSet( rItemSet.Clone() )
+{
+}
+
+//--------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(isethint_03)
+
+SfxItemSetHint::~SfxItemSetHint()
+{
+ delete _pItemSet;
+}
+
+//--------------------------------------------------------------------
+
+#pragma SEG_EOFMODULE
+
diff --git a/svtools/source/notify/lstner.cxx b/svtools/source/notify/lstner.cxx
new file mode 100644
index 000000000000..cad153962046
--- /dev/null
+++ b/svtools/source/notify/lstner.cxx
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * $RCSfile: lstner.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#ifndef DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#include "hint.hxx"
+#include "brdcst.hxx"
+
+SV_DECL_PTRARR( SfxBroadcasterArr_Impl, SfxBroadcaster*, 0, 2 );
+
+#define _SFX_LSTNER_CXX
+#include "lstner.hxx"
+
+//====================================================================
+DBG_NAME(SfxListener);
+TYPEINIT0(SfxListener);
+
+//====================================================================
+// simple ctor of class SfxListener
+
+SfxListener::SfxListener()
+{
+ DBG_CTOR(SfxListener, 0);
+}
+//--------------------------------------------------------------------
+
+// copy ctor of class SfxListener
+
+SfxListener::SfxListener( const SfxListener &rListener )
+{
+ DBG_CTOR(SfxListener, 0);
+
+ for ( USHORT n = 0; n < rListener.aBCs.Count(); ++n )
+ StartListening( *rListener.aBCs[n] );
+}
+//--------------------------------------------------------------------
+
+// unregisteres the SfxListener from its SfxBroadcasters
+
+SfxListener::~SfxListener()
+{
+ DBG_DTOR(SfxListener, 0);
+
+ // unregister at all remainding broadcasters
+ for ( USHORT nPos = 0; nPos < aBCs.Count(); ++nPos )
+ {
+ SfxBroadcaster *pBC = aBCs[nPos];
+ pBC->RemoveListener(*this);
+ }
+}
+
+//--------------------------------------------------------------------
+
+// unregisteres at a specific SfxBroadcaster
+
+void SfxListener::RemoveBroadcaster_Impl( SfxBroadcaster& rBC )
+{
+ DBG_CHKTHIS(SfxListener, 0);
+
+ const SfxBroadcaster *pBC = &rBC;
+ aBCs.Remove( aBCs.GetPos(pBC), 1 );
+}
+
+//--------------------------------------------------------------------
+
+// registeres at a specific SfxBroadcaster
+
+BOOL SfxListener::StartListening( SfxBroadcaster& rBroadcaster, BOOL bPreventDups )
+{
+ DBG_CHKTHIS(SfxListener, 0);
+
+ if ( !bPreventDups || !IsListening( rBroadcaster ) )
+ {
+#if SUPD>=501
+ if ( rBroadcaster.AddListener(*this) )
+#else
+ rBroadcaster.AddListener(*this);
+#endif
+ {
+ const SfxBroadcaster *pBC = &rBroadcaster;
+ aBCs.Insert( pBC, aBCs.Count() );
+
+ DBG_ASSERT( IsListening(rBroadcaster), "StartListening failed" );
+ return TRUE;
+ }
+
+ }
+ return FALSE;
+}
+
+//--------------------------------------------------------------------
+
+// unregisteres at a specific SfxBroadcaster
+
+BOOL SfxListener::EndListening( SfxBroadcaster& rBroadcaster, BOOL bAllDups )
+{
+ DBG_CHKTHIS(SfxListener, 0);
+
+ if ( !IsListening( rBroadcaster ) )
+ return FALSE;
+
+ do
+ {
+ rBroadcaster.RemoveListener(*this);
+ const SfxBroadcaster *pBC = &rBroadcaster;
+ aBCs.Remove( aBCs.GetPos(pBC), 1 );
+ }
+ while ( bAllDups && IsListening( rBroadcaster ) );
+ return TRUE;
+}
+
+//--------------------------------------------------------------------
+
+// unregisteres at a specific SfxBroadcaster by index
+
+void SfxListener::EndListening( USHORT nNo )
+{
+ DBG_CHKTHIS(SfxListener, 0);
+
+ SfxBroadcaster *pBC = aBCs.GetObject(nNo);
+ pBC->RemoveListener(*this);
+ aBCs.Remove( nNo, 1 );
+}
+
+//--------------------------------------------------------------------
+
+// unregisteres all Broadcasters
+
+void SfxListener::EndListeningAll()
+{
+ DBG_CHKTHIS(SfxListener, 0);
+
+ // MI: bei Optimierung beachten: Seiteneffekte von RemoveListener beachten!
+ while ( aBCs.Count() )
+ {
+ SfxBroadcaster *pBC = aBCs.GetObject(0);
+ pBC->RemoveListener(*this);
+ aBCs.Remove( 0, 1 );
+ }
+}
+
+//--------------------------------------------------------------------
+
+BOOL SfxListener::IsListening( SfxBroadcaster& rBroadcaster ) const
+{
+ const SfxBroadcaster *pBC = &rBroadcaster;
+ return USHRT_MAX != aBCs.GetPos( pBC );
+}
+
+//--------------------------------------------------------------------
+
+// base implementation of notification handler
+
+void SfxListener::SFX_NOTIFY( SfxBroadcaster& rBC, const TypeId& rBCType,
+ const SfxHint& rHint, const TypeId& rHintType )
+{
+ const SfxBroadcaster *pBC = &rBC;
+ DBG_ASSERT( USHRT_MAX != aBCs.GetPos(pBC),
+ "notification from unregistered broadcaster" );
+}
+
diff --git a/svtools/source/notify/makefile.mk b/svtools/source/notify/makefile.mk
new file mode 100644
index 000000000000..8bdce9c2e41d
--- /dev/null
+++ b/svtools/source/notify/makefile.mk
@@ -0,0 +1,123 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=notify
+TARGETSTAT=_notify
+LIBTARGET=NO
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(header)" == ""
+
+CXXFILES = \
+ smplhint.cxx \
+ hint.cxx \
+ lstner.cxx \
+ isethint.cxx \
+ cancel.cxx \
+ brdcst.cxx
+
+SLOFILES = \
+ $(SLO)$/smplhint.obj \
+ $(SLO)$/hint.obj \
+ $(SLO)$/lstner.obj \
+ $(SLO)$/isethint.obj \
+ $(SLO)$/cancel.obj \
+ $(SLO)$/brdcst.obj
+
+OBJFILES = \
+ $(OBJ)$/smplhint.obj \
+ $(OBJ)$/hint.obj \
+ $(OBJ)$/lstner.obj \
+ $(OBJ)$/isethint.obj \
+ $(OBJ)$/cancel.obj \
+ $(OBJ)$/brdcst.obj
+
+.ENDIF
+
+HXX1TARGET= notify
+HXX1EXT= hxx
+HXX1FILES= $(INC)$/hint.hxx \
+ $(INC)$/smplhint.hxx \
+ $(INC)$/lstner.hxx \
+ $(INC)$/brdcst.hxx
+HXX1EXCL= -E:*include*
+
+LIB1TARGET= $(SLB)$/$(TARGET).lib
+LIB1OBJFILES= $(SLOFILES)
+
+LIB2TARGET= $(LB)$/$(TARGETSTAT).lib
+LIB2OBJFILES= $(OBJFILES)
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svtools/source/notify/smplhint.cxx b/svtools/source/notify/smplhint.cxx
new file mode 100644
index 000000000000..3aa796962361
--- /dev/null
+++ b/svtools/source/notify/smplhint.cxx
@@ -0,0 +1,79 @@
+/*************************************************************************
+ *
+ * $RCSfile: smplhint.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include "smplhint.hxx"
+#include "segmentc.hxx"
+
+//====================================================================
+
+TYPEINIT1(SfxSimpleHint, SfxHint);
+
+//====================================================================
+// creates a SimpleHint with the type nId
+
+SfxSimpleHint::SfxSimpleHint( ULONG nIdP )
+{
+ nId = nIdP;
+}
+
+
diff --git a/svtools/source/numbers/makefile.mk b/svtools/source/numbers/makefile.mk
new file mode 100644
index 000000000000..c7cd1dcd823c
--- /dev/null
+++ b/svtools/source/numbers/makefile.mk
@@ -0,0 +1,122 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=svtools
+TARGET=numbers
+
+PROJECTPCH=
+PROJECTPCHSOURCE=
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+UNOUCRDEP=$(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/applicat.rdb
+# Every source directory generates headers in a own output directory to
+# enable parallel building of the source directories within a project!
+UNOUCROUT=$(OUT)$/inc$/$(PRJNAME)$/$(TARGET)
+INCPRE+=$(UNOUCROUT)
+
+UNOTYPES = com.sun.star.util.XNumberFormatsSupplier \
+ com.sun.star.util.XNumberFormatter \
+ com.sun.star.util.XNumberFormatPreviewer \
+ com.sun.star.util.XNumberFormatTypes \
+ com.sun.star.util.Date \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.lang.XTypeProvider \
+ com.sun.star.lang.XServiceInfo \
+ com.sun.star.lang.XUnoTunnel \
+ com.sun.star.beans.XPropertyAccess \
+ com.sun.star.beans.PropertyAttribute \
+ com.sun.star.uno.XAggregation \
+ com.sun.star.uno.XWeak \
+ com.sun.star.uno.TypeClass \
+ com.sun.star.lang.XInitialization \
+ com.sun.star.lang.Locale \
+ com.sun.star.io.XPersistObject \
+
+SLOFILES = \
+ $(SLO)$/zforfind.obj \
+ $(SLO)$/zforlist.obj \
+ $(SLO)$/zformat.obj \
+ $(SLO)$/zforscan.obj \
+ $(SLO)$/numhead.obj \
+ $(SLO)$/numuno.obj \
+ $(SLO)$/numfmuno.obj \
+ $(SLO)$/supservs.obj
+
+EXCEPTIONSFILES= \
+ $(SLO)$/numuno.obj \
+ $(SLO)$/numfmuno.obj \
+ $(SLO)$/supservs.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svtools/source/numbers/nbdll.cxx b/svtools/source/numbers/nbdll.cxx
new file mode 100644
index 000000000000..31456c0d7d87
--- /dev/null
+++ b/svtools/source/numbers/nbdll.cxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * $RCSfile: nbdll.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifdef WIN
+
+#ifndef _SVWIN_H
+#include <svwin.h>
+#endif
+
+#ifndef _SYSDEP_HXX
+#include <sysdep.hxx>
+#endif
+
+// Statische DLL-Verwaltungs-Variablen
+static HINSTANCE hDLLInst = 0; // HANDLE der DLL
+
+
+/***************************************************************************
+|*
+|* LibMain()
+|*
+|* Beschreibung Initialisierungsfunktion der DLL
+|* Ersterstellung TH 05.05.93
+|* Letzte Aenderung TH 05.05.93
+|*
+***************************************************************************/
+
+extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
+{
+#ifndef WNT
+ if ( nHeap )
+ UnlockData( 0 );
+#endif
+
+ hDLLInst = hDLL;
+
+ return TRUE;
+}
+
+/***************************************************************************
+|*
+|* WEP()
+|*
+|* Beschreibung DLL-Deinitialisierung
+|* Ersterstellung TH 05.05.93
+|* Letzte Aenderung TH 05.05.93
+|*
+***************************************************************************/
+
+extern "C" int CALLBACK WEP( int )
+{
+ return 1;
+}
+
+#endif
diff --git a/svtools/source/numbers/numfmuno.cxx b/svtools/source/numbers/numfmuno.cxx
new file mode 100644
index 000000000000..5dfa0a42835e
--- /dev/null
+++ b/svtools/source/numbers/numfmuno.cxx
@@ -0,0 +1,1137 @@
+/*************************************************************************
+ *
+ * $RCSfile: numfmuno.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <vcl/svapp.hxx>
+#include <vcl/color.hxx>
+#include <tools/debug.hxx>
+#include <tools/isolang.hxx>
+#include <vos/mutex.hxx>
+#include <rtl/ustring.hxx>
+
+#include <com/sun/star/util/Date.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+
+#include "numfmuno.hxx"
+#include "numuno.hxx"
+#include "zforlist.hxx"
+#include "zformat.hxx"
+#include "itemprop.hxx"
+
+using namespace com::sun::star;
+
+//------------------------------------------------------------------------
+
+#define SERVICENAME_NUMBERFORMATTER "com.sun.star.util.NumberFormatter"
+#define SERVICENAME_NUMBERSETTINGS "com.sun.star.util.NumberFormatSettings"
+#define SERVICENAME_NUMBERFORMATS "com.sun.star.util.NumberFormats"
+#define SERVICENAME_NUMBERFORMAT "com.sun.star.util.NumberFormatProperties"
+
+//------------------------------------------------------------------------
+
+#define PROPERTYNAME_FMTSTR "FormatString"
+#define PROPERTYNAME_LOCALE "Locale"
+#define PROPERTYNAME_TYPE "Type"
+#define PROPERTYNAME_COMMENT "Comment"
+#define PROPERTYNAME_CURREXT "CurrencyExtension"
+#define PROPERTYNAME_CURRSYM "CurrencySymbol"
+#define PROPERTYNAME_DECIMALS "Decimals"
+#define PROPERTYNAME_LEADING "LeadingZeros"
+#define PROPERTYNAME_NEGRED "NegativeRed"
+#define PROPERTYNAME_STDFORM "StandardFormat"
+#define PROPERTYNAME_THOUS "ThousandsSeparator"
+#define PROPERTYNAME_USERDEF "UserDefined"
+
+#define PROPERTYNAME_NOZERO "NoZero"
+#define PROPERTYNAME_NULLDATE "NullDate"
+#define PROPERTYNAME_STDDEC "StandardDecimals"
+#define PROPERTYNAME_TWODIGIT "TwoDigitDateStart"
+
+//------------------------------------------------------------------------
+
+// alles ohne Which-ID, Map nur fuer PropertySetInfo
+
+const SfxItemPropertyMap* lcl_GetNumberFormatPropertyMap()
+{
+ static SfxItemPropertyMap aNumberFormatPropertyMap_Impl[] =
+ {
+ {MAP_CHAR_LEN(PROPERTYNAME_FMTSTR), 0, &getCppuType((rtl::OUString*)0),beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_LOCALE), 0, &getCppuType((lang::Locale*)0),beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_TYPE), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_COMMENT), 0, &getCppuType((rtl::OUString*)0),beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_CURREXT), 0, &getCppuType((rtl::OUString*)0),beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_CURRSYM), 0, &getCppuType((rtl::OUString*)0),beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_DECIMALS), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_LEADING), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_NEGRED), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_STDFORM), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_THOUS), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {MAP_CHAR_LEN(PROPERTYNAME_USERDEF), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::READONLY},
+ {0,0,0,0}
+ };
+ return aNumberFormatPropertyMap_Impl;
+}
+
+const SfxItemPropertyMap* lcl_GetNumberSettingsPropertyMap()
+{
+ static SfxItemPropertyMap aNumberSettingsPropertyMap_Impl[] =
+ {
+ {MAP_CHAR_LEN(PROPERTYNAME_NOZERO), 0, &getBooleanCppuType(), beans::PropertyAttribute::BOUND},
+ {MAP_CHAR_LEN(PROPERTYNAME_NULLDATE), 0, &getCppuType((util::Date*)0), beans::PropertyAttribute::BOUND},
+ {MAP_CHAR_LEN(PROPERTYNAME_STDDEC), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND},
+ {MAP_CHAR_LEN(PROPERTYNAME_TWODIGIT), 0, &getCppuType((sal_Int16*)0), beans::PropertyAttribute::BOUND},
+ {0,0,0,0}
+ };
+ return aNumberSettingsPropertyMap_Impl;
+}
+
+//----------------------------------------------------------------------------------------
+
+LanguageType lcl_GetLanguage( const lang::Locale& rLocale )
+{
+ // empty language -> LANGUAGE_SYSTEM
+ if ( rLocale.Language.getLength() == 0 )
+ return LANGUAGE_SYSTEM;
+
+ String aLangStr = rLocale.Language;
+ String aCtryStr = rLocale.Country;
+ // Variant is ignored
+
+ LanguageType eRet = ConvertIsoNamesToLanguage( aLangStr, aCtryStr );
+ if ( eRet == LANGUAGE_NONE )
+ eRet = LANGUAGE_SYSTEM; //! or throw an exception?
+
+ return eRet;
+}
+
+void lcl_FillLocale( lang::Locale& rLocale, LanguageType eLang )
+{
+ String aLangStr, aCtryStr;
+ ConvertLanguageToIsoNames( eLang, aLangStr, aCtryStr );
+ rLocale.Language = aLangStr;
+ rLocale.Country = aCtryStr;
+}
+
+//----------------------------------------------------------------------------------------
+
+SvNumberFormatterServiceObj::SvNumberFormatterServiceObj() :
+ pSupplier(NULL)
+{
+}
+
+SvNumberFormatterServiceObj::~SvNumberFormatterServiceObj()
+{
+ if (pSupplier)
+ pSupplier->release();
+}
+
+uno::Reference<uno::XInterface> SAL_CALL SvNumberFormatterServiceObj_NewInstance(
+ const uno::Reference<lang::XMultiServiceFactory>& rSMgr )
+{
+ return (cppu::OWeakObject*) new SvNumberFormatterServiceObj();
+}
+
+// XNumberFormatter
+
+void SAL_CALL SvNumberFormatterServiceObj::attachNumberFormatsSupplier(
+ const uno::Reference<util::XNumberFormatsSupplier>& xSupplier )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ SvNumberFormatsSupplierObj* pNew = SvNumberFormatsSupplierObj::getImplementation( xSupplier );
+ if (!pNew)
+ throw uno::RuntimeException(); // wrong object
+
+ if (pNew)
+ pNew->acquire();
+ if (pSupplier)
+ pSupplier->release();
+ pSupplier = pNew;
+}
+
+uno::Reference<util::XNumberFormatsSupplier> SAL_CALL
+ SvNumberFormatterServiceObj::getNumberFormatsSupplier()
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+ return pSupplier;
+}
+
+sal_Int32 SAL_CALL SvNumberFormatterServiceObj::detectNumberFormat(
+ sal_Int32 nKey, const rtl::OUString& aString )
+ throw(util::NotNumericException, uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ INT32 nRet = 0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aTemp = aString;
+ ULONG nUKey = nKey;
+ double fValue = 0.0;
+ if ( pFormatter->IsNumberFormat(aTemp, nUKey, fValue) )
+ nRet = nUKey;
+ else
+ throw util::NotNumericException();
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+double SAL_CALL SvNumberFormatterServiceObj::convertStringToNumber(
+ sal_Int32 nKey, const rtl::OUString& aString )
+ throw(util::NotNumericException, uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ double fRet = 0.0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aTemp = aString;
+ ULONG nUKey = nKey;
+ double fValue = 0.0;
+ if ( pFormatter->IsNumberFormat(aTemp, nUKey, fValue) )
+ fRet = fValue;
+ else
+ throw util::NotNumericException();
+ }
+ else
+ throw uno::RuntimeException();
+
+ return fRet;
+}
+
+rtl::OUString SAL_CALL SvNumberFormatterServiceObj::convertNumberToString(
+ sal_Int32 nKey, double fValue ) throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ String aRet;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ Color* pColor = NULL;
+ pFormatter->GetOutputString(fValue, nKey, aRet, &pColor);
+ }
+ else
+ throw uno::RuntimeException();
+
+ return aRet;
+}
+
+util::color SAL_CALL SvNumberFormatterServiceObj::queryColorForNumber( sal_Int32 nKey,
+ double fValue, util::color aDefaultColor )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ util::color nRet = aDefaultColor; // color = INT32
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aStr;
+ Color* pColor = NULL;
+ pFormatter->GetOutputString(fValue, nKey, aStr, &pColor);
+ if (pColor)
+ nRet = pColor->GetColor();
+ // sonst Default behalten
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+rtl::OUString SAL_CALL SvNumberFormatterServiceObj::formatString( sal_Int32 nKey,
+ const rtl::OUString& aString ) throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ String aRet;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aTemp = aString;
+ Color* pColor = NULL;
+ pFormatter->GetOutputString(aTemp, nKey, aRet, &pColor);
+ }
+ else
+ throw uno::RuntimeException();
+
+ return aRet;
+}
+
+util::color SAL_CALL SvNumberFormatterServiceObj::queryColorForString( sal_Int32 nKey,
+ const rtl::OUString& aString,util::color aDefaultColor )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ util::color nRet = aDefaultColor; // color = INT32
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aTemp = aString;
+ String aStr;
+ Color* pColor = NULL;
+ pFormatter->GetOutputString(aTemp, nKey, aStr, &pColor);
+ if (pColor)
+ nRet = pColor->GetColor();
+ // sonst Default behalten
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+rtl::OUString SAL_CALL SvNumberFormatterServiceObj::getInputString( sal_Int32 nKey, double fValue )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ String aRet;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ pFormatter->GetInputLineString(fValue, nKey, aRet);
+ else
+ throw uno::RuntimeException();
+
+ return aRet;
+}
+
+// XNumberFormatPreviewer
+
+rtl::OUString SAL_CALL SvNumberFormatterServiceObj::convertNumberToPreviewString(
+ const rtl::OUString& aFormat, double fValue,
+ const lang::Locale& nLocale, sal_Bool bAllowEnglish )
+ throw(util::MalformedNumberFormatException, uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ String aRet;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aOutString;
+ String aFormString = aFormat;
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ Color* pColor = NULL;
+
+ BOOL bOk;
+ if ( bAllowEnglish )
+ bOk = pFormatter->GetPreviewStringGuess(
+ aFormString, fValue, aOutString, &pColor, eLang );
+ else
+ bOk = pFormatter->GetPreviewString(
+ aFormString, fValue, aOutString, &pColor, eLang );
+
+ if (bOk)
+ aRet = aOutString;
+ else
+ throw util::MalformedNumberFormatException();
+ }
+ else
+ throw uno::RuntimeException();
+
+ return aRet;
+}
+
+util::color SAL_CALL SvNumberFormatterServiceObj::queryPreviewColorForNumber(
+ const rtl::OUString& aFormat, double fValue,
+ const lang::Locale& nLocale, sal_Bool bAllowEnglish,
+ util::color aDefaultColor )
+ throw(util::MalformedNumberFormatException, uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ util::color nRet = aDefaultColor; // color = INT32
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aOutString;
+ String aFormString = aFormat;
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ Color* pColor = NULL;
+
+ BOOL bOk;
+ if ( bAllowEnglish )
+ bOk = pFormatter->GetPreviewStringGuess(
+ aFormString, fValue, aOutString, &pColor, eLang );
+ else
+ bOk = pFormatter->GetPreviewString(
+ aFormString, fValue, aOutString, &pColor, eLang );
+
+ if (bOk)
+ {
+ if (pColor)
+ nRet = pColor->GetColor();
+ // sonst Default behalten
+ }
+ else
+ throw util::MalformedNumberFormatException();
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+// XServiceInfo
+
+rtl::OUString SAL_CALL SvNumberFormatterServiceObj::getImplementationName()
+ throw(uno::RuntimeException)
+{
+ return rtl::OUString::createFromAscii("SvNumberFormatterServiceObj");
+}
+
+sal_Bool SAL_CALL SvNumberFormatterServiceObj::supportsService( const rtl::OUString& ServiceName )
+ throw(uno::RuntimeException)
+{
+ return ( ServiceName.compareToAscii(SERVICENAME_NUMBERFORMATTER) == 0 );
+}
+
+uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatterServiceObj::getSupportedServiceNames()
+ throw(uno::RuntimeException)
+{
+ uno::Sequence<rtl::OUString> aRet(1);
+ rtl::OUString* pArray = aRet.getArray();
+ pArray[0] = rtl::OUString::createFromAscii(SERVICENAME_NUMBERFORMATTER);
+ return aRet;
+}
+
+//------------------------------------------------------------------------
+
+SvNumberFormatsObj::SvNumberFormatsObj(SvNumberFormatsSupplierObj* pParent) :
+ pSupplier(pParent)
+{
+ if (pSupplier)
+ pSupplier->acquire();
+}
+
+SvNumberFormatsObj::~SvNumberFormatsObj()
+{
+ if (pSupplier)
+ pSupplier->release();
+}
+
+// XNumberFormats
+
+uno::Reference<beans::XPropertySet> SAL_CALL SvNumberFormatsObj::getByKey( sal_Int32 nKey )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL;
+ if (pFormat)
+ return new SvNumberFormatObj( pSupplier, nKey );
+ else
+ throw uno::RuntimeException();
+
+ return NULL;
+}
+
+uno::Sequence<sal_Int32> SAL_CALL SvNumberFormatsObj::queryKeys( sal_Int16 nType,
+ const lang::Locale& nLocale, sal_Bool bCreate )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if ( pFormatter )
+ {
+ ULONG nIndex = 0;
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ SvNumberFormatTable& rTable = bCreate ?
+ pFormatter->ChangeCL( nType, nIndex, eLang ) :
+ pFormatter->GetEntryTable( nType, nIndex, eLang );
+ ULONG nCount = rTable.Count();
+ uno::Sequence<sal_Int32> aSeq(nCount);
+ sal_Int32* pAry = aSeq.getArray();
+ for (ULONG i=0; i<nCount; i++)
+ pAry[i] = rTable.GetObjectKey( i );
+
+ return aSeq;
+ }
+ else
+ throw uno::RuntimeException();
+
+ return uno::Sequence<sal_Int32>(0);
+}
+
+sal_Int32 SAL_CALL SvNumberFormatsObj::queryKey( const rtl::OUString& aFormat,
+ const lang::Locale& nLocale, sal_Bool bScan )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ INT32 nRet = 0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aFormStr = aFormat;
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ if (bScan)
+ {
+ //! irgendwas muss hier noch passieren...
+ }
+ nRet = pFormatter->GetEntryKey( aFormat, eLang );
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+sal_Int32 SAL_CALL SvNumberFormatsObj::addNew( const rtl::OUString& aFormat,
+ const lang::Locale& nLocale )
+ throw(util::MalformedNumberFormatException, uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ INT32 nRet = 0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aFormStr = aFormat;
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ ULONG nKey = 0;
+ xub_StrLen nCheckPos = 0;
+ short nType = 0;
+ BOOL bOk = pFormatter->PutEntry( aFormStr, nCheckPos, nType, nKey, eLang );
+ if (bOk)
+ nRet = nKey;
+ else if (nCheckPos)
+ {
+ throw util::MalformedNumberFormatException(); // ungueltiges Format
+ }
+ else
+ throw uno::RuntimeException(); // anderer Fehler (z.B. schon vorhanden)
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+sal_Int32 SAL_CALL SvNumberFormatsObj::addNewConverted( const rtl::OUString& aFormat,
+ const lang::Locale& nLocale, const lang::Locale& nNewLocale )
+ throw(util::MalformedNumberFormatException, uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ INT32 nRet = 0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aFormStr = aFormat;
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ LanguageType eNewLang = lcl_GetLanguage( nNewLocale );
+ ULONG nKey = 0;
+ xub_StrLen nCheckPos = 0;
+ short nType = 0;
+ BOOL bOk = pFormatter->PutandConvertEntry( aFormStr, nCheckPos, nType, nKey, eLang, eNewLang );
+ if (bOk)
+ nRet = nKey;
+ else if (nCheckPos)
+ {
+ throw util::MalformedNumberFormatException(); // ungueltiges Format
+ }
+ else
+ throw uno::RuntimeException(); // anderer Fehler (z.B. schon vorhanden)
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+void SAL_CALL SvNumberFormatsObj::removeByKey( sal_Int32 nKey ) throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+
+ if (pFormatter)
+ {
+ pFormatter->DeleteEntry(nKey);
+ pSupplier->NumberFormatDeleted(nKey); // Benachrichtigung fuers Dokument
+ }
+}
+
+rtl::OUString SAL_CALL SvNumberFormatsObj::generateFormat( sal_Int32 nBaseKey,
+ const lang::Locale& nLocale, sal_Bool bThousands,
+ sal_Bool bRed, sal_Int16 nDecimals, sal_Int16 nLeading )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ String aRet;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ pFormatter->GenerateFormat( aRet, nBaseKey, eLang, bThousands, bRed, nDecimals, nLeading );
+ }
+ else
+ throw uno::RuntimeException();
+
+ return aRet;
+}
+
+// XNumberFormatTypes
+
+sal_Int32 SAL_CALL SvNumberFormatsObj::getStandardIndex( const lang::Locale& nLocale )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ INT32 nRet = 0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ nRet = pFormatter->GetStandardIndex(eLang);
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+sal_Int32 SAL_CALL SvNumberFormatsObj::getStandardFormat( sal_Int16 nType, const lang::Locale& nLocale )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ INT32 nRet = 0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ // mask out "defined" bit, so type from an existing number format
+ // can directly be used for getStandardFormat
+ nType &= ~NUMBERFORMAT_DEFINED;
+ nRet = pFormatter->GetStandardFormat(nType, eLang);
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatIndex( sal_Int16 nIndex, const lang::Locale& nLocale )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ INT32 nRet = 0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ nRet = pFormatter->GetFormatIndex( (NfIndexTableOffset)nIndex, eLang );
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+sal_Bool SAL_CALL SvNumberFormatsObj::isTypeCompatible( sal_Int16 nOldType, sal_Int16 nNewType )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ BOOL bRet = FALSE;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ bRet = pFormatter->IsCompatible( nOldType, nNewType );
+ else
+ throw uno::RuntimeException();
+
+ return bRet;
+}
+
+sal_Int32 SAL_CALL SvNumberFormatsObj::getFormatForLocale( sal_Int32 nKey, const lang::Locale& nLocale )
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ INT32 nRet = 0;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ LanguageType eLang = lcl_GetLanguage( nLocale );
+ nRet = pFormatter->GetFormatForLanguageIfBuiltIn(nKey, eLang);
+ }
+ else
+ throw uno::RuntimeException();
+
+ return nRet;
+}
+
+// XServiceInfo
+
+rtl::OUString SAL_CALL SvNumberFormatsObj::getImplementationName()
+ throw(uno::RuntimeException)
+{
+ return rtl::OUString::createFromAscii("SvNumberFormatsObj");
+}
+
+sal_Bool SAL_CALL SvNumberFormatsObj::supportsService( const rtl::OUString& ServiceName )
+ throw(uno::RuntimeException)
+{
+ return ( ServiceName.compareToAscii(SERVICENAME_NUMBERFORMATS) == 0 );
+}
+
+uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatsObj::getSupportedServiceNames()
+ throw(uno::RuntimeException)
+{
+ uno::Sequence<rtl::OUString> aRet(1);
+ rtl::OUString* pArray = aRet.getArray();
+ pArray[0] = rtl::OUString::createFromAscii(SERVICENAME_NUMBERFORMATS);
+ return aRet;
+}
+
+//------------------------------------------------------------------------
+
+SvNumberFormatObj::SvNumberFormatObj(SvNumberFormatsSupplierObj* pParent, ULONG nK) :
+ pSupplier(pParent),
+ nKey(nK)
+{
+ if (pSupplier)
+ pSupplier->acquire();
+}
+
+SvNumberFormatObj::~SvNumberFormatObj()
+{
+ if (pSupplier)
+ pSupplier->release();
+}
+
+// XPropertySet
+
+uno::Reference<beans::XPropertySetInfo> SAL_CALL SvNumberFormatObj::getPropertySetInfo()
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+ static uno::Reference<beans::XPropertySetInfo> aRef =
+ new SfxItemPropertySetInfo( lcl_GetNumberFormatPropertyMap() );
+ return aRef;
+}
+
+void SAL_CALL SvNumberFormatObj::setPropertyValue( const rtl::OUString& aPropertyName,
+ const uno::Any& aValue )
+ throw(beans::UnknownPropertyException, beans::PropertyVetoException,
+ lang::IllegalArgumentException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException(); // everything is read-only
+}
+
+uno::Any SAL_CALL SvNumberFormatObj::getPropertyValue( const rtl::OUString& aPropertyName )
+ throw(beans::UnknownPropertyException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ uno::Any aRet;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL;
+ if (pFormat)
+ {
+ String aSymbol, aExt;
+ pFormat->GetNewCurrencySymbol( aSymbol, aExt );
+ String aFmtStr = pFormat->GetFormatstring();
+ String aComment = ((SvNumberformat*)pFormat)->GetComment();
+ //! warum ist GetComment nicht const ???
+ BOOL bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 );
+ //! SvNumberformat Member bStandard rausreichen?
+ BOOL bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 );
+ BOOL bThousand, bRed;
+ USHORT nDecimals, nLeading;
+ ((SvNumberformat*)pFormat)->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading );
+ //! warum ist GetFormatSpecialInfo nicht const ???
+
+ String aString = aPropertyName;
+ if (aString.EqualsAscii( PROPERTYNAME_FMTSTR )) aRet <<= rtl::OUString( aFmtStr );
+ else if (aString.EqualsAscii( PROPERTYNAME_LOCALE ))
+ {
+ lang::Locale aLocale;
+ lcl_FillLocale( aLocale, pFormat->GetLanguage() );
+ aRet <<= aLocale;
+ }
+ else if (aString.EqualsAscii( PROPERTYNAME_TYPE )) aRet <<= (sal_Int16)( pFormat->GetType() );
+ else if (aString.EqualsAscii( PROPERTYNAME_COMMENT )) aRet <<= rtl::OUString( aComment );
+ else if (aString.EqualsAscii( PROPERTYNAME_STDFORM )) aRet.setValue( &bStandard, getBooleanCppuType() );
+ else if (aString.EqualsAscii( PROPERTYNAME_USERDEF )) aRet.setValue( &bUserDef, getBooleanCppuType() );
+ else if (aString.EqualsAscii( PROPERTYNAME_DECIMALS )) aRet <<= (sal_Int16)( nDecimals );
+ else if (aString.EqualsAscii( PROPERTYNAME_LEADING )) aRet <<= (sal_Int16)( nLeading );
+ else if (aString.EqualsAscii( PROPERTYNAME_NEGRED )) aRet.setValue( &bRed, getBooleanCppuType() );
+ else if (aString.EqualsAscii( PROPERTYNAME_THOUS )) aRet.setValue( &bThousand, getBooleanCppuType() );
+ else if (aString.EqualsAscii( PROPERTYNAME_CURRSYM )) aRet <<= rtl::OUString( aSymbol );
+ else if (aString.EqualsAscii( PROPERTYNAME_CURREXT )) aRet <<= rtl::OUString( aExt );
+ else
+ throw beans::UnknownPropertyException();
+ }
+ else
+ throw uno::RuntimeException();
+
+ return aRet;
+}
+
+void SAL_CALL SvNumberFormatObj::addPropertyChangeListener( const rtl::OUString&,
+ const uno::Reference<beans::XPropertyChangeListener>&)
+ throw(beans::UnknownPropertyException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ DBG_ERROR("not implemented");
+}
+
+void SAL_CALL SvNumberFormatObj::removePropertyChangeListener( const rtl::OUString&,
+ const uno::Reference<beans::XPropertyChangeListener>&)
+ throw(beans::UnknownPropertyException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ DBG_ERROR("not implemented");
+}
+
+void SAL_CALL SvNumberFormatObj::addVetoableChangeListener( const rtl::OUString&,
+ const uno::Reference<beans::XVetoableChangeListener>&)
+ throw(beans::UnknownPropertyException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ DBG_ERROR("not implemented");
+}
+
+void SAL_CALL SvNumberFormatObj::removeVetoableChangeListener( const rtl::OUString&,
+ const uno::Reference<beans::XVetoableChangeListener>&)
+ throw(beans::UnknownPropertyException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ DBG_ERROR("not implemented");
+}
+
+// XPropertyAccess
+
+uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValues()
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ const SvNumberformat* pFormat = pFormatter ? pFormatter->GetEntry(nKey) : NULL;
+ if (pFormat)
+ {
+ String aSymbol, aExt;
+ pFormat->GetNewCurrencySymbol( aSymbol, aExt );
+ String aFmtStr = pFormat->GetFormatstring();
+ String aComment = ((SvNumberformat*)pFormat)->GetComment();
+ //! warum ist GetComment nicht const ???
+ BOOL bStandard = ( ( nKey % SV_COUNTRY_LANGUAGE_OFFSET ) == 0 );
+ //! SvNumberformat Member bStandard rausreichen?
+ BOOL bUserDef = ( ( pFormat->GetType() & NUMBERFORMAT_DEFINED ) != 0 );
+ BOOL bThousand, bRed;
+ USHORT nDecimals, nLeading;
+ ((SvNumberformat*)pFormat)->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading );
+ //! warum ist GetFormatSpecialInfo nicht const ???
+ lang::Locale aLocale;
+ lcl_FillLocale( aLocale, pFormat->GetLanguage() );
+
+ uno::Sequence<beans::PropertyValue> aSeq(12);
+ beans::PropertyValue* pArray = aSeq.getArray();
+
+ pArray[0].Name = rtl::OUString::createFromAscii( PROPERTYNAME_FMTSTR );
+ pArray[0].Value <<= rtl::OUString( aFmtStr );
+ pArray[1].Name = rtl::OUString::createFromAscii( PROPERTYNAME_LOCALE );
+ pArray[1].Value <<= aLocale;
+ pArray[2].Name = rtl::OUString::createFromAscii( PROPERTYNAME_TYPE );
+ pArray[2].Value <<= (sal_Int16)( pFormat->GetType() );
+ pArray[3].Name = rtl::OUString::createFromAscii( PROPERTYNAME_COMMENT );
+ pArray[3].Value <<= rtl::OUString( aComment );
+ pArray[4].Name = rtl::OUString::createFromAscii( PROPERTYNAME_STDFORM );
+ pArray[4].Value.setValue( &bStandard, getBooleanCppuType() );
+ pArray[5].Name = rtl::OUString::createFromAscii( PROPERTYNAME_USERDEF );
+ pArray[5].Value.setValue( &bUserDef, getBooleanCppuType() );
+ pArray[6].Name = rtl::OUString::createFromAscii( PROPERTYNAME_DECIMALS );
+ pArray[6].Value <<= (sal_Int16)( nDecimals );
+ pArray[7].Name = rtl::OUString::createFromAscii( PROPERTYNAME_LEADING );
+ pArray[7].Value <<= (sal_Int16)( nLeading );
+ pArray[8].Name = rtl::OUString::createFromAscii( PROPERTYNAME_NEGRED );
+ pArray[8].Value.setValue( &bRed, getBooleanCppuType() );
+ pArray[9].Name = rtl::OUString::createFromAscii( PROPERTYNAME_THOUS );
+ pArray[9].Value.setValue( &bThousand, getBooleanCppuType() );
+ pArray[10].Name = rtl::OUString::createFromAscii( PROPERTYNAME_CURRSYM );
+ pArray[10].Value <<= rtl::OUString( aSymbol );
+ pArray[11].Name = rtl::OUString::createFromAscii( PROPERTYNAME_CURREXT );
+ pArray[11].Value <<= rtl::OUString( aExt );
+
+ return aSeq;
+ }
+ else
+ throw uno::RuntimeException();
+
+ return uno::Sequence<beans::PropertyValue>(0);
+}
+
+void SAL_CALL SvNumberFormatObj::setPropertyValues( const uno::Sequence<beans::PropertyValue>& aProps )
+ throw(beans::UnknownPropertyException, beans::PropertyVetoException,
+ lang::IllegalArgumentException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ throw beans::UnknownPropertyException(); // everything is read-only
+}
+
+// XServiceInfo
+
+rtl::OUString SAL_CALL SvNumberFormatObj::getImplementationName()
+ throw(uno::RuntimeException)
+{
+ return rtl::OUString::createFromAscii("SvNumberFormatObj");
+}
+
+sal_Bool SAL_CALL SvNumberFormatObj::supportsService( const rtl::OUString& ServiceName )
+ throw(uno::RuntimeException)
+{
+ return ( ServiceName.compareToAscii(SERVICENAME_NUMBERFORMAT) == 0 );
+}
+
+uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatObj::getSupportedServiceNames()
+ throw(uno::RuntimeException)
+{
+ uno::Sequence<rtl::OUString> aRet(1);
+ rtl::OUString* pArray = aRet.getArray();
+ pArray[0] = rtl::OUString::createFromAscii(SERVICENAME_NUMBERFORMAT);
+ return aRet;
+}
+
+//------------------------------------------------------------------------
+
+SvNumberFormatSettingsObj::SvNumberFormatSettingsObj(SvNumberFormatsSupplierObj* pParent) :
+ pSupplier(pParent)
+{
+ if (pSupplier)
+ pSupplier->acquire();
+}
+
+SvNumberFormatSettingsObj::~SvNumberFormatSettingsObj()
+{
+ if (pSupplier)
+ pSupplier->release();
+}
+
+// XPropertySet
+
+uno::Reference<beans::XPropertySetInfo> SAL_CALL SvNumberFormatSettingsObj::getPropertySetInfo()
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+ static uno::Reference<beans::XPropertySetInfo> aRef =
+ new SfxItemPropertySetInfo( lcl_GetNumberSettingsPropertyMap() );
+ return aRef;
+}
+
+void SAL_CALL SvNumberFormatSettingsObj::setPropertyValue( const rtl::OUString& aPropertyName,
+ const uno::Any& aValue )
+ throw(beans::UnknownPropertyException, beans::PropertyVetoException,
+ lang::IllegalArgumentException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aString = aPropertyName;
+ if (aString.EqualsAscii( PROPERTYNAME_NOZERO ))
+ {
+ // operator >>= shouldn't be used for bool (?)
+ if ( aValue.getValueTypeClass() == uno::TypeClass_BOOLEAN )
+ pFormatter->SetNoZero( *(sal_Bool*)aValue.getValue() );
+ }
+ else if (aString.EqualsAscii( PROPERTYNAME_NULLDATE ))
+ {
+ util::Date aDate;
+ if ( aValue >>= aDate )
+ pFormatter->ChangeNullDate( aDate.Day, aDate.Month, aDate.Year );
+ }
+ else if (aString.EqualsAscii( PROPERTYNAME_STDDEC ))
+ {
+ sal_Int16 nInt16;
+ if ( aValue >>= nInt16 )
+ pFormatter->ChangeStandardPrec( nInt16 );
+ }
+ else if (aString.EqualsAscii( PROPERTYNAME_TWODIGIT ))
+ {
+ sal_Int16 nInt16;
+ if ( aValue >>= nInt16 )
+ pFormatter->SetYear2000( nInt16 );
+ }
+ else
+ throw beans::UnknownPropertyException();
+
+ pSupplier->SettingsChanged();
+ }
+ else
+ throw uno::RuntimeException();
+}
+
+uno::Any SAL_CALL SvNumberFormatSettingsObj::getPropertyValue( const rtl::OUString& aPropertyName )
+ throw(beans::UnknownPropertyException, lang::WrappedTargetException,
+ uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ uno::Any aRet;
+ SvNumberFormatter* pFormatter = pSupplier ? pSupplier->GetNumberFormatter() : NULL;
+ if (pFormatter)
+ {
+ String aString = aPropertyName;
+ if (aString.EqualsAscii( PROPERTYNAME_NOZERO ))
+ {
+ BOOL bNoZero = pFormatter->GetNoZero();
+ aRet.setValue( &bNoZero, getBooleanCppuType() );
+ }
+ else if (aString.EqualsAscii( PROPERTYNAME_NULLDATE ))
+ {
+ Date* pDate = pFormatter->GetNullDate();
+ if (pDate)
+ {
+ util::Date aUnoDate( pDate->GetDay(), pDate->GetMonth(), pDate->GetYear() );
+ aRet <<= aUnoDate;
+ }
+ }
+ else if (aString.EqualsAscii( PROPERTYNAME_STDDEC ))
+ aRet <<= (sal_Int16)( pFormatter->GetStandardPrec() );
+ else if (aString.EqualsAscii( PROPERTYNAME_TWODIGIT ))
+ aRet <<= (sal_Int16)( pFormatter->GetYear2000() );
+ else
+ throw beans::UnknownPropertyException();
+ }
+ else
+ throw uno::RuntimeException();
+
+ return aRet;
+}
+
+void SAL_CALL SvNumberFormatSettingsObj::addPropertyChangeListener( const rtl::OUString&,
+ const uno::Reference<beans::XPropertyChangeListener>&)
+ throw(beans::UnknownPropertyException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ DBG_ERROR("not implemented");
+}
+
+void SAL_CALL SvNumberFormatSettingsObj::removePropertyChangeListener( const rtl::OUString&,
+ const uno::Reference<beans::XPropertyChangeListener>&)
+ throw(beans::UnknownPropertyException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ DBG_ERROR("not implemented");
+}
+
+void SAL_CALL SvNumberFormatSettingsObj::addVetoableChangeListener( const rtl::OUString&,
+ const uno::Reference<beans::XVetoableChangeListener>&)
+ throw(beans::UnknownPropertyException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ DBG_ERROR("not implemented");
+}
+
+void SAL_CALL SvNumberFormatSettingsObj::removeVetoableChangeListener( const rtl::OUString&,
+ const uno::Reference<beans::XVetoableChangeListener>&)
+ throw(beans::UnknownPropertyException,
+ lang::WrappedTargetException, uno::RuntimeException)
+{
+ DBG_ERROR("not implemented");
+}
+
+// XServiceInfo
+
+rtl::OUString SAL_CALL SvNumberFormatSettingsObj::getImplementationName()
+ throw(uno::RuntimeException)
+{
+ return rtl::OUString::createFromAscii("SvNumberFormatSettingsObj");
+}
+
+sal_Bool SAL_CALL SvNumberFormatSettingsObj::supportsService( const rtl::OUString& ServiceName )
+ throw(uno::RuntimeException)
+{
+ return ( ServiceName.compareToAscii(SERVICENAME_NUMBERSETTINGS) == 0 );
+}
+
+uno::Sequence<rtl::OUString> SAL_CALL SvNumberFormatSettingsObj::getSupportedServiceNames()
+ throw(uno::RuntimeException)
+{
+ uno::Sequence<rtl::OUString> aRet(1);
+ rtl::OUString* pArray = aRet.getArray();
+ pArray[0] = rtl::OUString::createFromAscii(SERVICENAME_NUMBERSETTINGS);
+ return aRet;
+}
+
+
diff --git a/svtools/source/numbers/numfmuno.hxx b/svtools/source/numbers/numfmuno.hxx
new file mode 100644
index 000000000000..6c593bb10b1c
--- /dev/null
+++ b/svtools/source/numbers/numfmuno.hxx
@@ -0,0 +1,364 @@
+/*************************************************************************
+ *
+ * $RCSfile: numfmuno.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _NUMFMUNO_HXX
+#define _NUMFMUNO_HXX
+
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTER_HPP_
+#include <com/sun/star/util/XNumberFormatter.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATPREVIEWER_HPP_
+#include <com/sun/star/util/XNumberFormatPreviewer.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATS_HPP_
+#include <com/sun/star/util/XNumberFormats.hpp>
+#endif
+#ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTYPES_HPP_
+#include <com/sun/star/util/XNumberFormatTypes.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYACCESS_HPP_
+#include <com/sun/star/beans/XPropertyAccess.hpp>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+#ifndef _CPPUHELPER_IMPLBASE3_HXX_
+#include <cppuhelper/implbase3.hxx>
+#endif
+
+class SvNumberformat;
+class SvNumberFormatter;
+class SvNumberFormatsSupplierObj;
+
+
+// SvNumberFormatterServiceObj wird global als Service angemeldet
+
+class SvNumberFormatterServiceObj : public cppu::WeakImplHelper3<
+ com::sun::star::util::XNumberFormatter,
+ com::sun::star::util::XNumberFormatPreviewer,
+ com::sun::star::lang::XServiceInfo>
+{
+private:
+ SvNumberFormatsSupplierObj* pSupplier;
+
+public:
+ SvNumberFormatterServiceObj();
+ virtual ~SvNumberFormatterServiceObj();
+
+ // XNumberFormatter
+ virtual void SAL_CALL attachNumberFormatsSupplier(
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::util::XNumberFormatsSupplier >& xSupplier )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier >
+ SAL_CALL getNumberFormatsSupplier()
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL detectNumberFormat( sal_Int32 nKey, const ::rtl::OUString& aString )
+ throw(::com::sun::star::util::NotNumericException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual double SAL_CALL convertStringToNumber( sal_Int32 nKey, const ::rtl::OUString& aString )
+ throw(::com::sun::star::util::NotNumericException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL convertNumberToString( sal_Int32 nKey, double fValue )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::util::color SAL_CALL queryColorForNumber( sal_Int32 nKey,
+ double fValue, ::com::sun::star::util::color aDefaultColor )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL formatString( sal_Int32 nKey, const ::rtl::OUString& aString )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::util::color SAL_CALL queryColorForString( sal_Int32 nKey,
+ const ::rtl::OUString& aString,
+ ::com::sun::star::util::color aDefaultColor )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL getInputString( sal_Int32 nKey, double fValue )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XNumberFormatPreviewer
+ virtual ::rtl::OUString SAL_CALL convertNumberToPreviewString(
+ const ::rtl::OUString& aFormat, double fValue,
+ const ::com::sun::star::lang::Locale& nLocale, sal_Bool bAllowEnglish )
+ throw(::com::sun::star::util::MalformedNumberFormatException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::util::color SAL_CALL queryPreviewColorForNumber(
+ const ::rtl::OUString& aFormat, double fValue,
+ const ::com::sun::star::lang::Locale& nLocale, sal_Bool bAllowEnglish,
+ ::com::sun::star::util::color aDefaultColor )
+ throw(::com::sun::star::util::MalformedNumberFormatException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+class SvNumberFormatsObj : public cppu::WeakImplHelper3<
+ com::sun::star::util::XNumberFormats,
+ com::sun::star::util::XNumberFormatTypes,
+ com::sun::star::lang::XServiceInfo>
+{
+private:
+ SvNumberFormatsSupplierObj* pSupplier;
+
+public:
+ SvNumberFormatsObj();
+ SvNumberFormatsObj(SvNumberFormatsSupplierObj* pParent);
+ virtual ~SvNumberFormatsObj();
+
+
+ // XNumberFormats
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
+ getByKey( sal_Int32 nKey ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< sal_Int32 > SAL_CALL queryKeys( sal_Int16 nType,
+ const ::com::sun::star::lang::Locale& nLocale, sal_Bool bCreate )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL queryKey( const ::rtl::OUString& aFormat,
+ const ::com::sun::star::lang::Locale& nLocale, sal_Bool bScan )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL addNew( const ::rtl::OUString& aFormat,
+ const ::com::sun::star::lang::Locale& nLocale )
+ throw(::com::sun::star::util::MalformedNumberFormatException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL addNewConverted( const ::rtl::OUString& aFormat,
+ const ::com::sun::star::lang::Locale& nLocale,
+ const ::com::sun::star::lang::Locale& nNewLocale )
+ throw(::com::sun::star::util::MalformedNumberFormatException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeByKey( sal_Int32 nKey ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::rtl::OUString SAL_CALL generateFormat( sal_Int32 nBaseKey,
+ const ::com::sun::star::lang::Locale& nLocale, sal_Bool bThousands,
+ sal_Bool bRed, sal_Int16 nDecimals, sal_Int16 nLeading )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XNumberFormatTypes
+ virtual sal_Int32 SAL_CALL getStandardIndex( const ::com::sun::star::lang::Locale& nLocale )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getStandardFormat( sal_Int16 nType,
+ const ::com::sun::star::lang::Locale& nLocale )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getFormatIndex( sal_Int16 nIndex,
+ const ::com::sun::star::lang::Locale& nLocale )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL isTypeCompatible( sal_Int16 nOldType, sal_Int16 nNewType )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getFormatForLocale( sal_Int32 nKey,
+ const ::com::sun::star::lang::Locale& nLocale )
+ throw(::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+class SvNumberFormatObj : public cppu::WeakImplHelper3<
+ com::sun::star::beans::XPropertySet,
+ com::sun::star::beans::XPropertyAccess,
+ com::sun::star::lang::XServiceInfo>
+{
+private:
+ SvNumberFormatsSupplierObj* pSupplier;
+ ULONG nKey;
+
+public:
+ SvNumberFormatObj(SvNumberFormatsSupplierObj* pParent, ULONG nK);
+ virtual ~SvNumberFormatObj();
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ SAL_CALL getPropertySetInfo( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Any& aValue )
+ 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);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
+ const ::rtl::OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XPropertyAccess
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL
+ getPropertyValues() throw(::com::sun::star::uno::RuntimeException);
+ 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);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+class SvNumberFormatSettingsObj : public cppu::WeakImplHelper2<
+ com::sun::star::beans::XPropertySet,
+ com::sun::star::lang::XServiceInfo>
+{
+private:
+ SvNumberFormatsSupplierObj* pSupplier;
+
+public:
+ SvNumberFormatSettingsObj(SvNumberFormatsSupplierObj* pParent);
+ virtual ~SvNumberFormatSettingsObj();
+
+
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo >
+ SAL_CALL getPropertySetInfo( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Any& aValue )
+ 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);
+ virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(
+ const ::rtl::OUString& PropertyName )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertyChangeListener >& xListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XPropertyChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName,
+ const ::com::sun::star::uno::Reference<
+ ::com::sun::star::beans::XVetoableChangeListener >& aListener )
+ throw(::com::sun::star::beans::UnknownPropertyException,
+ ::com::sun::star::lang::WrappedTargetException,
+ ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
+ throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
+ throw(::com::sun::star::uno::RuntimeException);
+};
+
+
+
+#endif
+
diff --git a/svtools/source/numbers/numhead.cxx b/svtools/source/numbers/numhead.cxx
new file mode 100644
index 000000000000..b9b5f5f2be00
--- /dev/null
+++ b/svtools/source/numbers/numhead.cxx
@@ -0,0 +1,323 @@
+/*************************************************************************
+ *
+ * $RCSfile: numhead.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+
+#include "numhead.hxx"
+
+// ID's fuer Dateien:
+#define SV_NUMID_SIZES 0x4200
+
+// STATIC DATA -----------------------------------------------------------
+
+//SEG_EOFGLOBALS()
+
+// =======================================================================
+/* wird fuer SvNumberformatter nicht gebraucht
+//#pragma SEG_FUNCDEF(numhead_01)
+
+SvNumReadHeader::SvNumReadHeader(SvStream& rNewStream) :
+ rStream( rNewStream )
+{
+ ULONG nDataSize;
+ rStream >> nDataSize;
+ nDataEnd = rStream.Tell() + nDataSize;
+}
+
+//#pragma SEG_FUNCDEF(numhead_02)
+
+SvNumReadHeader::~SvNumReadHeader()
+{
+ ULONG nReadEnd = rStream.Tell();
+ DBG_ASSERT( nReadEnd <= nDataEnd, "zuviele Bytes gelesen" );
+ if ( nReadEnd != nDataEnd )
+ rStream.Seek(nDataEnd); // Rest ueberspringen
+}
+
+//#pragma SEG_FUNCDEF(numhead_03)
+
+ULONG SvNumReadHeader::BytesLeft() const
+{
+ ULONG nReadEnd = rStream.Tell();
+ if (nReadEnd <= nDataEnd)
+ return nDataEnd-nReadEnd;
+
+ DBG_ERROR("Fehler bei SvNumReadHeader::BytesLeft");
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+//#pragma SEG_FUNCDEF(numhead_04)
+
+SvNumWriteHeader::SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault) :
+ rStream( rNewStream )
+{
+ nDataSize = nDefault;
+ rStream << nDataSize;
+ nDataPos = rStream.Tell();
+}
+
+//#pragma SEG_FUNCDEF(numhead_05)
+
+SvNumWriteHeader::~SvNumWriteHeader()
+{
+ ULONG nPos = rStream.Tell();
+
+ if ( nPos - nDataPos != nDataSize ) // Default getroffen?
+ {
+ nDataSize = nPos - nDataPos;
+ rStream.Seek(nDataPos - sizeof(ULONG));
+ rStream << nDataSize; // Groesse am Anfang eintragen
+ rStream.Seek(nPos);
+ }
+}
+*/
+
+// =======================================================================
+
+//#pragma SEG_FUNCDEF(numhead_06)
+
+//! mit Skip() synchron
+ImpSvNumMultipleReadHeader::ImpSvNumMultipleReadHeader(SvStream& rNewStream) :
+ rStream( rNewStream )
+{
+ ULONG nDataSize;
+ rStream >> nDataSize;
+ ULONG nDataPos = rStream.Tell();
+ nEntryEnd = nDataPos;
+
+ rStream.SeekRel(nDataSize);
+ USHORT nID;
+ rStream >> nID;
+ if (nID != SV_NUMID_SIZES)
+ {
+ DBG_ERROR("SV_NUMID_SIZES nicht gefunden");
+ }
+ ULONG nSizeTableLen;
+ rStream >> nSizeTableLen;
+ pBuf = new char[nSizeTableLen];
+ rStream.Read( pBuf, nSizeTableLen );
+ pMemStream = new SvMemoryStream( pBuf, nSizeTableLen, STREAM_READ );
+
+ nEndPos = rStream.Tell();
+ rStream.Seek( nDataPos );
+}
+
+//#pragma SEG_FUNCDEF(numhead_07)
+
+ImpSvNumMultipleReadHeader::~ImpSvNumMultipleReadHeader()
+{
+ DBG_ASSERT( pMemStream->Tell() == pMemStream->GetSize(),
+ "Sizes nicht vollstaendig gelesen" );
+ delete pMemStream;
+ delete pBuf;
+
+ rStream.Seek(nEndPos);
+}
+
+//! mit ctor synchron
+// static
+void ImpSvNumMultipleReadHeader::Skip( SvStream& rStream )
+{
+ ULONG nDataSize;
+ rStream >> nDataSize;
+ rStream.SeekRel( nDataSize );
+ USHORT nID;
+ rStream >> nID;
+ if ( nID != SV_NUMID_SIZES )
+ {
+ DBG_ERROR("SV_NUMID_SIZES nicht gefunden");
+ }
+ ULONG nSizeTableLen;
+ rStream >> nSizeTableLen;
+ rStream.SeekRel( nSizeTableLen );
+}
+
+//#pragma SEG_FUNCDEF(numhead_08)
+
+void ImpSvNumMultipleReadHeader::EndEntry()
+{
+ ULONG nPos = rStream.Tell();
+ DBG_ASSERT( nPos <= nEntryEnd, "zuviel gelesen" );
+ if ( nPos != nEntryEnd )
+ rStream.Seek( nEntryEnd ); // Rest ueberspringen
+}
+
+//#pragma SEG_FUNCDEF(numhead_0d)
+
+void ImpSvNumMultipleReadHeader::StartEntry()
+{
+ ULONG nPos = rStream.Tell();
+ ULONG nEntrySize;
+ (*pMemStream) >> nEntrySize;
+
+ nEntryEnd = nPos + nEntrySize;
+}
+
+//#pragma SEG_FUNCDEF(numhead_09)
+
+ULONG ImpSvNumMultipleReadHeader::BytesLeft() const
+{
+ ULONG nReadEnd = rStream.Tell();
+ if (nReadEnd <= nEntryEnd)
+ return nEntryEnd-nReadEnd;
+
+ DBG_ERROR("Fehler bei ImpSvNumMultipleReadHeader::BytesLeft");
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+//#pragma SEG_FUNCDEF(numhead_0a)
+
+ImpSvNumMultipleWriteHeader::ImpSvNumMultipleWriteHeader(SvStream& rNewStream,
+ ULONG nDefault) :
+ rStream( rNewStream ),
+ aMemStream( 4096, 4096 )
+{
+ nDataSize = nDefault;
+ rStream << nDataSize;
+
+ nDataPos = rStream.Tell();
+ nEntryStart = nDataPos;
+}
+
+//#pragma SEG_FUNCDEF(numhead_0b)
+
+ImpSvNumMultipleWriteHeader::~ImpSvNumMultipleWriteHeader()
+{
+ ULONG nDataEnd = rStream.Tell();
+
+ rStream << (USHORT) SV_NUMID_SIZES;
+ rStream << aMemStream.Tell();
+ rStream.Write( aMemStream.GetData(), aMemStream.Tell() );
+
+ if ( nDataEnd - nDataPos != nDataSize ) // Default getroffen?
+ {
+ nDataSize = nDataEnd - nDataPos;
+ ULONG nPos = rStream.Tell();
+ rStream.Seek(nDataPos-sizeof(ULONG));
+ rStream << nDataSize; // Groesse am Anfang eintragen
+ rStream.Seek(nPos);
+ }
+}
+
+//#pragma SEG_FUNCDEF(numhead_0c)
+
+void ImpSvNumMultipleWriteHeader::EndEntry()
+{
+ ULONG nPos = rStream.Tell();
+ aMemStream << nPos - nEntryStart;
+}
+
+//#pragma SEG_FUNCDEF(numhead_0e)
+
+void ImpSvNumMultipleWriteHeader::StartEntry()
+{
+ ULONG nPos = rStream.Tell();
+ nEntryStart = nPos;
+}
+
+
+/*------------------------------------------------------------------------
+
+ $Log: not supported by cvs2svn $
+ Revision 1.9 2000/09/18 14:13:40 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.8 2000/08/31 13:41:32 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.7 1999/04/06 15:24:24 ER
+ #64244# add: static ImpSvNumMultipleReadHeader Skip
+
+
+ Rev 1.6 06 Apr 1999 17:24:24 ER
+ #64244# add: static ImpSvNumMultipleReadHeader Skip
+
+ Rev 1.5 17 Oct 1997 14:31:08 ER
+ new: Keyword NNN, ,- ; Datumformate System/DIN, #.##0,-- ; Comments
+
+ Rev 1.4 30 Jul 1997 12:54:20 ER
+ onSave: StoreSYSTEM, onLoad: ConvertSystem; Header aufgeraeumt
+
+ Rev 1.3 22 Feb 1996 11:36:26 STE
+ imp imp imp
+
+ Rev 1.2 26 Jul 1995 19:35:14 STE
+ International
+
+ Rev 1.1 05 Jul 1995 17:04:42 STE
+ die ersten beiden Klassen auskommentiert
+
+ Rev 1.0 05 Jul 1995 16:28:20 STE
+ Initial revision.
+
+
+------------------------------------------------------------------------*/
+
+
+
diff --git a/svtools/source/numbers/numhead.hxx b/svtools/source/numbers/numhead.hxx
new file mode 100644
index 000000000000..ddc649d48929
--- /dev/null
+++ b/svtools/source/numbers/numhead.hxx
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: numhead.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef NF_NUMHEAD_HXX
+#define NF_NUMHEAD_HXX
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+// -----------------------------------------------------------------------
+
+ // "Automatischer" Record-Header mit Groessenangabe
+
+/* wird fuer SvNumberFormatter nicht gebraucht
+class SvNumReadHeader
+{
+private:
+ SvStream& rStream;
+ ULONG nDataEnd;
+
+public:
+ SvNumReadHeader(SvStream& rNewStream);
+ ~SvNumReadHeader();
+
+ ULONG BytesLeft() const;
+};
+
+class SvNumWriteHeader
+{
+private:
+ SvStream& rStream;
+ ULONG nDataPos;
+ ULONG nDataSize;
+
+public:
+ SvNumWriteHeader(SvStream& rNewStream, ULONG nDefault = 0);
+ ~SvNumWriteHeader();
+};
+
+*/
+
+ // Header mit Groessenangaben fuer mehrere Objekte
+
+class ImpSvNumMultipleReadHeader
+{
+private:
+ SvStream& rStream;
+ char* pBuf;
+ SvMemoryStream* pMemStream;
+ ULONG nEndPos;
+ ULONG nEntryEnd;
+
+public:
+ ImpSvNumMultipleReadHeader(SvStream& rNewStream);
+ ~ImpSvNumMultipleReadHeader();
+
+ void StartEntry();
+ void EndEntry();
+ ULONG BytesLeft() const;
+
+ static void Skip( SvStream& ); // komplett ueberspringen
+};
+
+class ImpSvNumMultipleWriteHeader
+{
+private:
+ SvStream& rStream;
+ SvMemoryStream aMemStream;
+ ULONG nDataPos;
+ ULONG nDataSize;
+ ULONG nEntryStart;
+
+public:
+ ImpSvNumMultipleWriteHeader(SvStream& rNewStream, ULONG nDefault = 0);
+ ~ImpSvNumMultipleWriteHeader();
+
+ void StartEntry();
+ void EndEntry();
+};
+
+#endif
+
+
diff --git a/svtools/source/numbers/numuno.cxx b/svtools/source/numbers/numuno.cxx
new file mode 100644
index 000000000000..c1ad79fe6d3e
--- /dev/null
+++ b/svtools/source/numbers/numuno.cxx
@@ -0,0 +1,193 @@
+/*************************************************************************
+ *
+ * $RCSfile: numuno.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#define _ZFORLIST_DECLARE_TABLE
+
+#include <vcl/svapp.hxx>
+#include <vcl/color.hxx>
+#include <tools/debug.hxx>
+#include <vos/mutex.hxx>
+#include <osl/mutex.hxx>
+#include <rtl/uuid.h>
+
+#include "numuno.hxx"
+#include "numfmuno.hxx"
+#include "zforlist.hxx"
+
+using namespace com::sun::star;
+
+//------------------------------------------------------------------------
+
+class SvNumFmtSuppl_Impl
+{
+public:
+ SvNumberFormatter* pFormatter;
+
+ SvNumFmtSuppl_Impl(SvNumberFormatter* p) :
+ pFormatter(p) {}
+};
+
+//------------------------------------------------------------------------
+
+// Default-ctor fuer getReflection
+SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj()
+{
+ pImpl = new SvNumFmtSuppl_Impl(NULL);
+}
+
+SvNumberFormatsSupplierObj::SvNumberFormatsSupplierObj(SvNumberFormatter* pForm)
+{
+ pImpl = new SvNumFmtSuppl_Impl(pForm);
+}
+
+SvNumberFormatsSupplierObj::~SvNumberFormatsSupplierObj()
+{
+ delete pImpl;
+}
+
+SvNumberFormatter* SvNumberFormatsSupplierObj::GetNumberFormatter() const
+{
+ return pImpl->pFormatter;
+}
+
+void SvNumberFormatsSupplierObj::SetNumberFormatter(SvNumberFormatter* pNew)
+{
+ // der alte Numberformatter ist ungueltig geworden, nicht mehr darauf zugreifen!
+ pImpl->pFormatter = pNew;
+}
+
+void SvNumberFormatsSupplierObj::NumberFormatDeleted(ULONG nKey)
+{
+ // Basis-Implementierung tut nix...
+}
+
+void SvNumberFormatsSupplierObj::SettingsChanged()
+{
+ // Basis-Implementierung tut nix...
+}
+
+// XNumberFormatsSupplier
+
+uno::Reference<beans::XPropertySet> SAL_CALL SvNumberFormatsSupplierObj::getNumberFormatSettings()
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ return new SvNumberFormatSettingsObj( this );
+}
+
+uno::Reference<util::XNumberFormats> SAL_CALL SvNumberFormatsSupplierObj::getNumberFormats()
+ throw(uno::RuntimeException)
+{
+ NAMESPACE_VOS(OGuard) aGuard(Application::GetSolarMutex());
+
+ return new SvNumberFormatsObj( this );
+}
+
+// XUnoTunnel
+
+sal_Int64 SAL_CALL SvNumberFormatsSupplierObj::getSomething(
+ const uno::Sequence<sal_Int8 >& rId ) throw(uno::RuntimeException)
+{
+ if ( rId.getLength() == 16 &&
+ 0 == rtl_compareMemory( getUnoTunnelId().getConstArray(),
+ rId.getConstArray(), 16 ) )
+ {
+ return (sal_Int64)this;
+ }
+ return 0;
+}
+
+// static
+const uno::Sequence<sal_Int8>& SvNumberFormatsSupplierObj::getUnoTunnelId()
+{
+ static uno::Sequence<sal_Int8> * pSeq = 0;
+ if( !pSeq )
+ {
+ osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() );
+ if( !pSeq )
+ {
+ static uno::Sequence< sal_Int8 > aSeq( 16 );
+ rtl_createUuid( (sal_uInt8*)aSeq.getArray(), 0, sal_True );
+ pSeq = &aSeq;
+ }
+ }
+ return *pSeq;
+}
+
+// static
+SvNumberFormatsSupplierObj* SvNumberFormatsSupplierObj::getImplementation(
+ const uno::Reference<util::XNumberFormatsSupplier> xObj )
+{
+ SvNumberFormatsSupplierObj* pRet = NULL;
+ uno::Reference<lang::XUnoTunnel> xUT( xObj, uno::UNO_QUERY );
+ if (xUT.is())
+ pRet = (SvNumberFormatsSupplierObj*) xUT->getSomething( getUnoTunnelId() );
+ return pRet;
+}
+
+
+//------------------------------------------------------------------------
+
+
+
diff --git a/svtools/source/numbers/supservs.cxx b/svtools/source/numbers/supservs.cxx
new file mode 100644
index 000000000000..2d31a835bbb0
--- /dev/null
+++ b/svtools/source/numbers/supservs.cxx
@@ -0,0 +1,264 @@
+/*************************************************************************
+ *
+ * $RCSfile: supservs.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
+#include "supservs.hxx"
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_LOCALE_HPP_
+#include <com/sun/star/lang/Locale.hpp>
+#endif
+
+#ifndef _ISOLANG_HXX
+#include <tools/isolang.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _VOS_MUTEX_HXX_
+#include <vos/mutex.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+#ifndef SVTOOLS_STRMADPT_HXX
+#include <strmadpt.hxx>
+#endif
+#ifndef SVTOOLS_INSTRM_HXX
+#include "instrm.hxx"
+#endif
+
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::lang;
+using namespace ::com::sun::star::io;
+using namespace ::com::sun::star::beans;
+using namespace ::com::sun::star::util;
+using namespace ::vos;
+
+#define PERSISTENT_SERVICE_NAME ::rtl::OUString::createFromAscii("com.sun.star.util.NumberFormatsSupplier");
+
+//-------------------------------------------------------------------------
+Reference< XInterface > SAL_CALL SvNumberFormatsSupplierServiceObject_CreateInstance(const Reference< XMultiServiceFactory >& /* _rxFactory */)
+{
+ return static_cast< ::cppu::OWeakObject* >(new SvNumberFormatsSupplierServiceObject);
+}
+
+//-------------------------------------------------------------------------
+SvNumberFormatsSupplierServiceObject::SvNumberFormatsSupplierServiceObject()
+ :m_pOwnFormatter(NULL)
+{
+}
+
+//-------------------------------------------------------------------------
+SvNumberFormatsSupplierServiceObject::~SvNumberFormatsSupplierServiceObject()
+{
+ if (m_pOwnFormatter)
+ {
+ delete m_pOwnFormatter;
+ m_pOwnFormatter = NULL;
+ }
+}
+
+//-------------------------------------------------------------------------
+Any SAL_CALL SvNumberFormatsSupplierServiceObject::queryAggregation( const Type& _rType ) throw (RuntimeException)
+{
+ Any aReturn = ::cppu::queryInterface(_rType,
+ static_cast< XInitialization* >(this),
+ static_cast< XPersistObject* >(this),
+ static_cast< XServiceInfo* >(this)
+ );
+
+ if (!aReturn.hasValue())
+ aReturn = SvNumberFormatsSupplierObj::queryAggregation(_rType);
+
+ return aReturn;
+}
+
+//-------------------------------------------------------------------------
+void SAL_CALL SvNumberFormatsSupplierServiceObject::initialize( const Sequence< Any >& _rArguments ) throw(Exception, RuntimeException)
+{
+ OGuard aGuard(Application::GetSolarMutex());
+ // the mutex of the base class .... hope we have a real (i.e. own) mutex sometimes
+
+ DBG_ASSERT(m_pOwnFormatter == NULL,
+ "SvNumberFormatsSupplierServiceObject::initialize : already initialized !");
+ // maybe you already called a method which needed the formatter
+ // you should use XMultiServiceFactory::createInstanceWithArguments to avoid that
+ if (m_pOwnFormatter)
+ { // !!! this is only a emergency handling, normally this should not occur !!!
+ delete m_pOwnFormatter;
+ m_pOwnFormatter = NULL;
+ SetNumberFormatter(m_pOwnFormatter);
+ }
+
+ Type aExpectedArgType = ::getCppuType(static_cast<Locale*>(NULL));
+ LanguageType eNewFormatterLanguage = LANGUAGE_ENGLISH_US;
+ // the default
+
+ const Any* pArgs = _rArguments.getConstArray();
+ for (sal_Int32 i=0; i<_rArguments.getLength(); ++i, ++pArgs)
+ {
+ if (pArgs->getValueType().equals(aExpectedArgType))
+ {
+ Locale aLocale;
+ *pArgs >>= aLocale;
+ eNewFormatterLanguage = ConvertIsoNamesToLanguage(aLocale.Language, aLocale.Country);
+ }
+#if DBG_UTIL
+ else
+ {
+ DBG_ERROR("SvNumberFormatsSupplierServiceObject::initialize : unknown argument !");
+ }
+#endif
+ }
+
+ m_pOwnFormatter = new SvNumberFormatter(eNewFormatterLanguage);
+ SetNumberFormatter(m_pOwnFormatter);
+}
+
+//-------------------------------------------------------------------------
+::rtl::OUString SAL_CALL SvNumberFormatsSupplierServiceObject::getImplementationName( ) throw(RuntimeException)
+{
+ return ::rtl::OUString::createFromAscii("com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject");
+}
+
+//-------------------------------------------------------------------------
+sal_Bool SAL_CALL SvNumberFormatsSupplierServiceObject::supportsService( const ::rtl::OUString& _rServiceName ) throw(RuntimeException)
+{
+ Sequence< ::rtl::OUString > aServices = getSupportedServiceNames();
+ const ::rtl::OUString* pServices = aServices.getConstArray();
+ for (sal_Int32 i=0; i<aServices.getLength(); ++i, ++pServices)
+ if (pServices->equals(_rServiceName))
+ return sal_True;
+
+ return sal_False;
+}
+
+//-------------------------------------------------------------------------
+Sequence< ::rtl::OUString > SAL_CALL SvNumberFormatsSupplierServiceObject::getSupportedServiceNames( ) throw(RuntimeException)
+{
+ Sequence< ::rtl::OUString > aSupported(1);
+ aSupported.getArray()[0] = PERSISTENT_SERVICE_NAME;
+ return aSupported;
+}
+
+//-------------------------------------------------------------------------
+::rtl::OUString SAL_CALL SvNumberFormatsSupplierServiceObject::getServiceName( ) throw(RuntimeException)
+{
+ return PERSISTENT_SERVICE_NAME;
+}
+
+//-------------------------------------------------------------------------
+void SAL_CALL SvNumberFormatsSupplierServiceObject::write( const Reference< XObjectOutputStream >& _rxOutStream ) throw(IOException, RuntimeException)
+{
+ OGuard aGuard(Application::GetSolarMutex());
+ implEnsureFormatter();
+
+ Reference< XOutputStream > xStream(_rxOutStream.get());
+ SvLockBytesRef aLockBytes = new SvOutputStreamOpenLockBytes(xStream);
+ SvStream aSvOutputSteam(aLockBytes);
+
+ m_pOwnFormatter->Save(aSvOutputSteam);
+}
+
+//-------------------------------------------------------------------------
+void SAL_CALL SvNumberFormatsSupplierServiceObject::read( const Reference< XObjectInputStream >& _rxInStream ) throw(IOException, RuntimeException)
+{
+ OGuard aGuard(Application::GetSolarMutex());
+ implEnsureFormatter();
+
+ Reference< XInputStream > xStream(_rxInStream.get());
+ SvInputStream aSvInputSteam(xStream);
+
+ m_pOwnFormatter->Load(aSvInputSteam);
+}
+
+//-------------------------------------------------------------------------
+Reference< XPropertySet > SAL_CALL SvNumberFormatsSupplierServiceObject::getNumberFormatSettings() throw(RuntimeException)
+{
+ OGuard aGuard(Application::GetSolarMutex());
+ implEnsureFormatter();
+ return SvNumberFormatsSupplierObj::getNumberFormatSettings();
+}
+
+//-------------------------------------------------------------------------
+Reference< XNumberFormats > SAL_CALL SvNumberFormatsSupplierServiceObject::getNumberFormats() throw(RuntimeException)
+{
+ OGuard aGuard(Application::GetSolarMutex());
+ implEnsureFormatter();
+ return SvNumberFormatsSupplierObj::getNumberFormats();
+}
+
+//-------------------------------------------------------------------------
+void SvNumberFormatsSupplierServiceObject::implEnsureFormatter()
+{
+ if (!m_pOwnFormatter)
+ {
+ DBG_ERROR("SvNumberFormatsSupplierServiceObject::implEnsureFormatter : forced to initialize with a default language !");
+ // you should use XMultiServiceFactory::createInstanceWithArguments (with an Locale as parameter)
+ m_pOwnFormatter = new SvNumberFormatter(LANGUAGE_ENGLISH_US);
+ SetNumberFormatter(m_pOwnFormatter);
+ }
+}
+
diff --git a/svtools/source/numbers/supservs.hxx b/svtools/source/numbers/supservs.hxx
new file mode 100644
index 000000000000..b47ce9b22f20
--- /dev/null
+++ b/svtools/source/numbers/supservs.hxx
@@ -0,0 +1,142 @@
+/*************************************************************************
+ *
+ * $RCSfile: supservs.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
+#define _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
+
+#ifndef _NUMUNO_HXX
+#include "numuno.hxx"
+#endif
+#ifndef _ZFORLIST_HXX
+#include "zforlist.hxx"
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
+#include <com/sun/star/lang/XInitialization.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+#ifndef _COM_SUN_STAR_IO_XPERSISTOBJECT_HPP_
+#include <com/sun/star/io/XPersistObject.hpp>
+#endif
+
+//=========================================================================
+//= SvNumberFormatsSupplierServiceObject - a number formats supplier which
+//= - can be instantiated as an service
+//= - supports the ::com::sun::star::io::XPersistObject interface
+//= - works with it's own SvNumberFormatter instance
+//= - can be initialized (::com::sun::star::lang::XInitialization)
+//= with a specific language (i.e. ::com::sun::star::lang::Locale)
+//=========================================================================
+class SvNumberFormatsSupplierServiceObject
+ :protected SvNumberFormatsSupplierObj
+ ,public ::com::sun::star::lang::XInitialization
+ ,public ::com::sun::star::io::XPersistObject
+ ,public ::com::sun::star::lang::XServiceInfo
+{ // don't want the Set-/GetNumberFormatter to be accessable from outside
+
+ friend ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
+ SAL_CALL SvNumberFormatsSupplierServiceObject_CreateInstance(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
+
+protected:
+ SvNumberFormatter* m_pOwnFormatter;
+
+public:
+ SvNumberFormatsSupplierServiceObject();
+ ~SvNumberFormatsSupplierServiceObject();
+
+ // XInterface
+ virtual void SAL_CALL acquire() { SvNumberFormatsSupplierObj::acquire(); }
+ virtual void SAL_CALL release() { SvNumberFormatsSupplierObj::release(); }
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException)
+ { return SvNumberFormatsSupplierObj::queryInterface(_rType); }
+
+ // XAggregation
+ virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XInitialization
+ virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw(::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
+
+ // XServiceInfo
+ virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XPersistObject
+ virtual ::rtl::OUString SAL_CALL getServiceName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL write( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream >& OutStream ) 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 >& InStream ) throw(::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+
+ // XNumberFormatsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL
+ getNumberFormatSettings() throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormats > SAL_CALL
+ getNumberFormats() throw(::com::sun::star::uno::RuntimeException);
+
+protected:
+ void implEnsureFormatter();
+};
+
+
+#endif // _SVTOOLS_NUMBERS_SUPPLIERSERVICE_HXX_
+
diff --git a/svtools/source/numbers/zforfind.cxx b/svtools/source/numbers/zforfind.cxx
new file mode 100644
index 000000000000..9c616ab39463
--- /dev/null
+++ b/svtools/source/numbers/zforfind.cxx
@@ -0,0 +1,2316 @@
+/*************************************************************************
+ *
+ * $RCSfile: zforfind.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <float.h>
+
+#ifndef _INTN_HXX //autogen
+#include <tools/intn.hxx>
+#endif
+#ifndef _DATE_HXX //autogen
+#include <tools/date.hxx>
+#endif
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _UNOTOOLS_CHARCLASS_HXX
+#include <unotools/charclass.hxx>
+#endif
+
+#include "zforlist.hxx" // NUMBERFORMAT_XXX
+#include "zforscan.hxx"
+#include "zformat.hxx"
+
+#define _ZFORFIND_CXX
+#include "zforfind.hxx"
+#undef _ZFORFIND_CXX
+
+
+// wenn's geht das schnellere isdigit benutzen
+#ifdef ENABLEUNICODE
+//#define MyIsdigit(c) (pFormatter->GetCharClass()->isDigit(c))
+#define MyIsdigit(c) ((c) < 256 && isdigit((unsigned char)(c)))
+#else
+#define MyIsdigit(c) (isdigit((unsigned xub_Unicode)(c)))
+#endif
+
+//---------------------------------------------------------------------------
+// Konstruktor
+
+ImpSvNumberInputScan::ImpSvNumberInputScan( SvNumberFormatter* pFormatterP )
+{
+ pFormatter = pFormatterP;
+ pNullDate = new Date(30,12,1899);
+ nYear2000 = SvNumberFormatter::GetYear2000Default();
+ Reset();
+ ChangeIntl();
+}
+
+
+//---------------------------------------------------------------------------
+// Destruktor
+
+ImpSvNumberInputScan::~ImpSvNumberInputScan()
+{
+ Reset();
+ delete pNullDate;
+}
+
+
+//---------------------------------------------------------------------------
+// Reset
+
+void ImpSvNumberInputScan::Reset()
+{
+#if 0
+// ER 16.06.97 18:56 Vorbelegung erfolgt jetzt in NumberStringDivision,
+// wozu immer alles loeschen wenn einiges wieder benutzt oder gar nicht
+// gebraucht wird..
+ for (USHORT i = 0; i < SV_MAX_ANZ_INPUT_STRINGS; i++)
+ {
+ sStrArray[i].Erase();
+ nNums[i] = SV_MAX_ANZ_INPUT_STRINGS-1;
+ IsNum[i] = FALSE;
+ }
+#endif
+ nMonth = 0;
+ nMonthPos = 0;
+ nTimePos = 0;
+ nSign = 0;
+ nESign = 0;
+ nDecPos = 0;
+ nNegCheck = 0;
+ nAnzStrings = 0;
+ nAnzNums = 0;
+ nThousand = 0;
+ eScannedType = NUMBERFORMAT_UNDEFINED;
+ nAmPm = 0;
+ nPosThousandString = 0;
+ nLogical = 0;
+ nStringScanNumFor = 0;
+ nStringScanSign = 0;
+}
+
+
+//---------------------------------------------------------------------------
+// StringToDouble
+//
+// nur Vorzeichenlose Dezimalzahlen
+
+double ImpSvNumberInputScan::StringToDouble( const XubString& rStr )
+{
+ double fNum = 0.0;
+ xub_StrLen nPos = 0;
+ xub_StrLen nLen = rStr.Len();
+ FASTBOOL bPreComma = TRUE;
+ double fBas;
+
+ while (nPos < nLen)
+ {
+ if (rStr.GetChar(nPos) == '.')
+ {
+ bPreComma = FALSE;
+ fBas = 1.0;
+ }
+ else if (bPreComma)
+ {
+ fNum *= 10.0;
+ fNum += (double) (rStr.GetChar(nPos)-'0');
+ }
+ else
+ {
+ fBas *= 10.0;
+ fNum += ((double)(rStr.GetChar(nPos)-'0'))/fBas;
+ }
+ nPos++;
+ }
+ return fNum;
+}
+
+
+//---------------------------------------------------------------------------
+// NextNumberStringSymbol
+//
+// Zerlegt die Eingabe in Zahlen und Strings fuer die weitere
+// Verarbeitung (Turing-Maschine).
+//---------------------------------------------------------------------------
+// Ausgangs Zustand = GetChar
+//---------------+-------------------+-----------------------+---------------
+// Alter Zustand | gelesenes Zeichen | Aktion | Neuer Zustand
+//---------------+-------------------+-----------------------+---------------
+// GetChar | Ziffer | Symbol=Zeichen | GetValue
+// | Sonst | Symbol=Zeichen | GetString
+//---------------|-------------------+-----------------------+---------------
+// GetValue | Ziffer | Symbol=Symbol+Zeichen | GetValue
+// | Sonst | Dec(CharPos) | Stop
+//---------------+-------------------+-----------------------+---------------
+// GetString | Ziffer | Dec(CharPos) | Stop
+// | Sonst | Symbol=Symbol+Zeichen | GetString
+//---------------+-------------------+-----------------------+---------------
+
+enum ScanState // States der Turing-Maschine
+{
+ SsStop = 0,
+ SsStart = 1,
+ SsGetValue = 2,
+ SsGetString = 3
+};
+
+BOOL ImpSvNumberInputScan::NextNumberStringSymbol(
+ const xub_Unicode*& pStr,
+ XubString& rSymbol )
+{
+ BOOL isNumber = FALSE;
+ xub_Unicode cToken;
+ ScanState eState = SsStart;
+ register const xub_Unicode* pHere = pStr;
+ register xub_StrLen nChars = 0;
+
+ while ( ((cToken = *pHere) != 0) && eState != SsStop)
+ {
+ pHere++;
+ switch (eState)
+ {
+ case SsStart:
+ if ( MyIsdigit( cToken ) )
+ {
+ eState = SsGetValue;
+ isNumber = TRUE;
+ }
+ else
+ eState = SsGetString;
+ nChars++;
+ break;
+ case SsGetValue:
+ if ( MyIsdigit( cToken ) )
+ nChars++;
+ else
+ {
+ eState = SsStop;
+ pHere--;
+ }
+ break;
+ case SsGetString:
+ if ( !MyIsdigit( cToken ) )
+ nChars++;
+ else
+ {
+ eState = SsStop;
+ pHere--;
+ }
+ break;
+ default:
+ break;
+ } // switch
+ } // while
+
+ if ( nChars )
+ rSymbol.Assign( pStr, nChars );
+ else
+ rSymbol.Erase();
+
+ pStr = pHere;
+
+ return isNumber;
+}
+
+
+//---------------------------------------------------------------------------
+// SkipThousands
+
+BOOL ImpSvNumberInputScan::SkipThousands(
+ const xub_Unicode*& pStr,
+ XubString& rSymbol )
+{
+ BOOL res = FALSE;
+ xub_Unicode cToken;
+ register const xub_Unicode* pHere = pStr;
+ ScanState eState = SsStart;
+ xub_StrLen nCounter; // zaehlt 3er Paare
+
+ while ( ((cToken = *pHere) != 0) && eState != SsStop)
+ {
+ pHere++;
+ switch (eState)
+ {
+ case SsStart:
+ if (cToken == pFormatter->GetInternational()->GetNumThousandSep())
+ {
+ nCounter = 0;
+ eState = SsGetValue;
+ }
+ else
+ {
+ eState = SsStop;
+ pHere--;
+ }
+ break;
+ case SsGetValue:
+ if ( MyIsdigit( cToken ) )
+ {
+ rSymbol += cToken;
+ nCounter++;
+ if (nCounter == 3)
+ {
+ eState = SsStart;
+ res = TRUE; // .000 Kombination gef.
+ }
+ }
+ else
+ {
+ eState = SsStop;
+ pHere--;
+ }
+ break;
+ default:
+ break;
+ } // switch
+ } // while
+
+ if (eState == SsGetValue) // Abbruch mit weniger als 3 St.
+ {
+ if ( nCounter )
+ rSymbol.Erase( rSymbol.Len() - nCounter, nCounter );
+ pHere -= nCounter + 1; // auch . mit zurueck
+ }
+ pStr = pHere;
+
+ return res;
+}
+
+
+//---------------------------------------------------------------------------
+// NumberStringDivision
+
+void ImpSvNumberInputScan::NumberStringDivision( const XubString& rString )
+{
+ register const xub_Unicode* pStr = rString.GetBuffer();
+ register const xub_Unicode* const pEnd = pStr + rString.Len();
+ while ( pStr < pEnd && nAnzStrings < SV_MAX_ANZ_INPUT_STRINGS )
+ {
+ if ( NextNumberStringSymbol( pStr, sStrArray[nAnzStrings] ) )
+ { // Zahl
+ IsNum[nAnzStrings] = TRUE;
+ nNums[nAnzNums] = nAnzStrings;
+ nAnzNums++;
+ if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS - 7 &&
+ nPosThousandString == 0) // nur einmal
+ if ( SkipThousands( pStr, sStrArray[nAnzStrings] ) )
+ nPosThousandString = nAnzStrings;
+ }
+ else
+ {
+ IsNum[nAnzStrings] = FALSE;
+ }
+ nAnzStrings++;
+ }
+}
+
+
+//---------------------------------------------------------------------------
+// if rString contains rWhat at nPos
+
+BOOL ImpSvNumberInputScan::StringContains( const XubString& rWhat,
+ const XubString& rString, xub_StrLen nPos )
+{
+ if ( nPos + rWhat.Len() <= rString.Len() )
+ {
+ register const xub_Unicode* pWhat = rWhat.GetBuffer();
+ register const xub_Unicode* const pEnd = pWhat + rWhat.Len();
+ register const xub_Unicode* pStr = rString.GetBuffer() + nPos;
+ while ( pWhat < pEnd )
+ {
+ if ( *pWhat != *pStr )
+ return FALSE;
+ pWhat++;
+ pStr++;
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// SkipChar
+//
+// ueberspringt genau das angegebene Zeichen
+
+inline BOOL ImpSvNumberInputScan::SkipChar( xub_Unicode c, const XubString& rString,
+ xub_StrLen& nPos )
+{
+ if ((nPos < rString.Len()) && (rString.GetChar(nPos) == c))
+ {
+ nPos++;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// SkipBlanks
+//
+// Ueberspringt Leerzeichen
+
+inline void ImpSvNumberInputScan::SkipBlanks( const XubString& rString,
+ xub_StrLen& nPos )
+{
+ if ( nPos < rString.Len() )
+ {
+ register const xub_Unicode* p = rString.GetBuffer() + nPos;
+ while ( *p == ' ' )
+ {
+ nPos++;
+ p++;
+ }
+ }
+}
+
+
+//---------------------------------------------------------------------------
+// SkipString
+//
+// jump over rWhat in rString at nPos
+
+inline BOOL ImpSvNumberInputScan::SkipString( const XubString& rWhat,
+ const XubString& rString, xub_StrLen& nPos )
+{
+ if ( StringContains( rWhat, rString, nPos ) )
+ {
+ nPos += rWhat.Len();
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// GetThousandSep
+//
+// erkennt genau .111 als Tausenderpunkt
+
+inline BOOL ImpSvNumberInputScan::GetThousandSep(
+ const XubString& rString,
+ xub_StrLen& nPos,
+ USHORT nStringPos )
+{
+ if ( rString.Len() == 1 // keine Blanks
+ && nPos == 0 // safety first!
+ && rString.GetChar(nPos) == pFormatter->GetInternational()->GetNumThousandSep() // '.'
+ && nStringPos < nAnzStrings - 1 // safety first!
+ && IsNum[nStringPos+1] // Zahl folgt
+ && ( sStrArray[nStringPos+1].Len() == 3 // mit 3 Stellen
+ || nPosThousandString == nStringPos+1 ) ) // oder bereits zusammengefasst
+ {
+ nPos++;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// GetLogical
+//
+// Umwandlung Text in logischen Wert
+// "TRUE" => 1:
+// "FALSE"=> -1:
+// sonst => 0:
+
+short ImpSvNumberInputScan::GetLogical( const XubString& rString )
+{
+ short res;
+
+ if (rString.Len() < 4) // kein Platz fuer mind 4 Buch.
+ res = 0;
+ else
+ {
+ const xub_Unicode *pTrue, *pFalse;
+ LanguageType eLnge = pFormatter->GetInternational()->GetLanguage();
+ ImpSvNumberformatScan::GetLogicalKeywords( eLnge, pTrue, pFalse );
+#if 0
+// NoMoreUpperNeeded
+ XubString sBool( pTrue );
+ USHORT nLen = rString.Len();
+ if ( nLen == sBool.Len() && pFormatter->GetInternational()->CompareEqual(
+ rString, sBool, INTN_COMPARE_IGNORECASE ) )
+ { // zuerst True
+ res = 1; // True -> 1
+ }
+ else
+ {
+ sBool = pFalse;
+ if ( nLen == sBool.Len() && pFormatter->GetInternational()->CompareEqual(
+ rString, sBool, INTN_COMPARE_IGNORECASE ) )
+ { // dann False
+ res = -1; // False -> -1
+ }
+ else
+ res = 0; // sonst -> 0
+ }
+#else
+ if ( rString == pTrue )
+ res = 1;
+ else if ( rString == pFalse )
+ res = -1;
+ else
+ res = 0;
+#endif
+ }
+
+ return res;
+}
+
+
+//---------------------------------------------------------------------------
+// GetMonth
+//
+// Wandelt String mit Monatsbezeichnung (JAN, Januar) in Zahl des Monats um
+// gibt 0 zurueck, wenn nix gefunden wird.
+
+short ImpSvNumberInputScan::GetMonth( const XubString& rString, xub_StrLen& nPos )
+{
+ short res = 0;
+
+ if (rString.Len() > nPos) // nur wenn Platz
+ {
+ if ( !bTextInitialized )
+ InitText();
+// XubString sString( pFormatter->GetCharClass()->upper(rString) ); // NoMoreUpperNeeded
+ for (int i = 0; i < 12; i++) // 12 Monate
+ {
+ if ( StringContains( aUpperMonthText[i], rString, nPos ) )
+ { // zuerst den langen
+ nPos += aUpperMonthText[i].Len();
+ res = i+1; // lange positiv
+ break; // Ende for
+ }
+ else if ( StringContains( aUpperAbbrevMonthText[i], rString, nPos ) )
+ { // dann den kurzen
+ nPos += aUpperAbbrevMonthText[i].Len();
+ res = -(i+1); // kurze negativ
+ break; // Ende for
+ }
+ }
+ }
+
+ return res; // kein Monat gefunden
+}
+
+
+//---------------------------------------------------------------------------
+// GetDayOfWeek
+//
+// Wandelt String mit Wochentagname (Mo, Montag) in Zahl des Wochentags um
+// (enum DayOfWeek + 1 !), gibt 0 zurueck, wenn nix gefunden wird.
+
+short ImpSvNumberInputScan::GetDayOfWeek( const XubString& rString, xub_StrLen& nPos )
+{
+ short res = 0;
+
+ if (rString.Len() > nPos) // nur wenn Platz
+ {
+ if ( !bTextInitialized )
+ InitText();
+// XubString sString( pFormatter->GetCharClass()->upper(rString) ); // NoMoreUpperNeeded
+ for (short i = 0; i < 7; i++) // 7 Wochentage
+ {
+ if ( StringContains( aUpperDayText[i], rString, nPos ) )
+ { // zuerst den langen
+ nPos += aUpperDayText[i].Len();
+ res = i + 1; // lange positiv
+ break; // Ende for
+ }
+ if ( StringContains( aUpperAbbrevDayText[i], rString, nPos ) )
+ { // dann den kurzen
+ nPos += aUpperAbbrevDayText[i].Len();
+ res = -(i + 1); // kurze negativ
+ break; // Ende for
+ }
+ }
+ }
+
+ return res;
+}
+
+
+//---------------------------------------------------------------------------
+// GetCurrency
+//
+// Lesen eines Waehrungssysmbols
+// '$' => TRUE
+// sonst => FALSE
+
+BOOL ImpSvNumberInputScan::GetCurrency( const XubString& rString, xub_StrLen& nPos,
+ const SvNumberformat* pFormat )
+{
+ if ( rString.Len() > nPos )
+ {
+ if ( !bTextInitialized )
+ InitText();
+// XubString sString( pFormatter->GetCharClass()->upper(rString) ); // NoMoreUpperNeeded
+ if ( StringContains( aUpperCurrSymbol, rString, nPos ) )
+ {
+ nPos += aUpperCurrSymbol.Len();
+ return TRUE;
+ }
+ if ( pFormat )
+ {
+ XubString aSymbol, aExtension;
+ if ( pFormat->GetNewCurrencySymbol( aSymbol, aExtension ) )
+ {
+ if ( aSymbol.Len() <= rString.Len() - nPos )
+ {
+ pFormatter->GetCharClass()->toUpper( aSymbol );
+ if ( StringContains( aSymbol, rString, nPos ) )
+ {
+ nPos += aSymbol.Len();
+ return TRUE;
+ }
+ }
+ }
+ }
+ }
+
+ return FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// GetTimeAmPm
+//
+// Lesen des Zeitsymbols (AM od. PM) f. kurze Zeitangabe
+//
+// Rueckgabe:
+// "AM" od. "PM" => TRUE
+// sonst => FALSE
+//
+// nAmPos:
+// "AM" => 1
+// "PM" => -1
+// sonst => 0
+
+BOOL ImpSvNumberInputScan::GetTimeAmPm( const XubString& rString, xub_StrLen& nPos )
+{
+// XubString sString( pFormatter->GetCharClass()->upper(rString) ); // NoMoreUpperNeeded
+
+ //! Internationalisierung?
+ static const XubString aUpperAM( RTL_CONSTASCII_USTRINGPARAM( "AM" ) );
+ static const XubString aUpperPM( RTL_CONSTASCII_USTRINGPARAM( "PM" ) );
+
+ if ( rString.Len() > nPos )
+ {
+ if ( StringContains( aUpperAM, rString, nPos ) )
+ {
+ nAmPm = 1;
+ nPos += aUpperAM.Len();
+ return TRUE;
+ }
+ else if ( StringContains( aUpperPM, rString, nPos ) )
+ {
+ nAmPm = -1;
+ nPos += aUpperPM.Len();
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// GetDecSep
+//
+// Lesen eines Dezimaltrenners (',')
+// ',' => TRUE
+// sonst => FALSE
+
+inline BOOL ImpSvNumberInputScan::GetDecSep( const XubString& rString, xub_StrLen& nPos )
+{
+ if ( rString.Len() > nPos
+ && rString.GetChar(nPos) == pFormatter->GetInternational()->GetNumDecimalSep() )
+ {
+ nPos++;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// GetSign
+//
+// Lesen eines Vorzeichens, auch Klammer !?!
+// '+' => 1
+// '-' => -1
+// '(' => -1, nNegCheck = 1
+// sonst => 0
+
+short ImpSvNumberInputScan::GetSign( const XubString& rString, xub_StrLen& nPos )
+{
+ if (rString.Len() > nPos)
+ switch (rString.GetChar(nPos))
+ {
+ case '+':
+ nPos++;
+ return 1;
+ break;
+ case '(': // '(' aehnlich wie '-' ?!?
+ nNegCheck = 1;
+ //! fallthru
+ case '-':
+ nPos++;
+ return -1;
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+
+//---------------------------------------------------------------------------
+// GetESign
+//
+// Lesen eines Vorzeichens, gedacht fuer Exponent ?!?
+// '+' => 1
+// '-' => -1
+// sonst => 0
+
+short ImpSvNumberInputScan::GetESign( const XubString& rString, xub_StrLen& nPos )
+{
+ if (rString.Len() > nPos)
+ switch (rString.GetChar(nPos))
+ {
+ case '+':
+ nPos++;
+ return 1;
+ break;
+ case '-':
+ nPos++;
+ return -1;
+ break;
+ default:
+ break;
+ }
+
+ return 0;
+}
+
+
+//---------------------------------------------------------------------------
+// GetNextNumber
+//
+// i zaehlt Strings, j zaehlt Numbers, eigentlich sollte das SkipNumber heissen
+
+inline BOOL ImpSvNumberInputScan::GetNextNumber( USHORT& i, USHORT& j )
+{
+ if ( IsNum[i] )
+ {
+ j++;
+ i++;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// GetTimeRef
+
+void ImpSvNumberInputScan::GetTimeRef(
+ double& fOutNumber,
+ USHORT nIndex, // j-Wert fuer den ersten Zeitstring der Eingabe (default 0)
+ USHORT nAnz ) // Anzahl der Zeitstrings
+{
+ xub_Unicode* pChar = NULL;
+ USHORT nHour;
+ USHORT nMinute = 0;
+ USHORT nSecond = 0;
+ double fSecond100 = 0.0;
+ USHORT nStartIndex = nIndex;
+
+ if (nDecPos == 2 && nAnz == 3) // 20:45,5
+ nHour = 0;
+ else
+ nHour = (USHORT) sStrArray[nNums[nIndex++]].ToInt32();
+ if (nIndex - nStartIndex < nAnz)
+ nMinute = (USHORT) sStrArray[nNums[nIndex++]].ToInt32();
+ if (nIndex - nStartIndex < nAnz)
+ nSecond = (USHORT) sStrArray[nNums[nIndex++]].ToInt32();
+ if (nIndex - nStartIndex < nAnz)
+ {
+ XubString s100Sec( '.' );
+ s100Sec += sStrArray[nNums[nIndex]];
+ fSecond100 = StringToDouble( s100Sec );
+ }
+ if (nAmPm == -1 && nHour != 12) // PM
+ nHour += 12;
+ else if (nAmPm == 1 && nHour == 12) // 12 AM
+ nHour = 0;
+
+ fOutNumber = ((double)nHour*3600 +
+ (double)nMinute*60 +
+ (double)nSecond +
+ fSecond100)/86400.0;
+}
+
+
+//---------------------------------------------------------------------------
+// ImplGetDay
+
+USHORT ImpSvNumberInputScan::ImplGetDay( USHORT nIndex )
+{
+ USHORT nRes = 0;
+
+ if (sStrArray[nNums[nIndex]].Len() <= 2)
+ {
+ USHORT nNum = (USHORT) sStrArray[nNums[nIndex]].ToInt32();
+ if (nNum <= 31)
+ nRes = nNum;
+ }
+
+ return nRes;
+}
+
+
+//---------------------------------------------------------------------------
+// ImplGetMonth
+
+USHORT ImpSvNumberInputScan::ImplGetMonth( USHORT nIndex )
+{
+ USHORT nRes = 0;
+
+ if (sStrArray[nNums[nIndex]].Len() <= 2)
+ {
+ USHORT nNum = (USHORT) sStrArray[nNums[nIndex]].ToInt32();
+ if (nNum <= 12)
+ nRes = nNum;
+ }
+
+ return nRes;
+}
+
+
+//---------------------------------------------------------------------------
+// ImplGetYear
+//
+// 30 -> 1930, 29 -> 2029, oder 56 -> 1756, 55 -> 1855, ...
+
+USHORT ImpSvNumberInputScan::ImplGetYear( USHORT nIndex )
+{
+ USHORT nYear = 0;
+
+ if (sStrArray[nNums[nIndex]].Len() <= 4)
+ {
+ nYear = (USHORT) sStrArray[nNums[nIndex]].ToInt32();
+ nYear = SvNumberFormatter::ExpandTwoDigitYear( nYear, nYear2000 );
+ }
+
+ return nYear;
+}
+
+
+//---------------------------------------------------------------------------
+// GetDateRef
+
+BOOL ImpSvNumberInputScan::GetDateRef( Date& aDt, USHORT& nCounter,
+ const SvNumberformat* pFormat )
+{
+ NfEvalDateFormat eEDF;
+ int nFormatOrder;
+ if ( pFormat && ((pFormat->GetType() & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE) )
+ {
+ eEDF = pFormat->ImpGetScan().GetNumberformatter()->GetEvalDateFormat();
+ switch ( eEDF )
+ {
+ case NF_EVALDATEFORMAT_INTL :
+ case NF_EVALDATEFORMAT_FORMAT :
+ nFormatOrder = 1; // nur ein Durchlauf
+ break;
+ default:
+ nFormatOrder = 2;
+ }
+ }
+ else
+ {
+ eEDF = NF_EVALDATEFORMAT_INTL;
+ nFormatOrder = 1;
+ }
+ BOOL res = TRUE;
+
+ const International* pIntl = pFormatter->GetInternational();
+ for ( int nTryOrder = 1; nTryOrder <= nFormatOrder; nTryOrder++ )
+ {
+ DateFormat DateFmt;
+ switch ( eEDF )
+ {
+ case NF_EVALDATEFORMAT_INTL :
+ DateFmt = pIntl->GetDateFormat();
+ break;
+ case NF_EVALDATEFORMAT_FORMAT :
+ DateFmt = pFormat->GetDateOrder();
+ break;
+ case NF_EVALDATEFORMAT_INTL_FORMAT :
+ if ( nTryOrder == 1 )
+ DateFmt = pIntl->GetDateFormat();
+ else
+ DateFmt = pFormat->GetDateOrder();
+ break;
+ case NF_EVALDATEFORMAT_FORMAT_INTL :
+ if ( nTryOrder == 2 )
+ DateFmt = pIntl->GetDateFormat();
+ else
+ DateFmt = pFormat->GetDateOrder();
+ break;
+ default:
+ DBG_ERROR( "ImpSvNumberInputScan::GetDateRef: unknown NfEvalDateFormat" );
+ }
+
+ res = TRUE;
+ nCounter = 0;
+
+ switch (nAnzNums) // Anzahl der Zahlen im String
+ {
+ case 0: // gar keine
+ if (nMonthPos) // nur Monat (Jan)
+ {
+ aDt.SetDay(1);
+ aDt.SetMonth((USHORT)Abs(nMonth));
+ }
+ else
+ res = FALSE;
+ break;
+
+ case 1: // nur eine Zahl
+ nCounter = 1;
+ switch (nMonthPos) // Wo steht der Monat
+ {
+ case 0: // nicht gefunden => nur Tag eingegeben
+ aDt.SetDay(ImplGetDay(0));
+ break;
+ case 1: // Monat am Anfang (Jan 01)
+ aDt.SetMonth((USHORT)Abs(nMonth));
+ switch (DateFmt)
+ {
+ case MDY:
+ case YMD:
+ aDt.SetDay(ImplGetDay(0));
+ break;
+ case DMY:
+ aDt.SetDay(1);
+ aDt.SetYear(ImplGetYear(0));
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ case 3: // Monat am Ende (10 Jan)
+ aDt.SetMonth((USHORT)Abs(nMonth));
+ switch (DateFmt)
+ {
+ case DMY:
+ aDt.SetDay(ImplGetDay(0));
+ break;
+ case YMD:
+ aDt.SetDay(1);
+ aDt.SetYear(ImplGetYear(0));
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ default:
+ res = FALSE;
+ break;
+ } // switch (nMonthPos)
+ break;
+
+ case 2: // 2 Zahlen
+ nCounter = 2;
+ switch (nMonthPos) // Wo steht der Monat
+ {
+ case 0: // nicht gefunden
+ switch (DateFmt)
+ {
+ case MDY:
+ aDt.SetDay(ImplGetDay(1));
+ aDt.SetMonth(ImplGetMonth(0));
+ break;
+ case DMY:
+ aDt.SetDay(ImplGetDay(0));
+ aDt.SetMonth(ImplGetMonth(1));
+ if (!aDt.IsValid()) // 2. Versuch
+ {
+ aDt.SetDay(1);
+ aDt.SetMonth(ImplGetMonth(0));
+ aDt.SetYear(ImplGetYear(1));
+ }
+ break;
+ case YMD:
+ aDt.SetDay(ImplGetDay(1));
+ aDt.SetMonth(ImplGetMonth(0));
+ if (!aDt.IsValid()) // 2. Versuch
+ {
+ aDt.SetDay(1);
+ aDt.SetMonth(ImplGetMonth(1));
+ aDt.SetYear(ImplGetYear(0));
+ }
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ case 1: // Monat am Anfang (Jan 01 01)
+ switch (DateFmt)
+ {
+ case MDY:
+ aDt.SetDay(ImplGetDay(0));
+ aDt.SetMonth((USHORT)Abs(nMonth));
+ aDt.SetYear(ImplGetYear(1));
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ case 2: // Monat in der Mitte (10 Jan 94)
+ aDt.SetMonth((USHORT)Abs(nMonth));
+ switch (DateFmt)
+ {
+ case DMY:
+ aDt.SetDay(ImplGetDay(0));
+ aDt.SetYear(ImplGetYear(1));
+ break;
+ case YMD:
+ aDt.SetDay(ImplGetDay(1));
+ aDt.SetYear(ImplGetYear(0));
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ default: // sonst., z.B. Monat am Ende (94 10 Jan)
+ res = FALSE;
+ break;
+ } // switch (nMonthPos)
+ break;
+
+ default: // mehr als zwei (31.12.94 8:23) (31.12. 8:23)
+ switch (nMonthPos) // Wo steht der Monat
+ {
+ case 0: // nicht gefunden
+ nCounter = 3;
+ if ( nTimePos > 1 )
+ { // find first time number index (should only be 3 or 2 anyway)
+ for ( USHORT j = 0; j < nAnzNums; j++ )
+ {
+ if ( nNums[j] == nTimePos - 2 )
+ {
+ nCounter = j;
+ break; // for
+ }
+ }
+ }
+ switch (DateFmt)
+ {
+ case MDY:
+ aDt.SetDay(ImplGetDay(1));
+ aDt.SetMonth(ImplGetMonth(0));
+ if ( nCounter > 2 )
+ aDt.SetYear(ImplGetYear(2));
+ break;
+ case DMY:
+ aDt.SetDay(ImplGetDay(0));
+ aDt.SetMonth(ImplGetMonth(1));
+ if ( nCounter > 2 )
+ aDt.SetYear(ImplGetYear(2));
+ break;
+ case YMD:
+ if ( nCounter > 2 )
+ aDt.SetDay(ImplGetDay(2));
+ aDt.SetMonth(ImplGetMonth(1));
+ aDt.SetYear(ImplGetYear(0));
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ case 1: // Monat am Anfang (Jan 01 01 8:23)
+ nCounter = 2;
+ switch (DateFmt)
+ {
+ case MDY:
+ aDt.SetDay(ImplGetDay(0));
+ aDt.SetMonth((USHORT)Abs(nMonth));
+ aDt.SetYear(ImplGetYear(1));
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ case 2: // Monat in der Mitte (10 Jan 94 8:23)
+ nCounter = 2;
+ aDt.SetMonth((USHORT)Abs(nMonth));
+ switch (DateFmt)
+ {
+ case DMY:
+ aDt.SetDay(ImplGetDay(0));
+ aDt.SetYear(ImplGetYear(1));
+ break;
+ case YMD:
+ aDt.SetDay(ImplGetDay(1));
+ aDt.SetYear(ImplGetYear(0));
+ break;
+ default:
+ res = FALSE;
+ break;
+ }
+ break;
+ default: // sonst., z.B. Monat am Ende (94 10 Jan 8:23)
+ nCounter = 2;
+ res = FALSE;
+ break;
+ } // switch (nMonthPos)
+ break;
+ } // switch (nAnzNums)
+
+ if ( nTryOrder < nFormatOrder )
+ {
+ if ( res && aDt.IsValid() )
+ nTryOrder = nFormatOrder; // break for
+ else
+ aDt = Date(); // naechster
+ }
+ }
+
+ return res;
+}
+
+
+//---------------------------------------------------------------------------
+// ScanStartString
+//
+// ersten String analysieren
+// Alles weg => TRUE
+// sonst => FALSE
+
+BOOL ImpSvNumberInputScan::ScanStartString( const XubString& rString,
+ const SvNumberformat* pFormat )
+{
+ xub_StrLen nPos = 0;
+ short nDayOfWeek;
+
+ SkipBlanks(rString, nPos);
+ if ( nSign = GetSign(rString, nPos) ) // Vorzeichen?
+ SkipBlanks(rString, nPos);
+
+ if ( GetDecSep(rString, nPos) ) // Dezimaltrenner (,) im Startstring
+ {
+ nDecPos = 1;
+ SkipBlanks(rString, nPos);
+ }
+ else if ( GetCurrency(rString, nPos, pFormat) ) // Waehrung (DM 1)?
+ {
+ eScannedType = NUMBERFORMAT_CURRENCY; // !!! es ist Geld !!!
+ SkipBlanks(rString, nPos);
+ if (nSign == 0) // noch kein Vorzeichen
+ if ( nSign = GetSign(rString, nPos) ) // DM -1
+ SkipBlanks(rString, nPos);
+ }
+ else if ( nMonth = GetMonth(rString, nPos) ) // Monat (Jan 1)?
+ {
+ eScannedType = NUMBERFORMAT_DATE; // !!! es ist eine Datum !!!
+ nMonthPos = 1; // Monat an 1. Pos
+ if ( nMonth < 0 )
+ SkipChar( '.', rString, nPos ); // abgekuerzt
+ SkipBlanks(rString, nPos);
+ }
+ else if ( nDayOfWeek = GetDayOfWeek( rString, nPos ) )
+ { // Wochentag wird nur weggeparst
+ eScannedType = NUMBERFORMAT_DATE; // !!! es ist eine Datum !!!
+ if ( nPos < rString.Len() )
+ {
+ if ( nDayOfWeek < 0 )
+ { // kurz
+ if ( rString.GetChar( nPos ) == '.' )
+ ++nPos;
+ }
+ else
+ { // lang
+ SkipBlanks(rString, nPos);
+ SkipString( pFormatter->GetInternational()->GetLongDateDayOfWeekSep(), rString, nPos );
+ }
+ SkipBlanks(rString, nPos);
+ if ( nMonth = GetMonth(rString, nPos) ) // Monat (Jan 1)?
+ {
+ nMonthPos = 1; // Monat an 1. Pos
+ if ( nMonth < 0 )
+ SkipChar( '.', rString, nPos ); // abgekuerzt
+ SkipBlanks(rString, nPos);
+ }
+ }
+ }
+
+ if (nPos < rString.Len()) // noch nicht alles weg
+ {
+ // eingegebener StartString gleich StartString im Format?
+ if ( !ScanStringNumFor( rString, nPos, pFormat, 0 ) )
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+//---------------------------------------------------------------------------
+// ScanMidString
+//
+// String in der Mitte analysieren
+// Alles weg => TRUE
+// sonst => FALSE
+
+BOOL ImpSvNumberInputScan::ScanMidString(
+ const XubString& rString,
+ USHORT nStringPos )
+{
+ const International* pIntl = pFormatter->GetInternational();
+ xub_StrLen nPos = 0;
+
+ SkipBlanks(rString, nPos);
+ if (GetDecSep(rString, nPos)) // Dezimaltrenner?
+ {
+ if (nDecPos == 1 || nDecPos == 3) // ,12,4 oder 1,E2,1
+ return FALSE;
+ else if (nDecPos == 2) // , doppelt 12,4,
+ {
+ if (bDecSepInDateSeps) // , auch Date Sep
+ {
+ if (eScannedType != NUMBERFORMAT_UNDEFINED &&
+ eScannedType != NUMBERFORMAT_DATE) // schon anderer Typ
+ return FALSE;
+ eScannedType = NUMBERFORMAT_DATE; // !!! Es ist ein Datum !!!
+ SkipBlanks(rString, nPos);
+ }
+ else
+ return FALSE;
+ }
+ else
+ {
+ nDecPos = 2; // , im Mittelstring
+ SkipBlanks(rString, nPos);
+ }
+ }
+
+ if (SkipChar('/', rString, nPos)) // Bruch?
+ {
+ if ( eScannedType != NUMBERFORMAT_UNDEFINED // schon anderes Format
+ && eScannedType != NUMBERFORMAT_DATE) // ausser Datum
+ return FALSE; // => jan/31/1994
+ else if ( eScannedType != NUMBERFORMAT_DATE // bisher als Datum analysiert
+ && ( eSetType == NUMBERFORMAT_FRACTION // und Vorgabe war Bruch
+ || (nAnzNums == 3 // oder 3 Zahlen
+ && nStringPos > 2) ) ) // und ???
+ {
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_FRACTION; // !!! es ist ein Bruch
+ }
+ else
+ nPos--; // '/' zurueck
+ }
+
+ if (GetThousandSep(rString, nPos, nStringPos)) // 1.000
+ {
+ if ( eScannedType != NUMBERFORMAT_UNDEFINED // schon anderes Format
+ && eScannedType != NUMBERFORMAT_CURRENCY) // ausser Waehrung
+ return FALSE;
+ nThousand++;
+ }
+
+ SkipBlanks(rString, nPos);
+ xub_Unicode cDate = pIntl->GetDateSep();
+ xub_Unicode cTime = pIntl->GetTimeSep();
+ if ( SkipChar(cDate, rString, nPos) // 10., 10-, 10/
+ || ((cTime != '.') && SkipChar('.', rString, nPos)) // TRICKY:
+ || ((cTime != '/') && SkipChar('/', rString, nPos)) // short boolean
+ || ((cTime != '-') && SkipChar('-', rString, nPos)) ) // evaluation!
+ {
+ if ( eScannedType != NUMBERFORMAT_UNDEFINED // schon anderes Format
+ && eScannedType != NUMBERFORMAT_DATE) // ausser Datum
+ return FALSE;
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_DATE; // !!! es ist ein Datum
+ short nTmpMonth = GetMonth(rString, nPos); // 10. Jan 94
+ if (nMonth && nTmpMonth) // Monat doppelt
+ return FALSE;
+ if (nTmpMonth)
+ {
+ nMonth = nTmpMonth;
+ nMonthPos = 2; // Monat in der Mitte
+ if ( nMonth < 0 )
+ SkipChar( '.', rString, nPos ); // abgekuerzt
+ SkipString( pIntl->GetLongDateMonthSep(), rString, nPos );
+ SkipBlanks(rString, nPos);
+ }
+ }
+
+ short nTempMonth = GetMonth(rString, nPos); // Monat in der Mitte (10 Jan 94)
+ if (nTempMonth)
+ {
+ if (nMonth != 0) // Monat doppelt
+ return FALSE;
+ if ( eScannedType != NUMBERFORMAT_UNDEFINED // schon anderes Format
+ && eScannedType != NUMBERFORMAT_DATE) // ausser Datum
+ return FALSE;
+ eScannedType = NUMBERFORMAT_DATE; // !!! es ist ein Datum
+ nMonth = nTempMonth;
+ nMonthPos = 2; // Monat in der Mitte
+ if ( nMonth < 0 )
+ SkipChar( '.', rString, nPos ); // abgekuerzt
+ SkipString( pIntl->GetLongDateMonthSep(), rString, nPos );
+ SkipBlanks(rString, nPos);
+ }
+
+ if ( SkipChar('E', rString, nPos) // 10E, 10e, 10,Ee
+ || SkipChar('e', rString, nPos) )
+ {
+ if (eScannedType != NUMBERFORMAT_UNDEFINED) // schon anderes Format
+ return FALSE;
+ else
+ {
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_SCIENTIFIC; // !!! es ist eine Zahl im E-Format
+ if ( nThousand+2 == nAnzNums // Sonderfall 1,E2
+ && nDecPos == 2 )
+ nDecPos = 3; // 1.100,E2 1.100.100,E3
+ }
+ nESign = GetESign(rString, nPos); // Vorzeichen vom Exponent?
+ SkipBlanks(rString, nPos);
+ }
+
+ if ( SkipChar(cTime, rString, nPos) ) // Zeittrenner?
+ {
+ if (nDecPos) // schon , => Fehler
+ return FALSE;
+ if ( ( eScannedType == NUMBERFORMAT_DATE // bereits Datumsformat
+ || eScannedType == NUMBERFORMAT_DATETIME) // erkannt und
+ && nAnzNums > 3) // mehr als 3 Zahlen? (31.Dez.94 8:23)
+ {
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_DATETIME; // !!! es ist Datum mit Uhrzeit
+ }
+ else if ( eScannedType != NUMBERFORMAT_UNDEFINED // schon anderes Format
+ && eScannedType != NUMBERFORMAT_TIME) // ausser Zeit
+ return FALSE;
+ else
+ {
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_TIME; // !!! es ist eine Zeit
+ }
+ if ( !nTimePos )
+ nTimePos = nStringPos + 1;
+ }
+
+ // #68232# recognize long date separators like ", " in "September 5, 1999"
+ if ( nPos < rString.Len() && eScannedType == NUMBERFORMAT_DATE
+ && nMonthPos == 1 && pIntl->GetLongDateFormat() == MDY )
+ {
+ if ( SkipString( pIntl->GetLongDateDaySep(), rString, nPos ) )
+ SkipBlanks( rString, nPos );
+ }
+
+ if (nPos < rString.Len()) // noch nicht alles weg?
+ return FALSE;
+
+ return TRUE;
+}
+
+
+//---------------------------------------------------------------------------
+// ScanEndString
+//
+// Schlussteil analysieren
+// Alles weg => TRUE
+// sonst => FALSE
+
+BOOL ImpSvNumberInputScan::ScanEndString( const XubString& rString,
+ const SvNumberformat* pFormat )
+{
+ const International* pIntl = pFormatter->GetInternational();
+ xub_StrLen nPos = 0;
+
+ SkipBlanks(rString, nPos);
+ if (GetDecSep(rString, nPos)) // Dezimaltrenner?
+ {
+ if (nDecPos == 1 || nDecPos == 3) // ,12,4 oder 12,E4,
+ return FALSE;
+ else if (nDecPos == 2) // , doppelt 12,4,
+ {
+ if (bDecSepInDateSeps) // , auch Date Sep
+ {
+ if (eScannedType != NUMBERFORMAT_UNDEFINED &&
+ eScannedType != NUMBERFORMAT_DATE) // schon anderer Typ
+ return FALSE;
+ eScannedType = NUMBERFORMAT_DATE; // !!! es ist ein Datum
+ SkipBlanks(rString, nPos);
+ }
+ else
+ return FALSE;
+ }
+ else
+ {
+ nDecPos = 3; // , im Endstring
+ SkipBlanks(rString, nPos);
+ }
+ }
+
+ if ( nSign == 0 // Konflikt - kein Vorzeichen
+ && eScannedType != NUMBERFORMAT_DATE) // und nicht Datum
+//? Uhrzeit auch abfangen ?
+ { // noch kein Vorzeichen
+ nSign = GetSign(rString, nPos); // 1- DM
+ if (nNegCheck) // '(' als Vorzeichen
+ return FALSE;
+ }
+
+ SkipBlanks(rString, nPos);
+ if (nNegCheck && SkipChar(')', rString, nPos)) // ggf. ')' ueberlesen
+ {
+ nNegCheck = 0;
+ SkipBlanks(rString, nPos);
+ }
+
+ if ( GetCurrency(rString, nPos, pFormat) ) // Waehrungssymbol?
+ {
+ if (eScannedType != NUMBERFORMAT_UNDEFINED) // DM doppelt oder
+ return FALSE;
+ else
+ {
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_CURRENCY;
+ } // hinter DM - erlaubt
+ if (nSign == 0) // noch kein Vorzeichen
+ {
+ nSign = GetSign(rString, nPos); // DM -
+ SkipBlanks(rString, nPos);
+ if (nNegCheck) // 3 DM (
+ return FALSE;
+ }
+ if ( nNegCheck && eScannedType == NUMBERFORMAT_CURRENCY
+ && SkipChar(')', rString, nPos) )
+ {
+ nNegCheck = 0; // ggf. ')' ueberlesen
+ SkipBlanks(rString, nPos); // nur bei Waehrung
+ }
+ }
+
+ if ( SkipChar('%', rString, nPos) ) // 1 %
+ {
+ if (eScannedType != NUMBERFORMAT_UNDEFINED) // schon anderes Format
+ return FALSE;
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_PERCENT;
+ }
+
+ xub_Unicode cTime = pIntl->GetTimeSep();
+ if ( SkipChar(cTime, rString, nPos) ) // 10:
+ {
+ if (nDecPos) // schon , => Fehler
+ return FALSE;
+ if (eScannedType == NUMBERFORMAT_DATE && nAnzNums > 2) // 31.Dez.94 8:
+ {
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_DATETIME;
+ }
+ else if (eScannedType != NUMBERFORMAT_UNDEFINED &&
+ eScannedType != NUMBERFORMAT_TIME) // schon anderes Format
+ return FALSE;
+ else
+ {
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_TIME;
+ }
+ }
+
+ xub_Unicode cDate = pIntl->GetDateSep();
+ if ( SkipChar(cDate, rString, nPos) // 10., 10-, 10/
+ || ((cTime != '.') && SkipChar('.', rString, nPos)) // TRICKY:
+ || ((cTime != '/') && SkipChar('/', rString, nPos)) // short boolean
+ || ((cTime != '-') && SkipChar('-', rString, nPos)) ) // evaluation!
+ {
+ if (eScannedType != NUMBERFORMAT_UNDEFINED &&
+ eScannedType != NUMBERFORMAT_DATE) // schon anderes Format
+ return FALSE;
+ else
+ {
+ SkipBlanks(rString, nPos);
+ eScannedType = NUMBERFORMAT_DATE;
+ }
+ short nTmpMonth = GetMonth(rString, nPos); // 10. Jan
+ if (nMonth && nTmpMonth) // Monat doppelt
+ return FALSE;
+ if (nTmpMonth)
+ {
+ nMonth = nTmpMonth;
+ nMonthPos = 3; // Monat hinten
+ if ( nMonth < 0 )
+ SkipChar( '.', rString, nPos ); // abgekuerzt
+ SkipBlanks(rString, nPos);
+ }
+ }
+
+ short nTempMonth = GetMonth(rString, nPos); // 10 Jan
+ if (nTempMonth)
+ {
+ if (nMonth) // Monat doppelt
+ return FALSE;
+ if (eScannedType != NUMBERFORMAT_UNDEFINED &&
+ eScannedType != NUMBERFORMAT_DATE) // schon anderes Format
+ return FALSE;
+ eScannedType = NUMBERFORMAT_DATE;
+ nMonth = nTempMonth;
+ nMonthPos = 3; // Monat hinten
+ if ( nMonth < 0 )
+ SkipChar( '.', rString, nPos ); // abgekuerzt
+ SkipBlanks(rString, nPos);
+ }
+
+ if (GetTimeAmPm(rString, nPos))
+ {
+ if (eScannedType != NUMBERFORMAT_UNDEFINED &&
+ eScannedType != NUMBERFORMAT_TIME &&
+ eScannedType != NUMBERFORMAT_DATETIME) // schon anderes Format
+ return FALSE;
+ else
+ {
+ SkipBlanks(rString, nPos);
+ if ( eScannedType != NUMBERFORMAT_DATETIME )
+ eScannedType = NUMBERFORMAT_TIME;
+ }
+ }
+
+ if ( nNegCheck && SkipChar(')', rString, nPos) )
+ {
+ if (eScannedType == NUMBERFORMAT_CURRENCY) // nur bei Waehrung
+ {
+ nNegCheck = 0; // ggf. ')' ueberlesen
+ SkipBlanks(rString, nPos);
+ }
+ else
+ return FALSE;
+ }
+
+ if ( nPos < rString.Len() &&
+ (eScannedType == NUMBERFORMAT_DATE
+ || eScannedType == NUMBERFORMAT_DATETIME) )
+ { // Wochentag wird nur weggeparst
+ xub_StrLen nOldPos = nPos;
+ const XubString& rSep = pIntl->GetLongDateDayOfWeekSep();
+ if ( StringContains( rSep, rString, nPos ) )
+ {
+ nPos += rSep.Len();
+ SkipBlanks(rString, nPos);
+ }
+ short nDayOfWeek;
+ if ( nDayOfWeek = GetDayOfWeek( rString, nPos ) )
+ {
+ if ( nPos < rString.Len() )
+ {
+ if ( nDayOfWeek < 0 )
+ { // kurz
+ if ( rString.GetChar( nPos ) == '.' )
+ ++nPos;
+ }
+ SkipBlanks(rString, nPos);
+ }
+ }
+ else
+ nPos = nOldPos;
+ }
+
+ if (nPos < rString.Len()) // alles weg?
+ {
+ // eingegebener EndString gleich EndString im Format?
+ if ( !ScanStringNumFor( rString, nPos, pFormat, 0xFFFF ) )
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+
+BOOL ImpSvNumberInputScan::ScanStringNumFor(
+ const XubString& rString, // zu scannender String
+ xub_StrLen nPos, // Position bis zu der abgearbeitet war
+ const SvNumberformat* pFormat, // das zu matchende Format
+ USHORT nString ) // TeilString des TeilFormats
+ // normalerweise 0 oder 0xFFFF
+{
+ const International* pIntl = pFormatter->GetInternational();
+ if ( !pFormat )
+ return FALSE;
+ const XubString* pStr;
+ XubString aString( rString );
+ BOOL bFound = FALSE;
+ BOOL bFirst = TRUE;
+ BOOL bContinue = TRUE;
+ USHORT nSub;
+ do
+ {
+ // wenn am Anfang das zweite/dritte Teilformat gefunden wurde darunter
+ // nicht mehr suchen
+ nSub = nStringScanNumFor;
+ do
+ { // TeilFormate durchprobieren, erst positiv, dann negativ, dann anderes,
+ // letztes (Text) nicht
+ pStr = pFormat->GetNumForString( nSub, nString, TRUE );
+ if ( pStr && pIntl->CompareEqual( aString, *pStr, INTN_COMPARE_IGNORECASE ) )
+ {
+ bFound = TRUE;
+ bContinue = FALSE;
+ }
+ else if ( nSub < 2 )
+ ++nSub;
+ else
+ bContinue = FALSE;
+ } while ( bContinue );
+ if ( !bFound && bFirst && nPos )
+ { // uebriggelassenen SubString probieren
+ bFirst = FALSE;
+ aString.Erase( 0, nPos );
+ bContinue = TRUE;
+ }
+ } while ( bContinue );
+
+ if ( !bFound )
+ {
+ if ( (nString == 0) && !bFirst && (nSign < 0)
+ && pFormat->IsNegativeRealNegative() )
+ { // simpel doppelt negiert? --1
+ aString.EraseAllChars( ' ' );
+ if ( (aString.Len() == 1) && (aString.GetChar(0) == '-') )
+ {
+ bFound = TRUE;
+ nStringScanSign = -1;
+ nSub = 0; //! nicht 1
+ }
+ }
+ if ( !bFound )
+ return FALSE;
+ }
+ else if ( (nSub == 1) && pFormat->IsNegativeRealNegative() )
+ { // negativ
+ if ( nStringScanSign < 0 )
+ {
+ if ( (nSign < 0) && (nStringScanNumFor != 1) )
+ nStringScanSign = 1; // dreifach negiert --1 yyy
+ }
+ else if ( nStringScanSign == 0 )
+ {
+ if ( nSign < 0 )
+ { // nSign und nStringScanSign werden spaeter verknuepft,
+ // Vorzeichen umkehren wenn doppelt negiert
+ if ( (nString == 0) && !bFirst
+ && SvNumberformat::HasStringNegativeSign( aString ) )
+ nStringScanSign = -1; // direkte doppelte Negierung
+ else if ( pFormat->IsNegativeWithoutSign() )
+ nStringScanSign = -1; // indirekte doppelte Negierung
+ }
+ else
+ nStringScanSign = -1;
+ }
+ else // > 0
+ nStringScanSign = -1;
+ }
+ nStringScanNumFor = nSub;
+ return TRUE;
+}
+
+
+//---------------------------------------------------------------------------
+// IsNumberFormatMain
+//
+// erkennt folgende Typen: Zahl Z, Exp.darst. E, Bruch B, Prozent P
+// Waehrung W, Datum D, Uhrzeit U
+// sonst Text T <=> return FALSE; )
+
+BOOL ImpSvNumberInputScan::IsNumberFormatMain(
+ const XubString& rString, // zu analysierender String
+ double& fOutNumber, // OUT: Ergebnis als Zahl, wenn moeglich
+ const SvNumberformat* pFormat ) // evtl. gesetztes Zahlenformat
+{
+ Reset(); // Anfangszustand
+ // NoMoreUpperNeeded, alle Vergleiche auf UpperCase
+ XubString aString( pFormatter->GetCharClass()->upper( rString ) );
+ NumberStringDivision(aString); // Zerlegung in Zahlen/Strings
+ if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS) // zuviele Einzelteile
+ return FALSE; // Njet, Nope, ...
+
+ if (nAnzNums == 0) // keine Zahl in der Eingabe
+ {
+ if ( nAnzStrings > 0 )
+ {
+ // hier kann das Original geaendert werden, wird nicht mehr
+ // gebraucht, das erspart Kopiererei und ToUpper in GetLogical
+ // und ist im Zusammenspiel schneller
+ XubString& rStrArray = sStrArray[0];
+ rStrArray.EraseTrailingChars( ' ' );
+ rStrArray.EraseLeadingChars( ' ' );
+ if ( nLogical = GetLogical( rStrArray ) )
+ {
+ eScannedType = NUMBERFORMAT_LOGICAL;// !!! es ist ein BOOL
+ return TRUE;
+ }
+ else
+ return FALSE; // simple Text
+ }
+ else
+ return FALSE; // simple Text
+ }
+
+ USHORT i = 0; // markiert Symbole
+ USHORT j = 0; // markiert nur Zahlen
+
+ switch ( nAnzNums )
+ {
+ case 1 : // Genau 1 Zahl in der Eingabe
+ { // nAnzStrings >= 1
+ if (GetNextNumber(i,j)) // i=1,0
+ { // Zahl am Anfang
+ if (eSetType == NUMBERFORMAT_FRACTION) // Sonderfall Bruch 1 = 1/1
+ {
+ if (i >= nAnzStrings || // kein Endstring oder ,
+ sStrArray[i].GetChar(0) == pFormatter->GetInternational()->GetNumDecimalSep())
+ {
+ eScannedType = NUMBERFORMAT_FRACTION;
+ return TRUE;
+ }
+ }
+ }
+ else
+ { // Analyse des Anfangsstrings
+ if (!ScanStartString( sStrArray[i], pFormat )) // i=0
+ return FALSE; // schon fehlerhaft
+ i++; // naechstes Symbol, i=1
+ }
+ GetNextNumber(i,j); // i=1,2
+ if (eSetType == NUMBERFORMAT_FRACTION) // Sonderfall Bruch -1 = -1/1
+ {
+ if (nSign && !nNegCheck && // Vorzeichen +, -
+ eScannedType == NUMBERFORMAT_UNDEFINED && // nicht D oder C
+ nDecPos == 0 && // kein Dezimalkomma vorher
+ (i >= nAnzStrings || // kein Endstring oder ,
+ sStrArray[i].GetChar(0) == pFormatter->GetInternational()->GetNumDecimalSep())
+ )
+ {
+ eScannedType = NUMBERFORMAT_FRACTION;
+ return TRUE;
+ }
+ }
+ if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat ))
+ return FALSE;
+ }
+ break;
+ case 2 : // Genau 2 Zahlen in Eingabe
+ { // nAnzStrings >= 3
+ if (!GetNextNumber(i,j)) // i=1,0
+ { // Analyse des Anfangsstrings
+ if (!ScanStartString( sStrArray[i], pFormat ))
+ return FALSE; // schon fehlerhaft
+ i++; // i=1
+ }
+ GetNextNumber(i,j); // i=1,2
+ if (!ScanMidString(sStrArray[i], i))
+ return FALSE;
+ i++; // naechstes Symbol, i=2,3
+ GetNextNumber(i,j); // i=3,4
+ if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat ))
+ return FALSE;
+ if (eSetType == NUMBERFORMAT_FRACTION) // Sonderfall -1.200, als Bruch
+ {
+ if (!nNegCheck && // kein Vorzeichen '('
+ eScannedType == NUMBERFORMAT_UNDEFINED &&
+ (nDecPos == 0 || nDecPos == 3) // kein Dezimalz. oder hinten
+ )
+ {
+ eScannedType = NUMBERFORMAT_FRACTION;
+ return TRUE;
+ }
+ }
+ }
+ break;
+ case 3 : // Genau 3 Zahlen in Eingabe
+ { // nAnzStrings >= 5
+ if (!GetNextNumber(i,j)) // i=1,0
+ { // Analyse des Anfangsstrings
+ if (!ScanStartString( sStrArray[i], pFormat ))
+ return FALSE; // schon fehlerhaft
+ i++; // i=1
+ if (nDecPos == 1) // , am Anfang => Fehler
+ return FALSE;
+ }
+ GetNextNumber(i,j); // i=1,2
+ if (!ScanMidString(sStrArray[i], i))
+ return FALSE;
+ i++; // i=2,3
+ if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E nur am Ende
+ return FALSE;
+ GetNextNumber(i,j); // i=3,4
+ if (!ScanMidString(sStrArray[i], i))
+ return FALSE;
+ i++; // i=4,5
+ GetNextNumber(i,j); // i=5,6
+ if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat ))
+ return FALSE;
+ if (eSetType == NUMBERFORMAT_FRACTION)// Sonderfall -1.200.100, als Bruch
+ {
+ if (!nNegCheck && // kein Vorzeichen '('
+ eScannedType == NUMBERFORMAT_UNDEFINED &&
+ (nDecPos == 0 || nDecPos == 3) // kein Dezimalz. oder hinten
+ )
+ {
+ eScannedType = NUMBERFORMAT_FRACTION;
+ return TRUE;
+ }
+ }
+ if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos )
+ return FALSE; // #36857# kein echter Bruch
+ }
+ break;
+ default: // Mehr als 3 Zahlen in Eingabe
+ { // nAnzStrings >= 7
+ if (!GetNextNumber(i,j)) // i=1,0
+ { // Analyse des Anfangsstrings
+ if (!ScanStartString( sStrArray[i], pFormat ))
+ return FALSE; // schon fehlerhaft
+ i++; // i=1
+ if (nDecPos == 1) // , am Anfang => Fehler
+ return FALSE;
+ }
+ GetNextNumber(i,j); // i=1,2
+ if (!ScanMidString(sStrArray[i], i))
+ return FALSE;
+ i++; // i=2,3
+ USHORT nThOld = 10; // != 0 oder 1
+ while (nThOld != nThousand && j < nAnzNums-1)
+ // mindestens ein Mal
+ // aber eine Zahl noch lassen
+ { // Abarbeitung Tausenderpkte.
+ nThOld = nThousand;
+ if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E nur am Ende
+ return FALSE;
+ GetNextNumber(i,j);
+ if (i < nAnzStrings && !ScanMidString(sStrArray[i], i))
+ return FALSE;
+ i++;
+ }
+ if (eScannedType == NUMBERFORMAT_DATE || // Abarbeitung langes Datum
+ eScannedType == NUMBERFORMAT_TIME || // lange Uhrzeit
+ eScannedType == NUMBERFORMAT_UNDEFINED) // oder lange Zahl
+ {
+ for (USHORT k = j; k < nAnzNums-1; k++)
+ {
+ if (eScannedType == NUMBERFORMAT_SCIENTIFIC) // E nur am Ende
+ return FALSE;
+ GetNextNumber(i,j);
+ if (i < nAnzStrings && !ScanMidString(sStrArray[i], i))
+ return FALSE;
+ i++;
+ }
+ }
+ GetNextNumber(i,j);
+ if (i < nAnzStrings && !ScanEndString( sStrArray[i], pFormat ))
+ return FALSE;
+ if (eSetType == NUMBERFORMAT_FRACTION)// Sonderfall -1.200.100, als Bruch
+ {
+ if (!nNegCheck && // kein Vorzeichen '('
+ eScannedType == NUMBERFORMAT_UNDEFINED &&
+ (nDecPos == 0 || nDecPos == 3) // kein Dezimalz. oder hinten
+ )
+ {
+ eScannedType = NUMBERFORMAT_FRACTION;
+ return TRUE;
+ }
+ }
+ if ( eScannedType == NUMBERFORMAT_FRACTION && nDecPos )
+ return FALSE; // #36857# kein echter Bruch
+ }
+ }
+
+ if (eScannedType == NUMBERFORMAT_UNDEFINED) // alles andere sollte bereits
+ eScannedType = NUMBERFORMAT_NUMBER; // erkannt sein
+
+ return TRUE;
+}
+
+
+//---------------------------------------------------------------------------
+// Die 12 Monate und 7 Wochentage initialisieren
+
+void ImpSvNumberInputScan::InitText()
+{
+ int j;
+ const International* pIntl = pFormatter->GetInternational();
+ const CharClass* pChrCls = pFormatter->GetCharClass();
+ for ( j=0; j<12; j++ )
+ {
+ aUpperMonthText[j] = pChrCls->upper( pIntl->GetMonthText(j+1) );
+ aUpperAbbrevMonthText[j] = pChrCls->upper( pIntl->GetAbbrevMonthText(j+1) );
+ }
+ for ( j=0; j<7; j++ )
+ {
+ aUpperDayText[j] = pChrCls->upper( pIntl->GetDayText( (DayOfWeek) j ) );
+ aUpperAbbrevDayText[j] = pChrCls->upper( pIntl->GetAbbrevDayText( (DayOfWeek) j ) );
+ }
+ aUpperCurrSymbol = pChrCls->upper( pIntl->GetCurrSymbol() );
+ bTextInitialized = TRUE;
+}
+
+
+//===========================================================================
+// P U B L I C
+
+//---------------------------------------------------------------------------
+// ChangeIntl
+//
+// MUST be called if International/Locale is changed
+
+void ImpSvNumberInputScan::ChangeIntl()
+{
+ xub_Unicode cDecSep = pFormatter->GetInternational()->GetNumDecimalSep();
+ bDecSepInDateSeps = ( cDecSep == '-' ||
+ cDecSep == '/' ||
+ cDecSep == '.' ||
+ cDecSep == pFormatter->GetInternational()->GetDateSep());
+ bTextInitialized = FALSE;
+}
+
+
+//---------------------------------------------------------------------------
+// ChangeNullDate
+
+void ImpSvNumberInputScan::ChangeNullDate(
+ const USHORT nDay,
+ const USHORT nMonth,
+ const USHORT nYear )
+{
+ delete pNullDate;
+ pNullDate = new Date(nDay, nMonth, nYear);
+}
+
+
+//---------------------------------------------------------------------------
+// IsNumberFormat
+//
+// => String als Zahl darstellbar
+
+BOOL ImpSvNumberInputScan::IsNumberFormat(
+ const XubString& rString, // zu analysierender String
+ short& F_Type, // IN: alter Typ, OUT: neuer Typ
+ double& fOutNumber, // OUT: Zahl, wenn Umwandlung moeglich
+ const SvNumberformat* pFormat ) // evtl. gesetztes Zahlenformat
+{
+ // in den zerlegten Strings gibt es keine Null-Laengen Strings mehr!
+
+ XubString sResString; // die Eingabe fuer atof
+ BOOL res; // Rueckgabewert
+ eSetType = F_Type; // Typ der Zelle
+
+ if ( !rString.Len() )
+ res = FALSE;
+ else if (rString.Len() > 308) // frueher 100
+ res = FALSE;
+ else
+ res = IsNumberFormatMain(rString, fOutNumber, pFormat);
+
+ if (res)
+ {
+ if ( nNegCheck // ')' nicht gefunden
+ || (eScannedType == NUMBERFORMAT_TIME // Zeit mit Vorzeichen
+ && nSign) )
+ res = FALSE;
+ else // Check der Zahlanzahlen
+ {
+ switch (eScannedType) // Analyseergebnis pruefen
+ {
+ case NUMBERFORMAT_PERCENT: // alle Zahlen
+ case NUMBERFORMAT_CURRENCY:
+ case NUMBERFORMAT_NUMBER:
+ if (nDecPos == 1) // ,05
+ {
+ if (nAnzNums != 1)
+ res = FALSE;
+ }
+ else if (nDecPos == 2) // 1,05
+ {
+ if (nAnzNums != nThousand+2)
+ res = FALSE;
+ }
+ else // 1.100 oder 1.100,
+ {
+ if (nAnzNums != nThousand+1)
+ res = FALSE;
+ }
+ break;
+
+ case NUMBERFORMAT_SCIENTIFIC: // wissenschaftl. Format 1,0e-2
+ if (nDecPos == 1) // ,05
+ {
+ if (nAnzNums != 2)
+ res = FALSE;
+ }
+ else if (nDecPos == 2) // 1,05
+ {
+ if (nAnzNums != nThousand+3)
+ res = FALSE;
+ }
+ else // 1.100 oder 1.100,
+ {
+ if (nAnzNums != nThousand+2)
+ res = FALSE;
+ }
+ break;
+
+ case NUMBERFORMAT_DATE: // Datum
+ if (nMonth)
+ {
+ if (nAnzNums > 2)
+ res = FALSE;
+ }
+ else
+ {
+ if (nAnzNums > 3)
+ res = FALSE;
+ }
+ break;
+
+ case NUMBERFORMAT_TIME: // Uhrzeit
+ if (nDecPos)
+ {
+ if (nAnzNums > 4)
+ res = FALSE;
+ }
+ else
+ {
+ if (nAnzNums > 3)
+ res = FALSE;
+ }
+ break;
+
+ case NUMBERFORMAT_DATETIME: // Datum + Uhrzeit
+ if (nMonth)
+ {
+ if (nAnzNums > 5)
+ res = FALSE;
+ }
+ else
+ {
+ if (nAnzNums > 6)
+ res = FALSE;
+ }
+ break;
+
+ default:
+ break;
+ } // switch
+ } // else
+ } // if (res)
+
+ if (res) // Bestimmung der Zahl:
+ {
+ switch (eScannedType)
+ {
+ case NUMBERFORMAT_LOGICAL: // Logisch
+ if (nLogical == 1)
+ fOutNumber = 1.0; // True
+ else if (nLogical == -1)
+ fOutNumber = 0.0; // False
+ else
+ res = FALSE; // Oops
+ break;
+
+ case NUMBERFORMAT_PERCENT: // Zahlen
+ case NUMBERFORMAT_CURRENCY:
+ case NUMBERFORMAT_NUMBER:
+ case NUMBERFORMAT_SCIENTIFIC: // erstmal Zahlanteil
+ if (nDecPos == 1) // , am Anfang
+ {
+ sResString.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "0." ) );
+ sResString += sStrArray[nNums[0]];
+ }
+ else
+ { USHORT k;
+ sResString = sStrArray[nNums[0]];
+ for ( k = 1; k <= nThousand; k++)
+ sResString += sStrArray[nNums[k]]; // Vorkommateil
+ if (nDecPos == 2) // in der Mitte
+ {
+ sResString += '.';
+ sResString += sStrArray[nNums[k]];
+ }
+ }
+
+ if (eScannedType != NUMBERFORMAT_SCIENTIFIC)
+ fOutNumber = StringToDouble(sResString);
+ else // Nachbehandlung Exponent
+ {
+ USHORT i;
+ double fExp;
+
+ if (nDecPos == 2)
+ fExp = StringToDouble(sStrArray[nNums[nThousand+2]]);
+ else
+ fExp = StringToDouble(sStrArray[nNums[nThousand+1]]);
+ if (fExp > 308.0)
+ {
+ F_Type = NUMBERFORMAT_TEXT; // Ueberlauf -> Text
+ if (nESign == -1)
+ fOutNumber = 0.0;
+ else
+ fOutNumber = DBL_MAX;
+/*!*/ return TRUE;
+ }
+ else
+ {
+ fOutNumber = StringToDouble(sResString);
+ if (nESign == -1)
+ {
+#ifdef S390
+ // S390 DBL_MIN = 5.397605347e-79
+ if (fExp == 79.0 && fOutNumber < 5.397605348)
+#else
+ if (fExp == 308.0 && fOutNumber < DBL_MIN*1.0E308)
+#endif
+ {
+ eScannedType = NUMBERFORMAT_TEXT; // Ueberlauf -> Text
+ fOutNumber = 0.0;
+ }
+ else
+ for (i=0; i < (USHORT) fExp; i++)
+ fOutNumber /= 10.0;
+ }
+ else
+ {
+#ifdef S390
+ if (fExp == 75.0 && fOutNumber > DBL_MAX/1.0E75)
+#else
+ if (fExp == 308.0 && fOutNumber > DBL_MAX/1.0E308)
+#endif
+ {
+ fOutNumber = DBL_MAX;
+ eScannedType = NUMBERFORMAT_TEXT; // Ueberlauf -> Text
+ }
+ else
+ for (i=0; i < (USHORT) fExp; i++)
+ fOutNumber *= 10.0;
+ }
+ }
+ }
+
+ if ( nStringScanSign )
+ {
+ if ( nSign )
+ nSign *= nStringScanSign;
+ else
+ nSign = nStringScanSign;
+ }
+ if ( nSign < 0 ) // Vorzeichen dazu
+ fOutNumber = -fOutNumber;
+
+ if (eScannedType == NUMBERFORMAT_PERCENT) // durch 100 dividieren
+ fOutNumber/= 100.0;
+ break;
+
+ case NUMBERFORMAT_FRACTION: // Bruch
+ if (nAnzNums == 1)
+ fOutNumber = StringToDouble(sStrArray[nNums[0]]);
+ else if (nAnzNums == 2)
+ {
+ if (nThousand == 1)
+ {
+ sResString = sStrArray[nNums[0]];
+ sResString += sStrArray[nNums[1]]; // Vorkommateil
+ fOutNumber = StringToDouble(sResString);
+ }
+ else
+ {
+ double fZaehler = StringToDouble(sStrArray[nNums[0]]);
+ double fNenner = StringToDouble(sStrArray[nNums[1]]);
+ if (fNenner != 0.0)
+ fOutNumber = fZaehler/fNenner;
+ else
+ res = FALSE;
+ }
+ }
+ else // nAnzNums > 2
+ {
+ USHORT k = 1;
+ sResString = sStrArray[nNums[0]];
+ if (nThousand > 0)
+ for (k = 1; k <= nThousand; k++)
+ sResString += sStrArray[nNums[k]];
+ fOutNumber = StringToDouble(sResString);
+
+ if (k == nAnzNums-2)
+ {
+ double fZaehler = StringToDouble(sStrArray[nNums[k]]);
+ double fNenner = StringToDouble(sStrArray[nNums[k+1]]);
+ if (fNenner != 0.0)
+ fOutNumber += fZaehler/fNenner;
+ else
+ res = FALSE;
+ }
+ }
+
+ if ( nStringScanSign )
+ {
+ if ( nSign )
+ nSign *= nStringScanSign;
+ else
+ nSign = nStringScanSign;
+ }
+ if ( nSign < 0 ) // Vorzeichen dazu
+ fOutNumber = -fOutNumber;
+ break;
+
+ case NUMBERFORMAT_TIME: // Uhrzeit
+ GetTimeRef(fOutNumber, 0, nAnzNums);
+ break;
+
+ case NUMBERFORMAT_DATE: // Datum
+ {
+ Date aDt; // heute
+ USHORT nCounter = 0; // hier dummy
+ res = GetDateRef(aDt, nCounter, pFormat); // Datum->aDt
+ if (aDt.IsValid())
+ {
+ long nDate = (long) (aDt - *pNullDate); // erst nach long!!
+ fOutNumber = (double) nDate; // vorsichtshalber
+ }
+ else
+ res = FALSE;
+ }
+ break;
+
+ case NUMBERFORMAT_DATETIME: // Datum mit Uhrzeit
+ {
+ Date aDt; // heute
+ USHORT nCounter; // hier wichtig
+ res = GetDateRef(aDt, nCounter, pFormat); // Datum->aDt
+ double fTime;
+ GetTimeRef(fTime, nCounter, nAnzNums-nCounter);
+ if (aDt.IsValid())
+ {
+ long nDate = (long) (aDt - *pNullDate);
+ fOutNumber = (double) nDate + fTime;
+ }
+ else
+ res = FALSE;
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ if (res) // Ueberlauf -> Text
+ {
+ if (fOutNumber < -DBL_MAX) // -1.7E308
+ {
+ F_Type = NUMBERFORMAT_TEXT;
+ fOutNumber = -DBL_MAX;
+ return TRUE;
+ }
+ else if (fOutNumber > DBL_MAX) // 1.7E308
+ {
+ F_Type = NUMBERFORMAT_TEXT;
+ fOutNumber = DBL_MAX;
+ return TRUE;
+ }
+ }
+
+ if (res == FALSE)
+ {
+ eScannedType = NUMBERFORMAT_TEXT;
+ fOutNumber = 0.0;
+ }
+
+ F_Type = eScannedType;
+ return res;
+}
+
+
+
diff --git a/svtools/source/numbers/zforlist.cxx b/svtools/source/numbers/zforlist.cxx
new file mode 100644
index 000000000000..262a5572dde2
--- /dev/null
+++ b/svtools/source/numbers/zforlist.cxx
@@ -0,0 +1,3657 @@
+/*************************************************************************
+ *
+ * $RCSfile: zforlist.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <math.h>
+
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#ifndef _INTN_HXX //autogen
+#include <tools/intn.hxx>
+#endif
+#ifndef _SOUND_HXX //autogen
+#include <vcl/sound.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_SETTINGS_HXX //autogen
+#include <vcl/settings.hxx>
+#endif
+#ifndef _UNOTOOLS_CHARCLASS_HXX
+#include <unotools/charclass.hxx>
+#endif
+#ifndef _ISOLANG_HXX
+#include <tools/isolang.hxx>
+#endif
+
+#define _SVSTDARR_USHORTS
+#include "svstdarr.hxx"
+
+#define _ZFORLIST_CXX
+#include "zforlist.hxx"
+#undef _ZFORLIST_CXX
+
+#include "zforscan.hxx"
+#include "zforfind.hxx"
+#include "zformat.hxx"
+#include "numhead.hxx"
+
+
+ // Konstanten fuer Typoffsets pro Land/Sprache (CL)
+#define ZF_STANDARD 0
+#define ZF_STANDARD_PERCENT 10
+#define ZF_STANDARD_CURRENCY 20
+#define ZF_STANDARD_DATE 30
+#define ZF_STANDARD_TIME 40
+#define ZF_STANDARD_DATETIME 50
+#define ZF_STANDARD_SCIENTIFIC 60
+#define ZF_STANDARD_FRACTION 70
+#define ZF_STANDARD_NEWEXTENDED 75
+#define ZF_STANDARD_NEWEXTENDEDMAX SV_MAX_ANZ_STANDARD_FORMATE-2 // 98
+#define ZF_STANDARD_LOGICAL SV_MAX_ANZ_STANDARD_FORMATE-1 // 99
+#define ZF_STANDARD_TEXT SV_MAX_ANZ_STANDARD_FORMATE // 100
+
+// Sprache, die am International gesetzt wird, wenn eine unbekannte Sprache
+// (von einem anderen System) geladen wird. Darf nicht SYSTEM sein, weil
+// "DM" aus deutschen Einstellungen sonst als Datum erkannt wird (#53155#).
+
+#define UNKNOWN_SUBSTITUTE LANGUAGE_ENGLISH_US
+
+static BOOL bIndexTableInitialized = FALSE;
+static ULONG __FAR_DATA theIndexTable[NF_INDEX_TABLE_ENTRIES];
+
+BOOL SvNumberFormatter::bCurrencyTableInitialized = FALSE;
+NfCurrencyTable SvNumberFormatter::theCurrencyTable;
+USHORT SvNumberFormatter::nSystemCurrencyPosition = 0;
+SV_IMPL_PTRARR( NfCurrencyTable, NfCurrencyEntry* );
+const USHORT nCurrencyTableEuroPosition = 1;
+SV_IMPL_PTRARR( NfWSStringsDtor, XubString* );
+
+// ob das BankSymbol immer am Ende ist (1 $;-1 $) oder sprachabhaengig
+#define NF_BANKSYMBOL_FIX_POSITION 1
+
+/***********************Funktionen SvNumberFormatter**************************/
+
+SvNumberFormatter::SvNumberFormatter(LanguageType eLnge)
+{
+//! if (eLnge == LANGUAGE_SYSTEM) // Sprache Systemn uebersteuern
+//! eLnge = System::GetLanguage();
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = LANGUAGE_ENGLISH_US;
+ SysLnge = eLnge;
+ ActLnge = eLnge;
+ eEvalDateFormat = NF_EVALDATEFORMAT_INTL;
+ nDefaultCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
+ if ( !International::IsFormatAvailable( eLnge ) )
+ eLnge = UNKNOWN_SUBSTITUTE;
+ pIntl = new International( eLnge );
+ String aLanguage, aCountry, aVariant;
+ ConvertLanguageToIsoNames( International::GetRealLanguage( eLnge ), aLanguage, aCountry );
+ pCharClass = new CharClass( ::com::sun::star::lang::Locale( aLanguage, aCountry, aVariant ) );
+ pStringScanner = new ImpSvNumberInputScan( this );
+ pFormatScanner = new ImpSvNumberformatScan( this );
+ pFormatTable = NULL;
+ ImpGenerateFormats(0); // 0 .. 999 fuer SystemEinst.
+ MaxCLOffset = 0;
+ pMergeTable = new SvULONGTable;
+ bNoZero = FALSE;
+ pColorLink = NULL;
+}
+
+SvNumberFormatter::~SvNumberFormatter()
+{
+ SvNumberformat* pEntry = aFTable.First();
+ while (pEntry)
+ {
+ delete pEntry;
+ pEntry = aFTable.Next();
+ }
+ delete pCharClass;
+ delete pIntl;
+ delete pStringScanner;
+ delete pFormatScanner;
+ ClearMergeTable();
+ delete pMergeTable;
+}
+
+Color* SvNumberFormatter::GetUserDefColor(USHORT nIndex)
+{
+ if( pColorLink && pColorLink->IsSet() )
+ return (Color*) ( pColorLink->Call( (void*) &nIndex ));
+ else
+ return NULL;
+}
+
+void SvNumberFormatter::ChangeNullDate(USHORT nDay,
+ USHORT nMonth,
+ USHORT nYear)
+{
+ pFormatScanner->ChangeNullDate(nDay, nMonth, nYear);
+ pStringScanner->ChangeNullDate(nDay, nMonth, nYear);
+}
+
+Date* SvNumberFormatter::GetNullDate()
+{
+ return pFormatScanner->GetNullDate();
+}
+
+void SvNumberFormatter::ChangeStandardPrec(short nPrec)
+{
+ pFormatScanner->ChangeStandardPrec(nPrec);
+}
+
+short SvNumberFormatter::GetStandardPrec()
+{
+ return pFormatScanner->GetStandardPrec();
+}
+
+void SvNumberFormatter::ImpChangeSysCL(LanguageType eLnge)
+{
+//! if (eLnge == LANGUAGE_SYSTEM) // Sprache Systemn uebersteuern
+//! eLnge = System::GetLanguage();
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = LANGUAGE_ENGLISH_US;
+ if (eLnge != SysLnge)
+ {
+ SysLnge = eLnge;
+ ChangeIntl(eLnge);
+ SvNumberformat* pEntry = aFTable.First();
+ while (pEntry) // alte Formate loeschen
+ {
+ pEntry = (SvNumberformat*) aFTable.Remove(aFTable.GetCurKey());
+ delete pEntry;
+ pEntry = (SvNumberformat*) aFTable.First();
+ }
+ ImpGenerateFormats(0); // wieder neue Standardformate
+ }
+}
+
+void SvNumberFormatter::ChangeIntl(LanguageType eLnge)
+{
+//! if (eLnge == LANGUAGE_SYSTEM) // Sprache Systemn uebersteuern
+//! eLnge = System::GetLanguage();
+ if (ActLnge != eLnge)
+ {
+ delete pIntl;
+ ActLnge = eLnge;
+ if ( !International::IsFormatAvailable( eLnge ) )
+ eLnge = UNKNOWN_SUBSTITUTE;
+ pIntl = new International( eLnge );
+
+ String aLanguage, aCountry, aVariant;
+ ConvertLanguageToIsoNames( International::GetRealLanguage( eLnge ), aLanguage, aCountry );
+ pCharClass->setLocale( ::com::sun::star::lang::Locale( aLanguage, aCountry, aVariant ) );
+
+ pFormatScanner->ChangeIntl();
+ pStringScanner->ChangeIntl();
+ }
+}
+
+BOOL SvNumberFormatter::IsTextFormat(ULONG F_Index) const
+{
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index);
+ if (!pFormat)
+ return FALSE;
+ else
+ return pFormat->IsTextFormat();
+}
+
+BOOL SvNumberFormatter::HasTextFormat(ULONG F_Index) const
+{
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index);
+ if (!pFormat)
+ return FALSE;
+ else
+ return pFormat->HasTextFormat();
+}
+
+BOOL SvNumberFormatter::PutEntry(XubString& rString,
+ xub_StrLen& nCheckPos,
+ short& nType,
+ ULONG& nKey, // Formatnummer
+ LanguageType eLnge)
+{
+ nKey = 0;
+ if (rString.Len() == 0) // keinen Leerstring
+ {
+ nCheckPos = 1; // -> Fehler
+ return FALSE;
+ }
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+
+ ChangeIntl(eLnge); // ggfs. austauschen
+ LanguageType eLge = eLnge; // Umgehung const fuer ConvertMode
+ BOOL bCheck = FALSE;
+ SvNumberformat* p_Entry = new SvNumberformat(rString,
+ pFormatScanner,
+ pStringScanner,
+ nCheckPos,
+ eLge);
+ if (nCheckPos == 0) // Format ok
+ { // Typvergleich:
+ short eCheckType = p_Entry->GetType();
+ if ( eCheckType != NUMBERFORMAT_UNDEFINED)
+ {
+ p_Entry->SetType(eCheckType | NUMBERFORMAT_DEFINED);
+ nType = eCheckType;
+ }
+ else
+ {
+ p_Entry->SetType(NUMBERFORMAT_DEFINED);
+ nType = NUMBERFORMAT_DEFINED;
+ }
+ ULONG CLOffset = ImpGenerateCL(eLge); // ggfs. neu Standard-
+ // formate anlegen
+ nKey = ImpIsEntry(p_Entry->GetFormatstring(),CLOffset, eLge);
+ if (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND) // schon vorhanden
+ delete p_Entry;
+ else
+ {
+ bCheck = TRUE;
+ SvNumberformat* pStdFormat =
+ (SvNumberformat*) aFTable.Get(CLOffset + ZF_STANDARD);
+ ULONG nPos = CLOffset + pStdFormat->GetLastInsertKey();
+// ULONG nPos = ImpGetLastCLEntryKey(CLOffset, eLge);
+ if (nPos - CLOffset >= SV_COUNTRY_LANGUAGE_OFFSET)
+ {
+#ifndef DOS
+ Sound::Beep();
+#endif
+ DBG_ERROR("SvNumberFormatter:: Zu viele Formate pro CL");
+ delete p_Entry;
+ }
+ else if (!aFTable.Insert(nPos+1,p_Entry))
+ delete p_Entry;
+ else
+ {
+ nKey = nPos+1;
+ pStdFormat->SetLastInsertKey((USHORT) (nKey-CLOffset));
+ }
+ }
+ }
+ else
+ delete p_Entry;
+ return bCheck;
+}
+
+BOOL SvNumberFormatter::PutandConvertEntry(XubString& rString,
+ xub_StrLen& nCheckPos,
+ short& nType,
+ ULONG& nKey,
+ LanguageType eLnge,
+ LanguageType eNewLnge)
+{
+ BOOL bRes;
+//! if (eNewLnge == LANGUAGE_SYSTEM) // Sprache Systemn uebersteuern
+//! eNewLnge = System::GetLanguage();
+ if (eNewLnge == LANGUAGE_DONTKNOW)
+ eNewLnge = LANGUAGE_ENGLISH_US;
+
+ pFormatScanner->SetConvertMode(eLnge, eNewLnge);
+ bRes = PutEntry(rString, nCheckPos, nType, nKey, eLnge);
+ pFormatScanner->SetConvertMode(FALSE);
+ return bRes;
+}
+
+void SvNumberFormatter::DeleteEntry(ULONG nKey)
+{
+ SvNumberformat* pEntry = aFTable.Remove(nKey);
+ delete pEntry;
+}
+
+void SvNumberFormatter::PrepareSave()
+{
+ SvNumberformat* pFormat = aFTable.First();
+ while (pFormat)
+ {
+ pFormat->SetUsed(FALSE);
+ pFormat = aFTable.Next();
+ }
+}
+
+void SvNumberFormatter::SetFormatUsed(ULONG nFIndex)
+{
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
+ if (pFormat)
+ pFormat->SetUsed(TRUE);
+}
+
+BOOL SvNumberFormatter::Load( SvStream& rStream )
+{
+ LanguageType eSysLang = System::GetLanguage();
+ SvNumberFormatter* pConverter = NULL;
+
+ ImpSvNumMultipleReadHeader aHdr( rStream );
+ USHORT nVersion;
+ rStream >> nVersion;
+ SvNumberformat* pEntry;
+ ULONG nPos;
+ LanguageType eSaveSysLang, eLoadSysLang;
+ USHORT nSysOnStore, eLge, eDummy; // Dummy fuer kompatibles Format
+ rStream >> nSysOnStore >> eLge; // Systemeinstellung aus
+ // Dokument
+ eSaveSysLang = (nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE ?
+ LANGUAGE_SYSTEM : (LanguageType) nSysOnStore);
+ LanguageType eLnge = (LanguageType) eLge;
+ ImpChangeSysCL(eLnge);
+
+ rStream >> nPos;
+ while (nPos != NUMBERFORMAT_ENTRY_NOT_FOUND)
+ {
+ rStream >> eDummy >> eLge;
+ eLnge = (LanguageType) eLge;
+ ImpGenerateCL(eLnge); // ggfs. neue Standardformate anlegen
+
+ ULONG nOffset = nPos % SV_COUNTRY_LANGUAGE_OFFSET; // relativIndex
+ BOOL bUserDefined = (nOffset > SV_MAX_ANZ_STANDARD_FORMATE);
+ //! HACK! ER 29.07.97 15:15
+ // SaveLang wurde bei SYSTEM nicht gespeichert sondern war auch SYSTEM,
+ // erst ab 364i Unterscheidung moeglich
+ BOOL bConversionHack;
+ if ( eLnge == LANGUAGE_SYSTEM )
+ {
+ if ( nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE )
+ {
+ bConversionHack = bUserDefined;
+ eLoadSysLang = eSaveSysLang;
+ }
+ else
+ {
+ bConversionHack = FALSE;
+ eLoadSysLang = eSysLang;
+ }
+ }
+ else
+ {
+ bConversionHack = FALSE;
+ eLoadSysLang = eSaveSysLang;
+ }
+
+ pEntry = new SvNumberformat(*pFormatScanner, eLnge);
+ if ( bConversionHack )
+ { // SYSTEM
+ // nVersion < SV_NUMBERFORMATTER_VERSION_SYSTORE
+ // nVersion < SV_NUMBERFORMATTER_VERSION_KEYWORDS
+ if ( !pConverter )
+ pConverter = new SvNumberFormatter( eSysLang );
+ NfHackConversion eHackConversion = pEntry->Load(
+ rStream, aHdr, pConverter, *pStringScanner );
+ switch ( eHackConversion )
+ {
+ case NF_CONVERT_GERMAN_ENGLISH :
+ pEntry->ConvertLanguage( *pConverter,
+ LANGUAGE_ENGLISH_US, eSysLang, TRUE );
+ break;
+ case NF_CONVERT_ENGLISH_GERMAN :
+ switch ( eSysLang )
+ {
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_GERMAN_SWISS:
+ case LANGUAGE_GERMAN_AUSTRIAN:
+ case LANGUAGE_GERMAN_LUXEMBOURG:
+ case LANGUAGE_GERMAN_LIECHTENSTEIN:
+ // alles beim alten
+ break;
+ default:
+ pEntry->ConvertLanguage( *pConverter,
+ LANGUAGE_GERMAN, eSysLang, TRUE );
+ }
+ break;
+ }
+
+ }
+ else
+ {
+ pEntry->Load( rStream, aHdr, NULL, *pStringScanner );
+ if ( !bUserDefined )
+ bUserDefined = (pEntry->GetNewStandardDefined() > SV_NUMBERFORMATTER_VERSION);
+ if ( bUserDefined )
+ {
+ if ( eSaveSysLang != eLoadSysLang )
+ { // SYSTEM verschieden
+ if ( !pConverter )
+ pConverter = new SvNumberFormatter( eSysLang );
+ if ( nVersion < SV_NUMBERFORMATTER_VERSION_KEYWORDS )
+ {
+ switch ( eSaveSysLang )
+ {
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_GERMAN_SWISS:
+ case LANGUAGE_GERMAN_AUSTRIAN:
+ case LANGUAGE_GERMAN_LUXEMBOURG:
+ case LANGUAGE_GERMAN_LIECHTENSTEIN:
+ // alles beim alten
+ pEntry->ConvertLanguage( *pConverter,
+ eSaveSysLang, eLoadSysLang, TRUE );
+ break;
+ default:
+ // alte english nach neuem anderen
+ pEntry->ConvertLanguage( *pConverter,
+ LANGUAGE_ENGLISH_US, eLoadSysLang, TRUE );
+ }
+ }
+ else
+ pEntry->ConvertLanguage( *pConverter,
+ eSaveSysLang, eLoadSysLang, TRUE );
+ }
+ else
+ { // nicht SYSTEM oder gleiches SYSTEM
+ if ( nVersion < SV_NUMBERFORMATTER_VERSION_KEYWORDS )
+ {
+ LanguageType eLoadLang;
+ BOOL bSystem;
+ if ( eLnge == LANGUAGE_SYSTEM )
+ {
+ eLoadLang = eSysLang;
+ bSystem = TRUE;
+ }
+ else
+ {
+ eLoadLang = eLnge;
+ bSystem = FALSE;
+ }
+ switch ( eLoadLang )
+ {
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_GERMAN_SWISS:
+ case LANGUAGE_GERMAN_AUSTRIAN:
+ case LANGUAGE_GERMAN_LUXEMBOURG:
+ case LANGUAGE_GERMAN_LIECHTENSTEIN:
+ // alles beim alten
+ break;
+ default:
+ // alte english nach neuem anderen
+ if ( !pConverter )
+ pConverter = new SvNumberFormatter( eSysLang );
+ pEntry->ConvertLanguage( *pConverter,
+ LANGUAGE_ENGLISH_US, eLoadLang, bSystem );
+ }
+ }
+ }
+ }
+ }
+ if ( nOffset == 0 ) // StandardFormat
+ {
+ SvNumberformat* pEnt = aFTable.Get(nPos);
+ if (pEnt)
+ pEnt->SetLastInsertKey(pEntry->GetLastInsertKey());
+ }
+ if (!aFTable.Insert(nPos, pEntry))
+ delete pEntry;
+ rStream >> nPos;
+ }
+
+ // ab SV_NUMBERFORMATTER_VERSION_YEAR2000
+ if ( nVersion >= SV_NUMBERFORMATTER_VERSION_YEAR2000 )
+ {
+ aHdr.StartEntry();
+ if ( aHdr.BytesLeft() >= sizeof(UINT16) )
+ {
+ UINT16 nY2k;
+ rStream >> nY2k;
+ if ( nVersion < SV_NUMBERFORMATTER_VERSION_TWODIGITYEAR && nY2k < 100 )
+ nY2k += 1901; // war vor src513e: 29, jetzt: 1930
+ SetYear2000( nY2k );
+ }
+ aHdr.EndEntry();
+ }
+
+ if ( pConverter )
+ delete pConverter;
+ if (rStream.GetError())
+ return FALSE;
+ else
+ return TRUE;
+}
+
+BOOL SvNumberFormatter::Save( SvStream& rStream ) const
+{
+ ImpSvNumMultipleWriteHeader aHdr( rStream );
+ // ab 364i wird gespeichert was SYSTEM wirklich war, vorher hart LANGUAGE_SYSTEM
+ rStream << (USHORT) SV_NUMBERFORMATTER_VERSION;
+ rStream << (USHORT) System::GetLanguage() << (USHORT) SysLnge;
+ SvNumberFormatTable* pTable = (SvNumberFormatTable*) &aFTable;
+ SvNumberformat* pEntry = (SvNumberformat*) pTable->First();
+ while (pEntry)
+ {
+ // Gespeichert werden alle markierten, benutzerdefinierten Formate und
+ // jeweils das Standardformat zu allen angewaehlten CL-Kombinationen
+ // sowie NewStandardDefined
+ if ( pEntry->GetUsed() || (pEntry->GetType() & NUMBERFORMAT_DEFINED) ||
+ pEntry->GetNewStandardDefined() ||
+ (pTable->GetCurKey() % SV_COUNTRY_LANGUAGE_OFFSET == 0) )
+ {
+ rStream << pTable->GetCurKey()
+ << (USHORT) LANGUAGE_SYSTEM
+ << (USHORT) pEntry->GetLanguage();
+ pEntry->Save(rStream, aHdr);
+ }
+ pEntry = (SvNumberformat*) pTable->Next();
+ }
+ rStream << NUMBERFORMAT_ENTRY_NOT_FOUND; // EndeKennung
+
+ // ab SV_NUMBERFORMATTER_VERSION_YEAR2000
+ aHdr.StartEntry();
+ rStream << (UINT16) GetYear2000();
+ aHdr.EndEntry();
+
+ if (rStream.GetError())
+ return FALSE;
+ else
+ return TRUE;
+}
+
+// static
+void SvNumberFormatter::SkipNumberFormatterInStream( SvStream& rStream )
+{
+ ImpSvNumMultipleReadHeader::Skip( rStream );
+}
+
+void SvNumberFormatter::GetUsedLanguages( SvUShorts& rList )
+{
+ rList.Remove( 0, rList.Count() );
+
+ ULONG nOffset = 0;
+ while (nOffset <= MaxCLOffset)
+ {
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nOffset);
+ if (pFormat)
+ rList.Insert( pFormat->GetLanguage(), rList.Count() );
+ nOffset += SV_COUNTRY_LANGUAGE_OFFSET;
+ }
+}
+
+XubString SvNumberFormatter::GetKeyword( LanguageType eLnge, USHORT nIndex )
+{
+ ChangeIntl(eLnge);
+ const String* pTable = pFormatScanner->GetKeyword();
+ if ( pTable && nIndex < NF_KEYWORD_ENTRIES_COUNT )
+ return pTable[nIndex];
+
+ DBG_ERROR("GetKeyword: invalid index");
+ return XubString();
+}
+
+ULONG SvNumberFormatter::ImpGetCLOffset(LanguageType eLnge) const
+{
+ SvNumberformat* pFormat;
+ ULONG nOffset = 0;
+ while (nOffset <= MaxCLOffset)
+ {
+ pFormat = (SvNumberformat*) aFTable.Get(nOffset);
+ if (pFormat && pFormat->GetLanguage() == eLnge)
+ return nOffset;
+ nOffset += SV_COUNTRY_LANGUAGE_OFFSET;
+ }
+ return nOffset;
+}
+
+ULONG SvNumberFormatter::ImpIsEntry(const XubString& rString,
+ ULONG nCLOffset,
+ LanguageType eLnge)
+{
+#ifndef NF_COMMENT_IN_FORMATSTRING
+#error NF_COMMENT_IN_FORMATSTRING not defined (zformat.hxx)
+#endif
+#if NF_COMMENT_IN_FORMATSTRING
+ XubString aStr( rString );
+ SvNumberformat::EraseComment( aStr );
+#endif
+ ULONG res = NUMBERFORMAT_ENTRY_NOT_FOUND;
+ SvNumberformat* pEntry;
+ pEntry = (SvNumberformat*) aFTable.Seek(nCLOffset);
+ while ( res == NUMBERFORMAT_ENTRY_NOT_FOUND &&
+ pEntry && pEntry->GetLanguage() == eLnge )
+ {
+#if NF_COMMENT_IN_FORMATSTRING
+ if ( pEntry->GetComment().Len() )
+ {
+ XubString aFormat( pEntry->GetFormatstring() );
+ SvNumberformat::EraseComment( aFormat );
+ if ( aStr == aFormat )
+ res = aFTable.GetCurKey();
+ else
+ pEntry = (SvNumberformat*) aFTable.Next();
+ }
+ else
+ {
+ if ( aStr == pEntry->GetFormatstring() )
+ res = aFTable.GetCurKey();
+ else
+ pEntry = (SvNumberformat*) aFTable.Next();
+ }
+#else
+ if ( rString == pEntry->GetFormatstring() )
+ res = aFTable.GetCurKey();
+ else
+ pEntry = (SvNumberformat*) aFTable.Next();
+#endif
+ }
+ return res;
+}
+
+/*
+ULONG SvNumberFormatter::ImpGetLastCLEntryKey(ULONG nCLOffset,
+ LanguageType eLnge)
+{
+ // Diese Funktion ist ueberfluesssig geworden 3.3.95
+ ULONG res = 0;
+ SvNumberformat* pEntry;
+ pEntry = (SvNumberformat*) aFTable.Seek(nCLOffset);
+ while (pEntry && pEntry->GetLanguage() == eLnge)
+ {
+ res = aFTable.GetCurKey();
+ pEntry = (SvNumberformat*) aFTable.Next();
+ }
+ if (res < nCLOffset + SV_MAX_ANZ_STANDARD_FORMATE) // nie bei den Standard-
+ res = nCLOffset + SV_MAX_ANZ_STANDARD_FORMATE; // formaten
+ return res;
+}
+*/
+
+SvNumberFormatTable& SvNumberFormatter::GetFirstEntryTable(
+ short& eType,
+ ULONG& FIndex,
+ LanguageType& rLnge)
+{
+ short eTypetmp = eType;
+ if (eType == NUMBERFORMAT_ALL) // Leere Zelle oder don't care
+ rLnge = SysLnge;
+ else
+ {
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(FIndex);
+ if (!pFormat)
+ {
+// DBG_ERROR("SvNumberFormatter:: Unbekanntes altes Zahlformat (1)");
+ rLnge = SysLnge;
+ eType = NUMBERFORMAT_ALL;
+ eTypetmp = eType;
+ }
+ else
+ {
+ rLnge = pFormat->GetLanguage();
+ eType = pFormat->GetType()&~NUMBERFORMAT_DEFINED;
+ if (eType == 0)
+ {
+ eType = NUMBERFORMAT_DEFINED;
+ eTypetmp = eType;
+ }
+ else if (eType == NUMBERFORMAT_DATETIME)
+ {
+ eTypetmp = eType;
+ eType = NUMBERFORMAT_DATE;
+ }
+ else
+ eTypetmp = eType;
+ }
+ }
+ ChangeIntl(rLnge);
+ return GetEntryTable(eTypetmp, FIndex, rLnge);
+}
+
+ULONG SvNumberFormatter::ImpGenerateCL(LanguageType eLnge)
+{
+ ChangeIntl(eLnge);
+ ULONG CLOffset = ImpGetCLOffset(ActLnge);
+ if (CLOffset > MaxCLOffset) // CL noch nicht da
+ {
+ MaxCLOffset += SV_COUNTRY_LANGUAGE_OFFSET;
+ ImpGenerateFormats(MaxCLOffset);
+ CLOffset = MaxCLOffset;
+ }
+ return CLOffset;
+}
+
+SvNumberFormatTable& SvNumberFormatter::ChangeCL(short eType,
+ ULONG& FIndex,
+ LanguageType eLnge)
+{
+ ImpGenerateCL(eLnge);
+ return GetEntryTable(eType, FIndex, ActLnge);
+}
+
+SvNumberFormatTable& SvNumberFormatter::GetEntryTable(
+ short eType,
+ ULONG& FIndex,
+ LanguageType eLnge)
+{
+ delete pFormatTable;
+ pFormatTable = new SvNumberFormatTable; // neuer Table
+ ChangeIntl(eLnge);
+ ULONG CLOffset = ImpGetCLOffset(ActLnge);
+ SvNumberformat* pEntry;
+ pEntry = (SvNumberformat*) aFTable.Seek(CLOffset);
+
+ if (eType == NUMBERFORMAT_ALL)
+ {
+ while (pEntry && pEntry->GetLanguage() == ActLnge)
+ {
+ pFormatTable->Insert(aFTable.GetCurKey(),pEntry); // einhaengen
+ pEntry = (SvNumberformat*) aFTable.Next();
+ }
+ }
+ else
+ {
+ while (pEntry && pEntry->GetLanguage() == ActLnge)
+ {
+ if ((pEntry->GetType()) & eType) // von diesem Typ
+ pFormatTable->Insert(aFTable.GetCurKey(),pEntry);// einhaengen
+ pEntry = (SvNumberformat*) aFTable.Next();
+ }
+ }
+ pEntry = aFTable.Get(FIndex);
+ if (!pEntry || !(pEntry->GetType() & eType) // irgendeine Veraenderung
+ || pEntry->GetLanguage() != ActLnge ) // => StandardForm.
+ if (pFormatTable->Count() > 0) // aber nicht leer
+ FIndex = GetStandardFormat(eType, ActLnge);
+ return *pFormatTable;
+}
+
+BOOL SvNumberFormatter::IsNumberFormat(const XubString& sString,
+ ULONG& F_Index,
+ double& fOutNumber)
+{
+ short FType;
+ const SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(F_Index);
+ if (!pFormat)
+ {
+// DBG_ERROR("SvNumberFormatter:: Unbekanntes altes Zahlformat (2)");
+ ChangeIntl(SysLnge);
+ FType = NUMBERFORMAT_NUMBER;
+ }
+ else
+ {
+ FType = pFormat->GetType() &~NUMBERFORMAT_DEFINED;
+ if (FType == 0)
+ FType = NUMBERFORMAT_DEFINED;
+ ChangeIntl(pFormat->GetLanguage());
+ }
+ BOOL res;
+ short RType = FType;
+ // Ergebnistyp
+ // ohne def-Kennung
+ if (RType == NUMBERFORMAT_TEXT) // Zahlzelle ->Stringz.
+ res = FALSE;
+ else
+ res = pStringScanner->IsNumberFormat(sString, RType, fOutNumber, pFormat);
+
+ if (res && !IsCompatible(FType, RType)) // unpassender Typ
+ {
+ switch ( RType )
+ {
+ case NUMBERFORMAT_TIME :
+ {
+ if ( pStringScanner->GetDecPos() )
+ { // 100stel Sekunden
+ if ( pStringScanner->GetAnzNums() > 3 || fOutNumber < 0.0 )
+ F_Index = GetFormatIndex( NF_TIME_HH_MMSS00, ActLnge );
+ else
+ F_Index = GetFormatIndex( NF_TIME_MMSS00, ActLnge );
+ }
+ else if ( fOutNumber >= 1.0 || fOutNumber < 0.0 )
+ F_Index = GetFormatIndex( NF_TIME_HH_MMSS, ActLnge );
+ else
+ F_Index = GetStandardFormat( RType, ActLnge );
+ }
+ break;
+ default:
+ F_Index = GetStandardFormat( RType, ActLnge );
+ }
+ }
+ return res;
+}
+
+BOOL SvNumberFormatter::IsCompatible(short eOldType,
+ short eNewType)
+{
+ if (eOldType == eNewType)
+ return TRUE;
+ else if (eOldType == NUMBERFORMAT_DEFINED)
+ return TRUE;
+ else
+ {
+ switch (eNewType)
+ {
+ case NUMBERFORMAT_NUMBER:
+ {
+ switch (eOldType)
+ {
+ case NUMBERFORMAT_PERCENT:
+ case NUMBERFORMAT_CURRENCY:
+ case NUMBERFORMAT_SCIENTIFIC:
+ case NUMBERFORMAT_FRACTION:
+// case NUMBERFORMAT_LOGICAL:
+ case NUMBERFORMAT_DEFINED:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ }
+ break;
+ case NUMBERFORMAT_DATE:
+ {
+ switch (eOldType)
+ {
+ case NUMBERFORMAT_DATETIME:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ }
+ break;
+ case NUMBERFORMAT_TIME:
+ {
+ switch (eOldType)
+ {
+ case NUMBERFORMAT_DATETIME:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ }
+ break;
+ case NUMBERFORMAT_DATETIME:
+ {
+ switch (eOldType)
+ {
+ case NUMBERFORMAT_TIME:
+ case NUMBERFORMAT_DATE:
+ return TRUE;
+ default:
+ return FALSE;
+ }
+ }
+ break;
+ default:
+ return FALSE;
+ }
+ return FALSE;
+ }
+}
+
+ULONG SvNumberFormatter::GetStandardFormat( short eType, LanguageType eLnge )
+{
+ ULONG CLOffset = ImpGenerateCL(eLnge);
+ switch(eType)
+ {
+ case NUMBERFORMAT_DATE : return CLOffset + ZF_STANDARD_DATE;
+ case NUMBERFORMAT_TIME : return CLOffset + ZF_STANDARD_TIME+1;
+ case NUMBERFORMAT_DATETIME : return CLOffset + ZF_STANDARD_DATETIME;
+ case NUMBERFORMAT_CURRENCY :
+ {
+ if ( eLnge == LANGUAGE_SYSTEM )
+ return ImpGetDefaultSystemCurrencyFormat();
+ else
+ return CLOffset + ZF_STANDARD_CURRENCY+3;
+ }
+ case NUMBERFORMAT_PERCENT : return CLOffset + ZF_STANDARD_PERCENT+1;
+ case NUMBERFORMAT_SCIENTIFIC: return CLOffset + ZF_STANDARD_SCIENTIFIC;
+ case NUMBERFORMAT_FRACTION : return CLOffset + ZF_STANDARD_FRACTION;
+ case NUMBERFORMAT_LOGICAL : return CLOffset + ZF_STANDARD_LOGICAL;
+ case NUMBERFORMAT_TEXT : return CLOffset + ZF_STANDARD_TEXT;
+ case NUMBERFORMAT_ALL :
+ case NUMBERFORMAT_DEFINED :
+ case NUMBERFORMAT_NUMBER :
+ case NUMBERFORMAT_UNDEFINED :
+ default : return CLOffset + ZF_STANDARD;
+ }
+}
+
+BOOL SvNumberFormatter::IsSpecialStandardFormat( ULONG nFIndex,
+ LanguageType eLnge )
+{
+ return
+ nFIndex == GetFormatIndex( NF_TIME_MMSS00, eLnge ) ||
+ nFIndex == GetFormatIndex( NF_TIME_HH_MMSS00, eLnge ) ||
+ nFIndex == GetFormatIndex( NF_TIME_HH_MMSS, eLnge )
+ ;
+}
+
+ULONG SvNumberFormatter::GetStandardFormat( ULONG nFIndex, short eType,
+ LanguageType eLnge )
+{
+ if ( IsSpecialStandardFormat( nFIndex, eLnge ) )
+ return nFIndex;
+ else
+ return GetStandardFormat( eType, eLnge );
+}
+
+ULONG SvNumberFormatter::GetStandardFormat( double fNumber, ULONG nFIndex,
+ short eType, LanguageType eLnge )
+{
+ if ( IsSpecialStandardFormat( nFIndex, eLnge ) )
+ return nFIndex;
+
+ switch( eType )
+ {
+ case NUMBERFORMAT_TIME :
+ {
+ BOOL bSign;
+ if ( fNumber < 0.0 )
+ {
+ bSign = TRUE;
+ fNumber = -fNumber;
+ }
+ else
+ bSign = FALSE;
+ double fSeconds = fNumber * 86400;
+ if ( floor( fSeconds + 0.5 ) * 100 != floor( fSeconds * 100 + 0.5 ) )
+ { // mit 100stel Sekunden
+ if ( bSign || fSeconds >= 3600 )
+ return GetFormatIndex( NF_TIME_HH_MMSS00, eLnge );
+ else
+ return GetFormatIndex( NF_TIME_MMSS00, eLnge );
+ }
+ else
+ {
+ if ( bSign || fNumber >= 1.0 )
+ return GetFormatIndex( NF_TIME_HH_MMSS, eLnge );
+ else
+ return GetStandardFormat( eType, eLnge );
+ }
+ }
+ break;
+ default:
+ return GetStandardFormat( eType, eLnge );
+ }
+}
+
+void SvNumberFormatter::GetInputLineString(const double& fOutNumber,
+ ULONG nFIndex,
+ XubString& sOutString)
+{
+ SvNumberformat* pFormat;
+ short nOldPrec;
+ Color* pColor;
+ pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
+ if (!pFormat)
+ pFormat = aFTable.Get(ZF_STANDARD);
+ LanguageType eLang = pFormat->GetLanguage();
+ ChangeIntl( eLang );
+ short eType = pFormat->GetType() & ~NUMBERFORMAT_DEFINED;
+ if (eType == 0)
+ eType = NUMBERFORMAT_DEFINED;
+ nOldPrec = -1;
+ if (eType == NUMBERFORMAT_NUMBER || eType == NUMBERFORMAT_PERCENT
+ || eType == NUMBERFORMAT_CURRENCY
+ || eType == NUMBERFORMAT_SCIENTIFIC
+ || eType == NUMBERFORMAT_FRACTION)
+ {
+ if (eType != NUMBERFORMAT_PERCENT) // spaeter Sonderbehandlung %
+ eType = NUMBERFORMAT_NUMBER;
+ nOldPrec = pFormatScanner->GetStandardPrec();
+ ChangeStandardPrec(300); // Merkwert
+ }
+ ULONG nKey = nFIndex;
+ switch ( eType )
+ { // #61619# immer vierstelliges Jahr editieren
+ case NUMBERFORMAT_DATE :
+ nKey = GetFormatIndex( NF_DATE_SYS_DDMMYYYY, eLang );
+ break;
+ case NUMBERFORMAT_DATETIME :
+ nKey = GetFormatIndex( NF_DATETIME_SYS_DDMMYYYY_HHMMSS, eLang );
+ break;
+ default:
+ nKey = GetStandardFormat( fOutNumber, nFIndex, eType, eLang );
+ }
+ if ( nKey != nFIndex )
+ pFormat = (SvNumberformat*) aFTable.Get( nKey );
+ if (pFormat)
+ {
+ if ( eType == NUMBERFORMAT_TIME && pFormat->GetFormatPrecision() )
+ {
+ nOldPrec = pFormatScanner->GetStandardPrec();
+ ChangeStandardPrec(300); // Merkwert
+ }
+ pFormat->GetOutputString(fOutNumber, sOutString, &pColor);
+ }
+ if (nOldPrec != -1)
+ ChangeStandardPrec(nOldPrec);
+}
+
+void SvNumberFormatter::GetOutputString(const double& fOutNumber,
+ ULONG nFIndex,
+ XubString& sOutString,
+ Color** ppColor)
+{
+ if (bNoZero && fOutNumber == 0.0)
+ {
+ sOutString.Erase();
+ return;
+ }
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
+ if (!pFormat)
+ pFormat = aFTable.Get(ZF_STANDARD);
+ ChangeIntl(pFormat->GetLanguage());
+ pFormat->GetOutputString(fOutNumber, sOutString, ppColor);
+}
+
+void SvNumberFormatter::GetOutputString(XubString& sString,
+ ULONG nFIndex,
+ XubString& sOutString,
+ Color** ppColor)
+{
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
+ if (!pFormat)
+ pFormat = aFTable.Get(ZF_STANDARD_TEXT);
+ if (!pFormat->IsTextFormat() && !pFormat->HasTextFormat())
+ {
+ *ppColor = NULL;
+ sOutString = sString;
+ }
+ else
+ {
+ ChangeIntl(pFormat->GetLanguage());
+ pFormat->GetOutputString(sString, sOutString, ppColor);
+ }
+}
+
+BOOL SvNumberFormatter::GetPreviewString(const XubString& sFormatString,
+ double fPreviewNumber,
+ XubString& sOutString,
+ Color** ppColor,
+ LanguageType eLnge)
+{
+ if (sFormatString.Len() == 0) // keinen Leerstring
+ return FALSE;
+
+ xub_StrLen nCheckPos;
+ ULONG nKey;
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+ ChangeIntl(eLnge); // ggfs. austauschen
+ eLnge = ActLnge;
+ XubString sTmpString = sFormatString;
+ SvNumberformat* p_Entry = new SvNumberformat(sTmpString,
+ pFormatScanner,
+ pStringScanner,
+ nCheckPos,
+ eLnge);
+ if (nCheckPos == 0) // String ok
+ {
+ ULONG CLOffset = ImpGenerateCL(eLnge); // ggfs. neu Standard-
+ // formate anlegen
+ nKey = ImpIsEntry(p_Entry->GetFormatstring(),CLOffset, eLnge);
+ if (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND) // schon vorhanden
+ GetOutputString(fPreviewNumber,nKey,sOutString,ppColor);
+ else
+ p_Entry->GetOutputString(fPreviewNumber,sOutString, ppColor);
+ delete p_Entry;
+ return TRUE;
+ }
+ else
+ {
+ delete p_Entry;
+ return FALSE;
+ }
+}
+
+BOOL SvNumberFormatter::GetPreviewStringGuess( const XubString& sFormatString,
+ double fPreviewNumber,
+ XubString& sOutString,
+ Color** ppColor,
+ LanguageType eLnge )
+{
+ if (sFormatString.Len() == 0) // keinen Leerstring
+ return FALSE;
+
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+
+ ChangeIntl( eLnge );
+ eLnge = ActLnge;
+ BOOL bEnglish = (eLnge == LANGUAGE_ENGLISH_US);
+
+ String aFormatStringUpper( pCharClass->upper( sFormatString ) );
+ ULONG nCLOffset = ImpGenerateCL( eLnge );
+ ULONG nKey = ImpIsEntry( aFormatStringUpper, nCLOffset, eLnge );
+ if ( nKey != NUMBERFORMAT_ENTRY_NOT_FOUND )
+ { // Zielformat vorhanden
+ GetOutputString( fPreviewNumber, nKey, sOutString, ppColor );
+ return TRUE;
+ }
+
+ SvNumberformat *pEntry = NULL;
+ xub_StrLen nCheckPos;
+ XubString sTmpString;
+
+ if ( bEnglish )
+ {
+ sTmpString = sFormatString;
+ pEntry = new SvNumberformat( sTmpString, pFormatScanner,
+ pStringScanner, nCheckPos, eLnge );
+ }
+ else
+ {
+ nCLOffset = ImpGenerateCL( LANGUAGE_ENGLISH_US );
+ nKey = ImpIsEntry( aFormatStringUpper, nCLOffset, LANGUAGE_ENGLISH_US );
+ BOOL bEnglishFormat = (nKey != NUMBERFORMAT_ENTRY_NOT_FOUND);
+
+ // try english --> other bzw. english nach other konvertieren
+ LanguageType eFormatLang = LANGUAGE_ENGLISH_US;
+ pFormatScanner->SetConvertMode( LANGUAGE_ENGLISH_US, eLnge );
+ sTmpString = sFormatString;
+ pEntry = new SvNumberformat( sTmpString, pFormatScanner,
+ pStringScanner, nCheckPos, eFormatLang );
+ pFormatScanner->SetConvertMode( FALSE );
+ ChangeIntl( eLnge );
+
+ if ( !bEnglishFormat )
+ {
+ if ( nCheckPos > 0 || pIntl->CompareEqual( sFormatString,
+ pEntry->GetFormatstring(), INTN_COMPARE_IGNORECASE ) )
+ { // other Format
+ delete pEntry;
+ sTmpString = sFormatString;
+ pEntry = new SvNumberformat( sTmpString, pFormatScanner,
+ pStringScanner, nCheckPos, eLnge );
+ }
+ else
+ { // verify english
+ xub_StrLen nCheckPos2;
+ // try other --> english
+ eFormatLang = eLnge;
+ pFormatScanner->SetConvertMode( eLnge, LANGUAGE_ENGLISH_US );
+ sTmpString = sFormatString;
+ SvNumberformat* pEntry2 = new SvNumberformat( sTmpString, pFormatScanner,
+ pStringScanner, nCheckPos2, eFormatLang );
+ pFormatScanner->SetConvertMode( FALSE );
+ ChangeIntl( eLnge );
+ if ( nCheckPos2 == 0 && !pIntl->CompareEqual( sFormatString,
+ pEntry2->GetFormatstring(), INTN_COMPARE_IGNORECASE ) )
+ { // other Format
+ delete pEntry;
+ sTmpString = sFormatString;
+ pEntry = new SvNumberformat( sTmpString, pFormatScanner,
+ pStringScanner, nCheckPos, eLnge );
+ }
+ delete pEntry2;
+ }
+ }
+ }
+
+ if (nCheckPos == 0) // String ok
+ {
+ ImpGenerateCL( eLnge ); // ggfs. neu Standardformate anlegen
+ pEntry->GetOutputString( fPreviewNumber, sOutString, ppColor );
+ delete pEntry;
+ return TRUE;
+ }
+ delete pEntry;
+ return FALSE;
+}
+
+ULONG SvNumberFormatter::TestNewString(const XubString& sFormatString,
+ LanguageType eLnge)
+{
+ if (sFormatString.Len() == 0) // keinen Leerstring
+ return NUMBERFORMAT_ENTRY_NOT_FOUND;
+
+ xub_StrLen nCheckPos;
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+ ChangeIntl(eLnge); // ggfs. austauschen
+ eLnge = ActLnge;
+ ULONG nRes;
+ BOOL bCheck = FALSE;
+ XubString sTmpString = sFormatString;
+ SvNumberformat* pEntry = new SvNumberformat(sTmpString,
+ pFormatScanner,
+ pStringScanner,
+ nCheckPos,
+ eLnge);
+ if (nCheckPos == 0) // String ok
+ {
+ ULONG CLOffset = ImpGenerateCL(eLnge); // ggfs. neu Standard-
+ // formate anlegen
+ nRes = ImpIsEntry(pEntry->GetFormatstring(),CLOffset, eLnge);
+ // schon vorhanden ?
+ }
+ else
+ nRes = NUMBERFORMAT_ENTRY_NOT_FOUND;
+ delete pEntry;
+ return nRes;
+}
+
+SvNumberformat* SvNumberFormatter::ImpInsertFormat(XubString& sStr,
+ BOOL bStandard,
+ ULONG nPos)
+{
+ xub_StrLen nCheckPos = 0;
+ SvNumberformat* pFormat = new SvNumberformat(sStr,
+ pFormatScanner,
+ pStringScanner,
+ nCheckPos,
+ ActLnge);
+ if (!pFormat || nCheckPos > 0)
+ {
+ DBG_ERROR
+ ("SvNumberFormatter:: Unbekanntes oder falsches Zahlformat");
+ delete pFormat;
+ return NULL;;
+ }
+ if (bStandard)
+ pFormat->SetStandard();
+ if (!aFTable.Insert(nPos, pFormat))
+ {
+ delete pFormat;
+ return NULL;
+ }
+ return pFormat;
+}
+
+SvNumberformat* SvNumberFormatter::ImpInsertNewStandardFormat( XubString& sStr,
+ ULONG nPos, USHORT nVersion )
+{
+ SvNumberformat* pNewFormat = ImpInsertFormat( sStr, FALSE, nPos );
+ if (pNewFormat)
+ pNewFormat->SetNewStandardDefined( nVersion );
+ // damit es gespeichert, richtig angezeigt und von alten Versionen konvertiert wird
+#ifndef PRODUCT
+ else
+ {
+ ByteString aErr( "New standard format not inserted: " );
+ aErr += ByteString( sStr, RTL_TEXTENCODING_UTF8 );
+ DBG_ERRORFILE( aErr.GetBuffer() );
+ }
+#endif
+ return pNewFormat;
+}
+
+void SvNumberFormatter::GetFormatSpecialInfo(ULONG nFormat,
+ BOOL& bThousand,
+ BOOL& IsRed,
+ USHORT& nPrecision,
+ USHORT& nAnzLeading)
+
+{
+ SvNumberformat* pFormat = aFTable.Get(nFormat);
+ if (pFormat)
+ pFormat->GetFormatSpecialInfo(bThousand, IsRed,
+ nPrecision, nAnzLeading);
+ else
+ {
+ bThousand = FALSE;
+ IsRed = FALSE;
+ nPrecision = pFormatScanner->GetStandardPrec();
+ nAnzLeading = 0;
+ }
+}
+
+USHORT SvNumberFormatter::GetFormatPrecision( ULONG nFormat ) const
+{
+ SvNumberformat* pFormat = aFTable.Get( nFormat );
+ if ( pFormat )
+ return pFormat->GetFormatPrecision();
+ else
+ return pFormatScanner->GetStandardPrec();
+}
+
+
+ULONG SvNumberFormatter::GetFormatSpecialInfo( const XubString& rFormatString,
+ BOOL& bThousand, BOOL& IsRed, USHORT& nPrecision,
+ USHORT& nAnzLeading, LanguageType eLnge )
+
+{
+ xub_StrLen nCheckPos = 0;
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+ ChangeIntl(eLnge); // ggfs. austauschen
+ eLnge = ActLnge;
+ XubString aTmpStr( rFormatString );
+ SvNumberformat* pFormat = new SvNumberformat( aTmpStr,
+ pFormatScanner, pStringScanner, nCheckPos, eLnge );
+ if ( nCheckPos == 0 )
+ pFormat->GetFormatSpecialInfo( bThousand, IsRed, nPrecision, nAnzLeading );
+ else
+ {
+ bThousand = FALSE;
+ IsRed = FALSE;
+ nPrecision = pFormatScanner->GetStandardPrec();
+ nAnzLeading = 0;
+ }
+ delete pFormat;
+ return nCheckPos;
+}
+
+
+inline ULONG SetIndexTable( NfIndexTableOffset nTabOff, ULONG nIndOff )
+{
+ if ( !bIndexTableInitialized )
+ {
+ DBG_ASSERT( theIndexTable[nTabOff] == NUMBERFORMAT_ENTRY_NOT_FOUND,
+ "SetIndexTable: theIndexTable[nTabOff] bereits belegt" );
+ theIndexTable[nTabOff] = nIndOff;
+ }
+ return nIndOff;
+}
+
+
+void SvNumberFormatter::ImpGenerateFormats(ULONG CLOffset)
+{
+ if ( !bIndexTableInitialized )
+ {
+ for ( USHORT j=0; j<NF_INDEX_TABLE_ENTRIES; j++ )
+ {
+ theIndexTable[j] = NUMBERFORMAT_ENTRY_NOT_FOUND;
+ }
+ }
+ BOOL bOldConvertMode = pFormatScanner->GetConvertMode();
+ if (bOldConvertMode) // fuer diese Funktion
+ pFormatScanner->SetConvertMode(FALSE); // ausschalten
+ xub_StrLen nCheckPos = 0; // Eintrag fuer Standard, Text
+ // und logisch direkt erzeugen
+ SvNumberformat* pNewFormat = NULL;
+ XubString aSystem( RTL_CONSTASCII_USTRINGPARAM( "System" ) ); // Kommentar
+ XubString aDefSystem( RTL_CONSTASCII_USTRINGPARAM( "def/System" ) ); // Kommentar
+ // Zaehler fuer zusaetzliche Standardformate, die nicht in die ersten 10
+ // einer Kategorie passen, insgesamt nochmal ca. 20
+ // Bei jedem ImpInsertNewStandardformat hochzaehlen, neue Formate
+ // hinten anhaengen, nicht einfuegen!
+ USHORT nNewExtended = ZF_STANDARD_NEWEXTENDED;
+
+ SvNumberformat* pStandard = new SvNumberformat(
+ pFormatScanner->GetStandardName(),
+ pFormatScanner, pStringScanner,
+ nCheckPos, ActLnge);
+ pStandard->SetType(NUMBERFORMAT_NUMBER);
+ pStandard->SetStandard();
+ if ( !aFTable.Insert(
+ CLOffset + SetIndexTable( NF_NUMBER_STANDARD, ZF_STANDARD ),
+ pStandard))
+ delete pStandard;
+ else
+ pStandard->SetLastInsertKey(SV_MAX_ANZ_STANDARD_FORMATE);
+ SvNumberformat* pLogical = new SvNumberformat(
+ pFormatScanner->GetBooleanString(),
+ pFormatScanner, pStringScanner,
+ nCheckPos, ActLnge);
+ pLogical->SetType(NUMBERFORMAT_LOGICAL);
+ pLogical->SetStandard();
+ if ( !aFTable.Insert(
+ CLOffset + SetIndexTable( NF_BOOLEAN, ZF_STANDARD_LOGICAL ),
+ pLogical))
+ delete pLogical;
+
+ XubString aWSString = '@';
+ SvNumberformat* pText = new SvNumberformat(aWSString,
+ pFormatScanner, pStringScanner,
+ nCheckPos, ActLnge);
+ pText->SetType(NUMBERFORMAT_TEXT);
+ pText->SetStandard();
+ if ( !aFTable.Insert(
+ CLOffset + SetIndexTable( NF_TEXT, ZF_STANDARD_TEXT ),
+ pText))
+ delete pText;
+
+ xub_Unicode cDecSep = pIntl->GetNumDecimalSep();
+ xub_Unicode cThousandSep = pIntl->GetNumThousandSep();
+ // Zahl:
+ XubString s0 = '0'; // 0
+ ImpInsertFormat(s0,FALSE,
+ CLOffset + SetIndexTable( NF_NUMBER_INT, ZF_STANDARD+1 ));
+ XubString s1( RTL_CONSTASCII_USTRINGPARAM( "000" ) ); // 0,00
+ s1.Insert(cDecSep,1);
+ ImpInsertFormat(s1,FALSE,
+ CLOffset + SetIndexTable( NF_NUMBER_DEC2, ZF_STANDARD+2 ));
+ XubString s2( RTL_CONSTASCII_USTRINGPARAM( "###0" ) ); // #.##0
+ s2.Insert(cThousandSep,1);
+ ImpInsertFormat(s2,FALSE,
+ CLOffset + SetIndexTable( NF_NUMBER_1000INT, ZF_STANDARD+3 ));
+ XubString s3( RTL_CONSTASCII_USTRINGPARAM( "###000" ) ); // #.##0,00
+ s3.Insert(cThousandSep,1);
+ s3.Insert(cDecSep,5);
+ ImpInsertFormat(s3,FALSE,
+ CLOffset + SetIndexTable( NF_NUMBER_1000DEC2, ZF_STANDARD+4 ));
+ // ab Version 6
+ XubString sNumSystem; // #.##0,00 System
+ if ( pIntl->IsNumLeadingZero() )
+ sNumSystem = '0';
+ if ( pIntl->IsNumThousandSep() )
+ {
+ if ( pIntl->IsNumLeadingZero() )
+ sNumSystem.Insert( XubString::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM( "###" ) ), 0 );
+ else
+ sNumSystem.Insert( XubString::CreateFromAscii(
+ RTL_CONSTASCII_STRINGPARAM( "####" ) ), 0 );
+ sNumSystem.Insert( cThousandSep, 1 );
+ }
+ USHORT nNumDigits = pIntl->GetNumDigits();
+ if ( nNumDigits )
+ {
+ sNumSystem += cDecSep;
+ for ( USHORT j=0; j<nNumDigits; j++ )
+ {
+ sNumSystem += '0';
+ }
+ }
+ pNewFormat = ImpInsertNewStandardFormat( sNumSystem,
+ CLOffset + SetIndexTable( NF_NUMBER_SYSTEM, ZF_STANDARD+5 ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aSystem );
+
+ // Prozent:
+ XubString s4( RTL_CONSTASCII_USTRINGPARAM( "0%" ) ); // 0%
+ ImpInsertFormat(s4,FALSE,
+ CLOffset + SetIndexTable( NF_PERCENT_INT, ZF_STANDARD_PERCENT ));
+ XubString s5( RTL_CONSTASCII_USTRINGPARAM( "000%" ) ); // 0,00%
+ s5.Insert(cDecSep,1);
+ ImpInsertFormat(s5,TRUE,
+ CLOffset + SetIndexTable( NF_PERCENT_DEC2, ZF_STANDARD_PERCENT+1 ));
+
+ // Waehrung: (keine Standardoption also kein TRUE bei ImpInsertFormat)
+
+ XubString aRed( '[' );
+ aRed += pFormatScanner->GetRedString();
+ aRed += ']';
+
+ XubString sCurrFlat1( RTL_CONSTASCII_USTRINGPARAM( "###0" ) ); // #.##0 DM
+ sCurrFlat1.Insert(cThousandSep,1);
+ XubString sCurrFlat2( sCurrFlat1 ); // #.##0,00 DM
+ XubString sCurrFlat3( sCurrFlat1 ); // #.##0,-- DM
+ // Anzahl Nachkommastellen in Waehrung
+ USHORT nCurrDigits = pIntl->GetCurrDigits();
+ if ( nCurrDigits )
+ {
+ sCurrFlat2 += cDecSep;
+ sCurrFlat3 += cDecSep;
+ sCurrFlat2.Expand( sCurrFlat2.Len() + nCurrDigits, '0' );
+ sCurrFlat3.Expand( sCurrFlat3.Len() + nCurrDigits, '-' );
+ }
+
+ XubString s6 = sCurrFlat1; // #.##0 DM
+ ImpGetPosCurrFormat(s6);
+ XubString s7 = sCurrFlat2; // #.##0,00 DM
+ ImpGetPosCurrFormat(s7);
+ XubString sDash = sCurrFlat3; // #.##0,-- DM
+ ImpGetPosCurrFormat(sDash);
+ XubString sNegStr1 = sCurrFlat1; // -#.##0 DM
+ ImpGetNegCurrFormat(sNegStr1);
+ XubString sNegStr2 = sCurrFlat2; // -#.##0,00 DM
+ ImpGetNegCurrFormat(sNegStr2);
+ XubString sNegStr3 = sCurrFlat3; // -#.##0,-- DM
+ ImpGetNegCurrFormat(sNegStr3);
+ s6 += ';';
+ XubString s8 = s6;
+ s6 += sNegStr1;
+ s8 += aRed;
+ s8 += sNegStr1;
+ s7 += ';';
+ XubString s9 = s7;
+ s7 += sNegStr2;
+ s9 += aRed;
+ s9 += sNegStr2;
+ sDash += ';';
+ XubString sDashed = sDash;
+ sDash += sNegStr3;
+ sDashed += aRed;
+ sDashed += sNegStr3;
+ ImpInsertFormat(s6,FALSE,
+ CLOffset + SetIndexTable( NF_CURRENCY_1000INT, ZF_STANDARD_CURRENCY ));
+ ImpInsertFormat(s7,FALSE,
+ CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2, ZF_STANDARD_CURRENCY+1 ));
+ // Muss immer 1 hinter
+ // Standard sein
+ // fuer Funktion DM()!!
+ ImpInsertFormat(s8,FALSE,
+ CLOffset + SetIndexTable( NF_CURRENCY_1000INT_RED, ZF_STANDARD_CURRENCY+2 ));
+ ImpInsertFormat(s9,FALSE,
+ CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2_RED, ZF_STANDARD_CURRENCY+3 ));
+
+ // ab Version 3 dazu
+ XubString s28 = sCurrFlat2; // #.##0,00 DEM
+#if NF_BANKSYMBOL_FIX_POSITION
+ s28.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " CCC" ) );
+#else
+ XubString s28n( sCurrFlat2 ), aCCC( RTL_CONSTASCII_USTRINGPARAM( "CCC" ) );
+ USHORT nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
+ pIntl->GetCurrPositiveFormat(), pIntl->GetCurrPositiveFormat(), TRUE );
+ USHORT nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
+ pIntl->GetCurrNegativeFormat(), pIntl->GetCurrNegativeFormat(), TRUE );
+ NfCurrencyEntry::CompletePositiveFormatString( s28, aCCC, nPosiForm );
+ NfCurrencyEntry::CompleteNegativeFormatString( s28n, aCCC, nNegaForm );
+ s28 += ';';
+ s28 += s28n;
+#endif
+ pNewFormat = ImpInsertFormat(s28,FALSE,
+ CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2_CCC, ZF_STANDARD_CURRENCY+4 ));
+ if ( pNewFormat )
+ pNewFormat->SetUsed(TRUE); // damit es gespeichert wird
+
+ // ab Version 6 dazu: #.##0,-- DM
+ ImpInsertNewStandardFormat( sDashed,
+ CLOffset + SetIndexTable( NF_CURRENCY_1000DEC2_DASHED, ZF_STANDARD_CURRENCY+5 ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+
+#if 0 // erDEBUG
+ { // ab SV_NUMBERFORMATTER_VERSION_NEW_CURR EURo und letztes Format testen
+ NfWSStringsDtor aArr;
+ USHORT j, nDefault;
+ const NfCurrencyTable& rTable = GetTheCurrencyTable();
+ const NfCurrencyEntry* pCurr = rTable.GetObject( nCurrencyTableEuroPosition );
+ GetCurrencyFormatStrings( aArr, *pCurr, FALSE );
+ GetCurrencyFormatStrings( aArr, *pCurr, TRUE );
+ for ( j=0; j<aArr.Count(); j++ )
+ {
+ ULONG nCheck, nKey;
+ short nType;
+ PutEntry( *aArr.GetObject(j), nCheck, nType, nKey, ActLnge );
+ }
+ aArr.Remove( 0, aArr.Count() );
+ pCurr = rTable.GetObject( rTable.Count()-1 );
+// GetCurrencyFormatStrings( aArr, *pCurr, FALSE );
+ GetCurrencyFormatStrings( aArr, *pCurr, TRUE );
+ for ( j=0; j<aArr.Count(); j++ )
+ {
+ ULONG nCheck, nKey;
+ short nType;
+ PutEntry( *aArr.GetObject(j), nCheck, nType, nKey, ActLnge );
+ }
+ }
+#endif
+
+ // Datum:
+ XubString s10;
+ ImpGetDateFormat(s10); // TT.MM.JJ kurzes Systemdatum
+ pNewFormat = ImpInsertFormat(s10,TRUE,
+ CLOffset + SetIndexTable( NF_DATE_SYSTEM_SHORT, ZF_STANDARD_DATE ));
+ if ( pNewFormat )
+ pNewFormat->SetComment( aSystem );
+
+ const XubString* pKeyword = pFormatScanner->GetKeyword();
+ xub_Unicode cDateSep = pIntl->GetDateSep();
+ xub_Unicode cTimeSep = pIntl->GetTimeSep();
+
+ XubString s11 = pKeyword[NF_KEY_NN]; // NN TT.MMM JJ
+ s11 += ' ';
+ s11 += pKeyword[NF_KEY_TT];
+ s11 += cDateSep;
+ s11 += pKeyword[NF_KEY_MMM];
+ s11 += ' ';
+ s11 += pKeyword[NF_KEY_JJ];
+ ImpInsertFormat(s11,FALSE,
+ CLOffset + SetIndexTable( NF_DATE_DEF_NNDDMMMYY, ZF_STANDARD_DATE+1 ));
+
+ XubString s12; // MM.JJ
+ XubString s13; // TT.MMM
+ XubString sFullDate; // TT.MM.JJJJ
+ XubString sDDMMYY; // TT.MM.JJ
+ switch(pIntl->GetDateFormat())
+ {
+ case DMY:
+ {
+ s12 = pKeyword[NF_KEY_MM]; // MM.JJ
+ s12 += cDateSep;
+ s12 += pKeyword[NF_KEY_JJ];
+ s13 = pKeyword[NF_KEY_TT]; // TT.MMM
+ s13 += cDateSep;
+ s13 += pKeyword[NF_KEY_MMM];
+ sFullDate = pKeyword[NF_KEY_TT]; // TT
+ sFullDate += cDateSep;
+ sFullDate += pKeyword[NF_KEY_MM]; // MM
+ sFullDate += cDateSep;
+ sDDMMYY = sFullDate;
+ sFullDate += pKeyword[NF_KEY_JJJJ]; // JJJJ
+ sDDMMYY += pKeyword[NF_KEY_JJ]; // JJ
+ }
+ break;
+ case YMD:
+ {
+ s12 = pKeyword[NF_KEY_JJ]; // JJ.MM
+ s12 += cDateSep;
+ s12 += pKeyword[NF_KEY_MM];
+ s13 = pKeyword[NF_KEY_MMM]; // MMM TT
+ s13 += ' ';
+ s13 += pKeyword[NF_KEY_TT];
+ sFullDate = pKeyword[NF_KEY_JJJJ]; // JJJJ
+ sDDMMYY = pKeyword[NF_KEY_JJ]; // JJ
+ XubString aTmp( cDateSep );
+ aTmp += pKeyword[NF_KEY_MM]; // MM
+ aTmp += cDateSep;
+ aTmp += pKeyword[NF_KEY_TT]; // TT
+ sFullDate += aTmp;
+ sDDMMYY += aTmp;
+
+ }
+ break;
+ case MDY:
+ default:
+ {
+ s12 = pKeyword[NF_KEY_MM]; // MM.JJ
+ s12 += cDateSep;
+ s12 += pKeyword[NF_KEY_JJ];
+ s13 = pKeyword[NF_KEY_MMM]; // MMM TT
+ s13 += ' ';
+ s13 += pKeyword[NF_KEY_TT];
+ sFullDate = pKeyword[NF_KEY_MM]; // MM
+ sFullDate += cDateSep;
+ sFullDate += pKeyword[NF_KEY_TT]; // TT
+ sFullDate += cDateSep;
+ sDDMMYY = sFullDate;
+ sFullDate += pKeyword[NF_KEY_JJJJ]; // JJJJ
+ sDDMMYY += pKeyword[NF_KEY_JJ]; // JJ
+ }
+ break;
+ }
+ pNewFormat = ImpInsertFormat(s12,FALSE,
+ CLOffset + SetIndexTable( NF_DATE_SYS_MMYY, ZF_STANDARD_DATE+2 ));
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDefSystem );
+
+ ImpInsertFormat(s13,FALSE,
+ CLOffset + SetIndexTable( NF_DATE_SYS_DDMMM, ZF_STANDARD_DATE+3 ));
+
+ XubString s14 = pKeyword[NF_KEY_MMMM]; // MMMM
+ ImpInsertFormat(s14,FALSE,
+ CLOffset + SetIndexTable( NF_DATE_MMMM, ZF_STANDARD_DATE+4 ));
+
+ XubString s15 = pKeyword[NF_KEY_QQ]; // QQ JJ
+ s15 += ' ';
+ s15 += pKeyword[NF_KEY_JJ];
+ ImpInsertFormat(s15,FALSE,
+ CLOffset + SetIndexTable( NF_DATE_QQJJ, ZF_STANDARD_DATE+5 ));
+
+ // ab Version 2 dazu, war TT.MM.[JJ]JJ jetzt (v6) TT.MM.JJJJ
+ pNewFormat = ImpInsertFormat(sFullDate,FALSE,
+ CLOffset + SetIndexTable( NF_DATE_SYS_DDMMYYYY, ZF_STANDARD_DATE+6 ));
+ if ( pNewFormat )
+ {
+ pNewFormat->SetUsed(TRUE); // damit es gespeichert wird
+ pNewFormat->SetComment( aDefSystem );
+ }
+
+ // ab Version 6 dazu
+ pNewFormat = ImpInsertNewStandardFormat( sDDMMYY,
+ CLOffset + SetIndexTable( NF_DATE_SYS_DDMMYY, ZF_STANDARD_DATE+7 ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDefSystem );
+ // lange Wochentage: statt "NNN, " steht "NNNN" Code wg. Kompatibilitaet
+ // langes Systemdatum wie eingestellt
+ XubString sLongDate;
+ ImpGetLongDateFormat( sLongDate ); // NNN, T. MMMM JJJJ System
+ pNewFormat = ImpInsertNewStandardFormat( sLongDate,
+ CLOffset + SetIndexTable( NF_DATE_SYSTEM_LONG, ZF_STANDARD_DATE+8 ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aSystem );
+ // harte aber systemabhaengige lange Datumformate
+ sLongDate.Erase();
+ ImpGetLongDateFormat( sLongDate, -1, 1, 1, 1 ); // T. MMM JJ def/System
+ pNewFormat = ImpInsertNewStandardFormat( sLongDate,
+ CLOffset + SetIndexTable( NF_DATE_SYS_DMMMYY, ZF_STANDARD_DATE+9 ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDefSystem );
+ //! leider hat das Templin'sche Erbe nur 10 Standardformate pro Kategorie
+ //! vorgesehen, weitere wuerden ZF_STANDARD_TIME ueberschreiben :-((
+ sLongDate.Erase();
+ ImpGetLongDateFormat( sLongDate, -1, 1, 1, 2 ); // T. MMM JJJJ def/System
+ pNewFormat = ImpInsertNewStandardFormat( sLongDate,
+ CLOffset + SetIndexTable( NF_DATE_SYS_DMMMYYYY, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDefSystem );
+ sLongDate.Erase();
+ ImpGetLongDateFormat( sLongDate, -1, 1, 2, 2 ); // T. MMMM JJJJ def/System
+ pNewFormat = ImpInsertNewStandardFormat( sLongDate,
+ CLOffset + SetIndexTable( NF_DATE_SYS_DMMMMYYYY, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDefSystem );
+ sLongDate.Erase();
+ ImpGetLongDateFormat( sLongDate, 1, 1, 1, 1 ); // NN, T. MMM JJ def/System
+ pNewFormat = ImpInsertNewStandardFormat( sLongDate,
+ CLOffset + SetIndexTable( NF_DATE_SYS_NNDMMMYY, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDefSystem );
+ sLongDate.Erase();
+ ImpGetLongDateFormat( sLongDate, 1, 1, 2, 2 ); // NN, T. MMMM JJJJ def/System
+ pNewFormat = ImpInsertNewStandardFormat( sLongDate,
+ CLOffset + SetIndexTable( NF_DATE_SYS_NNDMMMMYYYY, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDefSystem );
+ sLongDate.Erase();
+ ImpGetLongDateFormat( sLongDate, 2, 1, 2, 2 ); // NNN, T. MMMM JJJJ def/System
+ pNewFormat = ImpInsertNewStandardFormat( sLongDate,
+ CLOffset + SetIndexTable( NF_DATE_SYS_NNNNDMMMMYYYY, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDefSystem );
+
+ XubString aDIN( RTL_CONSTASCII_USTRINGPARAM( "DIN 5008 (EN 28601)" ) );
+ XubString sDinTMMMJJJJ; // DIN: T. MMM. JJJJ
+ sDinTMMMJJJJ += pKeyword[NF_KEY_T];
+ sDinTMMMJJJJ += '.';
+ sDinTMMMJJJJ += ' ';
+ sDinTMMMJJJJ += pKeyword[NF_KEY_MMM];
+ sDinTMMMJJJJ += '.';
+ sDinTMMMJJJJ += ' ';
+ sDinTMMMJJJJ += pKeyword[NF_KEY_JJJJ];
+ pNewFormat = ImpInsertNewStandardFormat( sDinTMMMJJJJ,
+ CLOffset + SetIndexTable( NF_DATE_DIN_DMMMYYYY, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDIN );
+
+ XubString sDinTMMMMJJJJ; // DIN: T. MMMM JJJJ
+ sDinTMMMMJJJJ += pKeyword[NF_KEY_T];
+ sDinTMMMMJJJJ += '.';
+ sDinTMMMMJJJJ += ' ';
+ sDinTMMMMJJJJ += pKeyword[NF_KEY_MMMM];
+ sDinTMMMMJJJJ += ' ';
+ sDinTMMMMJJJJ += pKeyword[NF_KEY_JJJJ];
+ pNewFormat = ImpInsertNewStandardFormat( sDinTMMMMJJJJ,
+ CLOffset + SetIndexTable( NF_DATE_DIN_DMMMMYYYY, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDIN );
+
+ XubString sDinMMTT; // DIN: MM-TT
+ sDinMMTT += pKeyword[NF_KEY_MM];
+ sDinMMTT += '-';
+ sDinMMTT += pKeyword[NF_KEY_TT];
+ pNewFormat = ImpInsertNewStandardFormat( sDinMMTT,
+ CLOffset + SetIndexTable( NF_DATE_DIN_MMDD, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDIN );
+
+ XubString sDinJJMMTT = sDinMMTT; // DIN: JJ-MM-TT
+ sDinJJMMTT.Insert( '-', 0 );
+ sDinJJMMTT.Insert( pKeyword[NF_KEY_JJ], 0 );
+ pNewFormat = ImpInsertNewStandardFormat( sDinJJMMTT,
+ CLOffset + SetIndexTable( NF_DATE_DIN_YYMMDD, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDIN );
+
+ XubString sDinJJJJMMTT = sDinMMTT; // DIN: JJJJ-MM-TT
+ sDinJJJJMMTT.Insert( '-', 0 );
+ sDinJJJJMMTT.Insert( pKeyword[NF_KEY_JJJJ], 0 );
+ pNewFormat = ImpInsertNewStandardFormat( sDinJJJJMMTT,
+ CLOffset + SetIndexTable( NF_DATE_DIN_YYYYMMDD, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NEWSTANDARD );
+ if ( pNewFormat )
+ pNewFormat->SetComment( aDIN );
+
+ // Uhrzeit:
+ XubString s16 = pKeyword[NF_KEY_HH]; // HH:MM
+ s16 += cTimeSep;
+ s16 += pKeyword[NF_KEY_MMI];
+ ImpInsertFormat(s16,FALSE,
+ CLOffset + SetIndexTable( NF_TIME_HHMM, ZF_STANDARD_TIME ));
+ XubString sFullTime = s16; // HH:MM:SS
+ sFullTime += cTimeSep;
+ sFullTime += pKeyword[NF_KEY_SS];
+ ImpInsertFormat(sFullTime,TRUE,
+ CLOffset + SetIndexTable( NF_TIME_HHMMSS, ZF_STANDARD_TIME+1 ));
+ XubString s18 = s16; // HH:MM AM/PM
+ s18 += ' ';
+ s18 += pKeyword[NF_KEY_AMPM];
+ ImpInsertFormat(s18,FALSE,
+ CLOffset + SetIndexTable( NF_TIME_HHMMAMPM, ZF_STANDARD_TIME+2 ));
+ XubString s19 = sFullTime; // HH:MM:SS AM/PM
+ s19 += ' ';
+ s19 += pKeyword[NF_KEY_AMPM];
+ ImpInsertFormat(s19,FALSE,
+ CLOffset + SetIndexTable( NF_TIME_HHMMSSAMPM, ZF_STANDARD_TIME+3 ));
+ XubString s20 = sFullTime; // [HH]:MM:SS
+ s20.Insert('[',0);
+ s20.Insert(']',3);
+ ImpInsertFormat(s20,FALSE,
+ CLOffset + SetIndexTable( NF_TIME_HH_MMSS, ZF_STANDARD_TIME+4 ));
+ XubString s21 = pKeyword[NF_KEY_MMI]; // MM:SS,00
+ s21 += cTimeSep;
+ s21 += pKeyword[NF_KEY_SS];
+ s21 += cDecSep;
+ s21 += '0';
+ s21 += '0';
+ ImpInsertFormat(s21,FALSE,
+ CLOffset + SetIndexTable( NF_TIME_MMSS00, ZF_STANDARD_TIME+5 ));
+ XubString s29 = s20; // [HH]:MM:SS,00
+ s29 += cDecSep;
+ s29 += '0';
+ s29 += '0';
+ ImpInsertNewStandardFormat( s29,
+ CLOffset + SetIndexTable( NF_TIME_HH_MMSS00, ZF_STANDARD_TIME+6 ),
+ SV_NUMBERFORMATTER_VERSION_NF_TIME_HH_MMSS00 );
+
+ // Datum u. Uhrzeit:
+ XubString s22 = s10; // TT.MM.JJ HH:MM
+ s22 += ' ';
+ s22 += s16;
+ ImpInsertFormat(s22,TRUE,
+ CLOffset + SetIndexTable( NF_DATETIME_SYSTEM_SHORT_HHMM, ZF_STANDARD_DATETIME ));
+ XubString sFullDateTime = sFullDate; // TT.MM.JJJJ HH:MM:SS
+ sFullDateTime += ' ';
+ sFullDateTime += sFullTime;
+ ImpInsertNewStandardFormat( sFullDateTime,
+ CLOffset + SetIndexTable( NF_DATETIME_SYS_DDMMYYYY_HHMMSS, ZF_STANDARD_DATETIME+1 ),
+ SV_NUMBERFORMATTER_VERSION_NF_DATETIME_SYS_DDMMYYYY_HHMMSS );
+
+ // Wissenschaft:
+ XubString s23( RTL_CONSTASCII_USTRINGPARAM( "000E+000" ) ); // 0,00E+000
+ s23.Insert(cDecSep,1);
+ ImpInsertFormat(s23,TRUE,
+ CLOffset + SetIndexTable( NF_SCIENTIFIC_000E000, ZF_STANDARD_SCIENTIFIC ));
+ XubString s24( RTL_CONSTASCII_USTRINGPARAM( "000E+00" ) ); // 0,00E+00
+ s24.Insert(cDecSep,1);
+ ImpInsertFormat(s24,FALSE,
+ CLOffset + SetIndexTable( NF_SCIENTIFIC_000E00, ZF_STANDARD_SCIENTIFIC+1 ));
+
+ // Bruch: (keine Standardopt.)
+ XubString s25( RTL_CONSTASCII_USTRINGPARAM( "# ?/?" ) ); // # ?/?
+ ImpInsertFormat(s25,FALSE,
+ CLOffset + SetIndexTable( NF_FRACTION_1, ZF_STANDARD_FRACTION ));
+ // "??/" wird vom Compiler als Trigraph fuer '\' interpretiert!
+ XubString s26( RTL_CONSTASCII_USTRINGPARAM( "# ?\?/?\?" ) ); // # ??/??
+ ImpInsertFormat(s26,FALSE,
+ CLOffset + SetIndexTable( NF_FRACTION_2, ZF_STANDARD_FRACTION+1 ));
+
+ XubString sWeekOfYear( pKeyword[NF_KEY_WW] );
+ pNewFormat = ImpInsertNewStandardFormat( sWeekOfYear,
+ CLOffset + SetIndexTable( NF_DATE_WW, nNewExtended++ ),
+ SV_NUMBERFORMATTER_VERSION_NF_DATE_WW );
+
+ bIndexTableInitialized = TRUE;
+ if (bOldConvertMode) // jetzt wieder
+ pFormatScanner->SetConvertMode(TRUE); // einschalten
+ DBG_ASSERT( nNewExtended <= ZF_STANDARD_NEWEXTENDEDMAX,
+ "Ueberlauf der nNewExtended Standardformate" );
+}
+
+void SvNumberFormatter::ImpGetDateFormat(XubString& sDateStr)
+{
+ const XubString* pKeyword = pFormatScanner->GetKeyword();
+ xub_Unicode cDateSep = pIntl->GetDateSep();
+ switch (pIntl->GetDateFormat())
+ {
+ case MDY:
+ {
+ if (pIntl->IsDateMonthLeadingZero())
+ sDateStr += pKeyword[NF_KEY_MM];
+ else
+ sDateStr += pKeyword[NF_KEY_M];
+ sDateStr += cDateSep;
+ if (pIntl->IsDateDayLeadingZero())
+ sDateStr += pKeyword[NF_KEY_TT];
+ else
+ sDateStr += pKeyword[NF_KEY_T];
+ sDateStr += cDateSep;
+ if (pIntl->IsDateCentury())
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ else
+ sDateStr += pKeyword[NF_KEY_JJ];
+ }
+ break;
+ case DMY:
+ {
+ if (pIntl->IsDateDayLeadingZero())
+ sDateStr += pKeyword[NF_KEY_TT];
+ else
+ sDateStr += pKeyword[NF_KEY_T];
+ sDateStr += cDateSep;
+ if (pIntl->IsDateMonthLeadingZero())
+ sDateStr += pKeyword[NF_KEY_MM];
+ else
+ sDateStr += pKeyword[NF_KEY_M];
+ sDateStr += cDateSep;
+ if (pIntl->IsDateCentury())
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ else
+ sDateStr += pKeyword[NF_KEY_JJ];
+ }
+ break;
+ case YMD:
+ {
+ if (pIntl->IsDateCentury())
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ else
+ sDateStr += pKeyword[NF_KEY_JJ];
+ sDateStr += cDateSep;
+ if (pIntl->IsDateMonthLeadingZero())
+ sDateStr += pKeyword[NF_KEY_MM];
+ else
+ sDateStr += pKeyword[NF_KEY_M];
+ sDateStr += cDateSep;
+ if (pIntl->IsDateDayLeadingZero())
+ sDateStr += pKeyword[NF_KEY_TT];
+ else
+ sDateStr += pKeyword[NF_KEY_T];
+ }
+ break;
+ default:
+ break;
+ }
+}
+
+
+void lcl_ImplAddStringMaybeQuoted( String& rDes, const String& rSrc,
+ CharClass* pChrCls )
+{
+ BOOL bQuoted = FALSE;
+ const xub_StrLen nLen = rSrc.Len();
+ xub_StrLen nPos = 0;
+ while ( nPos < nLen )
+ {
+ if ( !bQuoted && pChrCls->isLetter( rSrc, nPos ) )
+ {
+ rDes += '"';
+ bQuoted = TRUE;
+ }
+ else if ( bQuoted && !pChrCls->isLetter( rSrc, nPos ) )
+ {
+ rDes += '"';
+ bQuoted = FALSE;
+ }
+ rDes += rSrc.GetChar( nPos++ );
+ }
+ if ( bQuoted )
+ rDes += '"';
+}
+
+
+void SvNumberFormatter::ImpGetLongDateFormat( XubString& sDateStr,
+ short nShortLongDayOfWeek,
+ short nShortLongDay,
+ short nShortLongMonth,
+ short nShortLongYear )
+{
+ const XubString* pKeyword = pFormatScanner->GetKeyword();
+ switch ( nShortLongDayOfWeek )
+ {
+ case -1 :
+ break;
+ case 0 :
+ switch ( pIntl->GetLongDateDayOfWeekFormat() )
+ {
+ case DAYOFWEEK_NONE :
+ break;
+ case DAYOFWEEK_SHORT :
+ sDateStr += pKeyword[NF_KEY_NN];
+ lcl_ImplAddStringMaybeQuoted( sDateStr,
+ pIntl->GetLongDateDayOfWeekSep(), pCharClass );
+ break;
+ case DAYOFWEEK_LONG :
+ sDateStr += pKeyword[NF_KEY_NNNN];
+ // NNNN ist leider bereits mit Separator, so wird es in
+ // aelteren Versionen, die noch kein NNN kennen, korrekt
+ // dargestellt, nur der Formatstring sieht krank aus..
+ break;
+ default:
+ DBG_ERRORFILE( "unknown LongDateDayOfWeekFormat" );
+ }
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_NN];
+ lcl_ImplAddStringMaybeQuoted( sDateStr,
+ pIntl->GetLongDateDayOfWeekSep(), pCharClass );
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_NNNN];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongDayOfWeek" );
+ }
+ switch (pIntl->GetLongDateFormat())
+ {
+ case MDY:
+ {
+ switch ( nShortLongMonth )
+ {
+ case -1 :
+ break;
+ case 0 :
+ switch ( pIntl->GetLongDateMonthFormat() )
+ {
+ case MONTH_NORMAL :
+ sDateStr += pKeyword[NF_KEY_M];
+ break;
+ case MONTH_ZERO :
+ sDateStr += pKeyword[NF_KEY_MM];
+ break;
+ case MONTH_SHORT :
+ sDateStr += pKeyword[NF_KEY_MMM];
+ break;
+ case MONTH_LONG :
+ sDateStr += pKeyword[NF_KEY_MMMM];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown LongDateMonthFormat" );
+ }
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_MMM];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_MMMM];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongMonth" );
+ }
+ if ( nShortLongMonth != -1 )
+ lcl_ImplAddStringMaybeQuoted( sDateStr,
+ pIntl->GetLongDateMonthSep(), pCharClass );
+
+ switch ( nShortLongDay )
+ {
+ case -1 :
+ break;
+ case 0 :
+ if ( pIntl->IsLongDateDayLeadingZero() )
+ sDateStr += pKeyword[NF_KEY_TT];
+ else
+ sDateStr += pKeyword[NF_KEY_T];
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_T];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_TT];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongDay" );
+ }
+ if ( nShortLongDay != -1 )
+ lcl_ImplAddStringMaybeQuoted( sDateStr,
+ pIntl->GetLongDateDaySep(), pCharClass );
+
+ switch ( nShortLongYear )
+ {
+ case -1 :
+ break;
+ case 0 :
+ if ( pIntl->IsLongDateCentury() )
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ else
+ sDateStr += pKeyword[NF_KEY_JJ];
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_JJ];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongYear" );
+ }
+ //if ( nShortLongYear != -1 )
+ // lcl_ImplAddStringMaybeQuoted( sDateStr,
+ // pIntl->GetLongDateYearSep(), pCharClass );
+
+ }
+ break;
+ case DMY:
+ {
+ switch ( nShortLongDay )
+ {
+ case -1 :
+ break;
+ case 0 :
+ if ( pIntl->IsLongDateDayLeadingZero() )
+ sDateStr += pKeyword[NF_KEY_TT];
+ else
+ sDateStr += pKeyword[NF_KEY_T];
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_T];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_TT];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongDay" );
+ }
+ if ( nShortLongDay != -1 )
+ lcl_ImplAddStringMaybeQuoted( sDateStr,
+ pIntl->GetLongDateDaySep(), pCharClass );
+
+ switch ( nShortLongMonth )
+ {
+ case -1 :
+ break;
+ case 0 :
+ switch ( pIntl->GetLongDateMonthFormat() )
+ {
+ case MONTH_NORMAL :
+ sDateStr += pKeyword[NF_KEY_M];
+ break;
+ case MONTH_ZERO :
+ sDateStr += pKeyword[NF_KEY_MM];
+ break;
+ case MONTH_SHORT :
+ sDateStr += pKeyword[NF_KEY_MMM];
+ break;
+ case MONTH_LONG :
+ sDateStr += pKeyword[NF_KEY_MMMM];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown LongDateMonthFormat" );
+ }
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_MMM];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_MMMM];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongMonth" );
+ }
+ if ( nShortLongMonth != -1 )
+ lcl_ImplAddStringMaybeQuoted( sDateStr,
+ pIntl->GetLongDateMonthSep(), pCharClass );
+
+ switch ( nShortLongYear )
+ {
+ case -1 :
+ break;
+ case 0 :
+ if ( pIntl->IsLongDateCentury() )
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ else
+ sDateStr += pKeyword[NF_KEY_JJ];
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_JJ];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongYear" );
+ }
+ //if ( nShortLongYear != -1 )
+ // lcl_ImplAddStringMaybeQuoted( sDateStr,
+ // pIntl->GetLongDateYearSep(), pCharClass );
+
+ }
+ break;
+ case YMD:
+ {
+ switch ( nShortLongYear )
+ {
+ case -1 :
+ break;
+ case 0 :
+ if ( pIntl->IsLongDateCentury() )
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ else
+ sDateStr += pKeyword[NF_KEY_JJ];
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_JJ];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_JJJJ];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongYear" );
+ }
+ if ( nShortLongYear != -1 )
+ lcl_ImplAddStringMaybeQuoted( sDateStr,
+ pIntl->GetLongDateYearSep(), pCharClass );
+
+ switch ( nShortLongMonth )
+ {
+ case -1 :
+ break;
+ case 0 :
+ switch ( pIntl->GetLongDateMonthFormat() )
+ {
+ case MONTH_NORMAL :
+ sDateStr += pKeyword[NF_KEY_M];
+ break;
+ case MONTH_ZERO :
+ sDateStr += pKeyword[NF_KEY_MM];
+ break;
+ case MONTH_SHORT :
+ sDateStr += pKeyword[NF_KEY_MMM];
+ break;
+ case MONTH_LONG :
+ sDateStr += pKeyword[NF_KEY_MMMM];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown LongDateMonthFormat" );
+ }
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_MMM];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_MMMM];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongMonth" );
+ }
+ if ( nShortLongMonth != -1 )
+ lcl_ImplAddStringMaybeQuoted( sDateStr,
+ pIntl->GetLongDateMonthSep(), pCharClass );
+
+ switch ( nShortLongDay )
+ {
+ case -1 :
+ break;
+ case 0 :
+ if ( pIntl->IsLongDateDayLeadingZero() )
+ sDateStr += pKeyword[NF_KEY_TT];
+ else
+ sDateStr += pKeyword[NF_KEY_T];
+ break;
+ case 1 :
+ sDateStr += pKeyword[NF_KEY_T];
+ break;
+ case 2 :
+ sDateStr += pKeyword[NF_KEY_TT];
+ break;
+ default:
+ DBG_ERRORFILE( "unknown nShortLongDay" );
+ }
+ //if ( nShortLongDay != -1 )
+ // lcl_ImplAddStringMaybeQuoted( sDateStr,
+ // pIntl->GetLongDateDaySep(), pCharClass );
+
+ }
+ break;
+ default:
+ DBG_ERRORFILE( "unknown LongDateFormat" );
+ }
+}
+
+void SvNumberFormatter::ImpGetPosCurrFormat(XubString& sPosStr)
+{
+ NfCurrencyEntry::CompletePositiveFormatString( sPosStr,
+ pIntl->GetCurrSymbol(), pIntl->GetCurrPositiveFormat() );
+}
+
+void SvNumberFormatter::ImpGetNegCurrFormat(XubString& sNegStr)
+{
+ NfCurrencyEntry::CompleteNegativeFormatString( sNegStr,
+ pIntl->GetCurrSymbol(), pIntl->GetCurrNegativeFormat() );
+}
+
+void SvNumberFormatter::GenerateFormat(XubString& sString,
+ ULONG nIndex,
+ LanguageType eLnge,
+ BOOL bThousand,
+ BOOL IsRed,
+ USHORT nPrecision,
+ USHORT nAnzLeading)
+{
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+ short eType = GetType(nIndex);
+ USHORT i;
+ ImpGenerateCL(eLnge); // ggfs. neu Standard-
+ // formate anlegen
+ sString.Erase();
+
+ if (nAnzLeading == 0)
+ {
+ if (!bThousand)
+ sString += '#';
+ else
+ {
+ sString += '#';
+ sString += pIntl->GetNumThousandSep();
+ sString += '#';
+ sString += '#';
+ sString += '#';
+ }
+ }
+ else
+ {
+ for (i = 0; i < nAnzLeading; i++)
+ {
+ if (bThousand && i%3 == 0 && i > 0)
+ sString.Insert(pIntl->GetNumThousandSep(),0);
+ sString.Insert('0',0);
+ }
+ if (bThousand && nAnzLeading < 4)
+ {
+ for (i = nAnzLeading; i < 4; i++)
+ {
+ if (bThousand && i%3 == 0)
+ sString.Insert(pIntl->GetNumThousandSep(),0);
+ sString.Insert('#',0);
+ }
+ }
+ }
+ if (nPrecision > 0)
+ {
+ sString += pIntl->GetNumDecimalSep();
+ for (i = 0; i < nPrecision; i++)
+ sString += '0';
+ }
+ if (eType == NUMBERFORMAT_PERCENT)
+ sString += '%';
+ else if (eType == NUMBERFORMAT_CURRENCY)
+ {
+ XubString sNegStr = sString;
+ XubString aCurr;
+ const NfCurrencyEntry* pEntry;
+ BOOL bBank;
+ if ( GetNewCurrencySymbolString( nIndex, aCurr, &pEntry, &bBank ) )
+ {
+ if ( pEntry )
+ {
+ USHORT nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
+ pIntl->GetCurrPositiveFormat(),
+ pEntry->GetPositiveFormat(), bBank );
+ USHORT nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
+ pIntl->GetCurrNegativeFormat(),
+ pEntry->GetNegativeFormat(), bBank );
+ pEntry->CompletePositiveFormatString( sString, bBank,
+ nPosiForm );
+ pEntry->CompleteNegativeFormatString( sNegStr, bBank,
+ nNegaForm );
+ }
+ else
+ { // wir gehen von einem Banksymbol aus
+ USHORT nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
+ pIntl->GetCurrPositiveFormat(),
+ pIntl->GetCurrPositiveFormat(), TRUE );
+ USHORT nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
+ pIntl->GetCurrNegativeFormat(),
+ pIntl->GetCurrNegativeFormat(), TRUE );
+ NfCurrencyEntry::CompletePositiveFormatString( sString, aCurr,
+ nPosiForm );
+ NfCurrencyEntry::CompleteNegativeFormatString( sNegStr, aCurr,
+ nNegaForm );
+ }
+ }
+ else
+ {
+ ImpGetPosCurrFormat(sString);
+ ImpGetNegCurrFormat(sNegStr);
+ }
+ if (IsRed)
+ {
+ sString += ';';
+ sString += '[';
+ sString += pFormatScanner->GetRedString();
+ sString += ']';
+ }
+ else
+ sString += ';';
+ sString += sNegStr;
+ }
+ if (IsRed && eType != NUMBERFORMAT_CURRENCY)
+ {
+ XubString sTmpStr = sString;
+ sTmpStr += ';';
+ sTmpStr += '[';
+ sTmpStr += pFormatScanner->GetRedString();
+ sTmpStr += ']';
+ sTmpStr += '-';
+ sTmpStr +=sString;
+ sString = sTmpStr;
+ }
+}
+
+BOOL SvNumberFormatter::IsUserDefined(const XubString& sStr,
+ LanguageType eLnge)
+{
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+ ULONG CLOffset = ImpGenerateCL(eLnge); // ggfs. neu Standard-
+ // formate anlegen
+ eLnge = ActLnge;
+ ULONG nKey = ImpIsEntry(sStr, CLOffset, eLnge);
+ if (nKey == NUMBERFORMAT_ENTRY_NOT_FOUND)
+ return TRUE;
+ SvNumberformat* pEntry = aFTable.Get(nKey);
+ if ( pEntry && ((pEntry->GetType() & NUMBERFORMAT_DEFINED) != 0) )
+ return TRUE;
+ return FALSE;
+}
+
+ULONG SvNumberFormatter::GetEntryKey(const XubString& sStr,
+ LanguageType eLnge)
+{
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+ ULONG CLOffset = ImpGenerateCL(eLnge); // ggfs. neu Standard-
+ // formate anlegen
+ return ImpIsEntry(sStr, CLOffset, eLnge);
+}
+
+ULONG SvNumberFormatter::GetStandardIndex(LanguageType eLnge)
+{
+ if (eLnge == LANGUAGE_DONTKNOW)
+ eLnge = SysLnge;
+ return GetStandardFormat(NUMBERFORMAT_NUMBER, eLnge);
+}
+
+short SvNumberFormatter::GetType(ULONG nFIndex)
+{
+ short eType;
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get(nFIndex);
+ if (!pFormat)
+ eType = NUMBERFORMAT_UNDEFINED;
+ else
+ {
+ eType = pFormat->GetType() &~NUMBERFORMAT_DEFINED;
+ if (eType == 0)
+ eType = NUMBERFORMAT_DEFINED;
+ }
+ return eType;
+}
+
+void SvNumberFormatter::ClearMergeTable()
+{
+ ULONG* pIndex = (ULONG*) pMergeTable->First();
+ while (pIndex)
+ {
+ delete pIndex;
+ pIndex = pMergeTable->Next();
+ }
+ pMergeTable->Clear();
+}
+
+SvULONGTable* SvNumberFormatter::MergeFormatter(SvNumberFormatter& rTable)
+{
+ ClearMergeTable();
+ ULONG nCLOffset, nOldKey, nOffset, nNewKey;
+ ULONG* pNewIndex;
+ SvNumberformat* pNewEntry;
+ SvNumberformat* pFormat = rTable.aFTable.First();
+ while (pFormat)
+ {
+ nOldKey = rTable.aFTable.GetCurKey();
+ nOffset = nOldKey % SV_COUNTRY_LANGUAGE_OFFSET; // relativIndex
+ if (nOffset == 0) // 1. Format von CL
+ nCLOffset = ImpGenerateCL(pFormat->GetLanguage());
+
+ if (nOffset <= SV_MAX_ANZ_STANDARD_FORMATE) // Std.form.
+ {
+ nNewKey = nCLOffset + nOffset;
+ if (!aFTable.Get(nNewKey)) // noch nicht da
+ {
+// pNewEntry = new SvNumberformat(*pFormat); // Copy reicht nicht !!!
+ pNewEntry = new SvNumberformat( *pFormat, *pFormatScanner );
+ if (!aFTable.Insert(nNewKey, pNewEntry))
+ delete pNewEntry;
+ }
+ if (nNewKey != nOldKey) // neuer Index
+ {
+ pNewIndex = new ULONG(nNewKey);
+ if (!pMergeTable->Insert(nOldKey,pNewIndex))
+ delete pNewIndex;
+ }
+ }
+ else // benutzerdef.
+ {
+// pNewEntry = new SvNumberformat(*pFormat); // Copy reicht nicht !!!
+ pNewEntry = new SvNumberformat( *pFormat, *pFormatScanner );
+ nNewKey = ImpIsEntry(pNewEntry->GetFormatstring(),
+ nCLOffset,
+ pFormat->GetLanguage());
+ if (nNewKey != NUMBERFORMAT_ENTRY_NOT_FOUND) // schon vorhanden
+ delete pNewEntry;
+ else
+ {
+ SvNumberformat* pStdFormat =
+ (SvNumberformat*) aFTable.Get(nCLOffset + ZF_STANDARD);
+ ULONG nPos = nCLOffset + pStdFormat->GetLastInsertKey();
+ nNewKey = nPos+1;
+ if (nPos - nCLOffset >= SV_COUNTRY_LANGUAGE_OFFSET)
+ {
+#ifndef DOS
+ Sound::Beep();
+#endif
+ DBG_ERROR(
+ "SvNumberFormatter:: Zu viele Formate pro CL");
+ delete pNewEntry;
+ }
+ else if (!aFTable.Insert(nNewKey, pNewEntry))
+ delete pNewEntry;
+ else
+ pStdFormat->SetLastInsertKey((USHORT) (nNewKey - nCLOffset));
+ }
+ if (nNewKey != nOldKey) // neuer Index
+ {
+ pNewIndex = new ULONG(nNewKey);
+ if (!pMergeTable->Insert(nOldKey,pNewIndex))
+ delete pNewIndex;
+ }
+ }
+ pFormat = rTable.aFTable.Next();
+ }
+ return pMergeTable;
+}
+
+
+ULONG SvNumberFormatter::GetFormatForLanguageIfBuiltIn( ULONG nFormat,
+ LanguageType eLnge )
+{
+ if ( eLnge == LANGUAGE_DONTKNOW )
+ eLnge = SysLnge;
+ if ( nFormat < SV_COUNTRY_LANGUAGE_OFFSET && eLnge == SysLnge )
+ return nFormat; // es bleibt wie es ist
+ ULONG nOffset = nFormat % SV_COUNTRY_LANGUAGE_OFFSET; // relativIndex
+ if ( nOffset > SV_MAX_ANZ_STANDARD_FORMATE )
+ return nFormat; // kein eingebautes Format
+ ULONG nCLOffset = ImpGenerateCL(eLnge); // ggbf. generieren
+ return nCLOffset + nOffset;
+}
+
+
+ULONG SvNumberFormatter::GetFormatIndex( NfIndexTableOffset nTabOff,
+ LanguageType eLnge )
+{
+ if ( nTabOff >= NF_INDEX_TABLE_ENTRIES
+ || theIndexTable[nTabOff] == NUMBERFORMAT_ENTRY_NOT_FOUND )
+ return NUMBERFORMAT_ENTRY_NOT_FOUND;
+ if ( eLnge == LANGUAGE_DONTKNOW )
+ eLnge = SysLnge;
+ ULONG nCLOffset = ImpGenerateCL(eLnge); // ggbf. generieren
+ return nCLOffset + theIndexTable[nTabOff];
+}
+
+
+NfIndexTableOffset SvNumberFormatter::GetIndexTableOffset( ULONG nFormat ) const
+{
+ ULONG nOffset = nFormat % SV_COUNTRY_LANGUAGE_OFFSET; // relativIndex
+ if ( nOffset > SV_MAX_ANZ_STANDARD_FORMATE )
+ return NF_INDEX_TABLE_ENTRIES; // kein eingebautes Format
+ for ( USHORT j = 0; j < NF_INDEX_TABLE_ENTRIES; j++ )
+ {
+ if ( theIndexTable[j] == nOffset )
+ return (NfIndexTableOffset) j;
+ }
+ return NF_INDEX_TABLE_ENTRIES; // bad luck
+}
+
+
+void SvNumberFormatter::SetYear2000( USHORT nVal )
+{
+ pStringScanner->SetYear2000( nVal );
+}
+
+
+USHORT SvNumberFormatter::GetYear2000() const
+{
+ return pStringScanner->GetYear2000();
+}
+
+
+USHORT SvNumberFormatter::ExpandTwoDigitYear( USHORT nYear ) const
+{
+ if ( nYear < 100 )
+ return SvNumberFormatter::ExpandTwoDigitYear( nYear,
+ pStringScanner->GetYear2000() );
+ return nYear;
+}
+
+
+// static
+USHORT SvNumberFormatter::GetYear2000Default()
+{
+ return Application::GetSettings().GetMiscSettings().GetTwoDigitYearStart();
+}
+
+
+const NfCurrencyTable& SvNumberFormatter::GetTheCurrencyTable() const
+{
+ while ( !bCurrencyTableInitialized )
+ SvNumberFormatter::ImpInitCurrencyTable();
+ return theCurrencyTable;
+}
+
+
+const NfCurrencyEntry* SvNumberFormatter::MatchSystemCurrency() const
+{
+ const NfCurrencyTable& rTable = GetTheCurrencyTable();
+ return nSystemCurrencyPosition ? rTable[nSystemCurrencyPosition] : NULL;
+}
+
+
+const NfCurrencyEntry& SvNumberFormatter::GetCurrencyEntry( LanguageType eLang ) const
+{
+ if ( eLang == LANGUAGE_DONTKNOW )
+ eLang = SysLnge;
+ if ( eLang == LANGUAGE_SYSTEM )
+ {
+ const NfCurrencyEntry* pCurr = MatchSystemCurrency();
+ return pCurr ? *pCurr : *(GetTheCurrencyTable()[0]);
+ }
+ else
+ {
+ const NfCurrencyTable& rTable = GetTheCurrencyTable();
+ USHORT nCount = rTable.Count();
+ const NfCurrencyEntryPtr* ppData = rTable.GetData();
+ for ( USHORT j = 0; j < nCount; j++, ppData++ )
+ {
+ if ( (*ppData)->GetLanguage() == eLang )
+ return **ppData;
+ }
+ return *(rTable[0]);
+ }
+}
+
+
+ULONG SvNumberFormatter::ImpGetDefaultSystemCurrencyFormat()
+{
+ if ( nDefaultCurrencyFormat == NUMBERFORMAT_ENTRY_NOT_FOUND )
+ {
+ xub_StrLen nCheck;
+ short nType;
+ NfWSStringsDtor aCurrList;
+ USHORT nDefault = GetCurrencyFormatStrings( aCurrList,
+ GetCurrencyEntry( LANGUAGE_SYSTEM ), FALSE );
+ DBG_ASSERT( nDefault < aCurrList.Count(), "wo ist das NewCurrency Standard Format?!?" );
+ // wenn bereits geladen oder userdefined wird nDefaultCurrencyFormat
+ // hierbei auf den richtigen Wert gesetzt
+ PutEntry( *aCurrList.GetObject( nDefault ), nCheck, nType,
+ nDefaultCurrencyFormat, LANGUAGE_SYSTEM );
+ DBG_ASSERT( nCheck == 0, "NewCurrency CheckError" );
+ DBG_ASSERT( nDefaultCurrencyFormat != NUMBERFORMAT_ENTRY_NOT_FOUND,
+ "nDefaultCurrencyFormat == NUMBERFORMAT_ENTRY_NOT_FOUND" );
+ }
+ return nDefaultCurrencyFormat;
+}
+
+
+BOOL SvNumberFormatter::GetNewCurrencySymbolString( ULONG nFormat,
+ XubString& rStr, const NfCurrencyEntry** ppEntry /* = NULL */,
+ BOOL* pBank /* = NULL */ ) const
+{
+ rStr.Erase();
+ if ( ppEntry )
+ *ppEntry = NULL;
+ if ( pBank )
+ *pBank = FALSE;
+ SvNumberformat* pFormat = (SvNumberformat*) aFTable.Get( nFormat );
+ if ( pFormat )
+ {
+ XubString aSymbol, aExtension;
+ if ( pFormat->GetNewCurrencySymbol( aSymbol, aExtension ) )
+ {
+ xub_StrLen nExtLen = aExtension.Len();
+ if ( ppEntry )
+ {
+ LanguageType eExtLang;
+ if ( nExtLen )
+ {
+ ByteString aTmp( aExtension, 1, nExtLen-1, gsl_getSystemTextEncoding() );
+ char* pEnd;
+ long nExtLang = strtol( aTmp.GetBuffer(), &pEnd, 16 );
+ eExtLang = (LanguageType) (
+ (*pEnd || nExtLang == LONG_MIN || nExtLang == LONG_MAX) ?
+ LANGUAGE_DONTKNOW : nExtLang );
+ }
+ else
+ eExtLang = LANGUAGE_DONTKNOW;
+ const NfCurrencyEntry* pFoundEntry = NULL;
+ BOOL bFoundBank = FALSE;
+ const NfCurrencyTable& rTable = GetTheCurrencyTable();
+ USHORT nCount = rTable.Count();
+ const NfCurrencyEntryPtr* ppData = rTable.GetData();
+ for ( USHORT j = 0; j < nCount; j++, ppData++ )
+ {
+ LanguageType eLang = (*ppData)->GetLanguage();
+ if ( !nExtLen || eLang == eExtLang ||
+ (eLang == LANGUAGE_SYSTEM && eExtLang == LANGUAGE_DONTKNOW) )
+ {
+ BOOL bFound;
+ if ( (*ppData)->GetSymbol() == aSymbol )
+ {
+ bFound = TRUE;
+ bFoundBank = FALSE;
+ }
+ else if ( (*ppData)->GetBankSymbol() == aSymbol )
+ {
+ bFound = TRUE;
+ bFoundBank = TRUE;
+ }
+ else
+ bFound = FALSE;
+ if ( bFound )
+ {
+ if ( pFoundEntry && pFoundEntry != *ppData )
+ {
+ pFoundEntry = NULL;
+ break; // for, nicht eindeutig
+ }
+ if ( j == 0 )
+ { // erster Eintrag System
+ pFoundEntry = MatchSystemCurrency();
+ if ( pFoundEntry )
+ break; // for, selbst wenn es mehrere
+ // geben sollte, wird dieser gemeint sein
+ else
+ pFoundEntry = *ppData;
+ }
+ else
+ pFoundEntry = *ppData;
+ }
+ }
+ }
+ if ( pFoundEntry )
+ {
+ *ppEntry = pFoundEntry;
+ if ( pBank )
+ *pBank = bFoundBank;
+ pFoundEntry->BuildSymbolString( rStr, bFoundBank );
+ }
+ }
+ if ( !rStr.Len() )
+ { // analog zu BuildSymbolString
+ rStr = '[';
+ rStr += '$';
+ if ( aSymbol.Search( '-' ) != STRING_NOTFOUND ||
+ aSymbol.Search( ']' ) != STRING_NOTFOUND )
+ {
+ rStr += '"';
+ rStr += aSymbol;
+ rStr += '"';
+ }
+ else
+ rStr += aSymbol;
+ if ( nExtLen )
+ rStr += aExtension;
+ rStr += ']';
+ }
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
+#ifndef PRODUCT
+void lcl_CheckCurrencySymbolPosition( const NfCurrencyEntry& rCurr )
+{
+ short nPos = -1; // -1:=unknown, 0:=vorne, 1:=hinten
+ short nNeg = -1;
+ switch ( rCurr.GetPositiveFormat() )
+ {
+ case 0: // $1
+ nPos = 0;
+ break;
+ case 1: // 1$
+ nPos = 1;
+ break;
+ case 2: // $ 1
+ nPos = 0;
+ break;
+ case 3: // 1 $
+ nPos = 1;
+ break;
+ default:
+ DBG_ERRORFILE("lcl_CheckCurrencySymbolPosition: unknown PositiveFormat");
+ break;
+ }
+ switch ( rCurr.GetNegativeFormat() )
+ {
+ case 0: // ($1)
+ nNeg = 0;
+ break;
+ case 1: // -$1
+ nNeg = 0;
+ break;
+ case 2: // $-1
+ nNeg = 0;
+ break;
+ case 3: // $1-
+ nNeg = 0;
+ break;
+ case 4: // (1$)
+ nNeg = 1;
+ break;
+ case 5: // -1$
+ nNeg = 1;
+ break;
+ case 6: // 1-$
+ nNeg = 1;
+ break;
+ case 7: // 1$-
+ nNeg = 1;
+ break;
+ case 8: // -1 $
+ nNeg = 1;
+ break;
+ case 9: // -$ 1
+ nNeg = 0;
+ break;
+ case 10: // 1 $-
+ nNeg = 1;
+ break;
+ case 11: // $ -1
+ nNeg = 0;
+ break;
+ case 12 : // $ 1-
+ nNeg = 0;
+ break;
+ case 13 : // 1- $
+ nNeg = 1;
+ break;
+ case 14 : // ($ 1)
+ nNeg = 0;
+ break;
+ case 15 : // (1 $)
+ nNeg = 1;
+ break;
+ default:
+ DBG_ERRORFILE("lcl_CheckCurrencySymbolPosition: unknown NegativeFormat");
+ break;
+ }
+ if ( nPos >= 0 && nNeg >= 0 && nPos != nNeg )
+ {
+ ByteString aStr( "ER->TH: positions of currency symbols differ\nLanguage: " );
+ aStr += ByteString::CreateFromInt32( rCurr.GetLanguage() );
+ aStr += " <";
+ aStr += ByteString( rCurr.GetSymbol(), RTL_TEXTENCODING_UTF8 );
+ aStr += "> positive: ";
+ aStr += ByteString::CreateFromInt32( rCurr.GetPositiveFormat() );
+ aStr += ( nPos ? " (postfix)" : " (prefix)" );
+ aStr += ", negative: ";
+ aStr += ByteString::CreateFromInt32( rCurr.GetNegativeFormat() );
+ aStr += ( nNeg ? " (postfix)" : " (prefix)" );
+#if 0
+ DBG_ERRORFILE( aStr.GetBuffer() );
+#endif
+ }
+}
+#endif
+
+
+// static
+void SvNumberFormatter::ImpInitCurrencyTable()
+{
+ // racing condition moeglich:
+ // while ( !bCurrencyTableInitialized )
+ // ImpInitCurrencyTable();
+ static BOOL bInitializing = FALSE;
+ if ( bCurrencyTableInitialized || bInitializing )
+ return ;
+ bInitializing = TRUE;
+
+ LanguageType eSysLang = System::GetLanguage();
+ NfCurrencyEntryPtr pEntry;
+ USHORT n = International::GetAvailableFormatCount();
+ for ( USHORT j = 0; j < n; j++ )
+ {
+ LanguageType eLang = International::GetAvailableFormat( j );
+#ifdef DEBUG
+ LanguageType eReal = International::GetRealLanguage( eLang );
+ LanguageType eNeut = International::GetNeutralLanguage( eLang );
+ if ( eReal != eLang )
+ BOOL bBreak = TRUE;
+ if ( eNeut != eLang )
+ BOOL bBreak = TRUE;
+#endif
+ International* pIntl = new International( eLang );
+ pEntry = new NfCurrencyEntry( *pIntl );
+#ifndef PRODUCT
+ lcl_CheckCurrencySymbolPosition( *pEntry );
+#endif
+ theCurrencyTable.Insert( pEntry, j );
+ delete pIntl;
+ if ( !nSystemCurrencyPosition && pEntry->GetLanguage() == eSysLang )
+ nSystemCurrencyPosition = j;
+ }
+ DBG_ASSERT( theCurrencyTable.Count(),
+ "SvNumberFormatter::ImpInitCurrencyTable: kein NfCurrencyEntry ?!?" );
+ // erster Eintrag ist System
+ // landesunabhaengigen EURo an zweiter Stelle einfuegen
+ pEntry = new NfCurrencyEntry;
+ pEntry->SetEuro();
+ theCurrencyTable.Insert( pEntry, nCurrencyTableEuroPosition );
+ DBG_ASSERT( theCurrencyTable[0]->GetLanguage() == LANGUAGE_SYSTEM,
+ "SvNumberFormatter::ImpInitCurrencyTable: erster Eintrag nicht System" );
+ DBG_ASSERT( nSystemCurrencyPosition, "Regional Settings Language nicht in TH's Tabellen" );
+ if ( nSystemCurrencyPosition )
+ {
+ if ( nSystemCurrencyPosition >= nCurrencyTableEuroPosition )
+ nSystemCurrencyPosition++;
+ if ( theCurrencyTable[nSystemCurrencyPosition]->GetSymbol() !=
+ theCurrencyTable[0]->GetSymbol() )
+ {
+ if ( theCurrencyTable[0]->IsEuro() )
+ nSystemCurrencyPosition = nCurrencyTableEuroPosition;
+ else
+ nSystemCurrencyPosition = 0;
+ }
+ if ( nSystemCurrencyPosition )
+ theCurrencyTable[nSystemCurrencyPosition]->ApplyVariableInformation(
+ *theCurrencyTable[0] );
+ }
+ bCurrencyTableInitialized = TRUE;
+ bInitializing = FALSE;
+}
+
+
+USHORT SvNumberFormatter::GetCurrencyFormatStrings( NfWSStringsDtor& rStrArr,
+ const NfCurrencyEntry& rCurr, BOOL bBank ) const
+{
+ USHORT nDefault = 0;
+ if ( bBank )
+ { // nur Bankensymbole
+ XubString aPositiveBank, aNegativeBank;
+ rCurr.BuildPositiveFormatString( aPositiveBank, TRUE, *pIntl, 1 );
+ rCurr.BuildNegativeFormatString( aNegativeBank, TRUE, *pIntl, 1 );
+
+ WSStringPtr pFormat1 = new String( aPositiveBank );
+ *pFormat1 += ';';
+ WSStringPtr pFormat2 = new String( *pFormat1 );
+
+ XubString aRed( '[' );
+ aRed += pFormatScanner->GetRedString();
+ aRed += ']';
+
+ *pFormat2 += aRed;
+
+ *pFormat1 += aNegativeBank;
+ *pFormat2 += aNegativeBank;
+
+ rStrArr.Insert( pFormat1, rStrArr.Count() );
+ rStrArr.Insert( pFormat2, rStrArr.Count() );
+ nDefault = rStrArr.Count() - 1;
+ }
+ else
+ { // gemischte Formate wie in SvNumberFormatter::ImpGenerateFormats
+ // aber keine doppelten, wenn keine Nachkommastellen in Waehrung
+ XubString aPositive, aNegative, aPositiveNoDec, aNegativeNoDec,
+ aPositiveDashed, aNegativeDashed;
+ WSStringPtr pFormat1, pFormat2, pFormat3, pFormat4, pFormat5;
+
+ XubString aRed( '[' );
+ aRed += pFormatScanner->GetRedString();
+ aRed += ']';
+
+ rCurr.BuildPositiveFormatString( aPositive, FALSE, *pIntl, 1 );
+ rCurr.BuildNegativeFormatString( aNegative, FALSE, *pIntl, 1 );
+ if ( rCurr.GetDigits() )
+ {
+ rCurr.BuildPositiveFormatString( aPositiveNoDec, FALSE, *pIntl, 0 );
+ rCurr.BuildNegativeFormatString( aNegativeNoDec, FALSE, *pIntl, 0 );
+ rCurr.BuildPositiveFormatString( aPositiveDashed, FALSE, *pIntl, 2 );
+ rCurr.BuildNegativeFormatString( aNegativeDashed, FALSE, *pIntl, 2 );
+
+ pFormat1 = new String( aPositiveNoDec );
+ *pFormat1 += ';';
+ pFormat3 = new String( *pFormat1 );
+ pFormat5 = new String( aPositiveDashed );
+ *pFormat5 += ';';
+
+ *pFormat1 += aNegativeNoDec;
+
+ *pFormat3 += aRed;
+ *pFormat5 += aRed;
+
+ *pFormat3 += aNegativeNoDec;
+ *pFormat5 += aNegativeDashed;
+ }
+ else
+ {
+ pFormat1 = NULL;
+ pFormat3 = NULL;
+ pFormat5 = NULL;
+ }
+
+ pFormat2 = new String( aPositive );
+ *pFormat2 += ';';
+ pFormat4 = new String( *pFormat2 );
+
+ *pFormat2 += aNegative;
+
+ *pFormat4 += aRed;
+ *pFormat4 += aNegative;
+
+ if ( pFormat1 )
+ rStrArr.Insert( pFormat1, rStrArr.Count() );
+ rStrArr.Insert( pFormat2, rStrArr.Count() );
+ if ( pFormat3 )
+ rStrArr.Insert( pFormat3, rStrArr.Count() );
+ rStrArr.Insert( pFormat4, rStrArr.Count() );
+ nDefault = rStrArr.Count() - 1;
+ if ( pFormat5 )
+ rStrArr.Insert( pFormat5, rStrArr.Count() );
+ }
+ return nDefault;
+}
+
+
+//--- NfCurrencyEntry ----------------------------------------------------
+
+NfCurrencyEntry::NfCurrencyEntry()
+ : eLanguage( LANGUAGE_DONTKNOW ),
+ nPositiveFormat(3),
+ nNegativeFormat(8),
+ nDigits(2),
+ cZeroChar('0')
+{
+}
+
+
+NfCurrencyEntry::NfCurrencyEntry( const International& rIntl )
+{
+ aSymbol = rIntl.GetCurrSymbol();
+ aBankSymbol = rIntl.GetCurrBankSymbol();
+ eLanguage = rIntl.GetLanguage();
+ nPositiveFormat = rIntl.GetCurrPositiveFormat();
+ nNegativeFormat = rIntl.GetCurrNegativeFormat();
+ nDigits = rIntl.GetCurrDigits();
+ cZeroChar = rIntl.GetCurrZeroChar();
+}
+
+
+void NfCurrencyEntry::SetEuro()
+{
+ aSymbol = NfCurrencyEntry::GetEuroSymbol();
+ aBankSymbol.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "EUR" ) );
+ eLanguage = LANGUAGE_DONTKNOW;
+ nPositiveFormat = 3;
+ nNegativeFormat = 8;
+ nDigits = 2;
+ cZeroChar = '0';
+}
+
+
+BOOL NfCurrencyEntry::IsEuro() const
+{
+ if ( aBankSymbol.EqualsAscii( "EUR" ) )
+ return TRUE;
+ XubString aEuro( NfCurrencyEntry::GetEuroSymbol() );
+ return aSymbol == aEuro;
+}
+
+
+void NfCurrencyEntry::ApplyVariableInformation( const NfCurrencyEntry& r )
+{
+ nPositiveFormat = r.nPositiveFormat;
+ nNegativeFormat = r.nNegativeFormat;
+ nDigits = r.nDigits;
+ cZeroChar = r.cZeroChar;
+}
+
+
+void NfCurrencyEntry::BuildSymbolString( XubString& rStr, BOOL bBank,
+ BOOL bWithoutExtension ) const
+{
+ rStr = '[';
+ rStr += '$';
+ if ( bBank )
+ rStr += aBankSymbol;
+ else
+ {
+ if ( aSymbol.Search( '-' ) != STRING_NOTFOUND || aSymbol.Search( ']' ) != STRING_NOTFOUND )
+ {
+ rStr += '"';
+ rStr += aSymbol;
+ rStr += '"';
+ }
+ else
+ rStr += aSymbol;
+ if ( !bWithoutExtension && eLanguage != LANGUAGE_DONTKNOW && eLanguage != LANGUAGE_SYSTEM )
+ {
+ rStr += '-';
+ rStr += UniString::CreateFromInt32( sal_Int32( eLanguage ), 16 );
+ }
+ }
+ rStr += ']';
+}
+
+
+void NfCurrencyEntry::Impl_BuildFormatStringNumChars( XubString& rStr,
+ const International& rIntl, USHORT nDecimalFormat ) const
+{
+ rStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "###0" ) );
+ rStr.Insert( rIntl.GetNumThousandSep(), 1 );
+ if ( nDecimalFormat && nDigits )
+ {
+ rStr += rIntl.GetNumDecimalSep();
+ rStr.Expand( rStr.Len() + nDigits, (nDecimalFormat == 2 ? '-' : cZeroChar) );
+ }
+}
+
+
+void NfCurrencyEntry::BuildPositiveFormatString( XubString& rStr, BOOL bBank,
+ const International& rIntl, USHORT nDecimalFormat ) const
+{
+ Impl_BuildFormatStringNumChars( rStr, rIntl, nDecimalFormat );
+ USHORT nPosiForm = NfCurrencyEntry::GetEffectivePositiveFormat(
+ rIntl.GetCurrPositiveFormat(), nPositiveFormat, bBank );
+ CompletePositiveFormatString( rStr, bBank, nPosiForm );
+}
+
+
+void NfCurrencyEntry::BuildNegativeFormatString( XubString& rStr, BOOL bBank,
+ const International& rIntl, USHORT nDecimalFormat ) const
+{
+ Impl_BuildFormatStringNumChars( rStr, rIntl, nDecimalFormat );
+ USHORT nNegaForm = NfCurrencyEntry::GetEffectiveNegativeFormat(
+ rIntl.GetCurrNegativeFormat(), nNegativeFormat, bBank );
+ CompleteNegativeFormatString( rStr, bBank, nNegaForm );
+}
+
+
+void NfCurrencyEntry::CompletePositiveFormatString( XubString& rStr, BOOL bBank,
+ USHORT nPosiForm ) const
+{
+ XubString aSymStr;
+ BuildSymbolString( aSymStr, bBank );
+ NfCurrencyEntry::CompletePositiveFormatString( rStr, aSymStr, nPosiForm );
+}
+
+
+void NfCurrencyEntry::CompleteNegativeFormatString( XubString& rStr, BOOL bBank,
+ USHORT nNegaForm ) const
+{
+ XubString aSymStr;
+ BuildSymbolString( aSymStr, bBank );
+ NfCurrencyEntry::CompleteNegativeFormatString( rStr, aSymStr, nNegaForm );
+}
+
+
+// static
+void NfCurrencyEntry::CompletePositiveFormatString( XubString& rStr,
+ const XubString& rSymStr, USHORT nPositiveFormat )
+{
+ switch( nPositiveFormat )
+ {
+ case 0: // $1
+ rStr.Insert( rSymStr , 0 );
+ break;
+ case 1: // 1$
+ rStr += rSymStr;
+ break;
+ case 2: // $ 1
+ {
+ rStr.Insert( ' ', 0 );
+ rStr.Insert( rSymStr, 0 );
+ }
+ break;
+ case 3: // 1 $
+ {
+ rStr += ' ';
+ rStr += rSymStr;
+ }
+ break;
+ default:
+ DBG_ERROR("NfCurrencyEntry::CompletePositiveFormatString: unknown option");
+ break;
+ }
+}
+
+
+// static
+void NfCurrencyEntry::CompleteNegativeFormatString( XubString& rStr,
+ const XubString& rSymStr, USHORT nNegativeFormat )
+{
+ switch( nNegativeFormat )
+ {
+ case 0: // ($1)
+ {
+ rStr.Insert( rSymStr, 0);
+ rStr.Insert('(',0);
+ rStr += ')';
+ }
+ break;
+ case 1: // -$1
+ {
+ rStr.Insert( rSymStr, 0);
+ rStr.Insert('-',0);
+ }
+ break;
+ case 2: // $-1
+ {
+ rStr.Insert('-',0);
+ rStr.Insert( rSymStr, 0);
+ }
+ break;
+ case 3: // $1-
+ {
+ rStr.Insert( rSymStr, 0);
+ rStr += '-';
+ }
+ break;
+ case 4: // (1$)
+ {
+ rStr.Insert('(',0);
+ rStr += rSymStr;
+ rStr += ')';
+ }
+ break;
+ case 5: // -1$
+ {
+ rStr += rSymStr;
+ rStr.Insert('-',0);
+ }
+ break;
+ case 6: // 1-$
+ {
+ rStr += '-';
+ rStr += rSymStr;
+ }
+ break;
+ case 7: // 1$-
+ {
+ rStr += rSymStr;
+ rStr += '-';
+ }
+ break;
+ case 8: // -1 $
+ {
+ rStr += ' ';
+ rStr += rSymStr;
+ rStr.Insert('-',0);
+ }
+ break;
+ case 9: // -$ 1
+ {
+ rStr.Insert(' ',0);
+ rStr.Insert( rSymStr, 0);
+ rStr.Insert('-',0);
+ }
+ break;
+ case 10: // 1 $-
+ {
+ rStr += ' ';
+ rStr += rSymStr;
+ rStr += '-';
+ }
+ break;
+ case 11: // $ -1
+ {
+ XubString aTmp( rSymStr );
+ aTmp += ' ';
+ aTmp += '-';
+ rStr.Insert( aTmp, 0 );
+ }
+ break;
+ case 12 : // $ 1-
+ {
+ rStr.Insert(' ', 0);
+ rStr.Insert( rSymStr, 0);
+ rStr += '-';
+ }
+ break;
+ case 13 : // 1- $
+ {
+ rStr += '-';
+ rStr += ' ';
+ rStr += rSymStr;
+ }
+ break;
+ case 14 : // ($ 1)
+ {
+ rStr.Insert(' ',0);
+ rStr.Insert( rSymStr, 0);
+ rStr.Insert('(',0);
+ rStr += ')';
+ }
+ break;
+ case 15 : // (1 $)
+ {
+ rStr.Insert('(',0);
+ rStr += ' ';
+ rStr += rSymStr;
+ rStr += ')';
+ }
+ break;
+ default:
+ DBG_ERROR("NfCurrencyEntry::CompleteNegativeFormatString: unknown option");
+ break;
+ }
+}
+
+
+// static
+USHORT NfCurrencyEntry::GetEffectivePositiveFormat( USHORT nIntlFormat,
+ USHORT nCurrFormat, BOOL bBank )
+{
+ if ( bBank )
+ {
+#if NF_BANKSYMBOL_FIX_POSITION
+ return 3;
+#else
+ switch ( nIntlFormat )
+ {
+ case 0: // $1
+ nIntlFormat = 2; // $ 1
+ break;
+ case 1: // 1$
+ nIntlFormat = 3; // 1 $
+ break;
+ case 2: // $ 1
+ break;
+ case 3: // 1 $
+ break;
+ }
+ return nIntlFormat;
+#endif
+ }
+ else
+ return nCurrFormat;
+}
+
+
+// nur aufrufen, wenn nCurrFormat wirklich mit Klammern ist
+USHORT lcl_MergeNegativeParenthesisFormat( USHORT nIntlFormat, USHORT nCurrFormat )
+{
+ short nSign = 0; // -1:=Klammer 0:=links, 1:=mitte, 2:=rechts
+ switch ( nIntlFormat )
+ {
+ case 0: // ($1)
+ case 4: // (1$)
+ case 14 : // ($ 1)
+ case 15 : // (1 $)
+ return nCurrFormat;
+ break;
+ case 1: // -$1
+ case 5: // -1$
+ case 8: // -1 $
+ case 9: // -$ 1
+ nSign = 0;
+ break;
+ case 2: // $-1
+ case 6: // 1-$
+ case 11 : // $ -1
+ case 13 : // 1- $
+ break;
+ nSign = 1;
+ case 3: // $1-
+ case 7: // 1$-
+ case 10: // 1 $-
+ case 12 : // $ 1-
+ nSign = 2;
+ break;
+ }
+
+ switch ( nCurrFormat )
+ {
+ case 0: // ($1)
+ switch ( nSign )
+ {
+ case 0:
+ return 1; // -$1
+ break;
+ case 1:
+ return 2; // $-1
+ break;
+ case 2:
+ return 3; // $1-
+ break;
+ }
+ break;
+ case 4: // (1$)
+ switch ( nSign )
+ {
+ case 0:
+ return 5; // -1$
+ break;
+ case 1:
+ return 6; // 1-$
+ break;
+ case 2:
+ return 7; // 1$-
+ break;
+ }
+ break;
+ case 14 : // ($ 1)
+ switch ( nSign )
+ {
+ case 0:
+ return 9; // -$ 1
+ break;
+ case 1:
+ return 11; // $ -1
+ break;
+ case 2:
+ return 12; // $ 1-
+ break;
+ }
+ break;
+ case 15 : // (1 $)
+ switch ( nSign )
+ {
+ case 0:
+ return 8; // -1 $
+ break;
+ case 1:
+ return 13; // 1- $
+ break;
+ case 2:
+ return 10; // 1 $-
+ break;
+ }
+ break;
+ }
+ return nCurrFormat;
+}
+
+
+// static
+USHORT NfCurrencyEntry::GetEffectiveNegativeFormat( USHORT nIntlFormat,
+ USHORT nCurrFormat, BOOL bBank )
+{
+ if ( bBank )
+ {
+#if NF_BANKSYMBOL_FIX_POSITION
+ return 8;
+#else
+ switch ( nIntlFormat )
+ {
+ case 0: // ($1)
+// nIntlFormat = 14; // ($ 1)
+ nIntlFormat = 9; // -$ 1
+ break;
+ case 1: // -$1
+ nIntlFormat = 9; // -$ 1
+ break;
+ case 2: // $-1
+ nIntlFormat = 11; // $ -1
+ break;
+ case 3: // $1-
+ nIntlFormat = 12; // $ 1-
+ break;
+ case 4: // (1$)
+// nIntlFormat = 15; // (1 $)
+ nIntlFormat = 8; // -1 $
+ break;
+ case 5: // -1$
+ nIntlFormat = 8; // -1 $
+ break;
+ case 6: // 1-$
+ nIntlFormat = 13; // 1- $
+ break;
+ case 7: // 1$-
+ nIntlFormat = 10; // 1 $-
+ break;
+ case 8: // -1 $
+ break;
+ case 9: // -$ 1
+ break;
+ case 10: // 1 $-
+ break;
+ case 11: // $ -1
+ break;
+ case 12 : // $ 1-
+ break;
+ case 13 : // 1- $
+ break;
+ case 14 : // ($ 1)
+// nIntlFormat = 14; // ($ 1)
+ nIntlFormat = 9; // -$ 1
+ break;
+ case 15 : // (1 $)
+// nIntlFormat = 15; // (1 $)
+ nIntlFormat = 8; // -1 $
+ break;
+ }
+#endif
+ }
+ else if ( nIntlFormat != nCurrFormat )
+ {
+ switch ( nCurrFormat )
+ {
+ case 0: // ($1)
+ nIntlFormat = lcl_MergeNegativeParenthesisFormat(
+ nIntlFormat, nCurrFormat );
+ break;
+ case 1: // -$1
+ nIntlFormat = nCurrFormat;
+ break;
+ case 2: // $-1
+ nIntlFormat = nCurrFormat;
+ break;
+ case 3: // $1-
+ nIntlFormat = nCurrFormat;
+ break;
+ case 4: // (1$)
+ nIntlFormat = lcl_MergeNegativeParenthesisFormat(
+ nIntlFormat, nCurrFormat );
+ break;
+ case 5: // -1$
+ nIntlFormat = nCurrFormat;
+ break;
+ case 6: // 1-$
+ nIntlFormat = nCurrFormat;
+ break;
+ case 7: // 1$-
+ nIntlFormat = nCurrFormat;
+ break;
+ case 8: // -1 $
+ nIntlFormat = nCurrFormat;
+ break;
+ case 9: // -$ 1
+ nIntlFormat = nCurrFormat;
+ break;
+ case 10: // 1 $-
+ nIntlFormat = nCurrFormat;
+ break;
+ case 11: // $ -1
+ nIntlFormat = nCurrFormat;
+ break;
+ case 12 : // $ 1-
+ nIntlFormat = nCurrFormat;
+ break;
+ case 13 : // 1- $
+ nIntlFormat = nCurrFormat;
+ break;
+ case 14 : // ($ 1)
+ nIntlFormat = lcl_MergeNegativeParenthesisFormat(
+ nIntlFormat, nCurrFormat );
+ break;
+ case 15 : // (1 $)
+ nIntlFormat = lcl_MergeNegativeParenthesisFormat(
+ nIntlFormat, nCurrFormat );
+ break;
+ }
+ }
+ return nIntlFormat;
+}
+
+
+// we only support default encodings here
+// static
+sal_Char NfCurrencyEntry::GetEuroSymbol( rtl_TextEncoding eTextEncoding )
+{
+ switch ( eTextEncoding )
+ {
+ case RTL_TEXTENCODING_MS_1252 : // WNT Ansi
+ case RTL_TEXTENCODING_ISO_8859_1 : // UNX for use with TrueType fonts
+ return '\x80';
+ break;
+ case RTL_TEXTENCODING_ISO_8859_15 : // UNX real
+ return '\xA4';
+ break;
+ case RTL_TEXTENCODING_IBM_850 : // OS2
+ return '\xD5';
+ break;
+ case RTL_TEXTENCODING_APPLE_ROMAN : // MAC
+ return '\xDB';
+ break;
+ default: // default system
+#if WNT
+ return '\x80';
+#elif OS2
+ return '\xD5';
+#elif UNX
+// return '\xA4'; // #56121# 0xA4 waere korrekt fuer iso-8859-15
+ return '\x80'; // aber Windoze-Code fuer die konvertierten TrueType-Fonts
+#elif MAC
+ return '\xDB';
+#else
+#error EuroSymbol is what?
+ return '\x80';
+#endif
+ }
+ return '\x80';
+}
+
+
+
diff --git a/svtools/source/numbers/zformat.cxx b/svtools/source/numbers/zformat.cxx
new file mode 100644
index 000000000000..1bdba6e3112e
--- /dev/null
+++ b/svtools/source/numbers/zformat.cxx
@@ -0,0 +1,3469 @@
+/*************************************************************************
+ *
+ * $RCSfile: zformat.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <ctype.h>
+#include <float.h>
+#include <math.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#ifndef _INTN_HXX //autogen
+#include <tools/intn.hxx>
+#endif
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#ifndef _SOLMATH_HXX //autogen wg. SolarMath
+#include <tools/solmath.hxx>
+#endif
+#ifndef _UNOTOOLS_CHARCLASS_HXX
+#include <unotools/charclass.hxx>
+#endif
+
+#define _ZFORMAT_CXX
+#include "zformat.hxx"
+#include "zforscan.hxx"
+
+#include "zforfind.hxx"
+#include "zforlist.hxx"
+#include "numhead.hxx"
+
+
+const double _D_MAX_U_LONG_ = (double) 0xffffffff; // 4294967295.0
+const double _D_MAX_LONG_ = (double) 0x7fffffff; // 2147483647.0
+const USHORT _MAX_FRACTION_PREC = 3;
+const double D_EPS = 1.0E-2;
+
+#ifdef S390
+const double _D_MAX_D_BY_100 = 7.2E73;
+const double _D_MIN_M_BY_1000 = 5.4E-76;
+#else
+const double _D_MAX_D_BY_100 = 1.7E306;
+const double _D_MIN_M_BY_1000 = 2.3E-305;
+#endif
+
+static BYTE cCharWidths[ 128-32 ] = {
+ 1,1,1,2,2,3,2,1,1,1,1,2,1,1,1,1,
+ 2,2,2,2,2,2,2,2,2,2,1,1,2,2,2,2,
+ 3,2,2,2,2,2,2,3,2,1,2,2,2,3,3,3,
+ 2,3,2,2,2,2,2,3,2,2,2,1,1,1,2,2,
+ 1,2,2,2,2,2,1,2,2,1,1,2,1,3,2,2,
+ 2,2,1,2,1,2,2,2,2,2,2,1,1,1,2,1
+};
+
+static xub_StrLen InsertBlanks( XubString& r, xub_StrLen nPos, xub_Unicode c )
+{
+ if( c >= 32 )
+ {
+ USHORT n = 2; // Default fuer Zeichen > 128 (HACK!)
+ if( c <= 127 )
+ n = cCharWidths[ c - 32 ];
+ while( n-- )
+ r.Insert( ' ', nPos++ );
+ }
+ return nPos;
+}
+
+static long GetPrecExp( double fAbsVal )
+{
+ DBG_ASSERT( fAbsVal > 0.0, "GetPrecExp: fAbsVal <= 0.0" );
+ if ( fAbsVal < 1e-7 || fAbsVal > 1e7 )
+ { // die Schere, ob's schneller ist oder nicht, liegt zwischen 1e6 und 1e7
+ return (long) floor( log10( fAbsVal ) ) + 1;
+ }
+ else
+ {
+ long nPrecExp = 1;
+ while( fAbsVal < 1 )
+ {
+ fAbsVal *= 10;
+ nPrecExp--;
+ }
+ while( fAbsVal >= 10 )
+ {
+ fAbsVal /= 10;
+ nPrecExp++;
+ }
+ return nPrecExp;
+ }
+}
+
+const USHORT nNewCurrencyVersionId = 0x434E; // "NC"
+const xub_Unicode cNewCurrencyMagic = 0x01; // Magic fuer Format im Kommentar
+
+/***********************Funktion SvNumberformatInfo******************************/
+
+void ImpSvNumberformatInfo::Copy( const ImpSvNumberformatInfo& rNumFor, USHORT nAnz )
+{
+ for (USHORT i = 0; i < nAnz; i++)
+ {
+ sStrArray[i] = rNumFor.sStrArray[i];
+ nTypeArray[i] = rNumFor.nTypeArray[i];
+ }
+ eScannedType = rNumFor.eScannedType;
+ bThousand = rNumFor.bThousand;
+ nThousand = rNumFor.nThousand;
+ nCntPre = rNumFor.nCntPre;
+ nCntPost = rNumFor.nCntPost;
+ nCntExp = rNumFor.nCntExp;
+}
+
+void ImpSvNumberformatInfo::Save(SvStream& rStream, USHORT nAnz) const
+{
+ for (USHORT i = 0; i < nAnz; i++)
+ {
+ rStream.WriteByteString( sStrArray[i], rStream.GetStreamCharSet() );
+ switch ( nTypeArray[i] )
+ { // der Krampf fuer Versionen vor SV_NUMBERFORMATTER_VERSION_NEW_CURR
+ case SYMBOLTYPE_CURRENCY :
+ rStream << short( SYMBOLTYPE_STRING );
+ break;
+ case SYMBOLTYPE_CURRDEL :
+ case SYMBOLTYPE_CURREXT :
+ rStream << short(0); // werden ignoriert (hoffentlich..)
+ break;
+ default:
+ rStream << nTypeArray[i];
+ }
+
+ }
+ rStream << eScannedType << bThousand << nThousand
+ << nCntPre << nCntPost << nCntExp;
+}
+
+void ImpSvNumberformatInfo::Load(SvStream& rStream, USHORT nAnz)
+{
+ for (USHORT i = 0; i < nAnz; i++)
+ {
+ SvNumberformat::LoadString( rStream, sStrArray[i] );
+ rStream >> nTypeArray[i];
+ }
+ rStream >> eScannedType >> bThousand >> nThousand
+ >> nCntPre >> nCntPost >> nCntExp;
+}
+
+/***********************Funktionen SvNumFor******************************/
+
+ImpSvNumFor::ImpSvNumFor()
+{
+ nAnzStrings = 0;
+ aI.nTypeArray = NULL;
+ aI.sStrArray = NULL;
+ aI.eScannedType = NUMBERFORMAT_UNDEFINED;
+ aI.bThousand = FALSE;
+ aI.nThousand = 0;
+ aI.nCntPre = 0;
+ aI.nCntPost = 0;
+ aI.nCntExp = 0;
+ pColor = NULL;
+}
+
+ImpSvNumFor::~ImpSvNumFor()
+{
+ for (USHORT i = 0; i < nAnzStrings; i++)
+ aI.sStrArray[i].Erase();
+ __DELETE(nAnzStrings) aI.sStrArray;
+ __DELETE(nAnzStrings) aI.nTypeArray;
+}
+
+void ImpSvNumFor::Enlarge(USHORT nAnz)
+{
+ if ( nAnzStrings != nAnz )
+ {
+ if ( aI.nTypeArray )
+ delete [] aI.nTypeArray;
+ if ( aI.sStrArray )
+ delete [] aI.sStrArray;
+ nAnzStrings = nAnz;
+ if ( nAnz )
+ {
+ aI.nTypeArray = new short[nAnz];
+ aI.sStrArray = new XubString[nAnz];
+ }
+ else
+ {
+ aI.nTypeArray = NULL;
+ aI.sStrArray = NULL;
+ }
+ }
+}
+
+void ImpSvNumFor::Copy( const ImpSvNumFor& rNumFor )
+{
+ Enlarge( rNumFor.nAnzStrings );
+ aI.Copy( rNumFor.aI, nAnzStrings );
+ pColor = rNumFor.pColor;
+ sColorName = rNumFor.sColorName;
+}
+
+void ImpSvNumFor::Save(SvStream& rStream) const
+{
+ rStream << nAnzStrings;
+ aI.Save(rStream, nAnzStrings);
+ rStream.WriteByteString( sColorName, rStream.GetStreamCharSet() );
+}
+
+void ImpSvNumFor::Load(SvStream& rStream, ImpSvNumberformatScan& rSc,
+ XubString& rLoadedColorName )
+{
+ USHORT nAnz;
+ rStream >> nAnz; //! noch nicht direkt nAnzStrings wg. Enlarge
+ Enlarge( nAnz );
+ aI.Load( rStream, nAnz );
+ rStream.ReadByteString( sColorName, rStream.GetStreamCharSet() );
+ rLoadedColorName = sColorName;
+ pColor = rSc.GetColor(sColorName);
+}
+
+
+BOOL ImpSvNumFor::HasNewCurrency() const
+{
+ for ( USHORT j=0; j<nAnzStrings; j++ )
+ {
+ if ( aI.nTypeArray[j] == SYMBOLTYPE_CURRENCY )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+BOOL ImpSvNumFor::GetNewCurrencySymbol( XubString& rSymbol,
+ XubString& rExtension ) const
+{
+ for ( USHORT j=0; j<nAnzStrings; j++ )
+ {
+ if ( aI.nTypeArray[j] == SYMBOLTYPE_CURRENCY )
+ {
+ rSymbol = aI.sStrArray[j];
+ if ( j < nAnzStrings-1 && aI.nTypeArray[j+1] == SYMBOLTYPE_CURREXT )
+ rExtension = aI.sStrArray[j+1];
+ else
+ rExtension.Erase();
+ return TRUE;
+ }
+ }
+ //! kein Erase an rSymbol, rExtension
+ return FALSE;
+}
+
+
+void ImpSvNumFor::SaveNewCurrencyMap( SvStream& rStream ) const
+{
+ USHORT j;
+ USHORT nCnt = 0;
+ for ( j=0; j<nAnzStrings; j++ )
+ {
+ switch ( aI.nTypeArray[j] )
+ {
+ case SYMBOLTYPE_CURRENCY :
+ case SYMBOLTYPE_CURRDEL :
+ case SYMBOLTYPE_CURREXT :
+ nCnt++;
+ break;
+ }
+ }
+ rStream << nCnt;
+ for ( j=0; j<nAnzStrings; j++ )
+ {
+ switch ( aI.nTypeArray[j] )
+ {
+ case SYMBOLTYPE_CURRENCY :
+ case SYMBOLTYPE_CURRDEL :
+ case SYMBOLTYPE_CURREXT :
+ rStream << j << aI.nTypeArray[j];
+ break;
+ }
+ }
+}
+
+
+void ImpSvNumFor::LoadNewCurrencyMap( SvStream& rStream )
+{
+ USHORT nCnt;
+ rStream >> nCnt;
+ for ( USHORT j=0; j<nCnt; j++ )
+ {
+ USHORT nPos;
+ short nType;
+ rStream >> nPos >> nType;
+ if ( nPos < nAnzStrings )
+ aI.nTypeArray[nPos] = nType;
+ }
+}
+
+
+/***********************Funktionen SvNumberformat************************/
+
+enum Sc_FormatSymbolType
+{
+ SYMBOLTYPE_FORMAT = -1, // TeilFormatstring
+ SYMBOLTYPE_COLOR = -2, // Farbe
+ SYMBOLTYPE_ERROR = -3 // Fehler
+};
+
+SvNumberformat::SvNumberformat( ImpSvNumberformatScan& rSc, LanguageType eLge )
+ :
+ rScan(rSc),
+ eLnge(eLge),
+ bStarFlag( FALSE ),
+ nNewStandardDefined(0)
+{
+}
+
+void SvNumberformat::CopyNumberformat( const SvNumberformat& rFormat )
+{
+ sFormatstring = rFormat.sFormatstring;
+ eType = rFormat.eType;
+ eLnge = rFormat.eLnge;
+ fLimit1 = rFormat.fLimit1;
+ fLimit2 = rFormat.fLimit2;
+ eOp1 = rFormat.eOp1;
+ eOp2 = rFormat.eOp2;
+ bStandard = rFormat.bStandard;
+ bIsUsed = rFormat.bIsUsed;
+ sComment = rFormat.sComment;
+ nNewStandardDefined = rFormat.nNewStandardDefined;
+ for (USHORT i = 0; i < 4; i++)
+ NumFor[i].Copy(rFormat.NumFor[i]);
+}
+
+SvNumberformat::SvNumberformat( SvNumberformat& rFormat )
+ : rScan(rFormat.rScan), bStarFlag( rFormat.bStarFlag )
+{
+ CopyNumberformat( rFormat );
+}
+
+SvNumberformat::SvNumberformat( SvNumberformat& rFormat, ImpSvNumberformatScan& rSc )
+ : rScan(rSc), bStarFlag( rFormat.bStarFlag )
+{
+ CopyNumberformat( rFormat );
+}
+
+SvNumberformat::SvNumberformat(XubString& rString,
+ ImpSvNumberformatScan* pSc,
+ ImpSvNumberInputScan* pISc,
+ xub_StrLen& nCheckPos,
+ LanguageType& eLan,
+ BOOL bStan)
+ :
+ rScan(*pSc),
+ bStarFlag( FALSE ),
+ nNewStandardDefined(0)
+{
+ // Wenn der Tausender-Trenner ein Non-Breaking Space ist (franzoesisch),
+ // alle Vorkommen auf einfaches Space aendern:
+ // (Die Tokens werden hinterher wieder auf das Zeichen vom International gesetzt)
+
+ const xub_Unicode cNBSp = 0xA0;
+ if ( pSc->GetIntl().GetNumThousandSep() == cNBSp )
+ {
+ xub_StrLen nIndex = 0;
+ do
+ nIndex = rString.SearchAndReplace( cNBSp, ' ', nIndex );
+ while ( nIndex != STRING_NOTFOUND );
+ }
+
+ if (rScan.GetConvertMode())
+ {
+ eLnge = rScan.GetNewLnge();
+ eLan = eLnge; // Wechsel auch zurueckgeben
+ }
+ else
+ eLnge = eLan;
+ bStandard = bStan;
+ bIsUsed = FALSE;
+ fLimit1 = 0.0;
+ fLimit2 = 0.0;
+ eOp1 = NUMBERFORMAT_OP_NO;
+ eOp2 = NUMBERFORMAT_OP_NO;
+ eType = NUMBERFORMAT_DEFINED;
+
+ BOOL bCancel = FALSE;
+ BOOL bCondition = FALSE;
+ short eSymbolType;
+ xub_StrLen nStrPos;
+ xub_StrLen nPos = 0;
+ xub_StrLen nPosOld;
+ nCheckPos = 0;
+ XubString aComment;
+ // Zerlegung in 4 Teilstrings:
+ for (USHORT nIndex = 0; nIndex < 4 && !bCancel; nIndex++)
+ {
+ if (rScan.GetConvertMode())
+ (rScan.GetNumberformatter())->ChangeIntl(rScan.GetTmpLnge());
+ // in hinteren Formaten muss
+ // hier ggfs. wieder die
+ // Ausgangssprache eingestellt
+ // werden
+ XubString sStr;
+ nPosOld = nPos; // Position vor Teilstring
+ eSymbolType = ImpNextSymbol(rString, nPos, sStr);
+ if (eSymbolType > 0) // Bedingung
+ {
+ if (nIndex == 0)
+ {
+ bCondition = TRUE;
+ eOp1 = (SvNumberformatLimitOps) eSymbolType;
+ }
+ else if (nIndex == 1 && bCondition)
+ eOp2 = (SvNumberformatLimitOps) eSymbolType;
+ else // Fehler
+ {
+ bCancel = TRUE; // Abbruch for
+ nCheckPos = nPos;
+ }
+ if (!bCancel)
+ {
+ double fNumber;
+ xub_StrLen nAnzChars = ImpGetNumber(rString, nPos, sStr);
+ if (nAnzChars > 0)
+ {
+ short F_Type;
+ if (!pISc->IsNumberFormat(sStr,F_Type,fNumber) ||
+ ( F_Type != NUMBERFORMAT_NUMBER &&
+ F_Type != NUMBERFORMAT_SCIENTIFIC) )
+ {
+ fNumber = 0.0;
+ nPos -= nAnzChars;
+ rString.Erase(nPos, nAnzChars);
+ rString.Insert('0',nPos);
+ nPos++;
+ }
+ nPos++; // Skip ']'
+ }
+ else
+ {
+ fNumber = 0.0;
+ rString.Insert('0',nPos);
+ }
+ if (nIndex == 0)
+ fLimit1 = fNumber;
+ else
+ fLimit2 = fNumber;
+ }
+ nPosOld = nPos; // Position vor String
+ eSymbolType = ImpNextSymbol(rString, nPos, sStr);
+ }
+ if (eSymbolType == SYMBOLTYPE_COLOR)
+ {
+ NumFor[nIndex].SetColor(pSc->GetColor(sStr), sStr);
+#ifndef DOS
+ if (NumFor[nIndex].GetColor() == NULL) // Fehler
+ {
+ bCancel = TRUE; // Abbruch for
+ nCheckPos = nPos;
+ }
+ else
+ {
+ rString.Erase(nPosOld,nPos-nPosOld);
+ rString.Insert(sStr,nPosOld);
+ nPos = nPosOld + sStr.Len();
+ rString.Insert(']', nPos);
+ rString.Insert('[', nPosOld);
+ nPos += 2;
+ nPosOld = nPos; // Position vor String
+ eSymbolType = ImpNextSymbol(rString, nPos, sStr);
+ }
+#else
+ bCancel = TRUE; // Abbruch for
+ nCheckPos = nPos;
+#endif
+ }
+ if (eSymbolType == SYMBOLTYPE_FORMAT)
+ {
+ if (nIndex == 1 && eOp1 == NUMBERFORMAT_OP_NO)// Bdg. undefiniert
+ eOp1 = NUMBERFORMAT_OP_GT; // default: > 0
+ else if (nIndex == 2 && eOp2 == NUMBERFORMAT_OP_NO)
+ eOp2 = NUMBERFORMAT_OP_LT; // default: < 0
+ if (sStr.Len() == 0) // leeres Teilformat
+ { // Sonderfall 1
+ }
+/* // Typ undefined
+#ifndef ENABLEUNICODE
+ else if (sStr.ICompare(pSc->GetStandardName()) == COMPARE_EQUAL)
+#else
+ else if (sStr.Compare(pSc->GetStandardName()) == COMPARE_EQUAL)
+#endif
+ {
+ rString.Replace(pSc->GetStandardName(), rString.Search(sStr));
+ NumFor[nIndex].Info().eScannedType = NUMBERFORMAT_NUMBER;
+ }
+*/
+ // -> Sonderfall 2
+ else
+ {
+ nStrPos = pSc->ScanFormat( sStr, aComment );
+ USHORT nAnz = pSc->GetAnzResStrings();
+ if (nAnz == 0) // Fehler
+ nStrPos = 1;
+ if (nStrPos == 0) // ok
+ {
+ rString.Erase(nPosOld,nPos-nPosOld);
+ rString.Insert(sStr,nPosOld);
+ nPos = nPosOld + sStr.Len();
+ if (nPos < rString.Len())
+ {
+ rString.Insert(';',nPos);
+ nPos++;
+ }
+ NumFor[nIndex].Enlarge(nAnz);
+ pSc->CopyInfo(&(NumFor[nIndex].Info()), nAnz);
+ if (nIndex == 0) // Typcheck:
+ eType = (short) NumFor[nIndex].Info().eScannedType;
+ else if (nIndex == 3)
+ { // #77026# Everything recognized IS text
+ NumFor[nIndex].Info().eScannedType = NUMBERFORMAT_TEXT;
+ }
+ else if ( (short) NumFor[nIndex].Info().eScannedType !=
+ eType)
+ eType = NUMBERFORMAT_DEFINED;
+ }
+ else // Fehler im String
+ {
+ nCheckPos = nPosOld + nStrPos;
+ bCancel = TRUE; // Abbruch for
+ }
+ } // of != Standard
+ }
+ else if (eSymbolType == SYMBOLTYPE_ERROR) // Fehler
+ {
+ nCheckPos = nPos;
+ bCancel = TRUE;
+ }
+ else if (eSymbolType > 0 || // doppelt
+ eSymbolType == SYMBOLTYPE_COLOR )
+ {
+ nCheckPos = nPosOld+1;
+ bCancel = TRUE;
+ }
+ if (rString.Len() == nPos)
+ bCancel = TRUE;
+ } // of for
+ if (bCondition)
+ {
+ if (NumFor[1].GetnAnz() == 0) // kein 2. Teilstring
+ {
+ if (NumFor[1].Info().eScannedType != NUMBERFORMAT_NUMBER)
+ rString.InsertAscii(";Standard", rString.Len());
+ }
+ else if (NumFor[2].GetnAnz() == 0 && eOp2 != NUMBERFORMAT_OP_NO)
+ {
+ if (NumFor[2].Info().eScannedType != NUMBERFORMAT_NUMBER)
+ rString.InsertAscii(";Standard", rString.Len());
+ }
+ }
+ sFormatstring = rString;
+ if ( aComment.Len() )
+ {
+ SetComment( aComment ); // setzt sComment und sFormatstring
+ rString = sFormatstring; // geaenderten sFormatstring uebernehmen
+ }
+ if (NumFor[2].GetnAnz() == 0 && // kein 3. Teilstring
+ eOp1 == NUMBERFORMAT_OP_GT && eOp2 == NUMBERFORMAT_OP_NO &&
+ fLimit1 == 0.0 && fLimit2 == 0.0)
+ eOp1 = NUMBERFORMAT_OP_GE; // 0 zum ersten Format dazu
+
+}
+
+SvNumberformat::~SvNumberformat()
+{
+}
+
+//---------------------------------------------------------------------------
+// Next_Symbol
+//---------------------------------------------------------------------------
+// Zerlegt die Eingabe in Symbole fuer die weitere
+// Verarbeitung (Turing-Maschine).
+//---------------------------------------------------------------------------
+// Ausgangs Zustand = SsStart
+//---------------+-------------------+-----------------------+---------------
+// Alter Zustand | gelesenes Zeichen | Aktion | Neuer Zustand
+//---------------+-------------------+-----------------------+---------------
+// SsStart | ; | Pos-- | SsGetString
+// | [ | Symbol += Zeichen | SsGetColCon
+// | ] | Fehler | SsStop
+// | BLANK | |
+// | Sonst | Symbol += Zeichen | SsGetString
+//---------------+-------------------+-----------------------+---------------
+// SsGetString | ; | | SsStop
+// | Sonst | Symbol+=Zeichen |
+//---------------+-------------------+-----------------------+---------------
+// SsGetColCon | <, > = | del [ |
+// | | Symbol += Zeichen | SsGetCon
+// | BLANK | |
+// | h, H, m, M, s, S | Symbol += Zeichen | SsGetTime
+// | sonst | del [ |
+// | | Symbol += Zeichen | SsGetCol
+//---------------+-------------------+-----------------------+---------------
+// SsGetTime | ] | Symbol += Zeichen | SsGetString
+// | h, H, m, M, s, S | Symbol += Zeichen, * | SsGetString
+// | sonst | del [; Symbol+=Zeichen| SsGetCol
+//---------------+-------------------+-----------------------+---------------
+// SsGetCol | ] | | SsStop
+// | sonst | Symbol += Zeichen |
+//---------------+-------------------+-----------------------+---------------
+// SsGetCon | >, = | Symbol+=Zeichen |
+// | ] | | SsStop
+// | sonst | Fehler | SsStop
+//---------------+-------------------+-----------------------+---------------
+// * : Sonderbedingung
+
+enum ScanState
+{
+ SsStop = 0,
+ SsStart = 1,
+ SsGetCon = 2, // Bedingung
+ SsGetString = 3, // Format
+ SsGetCol = 4, // Farbe
+ SsGetTime = 5, // [MM] fuer Zeiten
+ SsGetColCon = 6 // noch unentschieden
+};
+
+xub_StrLen SvNumberformat::ImpGetNumber(XubString& rString,
+ xub_StrLen& nPos,
+ XubString& sSymbol)
+{
+ xub_StrLen nStartPos = nPos;
+ xub_Unicode cToken;
+ xub_StrLen nLen = rString.Len();
+ if (nPos < nLen)
+ cToken = rString.GetChar(nPos);
+ sSymbol.Erase();
+ while (nPos < nLen-1 && cToken != ']') // bis ']'
+ {
+ if (cToken == ' ') // Blanks loeschen
+ {
+ rString.Erase(nPos,1);
+ nLen--;
+ }
+ else
+ {
+ nPos++;
+ sSymbol += cToken;
+ }
+ cToken = rString.GetChar(nPos);
+ }
+ return nPos - nStartPos;
+}
+
+
+short SvNumberformat::ImpNextSymbol(XubString& rString,
+ xub_StrLen& nPos,
+ XubString& sSymbol)
+{
+ short eType = SYMBOLTYPE_FORMAT;
+ xub_Unicode cToken;
+ xub_Unicode cLetter; // Zwischenergebnis
+ xub_StrLen nLen = rString.Len();
+ ScanState eState = SsStart;
+ sSymbol.Erase();
+ XubString* pKeywords = rScan.GetKeyword();
+ while (nPos < nLen && eState != SsStop)
+ {
+ cToken = rString.GetChar(nPos);
+ nPos++;
+ switch (eState)
+ {
+ case SsStart:
+ {
+ if (cToken == '[')
+ {
+ eState = SsGetColCon;
+ sSymbol += cToken;
+ }
+ else if (cToken == ';')
+ {
+ eState = SsGetString;
+ nPos--;
+ eType = SYMBOLTYPE_FORMAT;
+ }
+ else if (cToken == ']')
+ {
+ eState = SsStop;
+ eType = SYMBOLTYPE_ERROR;
+ }
+ else if (cToken == ' ') // Skip Blanks
+ {
+ rString.Erase(nPos-1,1);
+ nPos--;
+ nLen--;
+ }
+ else
+ {
+ sSymbol += cToken;
+ eState = SsGetString;
+ eType = SYMBOLTYPE_FORMAT;
+ }
+ }
+ break;
+ case SsGetColCon:
+ {
+ switch (cToken)
+ {
+ case '<':
+ case '>':
+ case '=':
+ {
+ sSymbol.EraseAllChars('[');
+ sSymbol += cToken;
+ cLetter = cToken;
+ eState = SsGetCon;
+ switch (cToken)
+ {
+ case '<': eType = NUMBERFORMAT_OP_LT; break;
+ case '>': eType = NUMBERFORMAT_OP_GT; break;
+ case '=': eType = NUMBERFORMAT_OP_EQ; break;
+ default: break;
+ }
+ }
+ break;
+ case ' ':
+ {
+ rString.Erase(nPos-1,1);
+ nPos--;
+ nLen--;
+ }
+ break;
+ case '$' :
+ { // Waehrung ab SV_NUMBERFORMATTER_VERSION_NEW_CURR
+ eType = SYMBOLTYPE_FORMAT;
+ sSymbol += cToken;
+ eState = SsGetString;
+ }
+ break;
+ default:
+ {
+ xub_Unicode cUpper = rChrCls().toUpper( rString, nPos-1, 1 ).GetChar(0);
+ if (cUpper == pKeywords[NF_KEY_H].GetChar(0) || // H
+ cUpper == pKeywords[NF_KEY_MI].GetChar(0) || // M
+ cUpper == pKeywords[NF_KEY_S].GetChar(0) ) // S
+ {
+ sSymbol += cToken;
+ eState = SsGetTime;
+ cLetter = cToken;
+ }
+ else
+ {
+ sSymbol.EraseAllChars('[');
+ sSymbol += cToken;
+ eType = SYMBOLTYPE_COLOR;
+ eState = SsGetCol;
+ }
+ }
+ break;
+ }
+ }
+ break;
+ case SsGetString:
+ {
+ if (cToken == ';')
+ eState = SsStop;
+ else
+ sSymbol += cToken;
+ }
+ break;
+ case SsGetTime:
+ {
+ if (cToken == ']')
+ {
+ sSymbol += cToken;
+ eState = SsGetString;
+ eType = SYMBOLTYPE_FORMAT;
+ }
+ else
+ {
+ xub_Unicode cUpper = rChrCls().toUpper( rString, nPos-1, 1 ).GetChar(0);
+ if (cUpper == pKeywords[NF_KEY_H].GetChar(0) || // H
+ cUpper == pKeywords[NF_KEY_MI].GetChar(0) || // M
+ cUpper == pKeywords[NF_KEY_S].GetChar(0) ) // S
+ {
+ if (cLetter == cToken)
+ {
+ sSymbol += cToken;
+ cLetter = ' ';
+ }
+ else
+ {
+ sSymbol.EraseAllChars('[');
+ sSymbol += cToken;
+ eState = SsGetCol;
+ }
+ }
+ else
+ {
+ sSymbol.EraseAllChars('[');
+ sSymbol += cToken;
+ eType = SYMBOLTYPE_COLOR;
+ eState = SsGetCol;
+ }
+ }
+ }
+ break;
+ case SsGetCon:
+ {
+ switch (cToken)
+ {
+ case '<':
+ {
+ eState = SsStop;
+ eType = SYMBOLTYPE_ERROR;
+ }
+ break;
+ case '>':
+ {
+ if (cLetter == '<')
+ {
+ sSymbol += cToken;
+ cLetter = ' ';
+ eState = SsStop;
+ eType = NUMBERFORMAT_OP_NE;
+ }
+ else
+ {
+ eState = SsStop;
+ eType = SYMBOLTYPE_ERROR;
+ }
+ }
+ break;
+ case '=':
+ {
+ if (cLetter == '<')
+ {
+ sSymbol += cToken;
+ cLetter = ' ';
+ eType = NUMBERFORMAT_OP_LE;
+ }
+ else if (cLetter == '>')
+ {
+ sSymbol += cToken;
+ cLetter = ' ';
+ eType = NUMBERFORMAT_OP_GE;
+ }
+ else
+ {
+ eState = SsStop;
+ eType = SYMBOLTYPE_ERROR;
+ }
+ }
+ break;
+ case ' ':
+ {
+ rString.Erase(nPos-1,1);
+ nPos--;
+ nLen--;
+ }
+ break;
+ default:
+ {
+ eState = SsStop;
+ nPos--;
+ }
+ break;
+ }
+ }
+ break;
+ case SsGetCol:
+ {
+ if (cToken == ']')
+ eState = SsStop;
+ else
+ sSymbol += cToken;
+ }
+ break;
+ default:
+ break;
+ } // of switch
+ } // of while
+
+ return eType;
+}
+
+NfHackConversion SvNumberformat::Load( SvStream& rStream,
+ ImpSvNumMultipleReadHeader& rHdr, SvNumberFormatter* pHackConverter,
+ ImpSvNumberInputScan& rISc )
+{
+ rHdr.StartEntry();
+ USHORT nOp1, nOp2;
+ SvNumberformat::LoadString( rStream, sFormatstring );
+ rStream >> eType >> fLimit1 >> fLimit2
+ >> nOp1 >> nOp2 >> bStandard >> bIsUsed;
+ NfHackConversion eHackConversion = NF_CONVERT_NONE;
+ BOOL bOldConvert;
+ LanguageType eOldTmpLang, eOldNewLang;
+ if ( pHackConverter )
+ { // werden nur hierbei gebraucht
+ bOldConvert = rScan.GetConvertMode();
+ eOldTmpLang = rScan.GetTmpLnge();
+ eOldNewLang = rScan.GetNewLnge();
+ }
+ XubString aLoadedColorName;
+ for (USHORT i = 0; i < 4; i++)
+ {
+ NumFor[i].Load( rStream, rScan, aLoadedColorName );
+ if ( pHackConverter && eHackConversion == NF_CONVERT_NONE )
+ {
+ //! HACK! ER 29.07.97 13:52
+ // leider wurde nicht gespeichert, was SYSTEM on Save wirklich war :-/
+ // aber immerhin wird manchmal fuer einen Entry FARBE oder COLOR gespeichert..
+ // System-German FARBE nach System-xxx COLOR umsetzen und vice versa,
+ //! geht davon aus, dass onSave nur GERMAN und ENGLISH KeyWords in
+ //! ImpSvNumberformatScan existierten
+ if ( aLoadedColorName.Len() && !NumFor[i].GetColor()
+ && aLoadedColorName != rScan.GetColorString() )
+ {
+ if ( rScan.GetColorString().EqualsAscii( "FARBE" ) )
+ { // English -> German
+ eHackConversion = NF_CONVERT_ENGLISH_GERMAN;
+ rScan.GetNumberformatter()->ChangeIntl( LANGUAGE_ENGLISH_US );
+ rScan.SetConvertMode( LANGUAGE_ENGLISH_US, LANGUAGE_GERMAN );
+ }
+ else
+ { // German -> English
+ eHackConversion = NF_CONVERT_GERMAN_ENGLISH;
+ rScan.GetNumberformatter()->ChangeIntl( LANGUAGE_GERMAN );
+ rScan.SetConvertMode( LANGUAGE_GERMAN, LANGUAGE_ENGLISH_US );
+ }
+ XubString aColorName = NumFor[i].GetColorName();
+ Color* pColor = rScan.GetColor( aColorName );
+ if ( !pColor && aLoadedColorName == aColorName )
+ eHackConversion = NF_CONVERT_NONE;
+ rScan.GetNumberformatter()->ChangeIntl( LANGUAGE_SYSTEM );
+ rScan.SetConvertMode( eOldTmpLang, eOldNewLang );
+ rScan.SetConvertMode( bOldConvert );
+ }
+ }
+ }
+ eOp1 = (SvNumberformatLimitOps) nOp1;
+ eOp2 = (SvNumberformatLimitOps) nOp2;
+ XubString aComment; // wird nach dem NewCurrency-Geraffel richtig gesetzt
+ if ( rHdr.BytesLeft() )
+ { // ab SV_NUMBERFORMATTER_VERSION_NEWSTANDARD
+ SvNumberformat::LoadString( rStream, aComment );
+ rStream >> nNewStandardDefined;
+ }
+
+ xub_StrLen nNewCurrencyEnd = STRING_NOTFOUND;
+ BOOL bNewCurrencyComment = ( aComment.GetChar(0) == cNewCurrencyMagic &&
+ (nNewCurrencyEnd = aComment.Search( cNewCurrencyMagic, 1 )) != STRING_NOTFOUND );
+ BOOL bNewCurrencyLoaded = FALSE;
+ BOOL bNewCurrency = FALSE;
+ if ( rHdr.BytesLeft() )
+ { // ab SV_NUMBERFORMATTER_VERSION_NEW_CURR
+ USHORT nId;
+ rStream >> nId;
+ DBG_ASSERT( nId == nNewCurrencyVersionId, "SvNumberformat::Load: unknown nId" );
+ if ( nId == nNewCurrencyVersionId )
+ {
+ bNewCurrencyLoaded = TRUE;
+ rStream >> bNewCurrency;
+ if ( bNewCurrency )
+ {
+ for ( USHORT j=0; j<4; j++ )
+ {
+ NumFor[j].LoadNewCurrencyMap( rStream );
+ }
+ }
+ }
+ }
+ if ( bNewCurrencyLoaded )
+ {
+ if ( bNewCurrency && bNewCurrencyComment )
+ { // original Formatstring und Kommentar wiederherstellen
+ sFormatstring = aComment.Copy( 1, nNewCurrencyEnd-1 );
+ aComment.Erase( 0, nNewCurrencyEnd+1 );
+ }
+ }
+ else if ( bNewCurrencyComment )
+ { // neu, aber mit Version vor SV_NUMBERFORMATTER_VERSION_NEW_CURR gespeichert
+ // original Formatstring und Kommentar wiederherstellen
+ sFormatstring = aComment.Copy( 1, nNewCurrencyEnd-1 );
+ aComment.Erase( 0, nNewCurrencyEnd+1 );
+ // Zustaende merken
+ short nDefined = ( eType & NUMBERFORMAT_DEFINED );
+ USHORT nNewStandard = nNewStandardDefined;
+ // neu parsen etc.
+ XubString aStr( sFormatstring );
+ xub_StrLen nCheckPos;
+ SvNumberformat* pFormat = new SvNumberformat( aStr, &rScan, &rISc,
+ nCheckPos, eLnge, bStandard );
+ DBG_ASSERT( !nCheckPos, "SvNumberformat::Load: NewCurrencyRescan nCheckPos" );
+ CopyNumberformat( *pFormat );
+ delete pFormat;
+ // Zustaende wiederherstellen
+ eType |= nDefined;
+ if ( nNewStandard )
+ SetNewStandardDefined( nNewStandard );
+ }
+ SetComment( aComment );
+
+ rHdr.EndEntry();
+
+ if ( eHackConversion != NF_CONVERT_NONE )
+ { //! und weiter mit dem HACK!
+ switch ( eHackConversion )
+ {
+ case NF_CONVERT_ENGLISH_GERMAN :
+ ConvertLanguage( *pHackConverter,
+ LANGUAGE_ENGLISH_US, LANGUAGE_GERMAN, TRUE );
+ break;
+ case NF_CONVERT_GERMAN_ENGLISH :
+ ConvertLanguage( *pHackConverter,
+ LANGUAGE_GERMAN, LANGUAGE_ENGLISH_US, TRUE );
+ break;
+ default:
+ DBG_ERRORFILE( "SvNumberformat::Load: eHackConversion unknown" );
+ }
+ }
+ return eHackConversion;
+}
+
+void SvNumberformat::ConvertLanguage( SvNumberFormatter& rConverter,
+ LanguageType eConvertFrom, LanguageType eConvertTo, BOOL bSystem )
+{
+ xub_StrLen nCheckPos;
+ ULONG nKey;
+ short nType = eType;
+ XubString aFormatString( sFormatstring );
+ rConverter.PutandConvertEntry( aFormatString, nCheckPos, nType, nKey,
+ eConvertFrom, eConvertTo );
+ const SvNumberformat* pFormat = rConverter.GetEntry( nKey );
+ DBG_ASSERT( pFormat, "SvNumberformat::ConvertLanguage: Conversion ohne Format" );
+ if ( pFormat )
+ {
+ CopyNumberformat( *pFormat );
+ // aus Formatter/Scanner uebernommene Werte zuruecksetzen
+ if ( bSystem )
+ eLnge = LANGUAGE_SYSTEM;
+ // pColor zeigt noch auf Tabelle in temporaerem Formatter/Scanner
+ for ( USHORT i = 0; i < 4; i++ )
+ {
+ XubString aColorName = NumFor[i].GetColorName();
+ Color* pColor = rScan.GetColor( aColorName );
+ NumFor[i].SetColor( pColor, aColorName );
+ }
+ }
+}
+
+
+// static
+void SvNumberformat::LoadString( SvStream& rStream, XubString& rStr )
+{
+ CharSet eStream = rStream.GetStreamCharSet();
+ ByteString aStr;
+ rStream.ReadByteString( aStr );
+ sal_Char cStream = NfCurrencyEntry::GetEuroSymbol( eStream );
+ if ( aStr.Search( cStream ) == STRING_NOTFOUND )
+ { // simple conversion to unicode
+ rStr = UniString( aStr, eStream );
+ }
+ else
+ {
+ sal_Unicode cTarget = NfCurrencyEntry::GetEuroSymbol();
+ register const sal_Char* p = aStr.GetBuffer();
+ register const sal_Char* const pEnd = p + aStr.Len();
+ register sal_Unicode* pUni = rStr.AllocBuffer( aStr.Len() );
+ while ( p < pEnd )
+ {
+ if ( *p == cStream )
+ *pUni = cTarget;
+ else
+ *pUni = ByteString::ConvertToUnicode( *p, eStream );
+ p++;
+ pUni++;
+ }
+ *pUni = 0;
+ }
+}
+
+
+void SvNumberformat::Save( SvStream& rStream, ImpSvNumMultipleWriteHeader& rHdr ) const
+{
+ XubString aFormatstring( sFormatstring );
+ XubString aComment( sComment );
+#if NF_COMMENT_IN_FORMATSTRING
+ // der Kommentar im Formatstring wird nicht gespeichert, um in alten Versionen
+ // nicht ins schleudern zu kommen und spaeter getrennte Verarbeitung
+ // (z.B. im Dialog) zu ermoeglichen
+ SetComment( "", aFormatstring, aComment );
+#endif
+
+ BOOL bNewCurrency = HasNewCurrency();
+ if ( bNewCurrency )
+ { // SV_NUMBERFORMATTER_VERSION_NEW_CURR im Kommentar speichern
+ aComment.Insert( cNewCurrencyMagic, 0 );
+ aComment.Insert( cNewCurrencyMagic, 0 );
+ aComment.Insert( aFormatstring, 1 );
+ Build50Formatstring( aFormatstring ); // alten Formatstring generieren
+ }
+
+ rHdr.StartEntry();
+ rStream.WriteByteString( aFormatstring, rStream.GetStreamCharSet() );
+ rStream << eType << fLimit1 << fLimit2 << (USHORT) eOp1 << (USHORT) eOp2
+ << bStandard << bIsUsed;
+ for (USHORT i = 0; i < 4; i++)
+ NumFor[i].Save(rStream);
+ // ab SV_NUMBERFORMATTER_VERSION_NEWSTANDARD
+ rStream.WriteByteString( aComment, rStream.GetStreamCharSet() );
+ rStream << nNewStandardDefined;
+ // ab SV_NUMBERFORMATTER_VERSION_NEW_CURR
+ rStream << nNewCurrencyVersionId;
+ rStream << bNewCurrency;
+ if ( bNewCurrency )
+ {
+ for ( USHORT j=0; j<4; j++ )
+ {
+ NumFor[j].SaveNewCurrencyMap( rStream );
+ }
+ }
+ rHdr.EndEntry();
+}
+
+
+BOOL SvNumberformat::HasNewCurrency() const
+{
+ for ( USHORT j=0; j<4; j++ )
+ {
+ if ( NumFor[j].HasNewCurrency() )
+ return TRUE;
+ }
+ return FALSE;
+}
+
+
+BOOL SvNumberformat::GetNewCurrencySymbol( XubString& rSymbol,
+ XubString& rExtension ) const
+{
+ for ( USHORT j=0; j<4; j++ )
+ {
+ if ( NumFor[j].GetNewCurrencySymbol( rSymbol, rExtension ) )
+ return TRUE;
+ }
+ rSymbol.Erase();
+ rExtension.Erase();
+ return FALSE;
+}
+
+
+void SvNumberformat::Build50Formatstring( XubString& rStr ) const
+{
+ rStr.Erase();
+ xub_StrLen nStartPos, nPos, nLen;
+ nLen = sFormatstring.Len();
+ nStartPos = 0;
+ while ( (nPos = sFormatstring.SearchAscii( "[$", nStartPos )) != STRING_NOTFOUND )
+ {
+ xub_StrLen nEnd;
+ if ( (nEnd = GetQuoteEnd( sFormatstring, nPos )) < nLen )
+ {
+ rStr += sFormatstring.Copy( nStartPos, ++nEnd - nStartPos );
+ nStartPos = nEnd;
+ }
+ else
+ {
+ rStr += sFormatstring.Copy( nStartPos, nPos - nStartPos );
+ nStartPos = nPos + 2;
+ xub_StrLen nDash;
+ nEnd = nStartPos - 1;
+ do
+ {
+ nDash = sFormatstring.Search( '-', ++nEnd );
+ } while ( (nEnd = GetQuoteEnd( sFormatstring, nDash )) < nLen );
+ xub_StrLen nClose;
+ nEnd = nStartPos - 1;
+ do
+ {
+ nClose = sFormatstring.Search( ']', ++nEnd );
+ } while ( (nEnd = GetQuoteEnd( sFormatstring, nClose )) < nLen );
+ nPos = ( nDash < nClose ? nDash : nClose );
+ if ( sFormatstring.GetChar( nStartPos ) == '"' )
+ rStr += sFormatstring.Copy( nStartPos, nPos - nStartPos );
+ else
+ {
+ rStr += '"';
+ rStr += sFormatstring.Copy( nStartPos, nPos - nStartPos );
+ rStr += '"';
+ }
+ nStartPos = nClose + 1;
+ }
+ }
+ if ( nLen > nStartPos )
+ rStr += sFormatstring.Copy( nStartPos, nLen - nStartPos );
+}
+
+
+void SvNumberformat::ImpGetOutputStandard(double& fNumber, XubString& OutString)
+{
+ OutString.Erase();
+ USHORT nStandardPrec = rScan.GetStandardPrec();
+ if ( fabs(fNumber) > 1.0E15 ) // #58531# war E16
+ SolarMath::DoubleToString(OutString, fNumber, 'E', nStandardPrec /*2*/,
+ rIntl().GetNumDecimalSep());
+ else
+ {
+ SolarMath::DoubleToString( OutString, fNumber, 'F', nStandardPrec /*2*/,
+ rIntl().GetNumDecimalSep(), TRUE );
+ if (OutString.GetChar(0) == '-' &&
+ OutString.GetTokenCount('0') == OutString.Len())
+ OutString.EraseLeadingChars('-'); // nicht -0
+ }
+ return;
+}
+
+void SvNumberformat::ImpGetOutputInputLine(double fNumber, XubString& OutString)
+{
+ BOOL bModified = FALSE;
+ if ( (eType & NUMBERFORMAT_PERCENT) && (fabs(fNumber) < _D_MAX_D_BY_100))
+ {
+ if (fNumber == 0.0)
+ {
+ OutString.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "0%" ) );
+ return;
+ }
+ fNumber *= 100;
+ bModified = TRUE;
+ }
+
+ if (fNumber == 0.0)
+ {
+ OutString = '0';
+ return;
+ }
+
+ SolarMath::DoubleToString( OutString, fNumber, 'A', INT_MAX,
+ rIntl().GetNumDecimalSep(), TRUE );
+
+ if ( eType & NUMBERFORMAT_PERCENT && bModified)
+ OutString += '%';
+ return;
+}
+
+short SvNumberformat::ImpCheckCondition(double& fNumber,
+ double& fLimit,
+ SvNumberformatLimitOps eOp)
+{
+ switch(eOp)
+ {
+ case NUMBERFORMAT_OP_NO: return -1;
+ case NUMBERFORMAT_OP_EQ: return (short) (fNumber == fLimit);
+ case NUMBERFORMAT_OP_NE: return (short) (fNumber != fLimit);
+ case NUMBERFORMAT_OP_LT: return (short) (fNumber < fLimit);
+ case NUMBERFORMAT_OP_LE: return (short) (fNumber <= fLimit);
+ case NUMBERFORMAT_OP_GT: return (short) (fNumber > fLimit);
+ case NUMBERFORMAT_OP_GE: return (short) (fNumber >= fLimit);
+ default: return -1;
+ }
+}
+
+BOOL SvNumberformat::GetOutputString(XubString& sString,
+ XubString& OutString,
+ Color** ppColor)
+{
+ OutString.Erase();
+ USHORT nIx;
+ if (eType & NUMBERFORMAT_TEXT)
+ nIx = 0;
+ else if (NumFor[3].GetnAnz() > 0)
+ nIx = 3;
+ else
+ {
+ *ppColor = NULL; // no change of color
+ return FALSE;
+ }
+ *ppColor = NumFor[nIx].GetColor();
+ const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+ if (rInfo.eScannedType == NUMBERFORMAT_TEXT)
+ {
+ BOOL bRes = FALSE;
+ const USHORT nAnz = NumFor[nIx].GetnAnz();
+ for (USHORT i = 0; i < nAnz; i++)
+ {
+ switch (rInfo.nTypeArray[i])
+ {
+ case SYMBOLTYPE_STAR:
+ if( bStarFlag )
+ {
+ OutString += (xub_Unicode) 0x1B;
+ OutString += rInfo.sStrArray[i].GetChar(1);
+ bRes = TRUE;
+ }
+ break;
+ case SYMBOLTYPE_BLANK:
+ InsertBlanks( OutString, OutString.Len(),
+ rInfo.sStrArray[i].GetChar(1) );
+ break;
+ case NF_KEY_GENERAL : // #77026# "General" is the same as "@"
+ case SYMBOLTYPE_DEL :
+ OutString += sString;
+ break;
+ default:
+ OutString += rInfo.sStrArray[i];
+ }
+ }
+ return bRes;
+ }
+ return FALSE;
+}
+/*
+void SvNumberformat::GetNextFareyNumber(ULONG nPrec, ULONG x0, ULONG x1,
+ ULONG y0, ULONG y1,
+ ULONG& x2,ULONG& y2)
+{
+ x2 = ((y0+nPrec)/y1)*x1 - x0;
+ y2 = ((y0+nPrec)/y1)*y1 - y0;
+}
+*/
+ULONG SvNumberformat::ImpGGT(ULONG x, ULONG y)
+{
+ if (y == 0)
+ return x;
+ else
+ {
+ ULONG z = x%y;
+ while (z)
+ {
+ x = y;
+ y = z;
+ z = x%y;
+ }
+ return y;
+ }
+}
+
+ULONG SvNumberformat::ImpGGTRound(ULONG x, ULONG y)
+{
+ if (y == 0)
+ return x;
+ else
+ {
+ ULONG z = x%y;
+ while ((double)z/(double)y > D_EPS)
+ {
+ x = y;
+ y = z;
+ z = x%y;
+ }
+ return y;
+ }
+}
+
+BOOL SvNumberformat::GetOutputString(double fNumber,
+ XubString& OutString,
+ Color** ppColor)
+{
+ BOOL bRes = FALSE;
+ OutString.Erase(); // alles loeschen
+ *ppColor = NULL; // keine Farbaenderung
+ if (eType & NUMBERFORMAT_LOGICAL)
+ {
+ if (fNumber)
+ OutString = rScan.GetTrueString();
+ else
+ OutString = rScan.GetFalseString();
+ return FALSE;
+ }
+ if (eType & NUMBERFORMAT_TEXT && bStandard)
+ {
+ ImpGetOutputStandard(fNumber, OutString);
+ return FALSE;
+ }
+ if (bStandard) // einzelne Standardformate
+ {
+ if (rScan.GetStandardPrec() == 300) // alle Zahlformate InputLine
+ {
+ ImpGetOutputInputLine(fNumber, OutString);
+ return FALSE;
+ }
+ switch (eType)
+ {
+ case NUMBERFORMAT_NUMBER: // Standardzahlformat
+ ImpGetOutputStandard(fNumber, OutString);
+ break;
+ case NUMBERFORMAT_DATE:
+ {
+ if (fabs(fNumber) > _D_MAX_LONG_) // zu gross
+ {
+ OutString = rScan.GetErrorString();
+ return FALSE;
+ }
+ long nNum = (long) floor(fNumber);
+ Date aDate = *(rScan.GetNullDate()) + nNum;
+ OutString = rIntl().GetDate(aDate);
+ }
+ break;
+ case NUMBERFORMAT_TIME:
+ {
+ if (fNumber < 0.0) // -2:20 -> 21:40
+ {
+ fNumber = -fNumber;
+ fNumber -= floor(fNumber); // Datum hier egal
+ fNumber = 1.0 - fNumber;
+ }
+ else
+ fNumber -= floor(fNumber); // "
+
+ ULONG nTime = (ULONG) floor(0.5 + fNumber * 86400.0);
+ ULONG nHour = nTime / 3600;
+ nHour = nHour % 24;
+ if (nHour < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nHour);
+ OutString += rIntl().GetTimeSep();
+ ULONG nMin = (nTime%3600) / 60;
+ if (nMin < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nMin);
+ OutString += rIntl().GetTimeSep();
+ ULONG nSec = (nTime%60);
+ if (nSec < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nSec);
+ }
+ break;
+ case NUMBERFORMAT_DATETIME:
+ {
+ if (fabs(fNumber) > _D_MAX_LONG_) // zu gross
+ {
+ OutString = rScan.GetErrorString();
+ return FALSE;
+ }
+ double fNum1 = floor(fNumber);
+ long nNum1 = (long) fNum1;
+ Date aDate = *(rScan.GetNullDate()) + nNum1;
+ OutString = rIntl().GetDate(aDate);
+ OutString += ' ';
+ fNumber -= fNum1;
+ ULONG nTime = (ULONG) floor(0.5 + fNumber * 86400.0);
+ ULONG nHour = nTime / 3600;
+ if (nHour < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nHour);
+ OutString += rIntl().GetTimeSep();
+ ULONG nMin = (nTime%3600) / 60;
+ if (nMin < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nMin);
+ }
+ break;
+ case NUMBERFORMAT_FRACTION:
+ case NUMBERFORMAT_CURRENCY: // keine Standardoptimierung
+ break;
+ case NUMBERFORMAT_PERCENT:
+ {
+ if (fabs(fNumber) < _D_MAX_D_BY_100)
+ {
+ fNumber *= 100;
+ SolarMath::DoubleToString(OutString, fNumber, 'F', 2,
+ rIntl().GetNumDecimalSep());
+ if (OutString.GetChar(0) == '-' &&
+ OutString.GetTokenCount('0') == OutString.Len())
+ OutString.EraseLeadingChars('-'); // nicht -0
+ OutString+= '%';
+ }
+ else
+ OutString = rScan.GetErrorString();
+ }
+ break;
+ case NUMBERFORMAT_SCIENTIFIC:
+ {
+ SolarMath::DoubleToString(OutString, fNumber, 'E', 2,
+ rIntl().GetNumDecimalSep());
+ return FALSE;
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ else // keine Standards mehr
+ {
+ USHORT nIx; // Index des Teilformats
+ short nCheck = ImpCheckCondition(fNumber, fLimit1, eOp1);
+ if (nCheck == -1 || nCheck == 1) // nur 1 String oder True
+ nIx = 0;
+ else
+ {
+ nCheck = ImpCheckCondition(fNumber, fLimit2, eOp2);
+ if (nCheck == -1 || nCheck == 1)
+ nIx = 1;
+ else
+ nIx = 2;
+ }
+ if (nIx == 1 && fNumber < 0.0 && // negatives Format
+ IsNegativeRealNegative() ) // ohne Vorzeichen
+ fNumber = -fNumber; // Vorzeichen eliminieren
+ *ppColor = NumFor[nIx].GetColor();
+ const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+ const USHORT nAnz = NumFor[nIx].GetnAnz();
+ if (nAnz == 0 && rInfo.eScannedType == NUMBERFORMAT_UNDEFINED)
+ return FALSE; // leer => nichts
+ else if (nAnz == 0) // sonst Standard-Format
+ {
+ ImpGetOutputStandard(fNumber, OutString);
+ return FALSE;
+ }
+ switch (rInfo.eScannedType)
+ {
+ case NUMBERFORMAT_TEXT:
+ case NUMBERFORMAT_DEFINED:
+ {
+ for (USHORT i = 0; i < nAnz; i++)
+ {
+ switch (rInfo.nTypeArray[i])
+ {
+ case SYMBOLTYPE_STAR:
+ if( bStarFlag )
+ {
+ OutString += (xub_Unicode) 0x1B;
+ OutString += rInfo.sStrArray[i].GetChar(1);
+ bRes = TRUE;
+ }
+ break;
+ case SYMBOLTYPE_BLANK:
+ InsertBlanks( OutString, OutString.Len(),
+ rInfo.sStrArray[i].GetChar(1) );
+ break;
+ case SYMBOLTYPE_STRING:
+ case SYMBOLTYPE_CURRENCY:
+ OutString += rInfo.sStrArray[i];
+ break;
+ case SYMBOLTYPE_THSEP:
+ if (rInfo.nThousand == 0)
+ OutString += rInfo.sStrArray[i];
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ break;
+ case NUMBERFORMAT_DATE:
+ bRes |= ImpGetDateOutput(fNumber, nIx, OutString);
+ break;
+ case NUMBERFORMAT_TIME:
+ bRes |= ImpGetTimeOutput(fNumber, nIx, OutString);
+ break;
+ case NUMBERFORMAT_DATETIME:
+ bRes |= ImpGetDateTimeOutput(fNumber, nIx, OutString);
+ break;
+ case NUMBERFORMAT_NUMBER:
+ case NUMBERFORMAT_PERCENT:
+ case NUMBERFORMAT_CURRENCY:
+ bRes |= ImpGetNumberOutput(fNumber, nIx, OutString);
+ break;
+ case NUMBERFORMAT_FRACTION:
+ {
+ XubString sStr, sFrac, sDiv; // Strings, Wert fuer
+ ULONG nFrac, nDiv; // Vorkommaanteil
+ // Zaehler und Nenner
+ BOOL bSign = FALSE;
+ if (fNumber < 0)
+ {
+ if (nIx == 0) // nicht in hinteren
+ bSign = TRUE; // Formaten
+ fNumber = -fNumber;
+ }
+ double fNum = floor(fNumber); // Vorkommateil
+ fNumber -= fNum; // Nachkommateil
+ if (fNum > _D_MAX_U_LONG_ || rInfo.nCntExp > 9)
+ // zu gross
+ {
+ OutString = rScan.GetErrorString();
+ return FALSE;
+ }
+ if (rInfo.nCntExp == 0)
+ {
+ DBG_ERROR("SvNumberformat:: Bruch, nCntExp == 0");
+ return FALSE;
+ }
+ ULONG nBasis = ((ULONG)floor( // 9, 99, 999 ,...
+ pow(10.0,rInfo.nCntExp))) - 1;
+ ULONG x0, y0, x1, y1, x2, y2;
+
+ if (rInfo.nCntExp <= _MAX_FRACTION_PREC)
+ {
+ BOOL bUpperHalf;
+ if (fNumber > 0.5)
+ {
+ bUpperHalf = TRUE;
+ fNumber -= (fNumber - 0.5) * 2.0;
+ }
+ else
+ bUpperHalf = FALSE;
+ // Einstieg in Farey-Serie
+ // finden:
+ x0 = (ULONG) floor(fNumber*nBasis); // z.B. 2/9 <= x < 3/9
+ if (x0 == 0) // => x0 = 2
+ {
+ y0 = 1;
+ x1 = 1;
+ y1 = nBasis;
+ }
+ else if (x0 == (nBasis-1)/2) // (b-1)/2, 1/2
+ { // geht (nBasis ungerade)
+ y0 = nBasis;
+ x1 = 1;
+ y1 = 2;
+ }
+ else if (x0 == 1)
+ {
+ y0 = nBasis; // 1/n; 1/(n-1)
+ x1 = 1;
+ y1 = nBasis - 1;
+ }
+ else
+ {
+ y0 = nBasis; // z.B. 2/9 2/8
+ x1 = x0;
+ y1 = nBasis - 1;
+ double fUg = (double) x0 / (double) y0;
+ double fOg = (double) x1 / (double) y1;
+ ULONG nGgt = ImpGGT(y0, x0); // x0/y0 kuerzen
+ x0 /= nGgt;
+ y0 /= nGgt; // Einschachteln:
+ double fTest;
+ BOOL bStop = FALSE;
+ while (!bStop)
+ {
+ fTest = (double)x1/(double)y1;
+ while (!bStop)
+ {
+ while (fTest > fOg)
+ {
+ x1--;
+ fTest = (double)x1/(double)y1;
+ }
+ while (fTest < fUg && y1 > 1)
+ {
+ y1--;
+ fTest = (double)x1/(double)y1;
+ }
+ if (fTest <= fOg)
+ {
+ fOg = fTest;
+ bStop = TRUE;
+ }
+ else if (y1 == 1)
+ bStop = TRUE;
+ } // of while
+ nGgt = ImpGGT(y1, x1); // x1/y1 kuerzen
+ x2 = x1 / nGgt;
+ y2 = y1 / nGgt;
+ if (x2*y0 - x0*y2 == 1 || y1 <= 1) // Test, ob x2/y2
+ bStop = TRUE; // naechste Farey-Zahl
+ else
+ {
+ y1--;
+ bStop = FALSE;
+ }
+ } // of while
+ x1 = x2;
+ y1 = y2;
+ } // of else
+ double fup, flow;
+ flow = (double)x0/(double)y0;
+ fup = (double)x1/(double)y1;
+ while (fNumber > fup)
+ {
+ x2 = ((y0+nBasis)/y1)*x1 - x0; // naechste Farey-Zahl
+ y2 = ((y0+nBasis)/y1)*y1 - y0;
+// GetNextFareyNumber(nBasis, x0, x1, y0, y1, x2, y2);
+ x0 = x1;
+ y0 = y1;
+ x1 = x2;
+ y1 = y2;
+ flow = fup;
+ fup = (double)x1/(double)y1;
+ }
+ if (fNumber - flow < fup - fNumber)
+ {
+ nFrac = x0;
+ nDiv = y0;
+ }
+ else
+ {
+ nFrac = x1;
+ nDiv = y1;
+ }
+ if (bUpperHalf) // Original restaur.
+ {
+ if (nFrac == 0 && nDiv == 1) // 1/1
+ fNum += 1.0;
+ else
+ nFrac = nDiv - nFrac;
+ }
+ }
+ else // grosse Nenner
+ { // 0,1234->123/1000
+ ULONG nGgt;
+/*
+ nDiv = nBasis+1;
+ nFrac = ((ULONG)floor(0.5 + fNumber *
+ pow(10.0,rInfo.nCntExp)));
+*/
+ nDiv = 10000000;
+ nFrac = ((ULONG)floor(0.5 + fNumber * 10000000.0));
+ nGgt = ImpGGT(nDiv, nFrac);
+ if (nGgt > 1)
+ {
+ nDiv /= nGgt;
+ nFrac /= nGgt;
+ }
+ if (nDiv > nBasis)
+ {
+ nGgt = ImpGGTRound(nDiv, nFrac);
+ if (nGgt > 1)
+ {
+ nDiv /= nGgt;
+ nFrac /= nGgt;
+ }
+ }
+ if (nDiv > nBasis)
+ {
+ nDiv = nBasis;
+ nFrac = ((ULONG)floor(0.5 + fNumber *
+ pow(10.0,rInfo.nCntExp)));
+ nGgt = ImpGGTRound(nDiv, nFrac);
+ if (nGgt > 1)
+ {
+ nDiv /= nGgt;
+ nFrac /= nGgt;
+ }
+ }
+ }
+
+ if (rInfo.nCntPre == 0) // unechter Bruch
+ {
+ double fNum1 = fNum * (double)nDiv + (double)nFrac;
+ if (fNum1 > _D_MAX_U_LONG_)
+ {
+ OutString = rScan.GetErrorString();
+ return FALSE;
+ }
+ nFrac = (ULONG) floor(fNum1);
+ sStr.Erase();
+ }
+ else if (fNum == 0.0 && nFrac != 0)
+ sStr.Erase();
+ else
+ {
+ char aBuf[100];
+ sprintf( aBuf, "%.f", fNum ); // simple rounded integer
+ sStr.AssignAscii( aBuf );
+ }
+ sFrac = String::CreateFromInt32(nFrac);
+ sDiv = String::CreateFromInt32(nDiv);
+ if (rInfo.nCntPre > 0 && nFrac == 0)
+ {
+ sFrac.Erase();
+ sDiv.Erase();
+ }
+
+ USHORT j = nAnz-1; // letztes Symbol->rueckw.
+ xub_StrLen k; // Nenner:
+ bRes |= ImpNumberFill(sDiv, fNumber, k, j, nIx, SYMBOLTYPE_FRAC);
+ BOOL bCont = TRUE;
+ if (rInfo.nTypeArray[j] == SYMBOLTYPE_FRAC)
+ {
+ if (rInfo.nCntPre > 0 && nFrac == 0)
+ sDiv.Insert(' ',0);
+ else
+ sDiv.Insert( rInfo.sStrArray[j].GetChar(0), 0 );
+ if ( j )
+ j--;
+ else
+ bCont = FALSE;
+ }
+ // weiter Zaehler:
+ if ( !bCont )
+ sFrac.Erase();
+ else
+ {
+ bRes |= ImpNumberFill(sFrac, fNumber, k, j, nIx, SYMBOLTYPE_FRACBLANK);
+ if (rInfo.nTypeArray[j] == SYMBOLTYPE_FRACBLANK)
+ {
+ sFrac.Insert(rInfo.sStrArray[j],0);
+ if ( j )
+ j--;
+ else
+ bCont = FALSE;
+ }
+ }
+ // weiter Hauptzahl
+ if ( !bCont )
+ sStr.Erase();
+ else
+ {
+ k = sStr.Len(); // hinter letzter Ziffer
+ bRes |= ImpNumberFillWithThousands(sStr, fNumber, k, j, nIx,
+ rInfo.nCntPre);
+ }
+ if (bSign && !(nFrac == 0 && fNum == 0.0))
+ OutString.Insert('-',0); // nicht -0
+ OutString += sStr;
+ OutString += sFrac;
+ OutString += sDiv;
+ }
+ break;
+ case NUMBERFORMAT_SCIENTIFIC:
+ {
+ BOOL bSign = FALSE;
+ if (fNumber < 0)
+ {
+ if (nIx == 0) // nicht in hinteren
+ bSign = TRUE; // Formaten
+ fNumber = -fNumber;
+ }
+ XubString sStr;
+ SolarMath::DoubleToString(sStr, fNumber, 'E',
+ rInfo.nCntPre+rInfo.nCntPost-1);
+
+ XubString ExpStr;
+ short nExpSign = 1;
+ xub_StrLen nExPos = sStr.Search('E');
+ if ( nExPos != STRING_NOTFOUND )
+ {
+ ExpStr = sStr.Copy( nExPos );
+ sStr.Erase( nExPos );
+ ExpStr.Erase(0,2); // get rid of "E+" or "E-"
+ sStr.EraseAllChars('.'); // Komma (Punkt) weg
+ if (rInfo.nCntPre != 1) // Reskalierung Exp
+ {
+ sal_Int32 nExp = ExpStr.ToInt32();
+ nExp -= sal_Int32(rInfo.nCntPre)-1;
+ ExpStr = XubString::CreateFromInt32( nExp );
+ }
+ if (ExpStr.GetChar(0) == '-')
+ {
+ nExpSign = -1;
+ ExpStr.Erase(0,1); // Vorzeichen weg
+ }
+ }
+ USHORT j = nAnz-1; // letztes Symbol
+ xub_StrLen k;
+ bRes |= ImpNumberFill(ExpStr, fNumber, k, j, nIx, SYMBOLTYPE_EXP);
+
+ while (k > 0) // fuehrende Nullen loeschen
+ {
+ k--;
+ if (ExpStr.GetChar(k) == '0')
+ ExpStr.Erase(0,1);
+ }
+ BOOL bCont = TRUE;
+ if (rInfo.nTypeArray[j] == SYMBOLTYPE_EXP)
+ {
+ const XubString& rStr = rInfo.sStrArray[j];
+ if (nExpSign == -1)
+ ExpStr.Insert('-',0);
+ else if (rStr.Len() > 1 && rStr.GetChar(1) == '+')
+ ExpStr.Insert('+',0);
+ ExpStr.Insert(rStr.GetChar(0),0);
+ if ( j )
+ j--;
+ else
+ bCont = FALSE;
+ }
+ // weiter Hauptzahl:
+ if ( !bCont )
+ sStr.Erase();
+ else
+ {
+ k = sStr.Len(); // hinter letzter Ziffer
+ bRes |= ImpNumberFillWithThousands(sStr,fNumber, k,j,nIx,
+ rInfo.nCntPre +
+ rInfo.nCntPost);
+ }
+ if (bSign)
+ sStr.Insert('-',0);
+ OutString = sStr;
+ OutString += ExpStr;
+ return bRes;
+ }
+ break;
+ }
+ }
+ return bRes;
+}
+
+BOOL SvNumberformat::ImpGetTimeOutput(double fNumber,
+ USHORT nIx,
+ XubString& OutString)
+{
+ BOOL bRes = FALSE;
+ BOOL bSign = FALSE;
+ if (fNumber < 0.0)
+ {
+ fNumber = -fNumber;
+ if (nIx == 0)
+ bSign = TRUE;
+ }
+ const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+ if (rInfo.bThousand) // []-Format
+ {
+ if (fNumber > 1.0E10) // zu gross
+ {
+ OutString = rScan.GetErrorString();
+ return FALSE;
+ }
+ }
+ else
+ fNumber -= floor(fNumber); // sonst Datum abtrennen
+ BOOL bInputLine;
+ xub_StrLen nCntPost;
+ if ( rScan.GetStandardPrec() == 300 &&
+ 0 < rInfo.nCntPost && rInfo.nCntPost < 12 )
+ {
+ bInputLine = TRUE;
+ nCntPost = 12;
+ }
+ else
+ {
+ bInputLine = FALSE;
+ nCntPost = xub_StrLen(rInfo.nCntPost);
+ }
+ if (bSign && !rInfo.bThousand) // kein []-Format
+ fNumber = 1.0 - fNumber; // "Kehrwert"
+ double fTime = fNumber * 86400.0;
+ double fFactor = pow( 10.0, double(nCntPost) );
+ fTime = floor( 0.5 + fTime * fFactor ) / fFactor; // runden
+ if (bSign && fTime == 0.0)
+ bSign = FALSE; // nicht -00:00:00
+
+// ULONG nTime = (ULONG) floor(fTime); // Vorkommaanteil
+
+ ULONG nSeconds = 0;
+ ULONG nHours = 0;
+ if( floor( fTime ) > _D_MAX_U_LONG_ )
+ {
+ if( (floor( fTime )/3600.0) > _D_MAX_U_LONG_ )
+ {
+ OutString.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "###" ) );
+ return FALSE;
+ }
+ else
+ {
+ nSeconds = (ULONG)(((fTime/3600.0) - floor( fTime/3600.0 ))*3600.0);
+ nHours = (ULONG)(fTime/3600.0);
+ }
+ }
+ else
+ nSeconds = (ULONG)floor( fTime );
+
+ XubString sSecStr;
+ SolarMath::DoubleToString(sSecStr, fTime-nSeconds, 'F', int(nCntPost));
+ sSecStr.EraseLeadingChars('0');
+ sSecStr.EraseLeadingChars('.');
+ if ( bInputLine )
+ {
+ sSecStr.EraseTrailingChars('0');
+ if ( sSecStr.Len() < xub_StrLen(rInfo.nCntPost) )
+ sSecStr.Expand( xub_StrLen(rInfo.nCntPost), '0' );
+ nCntPost = sSecStr.Len();
+ }
+ xub_StrLen nSecPos = 0; // Zum Ziffernweisen
+ // abarbeiten
+ ULONG nHour, nMin, nSec;
+ if (!rInfo.bThousand) // kein [] Format
+ {
+ nHour = (nSeconds/3600) % 24;
+ nMin = (nSeconds%3600) / 60;
+ nSec = nSeconds%60;
+ }
+ else if (rInfo.nThousand == 3) // [ss]
+ {
+ nHour = 0;
+ nMin = 0;
+ nSec = nSeconds;
+ }
+ else if (rInfo.nThousand == 2) // [mm]:ss
+ {
+ nHour = 0;
+ nMin = nSeconds / 60;
+ nSec = nSeconds % 60;
+ }
+ else if (rInfo.nThousand == 1) // [hh]:mm:ss
+ {
+ nHour = nSeconds / 3600;
+ nMin = (nSeconds%3600) / 60;
+ nSec = nSeconds%60;
+ }
+ xub_Unicode cAmPm = ' '; // a oder p
+ if (rInfo.nCntExp) // AM/PM
+ {
+ if (nHour == 0)
+ {
+ nHour = 12;
+ cAmPm = 'a';
+ }
+ else if (nHour < 12)
+ cAmPm = 'a';
+ else
+ {
+ cAmPm = 'p';
+ if (nHour > 12)
+ nHour -= 12;
+ }
+ }
+ const USHORT nAnz = NumFor[nIx].GetnAnz();
+ for (USHORT i = 0; i < nAnz; i++)
+ {
+ switch (rInfo.nTypeArray[i])
+ {
+ case SYMBOLTYPE_STAR:
+ if( bStarFlag )
+ {
+ OutString += (xub_Unicode) 0x1B;
+ OutString += rInfo.sStrArray[i].GetChar(1);
+ bRes = TRUE;
+ }
+ break;
+ case SYMBOLTYPE_BLANK:
+ InsertBlanks( OutString, OutString.Len(),
+ rInfo.sStrArray[i].GetChar(1) );
+ break;
+ case SYMBOLTYPE_STRING:
+ case SYMBOLTYPE_CURRENCY:
+ OutString += rInfo.sStrArray[i];
+ break;
+ case SYMBOLTYPE_DIGIT:
+ {
+ xub_StrLen nLen = ( bInputLine && i > 0 &&
+ rInfo.sStrArray[i-1].GetChar(0) == rIntl().GetNumDecimalSep() ?
+ nCntPost : rInfo.sStrArray[i].Len() );
+ for (xub_StrLen j = 0; j < nLen && nSecPos < nCntPost; j++)
+ {
+ OutString += sSecStr.GetChar(nSecPos);
+ nSecPos++;
+ }
+ }
+ break;
+ case NF_KEY_AMPM: // AM/PM
+ {
+ if (cAmPm == 'a')
+ OutString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "AM" ) );
+ else
+ OutString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "PM" ) );
+ }
+ break;
+ case NF_KEY_AP: // A/P
+ {
+ if (cAmPm == 'a')
+ OutString += 'a';
+ else
+ OutString += 'p';
+ }
+ break;
+ case NF_KEY_MI: // M
+ OutString += String::CreateFromInt32(nMin);
+ break;
+ case NF_KEY_MMI: // MM
+ {
+ if (nMin < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nMin);
+ }
+ break;
+ case NF_KEY_H: // H
+ OutString += String::CreateFromInt32(nHour);
+ break;
+ case NF_KEY_HH: // HH
+ {
+ if (nHour < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nHour);
+ }
+ break;
+ case NF_KEY_S: // S
+ OutString += String::CreateFromInt32(nSec);
+ break;
+ case NF_KEY_SS: // SS
+ {
+ if (nSec < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nSec);
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ if (bSign && rInfo.bThousand)
+ OutString.Insert('-',0);
+ return bRes;
+}
+
+BOOL SvNumberformat::ImpGetDateOutput(double fNumber,
+ USHORT nIx,
+ XubString& OutString)
+{
+ BOOL bRes = FALSE;
+ if (fabs(fNumber) > _D_MAX_LONG_) // zu gross
+ {
+ OutString = rScan.GetErrorString();
+ return FALSE;
+ }
+ long nNum = (long) floor(fNumber);
+ Date aDate = *(rScan.GetNullDate()) + nNum;
+ const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+ const USHORT nAnz = NumFor[nIx].GetnAnz();
+ for (USHORT i = 0; i < nAnz; i++)
+ {
+ switch (rInfo.nTypeArray[i])
+ {
+ case SYMBOLTYPE_STAR:
+ if( bStarFlag )
+ {
+ OutString += (xub_Unicode) 0x1B;
+ OutString += rInfo.sStrArray[i].GetChar(1);
+ bRes = TRUE;
+ }
+ break;
+ case SYMBOLTYPE_BLANK:
+ InsertBlanks( OutString, OutString.Len(),
+ rInfo.sStrArray[i].GetChar(1) );
+ break;
+ case SYMBOLTYPE_STRING:
+ case SYMBOLTYPE_CURRENCY:
+ OutString += rInfo.sStrArray[i];
+ break;
+ case NF_KEY_M: // M
+ OutString += String::CreateFromInt32(aDate.GetMonth());
+ break;
+ case NF_KEY_MM: // MM
+ {
+ if (aDate.GetMonth() < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(aDate.GetMonth());
+ }
+ break;
+ case NF_KEY_MMM: // MMM
+ OutString += rIntl().GetAbbrevMonthText(aDate.GetMonth());
+ break;
+ case NF_KEY_MMMM: // MMMM
+ OutString += rIntl().GetMonthText(aDate.GetMonth());
+ break;
+ case NF_KEY_Q: // Q
+ case NF_KEY_QQ: // QQ
+ {
+ if (rInfo.nTypeArray[i] == NF_KEY_Q)
+ OutString += 'Q';
+ USHORT nMonth = aDate.GetMonth();
+ if (nMonth <= 3)
+ OutString += '1';
+ else if (nMonth <=6)
+ OutString += '2';
+ else if (nMonth <= 9)
+ OutString += '3';
+ else
+ OutString += '4';
+ if (rInfo.nTypeArray[i] == NF_KEY_QQ)
+ {
+ OutString += '.'; // #40387# "1. Quartal" mit Leerzeichen
+ OutString += ' ';
+ OutString += rScan.GetQuartalString();
+ }
+ }
+ break;
+ case NF_KEY_T: // T
+ OutString += String::CreateFromInt32(aDate.GetDay());
+ break;
+ case NF_KEY_TT: // TT
+ {
+ if (aDate.GetDay() < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(aDate.GetDay());
+ }
+ break;
+ case NF_KEY_TTT: // TTT
+ OutString += rIntl().GetAbbrevDayText(aDate.GetDayOfWeek());
+ break;
+ case NF_KEY_TTTT: // TTTT
+ OutString += rIntl().GetDayText(aDate.GetDayOfWeek());
+ break;
+ case NF_KEY_JJ: // JJ
+ {
+ XubString sStr = String::CreateFromInt32(aDate.GetYear());
+ sStr.Erase(0,2);
+ OutString += sStr;
+ }
+ break;
+ case NF_KEY_JJJJ: // JJJJ
+ OutString += String::CreateFromInt32(aDate.GetYear());
+ break;
+ case NF_KEY_NN: // NN
+ OutString += rIntl().GetAbbrevDayText(aDate.GetDayOfWeek());
+ break;
+ case NF_KEY_NNN: // NNN
+ OutString += rIntl().GetDayText(aDate.GetDayOfWeek());
+ break;
+ case NF_KEY_NNNN: // NNNN
+ {
+ OutString += rIntl().GetDayText(aDate.GetDayOfWeek());
+ OutString += rIntl().GetLongDateDayOfWeekSep();
+ }
+ break;
+ case NF_KEY_WW : // WW Kalenderwoche
+ OutString += String::CreateFromInt32(
+ aDate.GetWeekOfYear( rIntl().GetWeekStart(),
+ rIntl().GetWeekCountStart() ) );
+ break;
+ default:
+ break;
+ }
+ }
+ return bRes;
+}
+
+BOOL SvNumberformat::ImpGetDateTimeOutput(double fNumber,
+ USHORT nIx,
+ XubString& OutString)
+{
+ BOOL bRes = FALSE;
+ if (fabs(fNumber) > _D_MAX_LONG_) // zu gross
+ {
+ OutString = rScan.GetErrorString();
+ return FALSE;
+ }
+ double fNum1 = floor(fNumber); // -> Datum
+ double fNum2 = fNumber - fNum1; // -> Zeit
+ long nNum1 = (long) fNum1;
+
+ Date aDate = *(rScan.GetNullDate()) + nNum1;
+
+ const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+ double fTime = fNum2*86400.0;
+ double fFactor = pow(10.0,rInfo.nCntPost);
+ fTime = floor(0.5 + fTime * fFactor) / fFactor; // runden
+
+// ULONG nTime = (ULONG) floor(fTime); // Vorkommaanteil
+
+ ULONG nSeconds = 0;
+ ULONG nHours = 0;
+ if( floor( fTime ) > _D_MAX_U_LONG_ )
+ {
+ if( (floor( fTime )/3600.0) > _D_MAX_U_LONG_ )
+ {
+ OutString.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "###" ) );
+ return FALSE;
+ }
+ else
+ {
+ nSeconds = (ULONG)(((fTime/3600.0) - floor( fTime/3600.0 ))*3600.0);
+ nHours = (ULONG)(fTime/3600.0);
+ }
+ }
+ else
+ nSeconds = (ULONG)floor( fTime );
+
+ XubString sSecStr;
+ SolarMath::DoubleToString(sSecStr, fTime-nSeconds, 'F', rInfo.nCntPost);
+ sSecStr.EraseLeadingChars('0');
+ sSecStr.EraseLeadingChars('.');
+ xub_StrLen nSecPos = 0; // Zum Ziffernweisen
+ // abarbeiten
+ ULONG nHour, nMin, nSec;
+ if (!rInfo.bThousand) // [] Format
+ {
+ nHour = (nSeconds/3600) % 24;
+ nMin = (nSeconds%3600) / 60;
+ nSec = nSeconds%60;
+ }
+ else if (rInfo.nThousand == 3) // [ss]
+ {
+ nHour = 0;
+ nMin = 0;
+ nSec = nSeconds;
+ }
+ else if (rInfo.nThousand == 2) // [mm]:ss
+ {
+ nHour = 0;
+ nMin = nSeconds / 60;
+ nSec = nSeconds % 60;
+ }
+ else if (rInfo.nThousand == 1) // [hh]:mm:ss
+ {
+ nHour = nSeconds / 3600;
+ nMin = (nSeconds%3600) / 60;
+ nSec = nSeconds%60;
+ }
+ xub_Unicode cAmPm = ' '; // a oder p
+ if (rInfo.nCntExp) // AM/PM
+ {
+ if (nHour == 0)
+ {
+ nHour = 12;
+ cAmPm = 'a';
+ }
+ else if (nHour < 12)
+ cAmPm = 'a';
+ else
+ {
+ cAmPm = 'p';
+ if (nHour > 12)
+ nHour -= 12;
+ }
+ }
+ const USHORT nAnz = NumFor[nIx].GetnAnz();
+ for (USHORT i = 0; i < nAnz; i++)
+ {
+ switch (rInfo.nTypeArray[i])
+ {
+ case SYMBOLTYPE_STAR:
+ if( bStarFlag )
+ {
+ OutString += (xub_Unicode) 0x1B;
+ OutString += rInfo.sStrArray[i].GetChar(1);
+ bRes = TRUE;
+ }
+ break;
+ case SYMBOLTYPE_BLANK:
+ InsertBlanks( OutString, OutString.Len(),
+ rInfo.sStrArray[i].GetChar(1) );
+ break;
+ case SYMBOLTYPE_STRING:
+ case SYMBOLTYPE_CURRENCY:
+ OutString += rInfo.sStrArray[i];
+ break;
+ case SYMBOLTYPE_DIGIT:
+ {
+ const xub_StrLen nLen = rInfo.sStrArray[i].Len();
+ const xub_StrLen nCntPost = xub_StrLen(rInfo.nCntPost);
+ for (xub_StrLen j = 0; j < nLen && nSecPos < nCntPost; j++)
+ {
+ OutString += sSecStr.GetChar(nSecPos);
+ nSecPos++;
+ }
+ }
+ break;
+ case NF_KEY_AMPM: // AM/PM
+ {
+ if (cAmPm == 'a')
+ OutString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "AM" ) );
+ else
+ OutString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "PM" ) );
+ }
+ break;
+ case NF_KEY_AP: // A/P
+ {
+ if (cAmPm == 'a')
+ OutString += 'a';
+ else
+ OutString += 'p';
+ }
+ break;
+ case NF_KEY_MI: // M
+ OutString += String::CreateFromInt32(nMin);
+ break;
+ case NF_KEY_MMI: // MM
+ {
+ if (nMin < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nMin);
+ }
+ break;
+ case NF_KEY_H: // H
+ OutString += String::CreateFromInt32(nHour);
+ break;
+ case NF_KEY_HH: // HH
+ {
+ if (nHour < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nHour);
+ }
+ break;
+ case NF_KEY_S: // S
+ OutString += String::CreateFromInt32(nSec);
+ break;
+ case NF_KEY_SS: // SS
+ {
+ if (nSec < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(nSec);
+ }
+ break;
+ case NF_KEY_M: // M
+ OutString += String::CreateFromInt32(aDate.GetMonth());
+ break;
+ case NF_KEY_MM: // MM
+ {
+ if (aDate.GetMonth() < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(aDate.GetMonth());
+ }
+ break;
+ case NF_KEY_MMM: // MMM
+ OutString += rIntl().GetAbbrevMonthText(aDate.GetMonth());
+ break;
+ case NF_KEY_MMMM: // MMMM
+ OutString += rIntl().GetMonthText(aDate.GetMonth());
+ break;
+ case NF_KEY_Q: // Q
+ case NF_KEY_QQ: // QQ
+ {
+ USHORT nMonth = aDate.GetMonth();
+ if (nMonth <= 3)
+ OutString += '1';
+ else if (nMonth <=6)
+ OutString += '2';
+ else if (nMonth <= 9)
+ OutString += '3';
+ else
+ OutString += '4';
+ OutString += '.'; // #40387# "1. Quartal" mit Leerzeichen
+ OutString += ' ';
+ OutString += rScan.GetQuartalString();
+ if (rInfo.nTypeArray[i] == NF_KEY_QQ)
+ {
+ OutString += ' ';
+ OutString += String::CreateFromInt32(aDate.GetYear());
+ }
+ }
+ break;
+ case NF_KEY_T: // T
+ OutString += String::CreateFromInt32(aDate.GetDay());
+ break;
+ case NF_KEY_TT: // TT
+ {
+ if (aDate.GetDay() < 10)
+ OutString += '0';
+ OutString += String::CreateFromInt32(aDate.GetDay());
+ }
+ break;
+ case NF_KEY_TTT: // TTT
+ OutString += rIntl().GetAbbrevDayText(aDate.GetDayOfWeek());
+ break;
+ case NF_KEY_TTTT: // TTTT
+ OutString += rIntl().GetDayText(aDate.GetDayOfWeek());
+ break;
+ case NF_KEY_JJ: // JJ
+ {
+ XubString sStr = String::CreateFromInt32(aDate.GetYear());
+ sStr.Erase(0,2);
+ OutString += sStr;
+ }
+ break;
+ case NF_KEY_JJJJ: // JJJJ
+ OutString += String::CreateFromInt32(aDate.GetYear());
+ break;
+ case NF_KEY_NN: // NN
+ OutString += rIntl().GetAbbrevDayText(aDate.GetDayOfWeek());
+ break;
+ case NF_KEY_NNN: // NNN
+ OutString += rIntl().GetDayText(aDate.GetDayOfWeek());
+ break;
+ case NF_KEY_NNNN: // NNNN
+ OutString += rIntl().GetDayText(aDate.GetDayOfWeek());
+ OutString += rIntl().GetLongDateDayOfWeekSep();
+ break;
+ case NF_KEY_WW : // WW Kalenderwoche
+ OutString += String::CreateFromInt32(
+ aDate.GetWeekOfYear( rIntl().GetWeekStart(),
+ rIntl().GetWeekCountStart() ) );
+ break;
+ default:
+ break;
+ }
+ }
+ return bRes;
+}
+
+BOOL SvNumberformat::ImpGetNumberOutput(double fNumber,
+ USHORT nIx,
+ XubString& OutString)
+{
+ BOOL bRes = FALSE;
+ BOOL bSign;
+ if (fNumber < 0.0)
+ {
+ if (nIx == 0) // nicht in hinteren
+ bSign = TRUE; // Formaten
+ else
+ bSign = FALSE;
+ fNumber = -fNumber;
+ }
+ else
+ bSign = FALSE;
+ const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+ if (rInfo.eScannedType == NUMBERFORMAT_PERCENT)
+ {
+ if (fNumber < _D_MAX_D_BY_100)
+ fNumber *= 100.0;
+ else
+ {
+ OutString = rScan.GetErrorString();
+ return FALSE;
+ }
+ }
+ USHORT i, j;
+ xub_StrLen k;
+ XubString sStr;
+ long nPrecExp;
+ BOOL bInteger = FALSE;
+ if (rInfo.nThousand == FLAG_STANDARD_IN_FORMAT) // Hack: "Standard"
+ { // im Format
+ bSign = FALSE; // dann Vorzeichen per Format, nicht per Zahl
+ // und keine Zahlformatiererei an dieser
+ } // Stelle!
+ else
+ {
+ const USHORT nThousand = rInfo.nThousand;
+ for (i = 0; i < nThousand; i++)
+ {
+ if (fNumber > _D_MIN_M_BY_1000)
+ fNumber /= 1000.0;
+ else
+ fNumber = 0.0;
+ }
+ if (fNumber > 0.0)
+ nPrecExp = GetPrecExp( fNumber );
+ else
+ nPrecExp = 0;
+ if (rInfo.nCntPost) // NachkommaStellen
+ {
+ if (rInfo.nCntPost + nPrecExp > 15 && nPrecExp < 15)
+ {
+ SolarMath::DoubleToString( sStr, fNumber, 'F', 15-nPrecExp );
+ for (long l = 15-nPrecExp; l < (long) rInfo.nCntPost; l++)
+ sStr += '0';
+ }
+ else
+ SolarMath::DoubleToString( sStr, fNumber, 'F', rInfo.nCntPost );
+ sStr.EraseLeadingChars('0'); // fuehrende Nullen weg
+ }
+ else if (fNumber == 0.0) // Null
+ {
+ // nothing to be done here, keep empty string sStr,
+ // ImpNumberFillWithThousands does the rest
+ }
+ else // Integer
+ {
+ SolarMath::DoubleToString(sStr, fNumber, 'F', 0);
+ sStr.EraseLeadingChars('0'); // fuehrende Nullen weg
+ }
+ xub_StrLen nPoint = sStr.Search( '.' );
+ if ( nPoint != STRING_NOTFOUND )
+ {
+ register const xub_Unicode* p = sStr.GetBuffer() + nPoint;
+ while ( *++p == '0' )
+ ;
+ if ( !*p )
+ bInteger = TRUE;
+ sStr.Erase( nPoint, 1 ); // . herausnehmen
+ }
+ if (bSign &&
+ (sStr.Len() == 0 || sStr.GetTokenCount('0') == sStr.Len()+1)) // nur 00000
+ bSign = FALSE; // nicht -0.00
+ } // End of != FLAG_STANDARD_IN_FORMAT
+
+ // von hinten nach vorn
+ // editieren:
+ k = sStr.Len(); // hinter letzter Ziffer
+ j = NumFor[nIx].GetnAnz()-1; // letztes Symbol
+ // Nachkommastellen:
+ if (rInfo.nCntPost > 0)
+ {
+ BOOL bTrailing = TRUE; // ob Endnullen?
+ BOOL bFilled = FALSE; // ob aufgefuellt wurde ?
+ short nType;
+ while (j > 0 && // rueckwaerts
+ (nType = rInfo.nTypeArray[j]) != SYMBOLTYPE_DECSEP)
+ {
+ switch ( nType )
+ {
+ case SYMBOLTYPE_STAR:
+ if( bStarFlag )
+ {
+ sStr.Insert( (xub_Unicode) 0x1B, k /*++*/ );
+ sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
+ bRes = TRUE;
+ }
+ break;
+ case SYMBOLTYPE_BLANK:
+ /*k = */ InsertBlanks( sStr,k,rInfo.sStrArray[j].GetChar(1) );
+ break;
+ case SYMBOLTYPE_STRING:
+ case SYMBOLTYPE_CURRENCY:
+ sStr.Insert(rInfo.sStrArray[j],k);
+ break;
+ case SYMBOLTYPE_THSEP:
+ if (rInfo.nThousand == 0)
+ sStr.Insert(rInfo.sStrArray[j],k);
+ break;
+ case SYMBOLTYPE_DIGIT:
+ {
+ const XubString& rStr = rInfo.sStrArray[j];
+ const xub_Unicode* p1 = rStr.GetBuffer();
+ register const xub_Unicode* p = p1 + rStr.Len();
+ while ( p1 < p-- )
+ {
+ const xub_Unicode c = *p;
+ k--;
+ if ( sStr.GetChar(k) != '0' )
+ bTrailing = FALSE;
+ if (bTrailing)
+ {
+ if ( c == '0' )
+ bFilled = TRUE;
+ else if ( c == '-' )
+ {
+ if ( bInteger )
+ sStr.SetChar( k, '-' );
+ bFilled = TRUE;
+ }
+ else if ( c == '?' )
+ {
+ sStr.SetChar( k, ' ' );
+ bFilled = TRUE;
+ }
+ else if ( !bFilled ) // #
+ sStr.Erase(k,1);
+ }
+ } // of for
+ } // of case digi
+ break;
+ case NF_KEY_CCC: // CCC-Waehrung
+ sStr.Insert(rIntl().GetCurrBankSymbol(), k);
+ break;
+ case NF_KEY_GENERAL: // Standard im String
+ {
+ XubString sNum;
+ ImpGetOutputStandard(fNumber, sNum);
+ sNum.EraseLeadingChars('-');
+ sStr.Insert(sNum, k);
+ }
+ break;
+ default:
+ break;
+ } // of switch
+ j--;
+ } // of while
+ } // of Nachkomma
+
+ bRes |= ImpNumberFillWithThousands(sStr, fNumber, k, j, nIx, // ggfs Auffuellen mit .
+ rInfo.nCntPre);
+ if ( rInfo.nCntPost > 0 && sStr.GetChar( sStr.Len() - 1 ) == rIntl().GetNumDecimalSep() )
+ sStr.Erase( sStr.Len() - 1 ); // DecSep am Ende ohne Nachkommastellen weg
+ if (bSign)
+ sStr.Insert('-',0);
+ OutString = sStr;
+ return bRes;
+}
+
+BOOL SvNumberformat::ImpNumberFillWithThousands(
+ XubString& sStr, // Zahlstring
+ double& rNumber,
+ xub_StrLen k, // Zeiger darin
+ USHORT j, // Symbolzeiger
+ USHORT nIx, // Teilformatstring
+ USHORT nDigCnt) // Anz Dig. im For.
+{
+ BOOL bRes = FALSE;
+ BOOL bLeading = FALSE; // fuehrende 0
+ xub_StrLen nAnzLeadingChars = 0; // Anzahl fuehrende Nullen oder Blanks
+ USHORT nThousandCnt = 0; // Anzahl Ziffern vor letztem .
+ xub_StrLen nLeadingStringChars = 0; // inserted StringChars vor Zahl
+ USHORT nDigitCount = 0; // Zaehlt Vorkommaziffern
+ BOOL bStop = FALSE;
+ const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+ const xub_Unicode cThousandSep = rIntl().GetNumThousandSep();
+ while (!bStop) // rueckwaerts
+ {
+ if (j == 0)
+ bStop = TRUE;
+ switch (rInfo.nTypeArray[j])
+ {
+ case SYMBOLTYPE_DECSEP:
+ case SYMBOLTYPE_STRING:
+ case SYMBOLTYPE_CURRENCY:
+ sStr.Insert(rInfo.sStrArray[j],k);
+ if ( k == 0 )
+ nLeadingStringChars += rInfo.sStrArray[j].Len();
+ break;
+ case SYMBOLTYPE_STAR:
+ if( bStarFlag )
+ {
+ sStr.Insert( (xub_Unicode) 0x1B, k/*++*/ );
+ sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
+ bRes = TRUE;
+ }
+ break;
+ case SYMBOLTYPE_BLANK:
+ /*k = */ InsertBlanks( sStr,k,rInfo.sStrArray[j].GetChar(1) );
+ break;
+ case SYMBOLTYPE_THSEP:
+ {
+ if (k > 0 && rInfo.nThousand == 0)
+ {
+ sStr.Insert(rInfo.sStrArray[j],k);
+ nThousandCnt = 0;
+ }
+ }
+ break;
+ case SYMBOLTYPE_DIGIT:
+ {
+ const XubString& rStr = rInfo.sStrArray[j];
+ const xub_Unicode* p1 = rStr.GetBuffer();
+ register const xub_Unicode* p = p1 + rStr.Len();
+ while ( p1 < p-- )
+ {
+ nDigitCount++;
+ const xub_Unicode c = *p;
+ if (c == cThousandSep)
+ {
+ nDigitCount--;
+ if (k > 0)
+ {
+ sStr.Insert(c,k);
+ nThousandCnt = 0;
+ }
+ }
+ else if (k > 0)
+ {
+ k--;
+ nThousandCnt++;
+ }
+ else
+ bLeading = TRUE;
+ if (bLeading)
+ {
+ if (c == '?')
+ {
+ sStr.Insert(' ',0);
+ nAnzLeadingChars++;
+ }
+ else if (c == '0')
+ {
+ sStr.Insert('0',0);
+ nAnzLeadingChars++;
+ }
+ }
+ if (nDigitCount == nDigCnt && k > 0)
+ { // mehr Zahlen als Stellen
+ ImpDigitFill(sStr, 0, k, nIx, nThousandCnt);
+ }
+ }
+ }
+ break;
+ case NF_KEY_CCC: // CCC-Waehrung
+ sStr.Insert(rIntl().GetCurrBankSymbol(), k);
+ break;
+ case NF_KEY_GENERAL: // Standard im String
+ {
+ XubString sNum;
+ ImpGetOutputStandard(rNumber, sNum);
+ sNum.EraseLeadingChars('-');
+ sStr.Insert(sNum, k);
+ }
+ break;
+
+ default:
+ break;
+ } // switch
+ j--; // naechster String
+ } // while
+ k += nLeadingStringChars + nAnzLeadingChars;
+ if (k > nLeadingStringChars)
+ ImpDigitFill(sStr, nLeadingStringChars, k, nIx, nThousandCnt);
+/*
+ if (k > 0 && rInfo.bThousand) // noch Ziffern da
+ { // Aufuellen mit .
+ while (k > 0)
+ {
+ if (nThousandCnt > 2)
+ { // hier muss . dazwischen
+ sStr.Insert(rIntl().GetNumThousandSep(),k);
+ nThousandCnt = 1;
+ }
+ else
+ nThousandCnt++;
+ k--;
+ }
+ }
+*/
+ return bRes;
+}
+
+void SvNumberformat::ImpDigitFill(
+ XubString& sStr, // Zahlstring
+ xub_StrLen nStart, // Start der Ziffern
+ xub_StrLen& k, // Zeiger darin
+ USHORT nIx, // Index Teilstring
+ USHORT nThousandCnt ) // Anzahl seit .
+{
+ if (NumFor[nIx].Info().bThousand) // noch Ziffern da
+ { // Aufuellen mit .
+ while (k > nStart)
+ {
+ if (nThousandCnt > 2)
+ { // hier muss . dazwischen
+ sStr.Insert(rIntl().GetNumThousandSep(),k);
+ nThousandCnt = 1;
+ }
+ else
+ nThousandCnt++;
+ k--;
+ }
+ }
+ else // einfach ueberspringen
+ k = nStart;
+}
+
+BOOL SvNumberformat::ImpNumberFill(XubString& sStr, // Zahlstring
+ double& rNumber, // Zahl fuer Standard
+ xub_StrLen& k, // Zeigen darin
+ USHORT& j, // Symbolzeiger
+ USHORT nIx, // Teilformatstring
+ short eSymbolType ) // Abbruchtyp
+{
+ BOOL bRes = FALSE;
+ k = sStr.Len(); // hinter letzter Ziffer
+ BOOL bLeading = FALSE; // fuehrende ? oder 0
+ const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
+ const xub_Unicode cThousandSep = rIntl().GetNumThousandSep();
+ short nType;
+ while (j > 0 && (nType = rInfo.nTypeArray[j]) != eSymbolType )
+ { // rueckwaerts:
+ switch ( nType )
+ {
+ case SYMBOLTYPE_STAR:
+ if( bStarFlag )
+ {
+ sStr.Insert( xub_Unicode(0x1B), k++ );
+ sStr.Insert(rInfo.sStrArray[j].GetChar(1),k);
+ bRes = TRUE;
+ }
+ break;
+ case SYMBOLTYPE_BLANK:
+ k = InsertBlanks( sStr,k,rInfo.sStrArray[j].GetChar(1) );
+ break;
+ case SYMBOLTYPE_DIGIT:
+ {
+ const XubString& rStr = rInfo.sStrArray[j];
+ const xub_Unicode* p1 = rStr.GetBuffer();
+ register const xub_Unicode* p = p1 + rStr.Len();
+ while ( p1 < p-- )
+ {
+ const xub_Unicode c = *p;
+ if (c == cThousandSep)
+ {
+ if (k > 0)
+ sStr.Insert(c,k);
+ }
+ else if (k > 0)
+ k--;
+ else
+ bLeading = TRUE;
+ if (bLeading)
+ {
+ if (c == '?')
+ sStr.Insert(' ',0);
+ else if (c == '0')
+ sStr.Insert('0',0);
+ } // of if
+ } // of for
+ } // of case digi
+ break;
+ case NF_KEY_CCC: // CCC-Waehrung
+ sStr.Insert(rIntl().GetCurrBankSymbol(), k);
+ break;
+ case NF_KEY_GENERAL: // Standard im String
+ {
+ XubString sNum;
+ ImpGetOutputStandard(rNumber, sNum);
+ sNum.EraseLeadingChars('-'); // Vorzeichen weg!!
+ sStr.Insert(sNum, k);
+ }
+ break;
+
+ default:
+ sStr.Insert(rInfo.sStrArray[j],k);
+ break;
+ } // of switch
+ j--; // naechster String
+ } // of while
+ return bRes;
+}
+
+void SvNumberformat::GetFormatSpecialInfo(BOOL& bThousand,
+ BOOL& IsRed,
+ USHORT& nPrecision,
+ USHORT& nAnzLeading)
+{
+ const ImpSvNumberformatInfo& rInfo = NumFor[0].Info();
+ bThousand = rInfo.bThousand;
+ nPrecision = GetFormatPrecision();
+ Color* pColor = NumFor[1].GetColor();
+ if (fLimit1 == 0.0 && fLimit2 == 0.0 && pColor
+ && (*pColor == rScan.GetRedColor()))
+ IsRed = TRUE;
+ else
+ IsRed = FALSE;
+ if (bStandard && rInfo.eScannedType == NUMBERFORMAT_NUMBER)
+ // StandardFormat
+ nAnzLeading = 1;
+ else
+ {
+ nAnzLeading = 0;
+ BOOL bStop = FALSE;
+ USHORT i = 0;
+ const USHORT nAnz = NumFor[0].GetnAnz();
+ while (!bStop && i < nAnz)
+ {
+ short nType = rInfo.nTypeArray[i];
+ if ( nType == SYMBOLTYPE_DIGIT)
+ {
+ register const xub_Unicode* p = rInfo.sStrArray[i].GetBuffer();
+ while ( *p == '#' )
+ p++;
+ while ( *p++ == '0' )
+ nAnzLeading++;
+ }
+ else if (nType == SYMBOLTYPE_DECSEP)
+ bStop = TRUE;
+ i++;
+ }
+ }
+}
+
+const XubString* SvNumberformat::GetNumForString( USHORT nNumFor, USHORT nPos,
+ BOOL bString /* = FALSE */ ) const
+{
+ if ( nNumFor > 3 )
+ return NULL;
+ USHORT nAnz = NumFor[nNumFor].GetnAnz();
+ if ( !nAnz )
+ return NULL;
+ if ( nPos == 0xFFFF )
+ {
+ nPos = nAnz - 1;
+ if ( bString )
+ { // rueckwaerts
+ short* pType = NumFor[nNumFor].Info().nTypeArray + nPos;
+ while ( nPos > 0 && (*pType != SYMBOLTYPE_STRING) &&
+ (*pType != SYMBOLTYPE_CURRENCY) )
+ {
+ pType--;
+ nPos--;
+ }
+ if ( (*pType != SYMBOLTYPE_STRING) && (*pType != SYMBOLTYPE_CURRENCY) )
+ return NULL;
+ }
+ }
+ else if ( nPos > nAnz - 1 )
+ return NULL;
+ else if ( bString )
+ { // vorwaerts
+ short* pType = NumFor[nNumFor].Info().nTypeArray + nPos;
+ while ( nPos < nAnz && (*pType != SYMBOLTYPE_STRING) &&
+ (*pType != SYMBOLTYPE_CURRENCY) )
+ {
+ pType++;
+ nPos++;
+ }
+ if ( (*pType != SYMBOLTYPE_STRING) && (*pType != SYMBOLTYPE_CURRENCY) )
+ return NULL;
+ }
+ return &NumFor[nNumFor].Info().sStrArray[nPos];
+}
+
+
+short SvNumberformat::GetNumForType( USHORT nNumFor, USHORT nPos,
+ BOOL bString /* = FALSE */ ) const
+{
+ if ( nNumFor > 3 )
+ return 0;
+ USHORT nAnz = NumFor[nNumFor].GetnAnz();
+ if ( !nAnz )
+ return 0;
+ if ( nPos == 0xFFFF )
+ {
+ nPos = nAnz - 1;
+ if ( bString )
+ { // rueckwaerts
+ short* pType = NumFor[nNumFor].Info().nTypeArray + nPos;
+ while ( nPos > 0 && (*pType != SYMBOLTYPE_STRING) &&
+ (*pType != SYMBOLTYPE_CURRENCY) )
+ {
+ pType--;
+ nPos--;
+ }
+ if ( (*pType != SYMBOLTYPE_STRING) && (*pType != SYMBOLTYPE_CURRENCY) )
+ return 0;
+ }
+ }
+ else if ( nPos > nAnz - 1 )
+ return 0;
+ else if ( bString )
+ { // vorwaerts
+ short* pType = NumFor[nNumFor].Info().nTypeArray + nPos;
+ while ( nPos < nAnz && (*pType != SYMBOLTYPE_STRING) &&
+ (*pType != SYMBOLTYPE_CURRENCY) )
+ {
+ pType++;
+ nPos++;
+ }
+ if ( (*pType != SYMBOLTYPE_STRING) && (*pType != SYMBOLTYPE_CURRENCY) )
+ return 0;
+ }
+ return NumFor[nNumFor].Info().nTypeArray[nPos];
+}
+
+
+BOOL SvNumberformat::IsNegativeWithoutSign() const
+{
+ if ( IsNegativeRealNegative() )
+ {
+ const XubString* pStr = GetNumForString( 1, 0, TRUE );
+ if ( pStr )
+ return !HasStringNegativeSign( *pStr );
+ }
+ return FALSE;
+}
+
+
+DateFormat SvNumberformat::GetDateOrder() const
+{
+ if ( (eType & NUMBERFORMAT_DATE) == NUMBERFORMAT_DATE )
+ {
+ const short* pType = NumFor[0].Info().nTypeArray;
+ USHORT nAnz = NumFor[0].GetnAnz();
+ for ( USHORT j=0; j<nAnz; j++ )
+ {
+ switch ( pType[j] )
+ {
+ case NF_KEY_T :
+ case NF_KEY_TT :
+ return DMY;
+ break;
+ case NF_KEY_M :
+ case NF_KEY_MM :
+ case NF_KEY_MMM :
+ case NF_KEY_MMMM :
+ return MDY;
+ break;
+ case NF_KEY_JJ :
+ case NF_KEY_JJJJ :
+ return YMD;
+ break;
+ }
+ }
+ }
+ else
+ DBG_ERROR( "SvNumberformat::GetDateOrder: kein Datum" );
+ return rIntl().GetDateFormat();
+}
+
+
+void SvNumberformat::GetConditions( SvNumberformatLimitOps& rOper1, double& rVal1,
+ SvNumberformatLimitOps& rOper2, double& rVal2 ) const
+{
+ rOper1 = eOp1;
+ rOper2 = eOp2;
+ rVal1 = fLimit1;
+ rVal2 = fLimit2;
+}
+
+
+Color* SvNumberformat::GetColor( USHORT nNumFor ) const
+{
+ if ( nNumFor > 3 )
+ return NULL;
+
+ return NumFor[nNumFor].GetColor();
+}
+
+
+void lcl_SvNumberformat_AddLimitStringImpl( XubString& rStr,
+ SvNumberformatLimitOps eOp, double fLimit, xub_Unicode cDecSep )
+{
+ if ( eOp != NUMBERFORMAT_OP_NO )
+ {
+ switch ( eOp )
+ {
+ case NUMBERFORMAT_OP_EQ :
+ rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "[=" ) );
+ break;
+ case NUMBERFORMAT_OP_NE :
+ rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "[<>" ) );
+ break;
+ case NUMBERFORMAT_OP_LT :
+ rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "[<" ) );
+ break;
+ case NUMBERFORMAT_OP_LE :
+ rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "[<=" ) );
+ break;
+ case NUMBERFORMAT_OP_GT :
+ rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "[>" ) );
+ break;
+ case NUMBERFORMAT_OP_GE :
+ rStr.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "[>=" ) );
+ break;
+ }
+ SolarMath::DoubleToString( rStr, fLimit, 'A', INT_MAX, cDecSep, TRUE );
+ rStr += ']';
+ }
+}
+
+
+XubString SvNumberformat::GetMappedFormatstring(
+ const NfKeywordTable& rKeywords, const International& rIntl,
+ BOOL bDontQuote ) const
+{
+ XubString aStr;
+ // 1 subformat matches all if no condition specified
+ BOOL bDefault1 = ( NumFor[1].GetnAnz() == 0 && eOp1 == NUMBERFORMAT_OP_NO );
+ // with 2 subformats [>=0];[<0] is implied if no condition specified
+ BOOL bDefault2 = ( !bDefault1 && NumFor[2].GetnAnz() == 0 &&
+ eOp1 == NUMBERFORMAT_OP_GE && fLimit1 == 0.0 &&
+ eOp2 == NUMBERFORMAT_OP_NO && fLimit2 == 0.0 );
+ // with 3 subformats [>0];[<0];[=0] is implied if no condition specified
+ BOOL bDefault3 = ( !bDefault2 && NumFor[2].GetnAnz() > 0 &&
+ eOp1 == NUMBERFORMAT_OP_GT && fLimit1 == 0.0 &&
+ eOp2 == NUMBERFORMAT_OP_LT && fLimit2 == 0.0 );
+ BOOL bDefault = bDefault1 || bDefault2 || bDefault3;
+ int nSem = 0; // needed ';' delimiters
+ for ( int n=0; n<4; n++ )
+ {
+ if ( n > 0 )
+ nSem++;
+
+ XubString aPrefix;
+
+ if ( !bDefault )
+ {
+ switch ( n )
+ {
+ case 0 :
+ lcl_SvNumberformat_AddLimitStringImpl( aPrefix, eOp1,
+ fLimit1, rIntl.GetNumDecimalSep() );
+ break;
+ case 1 :
+ lcl_SvNumberformat_AddLimitStringImpl( aPrefix, eOp2,
+ fLimit2, rIntl.GetNumDecimalSep() );
+ break;
+ }
+ }
+
+ const XubString& rColorName = NumFor[n].GetColorName();
+ if ( rColorName.Len() )
+ {
+ XubString* pKey = rScan.GetKeyword() + NF_KEY_FIRSTCOLOR;
+ for ( int j=NF_KEY_FIRSTCOLOR; j<=NF_KEY_LASTCOLOR; j++, pKey++ )
+ {
+ if ( *pKey == rColorName )
+ {
+ aPrefix += '[';
+ aPrefix += rKeywords[j];
+ aPrefix += ']';
+ break; // for
+ }
+ }
+ }
+
+ USHORT nAnz = NumFor[n].GetnAnz();
+ if ( nAnz || aPrefix.Len() )
+ {
+ while ( nSem )
+ {
+ aStr += ';';
+ nSem--;
+ }
+ }
+
+ if ( aPrefix.Len() )
+ aStr += aPrefix;
+
+ if ( nAnz )
+ {
+ const short* pType = NumFor[n].Info().nTypeArray;
+ const XubString* pStr = NumFor[n].Info().sStrArray;
+ for ( USHORT j=0; j<nAnz; j++ )
+ {
+ if ( 0 <= pType[j] && pType[j] < NF_KEYWORD_ENTRIES_COUNT )
+ {
+ aStr += rKeywords[pType[j]];
+ if( NF_KEY_NNNN == pType[j] )
+ aStr += rIntl.GetLongDateDayOfWeekSep();
+ }
+ else
+ {
+ switch ( pType[j] )
+ {
+ case SYMBOLTYPE_DECSEP :
+ aStr += rIntl.GetNumDecimalSep();
+ break;
+ case SYMBOLTYPE_THSEP :
+ aStr += rIntl.GetNumThousandSep();
+ break;
+ case SYMBOLTYPE_STRING :
+ if( bDontQuote )
+ aStr += pStr[j];
+ else if ( pStr[j].Len() == 1 )
+ {
+ xub_Unicode cx = pStr[j].GetChar(0);
+ switch ( cx )
+ {
+ case '+' :
+ case '-' :
+ case ' ' :
+ aStr += cx; // don't escape simple forms
+ break;
+ default:
+ aStr += '\\';
+ aStr += cx;
+ }
+ }
+ else
+ {
+ aStr += '"';
+ aStr += pStr[j];
+ aStr += '"';
+ }
+ break;
+ default:
+ aStr += pStr[j];
+ }
+
+ }
+ }
+ }
+ }
+ return aStr;
+}
+
+
+// static
+BOOL SvNumberformat::HasStringNegativeSign( const XubString& rStr )
+{
+ // fuer Sign muss '-' am Anfang oder am Ende des TeilStrings sein (Blanks ignored)
+ xub_StrLen nLen = rStr.Len();
+ if ( !nLen )
+ return FALSE;
+ const xub_Unicode* const pBeg = rStr.GetBuffer();
+ const xub_Unicode* const pEnd = pBeg + nLen;
+ register const xub_Unicode* p = pBeg;
+ do
+ { // Anfang
+ if ( *p == '-' )
+ return TRUE;
+ } while ( *p == ' ' && ++p < pEnd );
+ p = pEnd - 1;
+ do
+ { // Ende
+ if ( *p == '-' )
+ return TRUE;
+ } while ( *p == ' ' && pBeg < --p );
+ return FALSE;
+}
+
+
+// static
+void SvNumberformat::SetComment( const XubString& rStr, XubString& rFormat,
+ XubString& rComment )
+{
+ if ( rComment.Len() )
+ { // alten Kommentar aus Formatstring loeschen
+ //! nicht per EraseComment, der Kommentar muss matchen
+ XubString aTmp( '{' );
+ aTmp += ' ';
+ aTmp += rComment;
+ aTmp += ' ';
+ aTmp += '}';
+ xub_StrLen nCom = 0;
+ do
+ {
+ nCom = rFormat.Search( aTmp, nCom );
+ } while ( (nCom != STRING_NOTFOUND) && (nCom + aTmp.Len() != rFormat.Len()) );
+ if ( nCom != STRING_NOTFOUND )
+ rFormat.Erase( nCom );
+ }
+ if ( rStr.Len() )
+ { // neuen Kommentar setzen
+ rFormat += '{';
+ rFormat += ' ';
+ rFormat += rStr;
+ rFormat += ' ';
+ rFormat += '}';
+ rComment = rStr;
+ }
+}
+
+
+// static
+void SvNumberformat::EraseCommentBraces( XubString& rStr )
+{
+ xub_StrLen nLen = rStr.Len();
+ if ( nLen && rStr.GetChar(0) == '{' )
+ {
+ rStr.Erase( 0, 1 );
+ --nLen;
+ }
+ if ( nLen && rStr.GetChar(0) == ' ' )
+ {
+ rStr.Erase( 0, 1 );
+ --nLen;
+ }
+ if ( nLen && rStr.GetChar( nLen-1 ) == '}' )
+ rStr.Erase( --nLen, 1 );
+ if ( nLen && rStr.GetChar( nLen-1 ) == ' ' )
+ rStr.Erase( --nLen, 1 );
+}
+
+
+// static
+void SvNumberformat::EraseComment( XubString& rStr )
+{
+ register const xub_Unicode* p = rStr.GetBuffer();
+ BOOL bInString = FALSE;
+ BOOL bEscaped = FALSE;
+ BOOL bFound = FALSE;
+ xub_StrLen nPos;
+ while ( !bFound && *p )
+ {
+ switch ( *p )
+ {
+ case '\\' :
+ bEscaped = !bEscaped;
+ break;
+ case '\"' :
+ if ( !bEscaped )
+ bInString = !bInString;
+ break;
+ case '{' :
+ if ( !bEscaped && !bInString )
+ {
+ bFound = TRUE;
+ nPos = p - rStr.GetBuffer();
+ }
+ break;
+ }
+ if ( bEscaped && *p != '\\' )
+ bEscaped = FALSE;
+ ++p;
+ }
+ if ( bFound )
+ rStr.Erase( nPos );
+}
+
+
+// static
+BOOL SvNumberformat::IsInQuote( const XubString& rStr, xub_StrLen nPos,
+ xub_Unicode cQuote, xub_Unicode cEscIn, xub_Unicode cEscOut )
+{
+ xub_StrLen nLen = rStr.Len();
+ if ( nPos >= nLen )
+ return FALSE;
+ register const xub_Unicode* p0 = rStr.GetBuffer();
+ register const xub_Unicode* p = p0;
+ register const xub_Unicode* p1 = p0 + nPos;
+ BOOL bQuoted = FALSE;
+ while ( p <= p1 )
+ {
+ if ( *p == cQuote )
+ {
+ if ( p == p0 )
+ bQuoted = TRUE;
+ else if ( bQuoted )
+ {
+ if ( *(p-1) != cEscIn )
+ bQuoted = FALSE;
+ }
+ else
+ {
+ if ( *(p-1) != cEscOut )
+ bQuoted = TRUE;
+ }
+ }
+ p++;
+ }
+ return bQuoted;
+}
+
+
+// static
+xub_StrLen SvNumberformat::GetQuoteEnd( const XubString& rStr, xub_StrLen nPos,
+ xub_Unicode cQuote, xub_Unicode cEscIn, xub_Unicode cEscOut )
+{
+ xub_StrLen nLen = rStr.Len();
+ if ( nPos >= nLen )
+ return STRING_NOTFOUND;
+ if ( !IsInQuote( rStr, nPos, cQuote, cEscIn, cEscOut ) )
+ {
+ if ( rStr.GetChar( nPos ) == cQuote )
+ return nPos; // schliessendes cQuote
+ return STRING_NOTFOUND;
+ }
+ register const xub_Unicode* p0 = rStr.GetBuffer();
+ register const xub_Unicode* p = p0 + nPos;
+ register const xub_Unicode* p1 = p0 + nLen;
+ while ( p < p1 )
+ {
+ if ( *p == cQuote && p > p0 && *(p-1) != cEscIn )
+ return p - p0;
+ p++;
+ }
+ return nLen; // String Ende
+}
+
+
+
diff --git a/svtools/source/numbers/zforscan.cxx b/svtools/source/numbers/zforscan.cxx
new file mode 100644
index 000000000000..98eb66c83707
--- /dev/null
+++ b/svtools/source/numbers/zforscan.cxx
@@ -0,0 +1,2406 @@
+/*************************************************************************
+ *
+ * $RCSfile: zforscan.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#pragma hdrstop
+
+#include <stdlib.h>
+
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#ifndef _INTN_HXX //autogen
+#include <tools/intn.hxx>
+#endif
+#ifndef _SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+#ifndef _UNOTOOLS_CHARCLASS_HXX
+#include <unotools/charclass.hxx>
+#endif
+
+#include "iniman.hxx"
+#include "zforlist.hxx"
+#include "zformat.hxx"
+
+#define _ZFORSCAN_CXX
+#include "zforscan.hxx"
+#undef _ZFORSCAN_CXX
+
+ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP )
+{
+#ifdef DOS
+#else
+ pFormatter = pFormatterP;
+ const International* pIntl = pFormatter->GetInternational();
+ bConvertMode = FALSE;
+ //! alle Schluesselwoerter muessen aus Grossbuchstaben bestehen !!
+ // 0 bleibt leer!!
+ sKeyword[NF_KEY_E].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "E" ) ); // Exp.
+ sKeyword[NF_KEY_AMPM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "AM/PM" ) ); // AM/PM
+ sKeyword[NF_KEY_AP].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "A/P" ) ); // AM/PM
+ sKeyword[NF_KEY_MI].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "M" ) ); // Minute
+ sKeyword[NF_KEY_MMI].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MM" ) ); // Minute
+ sKeyword[NF_KEY_S].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "S" ) ); // Sekunde 2
+ sKeyword[NF_KEY_SS].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "SS" ) ); // Sekunde 02
+ sKeyword[NF_KEY_Q].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Q" ) ); // Quartal
+ sKeyword[NF_KEY_QQ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "QQ" ) ); // Quartal lang
+ sKeyword[NF_KEY_NN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "NN" ) ); // Wochentag kurz
+ sKeyword[NF_KEY_NNN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "NNN" ) ); // Wochentag lang
+ sKeyword[NF_KEY_NNNN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "NNNN" ) ); // Wochentag lang mit Sep
+ sKeyword[NF_KEY_WW].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "WW" ) ); // Kalenderwoche
+ sKeyword[NF_KEY_CCC].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "CCC" ) ); // Waehrung Bank
+ SetDependentKeywords( pIntl->GetLanguage() );
+
+ StandardColor[0] = Color(COL_BLACK);
+ StandardColor[1] = Color(COL_LIGHTBLUE);
+ StandardColor[2] = Color(COL_LIGHTGREEN);
+ StandardColor[3] = Color(COL_LIGHTCYAN);
+ StandardColor[4] = Color(COL_LIGHTRED);
+ StandardColor[5] = Color(COL_LIGHTMAGENTA);
+ StandardColor[6] = Color(COL_BROWN);
+ StandardColor[7] = Color(COL_GRAY);
+ StandardColor[8] = Color(COL_YELLOW);
+ StandardColor[9] = Color(COL_WHITE);
+
+ pNullDate = new Date(30,12,1899);
+ nStandardPrec = 2;
+
+ sCurString = pFormatter->GetCharClass()->upper( pIntl->GetCurrSymbol() );
+ sErrStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "###" ) );
+ Reset();
+#endif
+}
+
+ImpSvNumberformatScan::~ImpSvNumberformatScan()
+{
+ delete pNullDate;
+ Reset();
+}
+
+// static
+void ImpSvNumberformatScan::GetLogicalKeywords( LanguageType eLnge,
+ const xub_Unicode*& pTrue, const xub_Unicode*& pFalse )
+{
+ static const xub_Unicode pDanishTrue[] = { 'S', 'A', 'N', 'D', 0 };
+ static const xub_Unicode pDanishFalse[] = { 'F', 'A', 'L', 'S', 'K', 0 };
+ static const xub_Unicode pDutchTrue[] = { 'W', 'A', 'A', 'R', 0 };
+ static const xub_Unicode pDutchFalse[] = { 'O', 'N', 'W', 'A', 'A', 'R', 0 };
+ static const xub_Unicode pFrenchTrue[] = { 'V', 'R', 'A', 'I', 0 };
+ static const xub_Unicode pFrenchFalse[] = { 'F', 'A', 'U', 'X', 0 };
+ static const xub_Unicode pGermanTrue[] = { 'W', 'A', 'H', 'R', 0 };
+ static const xub_Unicode pGermanFalse[] = { 'F', 'A', 'L', 'S', 'C', 'H', 0 };
+ static const xub_Unicode pItalianTrue[] = { 'V', 'E', 'R', 'O', 0 };
+ static const xub_Unicode pItalianFalse[] = { 'F', 'A', 'L', 'S', 'O', 0 };
+ static const xub_Unicode pNorwegianTrue[] = { 'R', 'I', 'K', 'T', 'I', 'G', 0 };
+ static const xub_Unicode pNorwegianFalse[] = { 'G', 'A', 'L', 'T', 0 };
+ static const xub_Unicode pPortugueseTrue[] = { 'V', 'E', 'R', 'D', 'A', 'D', 'E', 'I', 'R', 'O', 0 };
+ static const xub_Unicode pPortugueseFalse[] = { 'F', 'A', 'L', 'S', 'O', 0 };
+ static const xub_Unicode pSpanishTrue[] = { 'V', 'E', 'R', 'D', 'A', 'D', 'E', 'R', 'O', 0 };
+ static const xub_Unicode pSpanishFalse[] = { 'F', 'A', 'L', 'S', 'O', 0 };
+ static const xub_Unicode pSwedishTrue[] = { 'S', 'A', 'N', 'T', 0 };
+ static const xub_Unicode pSwedishFalse[] = { 'F', 'A', 'L', 'S', 'K', 'T', 0 };
+ static const xub_Unicode pEnglishTrue[] = { 'T', 'R', 'U', 'E', 0 };
+ static const xub_Unicode pEnglishFalse[] = { 'F', 'A', 'L', 'S', 'E', 0 };
+
+ if (eLnge == LANGUAGE_SYSTEM)
+ eLnge = System::GetLanguage();
+ switch (eLnge)
+ {
+ case LANGUAGE_DANISH:
+ pTrue = pDanishTrue;
+ pFalse = pDanishFalse;
+ break;
+
+ case LANGUAGE_DUTCH :
+ case LANGUAGE_DUTCH_BELGIAN :
+ pTrue = pDutchTrue;
+ pFalse = pDutchFalse;
+ break;
+
+ case LANGUAGE_FRENCH:
+ case LANGUAGE_FRENCH_BELGIAN:
+ case LANGUAGE_FRENCH_CANADIAN:
+ case LANGUAGE_FRENCH_SWISS:
+ case LANGUAGE_FRENCH_LUXEMBOURG:
+ case LANGUAGE_FRENCH_MONACO:
+ pTrue = pFrenchTrue;
+ pFalse = pFrenchFalse;
+ break;
+
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_GERMAN_SWISS:
+ case LANGUAGE_GERMAN_AUSTRIAN:
+ case LANGUAGE_GERMAN_LUXEMBOURG:
+ case LANGUAGE_GERMAN_LIECHTENSTEIN:
+ pTrue = pGermanTrue;
+ pFalse = pGermanFalse;
+ break;
+
+ case LANGUAGE_ITALIAN:
+ case LANGUAGE_ITALIAN_SWISS:
+ pTrue = pItalianTrue;
+ pFalse = pItalianFalse;
+ break;
+
+ case LANGUAGE_NORWEGIAN:
+ case LANGUAGE_NORWEGIAN_BOKMAL:
+ case LANGUAGE_NORWEGIAN_NYNORSK:
+ pTrue = pNorwegianTrue;
+ pFalse = pNorwegianFalse;
+ break;
+
+ case LANGUAGE_PORTUGUESE:
+ case LANGUAGE_PORTUGUESE_BRAZILIAN:
+ pTrue = pPortugueseTrue;
+ pFalse = pPortugueseFalse;
+ break;
+
+ case LANGUAGE_SPANISH :
+ case LANGUAGE_SPANISH_MEXICAN :
+ case LANGUAGE_SPANISH_MODERN :
+ case LANGUAGE_SPANISH_GUATEMALA :
+ case LANGUAGE_SPANISH_COSTARICA :
+ case LANGUAGE_SPANISH_PANAMA :
+ case LANGUAGE_SPANISH_DOMINICAN_REPUBLIC :
+ case LANGUAGE_SPANISH_VENEZUELA :
+ case LANGUAGE_SPANISH_COLOMBIA :
+ case LANGUAGE_SPANISH_PERU :
+ case LANGUAGE_SPANISH_ARGENTINA :
+ case LANGUAGE_SPANISH_ECUADOR :
+ case LANGUAGE_SPANISH_CHILE :
+ case LANGUAGE_SPANISH_URUGUAY :
+ case LANGUAGE_SPANISH_PARAGUAY :
+ case LANGUAGE_SPANISH_BOLIVIA :
+ case LANGUAGE_SPANISH_EL_SALVADOR :
+ case LANGUAGE_SPANISH_HONDURAS :
+ case LANGUAGE_SPANISH_NICARAGUA :
+ case LANGUAGE_SPANISH_PUERTO_RICO :
+ pTrue = pSpanishTrue;
+ pFalse = pSpanishFalse;
+ break;
+
+ case LANGUAGE_SWEDISH:
+ pTrue = pSwedishTrue;
+ pFalse = pSwedishFalse;
+ break;
+
+ default:
+ pTrue = pEnglishTrue;
+ pFalse = pEnglishFalse;
+ break;
+ } // switch
+}
+
+
+void ImpSvNumberformatScan::SetDependentKeywords(LanguageType eLnge)
+{
+ if (eLnge == LANGUAGE_SYSTEM)
+ eLnge = System::GetLanguage();
+ switch (eLnge)
+ {
+ case LANGUAGE_GERMAN:
+ case LANGUAGE_GERMAN_SWISS:
+ case LANGUAGE_GERMAN_AUSTRIAN:
+ case LANGUAGE_GERMAN_LUXEMBOURG:
+ case LANGUAGE_GERMAN_LIECHTENSTEIN:
+ {
+ sNameStandardFormat.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Standard" ) ); //!! darf nur aus 'a'-'Z' bestehen !!
+ sKeyword[NF_KEY_GENERAL].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "STANDARD" ) ); // =sNameStandardFormat
+ // in Grossbuchstaben
+ sKeyword[NF_KEY_M].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "M" ) ); // Monat
+ sKeyword[NF_KEY_MM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MM" ) ); // Monat
+ sKeyword[NF_KEY_MMM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MMM" ) ); // Monat Jan
+ sKeyword[NF_KEY_MMMM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MMMM" ) ); // Monat Januar
+ sKeyword[NF_KEY_H].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "H" ) ); // Stunde 2
+ sKeyword[NF_KEY_HH].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "HH" ) ); // Stunde 02
+ sKeyword[NF_KEY_T].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "T" ) );
+ sKeyword[NF_KEY_TT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "TT" ) );
+ sKeyword[NF_KEY_TTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "TTT" ) );
+ sKeyword[NF_KEY_TTTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "TTTT" ) );
+ sKeyword[NF_KEY_JJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "JJ" ) );
+ sKeyword[NF_KEY_JJJJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "JJJJ" ) );
+ sKeyword[NF_KEY_QUARTER].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Quartal" ) );
+ sKeyword[NF_KEY_TRUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "WAHR" ) );
+ sKeyword[NF_KEY_FALSE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "FALSCH" ) );
+ sKeyword[NF_KEY_BOOLEAN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "LOGISCH" ) );
+ sKeyword[NF_KEY_COLOR].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "FARBE" ) );
+ sKeyword[NF_KEY_BLACK].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "SCHWARZ" ) );
+ sKeyword[NF_KEY_BLUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "BLAU" ) );
+ sKeyword[NF_KEY_GREEN] = UniString( "GR" "\xDC" "N", RTL_TEXTENCODING_ISO_8859_1 );
+ sKeyword[NF_KEY_CYAN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "CYAN" ) );
+ sKeyword[NF_KEY_RED].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "ROT" ) );
+ sKeyword[NF_KEY_MAGENTA].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MAGENTA" ) );
+ sKeyword[NF_KEY_BROWN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "BRAUN" ) );
+ sKeyword[NF_KEY_GREY].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GRAU" ) );
+ sKeyword[NF_KEY_YELLOW].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GELB" ) );
+ sKeyword[NF_KEY_WHITE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "WEISS" ) );
+ }
+ break;
+ default:
+ {
+ // Standard
+ switch ( eLnge )
+ {
+ case LANGUAGE_ENGLISH :
+ case LANGUAGE_ENGLISH_US :
+ case LANGUAGE_ENGLISH_UK :
+ case LANGUAGE_ENGLISH_AUS :
+ case LANGUAGE_ENGLISH_CAN :
+ case LANGUAGE_ENGLISH_NZ :
+ case LANGUAGE_ENGLISH_EIRE :
+ case LANGUAGE_ENGLISH_SAFRICA :
+ case LANGUAGE_ENGLISH_JAMAICA :
+ case LANGUAGE_ENGLISH_CARRIBEAN :
+ case LANGUAGE_ENGLISH_BELIZE :
+ case LANGUAGE_ENGLISH_TRINIDAD :
+ case LANGUAGE_ENGLISH_ZIMBABWE :
+ case LANGUAGE_ENGLISH_PHILIPPINES:
+ sNameStandardFormat.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "General" ) );
+ sKeyword[NF_KEY_GENERAL].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GENERAL" ) );
+ break;
+ case LANGUAGE_PORTUGUESE :
+ case LANGUAGE_SPANISH :
+ case LANGUAGE_SPANISH_MEXICAN :
+ case LANGUAGE_SPANISH_MODERN :
+ case LANGUAGE_SPANISH_GUATEMALA :
+ case LANGUAGE_SPANISH_COSTARICA :
+ case LANGUAGE_SPANISH_PANAMA :
+ case LANGUAGE_SPANISH_DOMINICAN_REPUBLIC :
+ case LANGUAGE_SPANISH_VENEZUELA :
+ case LANGUAGE_SPANISH_COLOMBIA :
+ case LANGUAGE_SPANISH_PERU :
+ case LANGUAGE_SPANISH_ARGENTINA :
+ case LANGUAGE_SPANISH_ECUADOR :
+ case LANGUAGE_SPANISH_CHILE :
+ case LANGUAGE_SPANISH_URUGUAY :
+ case LANGUAGE_SPANISH_PARAGUAY :
+ case LANGUAGE_SPANISH_BOLIVIA :
+ case LANGUAGE_SPANISH_EL_SALVADOR :
+ case LANGUAGE_SPANISH_HONDURAS :
+ case LANGUAGE_SPANISH_NICARAGUA :
+ case LANGUAGE_SPANISH_PUERTO_RICO :
+ sNameStandardFormat.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Estandar" ) );
+ sKeyword[NF_KEY_GENERAL].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "ESTANDAR" ) );
+ break;
+ case LANGUAGE_PORTUGUESE_BRAZILIAN :
+ sNameStandardFormat.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Geral" ) );
+ sKeyword[NF_KEY_GENERAL].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GERAL" ) );
+ break;
+ case LANGUAGE_FINNISH :
+ sNameStandardFormat.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Yleinen" ) );
+ sKeyword[NF_KEY_GENERAL].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "YLEINEN" ) );
+ break;
+ case LANGUAGE_DUTCH :
+ case LANGUAGE_DUTCH_BELGIAN :
+ sNameStandardFormat.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Standaard" ) );
+ sKeyword[NF_KEY_GENERAL].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "STANDAARD" ) );
+ break;
+ default:
+ sNameStandardFormat.AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Standard" ) );
+ sKeyword[NF_KEY_GENERAL].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "STANDARD" ) );
+ }
+ // Tag
+ switch ( eLnge )
+ {
+ case LANGUAGE_ITALIAN :
+ case LANGUAGE_ITALIAN_SWISS :
+ sKeyword[NF_KEY_T].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "G" ) );
+ sKeyword[NF_KEY_TT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GG" ) );
+ sKeyword[NF_KEY_TTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GGG" ) );
+ sKeyword[NF_KEY_TTTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GGGG" ) );
+ break;
+ case LANGUAGE_FRENCH :
+ case LANGUAGE_FRENCH_BELGIAN :
+ case LANGUAGE_FRENCH_CANADIAN :
+ case LANGUAGE_FRENCH_SWISS :
+ case LANGUAGE_FRENCH_LUXEMBOURG :
+ case LANGUAGE_FRENCH_MONACO :
+ sKeyword[NF_KEY_T].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "J" ) );
+ sKeyword[NF_KEY_TT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "JJ" ) );
+ sKeyword[NF_KEY_TTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "JJJ" ) );
+ sKeyword[NF_KEY_TTTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "JJJJ" ) );
+ break;
+ case LANGUAGE_FINNISH :
+ sKeyword[NF_KEY_T].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "P" ) );
+ sKeyword[NF_KEY_TT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "PP" ) );
+ sKeyword[NF_KEY_TTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "PPP" ) );
+ sKeyword[NF_KEY_TTTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "PPPP" ) );
+ break;
+ default:
+ sKeyword[NF_KEY_T].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "D" ) );
+ sKeyword[NF_KEY_TT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DD" ) );
+ sKeyword[NF_KEY_TTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDD" ) );
+ sKeyword[NF_KEY_TTTT].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "DDDD" ) );
+ }
+ // Monat
+ switch ( eLnge )
+ {
+ case LANGUAGE_FINNISH :
+ sKeyword[NF_KEY_M].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "K" ) );
+ sKeyword[NF_KEY_MM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "KK" ) );
+ sKeyword[NF_KEY_MMM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "KKK" ) );
+ sKeyword[NF_KEY_MMMM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "KKKK" ) );
+ break;
+ default:
+ sKeyword[NF_KEY_M].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "M" ) );
+ sKeyword[NF_KEY_MM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MM" ) );
+ sKeyword[NF_KEY_MMM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MMM" ) );
+ sKeyword[NF_KEY_MMMM].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MMMM" ) );
+ }
+ // Jahr
+ switch ( eLnge )
+ {
+ case LANGUAGE_ITALIAN :
+ case LANGUAGE_ITALIAN_SWISS :
+ case LANGUAGE_FRENCH :
+ case LANGUAGE_FRENCH_BELGIAN :
+ case LANGUAGE_FRENCH_CANADIAN :
+ case LANGUAGE_FRENCH_SWISS :
+ case LANGUAGE_FRENCH_LUXEMBOURG :
+ case LANGUAGE_FRENCH_MONACO :
+ case LANGUAGE_PORTUGUESE :
+ case LANGUAGE_PORTUGUESE_BRAZILIAN :
+ case LANGUAGE_SPANISH :
+ case LANGUAGE_SPANISH_MEXICAN :
+ case LANGUAGE_SPANISH_MODERN :
+ case LANGUAGE_SPANISH_GUATEMALA :
+ case LANGUAGE_SPANISH_COSTARICA :
+ case LANGUAGE_SPANISH_PANAMA :
+ case LANGUAGE_SPANISH_DOMINICAN_REPUBLIC :
+ case LANGUAGE_SPANISH_VENEZUELA :
+ case LANGUAGE_SPANISH_COLOMBIA :
+ case LANGUAGE_SPANISH_PERU :
+ case LANGUAGE_SPANISH_ARGENTINA :
+ case LANGUAGE_SPANISH_ECUADOR :
+ case LANGUAGE_SPANISH_CHILE :
+ case LANGUAGE_SPANISH_URUGUAY :
+ case LANGUAGE_SPANISH_PARAGUAY :
+ case LANGUAGE_SPANISH_BOLIVIA :
+ case LANGUAGE_SPANISH_EL_SALVADOR :
+ case LANGUAGE_SPANISH_HONDURAS :
+ case LANGUAGE_SPANISH_NICARAGUA :
+ case LANGUAGE_SPANISH_PUERTO_RICO :
+ sKeyword[NF_KEY_JJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "AA" ) );
+ sKeyword[NF_KEY_JJJJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "AAAA" ) );
+ break;
+ case LANGUAGE_DUTCH :
+ case LANGUAGE_DUTCH_BELGIAN :
+ sKeyword[NF_KEY_JJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "JJ" ) );
+ sKeyword[NF_KEY_JJJJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "JJJJ" ) );
+ break;
+ case LANGUAGE_FINNISH :
+ sKeyword[NF_KEY_JJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "VV" ) );
+ sKeyword[NF_KEY_JJJJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "VVVV" ) );
+ break;
+ default:
+ sKeyword[NF_KEY_JJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "YY" ) );
+ sKeyword[NF_KEY_JJJJ].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "YYYY" ) );
+ }
+ // Stunde
+ switch ( eLnge )
+ {
+ case LANGUAGE_DUTCH :
+ case LANGUAGE_DUTCH_BELGIAN :
+ sKeyword[NF_KEY_H].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "U" ) );
+ sKeyword[NF_KEY_HH].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "UU" ) );
+ break;
+ case LANGUAGE_FINNISH :
+ case LANGUAGE_SWEDISH :
+ case LANGUAGE_SWEDISH_FINLAND :
+ case LANGUAGE_DANISH :
+ case LANGUAGE_NORWEGIAN :
+ case LANGUAGE_NORWEGIAN_BOKMAL :
+ case LANGUAGE_NORWEGIAN_NYNORSK :
+ sKeyword[NF_KEY_H].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "T" ) );
+ sKeyword[NF_KEY_HH].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "TT" ) );
+ break;
+ default:
+ sKeyword[NF_KEY_H].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "H" ) );
+ sKeyword[NF_KEY_HH].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "HH" ) );
+ }
+ // Quartal
+ sKeyword[NF_KEY_QUARTER].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "Quarter" ) );
+ // Logisch
+ const xub_Unicode *pTrue, *pFalse;
+ GetLogicalKeywords( eLnge, pTrue, pFalse );
+ sKeyword[NF_KEY_TRUE] = pTrue;
+ sKeyword[NF_KEY_FALSE] = pFalse;
+ sKeyword[NF_KEY_BOOLEAN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "BOOLEAN" ) );
+ // Farbe
+ sKeyword[NF_KEY_COLOR].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "COLOR" ) );
+ sKeyword[NF_KEY_BLACK].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "BLACK" ) );
+ sKeyword[NF_KEY_BLUE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "BLUE" ) );
+ sKeyword[NF_KEY_GREEN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GREEN" ) );
+ sKeyword[NF_KEY_CYAN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "CYAN" ) );
+ sKeyword[NF_KEY_RED].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "RED" ) );
+ sKeyword[NF_KEY_MAGENTA].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "MAGENTA" ) );
+ sKeyword[NF_KEY_BROWN].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "BROWN" ) );
+ sKeyword[NF_KEY_GREY].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "GREY" ) );
+ sKeyword[NF_KEY_YELLOW].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "YELLOW" ) );
+ sKeyword[NF_KEY_WHITE].AssignAscii( RTL_CONSTASCII_STRINGPARAM( "WHITE" ) );
+ }
+ break;
+ }
+}
+
+
+void ImpSvNumberformatScan::ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear)
+{
+ delete pNullDate;
+ pNullDate = new Date(nDay, nMonth, nYear);
+}
+
+void ImpSvNumberformatScan::ChangeStandardPrec(short nPrec)
+{
+ nStandardPrec = nPrec;
+}
+
+Color* ImpSvNumberformatScan::GetColor(XubString& sStr)
+{
+ XubString sString = pFormatter->GetCharClass()->upper(sStr);
+ USHORT i = 0;
+ while (i < SC_MAX_ANZ_STANDARD_FARBEN &&
+ sString != sKeyword[NF_KEY_FIRSTCOLOR+i] )
+ i++;
+ if (i >= SC_MAX_ANZ_STANDARD_FARBEN)
+ {
+ const XubString& rColorWord = sKeyword[NF_KEY_COLOR];
+ xub_StrLen nPos = sString.Match(rColorWord);
+ if (nPos > 0)
+ {
+ sStr.Erase(0, nPos);
+ sStr.EraseLeadingChars();
+ sStr.EraseTrailingChars();
+ if (bConvertMode)
+ {
+ pFormatter->ChangeIntl(eNewLnge);
+ sStr.Insert(rColorWord,0); // Color -> FARBE
+ pFormatter->ChangeIntl(eTmpLnge);
+ }
+ else
+ sStr.Insert(rColorWord,0);
+ sString.Erase(0, nPos);
+ sString.EraseLeadingChars();
+ sString.EraseTrailingChars();
+
+ if ( CharClass::isAsciiNumeric( sString ) )
+ {
+ long nIndex = sString.ToInt32();
+ if (nIndex > 0 && nIndex <= 64)
+ return pFormatter->GetUserDefColor((USHORT)nIndex-1);
+ else
+ return NULL;
+ }
+ else
+ return NULL;
+ }
+ else
+ return NULL;
+ }
+ else
+ {
+ sStr.Erase();
+ if (bConvertMode)
+ {
+ pFormatter->ChangeIntl(eNewLnge);
+ sStr = sKeyword[NF_KEY_FIRSTCOLOR+i]; // red -> rot
+ pFormatter->ChangeIntl(eTmpLnge);
+ }
+ else
+ sStr = sKeyword[NF_KEY_FIRSTCOLOR+i];
+
+ return &(StandardColor[i]);
+ }
+}
+
+void ImpSvNumberformatScan::ChangeIntl()
+{
+ SetDependentKeywords(pFormatter->GetInternational()->GetLanguage());
+ sCurString = pFormatter->GetCharClass()->upper(pFormatter->GetInternational()->GetCurrSymbol());
+}
+
+USHORT ImpSvNumberformatScan::GetKeyWord(const XubString& sSymbol)
+{
+ USHORT i = NF_KEY_LASTKEYWORD; // unbedingt rueckwaerts!!
+ XubString sString = pFormatter->GetCharClass()->upper(sSymbol);
+ while (i > 0 && sString.Search(sKeyword[i]) != 0)
+ i--; // unbedingt rueckwaerts!!
+ if ( i > NF_KEY_LASTOLDKEYWORD && sString != sKeyword[i] )
+ { // vielleicht doch noch was anderes?
+ // z.B. wird neues NNN in NNNN gefunden, NNNN muss also weitersuchen
+ USHORT j = i - 1;
+ while (j > 0 && sString.Search(sKeyword[j]) != 0)
+ j--; // unbedingt rueckwaerts!!
+ if ( j )
+ return j;
+ }
+ return i; // 0 => nicht gefunden
+}
+
+//---------------------------------------------------------------------------
+// Next_Symbol
+//---------------------------------------------------------------------------
+// Zerlegt die Eingabe in Symbole fuer die weitere
+// Verarbeitung (Turing-Maschine).
+//---------------------------------------------------------------------------
+// Ausgangs Zustand = SsStart
+//---------------+-------------------+-----------------------+---------------
+// Alter Zustand | gelesenes Zeichen | Aktion | Neuer Zustand
+//---------------+-------------------+-----------------------+---------------
+// SsStart | Buchstabe | Symbol=Zeichen | SsGetWord
+// | " | Typ = String | SsGetString
+// | \ | Typ = String | SsGetChar
+// | * | Typ = Star | SsGetStar
+// | _ | Typ = Blank | SsGetBlank
+// | @ # 0 ? / . , % [ | Symbol = Zeichen; |
+// | ] ' Blank | Typ = Steuerzeichen | SsStop
+// | $ - + ( ) : | Typ = String; |
+// | | | Typ = Comment | SsStop
+// | Sonst | Symbol = Zeichen | SsStop
+//---------------|-------------------+-----------------------+---------------
+// SsGetChar | Sonst | Symbol=Zeichen | SsStop
+//---------------+-------------------+-----------------------+---------------
+// GetString | " | | SsStop
+// | Sonst | Symbol+=Zeichen | GetString
+//---------------+-------------------+-----------------------+---------------
+// SsGetWord | Buchstabe | Symbol += Zeichen |
+// | + - (E+ E-)| Symbol += Zeichen | SsStop
+// | / (AM/PM)| Symbol += Zeichen |
+// | Sonst | Pos--, if Key Typ=Word| SsStop
+//---------------+-------------------+-----------------------+---------------
+// SsGetStar | Sonst | Symbol+=Zeichen | SsStop
+// | | markiere Sonderfall * |
+//---------------+-------------------+-----------------------+---------------
+// SsGetBlank | Sonst | Symbol+=Zeichen | SsStop
+// | | markiere Sonderfall _ |
+//---------------+-------------------+-----------------------+---------------
+// Wurde im State SsGetWord ein Schluesselwort erkannt (auch als
+// Anfangsteilwort des Symbols)
+// so werden die restlichen Buchstaben zurueckgeschrieben !!
+
+enum ScanState
+{
+ SsStop = 0,
+ SsStart = 1,
+ SsGetChar = 2,
+ SsGetString = 3,
+ SsGetWord = 4,
+ SsGetStar = 5,
+ SsGetBlank = 6
+};
+
+short ImpSvNumberformatScan::Next_Symbol( const XubString& rStr,
+ xub_StrLen& nPos, XubString& sSymbol )
+{
+ const CharClass* pChrCls = pFormatter->GetCharClass();
+ const xub_StrLen nStart = nPos;
+ short eType;
+ ScanState eState = SsStart;
+ sSymbol.Erase();
+ while ( nPos < rStr.Len() && eState != SsStop )
+ {
+ xub_Unicode cToken = rStr.GetChar( nPos++ );
+ switch (eState)
+ {
+ case SsStart:
+ {
+ switch (cToken)
+ {
+ case '#':
+ case '0':
+ case '?':
+ case '%':
+ case '@':
+ case '[':
+ case ']':
+ case ',':
+ case '.':
+ case '/':
+ case '\'':
+ case ' ':
+ case ':':
+ case '-':
+ {
+ eType = SYMBOLTYPE_DEL;
+ sSymbol += cToken;
+ eState = SsStop;
+ }
+ break;
+ case '*':
+ {
+ eType = SYMBOLTYPE_STAR;
+ sSymbol += cToken;
+ eState = SsGetStar;
+ }
+ break;
+ case '_':
+ {
+ eType = SYMBOLTYPE_BLANK;
+ sSymbol += cToken;
+ eState = SsGetBlank;
+ }
+ break;
+#if NF_COMMENT_IN_FORMATSTRING
+ case '{':
+ eType = SYMBOLTYPE_COMMENT;
+ eState = SsStop;
+ sSymbol.Append( rStr.GetBuffer() + (nPos-1), rStr.Len() - (nPos-1) );
+ nPos = rStr.Len();
+ break;
+#endif
+ case '"':
+ eType = SYMBOLTYPE_STRING;
+ eState = SsGetString;
+ sSymbol += cToken;
+ break;
+ case '\\':
+ eType = SYMBOLTYPE_STRING;
+ eState = SsGetChar;
+ sSymbol += cToken;
+ break;
+ case '$':
+ case '+':
+ case '(':
+ case ')':
+ eType = SYMBOLTYPE_STRING;
+ eState = SsStop;
+ sSymbol += cToken;
+ break;
+ default :
+ {
+ if ( pChrCls->isLetter( rStr, nPos-1 ) )
+ eState = SsGetWord;
+ else
+ {
+ eType = SYMBOLTYPE_STRING;
+ eState = SsStop;
+ }
+ sSymbol += cToken;
+ }
+ break;
+ }
+ }
+ break;
+ case SsGetChar:
+ {
+ sSymbol += cToken;
+ eState = SsStop;
+ }
+ break;
+ case SsGetString:
+ {
+ if (cToken == '"')
+ eState = SsStop;
+// else
+ sSymbol += cToken;
+ }
+ break;
+ case SsGetWord:
+ {
+ if ( pChrCls->isLetter( rStr, nPos-1 ) )
+ sSymbol += cToken;
+ else
+ {
+ BOOL bDontStop = FALSE;
+ switch (cToken)
+ {
+ case '+':
+ case '-': // E+ E-
+ {
+ eType = GetKeyWord(sSymbol);
+ if (eType == NF_KEY_E)
+ {
+ sSymbol += cToken;
+ eState = SsStop;
+ }
+ }
+ break;
+ case '.': // Sf. Waehrung
+ {
+ XubString TestStr = pChrCls->upper(sSymbol);
+ TestStr += cToken;
+ if ( TestStr == sCurString )
+ {
+ sSymbol += cToken;
+ eState = SsStop;
+ eType = SYMBOLTYPE_STRING;
+ }
+ }
+ break;
+ case '/': // AM/PM, A/P
+ {
+ sal_Unicode cNext = rStr.GetChar(nPos);
+ if ( cNext == 'P' || cNext == 'p' )
+ {
+ xub_StrLen nLen = sSymbol.Len();
+ if ( 1 <= nLen
+ && (sSymbol.GetChar(0) == 'A' || sSymbol.GetChar(0) == 'a')
+ && (nLen == 1 || (nLen == 2
+ && (sSymbol.GetChar(1) == 'M' || sSymbol.GetChar(1) == 'm')
+ && (rStr.GetChar(nPos+1) == 'M' || rStr.GetChar(nPos+1) == 'm'))) )
+ {
+ sSymbol += cToken;
+ bDontStop = TRUE;
+ }
+ }
+ }
+ break;
+ }
+ // anything not recognized will stop the scan
+ if ( eState != SsStop && !bDontStop )
+ {
+ eState = SsStop;
+ nPos--;
+ eType = GetKeyWord(sSymbol);
+ if (!eType)
+ eType = SYMBOLTYPE_STRING;
+ else
+ {
+ xub_StrLen nLen = sKeyword[eType].Len();
+ if ( nPos > nStart + nLen )
+ {
+ nPos = nStart + nLen;
+ sSymbol.Erase( nLen );
+ }
+ }
+ }
+ }
+ }
+ break;
+ case SsGetStar:
+ {
+ eState = SsStop;
+ sSymbol += cToken;
+ nRepPos = (nPos - nStart) - 1; // immer > 0!!
+ }
+ break;
+ case SsGetBlank:
+ {
+ eState = SsStop;
+ sSymbol += cToken;
+ }
+ break;
+ default:
+ break;
+ } // of switch
+ } // of while
+ if (eState == SsGetWord)
+ {
+ eType = GetKeyWord(sSymbol);
+ if ( eType )
+ {
+ xub_StrLen nLen = sKeyword[eType].Len();
+ if ( nPos > nStart + nLen )
+ {
+ nPos = nStart + nLen;
+ sSymbol.Erase( nLen );
+ }
+ }
+ else
+ {
+ eType = SYMBOLTYPE_STRING;
+ // #77026# And now for the Xcl perverts: a word containing the
+ // GENERAL keyword somewhere must be splitted.
+ if ( sSymbol.Len() > sKeyword[NF_KEY_GENERAL].Len() )
+ {
+ XubString aUp( pFormatter->GetCharClass()->upper( sSymbol ) );
+ xub_StrLen nFound = aUp.Search( sKeyword[NF_KEY_GENERAL], 1 );
+ if ( nFound != STRING_NOTFOUND )
+ {
+ nPos = nStart + nFound;
+ sSymbol.Erase( nFound );
+ }
+ }
+ }
+ }
+ return eType;
+}
+
+xub_StrLen ImpSvNumberformatScan::Symbol_Division(const XubString& rString)
+{
+ nCurrPos = STRING_NOTFOUND;
+ // Ist Waehrung im Spiel?
+ XubString sString = pFormatter->GetCharClass()->upper(rString);
+ xub_StrLen nCPos = 0;
+ while (nCPos != STRING_NOTFOUND)
+ {
+ nCPos = sString.Search(sCurString,nCPos);
+ if (nCPos != STRING_NOTFOUND)
+ {
+ // in Quotes?
+ xub_StrLen nQ = SvNumberformat::GetQuoteEnd( sString, nCPos );
+ if ( nQ == STRING_NOTFOUND )
+ {
+ xub_Unicode c;
+ if ( nCPos == 0 ||
+ ((c = sString.GetChar(xub_StrLen(nCPos-1))) != '"'
+ && c != '\\') ) // dm kann durch "dm
+ { // \d geschuetzt werden
+ nCurrPos = nCPos;
+ nCPos = STRING_NOTFOUND; // Abbruch
+ }
+ else
+ nCPos++; // weitersuchen
+ }
+ else
+ nCPos = nQ + 1; // weitersuchen
+ }
+ }
+ nAnzStrings = 0;
+ BOOL bStar = FALSE; // wird bei '*'Detektion gesetzt
+ Reset();
+ const International* pIntl = pFormatter->GetInternational();
+ cOldDecSep = pIntl->GetNumDecimalSep();
+ cOldThousandSep = pIntl->GetNumThousandSep();
+ cOldDateSep = pIntl->GetDateSep();
+ cOldTimeSep = pIntl->GetTimeSep();
+
+ // Wenn der Tausender-Trenner ein Non-Breaking Space ist (franzoesisch), mit
+ // einfachem Space weiterarbeiten, damit die Abfragen auf Space funktionieren.
+ // Der Format-String wird angepasst, so dass beides erlaubt ist.
+ // Fuer die Ausgabe des Format-Strings wird das Zeichen vom International genommen.
+
+ if ( cOldThousandSep == 0xA0 )
+ cOldThousandSep = ' ';
+
+ xub_StrLen nPos = 0;
+ const xub_StrLen nLen = rString.Len();
+ while (nPos < nLen && nAnzStrings < SC_MAX_ANZ_FORMAT_STRINGS)
+ {
+ nTypeArray[nAnzStrings] = Next_Symbol(rString, nPos, sStrArray[nAnzStrings]);
+ if (nTypeArray[nAnzStrings] == SYMBOLTYPE_STAR)
+ { // Ueberwachung des '*'
+ if (bStar)
+ return nPos; // Fehler: doppelter '*'
+ else
+ bStar = TRUE;
+ }
+ nAnzStrings++;
+ }
+
+ return 0; // 0 => ok
+}
+
+void ImpSvNumberformatScan::SkipStrings(USHORT& i, xub_StrLen& nPos)
+{
+ while (i < nAnzStrings && ( nTypeArray[i] == SYMBOLTYPE_STRING
+ || nTypeArray[i] == SYMBOLTYPE_BLANK
+ || nTypeArray[i] == SYMBOLTYPE_STAR) )
+ {
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+}
+
+
+USHORT ImpSvNumberformatScan::PreviousKeyword(USHORT i)
+{
+ short res = 0;
+ if (i > 0 && i < nAnzStrings)
+ {
+ i--;
+ while (i > 0 && nTypeArray[i] <= 0)
+ i--;
+ if (nTypeArray[i] > 0)
+ res = nTypeArray[i];
+ }
+ return res;
+}
+
+USHORT ImpSvNumberformatScan::NextKeyword(USHORT i)
+{
+ short res = 0;
+ if (i < nAnzStrings-1)
+ {
+ i++;
+ while (i < nAnzStrings-1 && nTypeArray[i] <= 0)
+ i++;
+ if (nTypeArray[i] > 0)
+ res = nTypeArray[i];
+ }
+ return res;
+}
+
+short ImpSvNumberformatScan::PreviousType( USHORT i )
+{
+ if ( i > 0 && i < nAnzStrings )
+ {
+ do
+ {
+ i--;
+ } while ( i > 0 && nTypeArray[i] == SYMBOLTYPE_EMPTY );
+ return nTypeArray[i];
+ }
+ return 0;
+}
+
+xub_Unicode ImpSvNumberformatScan::PreviousChar(USHORT i)
+{
+ xub_Unicode res = ' ';
+ if (i > 0 && i < nAnzStrings)
+ {
+ i--;
+ while (i > 0 && ( nTypeArray[i] == SYMBOLTYPE_EMPTY
+ || nTypeArray[i] == SYMBOLTYPE_STRING
+ || nTypeArray[i] == SYMBOLTYPE_STAR
+ || nTypeArray[i] == SYMBOLTYPE_BLANK ) )
+ i--;
+ if (sStrArray[i].Len() > 0)
+ res = sStrArray[i].GetChar(xub_StrLen(sStrArray[i].Len()-1));
+ }
+ return res;
+}
+
+xub_Unicode ImpSvNumberformatScan::NextChar(USHORT i)
+{
+ xub_Unicode res = ' ';
+ if (i < nAnzStrings-1)
+ {
+ i++;
+ while (i < nAnzStrings-1 &&
+ ( nTypeArray[i] == SYMBOLTYPE_EMPTY
+ || nTypeArray[i] == SYMBOLTYPE_STRING
+ || nTypeArray[i] == SYMBOLTYPE_STAR
+ || nTypeArray[i] == SYMBOLTYPE_BLANK))
+ i++;
+ if (sStrArray[i].Len() > 0)
+ res = sStrArray[i].GetChar(0);
+ }
+ return res;
+}
+
+BOOL ImpSvNumberformatScan::IsLastBlankBeforeFrac(USHORT i)
+{
+ BOOL res = TRUE;
+ if (i < nAnzStrings-1)
+ {
+ BOOL bStop = FALSE;
+ i++;
+ while (i < nAnzStrings-1 && !bStop)
+ {
+ i++;
+ if ( nTypeArray[i] == SYMBOLTYPE_DEL &&
+ sStrArray[i].GetChar(0) == '/')
+ bStop = TRUE;
+ else if ( nTypeArray[i] == SYMBOLTYPE_DEL &&
+ sStrArray[i].GetChar(0) == ' ')
+ res = FALSE;
+ }
+ if (!bStop) // kein '/'
+ res = FALSE;
+ }
+ else
+ res = FALSE; // kein '/' mehr
+
+ return res;
+}
+
+void ImpSvNumberformatScan::Reset()
+{
+ nAnzStrings = 0;
+ nAnzResStrings = 0;
+#if 0
+// ER 20.06.97 14:05 nicht noetig, wenn nAnzStrings beachtet wird
+ for (USHORT i = 0; i < SC_MAX_ANZ_FORMAT_STRINGS; i++)
+ {
+ sStrArray[i].Erase();
+ nTypeArray[i] = 0;
+ }
+#endif
+ eScannedType = NUMBERFORMAT_UNDEFINED;
+ nRepPos = 0;
+ bExp = FALSE;
+ bThousand = FALSE;
+ nThousand = 0;
+ bDecSep = FALSE;
+ nDecPos = -1;
+ nExpPos = (USHORT) -1;
+ nBlankPos = (USHORT) -1;
+ nCntPre = 0;
+ nCntPost = 0;
+ nCntExp = 0;
+ bFrac = FALSE;
+ bBlank = FALSE;
+}
+
+xub_StrLen ImpSvNumberformatScan::ScanType(const XubString& rString)
+{
+ xub_StrLen nPos = 0;
+ USHORT i = 0; // durchlaeuft die Symbole
+ short eNewType; // neu erkannter Typ
+
+ SkipStrings(i, nPos); // Ausgabestrings ueberlesen
+ while (i < nAnzStrings)
+ {
+ if (nTypeArray[i] > 0) // Schluesselwort
+ {
+ switch (nTypeArray[i])
+ {
+ case NF_KEY_E: // E
+ eNewType = NUMBERFORMAT_SCIENTIFIC;
+ break;
+ case NF_KEY_AMPM: // AM,A,PM,P
+ case NF_KEY_AP:
+ case NF_KEY_H: // H
+ case NF_KEY_HH: // HH
+ case NF_KEY_SS: // SS
+ eNewType = NUMBERFORMAT_TIME;
+ break;
+ case NF_KEY_S: // S(Sonderf. S Schilling)
+ {
+/*
+ if (eScannedType != NUMBERFORMAT_TIME &&
+ ( pFormatter->GetInternational()->GetLanguage() == LANGUAGE_GERMAN_AUSTRIAN ||
+ eNewLnge == LANGUAGE_GERMAN_AUSTRIAN) )
+ {
+ xub_Unicode cChar = PreviousChar(i);
+ if (cChar == '[') // nur [s],0 am Anfang!
+ eNewType = NUMBERFORMAT_TIME;
+ else
+ eNewType = NUMBERFORMAT_UNDEFINED;
+ }
+ else
+*/
+ eNewType = NUMBERFORMAT_TIME;
+ }
+ break;
+ case NF_KEY_M: // M
+ case NF_KEY_MM: // MM
+ { // Sonderfall: Minute oder Monat
+ USHORT nIndexPre = PreviousKeyword(i);
+ USHORT nIndexNex = NextKeyword(i);
+ xub_Unicode cChar = PreviousChar(i);
+ if (nIndexPre == NF_KEY_H || // H
+ nIndexPre == NF_KEY_HH || // HH
+ nIndexNex == NF_KEY_S || // S
+ nIndexNex == NF_KEY_SS || // SS
+ cChar == '[' ) // [M
+ {
+ eNewType = NUMBERFORMAT_TIME;
+ nTypeArray[i] -= 2; // 6 -> 4, 7 -> 5
+ }
+ else
+ eNewType = NUMBERFORMAT_DATE;
+ }
+ break;
+ case NF_KEY_MMM: // MMM
+ case NF_KEY_MMMM: // MMMM
+ case NF_KEY_Q: // Q
+ case NF_KEY_QQ: // QQ
+ case NF_KEY_T: // T
+ case NF_KEY_TT: // TT
+ case NF_KEY_TTT: // TTT
+ case NF_KEY_TTTT: // TTTT
+ case NF_KEY_JJ: // JJ
+ case NF_KEY_JJJJ: // JJJ
+ case NF_KEY_NN: // NN
+ case NF_KEY_NNN: // NNN
+ case NF_KEY_NNNN: // NNNN
+ case NF_KEY_WW : // WW
+ eNewType = NUMBERFORMAT_DATE;
+ break;
+ case NF_KEY_CCC: // CCC
+ eNewType = NUMBERFORMAT_CURRENCY;
+ break;
+ case NF_KEY_GENERAL: // Standard
+ eNewType = NUMBERFORMAT_NUMBER;
+ break;
+ default:
+ eNewType = NUMBERFORMAT_UNDEFINED;
+ break;
+ }
+ }
+ else // Steuerzeichen
+ {
+ switch ( sStrArray[i].GetChar(0) )
+ {
+ case '#':
+ case '?':
+ eNewType = NUMBERFORMAT_NUMBER;
+ break;
+ case '0':
+ {
+ if (eScannedType == NUMBERFORMAT_TIME)
+ {
+ USHORT nIndexPre = PreviousKeyword(i);
+ if ((nIndexPre == NF_KEY_S || nIndexPre == NF_KEY_SS)
+ && bDecSep) // S, SS ','
+ eNewType = NUMBERFORMAT_TIME;
+ else
+ return nPos; // Fehler
+ }
+ else
+ eNewType = NUMBERFORMAT_NUMBER;
+ }
+ break;
+ case ',':
+ case '.':
+ {
+ bDecSep = TRUE; // fuer SS,0
+ eNewType = NUMBERFORMAT_UNDEFINED;
+ }
+ break;
+ case '%':
+ eNewType = NUMBERFORMAT_PERCENT;
+ break;
+ case '/':
+ eNewType = NUMBERFORMAT_FRACTION;
+ break;
+ case '[':
+ {
+ if ( i < nAnzStrings-1 &&
+ nTypeArray[i+1] == SYMBOLTYPE_STRING &&
+ sStrArray[i+1].GetChar(0) == '$' )
+ {
+ eNewType = NUMBERFORMAT_CURRENCY;
+ }
+ else
+ {
+ USHORT nIndexNex = NextKeyword(i);
+ if (nIndexNex == NF_KEY_H || // H
+ nIndexNex == NF_KEY_HH || // HH
+ nIndexNex == NF_KEY_M || // M
+ nIndexNex == NF_KEY_MM || // MM
+ nIndexNex == NF_KEY_S || // S
+ nIndexNex == NF_KEY_SS ) // SS
+ eNewType = NUMBERFORMAT_TIME;
+ else
+ return nPos; // Fehler
+ }
+ }
+ break;
+ case '@':
+ eNewType = NUMBERFORMAT_TEXT;
+ break;
+ default:
+ eNewType = NUMBERFORMAT_UNDEFINED;
+ break;
+ }
+ }
+ if (eScannedType == NUMBERFORMAT_UNDEFINED)
+ eScannedType = eNewType;
+ else if (eScannedType == NUMBERFORMAT_TEXT || eNewType == NUMBERFORMAT_TEXT)
+ eScannedType = NUMBERFORMAT_TEXT; // Text bleibt immer Text
+ else if (eNewType == NUMBERFORMAT_UNDEFINED)
+ { // bleibt wie bisher
+ }
+ else if (eScannedType != eNewType)
+ {
+ switch (eScannedType)
+ {
+ case NUMBERFORMAT_DATE:
+ {
+ switch (eNewType)
+ {
+ case NUMBERFORMAT_TIME:
+ eScannedType = NUMBERFORMAT_DATETIME;
+ break;
+ case NUMBERFORMAT_FRACTION: // DD/MM
+ break;
+ default:
+ {
+ if (nCurrPos != STRING_NOTFOUND)
+ eScannedType = NUMBERFORMAT_UNDEFINED;
+ else if ( sStrArray[i].GetChar(0) != cOldDateSep )
+ return nPos;
+ }
+ }
+ }
+ break;
+ case NUMBERFORMAT_TIME:
+ {
+ switch (eNewType)
+ {
+ case NUMBERFORMAT_DATE:
+ eScannedType = NUMBERFORMAT_DATETIME;
+ break;
+ case NUMBERFORMAT_FRACTION: // MM/SS
+ break;
+ default:
+ {
+ if (nCurrPos != STRING_NOTFOUND)
+ eScannedType = NUMBERFORMAT_UNDEFINED;
+ else if ( sStrArray[i].GetChar(0) != cOldTimeSep )
+ return nPos;
+ }
+ }
+ }
+ break;
+ case NUMBERFORMAT_DATETIME:
+ {
+ switch (eNewType)
+ {
+ case NUMBERFORMAT_TIME:
+ case NUMBERFORMAT_DATE:
+ break;
+ case NUMBERFORMAT_FRACTION: // DD/MM
+ break;
+ default:
+ {
+ if (nCurrPos != STRING_NOTFOUND)
+ eScannedType = NUMBERFORMAT_UNDEFINED;
+ else if ( sStrArray[i].GetChar(0) != cOldDateSep
+ && sStrArray[i].GetChar(0) != cOldTimeSep )
+ return nPos;
+ }
+ }
+ }
+ break;
+ case NUMBERFORMAT_PERCENT:
+ {
+ switch (eNewType)
+ {
+ case NUMBERFORMAT_NUMBER: // nur Zahl nach Prozent
+ break;
+ default:
+ return nPos;
+ }
+ }
+ break;
+ case NUMBERFORMAT_SCIENTIFIC:
+ {
+ switch (eNewType)
+ {
+ case NUMBERFORMAT_NUMBER: // nur Zahl nach E
+ break;
+ default:
+ return nPos;
+ }
+ }
+ break;
+ case NUMBERFORMAT_NUMBER:
+ {
+ switch (eNewType)
+ {
+ case NUMBERFORMAT_SCIENTIFIC:
+ case NUMBERFORMAT_PERCENT:
+ case NUMBERFORMAT_FRACTION:
+ case NUMBERFORMAT_CURRENCY:
+ eScannedType = eNewType;
+ break;
+ default:
+ if (nCurrPos != STRING_NOTFOUND)
+ eScannedType = NUMBERFORMAT_UNDEFINED;
+ else
+ return nPos;
+ }
+ }
+ break;
+ case NUMBERFORMAT_FRACTION:
+ {
+ switch (eNewType)
+ {
+ case NUMBERFORMAT_NUMBER: // nur Zahl nach Bruch
+ break;
+ default:
+ return nPos;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ nPos += sStrArray[i].Len(); // Korrekturposition
+ i++;
+ SkipStrings(i, nPos);
+ }
+ if (bConvertMode) // hier muss Spr./Land ggfs.
+ { // gewechselt werden
+ pFormatter->ChangeIntl(eNewLnge);
+ }
+
+ if ((eScannedType == NUMBERFORMAT_NUMBER || eScannedType == NUMBERFORMAT_UNDEFINED)
+ && nCurrPos != STRING_NOTFOUND)
+ // Check, ob DM
+ eScannedType = NUMBERFORMAT_CURRENCY;
+/*
+ XubString sString = pFormatter->GetCharClass()->upper(rString);
+ USHORT nCPos = 0;
+ while (nCPos != STRING_NOTFOUND)
+ {
+ nCPos = sString.Search(sCurString,nCPos);
+ if (nCPos != STRING_NOTFOUND)
+ {
+ if ( nCPos == 0 ||
+ (nCPos > 0 && sString[(USHORT)(nCPos-1)] != '"'
+ && sString[(USHORT)(nCPos-1)] != '\\') )// dm kann durch "dm
+ { // \d geschuetzt werden
+ eScannedType = NUMBERFORMAT_CURRENCY;
+ nCPos = STRING_NOTFOUND; // Abbruch
+ }
+ else
+ nCPos++; // weitersuchen
+ }
+ }
+ }
+*/
+ if (eScannedType == NUMBERFORMAT_UNDEFINED)
+ eScannedType = NUMBERFORMAT_DEFINED;
+// eScannedType = NUMBERFORMAT_TEXT;
+ return 0; // Alles ok
+}
+
+xub_StrLen ImpSvNumberformatScan::FinalScan( XubString& rString, XubString& rComment )
+{
+ const International* pIntl = pFormatter->GetInternational();
+
+ xub_StrLen nPos = 0; // Korrekturposition
+ USHORT i = 0; // durchlaeuft die Symbole
+ USHORT nCounter = 0; // Zaehlt Ziffern
+ nAnzResStrings = nAnzStrings; // Zaehlt uebrigbleibende Symbole
+ bDecSep = FALSE; // falls schon in TypeCeck benutzt
+
+ switch (eScannedType)
+ {
+ case NUMBERFORMAT_TEXT:
+ case NUMBERFORMAT_DEFINED:
+ {
+ while (i < nAnzStrings)
+ {
+ switch (nTypeArray[i])
+ {
+ case SYMBOLTYPE_BLANK:
+ case SYMBOLTYPE_STAR:
+ break;
+ case SYMBOLTYPE_COMMENT:
+ {
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ SvNumberformat::EraseCommentBraces( rStr );
+ rComment += rStr;
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ }
+ break;
+ case NF_KEY_GENERAL : // #77026# "General" is the same as "@"
+ break;
+ default:
+ {
+ if ( nTypeArray[i] != SYMBOLTYPE_DEL ||
+ sStrArray[i].GetChar(0) != '@' )
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ }
+ break;
+ }
+ nPos += sStrArray[i].Len();
+ i++;
+ } // of while
+ }
+ break;
+ case NUMBERFORMAT_NUMBER:
+ case NUMBERFORMAT_PERCENT:
+ case NUMBERFORMAT_CURRENCY:
+ case NUMBERFORMAT_SCIENTIFIC:
+ case NUMBERFORMAT_FRACTION:
+ {
+ xub_Unicode cThousandFill = ' ';
+ while (i < nAnzStrings)
+ {
+ if (eScannedType == NUMBERFORMAT_FRACTION && // Sonderfall
+ nTypeArray[i] == SYMBOLTYPE_DEL && // # ### #/#
+ cOldThousandSep == ' ' && // Frankreich
+ sStrArray[i].GetChar(0) == ' ' && // Schweden
+ !bFrac &&
+ IsLastBlankBeforeFrac(i) )
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING; // del->string
+ } // kein Taus.p.
+
+
+ if (nTypeArray[i] == SYMBOLTYPE_BLANK ||
+ nTypeArray[i] == SYMBOLTYPE_STAR ||
+ nTypeArray[i] == NF_KEY_CCC || // CCC
+ nTypeArray[i] == NF_KEY_GENERAL ) // Standard
+ {
+ if (nTypeArray[i] == NF_KEY_GENERAL)
+ {
+ nThousand = FLAG_STANDARD_IN_FORMAT;
+ if ( bConvertMode )
+ sStrArray[i] = sNameStandardFormat;
+ }
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ else if (nTypeArray[i] == SYMBOLTYPE_STRING || // Strings oder
+ nTypeArray[i] > 0) // Keywords
+ {
+ if (eScannedType == NUMBERFORMAT_SCIENTIFIC &&
+ nTypeArray[i] == NF_KEY_E) // E+
+ {
+ if (bExp) // doppelt
+ return nPos;
+ bExp = TRUE;
+ nExpPos = i;
+ if (bDecSep)
+ nCntPost = nCounter;
+ else
+ nCntPre = nCounter;
+ nCounter = 0;
+ nTypeArray[i] = SYMBOLTYPE_EXP;
+ }
+ else if (eScannedType == NUMBERFORMAT_FRACTION &&
+ sStrArray[i].GetChar(0) == ' ')
+ {
+ if (!bBlank && !bFrac) // nicht doppelt oder hinter /
+ {
+ if (bDecSep && nCounter > 0) // Nachkommastellen
+ return nPos; // Fehler
+ bBlank = TRUE;
+ nBlankPos = i;
+ nCntPre = nCounter;
+ nCounter = 0;
+ }
+ nTypeArray[i] = SYMBOLTYPE_FRACBLANK;
+ }
+ else
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ else if (nTypeArray[i] == SYMBOLTYPE_DEL)
+ {
+ xub_Unicode cHere = sStrArray[i].GetChar(0);
+ switch ( cHere )
+ {
+ case '#':
+ case '0':
+ case '?':
+ {
+ if (nThousand > 0) // #... #
+ return nPos; // Fehler
+ else if (bFrac && cHere == '0')
+ return nPos; // 0 im Nenner
+ nTypeArray[i] = SYMBOLTYPE_DIGIT;
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ i++;
+ nCounter++;
+ while (i < nAnzStrings &&
+ (sStrArray[i].GetChar(0) == '#' ||
+ sStrArray[i].GetChar(0) == '0' ||
+ sStrArray[i].GetChar(0) == '?')
+ )
+ {
+ rStr += sStrArray[i];
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ nCounter++;
+ i++;
+ }
+ }
+ break;
+ case '-':
+ {
+ if ( bDecSep && nDecPos < i &&
+ nTypeArray[nDecPos] == SYMBOLTYPE_DECSEP )
+ { // "0,--"
+ nTypeArray[i] = SYMBOLTYPE_DIGIT;
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ i++;
+ nCounter++;
+ while (i < nAnzStrings &&
+ (sStrArray[i].GetChar(0) == '-') )
+ {
+ rStr += sStrArray[i];
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ nCounter++;
+ i++;
+ }
+ }
+ else
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ }
+ break;
+ case '.':
+ case ',':
+ case '\'':
+ case ' ':
+ {
+ xub_Unicode cSep = cHere; // merken
+ if ( cSep == cOldThousandSep)
+ {
+ if (bConvertMode)
+ {
+ cSep = pIntl->GetNumThousandSep();
+ sStrArray[i].SetChar( 0, cSep );
+ }
+ xub_Unicode cPre = PreviousChar(i); // letzter Buchst.
+ // vorher (skipt empty)
+ xub_Unicode cNext;
+ if (bExp || bBlank || bFrac)
+ { // hinter E, / oder ' '
+ if (cOldThousandSep != ' ')
+ {
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++; // weg damit
+ }
+ else
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ }
+ else if (i > 0 && i < nAnzStrings-1 &&
+ (cPre == '#' || cPre == '0') &&
+ ((cNext = NextChar(i)) == '#' || cNext == '0')
+ ) // #.#
+ {
+ nPos += sStrArray[i].Len();
+ if (!bThousand) // nur einmal
+ {
+ // hart setzen, falls Non-Breaking Space
+ sStrArray[i].Replace( 0, 1, pIntl->GetNumThousandSep() );
+ nTypeArray[i] = SYMBOLTYPE_THSEP;
+ bThousand = TRUE;
+ cThousandFill = sStrArray[i+1].GetChar(0);
+ }
+ else // weg damit
+ {
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ }
+ i++;
+ }
+ else if (i > 0 && (cPre == '#' || cPre == '0')
+ && PreviousType(i) == SYMBOLTYPE_DIGIT
+ && nThousand < FLAG_STANDARD_IN_FORMAT )
+ { // #....
+ if ( cOldThousandSep == ' ' )
+ { // die spinnen, die Franzosen..
+ BOOL bFirst = TRUE;
+ XubString& rStr = sStrArray[i];
+ // hart setzen, Non-Breaking Space
+ xub_Unicode cSepF = pIntl->GetNumThousandSep();
+ while ( i < nAnzStrings
+ && sStrArray[i].GetChar(0) ==
+ cOldThousandSep
+ && NextChar(i) == cOldThousandSep )
+ { // letzter ist Space oder es folgt
+ // noch ein Space => TausenderSep
+ nPos += sStrArray[i].Len();
+ if ( bFirst )
+ {
+ bFirst = FALSE;
+ rStr.Replace( 0, 1, cSepF );
+ nTypeArray[i] = SYMBOLTYPE_THSEP;
+ }
+ else
+ {
+ rStr += cSepF;
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ }
+ nThousand++;
+ i++;
+ }
+ if ( i < nAnzStrings-1
+ && sStrArray[i].GetChar(0) ==
+ cOldThousandSep )
+ { // hinter letztem Space ist was
+ // => Space wenn Waehrung enthalten,
+ // sonst TausenderSep
+ nPos += sStrArray[i].Len();
+ if ( (nPos <= nCurrPos &&
+ nCurrPos < nPos + sStrArray[i+1].Len())
+ || nTypeArray[i+1] == NF_KEY_CCC
+ || (i < nAnzStrings-2 &&
+ sStrArray[i+1].GetChar(0) == '[' &&
+ sStrArray[i+2].GetChar(0) == '$') )
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ }
+ else
+ {
+ if ( bFirst )
+ {
+ bFirst = FALSE;
+ rStr.Replace( 0, 1, cSepF );
+ nTypeArray[i] = SYMBOLTYPE_THSEP;
+ }
+ else
+ {
+ rStr += cSepF;
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ }
+ nThousand++;
+ }
+ i++;
+ }
+ }
+ else
+ {
+ nTypeArray[i] = SYMBOLTYPE_THSEP;
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ i++;
+ nThousand++;
+ while (i < nAnzStrings &&
+ sStrArray[i].GetChar(0) ==
+ cOldThousandSep)
+ {
+ nThousand++;
+ rStr += cSep;
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++;
+ }
+ }
+ }
+ else // irgendwelche .
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ i++;
+ while (i < nAnzStrings &&
+ sStrArray[i].GetChar(0) ==
+ cOldThousandSep)
+ {
+ rStr += sStrArray[i];
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++;
+ }
+ }
+ }
+ else if ( cSep == cOldDecSep)
+ { // Dezimalzeichen
+ if (bConvertMode)
+ {
+ cSep = pIntl->GetNumDecimalSep();
+ sStrArray[i].Replace( 0, 1, cSep );
+ }
+ if (bBlank || bFrac) // , hinter /, ' '
+ return nPos; // Fehler
+ else if (bExp) // hinter dem E
+ {
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++; // weg damit
+ }
+ else if (bDecSep) // irgendwelche ,
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ i++;
+ while (i < nAnzStrings &&
+ sStrArray[i].GetChar(0) ==
+ cOldDecSep)
+ {
+ rStr += sStrArray[i];
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++;
+ }
+ }
+ else
+ {
+ nTypeArray[i] = SYMBOLTYPE_DECSEP;
+ bDecSep = TRUE;
+ nDecPos = i;
+ nCntPre = nCounter;
+ nCounter = 0;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ } // of else = DecSep
+ else // . ohne Bedeutung
+ {
+ if (cSep == ' ' &&
+ eScannedType == NUMBERFORMAT_FRACTION &&
+ sStrArray[i].GetChar(0) == ' ')
+ {
+ if (!bBlank && !bFrac) // nicht doppelt
+ { // oder hinter /
+ if (bDecSep && nCounter > 0)// Nachkom.
+ return nPos; // Fehler
+ bBlank = TRUE;
+ nBlankPos = i;
+ nCntPre = nCounter;
+ nCounter = 0;
+ }
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ }
+ else
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ i++;
+ while (i < nAnzStrings &&
+ sStrArray[i].GetChar(0) == cSep)
+ {
+ rStr += sStrArray[i];
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++;
+ }
+ }
+ }
+ }
+ break;
+ case '/':
+ {
+ if (eScannedType == NUMBERFORMAT_FRACTION)
+ {
+ if ( i == 0 ||
+ (nTypeArray[i-1] != SYMBOLTYPE_DIGIT &&
+ nTypeArray[i-1] != SYMBOLTYPE_EMPTY) )
+ return nPos ? nPos : 1; // /? not allowed
+ else if (!bFrac || (bDecSep && nCounter > 0))
+ {
+ bFrac = TRUE;
+ nCntPost = nCounter;
+ nCounter = 0;
+ nTypeArray[i] = SYMBOLTYPE_FRAC;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ else // / doppelt od. , imZaehl
+ return nPos; // Fehler
+ }
+ else
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ }
+ break;
+ case '[' :
+ {
+ if ( eScannedType == NUMBERFORMAT_CURRENCY &&
+ i < nAnzStrings-1 &&
+ nTypeArray[i+1] == SYMBOLTYPE_STRING &&
+ sStrArray[i+1].GetChar(0) == '$' )
+ { // [$DM-xxx]
+ // ab SV_NUMBERFORMATTER_VERSION_NEW_CURR
+ nPos += sStrArray[i].Len(); // [
+ nTypeArray[i] = SYMBOLTYPE_CURRDEL;
+ nPos += sStrArray[++i].Len(); // $
+ sStrArray[i-1] += sStrArray[i]; // [$
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ if ( ++i >= nAnzStrings )
+ return nPos; // Fehler
+ nPos += sStrArray[i].Len(); // DM
+ XubString& rStr = sStrArray[i];
+ XubString* pStr = &sStrArray[i];
+ nTypeArray[i] = SYMBOLTYPE_CURRENCY; // wandeln
+ BOOL bHadDash = FALSE;
+ i++;
+ while ( i < nAnzStrings &&
+ sStrArray[i].GetChar(0) != ']' )
+ {
+ nPos += sStrArray[i].Len();
+ if ( bHadDash )
+ {
+ *pStr += sStrArray[i];
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ }
+ else
+ {
+ if ( sStrArray[i].GetChar(0) == '-' )
+ {
+ bHadDash = TRUE;
+ pStr = &sStrArray[i];
+ nTypeArray[i] = SYMBOLTYPE_CURREXT;
+ }
+ else
+ {
+ *pStr += sStrArray[i];
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ }
+ }
+ i++;
+ }
+ if ( rStr.Len() && i < nAnzStrings &&
+ sStrArray[i].GetChar(0) == ']' )
+ {
+ nTypeArray[i] = SYMBOLTYPE_CURRDEL;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ else
+ return nPos; // Fehler
+ }
+ else
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ }
+ break;
+ default: // andere Dels
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ } // of switch (Del)
+ } // of else Del
+ else if ( nTypeArray[i] == SYMBOLTYPE_COMMENT )
+ {
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ SvNumberformat::EraseCommentBraces( rStr );
+ rComment += rStr;
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++;
+ }
+ else
+ {
+ DBG_ERRORFILE( "unknown SYMBOLTYPE_..." );
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ } // of while
+ if (eScannedType == NUMBERFORMAT_FRACTION)
+ {
+ if (bFrac)
+ nCntExp = nCounter;
+ else if (bBlank)
+ nCntPost = nCounter;
+ else
+ nCntPre = nCounter;
+ }
+ else
+ {
+ if (bExp)
+ nCntExp = nCounter;
+ else if (bDecSep)
+ nCntPost = nCounter;
+ else
+ nCntPre = nCounter;
+ }
+ if (nThousand == 0 && bThousand) // Expansion Tausenderpunkt:
+ {
+ USHORT nMaxPos;
+ if (bFrac)
+ {
+ if (bBlank)
+ nMaxPos = nBlankPos;
+ else
+ nMaxPos = 0; // keine Expansion
+ }
+ else if (bDecSep) // , vorhanden
+ nMaxPos = nDecPos;
+ else if (bExp) // E vorhanden
+ nMaxPos = nExpPos;
+ else // sonst bis Ende
+ nMaxPos = i;
+ i = 0;
+ long nCount = nCntPre;
+ while (i < nMaxPos && nTypeArray[i] != SYMBOLTYPE_THSEP) // nur bis zum ,
+ {
+ if (nTypeArray[i] == SYMBOLTYPE_DIGIT)
+ nCount -= sStrArray[i].Len();
+ i++;
+ }
+ USHORT nPosThSep = i; // Position merken
+ i++; // Ziffern hinter .
+ xub_StrLen nFill = 0;
+ if (nCount > 0) // muesste immer sein
+ nFill = xub_StrLen(nCount % 3);
+ if (nFill)
+ {
+ nFill = 3 - nFill;
+ if (i < nMaxPos)
+ for (xub_StrLen k = 0; k < nFill; k++)
+ sStrArray[i].Insert(cThousandFill,0);
+ nCntPre += USHORT(nFill);
+ }
+ nCount = 0; // Aufuellen mit .
+ while (i < nMaxPos) // nach hinten
+ {
+ if (nTypeArray[i] == SYMBOLTYPE_DIGIT)
+ {
+ xub_StrLen nLen = sStrArray[i].Len();
+ if (nCount+nLen > 3)
+ { // hier muss . dazwischen
+ xub_StrLen nAnz = (nLen+nCount-4)/3+1;
+ xub_StrLen InPos = 3-nCount;
+ for (xub_StrLen k = 0; k < nAnz; k++)
+ {
+ sStrArray[i].Insert(
+ pIntl->GetNumThousandSep(),InPos);
+ InPos += 4;
+ }
+ nCount = sStrArray[i].Len() - InPos + 3;
+ }
+ else
+ nCount += sStrArray[i].Len();
+ }
+ i++;
+ }
+ nCount = 0; // Aufuellen mit .
+ i = nPosThSep; // nach vorn
+ while (i > 0)
+ {
+ i--;
+ if (nTypeArray[i] == SYMBOLTYPE_DIGIT)
+ {
+ xub_StrLen nLen = sStrArray[i].Len();
+ if (nCount+nLen > 3)
+ { // hier muss . dazwischen
+ xub_StrLen nAnz = (nLen+nCount-4)/3+1;
+ xub_StrLen InPos = nLen + nCount - 3;
+ for (xub_StrLen k = 0; k < nAnz; k++)
+ {
+ sStrArray[i].Insert(
+ pIntl->GetNumThousandSep(),InPos);
+ InPos -= 3;
+ }
+ nCount = InPos + 3;
+ }
+ else
+ nCount += sStrArray[i].Len();
+ }
+ }
+ }
+ }
+ break; // of NUMBERFORMAT_NUMBER
+ case NUMBERFORMAT_DATE:
+ {
+ while (i < nAnzStrings)
+ {
+ switch (nTypeArray[i])
+ {
+ case SYMBOLTYPE_BLANK:
+ case SYMBOLTYPE_STAR:
+ case SYMBOLTYPE_STRING:
+ break;
+ case SYMBOLTYPE_COMMENT:
+ {
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ SvNumberformat::EraseCommentBraces( rStr );
+ rComment += rStr;
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ }
+ break;
+ case SYMBOLTYPE_DEL:
+ {
+ if (bConvertMode && sStrArray[i].GetChar(0) == cOldDateSep)
+ sStrArray[i].Replace( 0, 1, pIntl->GetDateSep() );
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ }
+ break;
+ case NF_KEY_M: // M
+ case NF_KEY_MM: // MM
+ case NF_KEY_MMM: // MMM
+ case NF_KEY_MMMM: // MMMM
+ case NF_KEY_Q: // Q
+ case NF_KEY_QQ: // QQ
+ case NF_KEY_T: // T
+ case NF_KEY_TT: // TT
+ case NF_KEY_TTT: // TTT
+ case NF_KEY_TTTT: // TTTT
+ case NF_KEY_JJ: // JJ
+ case NF_KEY_JJJJ: // JJJJ
+ case NF_KEY_NN: // NN
+ case NF_KEY_NNN: // NNN
+ case NF_KEY_NNNN: // NNNN
+ case NF_KEY_WW : // WW
+ sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
+ break;
+ default: // andere Keywords
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ break;
+ }
+ nPos += sStrArray[i].Len();
+ i++;
+ } // of while
+ }
+ break; // of NUMBERFORMAT_DATE
+ case NUMBERFORMAT_TIME:
+ {
+ while (i < nAnzStrings)
+ {
+ switch (nTypeArray[i])
+ {
+ case SYMBOLTYPE_BLANK:
+ case SYMBOLTYPE_STAR:
+ {
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ case SYMBOLTYPE_DEL:
+ {
+ switch( sStrArray[i].GetChar(0) )
+ {
+ case '0':
+ {
+ if (bDecSep)
+ {
+ nTypeArray[i] = SYMBOLTYPE_DIGIT;
+ XubString& rStr = sStrArray[i];
+ i++;
+ nPos += sStrArray[i].Len();
+ nCounter++;
+ while (i < nAnzStrings &&
+ sStrArray[i].GetChar(0) == '0')
+ {
+ rStr += sStrArray[i];
+ nPos += sStrArray[i].Len();
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ nCounter++;
+ i++;
+ }
+ }
+ else
+ return nPos;
+ }
+ break;
+ case '#':
+ case '?':
+ return nPos;
+ break;
+ case '.':
+ case ',':
+ {
+ bDecSep = TRUE;
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ case '[':
+ {
+ if (bThousand) // doppelt
+ return nPos;
+ bThousand = TRUE; // bei Time frei
+ xub_Unicode cChar = pFormatter->GetCharClass()->upper( NextChar(i) ).GetChar(0);
+ if ( cChar == sKeyword[NF_KEY_H].GetChar(0) )
+ nThousand = 1; // H
+ else if ( cChar == sKeyword[NF_KEY_MI].GetChar(0) )
+ nThousand = 2; // M
+ else if ( cChar == sKeyword[NF_KEY_S].GetChar(0) )
+ nThousand = 3; // S
+ else
+ return nPos;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ case ']':
+ {
+ if (!bThousand) // kein [ vorher
+ return nPos;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ default:
+ {
+ if (bConvertMode &&
+ sStrArray[i].GetChar(0) == cOldTimeSep)
+ sStrArray[i].Replace( 0, 1, pIntl->GetTimeSep() );
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ }
+ }
+ break;
+ case SYMBOLTYPE_STRING:
+ {
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ case SYMBOLTYPE_COMMENT:
+ {
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ SvNumberformat::EraseCommentBraces( rStr );
+ rComment += rStr;
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++;
+ }
+ break;
+ case NF_KEY_AMPM: // AM/PM
+ case NF_KEY_AP: // A/P
+ {
+ bExp = TRUE; // missbraucht fuer A/P
+ sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ case NF_KEY_MI: // M
+ case NF_KEY_MMI: // MM
+ case NF_KEY_H: // H
+ case NF_KEY_HH: // HH
+ case NF_KEY_S: // S
+ case NF_KEY_SS: // SS
+ {
+ sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ default: // andere Keywords
+ {
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ nPos += sStrArray[i].Len();
+ i++;
+ }
+ break;
+ }
+ } // of while
+ nCntPost = nCounter; // Zaehler der Nullen
+ if (bExp)
+ nCntExp = 1; // merkt AM/PM
+ }
+ break; // of NUMBERFORMAT_TIME
+ case NUMBERFORMAT_DATETIME:
+ {
+ while (i < nAnzStrings)
+ {
+ switch (nTypeArray[i])
+ {
+ case SYMBOLTYPE_BLANK:
+ case SYMBOLTYPE_STAR:
+ case SYMBOLTYPE_STRING:
+ break;
+ case SYMBOLTYPE_COMMENT:
+ {
+ XubString& rStr = sStrArray[i];
+ nPos += rStr.Len();
+ SvNumberformat::EraseCommentBraces( rStr );
+ rComment += rStr;
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ }
+ break;
+ case SYMBOLTYPE_DEL:
+ {
+ if (bConvertMode && sStrArray[i].GetChar(0) == cOldDateSep)
+ sStrArray[i].Replace( 0, 1, pIntl->GetDateSep() );
+ if (bConvertMode && sStrArray[i].GetChar(0) == cOldTimeSep)
+ sStrArray[i].Replace( 0, 1, pIntl->GetTimeSep() );
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ }
+ break;
+ case NF_KEY_AMPM: // AM/PM
+ case NF_KEY_AP: // A/P
+ {
+ bExp = TRUE; // missbraucht fuer A/P
+ sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
+ }
+ break;
+ case NF_KEY_MI: // M
+ case NF_KEY_MMI: // MM
+ case NF_KEY_H: // H
+ case NF_KEY_HH: // HH
+ case NF_KEY_S: // S
+ case NF_KEY_SS: // SS
+ case NF_KEY_M: // M
+ case NF_KEY_MM: // MM
+ case NF_KEY_MMM: // MMM
+ case NF_KEY_MMMM: // MMMM
+ case NF_KEY_Q: // Q
+ case NF_KEY_QQ: // QQ
+ case NF_KEY_T: // T
+ case NF_KEY_TT: // TT
+ case NF_KEY_TTT: // TTT
+ case NF_KEY_TTTT: // TTTT
+ case NF_KEY_JJ: // JJ
+ case NF_KEY_JJJJ: // JJJJ
+ case NF_KEY_NN: // NN
+ case NF_KEY_NNN: // NNN
+ case NF_KEY_NNNN: // NNNN
+ case NF_KEY_WW : // WW
+ sStrArray[i] = sKeyword[nTypeArray[i]]; // tTtT -> TTTT
+ break;
+ default: // andere Keywords
+ nTypeArray[i] = SYMBOLTYPE_STRING;
+ break;
+ }
+ nPos += sStrArray[i].Len();
+ i++;
+ } // of while
+ if (bExp)
+ nCntExp = 1; // merkt AM/PM
+ }
+ break; // of Sc_N_F_DATETIME
+ default:
+ break;
+ }
+ if (eScannedType == NUMBERFORMAT_SCIENTIFIC &&
+ (nCntPre + nCntPost == 0 || nCntExp == 0))
+ return nPos;
+ else if (eScannedType == NUMBERFORMAT_FRACTION && (nCntExp > 8 || nCntExp == 0))
+ return nPos;
+ rString.Erase();
+ for (i = 0; i < nAnzStrings; i++)
+ {
+ if ( nTypeArray[i] != SYMBOLTYPE_EMPTY )
+ rString += sStrArray[i];
+ if ( sStrArray[i].Len() > 1 && (nTypeArray[i] == SYMBOLTYPE_STRING ||
+ nTypeArray[i] == SYMBOLTYPE_CURRENCY) )
+ {
+ XubString& rStr = sStrArray[i];
+ xub_Unicode c = rStr.GetChar(0);
+ xub_StrLen n;
+ if ( c == '"' && rStr.GetChar( (n = xub_StrLen(rStr.Len()-1)) ) == '"' )
+ {
+ rStr.Erase(n,1);
+ rStr.Erase(0,1);
+ }
+ else if ( c == '\\' )
+ rStr.Erase(0,1);
+ }
+ }
+ // Strings zusammenfassen:
+ i = 0;
+ while (i < nAnzStrings)
+ {
+ if (nTypeArray[i] == SYMBOLTYPE_STRING)
+ {
+ USHORT iPos = i;
+ USHORT j = i;
+ i++;
+ while ( i < nAnzStrings && nTypeArray[i] == SYMBOLTYPE_STRING )
+ {
+ sStrArray[iPos] += sStrArray[i];
+ nTypeArray[i] = SYMBOLTYPE_EMPTY;
+ nAnzResStrings--;
+ i++;
+ }
+ if (eScannedType == NUMBERFORMAT_CURRENCY)
+ { // dM -> DM
+ xub_StrLen nCPos;
+ XubString sTmpStr = pFormatter->GetCharClass()->upper(sStrArray[j]);
+ nCPos = sTmpStr.Search(sCurString);
+ if ( nCPos != STRING_NOTFOUND )
+ {
+ const XubString& rCurr = pIntl->GetCurrSymbol();
+ sStrArray[j].Replace( nCPos, rCurr.Len(), rCurr );
+ }
+ }
+ }
+ i++;
+ }
+ return 0;
+}
+
+xub_StrLen ImpSvNumberformatScan::ScanFormat( XubString& rString, XubString& rComment )
+{
+ xub_StrLen res = Symbol_Division(rString); //lexikalische Analyse
+ if (!res)
+ res = ScanType(rString); // Erkennung des Formattyps
+ if (!res)
+ res = FinalScan( rString, rComment ); // Typabhaengige Endanalyse
+ return res; // res = Kontrollposition
+ // res = 0 => Format ok
+}
+
+void ImpSvNumberformatScan::CopyInfo(ImpSvNumberformatInfo* pInfo, USHORT nAnz)
+{
+ USHORT i,j;
+ j = 0;
+ i = 0;
+ while (i < nAnz && j < SC_MAX_ANZ_FORMAT_STRINGS)
+ {
+ if (nTypeArray[j] != SYMBOLTYPE_EMPTY)
+ {
+ pInfo->sStrArray[i] = sStrArray[j];
+ pInfo->nTypeArray[i] = nTypeArray[j];
+ i++;
+ }
+ j++;
+ }
+ pInfo->eScannedType = eScannedType;
+ pInfo->bThousand = bThousand;
+ pInfo->nThousand = nThousand;
+ pInfo->nCntPre = nCntPre;
+ pInfo->nCntPost = nCntPost;
+ pInfo->nCntExp = nCntExp;
+}
+
+
diff --git a/svtools/source/numbers/zforscan.hxx b/svtools/source/numbers/zforscan.hxx
new file mode 100644
index 000000000000..3aa56db49f13
--- /dev/null
+++ b/svtools/source/numbers/zforscan.hxx
@@ -0,0 +1,254 @@
+/*************************************************************************
+ *
+ * $RCSfile: zforscan.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _ZFORSCAN_HXX
+#define _ZFORSCAN_HXX
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _DATE_HXX //autogen
+#include <tools/date.hxx>
+#endif
+#ifndef _LANG_HXX //autogen
+#include <tools/lang.hxx>
+#endif
+#ifndef _COLOR_HXX //autogen
+#include <vcl/color.hxx>
+#endif
+
+#include "zformat.hxx" // just for NfKeywordTable
+
+class International;
+class SvNumberFormatter;
+struct ImpSvNumberformatInfo;
+
+
+#define SC_MAX_ANZ_FORMAT_STRINGS 100
+#define SC_MAX_ANZ_STANDARD_FARBEN 10
+#define FLAG_STANDARD_IN_FORMAT 1000
+ // Hack: nThousand=1000
+ // => Standard kommt im
+ // Format vor
+
+enum Sc_SymbolType
+{
+ SYMBOLTYPE_STRING = -1, // String in Ausgabe
+ SYMBOLTYPE_DEL = -2, // Sonderzeichen
+ SYMBOLTYPE_BLANK = -3, // Blank fuer '_'
+ SYMBOLTYPE_STAR = -4, // *-Buchstabe
+ SYMBOLTYPE_DIGIT = -5, // Ziffernplatzhalter
+ SYMBOLTYPE_DECSEP = -6, // Komma
+ SYMBOLTYPE_THSEP = -7, // Tausenderpunkt
+ SYMBOLTYPE_EXP = -8, // Exponent E
+ SYMBOLTYPE_FRAC = -9, // Bruch /
+ SYMBOLTYPE_EMPTY = -10, // geloeschte Symbole
+ SYMBOLTYPE_FRACBLANK = -11, // Trenner Zahl - Zaehler bei Bruch
+ SYMBOLTYPE_COMMENT = -12, // Kommentar folgt
+ SYMBOLTYPE_CURRENCY = -13, // Waehrungssymbol
+ SYMBOLTYPE_CURRDEL = -14, // Waehrungssymbol Delimiter [$]
+ SYMBOLTYPE_CURREXT = -15 // Waehrungssymbol Extension -xxx
+};
+
+
+class ImpSvNumberformatScan
+{
+public: // ---- oeffentlicher Teil
+ static void GetLogicalKeywords( LanguageType eLnge,
+ const xub_Unicode*& pTrue, const xub_Unicode*& pFalse );
+
+ ImpSvNumberformatScan( SvNumberFormatter* pFormatter );
+ ~ImpSvNumberformatScan();
+ void ChangeIntl(); // tauscht Keywords aus
+
+ void ChangeNullDate(USHORT nDay, USHORT nMonth, USHORT nYear);
+ // tauscht Referenzdatum aus
+ void ChangeStandardPrec(short nPrec); // tauscht Standardprecision aus
+
+ xub_StrLen ScanFormat( XubString& rString, XubString& rComment ); // Aufruf der Scan-Analyse
+
+ void CopyInfo(ImpSvNumberformatInfo* pInfo,
+ USHORT nAnz); // Kopiert die FormatInfo
+ USHORT GetAnzResStrings() { return nAnzResStrings; }
+
+ const International& GetIntl() { return *pFormatter->GetInternational(); }
+ const CharClass& GetChrCls() { return *pFormatter->GetCharClass(); }
+
+ XubString& GetQuartalString(){ return sKeyword[NF_KEY_QUARTER]; }
+ XubString& GetTrueString() { return sKeyword[NF_KEY_TRUE]; }
+ XubString& GetFalseString() { return sKeyword[NF_KEY_FALSE]; }
+ XubString& GetColorString() { return sKeyword[NF_KEY_COLOR]; }
+ XubString& GetRedString() { return sKeyword[NF_KEY_RED]; }
+ XubString& GetBooleanString(){ return sKeyword[NF_KEY_BOOLEAN]; }
+ XubString& GetErrorString() { return sErrStr; }
+ XubString* GetKeyword() { return sKeyword; }
+
+ Date* GetNullDate() { return pNullDate; }
+ XubString& GetStandardName() { return sNameStandardFormat; }
+ short GetStandardPrec() { return nStandardPrec; }
+ Color& GetRedColor() { return StandardColor[4]; }
+ Color* GetColor(XubString& sStr); // Setzt Hauptfarben oder
+ // definierte Farben
+
+ void SetConvertMode(LanguageType eTmpLge, LanguageType eNewLge)
+ {
+ bConvertMode = TRUE;
+ eNewLnge = eNewLge;
+ eTmpLnge = eTmpLge;
+ }
+ void SetConvertMode(BOOL bMode) { bConvertMode = bMode; }
+ // Veraendert nur die Bool-Variable
+ // (zum temporaeren Unterbrechen des
+ // Convert-Modus)
+ const BOOL GetConvertMode() { return bConvertMode; }
+ const LanguageType GetNewLnge() { return eNewLnge; }
+ // Lesezugriff auf ConvertMode
+ // und Konvertierungsland/Spr.
+ const LanguageType GetTmpLnge() { return eTmpLnge; }
+ // Lesezugriff auf
+ // und Ausgangsland/Spr.
+ SvNumberFormatter* GetNumberformatter() { return pFormatter; }
+ // Zugriff auf Formatierer
+ // (fuer zformat.cxx)
+
+
+private: // ---- privater Teil
+ NfKeywordTable sKeyword; // Schluesselworte der Syntax
+ Color StandardColor[SC_MAX_ANZ_STANDARD_FARBEN];
+ // Array der Standardfarben
+ Date* pNullDate; // "1.1.1900"
+ XubString sNameStandardFormat; // "Standard"
+ short nStandardPrec; // default Precision fuer Standardformat (2)
+ SvNumberFormatter* pFormatter; // Pointer auf die Formatliste
+
+ XubString sStrArray[SC_MAX_ANZ_FORMAT_STRINGS];// Array der Symbole
+ short nTypeArray[SC_MAX_ANZ_FORMAT_STRINGS];// Array der Infos
+ // externe Infos:
+ USHORT nAnzResStrings; // Anzahl der Ergebnissymbole
+#if !(defined SOLARIS && defined X86)
+ short eScannedType; // Typ gemaess Scan
+#else
+ int eScannedType; // wg. Optimierung
+#endif
+ BOOL bThousand; // Mit Tausenderpunkt
+ USHORT nThousand; // Zaehlt ....-Folgen
+ USHORT nCntPre; // Zaehlt Vorkommastellen
+ USHORT nCntPost; // Zaehlt Nachkommastellen
+ USHORT nCntExp; // Zaehlt Exp.Stellen, AM/PM
+ // interne Infos:
+ USHORT nAnzStrings; // Anzahl der Symbole
+ USHORT nRepPos; // Position eines '*'
+ USHORT nExpPos; // interne Position des E
+ USHORT nBlankPos; // interne Position des Blank
+ short nDecPos; // interne Pos. des ,
+ BOOL bExp; // wird bei Lesen des E gesetzt
+ BOOL bFrac; // wird bei Lesen des / gesetzt
+ BOOL bBlank; // wird bei ' '(Fraction) ges.
+ BOOL bDecSep; // Wird beim ersten , gesetzt
+ XubString sCurString; // Das Waehrungssymbol in Upper
+ XubString sErrStr; // String fuer Fehlerausgaben
+
+ BOOL bConvertMode; // Wird im Convert-Mode gesetzt
+ // Land/Sprache, in die der
+ LanguageType eNewLnge; // gescannte String konvertiert
+ // wird (fuer Excel Filter)
+ // Land/Sprache, aus der der
+ LanguageType eTmpLnge; // gescannte String konvertiert
+ // wird (fuer Excel Filter)
+ xub_Unicode cOldDecSep; // Dezimalsymbol der Ausgangs-
+ xub_Unicode cOldThousandSep; // spr., analog Tausenderpunkt
+ xub_Unicode cOldDateSep; // Datums- und Zeitsymbol
+ xub_Unicode cOldTimeSep;
+ xub_StrLen nCurrPos; // Position des Waehrungssymbols
+
+#ifdef _ZFORSCAN_CXX // ----- private Methoden -----
+ void SetDependentKeywords(LanguageType eLnge);
+ // Setzt die Sprachabh. Keyw.
+ void SkipStrings(USHORT& i,xub_StrLen& nPos);// Ueberspringt StringSymbole
+ USHORT PreviousKeyword(USHORT i); // Gibt Index des vorangeh.
+ // Schluesselworts oder 0
+ USHORT NextKeyword(USHORT i); // Gibt Index des naechsten
+ // Schluesselworts oder 0
+ xub_Unicode PreviousChar(USHORT i); // Gibt letzten Buchstaben
+ // vor der Position,
+ // skipt EMPTY, STRING, STAR, BLANK
+ xub_Unicode NextChar(USHORT i); // Gibt ersten Buchst. danach
+ short PreviousType( USHORT i ); // Gibt Typ vor Position,
+ // skipt EMPTY
+ BOOL IsLastBlankBeforeFrac(USHORT i); // True <=> es kommt kein ' '
+ // mehr bis zum '/'
+ void Reset(); // Reset aller Variablen
+ // vor Analysestart
+ USHORT GetKeyWord(const XubString& sSymbol); // Vergleicht mit den Keywords
+ // return 0 <=> nicht gefunden
+ short Next_Symbol(const XubString& rStr,
+ xub_StrLen& nPos,
+ XubString& sSymbol); // Naechstes Symbol
+ xub_StrLen Symbol_Division(const XubString& rString);// lexikalische Voranalyse
+ xub_StrLen ScanType(const XubString& rString); // Analyse des Formattyps
+ xub_StrLen FinalScan( XubString& rString, XubString& rComment ); // Endanalyse mit Vorgabe
+ // des Typs
+
+#endif //_ZFORSCAN_CXX
+};
+
+
+
+#endif // _ZFORSCAN_HXX
diff --git a/svtools/source/plugapp/commtest.cxx b/svtools/source/plugapp/commtest.cxx
new file mode 100644
index 000000000000..e9a9b33b2089
--- /dev/null
+++ b/svtools/source/plugapp/commtest.cxx
@@ -0,0 +1,303 @@
+/*************************************************************************
+ *
+ * $RCSfile: commtest.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SV_SVAPP_HXX //autogen wg. Application
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_WRKWIN_HXX //autogen wg. WorkWindow
+#include <vcl/wrkwin.hxx>
+#endif
+#ifndef _SV_TOOLBOX_HXX //autogen wg. ToolBox
+#include <vcl/toolbox.hxx>
+#endif
+
+
+#ifndef _SIMPLECM_HXX //autogen wg. CommunicationManager
+#include <tools/simplecm.hxx>
+#endif
+#ifndef _COMMUNI_HXX //autogen
+#include "communi.hxx"
+#endif
+#include "brooker.hxx"
+//#include <tools/bcst.hxx>
+
+#include "commtest.hrc"
+
+
+
+#define TCP_PORT 17612
+
+#define CUniString( constAsciiStr ) UniString( RTL_CONSTASCII_USTRINGPARAM ( constAsciiStr ) )
+
+
+class PacketSender : public Timer
+{
+ SvStream* mpData;
+ CommunicationLinkRef mxCL;
+
+public:
+ PacketSender( ULONG nDelay, SvStream* pData, CommunicationLink* pCL );
+ virtual void Timeout();
+};
+
+PacketSender::PacketSender( ULONG nDelay, SvStream* pData, CommunicationLink* pCL )
+: mpData( pData )
+, mxCL( pCL )
+{
+ SetTimeout( nDelay );
+ Start();
+}
+
+void PacketSender::Timeout()
+{
+ mxCL->TransferDataStream( mpData );
+ delete mpData;
+ delete this;
+}
+
+
+
+class DelayedDeleter : public Timer
+{
+ CommunicationManager *mpManager;
+
+public:
+ DelayedDeleter( ULONG nDelay, CommunicationManager *pManager );
+ virtual void Timeout();
+};
+
+DelayedDeleter::DelayedDeleter( ULONG nDelay, CommunicationManager *pManager )
+: mpManager( pManager )
+{
+ SetTimeout( nDelay );
+ Start();
+}
+
+void DelayedDeleter::Timeout()
+{
+ delete mpManager;
+ delete this;
+}
+
+
+
+
+class CommunicationTester : public Application
+{
+ DECL_LINK( TBClick, ToolBox* );
+ DECL_LINK( DataReceived, CommunicationLink* );
+ DECL_LINK( ConnectionOpened, CommunicationLink* );
+ DECL_LINK( ConnectionClosed, CommunicationLink* );
+
+
+ CommunicationManager *pClientTcp, *pServerTcp;
+ InformationBroadcaster *pBCSTSend;
+ InformationBroadcaster *pBCSTListen;
+ InformationBrooker *pBCSTBrooker;
+public:
+ CommunicationTester();
+
+ virtual void Main();
+};
+
+CommunicationTester IchSelber;
+
+CommunicationTester::CommunicationTester()
+: pBCSTSend( NULL )
+, pBCSTListen( NULL )
+, pClientTcp( NULL )
+, pBCSTBrooker( NULL )
+, pServerTcp( NULL )
+{}
+
+void CommunicationTester::Main()
+{
+ ResMgr *pRes = new ResMgr( CUniString("commtest.res") );
+ Resource::SetResManager( pRes );
+ WorkWindow aWW( NULL, WB_APP | WB_STDWORK );
+ aWW.Show();
+ ToolBox aTB( &aWW, ResId( TBMenu ) );
+ aTB.Show();
+ aTB.RecalcItems();
+ aTB.SetFloatingMode( TRUE );
+ aTB.SetFloatingMode( FALSE );
+ aTB.SetClickHdl( LINK( this, CommunicationTester, TBClick ) );
+
+ Execute();
+}
+
+#define SWITCH( pManager, ManagerClass ) \
+{ \
+ if ( pManager ) \
+ { \
+ pManager->StopCommunication(); \
+ new DelayedDeleter( 1000, pManager ); \
+ pTB->SetItemState( pTB->GetCurItemId(), STATE_NOCHECK ); \
+ pManager = NULL; \
+ } \
+ else \
+ { \
+ pManager = new ManagerClass; \
+ pManager->SetConnectionOpenedHdl( LINK( this, CommunicationTester, ConnectionOpened ) );\
+ pManager->SetConnectionClosedHdl( LINK( this, CommunicationTester, ConnectionClosed ) );\
+ pManager->SetDataReceivedHdl( LINK( this, CommunicationTester, DataReceived ) );\
+ pTB->SetItemState( pTB->GetCurItemId(), STATE_CHECK ); \
+ } \
+}
+
+
+IMPL_LINK( CommunicationTester, TBClick, ToolBox*, pTB )
+{
+ switch ( pTB->GetCurItemId() )
+ {
+ case SERVER_TCP:
+ {
+ SWITCH( pServerTcp, CommunicationManagerServerViaSocket( TCP_PORT, (USHORT) 32000 ) );
+ if ( pServerTcp )
+ pServerTcp->StartCommunication(); // Am Port horchen
+ }
+ break;
+ case CLIENT_TCP:
+ {
+ SWITCH( pClientTcp, CommunicationManagerClientViaSocket( "localhost", TCP_PORT ) );
+ if ( pClientTcp )
+ pClientTcp->StartCommunication(); // Eine Verbindung aufbauen
+ }
+ break;
+ case BCST_BROOKER:
+ {
+ if ( pBCSTBrooker )
+ {
+ delete pBCSTBrooker;
+ pBCSTBrooker = NULL;
+ }
+ else
+ {
+ pBCSTBrooker = new InformationBrooker();
+ }
+ }
+ break;
+ case BCST_LISTEN:
+ {
+ if ( pBCSTListen )
+ {
+ delete pBCSTListen;
+ pBCSTListen = NULL;
+ }
+ else
+ {
+ pBCSTListen = new InformationBroadcaster();
+ }
+ }
+ case BCST_SEND:
+ {
+ if ( pBCSTSend )
+ {
+ pBCSTSend->Broadcast( BCST_CAT_PL2X, "Message: BCST_CAT_PL2X" );
+ pBCSTSend->Broadcast( BCST_CAT_MINORCOPY, "Message: BCST_CAT_MINORCOPY" );
+ pBCSTSend->Broadcast( BCST_CAT_DELIVER, "Message: BCST_CAT_DELIVER" );
+ pBCSTSend->Broadcast( BCST_CAT_ALL, "Message: BCST_CAT_ALL" );
+ }
+ else
+ {
+ pBCSTSend = new InformationBroadcaster();
+ }
+ }
+ break;
+ }
+ return 0;
+}
+
+IMPL_LINK( CommunicationTester, ConnectionOpened, CommunicationLink*, pCL )
+{
+ SvStream *pData = pCL->GetBestCommunicationStream();
+ while ( pData->Tell() < 70 ) *pData << 123;
+
+ pCL->TransferDataStream( pData );
+ return 0;
+}
+
+IMPL_LINK( CommunicationTester, ConnectionClosed, CommunicationLink*, pCL )
+{
+ return 0;
+}
+
+IMPL_LINK( CommunicationTester, DataReceived, CommunicationLink*, pCL )
+{
+ // Find Manager
+ CommunicationManager* pManager;
+ if ( pClientTcp && pClientTcp->IsLinkValid( pCL ) )
+ {
+ pManager = pClientTcp;
+ }
+ if ( pServerTcp && pServerTcp->IsLinkValid( pCL ) )
+ {
+ DBG_ASSERT( !pManager, "CommunicationLink bei mehreren Managern eingetragen");
+ pManager = pServerTcp;
+ }
+ DBG_ASSERT( pCL->GetCommunicationManager() == pManager, "Manager des Link != Manager bei dem der Link Valid ist");
+
+ // Send Data Back (Echo)
+ new PacketSender( 1000, pCL->GetServiceData(), pCL );
+
+ return 0;
+}
+
diff --git a/svtools/source/plugapp/commtest.hrc b/svtools/source/plugapp/commtest.hrc
new file mode 100644
index 000000000000..23c5c8629d9e
--- /dev/null
+++ b/svtools/source/plugapp/commtest.hrc
@@ -0,0 +1,68 @@
+/*************************************************************************
+ *
+ * $RCSfile: commtest.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define TBMenu 256
+
+
+#define SERVER_TCP 1
+#define CLIENT_TCP 2
+#define BCST_BROOKER 3
+#define BCST_LISTEN 4
+#define BCST_SEND 5
diff --git a/svtools/source/plugapp/commtest.src b/svtools/source/plugapp/commtest.src
new file mode 100644
index 000000000000..a7c43b0b5d79
--- /dev/null
+++ b/svtools/source/plugapp/commtest.src
@@ -0,0 +1,94 @@
+/*************************************************************************
+ *
+ * $RCSfile: commtest.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "commtest.hrc"
+
+ToolBox TBMenu {
+ Border = TRUE;
+ SVLook = TRUE;
+ Dockable = TRUE;
+ Pos = MAP_APPFONT( 0, 0 );
+ Size = MAP_APPFONT( 100, 20 );
+ LineCount = 2;
+// FloatingLines = 2;
+ ItemList = {
+ ToolBoxItem {
+ Identifier = SERVER_TCP;
+ Text = "Server TCP";
+ };
+ ToolBoxItem {
+ Identifier = CLIENT_TCP;
+ Text = "Client TCP";
+ };
+ ToolBoxItem {
+ Identifier = BCST_BROOKER;
+ Text = "BroadcastBrooker";
+ };
+ ToolBoxItem {
+ Identifier = BCST_SEND;
+ Text = "BroadcastClientSend";
+ };
+ ToolBoxItem {
+ Identifier = BCST_LISTEN;
+ Text = "BroadcastClientListen";
+ };
+ };
+ Scroll = TRUE;
+};
diff --git a/svtools/source/plugapp/makefile.mk b/svtools/source/plugapp/makefile.mk
new file mode 100644
index 000000000000..fdeb47d6b5ed
--- /dev/null
+++ b/svtools/source/plugapp/makefile.mk
@@ -0,0 +1,111 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=plugapp
+LIBTARGET=NO
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES = \
+ ttprops.cxx \
+ communi.cxx \
+ brooker.cxx
+
+
+SLOFILES = \
+ $(SLO)$/ttprops.obj \
+ $(SLO)$/communi.obj \
+ $(SLO)$/brooker.obj
+
+
+OBJFILES = $(OBJ)$/commtest.obj $(OBJ)$/brooker.obj
+
+
+.IF "$(GUI)"!="DOS"
+SRCFILES= testtool.src
+.ENDIF
+
+
+LIB1TARGET= $(SLB)$/plugapp.lib
+LIB1OBJFILES= $(SLOFILES)
+
+######## Testapplikation #########
+
+SRC1FILES= commtest.src
+SRS1NAME= commtest
+
+SRS1FILES= $(SRS)$/commtest.srs
+RES1TARGET= commtest
+
+######## Ende Testapplikation #########
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/plugapp/testtool.hrc b/svtools/source/plugapp/testtool.hrc
new file mode 100644
index 000000000000..ca360856ea08
--- /dev/null
+++ b/svtools/source/plugapp/testtool.hrc
@@ -0,0 +1,89 @@
+/*************************************************************************
+ *
+ * $RCSfile: testtool.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#define TTSTART 12345
+
+#define DisplayHidToolBox ( TTSTART + 0 )
+#define TT_SHOW 1
+#define TT_SHOW2 ( TTSTART + 1 )
+#define TT_OUTPUT 3
+#define TT_SEND_DATA 4
+#define TT_ALLWIN 5
+#define TT_KURZNAME 6
+#define TT_LANGNAME 7
+#define TT_ALTERNATE_CAPTION ( TTSTART + 2 )
+
+#define TT_INLINE_TRANSLATION ( TTSTART + 3)
+#define TT_GB_TRANSLATION 1
+#define TT_E_NEW 2
+#define TT_FT_OLD 3
+#define TT_GB_COMMENT 4
+#define TT_E_COMMENT 5
+
+#define TT_PB_SELECT 6
+#define TT_PB_RESTORE 7
+#define TT_PB_ACCEPT 8
+#define TT_PB_NEXT 9
+
+#define TT_DISCARD_CHANGED_DATA ( TTSTART + 4 )
+#define TT_NO_CONTROL ( TTSTART + 5 )
+
+
+#define TT_GPF ( TTSTART + 6 )
diff --git a/svtools/source/plugapp/testtool.src b/svtools/source/plugapp/testtool.src
new file mode 100644
index 000000000000..b2ae9ed1db35
--- /dev/null
+++ b/svtools/source/plugapp/testtool.src
@@ -0,0 +1,622 @@
+/*************************************************************************
+ *
+ * $RCSfile: testtool.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include "testtool.hrc"
+#include "solar.hrc"
+
+
+#define Control_Control 5
+#define Control_Border 7
+#define Button_Button Control_Control
+#define ButtonWidth 40
+
+
+ToolBox DisplayHidToolBox {
+ SVLook = TRUE ;
+ Text = "DisplayHID";
+ Text[ english_us ] = "DisplayHID";
+ ItemList = {
+ ToolBoxItem {
+ Type = TOOLBOXITEM_BUTTON;
+ _ToolBoxItemFlags = TIB_AUTOCHECK ;
+
+/*
+class FlagToolBoxState
+{
+ TIB_CHECKABLE, TIB_AUTOCHECK, TIB_RADIOCHECK, TIB_LEFT,
+ TIB_AUTOSIZE, TIB_DROPDOWN,
+};*/
+ Identifier = TT_SHOW;
+ Text = "IDs anzeigen";
+ Text[ english_us ] = "Display IDs";
+ ItemBitmap = Bitmap {
+ File = "ttshow.bmp";
+ };
+ Text[ portuguese ] = "Mostrar IDs";
+ Text[ russian ] = "Ïîêàçàòü IDs";
+ Text[ greek ] = "ÅìöÜíéóç IDs";
+ Text[ dutch ] = "IDs weergeven";
+ Text[ french ] = "Afficher les IDs";
+ Text[ spanish ] = "Mostrar IDs";
+ Text[ italian ] = "Mostra ID";
+ Text[ danish ] = "Vis ID'er";
+ Text[ swedish ] = "Visa ID:n";
+ Text[ polish ] = "Poka¿ IDs";
+ Text[ portuguese_brazilian ] = "IDs anzeigen";
+ Text[ japanese ] = "IDs •\\Ž¦";
+ Text[ korean ] = "ID Ç¥½Ã";
+ Text[ chinese_simplified ] = "ÏÔʾ IDs";
+ Text[ chinese_traditional ] = "Åã¥Ü ID";
+ Text[ arabic ] = "ÅÙåÇÑ IDs";
+ Text[ turkish ] = "ID'leri görüntüle";
+ };
+ ToolBoxItem {
+ Type = TOOLBOXITEM_SEPARATOR;
+ };
+ ToolBoxItem {
+ _ToolBoxItemFlags = TIB_AUTOSIZE;
+ Identifier = TT_OUTPUT;
+ Text = "Das ist das Eingabefenster";
+ Text[ english_us ] = "This is the input window";
+ Text[ portuguese ] = "Esta é a janela de entrada";
+ Text[ russian ] = "Ýòî îêíî ââîäà";
+ Text[ greek ] = "Áõôü åßíáé ôï ðáñÜèõñï åéóáãùãÞò";
+ Text[ dutch ] = "Dit is het invoervenster";
+ Text[ french ] = "Ceci est la fenêtre de saisie";
+ Text[ spanish ] = "Esta es la ventana de entradas";
+ Text[ italian ] = "È una finestra di digitazione";
+ Text[ danish ] = "Dette er inputvinduet";
+ Text[ swedish ] = "Det är inmatningsfönstret";
+ Text[ polish ] = "To jest okno wprowadzania";
+ Text[ portuguese_brazilian ] = "Das ist das Eingabefenster";
+ Text[ japanese ] = "‚±‚ê‚ͲÝÌ߯ĥ³¨ÝÄÞ³‚Å‚·";
+ Text[ korean ] = "ÀÌ°ÍÀº ÀÔ·ÂâÀÔ´Ï´Ù";
+ Text[ chinese_simplified ] = "ÕâÊÇÊäÈëÊÓ´°";
+ Text[ chinese_traditional ] = "³o¬O¤@­Ó¤å¦r¿é¤J¤è¶ô";
+ Text[ arabic ] = "åÐå åí äÇÝÐÉ ÇáÅÏÎÇá";
+ Text[ turkish ] = "Giriþ penceresi";
+ };
+ ToolBoxItem {
+ Type = TOOLBOXITEM_SEPARATOR;
+ };
+ ToolBoxItem {
+ Identifier = TT_SEND_DATA;
+ Text = "Zum TestTool Übertragen";
+ Text[ english_us ] = "Transfer to TestTool";
+ ItemBitmap = Bitmap {
+ File = "ttremote.bmp";
+ };
+ Text[ portuguese ] = "Transferir para TestTool";
+ Text[ russian ] = "Ïåðåäàòü â TestTool";
+ Text[ greek ] = "ÌåôÜäïóç ðñïò ôï TestTool";
+ Text[ dutch ] = "Transfereren naar TestTool";
+ Text[ french ] = "Transmettre au TestTool";
+ Text[ spanish ] = "Transmitir al TestTool";
+ Text[ italian ] = "Trasferisci nel testtool";
+ Text[ danish ] = "Overfør til TestTool";
+ Text[ swedish ] = "Överför till TestTool";
+ Text[ polish ] = "Przenieœ do TestTool";
+ Text[ portuguese_brazilian ] = "Zum TestTool Übertragen";
+ Text[ japanese ] = "TestTool‚Ö“]‘—";
+ Text[ korean ] = "TestTool·Î ¿Å±â±â";
+ Text[ chinese_simplified ] = "´«ËÍÖÁ TestTool";
+ Text[ chinese_traditional ] = "¶Ç»¼µ¹ TestTool";
+ Text[ arabic ] = "äÞá Åáì TestTool";
+ Text[ turkish ] = "TestTool'a aktar";
+ };
+ ToolBoxItem {
+ Type = TOOLBOXITEM_SEPARATOR;
+ };
+ ToolBoxItem {
+ Identifier = TT_ALLWIN;
+ Text = "Alle Fenster anzeigen";
+ Text[ english_us ] = "Show all windows";
+ ItemBitmap = Bitmap {
+ File = "ttall.bmp";
+ };
+ Text[ portuguese ] = "Mostrar janelas todas";
+ Text[ russian ] = "Ïîêàçàòü âñå îêíà";
+ Text[ greek ] = "ÅìöÜíéóç üëùí ôùí ðáñáèýñùí";
+ Text[ dutch ] = "Alle vensters weergeven";
+ Text[ french ] = "Afficher toutes les fenêtres";
+ Text[ spanish ] = "Mostrar todas las ventanas";
+ Text[ italian ] = "Mostra tutte le finestre";
+ Text[ danish ] = "Vis alle vinduer";
+ Text[ swedish ] = "Visa alla fönster";
+ Text[ polish ] = "Poka¿ wszystkie okna";
+ Text[ portuguese_brazilian ] = "Alle Fenster anzeigen";
+ Text[ japanese ] = "‚·‚ׂĂ̳¨ÝÄÞ³‚ð•\\Ž¦";
+ Text[ korean ] = "¸ðµç â Ç¥½Ã";
+ Text[ chinese_simplified ] = "ÏÔʾȫ²¿ÊÓ´°";
+ Text[ chinese_traditional ] = "Åã¥Ü©Ò¦³ªºµøµ¡";
+ Text[ arabic ] = "ÅÙåÇÑ ßÇÝÉ ÇáäæÇÝÐ";
+ Text[ turkish ] = "Tüm pencereleri görüntüle";
+ };
+ ToolBoxItem {
+ Identifier = TT_KURZNAME;
+ Text = "Kurzname Anzeigen(Falls Vorhanden)";
+ Text[ english_us ] = "Show short name (if one exists)";
+ ItemBitmap = Bitmap {
+ File = "ttdef.bmp";
+ };
+ Text[ portuguese ] = "Mostrar nomes abreviados (se existentes)";
+ Text[ russian ] = "Ïîêàçàòü ñîêðàùåííîå èìÿ (åñëè åñòü)";
+ Text[ greek ] = "ÅìöÜíéóç óõíôïìïãñáößá (áí õðÜñ÷åé)";
+ Text[ dutch ] = "Afkorting weergeven (indien voorhanden)";
+ Text[ french ] = "Afficher le nom abrégé (short name) - s'il y a lieu";
+ Text[ spanish ] = "Mostrar nombres abreviados (si existen)";
+ Text[ italian ] = "Mostra nome abbreviato (se esistente)";
+ Text[ danish ] = "Vis kortnavn (hvis findes)";
+ Text[ swedish ] = "Visa kort namn(om det finns)";
+ Text[ polish ] = "Poka¿ skrót (o ile istnieje)";
+ Text[ portuguese_brazilian ] = "Kurzname Anzeigen(Falls Vorhanden)";
+ Text[ japanese ] = "’Z‚¢–¼‘O‚ð•\\Ž¦(Šù‘¶‚·‚éê‡)";
+ Text[ korean ] = "ªÀº À̸§(ÀÖÀ» °æ¿ì) Ç¥½Ã";
+ Text[ chinese_simplified ] = "ÏÔʾ¶ÌÃû³Æ(Èô´æÔڵĻ°)";
+ Text[ chinese_traditional ] = "Åã¥Üµu¦WºÙ(¦pªG¦s¦b)";
+ Text[ arabic ] = "ÅÙåÇÑ ÇáÇÓã ÇáãÎÊÕÑ (ÅÐÇ ßÇä ãæÌæÏÇð)";
+ Text[ turkish ] = "(Varsa) kýsaltmayý görüntüle";
+ };
+ ToolBoxItem {
+ Identifier = TT_LANGNAME;
+ Text = "Langname immer Anzeigen";
+ Text[ english_us ] = "Always show long name";
+ ItemBitmap = Bitmap {
+ File = "tthid.bmp";
+ };
+ Text[ portuguese ] = "Mostrar sempre nome extenso";
+ Text[ russian ] = "Âñåãäà ïîêàçûâàòü ïîëíîå èìÿ";
+ Text[ greek ] = "Íá ãßíåôáé ðÜíôá åìöÜíéóç ôùí ïíïìÜôùí ìåãÜëïõ ìÞêïõò";
+ Text[ dutch ] = "Volledige naam altijd weergeven";
+ Text[ french ] = "Toujours afficher le nom long";
+ Text[ spanish ] = "Mostrar siempre los nombres largos";
+ Text[ italian ] = "Mostra nome intero";
+ Text[ danish ] = "Vis altid langt navn";
+ Text[ swedish ] = "Visa alltid långt namn";
+ Text[ polish ] = "Pokazuj zawsze pe³n¹ nazwê";
+ Text[ portuguese_brazilian ] = "Langname immer Anzeigen";
+ Text[ japanese ] = "í‚É’·‚¢–¼‘O‚ð•\\Ž¦";
+ Text[ korean ] = "±ä À̸§ Ç×»ó Ç¥½Ã";
+ Text[ chinese_simplified ] = "×ÜÊÇÏÔʾ³¤Ãû³Æ(È«³Æ)";
+ Text[ chinese_traditional ] = "Á`¬OÅã¥Üªø¦WºÙ";
+ Text[ arabic ] = "ÅÙåÇÑ ÇáÇÓã ÇáØæíá ÏÇÆãÇð";
+ Text[ turkish ] = "Tam adý daima görüntüle";
+ };
+ };
+ Text[ portuguese ] = "DisplayHID";
+ Text[ russian ] = "DisplayHID";
+ Text[ greek ] = "DisplayHID";
+ Text[ dutch ] = "DisplayHID";
+ Text[ french ] = "DisplayHID";
+ Text[ spanish ] = "DisplayHID";
+ Text[ italian ] = "DisplayHID";
+ Text[ danish ] = "DisplayHID";
+ Text[ swedish ] = "DisplayHID";
+ Text[ polish ] = "DisplayHID";
+ Text[ portuguese_brazilian ] = "DisplayHID";
+ Text[ japanese ] = "DisplayHID";
+ Text[ korean ] = "DisplayHID";
+ Text[ chinese_simplified ] = "DisplayHID";
+ Text[ chinese_traditional ] = "DisplayHID";
+ Text[ arabic ] = "DisplayHID";
+ Text[ turkish ] = "DisplayHID";
+};
+
+Bitmap TT_SHOW2 {
+ File = "ttshow2.bmp";
+};
+
+FloatingWindow TT_INLINE_TRANSLATION {
+ SVLook = TRUE;
+ Size = MAP_APPFONT( 2*Control_Border + 4*ButtonWidth + 3*Button_Button, 120 );
+ Text = "Inplace Translation";
+ Text[ ENGLISH ] = "Inplace Translation";
+ Text[ DANISH ] = "Ny oversættelse";
+ Text[ ENGLISH_US ] = "Inplace Translation";
+ Text[ SPANISH ] = "Nueva traducción";
+ Text[ FRENCH ] = "Relogement inline";
+ Text[ ITALIAN ] = "Nuova traduzione";
+ Text[ JAPANESE ] = "‚Í‚ßž‚Ý–|–ó";
+ Text[ DUTCH ] = "Vertaling";
+ Text[ POLISH ] = "W miejsce t³umaczenia";
+ Text[ PORTUGUESE_BRAZILIAN ] = "Inplace Translation";
+ Text[ RUSSIAN ] = "Íîâûé ïåðåâîä";
+ Text[ SWEDISH ] = "Översättning på plats";
+ Text[ CHINESE_SIMPLIFIED ] = "·­Ò빤¾ß";
+ Text[ PORTUGUESE ] = "Inplace Translation";
+ Moveable = TRUE;
+ Closeable = TRUE;
+ Zoomable = TRUE;
+ GroupBox TT_GB_TRANSLATION {
+ Pos = MAP_APPFONT( 2, 3 );
+ Size = MAP_APPFONT( 173, 44 );
+ Text = "Translation";
+ Text[ ENGLISH_US ] = "Translation";
+ Text[ portuguese ] = "Tradução";
+ Text[ russian ] = "Ïåðåâîä";
+ Text[ dutch ] = "Vertaling";
+ Text[ french ] = "Relogement";
+ Text[ spanish ] = "Traducción";
+ Text[ italian ] = "Traduzione";
+ Text[ danish ] = "Oversættelse";
+ Text[ swedish ] = "Översättning";
+ Text[ polish ] = "T³umaczenie";
+ Text[ portuguese_brazilian ] = "Translation";
+ Text[ japanese ] = "–|–ó";
+ Text[ chinese_simplified ] = "·­Òë";
+ Text[ chinese_traditional ] = "½Ķ";
+ Text[ arabic ] = "ÊÑÌãÉ";
+ Text[ greek ] = "ÌåôÜöñáóç";
+ Text[ korean ] = "¹ø¿ª";
+ Text[ turkish ] = "Çeviri";
+ Text[ language_user1 ] = " ";
+ };
+ Edit TT_E_NEW {
+ Disable = TRUE;
+ Border = TRUE;
+ Pos = MAP_APPFONT( 7, 16 );
+ Size = MAP_APPFONT( 162, 12 );
+ Text = "~Edit";
+ Text[ ENGLISH ] = "Edit";
+ Text[ DANISH ] = "Rediger";
+ Text[ ENGLISH_US ] = "~Edit";
+ Text[ SPANISH ] = "~Editar";
+ Text[ FRENCH ] = "~Edition";
+ Text[ ITALIAN ] = "Modifica";
+ Text[ JAPANESE ] = "•ÒW(~E)";
+ Text[ DUTCH ] = "~Editeren";
+ Text[ POLISH ] = "Edytuj";
+ Text[ PORTUGUESE_BRAZILIAN ] = "Edit";
+ Text[ RUSSIAN ] = "Ïðàâêà";
+ Text[ SWEDISH ] = "~Redigera";
+ Text[ CHINESE_SIMPLIFIED ] = "±à¼­(~E)";
+ Text[ PORTUGUESE ] = "~Editar";
+ TabStop = TRUE;
+ Text[ chinese_traditional ] = "½s¿è(~E)";
+ Text[ arabic ] = "ÊÍÑíÑ";
+ Text[ greek ] = "Åðåîåñãáóßá";
+ Text[ korean ] = "ÆíÁý(~E)";
+ Text[ turkish ] = "~Düzenle";
+ Text[ language_user1 ] = " ";
+ };
+ FixedText TT_FT_OLD {
+ Pos = MAP_APPFONT( 7, 33 );
+ Size = MAP_APPFONT( 162, 10 );
+ Text = "Original Text";
+ Text[ ENGLISH ] = "Original Text";
+ Text[ DANISH ] = "Originaltekst";
+ Text[ ENGLISH_US ] = "Original Text";
+ Text[ SPANISH ] = "Texto original";
+ Text[ FRENCH ] = "Texte d'origine";
+ Text[ ITALIAN ] = "Testo originale";
+ Text[ JAPANESE ] = "µØ¼ÞÅÙ•¶‘";
+ Text[ DUTCH ] = "Originele tekst";
+ Text[ POLISH ] = "Tekst oryginalny";
+ Text[ PORTUGUESE_BRAZILIAN ] = "Original Text";
+ Text[ RUSSIAN ] = "Òåêñò îðèãèíàëà";
+ Text[ SWEDISH ] = "Original text";
+ Text[ CHINESE_SIMPLIFIED ] = "Ô­À´µÄÎÄ×Ö";
+ Text[ PORTUGUESE ] = "Texto original";
+ Text[ chinese_traditional ] = "­ì¨Óªº¤å¦r";
+ Text[ arabic ] = "ÇáäÕ ÇáÃÕáí";
+ Text[ greek ] = "Áñ÷éêü êåßìåíï";
+ Text[ korean ] = "¿ø·¡ ÅؽºÆ®";
+ Text[ turkish ] = "Asýl metin";
+ Text[ language_user1 ] = " ";
+ };
+ GroupBox TT_GB_COMMENT {
+ Pos = MAP_APPFONT( 2, 52 );
+ Size = MAP_APPFONT( 173, 32 );
+ Text = "Comment";
+ Text[ ENGLISH_US ] = "Comment";
+ Text[ portuguese ] = "Comentário";
+ Text[ russian ] = "Êîììåíòàðèé";
+ Text[ dutch ] = "Commentaar";
+ Text[ french ] = "Commentaire";
+ Text[ spanish ] = "Comentario";
+ Text[ italian ] = "Commento";
+ Text[ danish ] = "Kommentar";
+ Text[ swedish ] = "Kommentar";
+ Text[ polish ] = "Komentarz";
+ Text[ portuguese_brazilian ] = "Comment";
+ Text[ japanese ] = "ºÒÝÄ";
+ Text[ chinese_simplified ] = "±¸×¢";
+ Text[ chinese_traditional ] = "³Æµù";
+ Text[ arabic ] = "ÊÚáíÞ";
+ Text[ greek ] = "Ó÷üëéï";
+ Text[ korean ] = "¸Þ¸ð";
+ Text[ turkish ] = "Açýklama";
+ Text[ language_user1 ] = " ";
+ };
+ Edit TT_E_COMMENT {
+ Disable = TRUE;
+ Border = TRUE;
+ Pos = MAP_APPFONT( 7, 64 );
+ Size = MAP_APPFONT( 162, 12 );
+ Text = "~Comment";
+ Text[ ENGLISH_US ] = "~Comment";
+ TabStop = TRUE;
+ Text[ portuguese ] = "~Comentário";
+ Text[ russian ] = "Êîììåíòàðèé";
+ Text[ dutch ] = "~Commentaar";
+ Text[ french ] = "~Commentaire";
+ Text[ spanish ] = "~Comentario";
+ Text[ italian ] = "Commento";
+ Text[ danish ] = "Kommentar";
+ Text[ swedish ] = "~Kommentar";
+ Text[ polish ] = "Komentarz";
+ Text[ portuguese_brazilian ] = "Comment";
+ Text[ japanese ] = "ºÒÝÄ(~C)";
+ Text[ chinese_simplified ] = "±¸×¢(~C)";
+ Text[ chinese_traditional ] = "³Æµù(~C)";
+ Text[ arabic ] = "ÊÚáíÞ";
+ Text[ greek ] = "Ó÷üëéï";
+ Text[ korean ] = "¸Þ¸ð(~C)";
+ Text[ turkish ] = "~Açýklama";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton TT_PB_SELECT {
+ Pos = MAP_APPFONT( Control_Border, 89 );
+ Size = MAP_APPFONT( ButtonWidth, 12 );
+ TabStop = TRUE;
+ Text = "~Select";
+ Text[ ENGLISH ] = "Select";
+ Text[ DANISH ] = "Marker";
+ Text[ ENGLISH_US ] = "~Select";
+ Text[ SPANISH ] = "~Seleccionar";
+ Text[ FRENCH ] = "~Sélectionner";
+ Text[ ITALIAN ] = "Seleziona";
+ Text[ JAPANESE ] = "‘I‘ð‚·‚é(~S)";
+ Text[ DUTCH ] = "~Selecteren";
+ Text[ POLISH ] = "Zaznacz";
+ Text[ PORTUGUESE_BRAZILIAN ] = "Select";
+ Text[ RUSSIAN ] = "Îòáîð";
+ Text[ SWEDISH ] = "~Markera";
+ Text[ CHINESE_SIMPLIFIED ] = "Ñ¡Ôñ(~S)";
+ Text[ PORTUGUESE ] = "~Seleccionar";
+ Text[ chinese_traditional ] = "¿ï¾Ü(~S)";
+ Text[ arabic ] = "ÊÍÏíÏ";
+ Text[ greek ] = "ÅðéëïãÞ";
+ Text[ korean ] = "¼±ÅÃ(~S)";
+ Text[ turkish ] = "~Seç";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton TT_PB_RESTORE {
+ Disable = TRUE;
+ Pos = MAP_APPFONT( Control_Border + ButtonWidth + Button_Button, 89 );
+ Size = MAP_APPFONT( ButtonWidth, 12 );
+ TabStop = TRUE;
+ Text = "~Restore";
+ Text[ ENGLISH ] = "~Restore";
+ Text[ english_us ] = "~Restore";
+ Text[ portuguese ] = "~Restaurar";
+ Text[ russian ] = "~Âîññòàíîâèòü";
+ Text[ greek ] = "Åðáíáöï~ñÜ";
+ Text[ dutch ] = "~Restore";
+ Text[ french ] = "~Restaurer";
+ Text[ spanish ] = "~Restore";
+ Text[ italian ] = "~Rispristina";
+ Text[ danish ] = "Gendan";
+ Text[ swedish ] = "Återställ";
+ Text[ polish ] = "Przywróæ";
+ Text[ portuguese_brazilian ] = "~Restore";
+ Text[ japanese ] = "Œ³‚Ìó‘Ô‚É–ß‚·(~R)";
+ Text[ korean ] = "º¹¿ø(~R)";
+ Text[ chinese_simplified ] = "ÐÞ¸´(~R)";
+ Text[ chinese_traditional ] = "«ì´_(~R)";
+ Text[ arabic ] = "ÇÓÊÚÇÏÉ";
+ Text[ turkish ] = "~Geri yükle";
+ };
+ PushButton TT_PB_ACCEPT {
+ Disable = TRUE;
+ Pos = MAP_APPFONT( Control_Border + 2*(ButtonWidth + Button_Button), 89 );
+ Size = MAP_APPFONT( ButtonWidth, 12 );
+ TabStop = TRUE;
+ Text = "~Accept";
+ Text[ ENGLISH ] = "Accept";
+ Text[ DANISH ] = "Accepter";
+ Text[ ENGLISH_US ] = "~Accept";
+ Text[ SPANISH ] = "~Aceptar";
+ Text[ FRENCH ] = "~Accepter";
+ Text[ ITALIAN ] = "Accetta";
+ Text[ JAPANESE ] = "³‘ø(~A)";
+ Text[ DUTCH ] = "~Accepteren";
+ Text[ POLISH ] = "Zaakceptuj";
+ Text[ PORTUGUESE_BRAZILIAN ] = "Accept";
+ Text[ RUSSIAN ] = "Ïðèíÿòü";
+ Text[ SWEDISH ] = "~Acceptera";
+ Text[ CHINESE_SIMPLIFIED ] = "½ÓÊÜ(~A)";
+ Text[ PORTUGUESE ] = "~Aceitar";
+ Text[ chinese_traditional ] = "±µ¨ü(~A)";
+ Text[ arabic ] = "ÞÈæá";
+ Text[ greek ] = "~Áðïäï÷Þ";
+ Text[ korean ] = "µ¿ÀÇ(~A)";
+ Text[ turkish ] = "~Kabul";
+ Text[ language_user1 ] = " ";
+ };
+ PushButton TT_PB_NEXT {
+ Pos = MAP_APPFONT( Control_Border + 3*(ButtonWidth + Button_Button), 89 );
+ Size = MAP_APPFONT( ButtonWidth, 12 );
+ TabStop = TRUE;
+ Text = "~Next";
+ Text[ ENGLISH ] = "Next";
+ Text[ DANISH ] = "Næste";
+ Text[ ENGLISH_US ] = "~Next";
+ Text[ SPANISH ] = "~Siguiente";
+ Text[ FRENCH ] = "~Suivant";
+ Text[ ITALIAN ] = "Avanti";
+ Text[ JAPANESE ] = "ŽŸ‚Ö(~N)";
+ Text[ DUTCH ] = "~Volgende";
+ Text[ POLISH ] = "Dalej";
+ Text[ PORTUGUESE_BRAZILIAN ] = "Next";
+ Text[ RUSSIAN ] = "Äàëåå";
+ Text[ SWEDISH ] = "~Nästa";
+ Text[ CHINESE_SIMPLIFIED ] = "¼ÌÐø(~N)";
+ Text[ PORTUGUESE ] = "~Seguinte";
+ Text[ chinese_traditional ] = "Ä~Äò(~N)";
+ Text[ arabic ] = "ÇáÊÇáí";
+ Text[ greek ] = "Åðüìåíï";
+ Text[ korean ] = "´ÙÀ½(~N)";
+ Text[ turkish ] = "~Ýleri";
+ Text[ language_user1 ] = " ";
+ };
+ Text[ chinese_traditional ] = "½Ķ¤u¨ã";
+ Text[ arabic ] = "ÊÑÌãÉ Ýí ÇáãæÞÚ";
+ Text[ greek ] = "ÍÝá ìåôÜöñáóç";
+ Text[ korean ] = "³»ºÎ ¹ø¿ª";
+ Text[ turkish ] = "Inplace Translation";
+ Text[ language_user1 ] = " ";
+};
+
+MessBox TT_DISCARD_CHANGED_DATA {
+ Buttons = WB_YES_NO;
+ DefButton = WB_DEF_YES;
+ Message = "The Translation will be lost. Proceed?";
+ Message[ ENGLISH_US ] = "The Translation will be lost. Proceed anyway?";
+ Message[ portuguese ] = "A tradução será perdida. Continuar?";
+ Message[ russian ] = "Ïåðåâîä áóäåò ïîòåðÿí. Âñå ðàâíî ïðîäîëæèòü?";
+ Message[ dutch ] = "De vertaling gaat verloren. Toch doorgaan?";
+ Message[ french ] = "Le relogement sera perdu. Souhaitez-vous poursouivre ?";
+ Message[ spanish ] = "Se perderá la traducción. ¿Continuar?";
+ Message[ italian ] = "La traduzione andrà persa. Continuare?";
+ Message[ danish ] = "Oversættelsen vil gå tabt. Vil du fortsætte alligevel?";
+ Message[ swedish ] = "Översättningen kommer att gå förlorad. Fortsätta ändå?";
+ Message[ polish ] = "T³umaczenie zaginie. Kontynuowaæ?";
+ Message[ portuguese_brazilian ] = "The Translation will be lost. Proceed?";
+ Message[ japanese ] = "–|–󂪎¸‚í‚ê‚Ü‚µ‚½B‘±‚¯‚Ü‚·‚©?";
+ Message[ chinese_simplified ] = "·­ÒëÄÚÈݽ«»áÒÅʧ¡£ÄúÒª¼ÌÐøÂð£¿";
+ Message[ chinese_traditional ] = "½Ķ¤º®e±N·|¬y¥¢¡C±z­nÄ~Äò¡H";
+ Message[ arabic ] = "åÐå ÇáÊÑÌãÉ ÓæÝ ÊÖíÚ. åá ÊÑíÏ ÇáãÊÇÈÚÉ Úáì ÇáÑÛã ãä Ðáß¿";
+ Message[ greek ] = "Ç ìåôÜöñáóç èá ÷áèåß. ÓõíÝ÷åéá;";
+ Message[ korean ] = "¹ø¿ªÀ» ÀÒ°Ô µË´Ï´Ù. °è¼ÓÇϽðڽÀ´Ï±î?";
+ Message[ turkish ] = "Çevriri kaybolacak. Devam etmek istiyor musunuz?";
+ Message[ language_user1 ] = " ";
+};
+
+ErrorBox TT_NO_CONTROL {
+ Buttons = WB_OK;
+ DefButton = WB_DEF_OK;
+ Message = "The Control is no longer valid. The Translation cannot be saved.";
+ Message [ ENGLISH_US ] = "This Control is no longer valid. The Translation cannot be saved.";
+ Message[ portuguese ] = "Este Controlo já não é válido. Impossível guardar a tradução.";
+ Message[ russian ] = "Êîìàíäà áîëüøå íåäåéñòâèòåëüíà. Ïåðåâîä ñîõðàíèòü íåâîçìîæíî.";
+ Message[ dutch ] = "De controle is niet langer geldig. De vertaling kan niet worden opgeslagen";
+ Message[ french ] = "Le contrôle n'est plus valable. Impossible d'enregistrer le relogement.";
+ Message[ spanish ] = "La validez del control no durará mucho. No se puede guardar la traducción.";
+ Message[ italian ] = "Il controllo non è più valido. Non è stato possibile salvare la traduzione.";
+ Message[ danish ] = "Kontrollen er ikke mere tilgængelig. Oversættelsen kan ikke gemmes.";
+ Message[ swedish ] = "Kontrollen är inte längre giltig. Översättningen kan inte sparas.";
+ Message[ polish ] = "Polecenie nie jest wa¿ne. T³umaczenia nie mo¿na zapisaæ.";
+ Message[ portuguese_brazilian ] = "The Control is no longer valid. The Translation cannot be saved.";
+ Message[ japanese ] = "ºÝÄÛ°Ù‚Í‚à‚¤—LŒø‚Å‚Í‚ ‚è‚Ü‚¹‚ñB–|–ó‚ð•Û‘¶‚Å‚«‚Ü‚¹‚ñB";
+ Message[ chinese_simplified ] = "Õâ¸ö¿Ø¼þÒѾ­ÎÞЧ¡£ÎÞ·¨´æÅÌ·­ÒëÄÚÈÝ¡£";
+ Message[ chinese_traditional ] = "³o­Ó±±¨î¶µ¤w¸gµL®Ä¡CµLªkÀx¦s½Ķ¤º®e¡C";
+ Message[ arabic ] = "ÚäÕÑ ÇáÊÍßã åÐÇ áã íÚÏ ÕÇáÍÇð. áÇ íãßä ÍÝÙ ÇáÊÑÌãÉ.";
+ Message[ greek ] = "Ôï óôïé÷åßï åëÝã÷ïõ äåí åßíáé ðëÝïí Ýãêõñï. Äåí åßíáé äõíáôüí íá áðïèçêåõôåß ç ìåôÜöñáóç.";
+ Message[ korean ] = "ÄÁÆ®·ÑÀÌ ´õ ÀÌ»ó À¯È¿ÇÏÁö ¾Ê½À´Ï´Ù. º¯È¯ÇÑ °ÍÀ» ÀúÀåÇÒ ¼ö ¾ø½À´Ï´Ù.";
+ Message[ turkish ] = "Denetim artýk geçerli deðil. Çeviri kaydedilemiyor.";
+ Message[ language_user1 ] = " ";
+};
+
+String TT_GPF
+{
+ Text = "GPF Aufgetreten";
+ Text[ english_us ] = "GPF occured";
+ Text[ portuguese ] = "Ocorreu um erro GPF";
+ Text[ russian ] = "Ïðîèçîøëà îøèáêà";
+ Text[ greek ] = "ÐáñïõóéÜóôçêå ãåíéêü óöÜëìá ðñïóôáóßáò (GPF)";
+ Text[ dutch ] = "Algemene fout opgetreden";
+ Text[ french ] = "Erreur (GPF) survenue";
+ Text[ spanish ] = "Ha ocurrido un error";
+ Text[ italian ] = "Si è verificato un GPF";
+ Text[ danish ] = "Der opstod en fejl";
+ Text[ swedish ] = "Fel uppstod";
+ Text[ polish ] = "Wyst¹pi³ b³¹d";
+ Text[ portuguese_brazilian ] = "GPF Aufgetreten";
+ Text[ japanese ] = "GPF‚ª”­¶‚µ‚Ü‚µ‚½";
+ Text[ korean ] = "GPF ¹ß»ý";
+ Text[ chinese_simplified ] = "³öÏÖ´íÎó";
+ Text[ chinese_traditional ] = "µo¥X¿ù»~";
+ Text[ arabic ] = "ÍÏË ÎØÃ GPF";
+ Text[ turkish ] = "GKH oluþtu";
+};
+
+String TT_ALTERNATE_CAPTION
+{
+ Text = "HelpID ungleich UniqueID: ";
+ Text[ english_us ] = "HelpID does not match UniqueID: ";
+ Text[ portuguese ] = "HelpID desigual a UniqueID ";
+ Text[ russian ] = "HelpID íå ðàâíî UniqueID: ";
+ Text[ greek ] = "HelpID äåí åßíáé ßóï ìå UniqueID:";
+ Text[ dutch ] = "HelpID niet gelijk aan UniqueID: ";
+ Text[ french ] = "HelpID différent de l'UniqueID : ";
+ Text[ spanish ] = "HelpID difiere de UniqueID:";
+ Text[ italian ] = "HelpID diverso da UniqueID: ";
+ Text[ danish ] = "HelpID ikke lig med UniqueID: ";
+ Text[ swedish ] = "HelpID ej lika med UniqueID: ";
+ Text[ polish ] = "HelpID nie jest równy UniquellID: ";
+ Text[ portuguese_brazilian ] = "GPF Aufgetreten";
+ Text[ japanese ] = "ÍÙÌßID ‚Æ ÕÆ°¸ID‚Æ‚Í“¯ˆê‚Å‚Í‚ ‚è‚Ü‚¹‚ñ: ";
+ Text[ korean ] = "µµ¿ò¸»ID¿Í °íÀ¯ID°¡ ÀÏÄ¡ÇÏÁö ¾ÊÀ½ ";
+ Text[ chinese_simplified ] = "HelpID does not match UniqueID: ";
+ Text[ chinese_traditional ] = "HelpID does not match UniqueID: ";
+ Text[ arabic ] = "HelpID ÛíÑ ãØÇÈÞ áÜ UniqueID: ";
+ Text[ turkish ] = "HelpID ile UniqueID eþit deðil: ";
+};
diff --git a/svtools/source/plugapp/ttprops.cxx b/svtools/source/plugapp/ttprops.cxx
new file mode 100644
index 000000000000..7548d4cb764c
--- /dev/null
+++ b/svtools/source/plugapp/ttprops.cxx
@@ -0,0 +1,119 @@
+/*************************************************************************
+ *
+ * $RCSfile: ttprops.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:03 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVTOOLS_TTPROPS_HXX // handmade
+#include "ttprops.hxx"
+#endif
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+#ifndef _SV_BITMAP_HXX //autogen
+#include <vcl/bitmap.hxx>
+#endif
+#ifndef _RTTI_HXX // manual
+#include <tools/rtti.hxx>
+#endif
+
+TYPEINIT1( TTProperties, ApplicationProperty )
+
+BOOL TTProperties::RequestProperty( USHORT nRequest )
+{
+ if ( (( nRequest & TT_PR_ONCE ) == 0) || (nDonePRs & (nRequest & 0x0ff)) == 0 )
+ {
+ nActualPR = nRequest;
+ nDonePRs |= nRequest;
+ GetpApp()->Property( *this );
+ return nActualPR == 0;
+ }
+ return TRUE;
+}
+
+
+BOOL TTProperties::GetSlots()
+{
+ RequestProperty( TT_PR_SLOTS );
+ return HasSlots();
+}
+
+USHORT TTProperties::ExecuteFunction( USHORT nSID, SfxPoolItem** ppArgs, USHORT nMode )
+{
+ mnSID = nSID;
+ mppArgs = ppArgs;
+ mnMode = nMode;
+ RequestProperty( TT_PR_DISPATCHER );
+ mppArgs = NULL;
+ return nActualPR;
+}
+
+BOOL TTProperties::Img( Bitmap *pBmp )
+{
+ BOOL bRet;
+ mpBmp = pBmp;
+ bRet = RequestProperty( TT_PR_IMG );
+ mpBmp = NULL;
+ return bRet;
+}
+
+SvtResId TTProperties::GetSvtResId( USHORT nId )
+{
+ return SvtResId( nId );
+}
+
diff --git a/svtools/source/svdde/ddecli.cxx b/svtools/source/svdde/ddecli.cxx
new file mode 100644
index 000000000000..70c6fb0db864
--- /dev/null
+++ b/svtools/source/svdde/ddecli.cxx
@@ -0,0 +1,509 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddecli.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string.h> // memset
+#include "ddeimp.hxx"
+#include <svdde.hxx>
+
+#include <osl/thread.h>
+
+#ifndef _TOOLS_DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+// static DWORD hDdeInst = NULL;
+// static short nInstance = 0;
+
+// DdeConnections* DdeConnection::pConnections = NULL;
+
+DdeInstData* ImpInitInstData()
+{
+ DdeInstData* pData = new DdeInstData;
+ memset( pData,0,sizeof(DdeInstData) );
+ DdeInstData** ppInst = (DdeInstData**)GetAppData( SHL_SVDDE );
+ *ppInst = pData;
+ return pData;
+}
+
+void ImpDeinitInstData()
+{
+ DdeInstData** ppInst = (DdeInstData**)GetAppData( SHL_SVDDE );
+ delete (*ppInst);
+ *ppInst = 0;
+}
+
+
+struct DdeImp
+{
+ HCONV hConv;
+ long nStatus;
+};
+
+// --- DdeInternat::CliCallback() ----------------------------------
+
+#ifdef WNT
+HDDEDATA CALLBACK DdeInternal::CliCallback(
+ WORD nCode, WORD nCbType, HCONV hConv, HSZ hText1, HSZ hText2,
+ HDDEDATA hData, DWORD nInfo1, DWORD nInfo2 )
+#else
+#if defined ( MTW ) || ( defined ( GCC ) && defined ( OS2 )) || defined( ICC )
+HDDEDATA CALLBACK __EXPORT DdeInternal::CliCallback(
+ WORD nCode, WORD nCbType, HCONV hConv, HSZ hText1, HSZ hText2,
+ HDDEDATA hData, DWORD nInfo1, DWORD nInfo2 )
+#else
+HDDEDATA CALLBACK _export DdeInternal::CliCallback(
+ WORD nCode, WORD nCbType, HCONV hConv, HSZ hText1, HSZ hText2,
+ HDDEDATA hData, DWORD nInfo1, DWORD nInfo2 )
+#endif
+#endif
+{
+ HDDEDATA nRet = DDE_FNOTPROCESSED;
+ DdeConnections& rAll = (DdeConnections&)DdeConnection::GetConnections();
+ DdeConnection* self = 0;
+
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+
+ for ( self = rAll.First(); self; self = rAll.Next() )
+ if ( self->pImp->hConv == hConv )
+ break;
+
+ if( self )
+ {
+ DdeTransaction* t;
+ BOOL bFound = FALSE;
+ for( t = self->aTransactions.First(); t; t = self->aTransactions.Next() )
+ {
+ switch( nCode )
+ {
+ case XTYP_XACT_COMPLETE:
+ if( (DWORD)t->nId == nInfo1 )
+ {
+ nCode = t->nType & (XCLASS_MASK | XTYP_MASK);
+ t->bBusy = FALSE;
+ t->Done( 0 != hData );
+ bFound = TRUE;
+ }
+ break;
+
+ case XTYP_DISCONNECT:
+ self->pImp->hConv = DdeReconnect( hConv );
+ self->pImp->nStatus = self->pImp->hConv
+ ? DMLERR_NO_ERROR
+ : DdeGetLastError( pInst->hDdeInstCli );
+ t = 0;
+ nRet = 0;
+ bFound = TRUE;
+ break;
+
+ case XTYP_ADVDATA:
+ bFound = BOOL( *t->pName == hText2 );
+ break;
+ }
+ if( bFound )
+ break;
+ }
+
+ if( t )
+ {
+ switch( nCode )
+ {
+ case XTYP_ADVDATA:
+ if( !hData )
+ {
+ ((DdeLink*) t)->Notify();
+ nRet = (HDDEDATA)DDE_FACK;
+ break;
+ }
+ // kein break;
+
+ case XTYP_REQUEST:
+ if( !hData && XTYP_REQUEST == nCode )
+ {
+
+ }
+
+ DdeData d;
+ d.pImp->hData = hData;
+ d.pImp->nFmt = nCbType;
+ d.Lock();
+ t->Data( &d );
+ nRet = (HDDEDATA)DDE_FACK;
+ break;
+ }
+ }
+ }
+ return nRet;
+}
+
+// --- DdeConnection::DdeConnection() ------------------------------
+
+DdeConnection::DdeConnection( const String& rService, const String& rTopic )
+{
+ pImp = new DdeImp;
+ pImp->nStatus = DMLERR_NO_ERROR;
+ pImp->hConv = NULL;
+
+ DdeInstData* pInst = ImpGetInstData();
+ if( !pInst )
+ pInst = ImpInitInstData();
+ pInst->nRefCount++;
+ pInst->nInstanceCli++;
+ if ( !pInst->hDdeInstCli )
+ {
+ pImp->nStatus = DdeInitialize( &pInst->hDdeInstCli,
+ (PFNCALLBACK)DdeInternal::CliCallback,
+ APPCLASS_STANDARD | APPCMD_CLIENTONLY |
+ CBF_FAIL_ALLSVRXACTIONS |
+ CBF_SKIP_REGISTRATIONS |
+ CBF_SKIP_UNREGISTRATIONS, 0L );
+ pInst->pConnections = new DdeConnections;
+ }
+
+ pService = new DdeString( pInst->hDdeInstCli, rService );
+ pTopic = new DdeString( pInst->hDdeInstCli, rTopic );
+
+ if ( pImp->nStatus == DMLERR_NO_ERROR )
+ {
+ pImp->hConv = DdeConnect( pInst->hDdeInstCli,*pService,*pTopic, NULL);
+ if( !pImp->hConv )
+ pImp->nStatus = DdeGetLastError( pInst->hDdeInstCli );
+ }
+
+ if ( pInst->pConnections )
+ pInst->pConnections->Insert( this );
+}
+
+// --- DdeConnection::~DdeConnection() -----------------------------
+
+DdeConnection::~DdeConnection()
+{
+ if ( pImp->hConv )
+ DdeDisconnect( pImp->hConv );
+
+ delete pService;
+ delete pTopic;
+
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ if ( pInst->pConnections )
+ pInst->pConnections->Remove( this );
+
+ pInst->nInstanceCli--;
+ pInst->nRefCount--;
+ if ( !pInst->nInstanceCli && pInst->hDdeInstCli )
+ {
+ if( DdeUninitialize( pInst->hDdeInstCli ) )
+ {
+ pInst->hDdeInstCli = NULL;
+ delete pInst->pConnections;
+ pInst->pConnections = NULL;
+ if( pInst->nRefCount == 0 )
+ ImpDeinitInstData();
+ }
+ }
+ delete pImp;
+}
+
+// --- DdeConnection::IsConnected() --------------------------------
+
+BOOL DdeConnection::IsConnected()
+{
+ CONVINFO c;
+#ifdef OS2
+ c.nSize = sizeof( c );
+#else
+ c.cb = sizeof( c );
+#endif
+ if ( DdeQueryConvInfo( pImp->hConv, QID_SYNC, &c ) )
+ return TRUE;
+ else
+ {
+ DdeInstData* pInst = ImpGetInstData();
+ pImp->hConv = DdeReconnect( pImp->hConv );
+ pImp->nStatus = pImp->hConv ? DMLERR_NO_ERROR : DdeGetLastError( pInst->hDdeInstCli );
+ return BOOL( pImp->nStatus == DMLERR_NO_ERROR );
+ }
+}
+
+// --- DdeConnection::GetServiceName() -----------------------------
+
+const String& DdeConnection::GetServiceName()
+{
+ return (const String&)*pService;
+}
+
+// --- DdeConnection::GetTopicName() -------------------------------
+
+const String& DdeConnection::GetTopicName()
+{
+ return (const String&)*pTopic;
+}
+
+// --- DdeConnection::GetConvId() ----------------------------------
+
+long DdeConnection::GetConvId()
+{
+ return (long)pImp->hConv;
+}
+
+const DdeConnections& DdeConnection::GetConnections()
+{
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ return *(pInst->pConnections);
+}
+
+// --- DdeTransaction::DdeTransaction() ----------------------------
+
+DdeTransaction::DdeTransaction( DdeConnection& d, const String& rItemName,
+ long n ) :
+ rDde( d )
+{
+ DdeInstData* pInst = ImpGetInstData();
+ pName = new DdeString( pInst->hDdeInstCli, rItemName );
+ nTime = n;
+ nId = 0;
+ nType = 0;
+ bBusy = FALSE;
+
+ rDde.aTransactions.Insert( this );
+}
+
+// --- DdeTransaction::~DdeTransaction() ---------------------------
+
+DdeTransaction::~DdeTransaction()
+{
+ if ( nId && rDde.pImp->hConv )
+ {
+ DdeInstData* pInst = ImpGetInstData();
+ DdeAbandonTransaction( pInst->hDdeInstCli, rDde.pImp->hConv, nId );
+ }
+
+ delete pName;
+ rDde.aTransactions.Remove( this );
+}
+
+// --- DdeTransaction::Execute() -----------------------------------
+
+void DdeTransaction::Execute()
+{
+ HSZ hItem = *pName;
+ void* pData = (void*)(const void *)aDdeData;
+ DWORD nData = (DWORD)(long)aDdeData;
+ UINT nFmt = aDdeData.pImp->nFmt;
+ DdeInstData* pInst = ImpGetInstData();
+
+ if ( nType == XTYP_EXECUTE )
+ hItem = NULL;
+ if ( nType != XTYP_EXECUTE && nType != XTYP_POKE )
+ {
+ pData = NULL;
+ nData = 0L;
+ }
+ if ( nTime )
+ {
+ HDDEDATA hData = DdeClientTransaction( (unsigned char*)pData,
+ nData, rDde.pImp->hConv,
+ hItem, nFmt, (UINT)nType,
+ (DWORD)nTime, (DWORD FAR*)NULL );
+
+ rDde.pImp->nStatus = DdeGetLastError( pInst->hDdeInstCli );
+ if( hData && nType == XTYP_REQUEST )
+ {
+ {
+ DdeData d;
+ d.pImp->hData = hData;
+ d.pImp->nFmt = nFmt;
+ d.Lock();
+ Data( &d );
+ }
+ DdeFreeDataHandle( hData );
+ }
+ }
+ else
+ {
+ if ( nId && rDde.pImp->hConv )
+ DdeAbandonTransaction( pInst->hDdeInstCli, rDde.pImp->hConv, nId);
+ nId = 0;
+ bBusy = TRUE;
+ HDDEDATA hRet = DdeClientTransaction( (unsigned char*)pData, nData,
+ rDde.pImp->hConv, hItem, nFmt,
+ (UINT)nType, TIMEOUT_ASYNC,
+ (DWORD FAR *) ((long*) &nId) );
+ rDde.pImp->nStatus = hRet ? DMLERR_NO_ERROR
+ : DdeGetLastError( pInst->hDdeInstCli );
+ }
+}
+
+// --- DdeTransaction::GetName() -----------------------------------
+
+const String& DdeTransaction::GetName() const
+{
+ return *pName;
+}
+
+// --- DdeTransaction::Data() --------------------------------------
+
+void __EXPORT DdeTransaction::Data( const DdeData* p )
+{
+ aData.Call( (void*)p );
+}
+
+// --- DdeTransaction::Done() --------------------------------------
+
+void __EXPORT DdeTransaction::Done( BOOL bDataValid )
+{
+ aDone.Call( (void*)bDataValid );
+}
+
+// --- DdeLink::DdeLink() ------------------------------------------
+
+DdeLink::DdeLink( DdeConnection& d, const String& aItemName, long n ) :
+ DdeTransaction (d, aItemName, n)
+{
+}
+
+// --- DdeLink::~DdeLink() -----------------------------------------
+
+DdeLink::~DdeLink()
+{
+ nType = (short)XTYP_ADVSTOP;
+ nTime = 0;
+}
+
+// --- DdeLink::Notify() -----------------------------------------
+
+void __EXPORT DdeLink::Notify()
+{
+ aNotify.Call( NULL );
+}
+
+// --- DdeRequest::DdeRequest() ------------------------------------
+
+DdeRequest::DdeRequest( DdeConnection& d, const String& i, long n ) :
+ DdeTransaction( d, i, n )
+{
+ nType = XTYP_REQUEST;
+}
+
+// --- DdeWarmLink::DdeWarmLink() ----------------------------------
+
+DdeWarmLink::DdeWarmLink( DdeConnection& d, const String& i, long n ) :
+ DdeLink( d, i, n )
+{
+ nType = XTYP_ADVSTART | XTYPF_NODATA;
+}
+
+// --- DdeHotLink::DdeHotLink() ------------------------------------
+
+DdeHotLink::DdeHotLink( DdeConnection& d, const String& i, long n ) :
+ DdeLink( d, i, n )
+{
+ nType = XTYP_ADVSTART;
+}
+
+// --- DdePoke::DdePoke() ------------------------------------------
+
+DdePoke::DdePoke( DdeConnection& d, const String& i, const char* p,
+ long l, ULONG f, long n ) :
+ DdeTransaction( d, i, n )
+{
+ aDdeData = DdeData( p, l, f );
+ nType = XTYP_POKE;
+}
+
+// --- DdePoke::DdePoke() ------------------------------------------
+
+DdePoke::DdePoke( DdeConnection& d, const String& i, const String& rData,
+ long n ) :
+ DdeTransaction( d, i, n )
+{
+ const char* p = ByteString( rData, osl_getThreadTextEncoding() ).GetBuffer();
+ aDdeData = DdeData( (char*) p, rData.Len(), CF_TEXT );
+ nType = XTYP_POKE;
+}
+
+// --- DdePoke::DdePoke() ------------------------------------------
+
+DdePoke::DdePoke( DdeConnection& d, const String& i, const DdeData& rData,
+ long n ) :
+ DdeTransaction( d, i, n )
+{
+ aDdeData = rData;
+ nType = XTYP_POKE;
+}
+
+// --- DdeExecute::DdeExecute() ------------------------------------
+
+DdeExecute::DdeExecute( DdeConnection& d, const String& rData, long n ) :
+ DdeTransaction( d, String(), n )
+{
+ const char* p = ByteString( rData, osl_getThreadTextEncoding() ).GetBuffer();;
+ aDdeData = DdeData( (char*) p, rData.Len() + 1, CF_TEXT );
+ nType = XTYP_EXECUTE;
+}
+
+// --- DdeConnection::GetError() -----------------------------------
+
+long DdeConnection::GetError()
+{
+ return pImp->nStatus;
+}
diff --git a/svtools/source/svdde/ddedata.cxx b/svtools/source/svdde/ddedata.cxx
new file mode 100644
index 000000000000..e6fb2d96f35a
--- /dev/null
+++ b/svtools/source/svdde/ddedata.cxx
@@ -0,0 +1,253 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddedata.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+// ACHTUNG: es wird angenommen, dass StarView-Clipboard-Foamatnummern
+// und Windows-Formatnummern identisch sind! Ist dies einmal nicht der
+// Fall, muessen die Routinen hier angepasst werden. Die Implementation
+// verwendet die hier defineirten Konversionen.
+
+#define UNICODE
+
+#include <string.h>
+#include "ddeimp.hxx"
+#include <svdde.hxx>
+
+#include <osl/thread.h>
+
+#if defined( WIN ) && defined( MSC )
+#pragma code_seg( "SVDDE_MISC_CODE" )
+#endif
+
+// --- DdeData::DdeData() ------------------------------------------
+
+DdeData::DdeData()
+{
+ pImp = new DdeDataImp;
+ pImp->hData = NULL;
+ pImp->nData = 0;
+ pImp->pData = NULL;
+ pImp->nFmt = CF_TEXT;
+}
+
+// --- DdeData::DdeData() ------------------------------------------
+
+DdeData::DdeData( const void* p, long n, ULONG f )
+{
+ pImp = new DdeDataImp;
+ pImp->hData = NULL;
+ pImp->pData = (LPBYTE)p;
+ pImp->nData = n;
+ SetFormat( f );
+}
+
+// --- DdeData::DdeData() ------------------------------------------
+
+DdeData::DdeData( const String& s )
+{
+ pImp = new DdeDataImp;
+ pImp->hData = NULL;
+ pImp->pData = (LPBYTE)s.GetBuffer();
+ pImp->nData = s.Len()+1;
+ pImp->nFmt = CF_TEXT;
+}
+
+// --- DdeData::DdeData() ------------------------------------------
+
+DdeData::DdeData( const DdeData& rData )
+{
+ pImp = new DdeDataImp;
+ pImp->hData = rData.pImp->hData;
+ pImp->nData = rData.pImp->nData;
+ pImp->pData = rData.pImp->pData;
+ pImp->nFmt = rData.pImp->nFmt;
+ Lock();
+}
+
+// --- DdeData::~DdeData() -----------------------------------------
+
+DdeData::~DdeData()
+{
+ if ( pImp && pImp->hData )
+ DdeUnaccessData( pImp->hData );
+ delete pImp;
+}
+
+// --- DdeData::Lock() ---------------------------------------------
+
+void DdeData::Lock()
+{
+ if ( pImp->hData )
+ pImp->pData = DdeAccessData( pImp->hData, (LPDWORD) &pImp->nData );
+}
+
+// --- DdeData::GetFormat() ----------------------------------------
+
+ULONG DdeData::GetFormat() const
+{
+ ULONG nRet = pImp->nFmt;
+ switch( nRet )
+ {
+ case CF_TEXT:
+ nRet = FORMAT_STRING;
+ break;
+
+ case CF_BITMAP:
+ nRet = FORMAT_BITMAP;
+ break;
+
+ case CF_METAFILEPICT:
+ nRet = FORMAT_GDIMETAFILE;
+ break;
+
+ default:
+#if defined(WIN) || defined(WNT)
+ if ( pImp->nFmt >= CF_MAX )
+ {
+ TCHAR szName[ 256 ];
+
+ if( GetClipboardFormatName( pImp->nFmt, szName, sizeof(szName) ) )
+ nRet = SotExchange::RegisterFormatName( String(szName) );
+ }
+#endif
+#if defined(PM2)
+ if( pImp->nFmt > CF_PALETTE )
+ {
+ char szName[ 256 ];
+
+ HATOMTBL hSysTable = WinQuerySystemAtomTable();
+ WinQueryAtomName( hSysTable, (ATOM)pImp->nFmt, (PSZ)szName,
+ sizeof( szName ) );
+ nRet = SotExchange::RegisterFormatName( String( szName ) );
+ }
+#endif
+ }
+ return nRet;
+}
+
+// --- DdeData::operator const char*() -----------------------------
+
+DdeData::operator const void*() const
+{
+ return pImp->pData;
+}
+
+// --- DdeData::operator long() ------------------------------------
+
+DdeData::operator long() const
+{
+ return pImp->nData;
+}
+
+// --- DdeData::operator =() ---------------------------------------
+
+DdeData& DdeData::operator = ( const DdeData& rData )
+{
+ if ( &rData != this )
+ {
+ DdeData tmp( rData );
+ delete pImp;
+ pImp = tmp.pImp;
+ tmp.pImp = NULL;
+ }
+
+ return *this;
+}
+
+// --- DdeData::SetFormat() ---------------------------------------
+
+void DdeData::SetFormat( ULONG nFmt )
+{
+ switch( nFmt )
+ {
+ case FORMAT_STRING:
+ pImp->nFmt = CF_TEXT;
+ break;
+ case FORMAT_BITMAP:
+ pImp->nFmt = CF_BITMAP;
+ break;
+ case FORMAT_GDIMETAFILE:
+ pImp->nFmt = CF_METAFILEPICT;
+ break;
+
+ default:
+ {
+ String aName( SotExchange::GetFormatName( nFmt ) );
+
+#if defined(WNT) || defined(WIN)
+
+ if( aName.Len() )
+ pImp->nFmt = RegisterClipboardFormat( aName.GetBuffer() );
+ else
+#endif
+#if defined( PM2 )
+
+ if( aName.Len() )
+ {
+ HATOMTBL hSysTable = WinQuerySystemAtomTable();
+ pImp->nFmt = (ULONG)WinAddAtom( hSysTable, (PSZ)aName.GetBuffer() );
+ }
+ else
+#endif
+ pImp->nFmt = (USHORT)nFmt;
+ }
+ }
+}
+
diff --git a/svtools/source/svdde/ddedll.cxx b/svtools/source/svdde/ddedll.cxx
new file mode 100644
index 000000000000..d4220d1b439d
--- /dev/null
+++ b/svtools/source/svdde/ddedll.cxx
@@ -0,0 +1,96 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddedll.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifdef WIN
+
+#pragma hdrstop
+
+#include <sysdep.hxx> // included svwin.h
+
+// Statische DLL-Verwaltungs-Variablen
+static HINSTANCE hDLLInst = 0; // HANDLE der DLL
+
+/***************************************************************************
+|* LibMain()
+|* Beschreibung Initialisierungsfunktion der DLL
+***************************************************************************/
+extern "C" int CALLBACK LibMain( HINSTANCE hDLL, WORD, WORD nHeap, LPSTR )
+{
+#ifndef WNT
+ if ( nHeap )
+ UnlockData( 0 );
+#endif
+
+ hDLLInst = hDLL;
+
+ return TRUE;
+}
+
+/***************************************************************************
+|* WEP()
+|* Beschreibung DLL-Deinitialisierung
+***************************************************************************/
+extern "C" int CALLBACK WEP( int )
+{
+ return 1;
+}
+
+#endif
+
diff --git a/svtools/source/svdde/ddeimp.hxx b/svtools/source/svdde/ddeimp.hxx
new file mode 100644
index 000000000000..33863d09ba54
--- /dev/null
+++ b/svtools/source/svdde/ddeimp.hxx
@@ -0,0 +1,215 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddeimp.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _DDEIMP_HXX
+#define _DDEIMP_HXX
+
+#ifdef OS2
+
+#include "ddemlos2.h"
+#ifndef _SYSDEP_HXX
+#include <vcl/sysdep.hxx>
+#endif
+
+#define WORD USHORT
+#define DWORD ULONG
+#define LPBYTE BYTE*
+#define LPWORD USHORT*
+#define LPDWORD ULONG*
+
+#else
+
+#include <tools/svwin.h>
+extern "C"
+{
+#define BOOL WIN_BOOL
+#define BYTE WIN_BYTE
+#include <ddeml.h>
+#undef BOOL
+#undef BYTE
+};
+
+#endif
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+#ifndef _LIST_HXX //autogen
+#include <tools/list.hxx>
+#endif
+#ifndef _SHL_HXX //autogen
+#include <tools/shl.hxx>
+#endif
+
+class DdeService;
+class DdeTopic;
+class DdeItem;
+class DdeTopics;
+class DdeItems;
+
+// ----------------
+// - Conversation -
+// ----------------
+
+struct Conversation
+{
+ HCONV hConv;
+ DdeTopic* pTopic;
+};
+
+DECLARE_LIST( ConvList, Conversation* );
+
+// ---------------
+// - DdeInternal -
+// ---------------
+
+class DdeInternal
+{
+public:
+#ifdef WNT
+ static HDDEDATA CALLBACK CliCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+ static HDDEDATA CALLBACK SvrCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+ static HDDEDATA CALLBACK InfCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+#else
+#if defined ( MTW ) || ( defined ( GCC ) && defined ( OS2 )) || defined( ICC )
+ static HDDEDATA CALLBACK __EXPORT CliCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+ static HDDEDATA CALLBACK __EXPORT SvrCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+ static HDDEDATA CALLBACK __EXPORT InfCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+#else
+ static HDDEDATA CALLBACK _export CliCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+ static HDDEDATA CALLBACK _export SvrCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+ static HDDEDATA CALLBACK _export InfCallback
+ ( WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD );
+#endif
+#endif
+ static DdeService* FindService( HSZ );
+ static DdeTopic* FindTopic( DdeService&, HSZ );
+ static DdeItem* FindItem( DdeTopic&, HSZ );
+};
+
+// -------------
+// - DdeString -
+// -------------
+
+class DdeString : public String
+{
+protected:
+ HSZ hString;
+ DWORD hInst;
+
+public:
+ DdeString( DWORD, const sal_Unicode* );
+ DdeString( DWORD, const String& );
+ ~DdeString();
+
+ int operator==( HSZ );
+ operator HSZ();
+};
+
+// --------------
+// - DdeDataImp -
+// --------------
+
+struct DdeDataImp
+{
+ HDDEDATA hData;
+ LPBYTE pData;
+ long nData;
+ USHORT nFmt;
+};
+
+class DdeConnections;
+class DdeServices;
+
+struct DdeInstData
+{
+ USHORT nRefCount;
+ DdeConnections* pConnections;
+ // Server
+ long hCurConvSvr;
+ ULONG hDdeInstSvr;
+ short nInstanceSvr;
+ DdeServices* pServicesSvr;
+ // Client
+ ULONG hDdeInstCli;
+ short nInstanceCli;
+};
+
+#ifndef SHL_SVDDE
+#define SHL_SVDDE SHL_SHL2
+#endif
+
+inline DdeInstData* ImpGetInstData()
+{
+ return (DdeInstData*)(*GetAppData( SHL_SVDDE ));
+}
+DdeInstData* ImpInitInstData();
+void ImpDeinitInstData();
+
+#endif // _DDEIMP_HXX
diff --git a/svtools/source/svdde/ddeinf.cxx b/svtools/source/svdde/ddeinf.cxx
new file mode 100644
index 000000000000..98ff34bb52ec
--- /dev/null
+++ b/svtools/source/svdde/ddeinf.cxx
@@ -0,0 +1,212 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddeinf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define UNICODE
+
+#include <string.h>
+#include "ddeimp.hxx"
+#include <svdde.hxx>
+
+// --- DdeInternal::InfCallback() ----------------------------------
+
+#ifdef WNT
+HDDEDATA CALLBACK DdeInternal::InfCallback(
+ WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD )
+#else
+#if defined ( MTW ) || ( defined ( GCC ) && defined ( OS2 )) || defined( ICC )
+HDDEDATA CALLBACK __EXPORT DdeInternal::InfCallback(
+ WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD )
+#else
+HDDEDATA CALLBACK _export DdeInternal::InfCallback(
+ WORD, WORD, HCONV, HSZ, HSZ, HDDEDATA, DWORD, DWORD )
+#endif
+#endif
+{
+ return (HDDEDATA)DDE_FNOTPROCESSED;
+}
+
+// --- DdeServiceList::DdeServiceList() ----------------------------
+
+DdeServiceList::DdeServiceList( const String* pTopic )
+{
+ DWORD hDdeInst = NULL;
+ HCONVLIST hConvList;
+ HCONV hConv = NULL;
+ short nStatus = DMLERR_NO_ERROR;
+ HSZ hTopic = NULL;
+
+ nStatus = DdeInitialize( &hDdeInst, (PFNCALLBACK) DdeInternal::InfCallback,
+ APPCLASS_STANDARD | APPCMD_CLIENTONLY |
+ CBF_FAIL_ALLSVRXACTIONS |
+ CBF_SKIP_ALLNOTIFICATIONS, 0L );
+
+ if ( nStatus == DMLERR_NO_ERROR )
+ {
+ if ( pTopic )
+ {
+ LPCTSTR p = pTopic->GetBuffer();
+ hTopic = DdeCreateStringHandle( hDdeInst, p, CP_WINUNICODE );
+ }
+
+ hConvList = DdeConnectList( hDdeInst, NULL, hTopic, NULL, NULL );
+ nStatus = DdeGetLastError( hDdeInst );
+ }
+
+ if ( nStatus == DMLERR_NO_ERROR )
+ {
+ while ( ( hConv = DdeQueryNextServer( hConvList, hConv ) ) != NULL)
+ {
+ CONVINFO aInf;
+ TCHAR buf[256], *p;
+ HSZ h;
+#ifdef OS2
+ aInf.nSize = sizeof( aInf );
+#else
+ aInf.cb = sizeof( aInf );
+#endif
+ if( DdeQueryConvInfo( hConv, QID_SYNC, &aInf))
+ {
+ h = aInf.hszServiceReq;
+ if ( !h )
+#ifndef OS2
+ h = aInf.hszSvcPartner;
+#else
+ h = aInf.hszPartner;
+#endif
+ DdeQueryString( hDdeInst, h, buf, sizeof(buf) / sizeof(TCHAR), CP_WINUNICODE );
+ p = buf + lstrlen( buf );
+ *p++ = '|'; *p = 0;
+ DdeQueryString( hDdeInst, aInf.hszTopic, p, sizeof(buf)/sizeof(TCHAR)-lstrlen( buf ),
+ CP_WINUNICODE );
+ aServices.Insert( new String( buf ) );
+ }
+ }
+ DdeDisconnectList( hConvList );
+ }
+
+ if ( hTopic)
+ DdeFreeStringHandle( hDdeInst, hTopic );
+ if ( hDdeInst )
+ DdeUninitialize( hDdeInst );
+}
+
+// --- DdeServiceList::~DdeServiceList() ---------------------------
+
+DdeServiceList::~DdeServiceList()
+{
+ String* s;
+ while ( ( s = aServices.First() ) != NULL )
+ {
+ aServices.Remove( s );
+ delete s;
+ }
+}
+
+// --- DdeTopicList::DdeTopicList() --------------------------------
+
+DdeTopicList::DdeTopicList( const String& rService )
+{
+ DdeConnection aSys( rService, String( SZDDESYS_TOPIC ) );
+
+ if ( !aSys.GetError() )
+ {
+ DdeRequest aReq( aSys, String( SZDDESYS_ITEM_TOPICS ), 500 );
+ aReq.SetDataHdl( LINK( this, DdeTopicList, Data ) );
+ aReq.Execute();
+ }
+}
+
+// --- DdeTopicList::~DdeTopicList() -------------------------------
+
+DdeTopicList::~DdeTopicList()
+{
+ String* s;
+ while ( ( s = aTopics.First() ) != NULL )
+ {
+ aTopics.Remove( s );
+ delete s;
+ }
+}
+
+// --- DdeTopicList::Data() --------------------------------------------
+
+IMPL_LINK( DdeTopicList, Data, DdeData*, pData )
+{
+ char* p = (char*) (const void *) *pData;
+ char* q = p;
+ short i;
+ char buf[256];
+
+ while ( *p && *p != '\r' && *p != '\n' )
+ {
+ q = buf; i = 0;
+ while ( i < 255 && *p && *p != '\r' && *p != '\n' && *p != '\t' )
+ *q++ = *p++, i++;
+ *q = 0;
+ while ( *p && *p != '\r' && *p != '\n' && *p != '\t' )
+ p++;
+ aTopics.Insert( new String( String::CreateFromAscii(buf) ) );
+ if ( *p == '\t' )
+ p++;
+ }
+ return 0;
+}
+
diff --git a/svtools/source/svdde/ddeml1.cxx b/svtools/source/svdde/ddeml1.cxx
new file mode 100644
index 000000000000..0b4137628da2
--- /dev/null
+++ b/svtools/source/svdde/ddeml1.cxx
@@ -0,0 +1,2689 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddeml1.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+/*
+ ToDo / Bugs:
+
+ - DdeInitiate: Eigener Thread?
+ - Timeout bei Disconnects (IBM:nicht auf Ack warten!)
+ - Konzept Errorhandling (globale/lokale Fehler)
+ - Bedeutung/Anwendung Conversation-Contexte
+ - Bei Zugriffen auf ConversationHandles WindowHandles checken
+ - Namen der Partner-App ermitteln
+ - Codepage-Geraffel
+*/
+#define INCL_DOSPROCESS
+
+#include "ddemlimp.hxx"
+
+#define LOGFILE
+#define STATUSFILE
+#define DDEDATAFILE
+#include "ddemldeb.hxx"
+
+
+#if defined (OS2) && defined (__BORLANDC__)
+#pragma option -w-par
+#endif
+
+// static
+inline BOOL ImpDdeMgr::MyWinDdePostMsg( HWND hWndTo, HWND hWndFrom,
+ USHORT nMsg, PDDESTRUCT pData, ULONG nFlags )
+{
+ BOOL bSuccess = WinDdePostMsg( hWndTo,hWndFrom,nMsg,pData,nFlags);
+ if( !bSuccess )
+ {
+ WRITELOG("WinDdePostMsg:Failed!")
+ if ( !(nFlags & DDEPM_NOFREE) )
+ {
+ MyDosFreeMem( pData,"MyWinDdePostMsg" );
+ }
+ }
+ return bSuccess;
+}
+
+
+// *********************************************************************
+// ImpDdeMgr
+// *********************************************************************
+
+USHORT ImpDdeMgr::nLastErrInstance = 0;
+
+//
+// Conversation-WndProc
+// Steuert Transaktionen eines Conversationhandles
+//
+MRESULT EXPENTRY ConvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2)
+{
+#if defined(DBG_UTIL) && defined(OV_DEBUG)
+ if( nMsg >= WM_DDE_FIRST && nMsg <= WM_DDE_LAST)
+ {
+ ////WRITELOG("::ConvWndProc:DDE-Msg received")
+ }
+#endif
+ ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 );
+ return pObj->pThis->ConvWndProc( hWnd, nMsg, nPar1, nPar2 );
+}
+
+//
+// Server-WndProc
+// DDE-Server-Window der App
+//
+MRESULT EXPENTRY ServerWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2)
+{
+#if defined(DBG_UTIL) && defined(OV_DEBUG)
+ if( nMsg >= WM_DDE_FIRST && nMsg <= WM_DDE_LAST)
+ {
+ ////WRITELOG("::ServerWndProc:DDE-Msg received")
+ }
+#endif
+ ImpDdeMgr* pObj = (ImpDdeMgr*)WinQueryWindowULong( hWnd, 0 );
+ return pObj->SrvWndProc( hWnd, nMsg, nPar1, nPar2 );
+}
+
+
+inline HDDEDATA ImpDdeMgr::Callback( USHORT nTransactionType,
+ USHORT nClipboardFormat, HCONV hConversationHandle, HSZ hsz1,
+ HSZ hsz2, HDDEDATA hData, ULONG nData1, ULONG nData2 )
+{
+ HDDEDATA hRet = (HDDEDATA)0;
+ if( pCallback )
+ hRet = (*pCallback)(nTransactionType, nClipboardFormat,
+ hConversationHandle, hsz1, hsz2, hData, nData1, nData2);
+ return hRet;
+}
+
+
+
+ImpDdeMgr::ImpDdeMgr()
+{
+ nLastErrInstance = DMLERR_NO_ERROR;
+ pCallback = 0;
+ nTransactFilter = 0;
+ nServiceCount = 0;
+ pServices = 0;
+ pAppTable = 0;
+ pConvTable = 0;
+ pTransTable = 0;
+ bServFilterOn = TRUE;
+ bInSyncTrans = FALSE;
+
+ CreateServerWnd();
+ pData = InitAll();
+ if ( !pData )
+ nLastErrInstance = DMLERR_MEMORY_ERROR;
+ else
+ RegisterDDEMLApp();
+}
+
+ImpDdeMgr::~ImpDdeMgr()
+{
+ CleanUp();
+ DestroyServerWnd();
+// Named Shared Mem vom BS loeschen lassen, da nicht bekannt ist,
+// wieviele DDEML-Instanzen die App erzeugt hat, und OS/2
+// keinen App-Referenzzaehler fuer shared mem fuehrt.
+// if ( pData )
+// DosFreeMem( pData );
+}
+
+
+BOOL ImpDdeMgr::IsSameInstance( HWND hWnd )
+{
+ TID tid; PID pid;
+ WinQueryWindowProcess( hWnd, &pid, &tid );
+ return (BOOL)(pid == pidThis);
+}
+
+HSZ ImpDdeMgr::GetAppName( HWND hWnd )
+{
+ return 0;
+}
+
+// static
+ImpDdeMgr* ImpDdeMgr::GetImpDdeMgrInstance( HWND hWnd )
+{
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ if( !pData )
+ return 0;
+
+ ImpDdeMgr* pResult = 0;
+ TID tid; PID pidApp;
+ WinQueryWindowProcess( hWnd, &pidApp, &tid );
+ HWND* pApp = ImpDdeMgr::GetAppTable( pData );
+ USHORT nCurApp = 0;
+ while( nCurApp < pData->nMaxAppCount )
+ {
+ HWND hCurWin = *pApp;
+ if( hCurWin )
+ {
+ PID pidCurApp;
+ WinQueryWindowProcess( hCurWin, &pidCurApp, &tid );
+ if( pidCurApp == pidApp )
+ {
+ pResult = (ImpDdeMgr*)WinQueryWindowULong( hCurWin, 0 );
+ break;
+ }
+ }
+ pApp++;
+ nCurApp++;
+ }
+ return pResult;
+}
+
+
+
+
+
+void ImpDdeMgr::CleanUp()
+{
+ DisconnectAll();
+ ImpService* pPtr = pServices;
+ if( pPtr )
+ {
+ for( USHORT nIdx = 0; nIdx < nServiceCount; nIdx++, pPtr++ )
+ {
+ HSZ hStr = pPtr->hBaseServName;
+ if( hStr )
+ DdeFreeStringHandle( hStr );
+ hStr = pPtr->hInstServName;
+ if( hStr )
+ DdeFreeStringHandle( hStr );
+ }
+ nServiceCount = 0;
+ delete pServices;
+ pServices = 0;
+ }
+ bServFilterOn = TRUE; // default setting DDEML
+ UnregisterDDEMLApp();
+}
+
+void ImpDdeMgr::RegisterDDEMLApp()
+{
+ HWND* pPtr = pAppTable;
+ HWND hCur;
+ USHORT nPos = 0;
+ while( nPos < pData->nMaxAppCount )
+ {
+ hCur = *pPtr;
+ if (hCur == (HWND)0 )
+ {
+ // in Tabelle stellen
+ *pPtr = hWndServer;
+ break;
+ }
+ nPos++;
+ pPtr++;
+ }
+}
+
+void ImpDdeMgr::UnregisterDDEMLApp()
+{
+ HWND* pPtr = pAppTable;
+ USHORT nPos = 0;
+ while( nPos < pData->nMaxAppCount )
+ {
+ if (*pPtr == hWndServer )
+ {
+ *pPtr = 0;
+ break;
+ }
+ nPos++;
+ pPtr++;
+ }
+}
+
+// static
+ImpDdeMgrData* ImpDdeMgr::AccessMgrData()
+{
+ ImpDdeMgrData* pData = 0;
+ APIRET nRet = DosGetNamedSharedMem((PPVOID)&pData,DDEMLDATA,PAG_READ|PAG_WRITE);
+ DBG_ASSERT(!nRet,"DDE:AccessMgrData failed");
+ return pData;
+}
+
+USHORT ImpDdeMgr::DdeGetLastError()
+{
+ USHORT nErr;
+ if ( !pData )
+ nErr = DMLERR_DLL_NOT_INITIALIZED;
+ else if ( nLastErrInstance )
+ nErr = nLastErrInstance;
+ else
+ nErr = pData->nLastErr;
+
+ nLastErrInstance = 0;
+ pData->nLastErr = 0;
+ return nErr;
+}
+
+
+
+USHORT ImpDdeMgr::DdeInitialize( PFNCALLBACK pCallbackProc, ULONG nTransactionFilter )
+{
+ if ( !nLastErrInstance )
+ {
+ if ( !pCallbackProc )
+ {
+ nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ return nLastErrInstance;
+ }
+ pCallback = pCallbackProc;
+ nTransactFilter = nTransactionFilter;
+ nTransactFilter |= CBF_FAIL_SELFCONNECTIONS;
+ }
+ return nLastErrInstance;
+}
+
+
+// static
+HWND ImpDdeMgr::NextFrameWin( HENUM hEnum )
+{
+ char aBuf[ 10 ];
+
+ HWND hWnd = WinGetNextWindow( hEnum );
+ while( hWnd )
+ {
+ WinQueryClassName( hWnd, sizeof(aBuf)-1, (PCH)aBuf );
+ // Frame-Window ?
+ if( !strcmp( aBuf, "#1" ) ) // #define WC_FRAME ((PSZ)0xffff0001L)
+ break;
+ hWnd = WinGetNextWindow( hEnum );
+ }
+ return hWnd;
+}
+
+
+HCONV ImpDdeMgr::DdeConnectImp( HSZ hszService,HSZ hszTopic,CONVCONTEXT* pCC)
+{
+ hCurConv = 0;
+ if( !pCC )
+ pCC = &aDefaultContext;
+
+ ULONG nBufLen;
+ PSZ pService = AllocAtomName( (ATOM)hszService, nBufLen );
+ PSZ pTopic = AllocAtomName( (ATOM)hszTopic, nBufLen );
+#if 0 && defined(OV_DEBUG)
+ String aStr("DdeConnectImp Service:");
+ aStr += pService;
+ aStr += " Topic:";
+ aStr += pTopic;
+ WRITELOG((char*)(const char*)aStr)
+#endif
+
+#if defined(OV_DEBUG)
+ if( !strcmp(pService,"oliver voeltz") )
+ {
+ WRITESTATUS("Table of connections");
+ MyDosFreeMem( pTopic,"DdeConnectImp" );
+ MyDosFreeMem( pService,"DdeConnectImp" );
+ return 0;
+ }
+#endif
+
+#if 0
+ // original pm-fkt benutzen
+ HWND hWndCurClient = CreateConversationWnd();
+ WinDdeInitiate( hWndCurClient, pService, pTopic, pCC );
+ if( GetConversationWndRefCount(hWndCurClient) == 0)
+ DestroyConversationWnd( hWndCurClient );
+#else
+ // eigener Verbindungsaufbau
+ HENUM hEnum = WinBeginEnumWindows( HWND_DESKTOP );
+ HWND hWndCurSrv = NextFrameWin( hEnum );
+ HWND hWndCurClient = CreateConversationWnd();
+ while( hWndCurSrv && !hCurConv )
+ {
+ if( hWndCurSrv != hWndServer ||
+ ((nTransactFilter & CBF_FAIL_SELFCONNECTIONS)==0 ))
+ {
+ // pro DDE-Server ein Conversation-Window erzeugen
+ if( GetConversationWndRefCount(hWndCurClient) >= 2)
+ {
+ DestroyConversationWnd( hWndCurClient );
+ hWndCurClient = CreateConversationWnd();
+ }
+ MyInitiateDde(hWndCurSrv,hWndCurClient,hszService,hszTopic,pCC);
+ if( !bListConnect && hCurConv )
+ break;
+ }
+ hWndCurSrv = NextFrameWin( hEnum );
+ }
+
+ if( GetConversationWndRefCount(hWndCurClient) == 0)
+ DestroyConversationWnd( hWndCurClient );
+ WinEndEnumWindows( hEnum );
+#endif
+
+ if( !hCurConv )
+ nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED;
+
+#if 0 && defined(OV_DEBUG)
+ String aCStr( "DdeConnectImp:End ");
+ if( nLastErrInstance != DMLERR_NO_CONV_ESTABLISHED )
+ aCStr += "(Success)";
+ else
+ aCStr += "(Failed)";
+ WRITELOG((char*)aCStr.GetStr())
+#endif
+
+ MyDosFreeMem( pTopic,"DdeConnectImp" );
+ MyDosFreeMem( pService,"DdeConnectImp" );
+ return hCurConv;
+}
+
+HCONV ImpDdeMgr::DdeConnect( HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC)
+{
+ ////WRITELOG("DdeConnect:Start")
+ bListConnect = FALSE;
+ HCONV hResult = DdeConnectImp( hszService, hszTopic, pCC );
+ ////WRITELOG("DdeConnect:End")
+ ////WRITESTATUS("DdeConnect:End")
+ return hResult;
+}
+
+
+HCONVLIST ImpDdeMgr::DdeConnectList( HSZ hszService, HSZ hszTopic,
+ HCONVLIST hConvList, CONVCONTEXT* pCC )
+{
+ nPrevConv = 0;
+ ////WRITESTATUS("Before DdeConnectList")
+ if( hConvList )
+ {
+ HCONV hLastConvInList;
+
+ hCurListId = hConvList;
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConvList;
+ if( (USHORT)hConvList >= pData->nMaxConvCount ||pConv->hWndThis==0 )
+ {
+ nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ return 0;
+ }
+ GetLastServer(pData, hConvList, hLastConvInList);
+ nPrevConv = (USHORT)hLastConvInList;
+ }
+ else
+ hCurListId = (HCONVLIST)WinCreateWindow( HWND_OBJECT, WC_FRAME,
+ CONVLISTNAME, 0,0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0,0,0);
+
+ bListConnect = TRUE;
+ DdeConnectImp( hszService, hszTopic, pCC );
+#if 0 && defined(OV_DEBUG)
+ WRITELOG("DdeConnectList:ConnectionList:")
+ HCONV hDebug = 0;
+ do
+ {
+ hDebug = DdeQueryNextServer( hCurListId, hDebug);
+ String aStr( (ULONG)hDebug );
+ WRITELOG((char*)(const char*)aStr)
+ } while( hDebug );
+#endif
+ ////WRITESTATUS("After DdeConnectList")
+ return (HCONVLIST)hCurListId;
+}
+
+DDEINIT* ImpDdeMgr::CreateDDEInitData( HWND hWndDestination, HSZ hszService,
+ HSZ hszTopic, CONVCONTEXT* pCC )
+{
+ ULONG nLen1 = 0, nLen2 = 0;
+ HATOMTBL hAtomTable = WinQuerySystemAtomTable();
+
+ if( hszService )
+ nLen1 = WinQueryAtomLength( hAtomTable, hszService );
+ if( hszTopic )
+ nLen2 = WinQueryAtomLength( hAtomTable, hszTopic );
+ nLen1++; nLen2++;
+
+ DDEINIT* pBuf = 0;
+
+ ULONG nLen = sizeof(DDEINIT) + nLen1+ nLen2 + sizeof(CONVCONTEXT);
+ if( !(MyDosAllocSharedMem((PPVOID)&pBuf, NULL, nLen,
+ PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_GIVEABLE,
+ "CreateDDEInitData")))
+ {
+ memset( pBuf, 0, nLen );
+
+ /*
+ PID pid; TID tid;
+ WinQueryWindowProcess( hWndDestination, &pid, &tid );
+ APIRET nRet = DosGiveSharedMem( pBuf, pid, PAG_READ | PAG_WRITE );
+ */
+
+ pBuf->cb = nLen;
+ pBuf->offConvContext = sizeof( DDEINIT );
+ char* pBase = (char*)pBuf;
+ pBase += sizeof(DDEINIT);
+ if( pCC )
+ memcpy( pBase, pCC, sizeof(CONVCONTEXT) );
+ pBase += sizeof(CONVCONTEXT);
+ pBuf->pszAppName = pBase;
+ if( hszService )
+ WinQueryAtomName( hAtomTable, hszService, pBase, nLen1 );
+ pBase += nLen1;
+ pBuf->pszTopic = pBase;
+ if( hszTopic )
+ WinQueryAtomName( hAtomTable, hszTopic, pBase, nLen2 );
+ }
+ return pBuf;
+}
+
+
+
+void ImpDdeMgr::MyInitiateDde( HWND hWndSrv, HWND hWndClient,
+ HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC )
+{
+ DDEINIT* pBuf = CreateDDEInitData( hWndSrv, hszService, hszTopic, pCC );
+ if( pBuf )
+ {
+ PID pid; TID tid;
+ WinQueryWindowProcess( hWndSrv, &pid, &tid );
+ APIRET nRet = DosGiveSharedMem( pBuf, pid, PAG_READ | PAG_WRITE );
+ WinSendMsg( hWndSrv,WM_DDE_INITIATE,(MPARAM)hWndClient,(MPARAM)pBuf);
+ MyDosFreeMem( pBuf,"MyInitiateDde" );
+ }
+}
+
+// static
+ImpHCONV* ImpDdeMgr::GetFirstServer(ImpDdeMgrData* pData, HCONVLIST hConvList,
+ HCONV& rhConv )
+{
+ ImpHCONV* pPtr = GetConvTable( pData );
+ HCONV hConv;
+ if( !rhConv )
+ {
+ pPtr++;
+ hConv = 1;
+ }
+ else
+ {
+ // Startposition
+ pPtr += (USHORT)rhConv;
+ hConv = rhConv;
+ pPtr++; hConv++; // auf den naechsten
+ }
+ while( hConv < pData->nMaxConvCount )
+ {
+ if( pPtr->hConvList == hConvList )
+ {
+ rhConv = hConv;
+ return pPtr;
+ }
+ pPtr++;
+ hConv++;
+ }
+ rhConv = 0;
+ return 0;
+}
+
+// static
+ImpHCONV* ImpDdeMgr::GetLastServer(ImpDdeMgrData* pData, HCONVLIST hConvList,
+ HCONV& rhConv )
+{
+ ImpHCONV* pPtr = GetConvTable( pData );
+ pPtr += pData->nMaxConvCount;
+ pPtr--;
+ HCONV hConv = pData->nMaxConvCount;
+ hConv--;
+ while( hConv > 0 )
+ {
+ if( pPtr->hConvList == hConvList )
+ {
+ rhConv = hConv;
+ return pPtr;
+ }
+ pPtr--;
+ hConv--;
+ }
+ rhConv = 0;
+ return 0;
+}
+
+// static
+BOOL ImpDdeMgr::CheckConvListId( HCONVLIST hConvListId )
+{
+ HAB hAB = WinQueryAnchorBlock( (HWND)hConvListId );
+ if( hAB )
+ return WinIsWindow( hAB, (HWND)hConvListId );
+ return FALSE;
+ /*
+ HAB hAB = WinQueryAnchorBlock( (HWND)hConvListId );
+ if( hAB )
+ {
+ char aBuf[ 16 ];
+ WinQueryWindowText( (HWND)hConvListId, sizeof(aBuf), aBuf );
+ if( strcmp(aBuf, CONVLISTNAME ) == 0 )
+ return TRUE;
+ }
+ return FALSE;
+ */
+}
+
+// static
+HCONV ImpDdeMgr::DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev)
+{
+ if( !CheckConvListId( hConvList ) )
+ return (HCONV)0;
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ GetFirstServer( pData, hConvList, hConvPrev );
+ return hConvPrev;
+}
+
+// static
+
+// Idee: DisconnectAll uebergibt das ServerWindow. Zu jedem HCONV
+// wird das Creator-Server-Wnd gespeichert. Disconnect braucht
+// dann nur noch die Window-Handles zu vergleichen
+BOOL ImpDdeMgr::DdeDisconnect( HCONV hConv )
+{
+ WRITELOG("DdeDisconnect:Start")
+ ////WRITESTATUS("DdeDisconnect:Start")
+
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ if ( !pData )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
+ return FALSE;
+ }
+ ImpHCONV* pConv = GetConvTable(pData) + (USHORT)hConv;
+
+ if( (USHORT)hConv >= pData->nMaxConvCount || pConv->hWndThis==0 )
+ {
+ nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED;
+ return FALSE;
+ }
+
+ PID pidApp; TID tid;
+ HWND hWndDummy = WinCreateWindow( HWND_OBJECT, WC_FRAME,
+ "Bla", 0, 0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0, 0, 0 );
+ WinQueryWindowProcess( hWndDummy, &pidApp, &tid );
+ WinDestroyWindow( hWndDummy );
+ PID pidThis; PID pidPartner;
+
+ HWND hWndThis = pConv->hWndThis;
+ HWND hWndPartner = pConv->hWndPartner;
+
+ WinQueryWindowProcess( hWndThis, &pidThis, &tid );
+ WinQueryWindowProcess( hWndPartner, &pidPartner, &tid );
+ if( pidApp != pidThis && pidApp != pidPartner )
+ return TRUE; // gehoert nicht der App -> ueberspringen
+
+ HCONV hConvPartner = pConv->hConvPartner;
+
+ // die App benachrichtigen, dass alle offenen Advise-Loops
+ // beendet werden, egal ob sie vom Server oder Client
+ // initiiert wurden. Die Dinger aber nicht loeschen, da sie evtl.
+ // noch vom Partner gebraucht werden.
+ ImpConvWndData* pObj =
+ (ImpConvWndData*)WinQueryWindowULong( pConv->hWndThis, 0 );
+ ImpDdeMgr* pThis = pObj->pThis;
+ pThis->SendUnadvises( hConv, 0, FALSE ); // alle Formate & NICHT loeschen
+ pThis->SendUnadvises( hConvPartner, 0, FALSE ); // alle Formate & NICHT loeschen
+
+ pConv->nStatus |= ST_TERMINATED;
+
+ HAB hAB = WinQueryAnchorBlock( pConv->hWndThis );
+ // um die MessageQueue inne Gaenge zu halten
+ ULONG nTimerId = WinStartTimer( hAB, 0, 0, 50 );
+
+ /*
+ Die Partner-App muss ein DDE_TERMINATE posten, auf das
+ wir warten muessen, um alle Messages zu bearbeiten, die
+ _vor_ dem DdeDisconnect von der Partner-App gepostet
+ wurden.
+ */
+ WRITELOG("DdeDisconnect:Waiting for acknowledge...")
+ WinDdePostMsg( hWndPartner, hWndThis, WM_DDE_TERMINATE,
+ (PDDESTRUCT)0,DDEPM_RETRY);
+
+ QMSG aQueueMsg;
+ BOOL bContinue = TRUE;
+ while( bContinue )
+ {
+ if( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 ))
+ {
+ WinDispatchMsg( hAB, &aQueueMsg );
+ if( (!WinIsWindow( hAB, hWndPartner)) ||
+ (pConv->nStatus & ST_TERMACKREC) )
+ {
+ bContinue = FALSE;
+ if( pConv->nStatus & ST_TERMACKREC )
+ {
+ WRITELOG("DdeDisconnect: TermAck received")
+ }
+ else
+ {
+ WRITELOG("DdeDisconnect: Partner died")
+ }
+ }
+ }
+ else
+ bContinue = FALSE;
+ }
+
+ WinStopTimer( hAB, 0, nTimerId );
+
+ // WRITELOG("DdeDisconnect:Freeing data")
+ // Transaktionstabelle aufraeumen
+ FreeTransactions( pData, hConv );
+ if( hConvPartner )
+ FreeTransactions( pData, hConvPartner );
+
+ FreeConvHandle( pData, hConv );
+
+ WRITELOG("DdeDisconnect:End")
+ //WRITESTATUS("DdeDisconnect:End")
+ return TRUE;
+}
+
+// static
+BOOL ImpDdeMgr::DdeDisconnectList( HCONVLIST hConvList )
+{
+ if( !CheckConvListId( hConvList ) )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ return FALSE;
+ }
+
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ if ( !pData )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
+ return FALSE;
+ }
+ HCONV hConv = 0;
+ GetFirstServer( pData, hConvList, hConv );
+ while( hConv )
+ {
+ DdeDisconnect( hConv );
+ GetFirstServer( pData, hConvList, hConv );
+ }
+ WinDestroyWindow( (HWND)hConvList );
+ return TRUE;
+}
+
+
+
+// static
+HCONV ImpDdeMgr::DdeReconnect(HCONV hConv)
+{
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ if ( !pData )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
+ return 0;
+ }
+ return 0;
+}
+
+// static
+USHORT ImpDdeMgr::DdeQueryConvInfo(HCONV hConv, ULONG nTransId, CONVINFO* pCI)
+{
+ if( !pCI || pCI->nSize == 0)
+ return 0;
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ if ( !pData )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
+ return 0;
+ }
+ Transaction* pTrans;
+ if( nTransId != QID_SYNC )
+ {
+ pTrans = ImpDdeMgr::GetTransTable( pData );
+ pTrans += nTransId;
+ if( nTransId >= pData->nMaxTransCount || pTrans->hConvOwner == 0 )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID;
+ return 0;
+ }
+ }
+ else
+ pTrans = 0;
+
+ ImpHCONV* pConv = ImpDdeMgr::GetConvTable( pData );
+ pConv += (ULONG)hConv;
+ if( hConv >= pData->nMaxConvCount || pConv->hWndThis == 0 )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED;
+ return 0;
+ }
+
+ USHORT nSize = pCI->nSize;
+ if( nSize > sizeof(CONVINFO) )
+ nSize = sizeof(CONVINFO);
+ CONVINFO aTempInfo;
+ memset( &aTempInfo, 0, sizeof(CONVINFO) );
+ aTempInfo.nSize = pCI->nSize;
+ aTempInfo.hConvPartner = pConv->hConvPartner;
+ aTempInfo.hszPartner = pConv->hszPartner;
+ aTempInfo.hszServiceReq = pConv->hszServiceReq;
+ aTempInfo.hszTopic = pConv->hszTopic;
+ aTempInfo.nStatus = pConv->nStatus;
+ aTempInfo.hConvList = pConv->hConvList;
+ aTempInfo.aConvCtxt = pConv->aConvContext;
+ if( pTrans )
+ {
+ aTempInfo.nUser = pTrans->nUser;
+ aTempInfo.hszItem = pTrans->hszItem;
+ aTempInfo.nFormat = pTrans->nFormat;
+ aTempInfo.nType = pTrans->nType;
+ aTempInfo.nConvst = pTrans->nConvst;
+ aTempInfo.nLastError= pTrans->nLastError;
+ }
+ memcpy( pCI, &aTempInfo, nSize );
+
+ return nSize;
+}
+
+// static
+BOOL ImpDdeMgr::DdeSetUserHandle(HCONV hConv, ULONG nTransId, ULONG hUser)
+{
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ if ( !pData )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
+ return FALSE;
+ }
+ Transaction* pTrans = GetTransTable( pData );
+ pTrans += nTransId;
+ if( !nTransId || !hConv || nTransId >= pData->nMaxTransCount ||
+ pTrans->hConvOwner != hConv )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ return FALSE;
+ }
+ if( !pTrans->hConvOwner)
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID;
+ return FALSE;
+ }
+ pTrans->nUser = hUser;
+ return TRUE;
+}
+
+BOOL ImpDdeMgr::DdeAbandonTransaction( HCONV hConv, ULONG nTransId )
+{
+ ////WRITELOG("DdeAbandonTransaction:Start")
+ if( !pData )
+ {
+ nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
+ return FALSE;
+ }
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+ if( nTransId < 1 || nTransId >= pData->nMaxTransCount ||
+ hConv < 1 || hConv >= pData->nMaxConvCount || !pConv->hWndThis)
+ {
+ nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ return FALSE;
+ }
+ if( !hConv )
+ {
+ DBG_ASSERT(0,"DdeAbandonTransaction:NULL-hConv not supported");
+ nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ return FALSE;
+ }
+ Transaction* pTrans = pTransTable;
+ pTrans += (USHORT)nTransId;
+ if( pTrans->hConvOwner != hConv )
+ {
+ nLastErrInstance = DMLERR_UNFOUND_QUEUE_ID;
+ return FALSE;
+ }
+
+ if( bInSyncTrans && nTransId == nSyncTransId )
+ {
+ bSyncAbandonTrans = TRUE;
+ return TRUE;
+ }
+ USHORT nTempType = pTrans->nType;
+ nTempType &= (~XTYPF_MASK);
+ if( nTempType == (XTYP_ADVREQ & ~(XTYPF_NOBLOCK)))
+ {
+ ////WRITELOG("DdeAbandTrans:Advise Loop")
+
+// ----------------------------------------------------------------------
+// Der von der Deutschen Bank eingesetzte DDE-Server
+// "Invision V2.71 Build 36 Mar 12 1999 V4.8.2" hat einen Bug, der
+// dazu fuehrt, dass auf per WM_DDE_TERMINATE geschlossene Verbindungen
+// nicht mit einem WM_DDE_TERMINATE geantwortet wird, wenn der
+// entsprechende Link vorher per WM_DDE_UNADVISE beendet wurde. Dieser
+// Bug tritt ab zwei parallel laufenden Links auf. Auf Wunsch der DB
+// wurde das folgende Workaround eingebaut.
+// ----------------------------------------------------------------------
+#define DEUTSCHE_BANK
+#ifndef DEUTSCHE_BANK
+
+// Acknowledge ist beim Unadvise nicht ueblich
+//#define SO_DDE_ABANDON_TRANSACTION_WAIT_ACK
+#ifdef SO_DDE_ABANDON_TRANSACTION_WAIT_ACK
+ DDESTRUCT* pOutDDEData = MakeDDEObject( pConv->hWndPartner,
+ pTrans->hszItem, DDE_FACKREQ, 0 /*pTrans->nFormat*/, 0, 0);
+#else
+ DDESTRUCT* pOutDDEData = MakeDDEObject( pConv->hWndPartner,
+ pTrans->hszItem, 0, 0 /*pTrans->nFormat*/, 0, 0);
+#endif
+ WRITELOG("DdeAbandTrans:Waiting for acknowledge...")
+ pTrans->nConvst = XST_UNADVSENT;
+ if ( !MyWinDdePostMsg( pConv->hWndPartner, pConv->hWndThis,
+ WM_DDE_UNADVISE, pOutDDEData, DDEPM_RETRY ) )
+ {
+ WRITELOG("DdeAbandTrans:PostMsg Failed")
+ return FALSE;
+ }
+#ifdef SO_DDE_ABANDON_TRANSACTION_WAIT_ACK
+ WaitTransState( pTrans, nTransId, XST_UNADVACKRCVD, 0 );
+#else
+ pTrans->nConvst = XST_UNADVACKRCVD;
+#endif
+
+#endif // DEUTSCHE_BANK
+
+ WRITELOG("DdeAbandTrans:Ack received->Freeing transaction")
+ FreeTransaction( pData, nTransId );
+ }
+ WRITELOG("DdeAbandonTransaction:End")
+ return TRUE;
+}
+
+// wird von einem Server aufgerufen, wenn sich die Daten des
+// Topic/Item-Paars geaendert haben. Diese Funktion fordert
+// dann den Server auf, die Daten zu rendern (bei Hotlinks) und
+// benachrichtigt die Clients
+BOOL ImpDdeMgr::DdePostAdvise( HSZ hszTopic, HSZ hszItem)
+{
+ ////WRITELOG("DdePostAdvise:Start")
+ ////WRITESTATUS("DdePostAdvise:Start")
+
+#if 0 && defined( OV_DEBUG )
+ String aDebStr("DdePostAdvise:Item ");
+ aDebStr += (ULONG)hszItem;
+ WRITELOG((char*)(const char*)aDebStr)
+#endif
+
+ Transaction* pTrans = pTransTable;
+ pTrans++;
+ USHORT nCurTrans = 1;
+ USHORT nUsedTransactions = pData->nCurTransCount;
+ while( nUsedTransactions && nCurTrans < pData->nMaxTransCount )
+ {
+ HCONV hOwner = pTrans->hConvOwner;
+ if( hOwner )
+ {
+ nUsedTransactions--;
+ USHORT nTempType = pTrans->nType;
+ nTempType &= (~XTYPF_MASK);
+ if( nTempType == (XTYP_ADVREQ & (~XTYPF_NOBLOCK) ) )
+ {
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hOwner;
+ if(hszItem == pTrans->hszItem && pConv->hszTopic == hszTopic)
+ {
+ if( pConv->hConvPartner )
+ {
+ // Transaktionen werden immer vom Client erzeugt
+ // -> auf Server-HCONV umschalten
+ hOwner = pConv->hConvPartner;
+ pConv = pConvTable;
+ pConv += (USHORT)hOwner;
+ }
+ HWND hWndClient = pConv->hWndPartner;
+ HWND hWndServer = pConv->hWndThis;
+#if 0 && defined( OV_DEBUG )
+ String aDebStr("DdePostAdvise: Server:");
+ aDebStr += (ULONG)hWndServer;
+ aDebStr += " Client:";
+ aDebStr += (ULONG)hWndClient;
+ WRITELOG((char*)(const char*)aDebStr)
+#endif
+ DDESTRUCT* pOutDDEData;
+ if ( pTrans->nType & XTYPF_NODATA )
+ {
+ // Warm link
+ ////WRITELOG("DdePostAdvise:Warm link found")
+ pOutDDEData = MakeDDEObject( hWndClient, hszItem,
+ DDE_FNODATA, pTrans->nFormat, 0, 0 );
+ }
+ else
+ {
+ // Hot link
+ ////WRITELOG("DdePostAdvise:Hot link found")
+ pOutDDEData = Callback( XTYP_ADVREQ,
+ pTrans->nFormat, hOwner, hszTopic,
+ hszItem, (HDDEDATA)0, 1, 0 );
+ }
+ if( pOutDDEData )
+ {
+ // todo: FACK_REQ in Out-Data setzen, wenn pTrans->nType & XTYPF_ACKREQ
+ ////WRITELOG("DdePostAdvise:Sending data/notification")
+ BOOL bSuccess = MyWinDdePostMsg( hWndClient,
+ hWndServer,WM_DDE_DATA, pOutDDEData, DDEPM_RETRY);
+ if( bSuccess )
+ {
+ // auf Acknowledge des Partners warten ?
+ if( pTrans->nType & XTYPF_ACKREQ )
+ {
+ pTrans->nConvst = XST_ADVDATASENT;
+ // Impl. ist falsch! => korrekt: XST_ADVDATAACKRCVD
+ WaitTransState(pTrans, nCurTrans,
+ XST_UNADVACKRCVD, 0);
+ }
+ }
+ else
+ {
+ ////WRITELOG("DdePostAdvise:PostMsg failed")
+ nLastErrInstance = DMLERR_POSTMSG_FAILED;
+ }
+ }
+ else
+ {
+ ////WRITELOG("DdePostAdvise:No data to send")
+ }
+ }
+ }
+ }
+ nCurTrans++;
+ pTrans++;
+ }
+ ////WRITELOG("DdePostAdvise:End")
+ return TRUE;
+}
+
+BOOL ImpDdeMgr::DdeEnableCallback( HCONV hConv, USHORT wCmd)
+{
+ return FALSE;
+}
+
+// Rueckgabe: 0==Service nicht registriert; sonst Pointer auf Service-Eintrag
+ImpService* ImpDdeMgr::GetService( HSZ hszService )
+{
+ ImpService* pPtr = pServices;
+ if( !pPtr || !hszService )
+ return 0;
+ for( ULONG nIdx = 0; nIdx < nServiceCount; nIdx++, pPtr++ )
+ {
+ if(( hszService == pPtr->hBaseServName ) ||
+ ( hszService == pPtr->hInstServName ) )
+ return pPtr;
+ }
+ return 0;
+}
+
+
+// legt Service in Service-Tabelle ab. Tabelle wird ggf. expandiert
+ImpService* ImpDdeMgr::PutService( HSZ hszService )
+{
+ if( !pServices )
+ {
+ DBG_ASSERT(nServiceCount==0,"DDE:Bad ServiceCount");
+ pServices = new ImpService[ DDEMLSERVICETABLE_INISIZE ];
+ memset( pServices, 0, DDEMLSERVICETABLE_INISIZE* sizeof(ImpService));
+ nServiceCount = DDEMLSERVICETABLE_INISIZE;
+ }
+ ImpService* pPtr = pServices;
+ USHORT nCurPos = 0;
+ while( pPtr )
+ {
+ if( pPtr->hBaseServName == 0 )
+ break;
+ nCurPos++;
+ if( nCurPos < nServiceCount )
+ pPtr++;
+ else
+ pPtr = 0;
+ }
+ if( !pPtr )
+ {
+ // Tabelle vergroessern
+ pPtr = new ImpService[ nServiceCount + DDEMLSERVICETABLE_INISIZE ];
+ memset( pPtr, 0, DDEMLSERVICETABLE_INISIZE* sizeof(ImpService));
+ memcpy( pPtr, pServices, nServiceCount * sizeof(ImpService) );
+#ifdef DBG_UTIL
+ memset( pServices, 0, nServiceCount * sizeof(ImpService) );
+#endif
+ delete pServices;
+ pServices = pPtr;
+ pPtr += nServiceCount; // zeigt auf erste neue Position
+ nServiceCount += DDEMLSERVICETABLE_INISIZE;
+ }
+ DBG_ASSERT(pPtr->hBaseServName==0,"DDE:Service not empty");
+ DBG_ASSERT(pPtr->hInstServName==0,"DDE:Service not empty");
+
+ DdeKeepStringHandle( hszService );
+
+ USHORT nStrLen = (USHORT)DdeQueryString( hszService, 0, 0, 0);
+ char* pBuf = new char[ nStrLen + 1 ];
+ DdeQueryString(hszService, pBuf, nStrLen, 850 /* CodePage*/ );
+ pBuf[ nStrLen ] = 0;
+ String aStr( (ULONG)hWndServer );
+ aStr += pBuf;
+ HSZ hszInstServ = DdeCreateStringHandle( (PSZ)(const char*)pBuf, 850 );
+ delete pBuf;
+
+ pPtr->hBaseServName = hszService;
+ pPtr->hInstServName = hszInstServ;
+ return pPtr;
+}
+
+void ImpDdeMgr::BroadcastService( ImpService* pService, BOOL bRegistered )
+{
+ DBG_ASSERT(pService,"DDE:No Service");
+ if( !pService )
+ return;
+ MPARAM aMp1 = (MPARAM)(pService->hBaseServName);
+ MPARAM aMp2 = (MPARAM)(pService->hInstServName);
+ ULONG nMsg;
+ if( bRegistered )
+ nMsg = WM_DDEML_REGISTER;
+ else
+ nMsg = WM_DDEML_UNREGISTER;
+
+ HWND* pPtr = pAppTable;
+ for( USHORT nPos = 0; nPos < pData->nMaxAppCount; nPos++, pPtr++ )
+ {
+ HWND hWndCurWin = *pPtr;
+ if ( hWndCurWin && hWndCurWin != hWndServer )
+ WinSendMsg( hWndCurWin, nMsg, aMp1, aMp2 );
+ }
+}
+
+HDDEDATA ImpDdeMgr::DdeNameService( HSZ hszService, USHORT afCmd )
+{
+ HDDEDATA hRet = (HDDEDATA)1;
+
+ if( afCmd & DNS_FILTERON )
+ bServFilterOn = TRUE;
+ else if( afCmd & DNS_FILTEROFF )
+ bServFilterOn = FALSE;
+ ImpService* pService = GetService( hszService );
+ BOOL bRegister = (BOOL)(afCmd & DNS_REGISTER);
+ if( bRegister )
+ {
+ if( !pService )
+ {
+ pService = PutService( hszService );
+ BroadcastService( pService, TRUE );
+ }
+ }
+ else
+ {
+ if( pService )
+ {
+ BroadcastService( pService, FALSE );
+ DdeFreeStringHandle( pService->hBaseServName );
+ pService->hBaseServName = 0;
+ DdeFreeStringHandle( pService->hInstServName );
+ pService->hInstServName = 0;
+ }
+ hRet = (HDDEDATA)0; // Service nicht gefunden
+ }
+ return hRet;
+}
+
+
+// static
+HDDEDATA ImpDdeMgr::DdeClientTransaction(void* pDdeData, ULONG cbData,
+ HCONV hConv, HSZ hszItem, USHORT nFormat, USHORT nType,
+ ULONG nTimeout, ULONG* pResult)
+{
+ //WRITELOG("DdeClientTransaction:Start")
+
+#if 0 && defined(OV_DEBUG)
+ if( nType == XTYP_REQUEST )
+ {
+ WRITELOG("Start XTYP_REQUEST");
+ WinMessageBox(HWND_DESKTOP,HWND_DESKTOP,
+ "Start XTYP_REQUEST","DdeClientTransaction",
+ HWND_DESKTOP,MB_OK);
+ }
+#endif
+
+ if( pResult )
+ *pResult = 0;
+
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ if ( !pData )
+ {
+ ImpDdeMgr::nLastErrInstance = DMLERR_DLL_NOT_INITIALIZED;
+ return (HDDEDATA)0;
+ }
+
+ BOOL bIsDdeHandle = (BOOL)(pDdeData && cbData==0xffffffff);
+ BOOL bAppOwnsHandle = (BOOL)( bIsDdeHandle &&
+ (((DDESTRUCT*)pDdeData)->fsStatus & IMP_HDATAAPPOWNED) );
+
+ BOOL bNoData = (BOOL)(nType & XTYPF_NODATA)!=0;
+ BOOL bAckReq = (BOOL)(nType & XTYPF_ACKREQ)!=0;
+ USHORT nTypeFlags = nType & XTYPF_MASK;
+ nType &= (~XTYPF_MASK);
+
+ BOOL bSync = (BOOL)( nTimeout != TIMEOUT_ASYNC ) != 0;
+ if( nType == XTYP_ADVSTART )
+ bSync = TRUE;
+
+ // Mapping transaction -> OS/2-Message
+ USHORT nTimeoutErr, nMsg;
+ switch ( nType )
+ {
+ case XTYP_ADVSTART:
+ nMsg = WM_DDE_ADVISE;
+ nTimeoutErr = DMLERR_ADVACKTIMEOUT;
+{
+ nTimeout = 60000;
+#if 0 && defined(OV_DEBUG)
+ char aBuf[ 128 ];
+ ImpDdeMgr::DdeQueryString( hszItem,aBuf,127,850);
+ String aXXStr("Establishing hotlink ");
+ aXXStr += aBuf;
+ WRITELOG((char*)aXXStr.GetStr());
+#endif
+
+}
+ break;
+
+ case XTYP_ADVSTOP:
+ nMsg = WM_DDE_UNADVISE;
+ nTimeoutErr = DMLERR_UNADVACKTIMEOUT;
+ break;
+
+ case XTYP_REQUEST:
+ nMsg = WM_DDE_REQUEST;
+ nTimeoutErr = DMLERR_DATAACKTIMEOUT;
+ break;
+
+ case XTYP_POKE:
+ nMsg = WM_DDE_POKE;
+ nTimeoutErr = DMLERR_POKEACKTIMEOUT;
+ break;
+
+ case XTYP_EXECUTE:
+ nMsg = WM_DDE_EXECUTE;
+ nTimeoutErr = DMLERR_EXECACKTIMEOUT;
+ break;
+
+ default:
+ nMsg = 0;
+ }
+ if(!hConv || (USHORT)hConv>= pData->nMaxConvCount || !nType || !nMsg ||
+ (nType != XTYP_EXECUTE && (!hszItem || !nFormat)) )
+ {
+ WRITELOG("DdeClientTransaction:Invalid parameter")
+ ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ if( bIsDdeHandle && !bAppOwnsHandle )
+ DdeFreeDataHandle( (HDDEDATA)pDdeData );
+ return (HDDEDATA)0;
+ }
+
+ // ueber den Conversation handle das ImpDdeMgr-Objekt holen
+ ImpHCONV* pConv = GetConvTable( pData );
+ pConv += (USHORT)hConv;
+ ImpConvWndData* pObj =
+ (ImpConvWndData*)WinQueryWindowULong( pConv->hWndThis, 0 );
+ ImpDdeMgr* pThis = pObj->pThis;
+
+ if( bSync && pThis->bInSyncTrans )
+ {
+ WRITELOG("DdeClientTransaction:Already in sync. transaction")
+ ImpDdeMgr::nLastErrInstance = DMLERR_REENTRANCY;
+ if( bIsDdeHandle && !bAppOwnsHandle )
+ DdeFreeDataHandle( (HDDEDATA)pDdeData );
+ return (HDDEDATA)0;
+ }
+
+ Transaction* pTrans;
+
+ BOOL bReqOnAdvLoop = FALSE;
+ ULONG nTransId = GetTransaction( pData, hConv, hszItem, nFormat );
+ if( nTransId )
+ {
+ // WRITELOG("DdeClientTransaction:Transaction found")
+ pTrans = GetTransTable( pData );
+ pTrans += (USHORT)nTransId;
+ USHORT nTransType = pTrans->nType;
+ nTransType &= (~XTYPF_MASK);
+ if( (nType != XTYP_REQUEST && nTransType == nType) ||
+ // wird Advise-Loop schon zum requesten missbraucht ?
+ (nType == XTYP_REQUEST &&
+ nTransType == XTYP_ADVREQ &&
+ pTrans->nConvst == XST_WAITING_REQDATA))
+ {
+ // dieser Kanal ist dicht!
+ WRITELOG("DdeClientTransaction:Transaction already used")
+ ImpDdeMgr::nLastErrInstance = DMLERR_REENTRANCY;
+ if( bIsDdeHandle && !bAppOwnsHandle )
+ DdeFreeDataHandle( (HDDEDATA)pDdeData );
+ return (HDDEDATA)0;
+ }
+ else if( nTransType == XTYP_ADVREQ )
+ {
+ switch( nType )
+ {
+ case XTYP_ADVSTOP:
+ //WRITELOG("DdeClientTransaction:Stopping advise trans")
+ pTrans->nType = XTYP_ADVSTOP;
+ break;
+
+ case XTYP_ADVSTART:
+ //WRITELOG("DdeClientTransaction:Adj. Advise-Params")
+ pTrans->nType = XTYP_ADVREQ;
+ if( bNoData )
+ pTrans->nType |= XTYPF_NODATA;
+ if( bAckReq )
+ pTrans->nType |= XTYPF_ACKREQ;
+ if( pResult )
+ *pResult = nTransId;
+ return (HDDEDATA)TRUE;
+
+ case XTYP_REQUEST:
+ // WRITELOG("DdeClientTransaction:Using adv trans for req")
+ // nConvst wird unten auf XST_WAITING_REQDATA gesetzt
+ bReqOnAdvLoop = TRUE;
+ break;
+
+ default:
+ WRITELOG("DdeClientTransaction:Invalid parameter")
+ ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ if( bIsDdeHandle && !bAppOwnsHandle )
+ DdeFreeDataHandle( (HDDEDATA)pDdeData );
+ return (HDDEDATA)FALSE;
+ }
+ }
+ }
+ else
+ {
+ // WRITELOG("DdeClientTransaction:Creating transaction")
+ nTransId = CreateTransaction(pData, hConv, hszItem, nFormat, nType);
+ }
+
+ pTrans = GetTransTable( pData );
+ pTrans += (USHORT)nTransId;
+ pTrans->nConvst = XST_WAITING_ACK;
+ if( nType == XTYP_REQUEST )
+ pTrans->nConvst = XST_WAITING_REQDATA;
+
+ HWND hWndServer = pConv->hWndPartner;
+ HWND hWndClient = pConv->hWndThis;
+
+ HDDEDATA pOutDDEData;
+ if( bIsDdeHandle )
+ {
+ if( bAppOwnsHandle )
+ {
+ // wir muessen leider leider duplizieren, da uns OS/2
+ // keine Chance laesst, diesen Status im Datenobjekt
+ // zu versenken.
+ ////WRITELOG("DdeClientTransaction:Copying handle")
+ HDDEDATA pNew;
+ HDDEDATA pData = (HDDEDATA)pDdeData;
+ if( !(MyDosAllocSharedMem((PPVOID)&pNew, NULL, pData->cbData,
+ PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_GIVEABLE,
+ "MakeDDEObject")))
+ {
+ memcpy( pNew, pData, pData->cbData );
+ pOutDDEData = pNew;
+ }
+ else
+ {
+ WRITELOG("DdeClientTransaction:No Memory")
+ ImpDdeMgr::nLastErrInstance = DMLERR_LOW_MEMORY;
+ return (HDDEDATA)0;
+ }
+ }
+ else
+ pOutDDEData = (HDDEDATA)pDdeData;
+ }
+ else
+ pOutDDEData=MakeDDEObject(hWndServer,hszItem,0,nFormat,pDdeData,cbData);
+
+ pOutDDEData->fsStatus |= nTypeFlags;
+
+ HDDEDATA pDDEInData = 0;
+ if( bSync )
+ {
+ if( nType != XTYP_REQUEST )
+ pOutDDEData->fsStatus |= DDE_FACKREQ;
+
+ // WRITELOG("DdeClientTransaction:Starting sync. trans.")
+ pThis->hSyncResponseData = (HDDEDATA)0;
+ pThis->nSyncResponseMsg = 0;
+ pThis->bInSyncTrans = TRUE;
+ pThis->nSyncTransId = nTransId;
+ pThis->bSyncAbandonTrans = FALSE;
+
+ if ( !MyWinDdePostMsg( hWndServer, hWndClient, nMsg, pOutDDEData,
+ DDEPM_RETRY) )
+ {
+ WRITELOG("DdeClientTransaction:PostMsg failed")
+ nLastErrInstance = DMLERR_POSTMSG_FAILED;
+ if( !bReqOnAdvLoop )
+ FreeTransaction( pData, nTransId );
+ else
+ {
+ DBG_ASSERT(pTrans->nType==XTYP_ADVREQ,"DDE:Error!")
+ pTrans->nConvst = 0;
+ }
+ return FALSE;
+ }
+ HAB hAB = WinQueryAnchorBlock( hWndClient );
+ ULONG nDummyTimer = WinStartTimer( hAB, 0, 0, 50 );
+ ULONG nTimeoutId = TID_USERMAX - nTransId;
+ WinStartTimer( hAB, hWndClient, nTimeoutId, nTimeout );
+ QMSG aQueueMsg;
+ BOOL bLoop = TRUE;
+ while( bLoop )
+ {
+ if( pThis->nSyncResponseMsg )
+ bLoop = FALSE;
+ else
+ {
+ if( WinGetMsg(hAB,&aQueueMsg,0,0,0 ))
+ {
+ WinDispatchMsg( hAB, &aQueueMsg );
+ }
+ else
+ bLoop = FALSE;
+ }
+ }
+
+ WinStopTimer( hAB, hWndClient, nTimeoutId );
+ WinStopTimer( hAB, 0, nDummyTimer );
+
+ //
+ // Der Speicherblock pOutDDEData muss vom Server geloescht worden sein!
+ // Ueberlegen: Nochmal loeschen, falls Server buggy ist, ansonsten
+ // platzt uns bald der Adressraum!
+ //
+ if( !pThis->nSyncResponseMsg )
+ {
+ // unsere App wurde beendet
+ ////WRITELOG("DdeClientTransaction:App terminated")
+ return 0;
+ }
+ pDDEInData = pThis->hSyncResponseData;
+ nMsg = pThis->nSyncResponseMsg;
+ pThis->hSyncResponseData= 0;
+ pThis->nSyncResponseMsg = 0;
+ pThis->bInSyncTrans = FALSE;
+ pThis->nSyncTransId = 0;
+ if( !pDDEInData && nMsg != WM_TIMER )
+ {
+ DBG_ASSERT(0,"Dde:No data!");
+ WRITELOG("DdeClientTransaction: No Data!")
+ return (HDDEDATA)0;
+ }
+ switch( nMsg )
+ {
+ case WM_TIMER:
+ WRITELOG("DdeClientTransaction:Timeout!")
+ nLastErrInstance = nTimeoutErr;
+ if( bReqOnAdvLoop )
+ // auf normalen Loop-Betrieb zurueckschalten
+ pTrans->nConvst = XST_WAITING_ADVDATA;
+ break;
+
+ case WM_DDE_ACK:
+ {
+ // WRITELOG("DdeClientTransaction:Ack received")
+ BOOL bPositive = (BOOL)(pDDEInData->fsStatus & DDE_FACK);
+ MyDosFreeMem( pDDEInData,"DdeClientTransaction" );
+ pDDEInData = (HDDEDATA)bPositive;
+ if( nType == XTYP_ADVSTART && pDDEInData )
+ {
+
+#if 0 && defined(OV_DEBUG)
+ char aBuf[ 128 ];
+ ImpDdeMgr::DdeQueryString( pTrans->hszItem,aBuf,128,850);
+ String aXXStr("Hotlink ");
+#endif
+
+ if( bPositive )
+ {
+ pTrans->nType = XTYP_ADVREQ;
+ // Hot/Warmlink, Ack
+ pTrans->nType |= nTypeFlags;
+ // XST_WAITING_ACK ==> XST_WAITING_ADVDATA
+ pTrans->nConvst = XST_WAITING_ADVDATA;
+
+#if 0 && defined(OV_DEBUG)
+ aXXStr += "established ";
+ aXXStr += aBuf;
+#endif
+
+ }
+
+#if 0 && defined(OV_DEBUG)
+ else
+ {
+ aXXStr += "failed ";
+ aXXStr += aBuf;
+ }
+ WRITELOG((char*)aXXStr.GetStr());
+#endif
+
+ }
+ }
+ break;
+
+ case WM_DDE_DATA:
+ // WRITELOG("DdeClientTransaction:Data received")
+ // WRITEDATA(pDDEInData)
+ if( bReqOnAdvLoop )
+ {
+ DBG_ASSERT(pTrans->nConvst==XST_WAITING_REQDATA,"DDE:Bad state");
+ DBG_ASSERT(pTrans->nType==XTYP_ADVREQ,"DDE:Bad state");
+ // auf Loop-Betrieb umschalten
+ pTrans->nConvst = XST_WAITING_ADVDATA;
+ }
+ break;
+
+ default:
+ WRITELOG("DdeClientTransaction:Unexpected msg")
+ MyDosFreeMem( pDDEInData,"DdeClientTransaction" );
+ pDDEInData = 0;
+ }
+ pThis->bSyncAbandonTrans = FALSE;
+ pThis->bInSyncTrans = FALSE;
+ if( pThis->bSyncAbandonTrans && bReqOnAdvLoop )
+ pThis->DdeAbandonTransaction( hConv, nTransId );
+ }
+ else
+ {
+ // WRITELOG("DdeClientTransaction:Starting async. trans.")
+ pDDEInData = (HDDEDATA)MyWinDdePostMsg( hWndServer, hWndClient, nMsg,
+ pOutDDEData, DDEPM_RETRY);
+ if( !pDDEInData )
+ {
+ WRITELOG("DdeClientTransaction:PostMsg failed")
+ nLastErrInstance = DMLERR_POSTMSG_FAILED;
+ if( !bReqOnAdvLoop )
+ FreeTransaction( pData, nTransId );
+ else
+ {
+ DBG_ASSERT(pTrans->nType==XTYP_ADVREQ,"DDE:Error!")
+ pTrans->nConvst = 0;
+ }
+ }
+ else
+ {
+ // WRITELOG("DdeClientTransaction:Async trans. success")
+ if( pResult )
+ *pResult = nTransId;
+ }
+ }
+#if 0 && defined( OV_DEBUG )
+ if( nType == XTYP_REQUEST )
+ {
+ WRITELOG("End XTYP_REQUEST");
+ WinMessageBox(HWND_DESKTOP,HWND_DESKTOP,
+ "End XTYP_REQUEST","DdeClientTransaction",
+ HWND_DESKTOP,MB_OK);
+ }
+#endif
+ //WRITELOG("DdeClientTransaction:End")
+ //WRITESTATUS("DdeClientTransaction:End")
+ return pDDEInData;
+}
+
+MRESULT ImpDdeMgr::DdeRegister( ImpWndProcParams* pParams )
+{
+ MRESULT nRet = (MRESULT)0;
+ if ( !(nTransactFilter & CBF_SKIP_REGISTRATIONS) )
+ {
+ HSZ hSBaseName = (HSZ)pParams->nPar1;
+ HSZ hIBaseName = (HSZ)pParams->nPar2;
+ nRet=(MRESULT)Callback(XTYP_REGISTER,0,0,hSBaseName,hIBaseName,0,0,0);
+ }
+ return nRet;
+}
+
+MRESULT ImpDdeMgr::DdeUnregister( ImpWndProcParams* pParams )
+{
+ MRESULT nRet = (MRESULT)0;
+ if ( !(nTransactFilter & CBF_SKIP_UNREGISTRATIONS) )
+ {
+ HSZ hSBaseName = (HSZ)pParams->nPar1;
+ HSZ hIBaseName = (HSZ)pParams->nPar2;
+ nRet=(MRESULT)Callback(XTYP_UNREGISTER,0,0,hSBaseName,hIBaseName,0,0,0);
+ }
+ return nRet;
+}
+
+MRESULT ImpDdeMgr::DdeTimeout( ImpWndProcParams* pParams )
+{
+ ////WRITELOG("DdeTimeout:Received")
+ if( nSyncResponseMsg )
+ {
+ ////WRITELOG("DdeTimeout:Trans already processed->ignoring timeout")
+ return (MRESULT)1;
+ }
+ ULONG nTimerId = (ULONG)pParams->nPar1;
+ ULONG nTransId = TID_USERMAX - nTimerId;
+ Transaction* pTrans = pTransTable;
+ pTrans += (USHORT)nTransId;
+ if( nTransId < 1 || nTransId >= pData->nMaxTransCount ||
+ pTrans->hConvOwner == 0 )
+ {
+ DBG_ASSERT(0,"DdeTimeout:Invalid TransactionId");
+ return (MRESULT)1;
+ }
+ if( bInSyncTrans && nTransId == nSyncTransId )
+ {
+ USHORT nTempType = pTrans->nType;
+ nTempType &= (~XTYPF_MASK);
+ // advise-loops koennen nur innerhalb synchroner
+ // requests timeouts bekommen. die transaktion wird
+ // in diesem fall nicht geloescht.
+ if( nTempType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK) ))
+ {
+ ////WRITELOG("DdeTimeout:Freeing transaction")
+ FreeTransaction( pData, nTransId );
+ }
+ nSyncResponseMsg = WM_TIMER;
+#if 0 && defined( OV_DEBUG )
+ String aMsg("DdeTimeout:Transaction=");
+ aMsg += nTransId;
+ WRITELOG((char*)(const char*)aMsg)
+#endif
+ }
+ else
+ {
+ ////WRITELOG("DdeTimeout:Async transaction timed out")
+ pTrans->nConvst = XST_TIMEOUT;
+ }
+ return (MRESULT)1;
+}
+
+
+
+MRESULT ImpDdeMgr::DdeTerminate( ImpWndProcParams* pParams )
+{
+ WRITELOG("DdeTerminate:Received")
+ HWND hWndThis = pParams->hWndReceiver;
+ HWND hWndPartner = (HWND)(pParams->nPar1);
+
+ HCONV hConv = GetConvHandle( pData, hWndThis, hWndPartner );
+#if 0 && defined( OV_DEBUG )
+ String strDebug("DdeTerminate:ConvHandle=");
+ strDebug += (USHORT)hConv;
+ WRITELOG((char*)(const char*)strDebug)
+#endif
+ ImpHCONV* pConv = pConvTable + (USHORT)hConv;
+ if( hConv )
+ {
+ // warten wir auf ein DDE_TERMINATE Acknowledge ?
+ if( pConv->nStatus & ST_TERMINATED )
+ {
+ ////WRITELOG("DdeTerminate:TERMINATE-Ack received")
+ pConv->nStatus |= ST_TERMACKREC;
+ return (MRESULT)0; // DdeDisconnect raeumt jetzt auf
+ }
+
+ // sind wir Server?, wenn ja: die App benachrichtigen,
+ // dass die Advise loops gestoppt wurden und die
+ // Transaktionen loeschen
+
+ // OV 26.07.96: Die das TERMINATE empfangende App muss
+ // die Transaction-Tabelle abraeumen, egal ob Server oder Client!!
+ // Es muessen alle Trans geloescht werden, die als Owner den
+ // Client oder den Server haben!
+ // if( !(pConv->nStatus & ST_CLIENT ) )
+ SendUnadvises( hConv, 0, FALSE ); // alle Formate & nicht loeschen
+ SendUnadvises( pConv->hConvPartner, 0, FALSE );
+
+ // wir werden von draussen gekillt
+ if ( !(nTransactFilter & CBF_SKIP_DISCONNECTS) )
+ {
+ Callback( XTYP_DISCONNECT, 0, hConv, 0, 0, 0,
+ 0, (ULONG)IsSameInstance(hWndPartner));
+ }
+
+ // kann unsere Partner-App DDEML ?
+ if( !(pConv->hConvPartner) )
+ {
+ // nein, deshalb Transaktionstabelle selbst loeschen
+ ////WRITELOG("DdeTerminate:Freeing transactions")
+ FreeTransactions( pData, hConv );
+ }
+ }
+ else
+ nLastErrInstance = DMLERR_NO_CONV_ESTABLISHED;
+
+#if 0 && defined(OV_DEBUG)
+ if( !WinIsWindow(0,hWndPartner))
+ {
+ WRITELOG("DdeTerminate:hWndPartner not valid")
+ }
+ if(!WinIsWindow(0,hWndThis))
+ {
+ WRITELOG("DdeTerminate:hWndThis not valid")
+ }
+#endif
+
+ if( hConv )
+ {
+ // hWndThis nicht loeschen, da wir den Handle noch fuer
+ // das Acknowledge brauchen
+ ////WRITELOG("DdeTerminate:Freeing conversation")
+ FreeConvHandle( pData, hConv, FALSE );
+ }
+
+ ////WRITELOG("DdeTerminate:Acknowledging DDE_TERMINATE")
+
+#ifdef OV_DEBUG
+ DBG_ASSERT(WinIsWindow( 0, hWndThis ),"hWndThis not valid");
+#endif
+
+ if( !WinDdePostMsg( hWndPartner, hWndThis, WM_DDE_TERMINATE, 0, DDEPM_RETRY ))
+ {
+ ////WRITELOG("DdeTerminate:Acknowledging DDE_TERMINATE failed")
+ }
+ // jetzt hWndThis loeschen
+ DestroyConversationWnd( hWndThis );
+
+ return (MRESULT)0;
+}
+
+
+/*
+ Zuordnung des Conversationhandles:
+
+ Verbindungsaufbau:
+ Client: DdeInitiate( HWNDClient )
+ Server: Post( WM_DDE_INITIATEACK( HWNDServer ))
+ Client: CreateConvHandle( HWNDClient, HWNDServer )
+
+ Datenaustausch:
+ Server: Post(WM_DDE_ACK( HWNDSender ))
+ Client: GetConvHandle( HWNDClient, HWNDSender )
+*/
+
+MRESULT ImpDdeMgr::ConvWndProc( HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2 )
+{
+ ImpWndProcParams aParams;
+
+ MRESULT nRet = (MRESULT)0;
+ aParams.hWndReceiver= hWnd;
+ aParams.nPar1 = nPar1;
+ aParams.nPar2 = nPar2;
+
+ switch( nMsg )
+ {
+
+#ifdef DBG_UTIL
+ case WM_DDE_INITIATE :
+ DBG_ASSERT(0,"dde:unexpected msg");
+ nRet = (MRESULT)TRUE;
+ break;
+#endif
+
+ case WM_DDE_INITIATEACK : nRet = DdeInitiateAck(&aParams); break;
+ case WM_DDE_ACK : nRet = DdeAck( &aParams ); break;
+ case WM_DDE_ADVISE : nRet = DdeAdvise( &aParams ); break;
+ case WM_DDE_DATA : nRet = DdeData( &aParams ); break;
+ case WM_DDE_EXECUTE : nRet = DdeExecute( &aParams ); break;
+ case WM_DDE_POKE : nRet = DdePoke( &aParams ); break;
+ case WM_DDE_REQUEST : nRet = DdeRequest( &aParams ); break;
+ case WM_DDE_TERMINATE : nRet = DdeTerminate( &aParams ); break;
+ case WM_DDE_UNADVISE : nRet = DdeUnadvise( &aParams ); break;
+ case WM_TIMER : nRet = DdeTimeout( &aParams ); break;
+ }
+ return nRet;
+}
+
+MRESULT ImpDdeMgr::SrvWndProc( HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2 )
+{
+ MRESULT nRet = (MRESULT)0;
+
+ ImpWndProcParams aParams;
+ aParams.hWndReceiver= hWnd;
+ aParams.nPar1 = nPar1;
+ aParams.nPar2 = nPar2;
+
+ switch( nMsg )
+ {
+#ifdef DBG_UTIL
+ case WM_DDE_ACK :
+ case WM_DDE_ADVISE :
+ case WM_DDE_EXECUTE :
+ case WM_DDE_POKE :
+ case WM_DDE_REQUEST :
+ case WM_DDE_UNADVISE :
+ case WM_DDE_DATA :
+ case WM_DDE_INITIATEACK :
+ DBG_ASSERT(0,"dde:unexpected msg");
+ nRet = (MRESULT)TRUE;
+ break;
+#endif
+
+ case WM_DDE_TERMINATE :
+ break; // DDE_INITIATE wurde im DDE_INITIATEACK terminiert
+
+ // ein Client will was von uns
+ case WM_DDE_INITIATE :
+ nRet = DdeInitiate( &aParams );
+ break;
+
+ // eine ddeml-faehige App. hat einen Service (typ. AppName) [de]reg.
+ case WM_DDEML_REGISTER :
+ nRet = DdeRegister( &aParams );
+ break;
+
+ case WM_DDEML_UNREGISTER :
+ nRet = DdeUnregister( &aParams );
+ break;
+ };
+ return nRet;
+}
+
+
+MRESULT ImpDdeMgr::DdeAck( ImpWndProcParams* pParams )
+{
+ //WRITELOG("DdeAck:Start")
+ HSZ hszItem;
+ DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2);
+ if( pInDDEData )
+ {
+ BOOL bPositive = (BOOL)(pInDDEData->fsStatus & DDE_FACK ) != 0;
+ BOOL bBusy = bPositive ? FALSE : (BOOL)(pInDDEData->fsStatus & DDE_FBUSY ) != 0;
+ BOOL bNotProcessed = (BOOL)(pInDDEData->fsStatus & DDE_NOTPROCESSED ) != 0;
+#if 0 && defined( OV_DEBUG )
+ String aDebStr("DdeAck:Received ");
+ if( bPositive )
+ aDebStr += "(positive)";
+ else
+ aDebStr += "(negative)";
+ if( bBusy )
+ aDebStr += "(busy)";
+ if( bNotProcessed )
+ aDebStr += "(not processed)";
+ WRITELOG((char*)(const char*)aDebStr)
+#endif
+ // ein DDE_ACK niemals bestaetigen (um endlosschleifen zu vermeiden)
+ pInDDEData->fsStatus &= (~DDE_FACKREQ);
+ }
+ else
+ {
+ //WRITELOG("DdeAck:Received (no data!)")
+ return (MRESULT)0;
+ }
+
+ HCONV hConv = CheckIncoming(pParams, 0, hszItem);
+#ifdef OV_DEBUG
+ if( !hConv )
+ {
+ WRITELOG("DdeAck:HCONV not found")
+ }
+#endif
+ ULONG nTransId=GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat);
+ if( !nTransId )
+ {
+ WRITELOG("DdeAck:Transaction not found")
+ MyDosFreeMem( pInDDEData,"DdeAck" );
+ return (MRESULT)0;
+ }
+
+ BOOL bThisIsSync = (BOOL)( bInSyncTrans && nTransId == nSyncTransId );
+#if 0 && defined( OV_DEBUG )
+ if( bThisIsSync)
+ WRITELOG("DdeAck: sync transaction")
+ else
+ WRITELOG("DdeAck: async transaction")
+#endif
+ // pruefen, ob die Transaktion abgeschlossen ist.
+ Transaction* pTrans = pTransTable;
+ pTrans += (USHORT)nTransId;
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+
+ if( pTrans->nConvst == XST_UNADVSENT )
+ {
+ //WRITELOG("DdeAck:Unadvise-Ack received")
+ pTrans->nConvst = XST_UNADVACKRCVD;
+ MyDosFreeMem( pInDDEData,"DdeAck" );
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+ }
+ if( pTrans->nConvst == XST_ADVDATASENT )
+ {
+ //WRITELOG("DdeAck:AdvData-Ack received")
+ pTrans->nConvst = XST_ADVDATAACKRCVD;
+ MyDosFreeMem( pInDDEData,"DdeAck" );
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+ }
+
+ USHORT nType = pTrans->nType;
+ nType &= (~XTYPF_MASK);
+ // beginn einer advise-loop oder request auf advise-loop ?
+ // wenn ja: transaktion nicht loeschen
+ BOOL bFinished = (BOOL)(nType != XTYP_ADVSTART &&
+ nType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK)) );
+ if( bFinished )
+ {
+ if( !bThisIsSync )
+ {
+ ////WRITELOG("DdeAck:Transaction completed")
+ Callback( XTYP_XACT_COMPLETE, pInDDEData->usFormat, hConv,
+ pConv->hszTopic, hszItem, (HDDEDATA)0, nTransId, 0 );
+ }
+ ////WRITELOG("DdeAck:Freeing transaction")
+ FreeTransaction( pData, nTransId );
+ }
+
+ if( bThisIsSync )
+ {
+ hSyncResponseData = pInDDEData;
+ nSyncResponseMsg = WM_DDE_ACK;
+ }
+ else
+ {
+ MyDosFreeMem( pInDDEData,"DdeAck" );
+ }
+
+ DdeFreeStringHandle( hszItem );
+
+ return (MRESULT)0;
+}
+
+
+USHORT ImpDdeMgr::SendUnadvises(HCONV hConvServer,USHORT nFormat,BOOL bFree)
+{
+ USHORT nTransFound = 0;
+ BOOL bCallApp = (BOOL)(!(nTransactFilter & CBF_FAIL_ADVISES));
+#if 0 && defined( OV_DEBUG )
+ String aStr("Unadvising transactions for HCONV=");
+ aStr += (ULONG)hConvServer;
+ aStr += " CallApp:"; aStr += (USHORT)bCallApp;
+ WRITELOG((char*)aStr.GetStr())
+#endif
+
+
+ // wenn wir weder loeschen noch die App benachrichtigen sollen,
+ // koennen wir gleich wieder returnen
+ if( !hConvServer || ( !bFree && !bCallApp ) )
+ return 0;
+
+ ImpHCONV* pConvSrv = pConvTable;
+ pConvSrv += (USHORT)hConvServer;
+ HSZ hszTopic = pConvSrv->hszTopic;
+
+ Transaction* pTrans = pTransTable;
+ pTrans++;
+ USHORT nCurTransId = 1;
+ USHORT nCurTransactions = pData->nCurTransCount;
+ while( nCurTransactions && nCurTransId < pData->nMaxTransCount )
+ {
+ if( pTrans->hConvOwner )
+ nCurTransactions--;
+ if( pTrans->hConvOwner == hConvServer &&
+ (pTrans->nType & XTYP_ADVREQ) )
+ {
+ if( !nFormat || (nFormat == pTrans->nFormat) )
+ {
+ nTransFound++;
+ if( bCallApp )
+ {
+ //WRITELOG("SendUnadvises:Notifying App")
+ Callback( XTYP_ADVSTOP, pTrans->nFormat, hConvServer,
+ hszTopic, pTrans->hszItem, 0,0,0 );
+ }
+ if( bFree )
+ FreeTransaction( pData, (ULONG)nCurTransId );
+ }
+ }
+ nCurTransId++;
+ pTrans++;
+ }
+ return nTransFound;
+}
+
+
+
+HCONV ImpDdeMgr::CheckIncoming( ImpWndProcParams* pParams, ULONG nTransMask,
+ HSZ& rhszItem )
+{
+// ////WRITELOG("CheckIncoming")
+ rhszItem = 0;
+ DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2);
+ if( !pInDDEData )
+ {
+ // ////WRITELOG("CheckIncoming:PDDESTRUCT==0")
+ return (HCONV)0;
+ }
+
+ HWND hWndThis = pParams->hWndReceiver;
+ HWND hWndClient = (HWND)pParams->nPar1;
+
+ BOOL bReject = (BOOL)(nTransactFilter & nTransMask);
+ HCONV hConv;
+ if( !bReject )
+ hConv = GetConvHandle( pData, hWndThis, hWndClient );
+ if ( bReject || !hConv )
+ return (HCONV)0;
+
+ rhszItem = DdeCreateStringHandle(
+ ((char*)(pInDDEData)+pInDDEData->offszItemName), 850 );
+
+ // ////WRITELOG("CheckIncoming:OK");
+ return hConv;
+}
+
+
+MRESULT ImpDdeMgr::DdeAdvise( ImpWndProcParams* pParams )
+{
+ ////WRITELOG("DdeAdvise:Received")
+ HSZ hszItem;
+ HCONV hConv = CheckIncoming(pParams, CBF_FAIL_ADVISES, hszItem);
+ DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2);
+ HWND hWndThis = pParams->hWndReceiver;
+ HWND hWndClient = (HWND)pParams->nPar1;
+ if( !hConv )
+ {
+ ////WRITELOG("DdeAdvise:Conversation not found")
+ pInDDEData->fsStatus &= (~DDE_FACK);
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+ }
+
+ Transaction* pTrans = pTransTable;
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+
+ // existiert schon ein Link auf Topic/Item/Format-Vektor ?
+
+ ULONG nTransId=GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat);
+ if( nTransId )
+ {
+ ////WRITELOG("DdeAdvise:Transaction already exists")
+ pTrans += (USHORT)nTransId;
+ // ist es eine AdviseLoop ?
+ USHORT nTempType = pTrans->nType;
+ nTempType &= (~XTYPF_MASK);
+ if( nTempType == XTYP_ADVREQ )
+ {
+ // Flags der laufenden Advise-Loop aktualisieren
+ ////WRITELOG("DdeAdvise:Adjusting Advise-Params")
+ pTrans->nType = XTYP_ADVREQ;
+ if( pInDDEData->fsStatus & DDE_FNODATA )
+ pTrans->nType |= XTYPF_NODATA;
+ if( pInDDEData->fsStatus & DDE_FACKREQ )
+ pTrans->nType |= XTYPF_ACKREQ;
+ pInDDEData->fsStatus |= DDE_FACK;
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+ }
+ else if( nTempType != XTYP_ADVSTART )
+ {
+ ////WRITELOG("DdeAdvise:Not a advise transaction")
+ pInDDEData->fsStatus &= (~DDE_FACK);
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+ }
+ }
+
+ if( !nTransId )
+ {
+ ////WRITELOG("DdeAdvise:Creating Transaction")
+ ////WRITESTATUS("DdeAdvise:Creating Transaction")
+ nTransId = CreateTransaction( pData, hConv, hszItem,
+ pInDDEData->usFormat, XTYP_ADVREQ );
+ ////WRITESTATUS("DdeAdvise:Created Transaction")
+ }
+ if( nTransId )
+ {
+ pTrans = pTransTable;
+ pTrans += (USHORT)nTransId;
+ if( pInDDEData->fsStatus & DDE_FNODATA )
+ pTrans->nType |= XTYPF_NODATA;
+ if( pInDDEData->fsStatus & DDE_FACKREQ )
+ pTrans->nType |= XTYPF_ACKREQ;
+ }
+ else
+ {
+ ////WRITELOG("DdeAdvise:Cannot create Transaction")
+ pInDDEData->fsStatus &= (~DDE_FACK);
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+ }
+
+ ////WRITELOG("DdeAdvise:Calling Server")
+
+ if ( Callback( XTYP_ADVSTART, pInDDEData->usFormat,
+ hConv, pConv->hszTopic, hszItem, (HDDEDATA)0, 0, 0 ) )
+ {
+ //
+ // ServerApp erlaubt AdviseLoop
+ //
+ ////WRITELOG("DdeAdvise:Advise loop established")
+ pInDDEData->fsStatus |= DDE_FACK;
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ }
+ else
+ {
+ ////WRITELOG("DdeAdvise:Advise loop not established")
+ FreeTransaction( pData, nTransId );
+ pInDDEData->fsStatus &= (~DDE_FACK); // DDE_FNOTPROCESSED;
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ }
+ ////WRITESTATUS("DdeAdvise:End")
+ ////WRITELOG("DdeAdvise:End")
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+}
+
+MRESULT ImpDdeMgr::DdeData( ImpWndProcParams* pParams )
+{
+ WRITELOG("DdeData:Received")
+ HSZ hszItem;
+ HCONV hConv = CheckIncoming(pParams, 0, hszItem);
+ HWND hWndThis = pParams->hWndReceiver;
+ HWND hWndClient = (HWND)pParams->nPar1;
+ DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2);
+#if 0 && defined( OV_DEBUG )
+ {
+ String aStr("DdeData Address:");
+ aStr += (ULONG)pInDDEData;
+ WRITELOG((char*)aStr.GetStr())
+ }
+#endif
+
+ BOOL bSendAck;
+ if( pInDDEData && (pInDDEData->fsStatus & DDE_FACKREQ ))
+ {
+ WRITELOG("DdeData: Ackn requested")
+ bSendAck = TRUE;
+ }
+ else
+ {
+ WRITELOG("DdeData: Ackn not requested")
+ bSendAck = FALSE;
+ }
+
+ ULONG nTransId = GetTransaction(pData,hConv,hszItem,pInDDEData->usFormat);
+ if( !nTransId )
+ {
+ WRITELOG("DdeData:Transaction not found")
+ WRITEDATA(pInDDEData)
+ if( bSendAck )
+ {
+ WRITELOG("DdeData: Posting Ackn")
+ pInDDEData->fsStatus &= (~DDE_FACK); // NOTPROCESSED;
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ }
+ else
+ {
+ MyDosFreeMem( pInDDEData,"DdeData" );
+ }
+ return (MRESULT)0;
+ }
+
+#if 0 && defined( OV_DEBUG )
+ if( pInDDEData )
+ {
+ WRITEDATA(pInDDEData)
+ }
+#endif
+
+ BOOL bThisIsSync = (BOOL)( bInSyncTrans && nTransId == nSyncTransId );
+
+ // pruefen, ob die Transaktion abgeschlossen ist.
+ Transaction* pTrans = pTransTable;
+ pTrans += (USHORT)nTransId;
+
+ if( pTrans->nConvst == XST_WAITING_ACK )
+ {
+ // dieser Fall kann eintreten, wenn ein Server innerhalb
+ // einer WM_DDE_ADVISE-Msg. oder bevor beim Client das
+ // Ack eintrifft, Advise-Daten sendet.
+ WRITELOG("DdeData:Ignoring unexpected data")
+ if( bSendAck )
+ {
+ WRITELOG("DdeData: Posting Ackn")
+ pInDDEData->fsStatus &= (~DDE_FACK); // NOTPROCESSED;
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ }
+ else
+ {
+ MyDosFreeMem( pInDDEData,"DdeData" );
+ }
+ return (MRESULT)0;
+ }
+
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+
+ USHORT nType = pTrans->nType;
+ nType &= (~XTYPF_MASK);
+ BOOL bNotAdviseLoop = (BOOL)(nType != (XTYP_ADVREQ & (~XTYPF_NOBLOCK)));
+ if( !bThisIsSync )
+ {
+ // WRITELOG("DdeData:Is async transaction")
+ if( bNotAdviseLoop )
+ {
+ // WRITELOG("DdeData:Transaction completed -> calling client")
+ Callback( XTYP_XACT_COMPLETE, pInDDEData->usFormat, hConv,
+ pConv->hszTopic, hszItem, pInDDEData, nTransId, 0 );
+ // WRITELOG("DdeData:Freeing transaction")
+ FreeTransaction( pData, nTransId );
+ }
+ else
+ {
+ WRITELOG("DdeData:Advise-Loop -> calling client")
+ HDDEDATA pToSend = pInDDEData;
+ if( pTrans->nType & XTYPF_NODATA )
+ {
+ pToSend = 0;
+ // WRITELOG("DdeData:Is warm link")
+ }
+ Callback( XTYP_ADVDATA, pInDDEData->usFormat, hConv,
+ pConv->hszTopic, hszItem, pToSend, nTransId, 0 );
+ }
+ if( bSendAck )
+ {
+ WRITELOG("DdeData: Posting Ackn")
+ pInDDEData->fsStatus = DDE_FACK;
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ }
+ else
+ MyDosFreeMem( pInDDEData,"DdeData" );
+ }
+ else // synchrone Transaktion (Datenhandle nicht freigeben!)
+ {
+ // WRITELOG("DdeData:Is sync transaction")
+ hSyncResponseData = pInDDEData;
+ nSyncResponseMsg = WM_DDE_DATA;
+ if( bSendAck )
+ {
+ pInDDEData->fsStatus |= DDE_FACK;
+ WRITELOG("DdeData: Posting Ackn")
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,
+ DDEPM_RETRY | DDEPM_NOFREE );
+ }
+ }
+
+ DdeFreeStringHandle( hszItem );
+ // WRITELOG("DdeData:End")
+ return (MRESULT)0;
+}
+
+MRESULT ImpDdeMgr::DdeExecute( ImpWndProcParams* pParams )
+{
+ ////WRITELOG("DdeExecute:Received")
+ DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2);
+ HSZ hszItem;
+ HCONV hConv = CheckIncoming(pParams, 0, hszItem);
+ BOOL bSuccess = FALSE;
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+ if ( hConv && !(nTransactFilter & CBF_FAIL_EXECUTES) && pInDDEData )
+ {
+ if ( Callback( XTYP_EXECUTE, pInDDEData->usFormat, hConv,
+ pConv->hszTopic, hszItem, pInDDEData, 0, 0 )
+ == (DDESTRUCT*)DDE_FACK )
+ bSuccess = TRUE;
+ }
+ else
+ {
+ ////WRITELOG("DdeExecute:Not processed")
+ }
+ if( pInDDEData )
+ {
+ if( bSuccess )
+ pInDDEData->fsStatus |= DDE_FACK;
+ else
+ pInDDEData->fsStatus &= (~DDE_FACK);
+ MyWinDdePostMsg( pConv->hWndPartner, pConv->hWndThis, WM_DDE_ACK,
+ pInDDEData, DDEPM_RETRY );
+ }
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+}
+
+HCONV ImpDdeMgr::ConnectWithClient( HWND hWndClient,
+ HSZ hszPartner, HSZ hszService, HSZ hszTopic, BOOL bSameInst,
+ DDEINIT* pDDEData, CONVCONTEXT* pCC )
+{
+ ////WRITELOG("ConnectWithClient:Start")
+ HWND hWndSrv = CreateConversationWnd();
+ IncConversationWndRefCount( hWndSrv );
+ HCONV hConv = CreateConvHandle( pData, pidThis, hWndSrv, hWndClient,
+ hszPartner, hszService, hszTopic );
+ if(!hConv )
+ return 0;
+ BOOL bFreeDdeData = FALSE;
+ if( !pDDEData )
+ {
+ bFreeDdeData = TRUE;
+ pDDEData = CreateDDEInitData( hWndClient,hszService,hszTopic, pCC );
+ PID pid; TID tid;
+ WinQueryWindowProcess( hWndClient, &pid, &tid );
+ DosGiveSharedMem( pDDEData, pid, PAG_READ | PAG_WRITE);
+ }
+ HAB hAB = WinQueryAnchorBlock( hWndSrv );
+ WinGetLastError( hAB ); // fehlercode zuruecksetzen
+ WinSendMsg(hWndClient,WM_DDE_INITIATEACK,(MPARAM)hWndSrv,(MPARAM)pDDEData);
+ if( WinGetLastError( hAB ) )
+ {
+ // ////WRITELOG("DdeConnectWithClient:Client died")
+ if( bFreeDdeData )
+ {
+ MyDosFreeMem( pDDEData,"ConnectWithClient" );
+ }
+ FreeConvHandle( pData, hConv );
+ return (HCONV)0;
+ }
+
+ if( !(nTransactFilter & CBF_SKIP_CONNECT_CONFIRMS) )
+ {
+ Callback( XTYP_CONNECT_CONFIRM, 0, hConv, hszTopic, hszService,
+ 0, 0, (ULONG)bSameInst );
+ }
+
+ if( bFreeDdeData )
+ {
+ MyDosFreeMem( pDDEData,"ConnectWithClient" );
+ }
+ // HCONV der PartnerApp suchen & bei uns eintragen
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+ pConv->hConvPartner = GetConvHandle( pData, hWndClient, hWndSrv );
+#if 0 && defined(OV_DEBUG)
+ if( !pConv->hConvPartner )
+ {
+ WRITELOG("DdeConnectWithClient:Partner not found")
+ }
+#endif
+ pConv->nStatus = ST_CONNECTED;
+ //WRITESTATUS("Server:Connected with client")
+ //WRITELOG("ConnectWithClient:End")
+ return hConv;
+}
+
+MRESULT ImpDdeMgr::DdeInitiate( ImpWndProcParams* pParams )
+{
+ ////WRITELOG("DdeInitiate:Received")
+ HWND hWndClient = (HWND)(pParams->nPar1);
+// BOOL bSameInst = IsSameInstance( hWndClient );
+ BOOL bSameInst = (BOOL)(hWndClient==hWndServer);
+ DDEINIT* pDDEData = (DDEINIT*)pParams->nPar2;
+
+ if ( ( nTransactFilter & (CBF_FAIL_CONNECTIONS | APPCMD_CLIENTONLY)) ||
+ (( nTransactFilter & CBF_FAIL_SELFCONNECTIONS) && bSameInst )
+ )
+ {
+ MyDosFreeMem( pDDEData,"DdeInitiate" );
+ return (MRESULT)FALSE; // narda
+ }
+
+ HSZ hszService = (HSZ)0;
+ if( *(pDDEData->pszAppName) != '\0' )
+ {
+ hszService = DdeCreateStringHandle( pDDEData->pszAppName, 850 );
+ ////WRITELOG(pDDEData->pszAppName);
+ }
+ HSZ hszTopic = (HSZ)0;
+ if( *(pDDEData->pszTopic) != '\0' )
+ {
+ hszTopic = DdeCreateStringHandle( pDDEData->pszTopic, 850 );
+ ////WRITELOG(pDDEData->pszTopic);
+ }
+ HSZ hszPartner = GetAppName( hWndClient );
+
+ // nur weitermachen, wenn Service registriert oder
+ // Service-Name-Filtering ausgeschaltet.
+ if( !bServFilterOn || GetService(hszService) )
+ {
+ // XTYP_CONNECT-Transaktionen erfolgen nur mit
+ // Services & Topics ungleich 0!
+ if( hszService && hszTopic )
+ {
+ if( IsConvHandleAvailable(pData) && Callback( XTYP_CONNECT,
+ 0, 0, hszTopic,hszService, 0, 0, (ULONG)bSameInst))
+ {
+ // App erlaubt Verbindung mit Client
+ ConnectWithClient( hWndClient, hszPartner,
+ hszService, hszTopic, bSameInst, pDDEData );
+ }
+ }
+ else
+ {
+ // ** Wildcard-Connect **
+ ////WRITELOG("DdeInitiate:Wildconnect")
+ // vom Server eine Liste aller Service/Topic-Paare anfordern
+ CONVCONTEXT* pCC=(CONVCONTEXT*)(pDDEData+pDDEData->offConvContext);
+ DDESTRUCT* hList = Callback( XTYP_WILDCONNECT, 0, (HCONV)0,
+ hszTopic,hszService, (HDDEDATA)0, (ULONG)pCC, (ULONG)bSameInst );
+ if( hList )
+ {
+ HSZPAIR* pPairs = (HSZPAIR*)((char*)hList+hList->offabData);
+ while( pPairs->hszSvc )
+ {
+ ////WRITELOG("DdeInitiate:Wildconnect.Connecting")
+ ConnectWithClient( hWndClient, hszPartner,
+ pPairs->hszSvc, pPairs->hszTopic, bSameInst, 0, pCC);
+ // Stringhandles gehoeren der App! (nicht free-en)
+ pPairs++;
+ }
+ DdeFreeDataHandle( hList );
+ }
+ }
+ }
+#if 0 && defined(OV_DEBUG)
+ else
+ {
+ WRITELOG("DdeInitiate:Service filtered")
+ }
+#endif
+ DdeFreeStringHandle( hszTopic );
+ DdeFreeStringHandle( hszService );
+ DdeFreeStringHandle( hszPartner );
+ MyDosFreeMem( pDDEData,"DdeInitiate" );
+ ////WRITELOG("DdeInitiate:End")
+ return (MRESULT)TRUE;
+}
+
+MRESULT ImpDdeMgr::DdeInitiateAck( ImpWndProcParams* pParams )
+{
+ ////WRITELOG("DdeInitiateAck:Received")
+ DDEINIT* pDDEData = (DDEINIT*)(pParams->nPar2);
+
+ if( !bListConnect && hCurConv )
+ {
+ ////WRITELOG("DdeInitiateAck:Already connected")
+ MyDosFreeMem( pDDEData,"DdeInitiateAck" );
+ WinPostMsg( hWndServer, WM_DDE_TERMINATE, (MPARAM)hWndServer, 0 );
+ return (MRESULT)FALSE;
+ }
+
+ HWND hWndThis = pParams->hWndReceiver;
+ // Referenz-Count unseres Client-Windows inkrementieren
+ IncConversationWndRefCount( hWndThis );
+
+ HWND hWndSrv = (HWND)(pParams->nPar1);
+ HSZ hszService = DdeCreateStringHandle( pDDEData->pszAppName, 850 );
+ HSZ hszTopic = DdeCreateStringHandle( pDDEData->pszTopic, 850 );
+ HSZ hszPartnerApp = GetAppName( hWndSrv );
+
+ hCurConv = CreateConvHandle( pData, pidThis, hWndThis, hWndSrv,
+ hszPartnerApp, hszService, hszTopic, 0 );
+
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hCurConv;
+
+ // HCONV der PartnerApp suchen & bei uns eintragen
+ pConv->hConvPartner = GetConvHandle( pData, hWndSrv, hWndThis );
+ // nicht asserten, da ja non-ddeml-Partner moeglich
+ // DBG_ASSERT(pConv->hConvPartner,"DDE:Partner not found");
+ pConv->nStatus = ST_CONNECTED | ST_CLIENT;
+
+ if( bListConnect )
+ {
+ ////WRITELOG("DdeInitiateAck:ListConnect/Connecting hConvs")
+ // Status setzen & verketten
+ pConv->hConvList = hCurListId;
+ pConv->nPrevHCONV = nPrevConv;
+ pConv->nStatus |= ST_INLIST;
+ if( nPrevConv )
+ {
+ pConv = pConvTable;
+ pConv += nPrevConv;
+ pConv->nNextHCONV = (USHORT)hCurConv;
+ }
+ nPrevConv = (USHORT)hCurConv;
+ }
+
+ DdeFreeStringHandle( hszService );
+ DdeFreeStringHandle( hszTopic );
+ DdeFreeStringHandle( hszPartnerApp );
+ MyDosFreeMem( pDDEData,"DdeInitiateAck" );
+ ////WRITESTATUS("After DdeInitiateAck")
+ ////WRITELOG("DdeInitiateAck:End")
+ return (MRESULT)TRUE;
+}
+
+MRESULT ImpDdeMgr::DdePoke( ImpWndProcParams* pParams )
+{
+ ////WRITELOG("DdePoke:Received")
+ HSZ hszItem = 0;
+ DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2);
+ HCONV hConv = CheckIncoming( pParams, CBF_FAIL_REQUESTS, hszItem );
+ BOOL bSuccess =FALSE;
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+ if ( hConv && !(nTransactFilter & CBF_FAIL_POKES) && pInDDEData )
+ {
+ if( Callback( XTYP_POKE, pInDDEData->usFormat, hConv,
+ pConv->hszTopic, hszItem, pInDDEData, 0, 0 )
+ == (DDESTRUCT*)DDE_FACK )
+ bSuccess = TRUE;
+ }
+#if 0 && defined( OV_DEBUG )
+ else
+ {
+ WRITELOG("DdePoke:Not processed")
+ }
+#endif
+ if( pInDDEData )
+ {
+ if( bSuccess )
+ pInDDEData->fsStatus |= DDE_FACK;
+ else
+ pInDDEData->fsStatus &= (~DDE_FACK);
+
+ MyWinDdePostMsg( pConv->hWndPartner, pConv->hWndThis, WM_DDE_ACK,
+ pInDDEData, DDEPM_RETRY );
+ }
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+}
+
+MRESULT ImpDdeMgr::DdeRequest( ImpWndProcParams* pParams )
+{
+ ////WRITELOG("DdeRequest:Received")
+ HSZ hszItem = 0;
+ DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2);
+ if( pInDDEData )
+ // ist fuer Requests nicht definiert
+ pInDDEData->fsStatus = 0;
+ HCONV hConv = CheckIncoming( pParams, CBF_FAIL_REQUESTS, hszItem );
+ HWND hWndThis = pParams->hWndReceiver;
+ HWND hWndClient = (HWND)pParams->nPar1;
+ if( hConv )
+ {
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+
+ DDESTRUCT* pOutDDEData = Callback( XTYP_REQUEST, pInDDEData->usFormat,
+ hConv, pConv->hszTopic, hszItem, (HDDEDATA)0, 0, 0 );
+
+ if ( !pOutDDEData )
+ {
+ ////WRITELOG("DdeRequest:Not processed")
+ pInDDEData->fsStatus &= (~DDE_FACK);
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ }
+ else
+ {
+ ////WRITELOG("DdeRequest:Success")
+ MyDosFreeMem( pInDDEData,"DdeRequest" );
+ pOutDDEData->fsStatus |= DDE_FRESPONSE;
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_DATA,pOutDDEData,DDEPM_RETRY);
+ }
+ }
+ else
+ {
+ pInDDEData->fsStatus &= (~DDE_FACK);
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ }
+
+ DdeFreeStringHandle( hszItem );
+ ////WRITELOG("DdeRequest:End")
+ return (MRESULT)0;
+}
+
+
+MRESULT ImpDdeMgr::DdeUnadvise( ImpWndProcParams* pParams )
+{
+ ////WRITELOG("DdeUnadvise:Received")
+
+ HSZ hszItem;
+ HCONV hConv = CheckIncoming( pParams, 0, hszItem );
+ DDESTRUCT* pInDDEData = (DDESTRUCT*)(pParams->nPar2);
+ HWND hWndThis = pParams->hWndReceiver;
+ HWND hWndClient = (HWND)pParams->nPar1;
+ USHORT nClosedTransactions = 0;
+ if( hConv )
+ {
+ USHORT nFormat = pInDDEData->usFormat;
+ // alle Transaktionen des HCONVs loeschen ?
+ if( !hszItem )
+ {
+ // App benachrichtigen & Transaktionen loeschen
+ nClosedTransactions = SendUnadvises( hConv, nFormat, TRUE );
+ }
+ else
+ {
+ ULONG nTransId = GetTransaction(pData, hConv, hszItem, nFormat);
+ if( nTransId )
+ {
+ ////WRITELOG("DdeUnadvise:Transaction found")
+ Transaction* pTrans = pTransTable;
+ pTrans += (USHORT)nTransId;
+ ImpHCONV* pConv = pConvTable;
+ pConv += (USHORT)hConv;
+ nClosedTransactions = 1;
+ if( !(nTransactFilter & CBF_FAIL_ADVISES) )
+ Callback( XTYP_ADVSTOP, nFormat, hConv,
+ pConv->hszTopic, hszItem, 0, 0, 0 );
+ if( !pConv->hConvPartner )
+ FreeTransaction( pData, nTransId );
+ }
+#if defined(OV_DEBUG)
+ else
+ {
+ WRITELOG("DdeUnadvise:Transaction not found")
+ }
+#endif
+ }
+ }
+#if defined(OV_DEBUG)
+ else
+ {
+ WRITELOG("DdeUnadvise:Conversation not found")
+ }
+#endif
+
+ if( !nClosedTransactions )
+ pInDDEData->fsStatus &= (~DDE_FACK);
+ else
+ pInDDEData->fsStatus |= DDE_FACK;
+
+ MyWinDdePostMsg(hWndClient,hWndThis,WM_DDE_ACK,pInDDEData,DDEPM_RETRY);
+ DdeFreeStringHandle( hszItem );
+ return (MRESULT)0;
+}
+
+BOOL ImpDdeMgr::WaitTransState( Transaction* pTrans, ULONG nTransId,
+ USHORT nNewState, ULONG nTimeout )
+{
+ ////WRITELOG("WaitTransState:Start")
+ ImpHCONV* pConv = pConvTable;
+ pConv += pTrans->hConvOwner;
+ HAB hAB = WinQueryAnchorBlock( pConv->hWndThis );
+ ULONG nTimerId = WinStartTimer( hAB, 0, 0, 50 );
+ QMSG aQueueMsg;
+
+// while( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 ) &&
+// WinIsWindow( hAB, pConv->hWndPartner) &&
+// pTrans->nConvst != nNewState )
+// {
+// WinDispatchMsg( hAB, &aQueueMsg );
+// }
+
+ BOOL bContinue = TRUE;
+ while( bContinue )
+ {
+ if( WinGetMsg( hAB, &aQueueMsg, 0, 0, 0 ))
+ {
+ WinDispatchMsg( hAB, &aQueueMsg );
+ if( (!WinIsWindow( hAB, pConv->hWndPartner)) ||
+ (pTrans->nConvst == nNewState) )
+ {
+ bContinue = FALSE;
+ }
+ }
+ else
+ bContinue = FALSE;
+ }
+
+ WinStopTimer( hAB, 0, nTimerId );
+ ////WRITELOG("WaitTransState:End")
+ return TRUE;
+}
+
+
+
+
diff --git a/svtools/source/svdde/ddeml2.cxx b/svtools/source/svdde/ddeml2.cxx
new file mode 100644
index 000000000000..551d7b2950e4
--- /dev/null
+++ b/svtools/source/svdde/ddeml2.cxx
@@ -0,0 +1,1157 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddeml2.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define INCL_DOS
+#include <stdlib.h>
+
+#include "ddemlimp.hxx"
+#define LOGFILE
+#define STATUSFILE
+#define DDEDATAFILE
+#include "ddemldeb.hxx"
+
+#ifdef VCL
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx> // fuer IsRemoteServer
+#endif
+#endif
+
+
+#if defined (OS2) && defined (__BORLANDC__)
+#pragma option -w-par
+#endif
+
+
+// ************************************************************************
+// Hilfsfunktionen Speicherverwaltung
+// ************************************************************************
+
+//
+// AllocAtomName
+//
+
+PSZ ImpDdeMgr::AllocAtomName( ATOM hString, ULONG& rBufLen )
+{
+ HATOMTBL hAtomTable = WinQuerySystemAtomTable();
+ ULONG nLen = WinQueryAtomLength( hAtomTable, hString );
+ nLen++;
+ PSZ pBuf = 0;
+ if ( !MyDosAllocMem( (PPVOID)&pBuf, nLen, PAG_READ|PAG_WRITE|PAG_COMMIT,"Atom" ) )
+ {
+ WinQueryAtomName( hAtomTable, hString, pBuf, nLen );
+ rBufLen = nLen;
+ }
+ return pBuf;
+}
+
+
+//
+// MakeDDEObject
+//
+
+PDDESTRUCT ImpDdeMgr::MakeDDEObject( HWND hwnd, ATOM hItemName,
+ USHORT fsStatus, USHORT usFormat, PVOID pabData, ULONG usDataLen )
+{
+ PDDESTRUCT pddes = 0;
+ ULONG usItemLen;
+ PULONG pulSharedObj;
+ //WRITELOG("MakeDDEObject: Start")
+
+ PSZ pItemName = 0;
+ if( hItemName != NULL )
+ pItemName = AllocAtomName( hItemName, usItemLen );
+ else
+ usItemLen = 1;
+
+ ULONG nTotalSize = sizeof(DDESTRUCT) + usItemLen + usDataLen;
+
+ if( !(MyDosAllocSharedMem((PPVOID)&pulSharedObj, NULL,
+ nTotalSize,
+ PAG_COMMIT | PAG_READ | PAG_WRITE | OBJ_GETTABLE | OBJ_GIVEABLE,
+ "MakeDDEObject")))
+ {
+ pddes = (PDDESTRUCT) pulSharedObj;
+ // siehe "Glenn Puchtel, DDE for OS/2" p.60
+ pddes->cbData = (ULONG)usDataLen;
+ pddes->fsStatus = fsStatus;
+ pddes->usFormat = usFormat;
+ pddes->offszItemName = sizeof( DDESTRUCT );
+ if( (usDataLen) && (pabData != NULL ) )
+ pddes->offabData = sizeof(DDESTRUCT) + usItemLen;
+ else
+ pddes->offabData = 0;
+
+ if( pItemName != NULL )
+ memcpy(DDES_PSZITEMNAME(pddes), pItemName, usItemLen );
+ else
+ *(DDES_PSZITEMNAME(pddes)) = '\0';
+
+ if( pabData != NULL )
+ memcpy( DDES_PABDATA(pddes), pabData, usDataLen );
+ }
+
+ if ( pItemName )
+ {
+ MyDosFreeMem( pItemName,"MakeDDEObject" );
+ }
+ return pddes;
+}
+
+//
+// AllocNamedSharedMem
+//
+
+APIRET ImpDdeMgr::AllocNamedSharedMem( PPVOID ppBaseAddress, PSZ pName,
+ ULONG nElementSize, ULONG nElementCount )
+{
+ ULONG nObjSize = (ULONG)(nElementSize * nElementCount );
+ nObjSize += sizeof( ULONG ); // fuer ElementCount am Anfang des Blocks
+
+ *ppBaseAddress = 0;
+ APIRET nRet = MyDosAllocSharedMem( ppBaseAddress, pName, nObjSize,
+ PAG_READ | PAG_WRITE | PAG_COMMIT,
+ "AllocNamedSharedMem" );
+ if ( !nRet )
+ {
+ memset( *ppBaseAddress, 0, nObjSize );
+ ULONG* pULONG = (ULONG*)*ppBaseAddress;
+ *pULONG = nObjSize;
+ }
+ return nRet;
+}
+
+void ImpDdeMgr::CreateServerWnd()
+{
+ hWndServer = WinCreateWindow( HWND_DESKTOP, WC_FRAME, "DDEServer", 0,
+ 0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0, 0, 0 );
+ WinSetWindowULong( hWndServer, 0, (ULONG)this );
+ WinSubclassWindow( hWndServer, ::ServerWndProc );
+ TID tidDummy;
+ WinQueryWindowProcess( hWndServer, &pidThis, &tidDummy );
+}
+
+void ImpDdeMgr::DestroyServerWnd()
+{
+ WinDestroyWindow( hWndServer );
+ hWndServer = NULLHANDLE;
+}
+
+HWND ImpDdeMgr::CreateConversationWnd()
+{
+ HWND hWnd = WinCreateWindow( HWND_OBJECT, WC_FRAME, "DDEConvWnd", 0,
+ 0,0,0,0, HWND_DESKTOP, HWND_BOTTOM, 0, 0, 0 );
+ if ( hWnd )
+ {
+ ImpConvWndData* pWndData = new ImpConvWndData;
+ pWndData->pThis = this;
+ pWndData->nRefCount = 0;
+ WinSetWindowULong( hWnd, 0, (ULONG)pWndData );
+ WinSubclassWindow( hWnd, ::ConvWndProc );
+#if 0 && defined( OV_DEBUG )
+ String aStr("ConvWnd created:");
+ aStr += (ULONG)hWnd;
+ WRITELOG((char*)aStr.GetStr())
+#endif
+ }
+ else
+ nLastErrInstance = DMLERR_SYS_ERROR;
+
+ return hWnd;
+}
+
+// static
+void ImpDdeMgr::DestroyConversationWnd( HWND hWnd )
+{
+ ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 );
+ if( pObj )
+ {
+ pObj->nRefCount--;
+ if( pObj->nRefCount == 0
+ // auch Windows mit Refcount vonm loeschen, da dieser in initial
+ // auf 0 gesetzt wird
+ || pObj->nRefCount == (USHORT)-1 )
+ {
+ delete pObj;
+ WinDestroyWindow( hWnd );
+#if 0 && defined( OV_DEBUG )
+ String aStr("ConvWnd destroyed:");
+ aStr += (ULONG)hWnd;
+ WRITELOG((char*)aStr.GetStr())
+#endif
+ }
+ else
+ {
+#if 0 && defined( OV_DEBUG )
+ String aStr("ConvWnd not destroyed (Refcount=");
+ aStr += pObj->nRefCount;
+ aStr += ") "; aStr += (ULONG)hWnd;
+ WRITELOG((char*)aStr.GetStr())
+#endif
+ }
+ }
+#if defined( OV_DEBUG )
+ else
+ {
+ WRITELOG("DestroyCnvWnd:Already destroyed/No win data/Partner died")
+ }
+#endif
+}
+
+// static
+USHORT ImpDdeMgr::GetConversationWndRefCount( HWND hWnd )
+{
+ ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 );
+ DBG_ASSERT(pObj,"Dde:ConvWnd has no data");
+ if( pObj )
+ return pObj->nRefCount;
+ return 0;
+}
+
+// static
+USHORT ImpDdeMgr::IncConversationWndRefCount( HWND hWnd )
+{
+#if 0 && defined( OV_DEBUG )
+ String aStr("IncConversationWndRefCount ");
+ aStr += (ULONG)hWnd;
+ WRITELOG((char*)aStr.GetStr())
+#endif
+ ImpConvWndData* pObj = (ImpConvWndData*)WinQueryWindowULong( hWnd, 0 );
+ DBG_ASSERT(pObj,"Dde:ConvWnd has no data");
+ if( pObj )
+ {
+ pObj->nRefCount++;
+ return pObj->nRefCount;
+ }
+ return 0;
+}
+
+ImpDdeMgrData* ImpDdeMgr::InitAll()
+{
+ ImpDdeMgrData* pBase = 0;
+ // nur dann neu anlegen, wenn die Tabelle nicht existiert
+ APIRET nRet=DosGetNamedSharedMem((PPVOID)&pBase,DDEMLDATA,PAG_READ| PAG_WRITE);
+ if ( nRet )
+ {
+ if ( nRet == 2 ) // ERROR_FILE_NOT_FOUND )
+ {
+ // DDECONVERSATIONCOUNT=4096
+ USHORT nConvTransCount = 128;
+ PSZ pResult;
+ nRet = DosScanEnv( "SOMAXDDECONN", (const char**)&pResult );
+ if( !nRet )
+ {
+ int nTemp = 0;
+ nTemp = atoi( pResult );
+ nTemp++; // der nullte Eintrag wird nicht benutzt
+ if( nTemp > 128 )
+ nConvTransCount = (USHORT)nTemp;
+ }
+ ULONG nSize = sizeof(ImpDdeMgrData);
+ nSize += sizeof(ImpHCONV) * nConvTransCount;
+ nSize += sizeof(Transaction) * nConvTransCount;
+ nSize += sizeof(HWND) * DDEMLAPPCOUNT;
+
+ nRet = ImpDdeMgr::AllocNamedSharedMem( (PPVOID)&pBase,
+ DDEMLDATA, nSize, 1 );
+ if ( !nRet )
+ {
+ pBase->nTotalSize = nSize;
+ ULONG nAppTable = (ULONG)&(pBase->aAppTable);
+ ULONG nCharBase = (ULONG)pBase;
+ pBase->nOffsAppTable = nAppTable - nCharBase;
+ pBase->nOffsConvTable = pBase->nOffsAppTable;
+ pBase->nOffsConvTable += sizeof(HWND) * DDEMLAPPCOUNT;
+ pBase->nOffsTransTable = pBase->nOffsConvTable;
+ pBase->nOffsTransTable += sizeof(ImpHCONV) * nConvTransCount;
+
+ pBase->nMaxAppCount = DDEMLAPPCOUNT;
+ pBase->nMaxConvCount = nConvTransCount;
+ pBase->nMaxTransCount = nConvTransCount;
+ }
+ }
+ }
+
+ if( pBase )
+ {
+ pConvTable = ImpDdeMgr::GetConvTable( pBase );
+ pTransTable = ImpDdeMgr::GetTransTable( pBase );
+ pAppTable = ImpDdeMgr::GetAppTable( pBase );
+ }
+
+ memset( &aDefaultContext, 0, sizeof(CONVCONTEXT) );
+ aDefaultContext.cb = sizeof(CONVCONTEXT);
+ aDefaultContext.idCountry = 49; // ??
+ aDefaultContext.usCodepage = 850; // ??
+
+ return pBase;
+}
+
+// static
+HCONV ImpDdeMgr::CreateConvHandle( ImpDdeMgrData* pData,
+ PID pidOwner,
+ HWND hWndMe, HWND hWndPartner,
+ HSZ hszPartner, HSZ hszServiceReq, HSZ hszTopic,
+ HCONV hPrevHCONV )
+{
+ DBG_ASSERT(pData,"DDE:Invalid data");
+ if( !pData )
+ return (HCONV)0;
+
+ ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pData );
+ USHORT nCount = pData->nMaxConvCount;
+ pPtr++;
+ nCount--; // ersten Handle (NULLHANDLE) ueberspringen
+ USHORT nIdx = 1;
+ DBG_ASSERT(pPtr,"No ConvTable");
+ if( !pPtr )
+ return (HCONV)0;
+
+ while( nCount && pPtr->hWndThis != (HWND)NULL )
+ {
+ nCount--;
+ pPtr++;
+ nIdx++;
+ }
+ if( !nCount )
+ return (HCONV)0;
+
+ DdeKeepStringHandle( hszPartner );
+ DdeKeepStringHandle( hszServiceReq );
+ DdeKeepStringHandle( hszTopic );
+ pPtr->hszPartner = hszPartner;
+ pPtr->hszServiceReq = hszServiceReq;
+ pPtr->hszTopic = hszTopic;
+
+ pPtr->hWndThis = hWndMe;
+ pPtr->hWndPartner = hWndPartner;
+ pPtr->pidOwner = pidOwner;
+ pPtr->hConvPartner = (HCONV)0;
+ pPtr->nPrevHCONV = (USHORT)hPrevHCONV;
+ pPtr->nNextHCONV = 0;
+ pPtr->nStatus = ST_CONNECTED;
+
+ pData->nCurConvCount++;
+
+ return (HCONV)nIdx;
+}
+
+// static
+void ImpDdeMgr::FreeConvHandle( ImpDdeMgrData* pBase, HCONV hConv,
+ BOOL bDestroyHWndThis )
+{
+ DBG_ASSERT(pBase,"DDE:No data");
+#if 0 && defined( OV_DEBUG )
+ String aStr("FreeConvHandle: Start ");
+ aStr += (ULONG)hConv;
+ aStr += " Destroy: "; aStr += (USHORT)bDestroyHWndThis;
+ WRITELOG((char*)aStr.GetStr());
+ WRITESTATUS("FreeConvHandle: Start");
+#endif
+ if( !pBase )
+ {
+ WRITELOG("FreeConvHandle: FAIL");
+ return;
+ }
+ DBG_ASSERT(hConv&&hConv<pBase->nMaxConvCount,"DDE:Invalid Conv-Handle");
+ if( hConv && hConv < pBase->nMaxConvCount )
+ {
+ ImpHCONV* pTable = ImpDdeMgr::GetConvTable( pBase );
+ ImpHCONV* pPtr = pTable + (USHORT)hConv;
+ if( pPtr->nStatus & ST_INLIST )
+ {
+ // Verkettung umsetzen
+ USHORT nPrev = pPtr->nPrevHCONV;
+ USHORT nNext = pPtr->nNextHCONV;
+ if( nPrev )
+ {
+ pPtr = pTable + nPrev;
+ pPtr->nNextHCONV = nNext;
+ }
+ if( nNext )
+ {
+ pPtr = pTable + nNext;
+ pPtr->nPrevHCONV = nPrev;
+ }
+ pPtr = pTable + (USHORT)hConv;
+ }
+
+ DdeFreeStringHandle( pPtr->hszPartner );
+ DdeFreeStringHandle( pPtr->hszServiceReq );
+ DdeFreeStringHandle( pPtr->hszTopic );
+ if( bDestroyHWndThis )
+ DestroyConversationWnd( pPtr->hWndThis );
+ memset( pPtr, 0, sizeof(ImpHCONV) );
+ DBG_ASSERT(pBase->nCurConvCount,"Dde:Invalid Trans. count");
+ pBase->nCurConvCount--;
+ }
+#if defined(OV_DEBUG)
+ else
+ {
+ WRITELOG("FreeConvHandle: FAIL");
+ }
+#endif
+ //WRITELOG("FreeConvHandle: END");
+ //WRITESTATUS("FreeConvHandle: End");
+}
+
+// static
+HCONV ImpDdeMgr::IsConvHandleAvailable( ImpDdeMgrData* pBase )
+{
+ DBG_ASSERT(pBase,"DDE:No data");
+ if( !pBase )
+ return 0;
+
+ ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pBase );
+ USHORT nCurPos = pBase->nMaxConvCount - 1;
+ pPtr += nCurPos; // von hinten aufrollen
+ while( nCurPos >= 1 )
+ {
+ if( pPtr->hWndThis == 0 )
+ return TRUE;
+ pPtr--;
+ nCurPos--;
+ }
+ return FALSE;
+}
+
+// static
+HCONV ImpDdeMgr::GetConvHandle( ImpDdeMgrData* pBase, HWND hWndThis,
+ HWND hWndPartner )
+{
+ DBG_ASSERT(pBase,"DDE:No data");
+ if( !pBase )
+ return 0;
+ ImpHCONV* pPtr = ImpDdeMgr::GetConvTable( pBase );
+ USHORT nCurPos = 1;
+ pPtr++; // ersten Handle ueberspringen
+ USHORT nCurConvCount = pBase->nCurConvCount;
+ while( nCurConvCount && nCurPos < pBase->nMaxConvCount )
+ {
+ if( pPtr->hWndThis )
+ {
+ if(pPtr->hWndThis == hWndThis && pPtr->hWndPartner == hWndPartner)
+ return (HCONV)nCurPos;
+ nCurConvCount--;
+ if( !nCurConvCount )
+ return (HCONV)0;
+ }
+ nCurPos++;
+ pPtr++;
+ }
+ return (HCONV)0;
+}
+
+
+
+// static
+ULONG ImpDdeMgr::CreateTransaction( ImpDdeMgrData* pBase, HCONV hOwner,
+ HSZ hszItem, USHORT nFormat, USHORT nTransactionType )
+{
+ DBG_ASSERT(pBase,"DDE:No Data");
+ DBG_ASSERT(hOwner!=0,"DDE:No Owner");
+
+ if( pBase && hOwner )
+ {
+ Transaction* pPtr = ImpDdeMgr::GetTransTable( pBase );
+ DBG_ASSERT(pPtr->hConvOwner==0,"DDE:Data corrupted");
+ USHORT nId = 1;
+ pPtr++;
+ while( nId < pBase->nMaxTransCount )
+ {
+ if( pPtr->hConvOwner == (HCONV)0 )
+ {
+ pPtr->hConvOwner = hOwner;
+ DdeKeepStringHandle( hszItem );
+ pPtr->hszItem = hszItem;
+ pPtr->nType = nTransactionType;
+ pPtr->nConvst = XST_CONNECTED;
+ pPtr->nFormat = nFormat;
+ pBase->nCurTransCount++;
+ return (ULONG)nId;
+ }
+ nId++;
+ pPtr++;
+ }
+ }
+ return 0;
+}
+
+// static
+void ImpDdeMgr::FreeTransaction( ImpDdeMgrData* pBase, ULONG nTransId )
+{
+ DBG_ASSERT(pBase,"DDE:No Data");
+ if( !pBase )
+ return;
+
+ DBG_ASSERT(nTransId<pBase->nMaxTransCount,"DDE:Invalid TransactionId");
+ if( nTransId >= pBase->nMaxTransCount )
+ return;
+
+ Transaction* pPtr = ImpDdeMgr::GetTransTable( pBase );
+ pPtr += nTransId;
+ DBG_ASSERT(pPtr->hConvOwner!=0,"DDE:TransId has no owner");
+ if( pPtr->hConvOwner )
+ {
+ //WRITELOG("Freeing transaction");
+ DdeFreeStringHandle( pPtr->hszItem );
+ memset( pPtr, 0, sizeof(Transaction) );
+ DBG_ASSERT(pBase->nCurTransCount,"Dde:Invalid Trans. count");
+ pBase->nCurTransCount--;
+ }
+}
+
+// static
+ULONG ImpDdeMgr::GetTransaction( ImpDdeMgrData* pBase,
+ HCONV hOwner, HSZ hszItem, USHORT nFormat )
+{
+ DBG_ASSERT(pBase,"DDE:No Data");
+ if( !pBase || !hOwner )
+ return 0;
+
+ Transaction* pTrans = ImpDdeMgr::GetTransTable( pBase );
+ DBG_ASSERT(pTrans,"DDE:No TransactionTable");
+ if( !pTrans )
+ return 0;
+ pTrans++; // NULLHANDLE ueberspringen
+
+ ImpHCONV* pConv = ImpDdeMgr::GetConvTable( pBase );
+ pConv += (USHORT)hOwner;
+ HCONV hConvPartner = pConv->hConvPartner;
+
+ USHORT nCurTransCount = pBase->nCurTransCount;
+ for( USHORT nTrans=1; nTrans< pBase->nMaxTransCount; nTrans++, pTrans++ )
+ {
+ if( pTrans->hConvOwner )
+ {
+ if(( pTrans->hConvOwner == hOwner ||
+ pTrans->hConvOwner == hConvPartner) &&
+ pTrans->nFormat == nFormat &&
+ pTrans->hszItem == hszItem )
+ {
+ // gefunden!
+ return (ULONG)nTrans;
+ }
+ nCurTransCount--;
+ if( !nCurTransCount )
+ return 0;
+ }
+ }
+ return 0; // narda
+}
+
+// static
+HSZ ImpDdeMgr::DdeCreateStringHandle( PSZ pszString, int iCodePage)
+{
+ if( !pszString || *pszString == '\0' )
+ return (HSZ)0;
+ // Atom-Table beachtet Gross/Kleinschreibung, DDEML aber nicht
+
+ // OV 12.4.96: Services,Topics,Items case-sensitiv!!!
+ // (Grosskundenanforderung (Reuter-DDE))
+ //strlwr( pszString );
+ //*pszString = (char)toupper(*pszString);
+
+ HATOMTBL hAtomTable = WinQuerySystemAtomTable();
+ ATOM aAtom = WinAddAtom( hAtomTable, pszString );
+ return (HSZ)aAtom;
+}
+
+// static
+ULONG ImpDdeMgr::DdeQueryString( HSZ hszStr, PSZ pszStr, ULONG cchMax, int iCodePage)
+{
+ HATOMTBL hAtomTable = WinQuerySystemAtomTable();
+ if ( !pszStr )
+ return WinQueryAtomLength( hAtomTable, (ATOM)hszStr);
+ else
+ {
+ *pszStr = 0;
+ return WinQueryAtomName( hAtomTable, (ATOM)hszStr, pszStr, cchMax );
+ }
+}
+
+// static
+BOOL ImpDdeMgr::DdeFreeStringHandle( HSZ hsz )
+{
+ if( !hsz )
+ return FALSE;
+ ATOM aResult = WinDeleteAtom( WinQuerySystemAtomTable(),(ATOM)hsz );
+ return (BOOL)(aResult==0);
+}
+
+// static
+BOOL ImpDdeMgr::DdeKeepStringHandle( HSZ hsz )
+{
+ if( !hsz )
+ return TRUE;
+ HATOMTBL hAtomTable = WinQuerySystemAtomTable();
+#ifdef DBG_UTIL
+ ULONG nUsageCount=WinQueryAtomUsage(hAtomTable,(ATOM)hsz);
+#endif
+ ULONG nAtom = 0xFFFF0000;
+ ULONG nPar = (ULONG)hsz;
+ nAtom |= nPar;
+ ATOM aAtom = WinAddAtom( hAtomTable, (PSZ)nAtom );
+#ifdef DBG_UTIL
+ if ( aAtom )
+ DBG_ASSERT(WinQueryAtomUsage(hAtomTable,(ATOM)hsz)==nUsageCount+1,"Keep failed");
+#endif
+ return (BOOL)(aAtom!=0);
+}
+
+
+// static
+int ImpDdeMgr::DdeCmpStringHandles(HSZ hsz1, HSZ hsz2)
+{
+ if ( hsz1 == hsz2 )
+ return 0;
+ if ( hsz1 < hsz2 )
+ return -1;
+ return 1;
+}
+
+HDDEDATA ImpDdeMgr::DdeCreateDataHandle( void* pSrc, ULONG cb,
+ ULONG cbOff, HSZ hszItem, USHORT wFmt, USHORT afCmd)
+{
+ char* pData = (char*)pSrc;
+ pData += cbOff;
+ USHORT nStatus;
+ if( afCmd & HDATA_APPOWNED )
+ nStatus = IMP_HDATAAPPOWNED;
+ else
+ nStatus = 0;
+ PDDESTRUCT hData=MakeDDEObject(0,(ATOM)hszItem,nStatus,wFmt,pData,cb);
+// WRITEDATA(hData)
+ if ( !hData )
+ ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ return (HDDEDATA)hData;
+}
+
+// static
+BYTE* ImpDdeMgr::DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize)
+{
+ BYTE* pRet = 0;
+ *pcbDataSize = 0;
+ if ( hData )
+ {
+ pRet = (BYTE*)hData;
+ pRet += hData->offabData;
+ ULONG nLen = hData->cbData;
+ // nLen -= hData->offabData;
+ *pcbDataSize = nLen;
+ }
+ else
+ ImpDdeMgr::nLastErrInstance = DMLERR_INVALIDPARAMETER;
+ return pRet;
+}
+
+// static
+BOOL ImpDdeMgr::DdeUnaccessData(HDDEDATA hData)
+{
+ return TRUE; // nothing to do for us
+}
+
+// static
+BOOL ImpDdeMgr::DdeFreeDataHandle(HDDEDATA hData)
+{
+ DdeUnaccessData( hData );
+ MyDosFreeMem( (PSZ)hData, "DdeFreeDataHandle" );
+ return TRUE;
+}
+
+// static
+HDDEDATA ImpDdeMgr::DdeAddData(HDDEDATA hData,void* pSrc,ULONG cb,ULONG cbOff)
+{
+ return (HDDEDATA)0;
+}
+
+// static
+ULONG ImpDdeMgr::DdeGetData(HDDEDATA hData,void* pDst,ULONG cbMax,ULONG cbOff)
+{
+ return 0;
+}
+
+BOOL ImpDdeMgr::DisconnectAll()
+{
+ //WRITESTATUS("Before DisconnectAll()")
+ USHORT nCurConvCount = pData->nCurConvCount;
+ if( !nCurConvCount )
+ return TRUE;
+
+ BOOL bRet = TRUE;
+ ImpHCONV* pPtr = pConvTable;
+ pPtr++;
+
+ for( USHORT nPos=1; nPos < pData->nMaxConvCount; nPos++, pPtr++ )
+ {
+ if( pPtr->hWndThis )
+ {
+ if( !DdeDisconnect( (HCONV)nPos ) )
+ bRet = FALSE;
+ nCurConvCount--;
+ if( !nCurConvCount )
+ break;
+ }
+ }
+ //WRITESTATUS("After DisconnectAll()")
+ return bRet;
+}
+
+// static
+void ImpDdeMgr::FreeTransactions( ImpDdeMgrData* pData,HWND hWndThis,
+ HWND hWndPartner )
+{
+ USHORT nCurTransCount = pData->nCurTransCount;
+ if( !nCurTransCount )
+ return;
+
+ Transaction* pTrans = GetTransTable( pData );
+ ImpHCONV* pConvTable = GetConvTable( pData );
+ pTrans++;
+ for( USHORT nPos=1; nPos < pData->nMaxTransCount; nPos++, pTrans++ )
+ {
+ if( pTrans->hConvOwner )
+ {
+ ImpHCONV* pConv = pConvTable + (USHORT)(pTrans->hConvOwner);
+ if((pConv->hWndThis==hWndThis&& pConv->hWndPartner==hWndPartner)||
+ (pConv->hWndThis==hWndPartner && pConv->hWndPartner==hWndThis))
+ {
+ FreeTransaction( pData, (ULONG)nPos );
+ }
+ nCurTransCount--;
+ if( !nCurTransCount )
+ return;
+ }
+ }
+}
+
+// static
+void ImpDdeMgr::FreeTransactions( ImpDdeMgrData* pData, HCONV hConvOwner )
+{
+ USHORT nCurTransCount = pData->nCurTransCount;
+ if( !nCurTransCount )
+ return;
+
+ Transaction* pTrans = GetTransTable( pData );
+// ImpHCONV* pConvTable = GetConvTable( pData );
+ pTrans++;
+ for( USHORT nPos=1; nPos < pData->nMaxTransCount; nPos++, pTrans++ )
+ {
+ if( pTrans->hConvOwner == hConvOwner )
+ {
+ FreeTransaction( pData, (ULONG)nPos );
+ nCurTransCount--;
+ if( !nCurTransCount )
+ return;
+ }
+ }
+}
+
+// static
+void ImpDdeMgr::FreeConversations( ImpDdeMgrData* pData, HWND hWndThis,
+ HWND hWndPartner )
+{
+ USHORT nCurCount = pData->nCurConvCount;
+ if( !nCurCount )
+ return;
+
+ ImpHCONV* pPtr = GetConvTable( pData );
+ pPtr++;
+ for( USHORT nPos=1; nPos < pData->nMaxConvCount; nPos++, pPtr++ )
+ {
+ if( pPtr->hWndThis )
+ {
+ if( hWndThis && pPtr->hWndPartner==hWndPartner )
+ FreeConvHandle( pData, (HCONV)nPos );
+ nCurCount--;
+ if( !nCurCount )
+ return;
+ }
+ }
+}
+
+
+BOOL ImpDdeMgr::OwnsConversationHandles()
+{
+ //WRITESTATUS("OwnsConversationHandles()");
+#if 0 && defined( OV_DEBUG )
+ String aStr("OwnsConversationHandles Server:");
+ aStr += (ULONG)hWndServer;
+ WRITELOG((char*)aStr.GetStr())
+#endif
+ ImpHCONV* pPtr = GetConvTable( pData );
+ for( USHORT nCur = 1; nCur < pData->nMaxConvCount; nCur++, pPtr++ )
+ {
+ if( pPtr->hWndThis && pPtr->pidOwner == pidThis )
+ {
+ //WRITELOG("OwnsConversationHandles: TRUE");
+ return TRUE;
+ }
+ }
+ // WRITELOG("OwnsConversationHandles: FALSE");
+ return FALSE;
+}
+
+
+
+// *********************************************************************
+// *********************************************************************
+// *********************************************************************
+
+USHORT DdeInitialize(ULONG* pidInst, PFNCALLBACK pfnCallback,
+ ULONG afCmd, ULONG ulRes)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return DMLERR_UNFOUND_QUEUE_ID;
+#endif
+ if( (*pidInst)!=0 )
+ {
+ // Reinitialize wird noch nicht unterstuetzt
+ DBG_ASSERT(0,"DDEML:Reinitialize not supported");
+ return DMLERR_INVALIDPARAMETER;
+ }
+
+ ImpDdeMgr* pMgr = new ImpDdeMgr;
+ *pidInst = (ULONG)pMgr;
+ return pMgr->DdeInitialize( pfnCallback, afCmd );
+}
+
+BOOL DdeUninitialize(ULONG idInst)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return TRUE;
+#endif
+ if( !idInst )
+ return FALSE;
+ ImpDdeMgr* pMgr = (ImpDdeMgr*)idInst;
+ // nur loeschen, wenn wir nicht mehr benutzt werden!
+ if( !pMgr->OwnsConversationHandles() )
+ {
+ WRITELOG("DdeUninitialize: TRUE");
+ delete pMgr;
+ return TRUE;
+ }
+ WRITELOG("DdeUninitialize: FALSE");
+ return FALSE;
+}
+
+
+HCONVLIST DdeConnectList(ULONG idInst, HSZ hszService, HSZ hszTopic,
+ HCONVLIST hConvList, CONVCONTEXT* pCC)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ if( !idInst )
+ return 0;
+ return ((ImpDdeMgr*)idInst)->DdeConnectList(hszService,hszTopic,
+ hConvList, pCC );
+}
+
+HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ return ImpDdeMgr::DdeQueryNextServer( hConvList, hConvPrev );
+}
+
+BOOL DdeDisconnectList(HCONVLIST hConvList)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ return ImpDdeMgr::DdeDisconnectList( hConvList );
+}
+
+HCONV DdeConnect(ULONG idInst, HSZ hszService, HSZ hszTopic,
+ CONVCONTEXT* pCC)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ if( !idInst )
+ return 0;
+ return ((ImpDdeMgr*)idInst)->DdeConnect( hszService, hszTopic, pCC );
+}
+
+BOOL DdeDisconnect(HCONV hConv)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ return ImpDdeMgr::DdeDisconnect( hConv );
+}
+
+HCONV DdeReconnect(HCONV hConv)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ return ImpDdeMgr::DdeReconnect( hConv );
+}
+
+
+USHORT DdeQueryConvInfo(HCONV hConv, ULONG idTransact, CONVINFO* pCI )
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return DMLERR_DLL_NOT_INITIALIZED;
+#endif
+ return ImpDdeMgr::DdeQueryConvInfo( hConv, idTransact, pCI );
+}
+
+BOOL DdeSetUserHandle(HCONV hConv, ULONG id, ULONG hUser)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return DMLERR_DLL_NOT_INITIALIZED;
+#endif
+ return ImpDdeMgr::DdeSetUserHandle( hConv, id, hUser );
+}
+
+BOOL DdeAbandonTransaction(ULONG idInst, HCONV hConv, ULONG idTransaction)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ if( !idInst )
+ return FALSE;
+ return ((ImpDdeMgr*)idInst)->DdeAbandonTransaction(hConv,idTransaction);
+}
+
+BOOL DdePostAdvise(ULONG idInst, HSZ hszTopic, HSZ hszItem)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ if( !idInst )
+ return FALSE;
+ return ((ImpDdeMgr*)idInst)->DdePostAdvise( hszTopic, hszItem );
+}
+
+BOOL DdeEnableCallback(ULONG idInst, HCONV hConv, USHORT wCmd)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ if( !idInst )
+ return FALSE;
+ return ((ImpDdeMgr*)idInst)->DdeEnableCallback( hConv, wCmd );
+}
+
+HDDEDATA DdeClientTransaction(void* pData, ULONG cbData,
+ HCONV hConv, HSZ hszItem, USHORT wFmt, USHORT wType,
+ ULONG dwTimeout, ULONG* pdwResult)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ return ImpDdeMgr::DdeClientTransaction( pData, cbData,
+ hConv, hszItem, wFmt, wType, dwTimeout, pdwResult );
+}
+
+HDDEDATA DdeCreateDataHandle(ULONG idInst, void* pSrc, ULONG cb,
+ ULONG cbOff, HSZ hszItem, USHORT wFmt, USHORT afCmd)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ if( !idInst )
+ return 0;
+ return ((ImpDdeMgr*)idInst)->DdeCreateDataHandle( pSrc, cb,
+ cbOff, hszItem, wFmt, afCmd );
+}
+
+HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, ULONG cb, ULONG cbOff)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ return ImpDdeMgr::DdeAddData( hData, pSrc, cb, cbOff );
+}
+
+ULONG DdeGetData(HDDEDATA hData, void* pDst, ULONG cbMax, ULONG cbOff)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ return ImpDdeMgr::DdeGetData( hData, pDst, cbMax, cbOff );
+}
+
+BYTE* DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ return ImpDdeMgr::DdeAccessData( hData, pcbDataSize );
+}
+
+BOOL DdeUnaccessData(HDDEDATA hData)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ return ImpDdeMgr::DdeUnaccessData( hData );
+}
+
+BOOL DdeFreeDataHandle(HDDEDATA hData)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ return ImpDdeMgr::DdeFreeDataHandle( hData );
+}
+
+USHORT DdeGetLastError(ULONG idInst)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return DMLERR_DLL_NOT_INITIALIZED;
+#endif
+ if( !idInst )
+ return DMLERR_DLL_NOT_INITIALIZED;
+ return ((ImpDdeMgr*)idInst)->DdeGetLastError();
+}
+
+HSZ DdeCreateStringHandle(ULONG idInst, PSZ pszString,int iCodePage )
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ if( !idInst )
+ return 0;
+ return ((ImpDdeMgr*)idInst)->DdeCreateStringHandle(pszString,iCodePage);
+}
+
+ULONG DdeQueryString( ULONG idInst, HSZ hsz, PSZ pBuf,
+ ULONG cchMax, int iCodePage )
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ if( !idInst )
+ return 0;
+ return ((ImpDdeMgr*)idInst)->DdeQueryString( hsz,pBuf,cchMax,iCodePage);
+}
+
+BOOL DdeFreeStringHandle( ULONG idInst, HSZ hsz)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ if( !idInst )
+ return FALSE;
+ return ((ImpDdeMgr*)idInst)->DdeFreeStringHandle( hsz );
+}
+
+BOOL DdeKeepStringHandle( ULONG idInst, HSZ hsz )
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return FALSE;
+#endif
+ if( !idInst )
+ return FALSE;
+ return ((ImpDdeMgr*)idInst)->DdeKeepStringHandle( hsz );
+}
+
+int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2)
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return -1;
+#endif
+ return ImpDdeMgr::DdeCmpStringHandles( hsz1, hsz2 );
+}
+
+HDDEDATA DdeNameService( ULONG idInst, HSZ hsz1, HSZ hszRes, USHORT afCmd )
+{
+#ifdef VCL
+ if( Application::IsRemoteServer() )
+ return 0;
+#endif
+ if( !idInst )
+ return 0;
+ return ((ImpDdeMgr*)idInst)->DdeNameService( hsz1, afCmd );
+}
+
+
diff --git a/svtools/source/svdde/ddemldeb.cxx b/svtools/source/svdde/ddemldeb.cxx
new file mode 100644
index 000000000000..6bdd12dfc50e
--- /dev/null
+++ b/svtools/source/svdde/ddemldeb.cxx
@@ -0,0 +1,311 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddemldeb.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "ddemlimp.hxx"
+
+#ifdef OV_DEBUG
+#include <svgen.hxx>
+#endif
+
+#if defined(OV_DEBUG)
+
+void ImpAddHSZ( HSZ hszString, String& rStr )
+{
+ char aBuf[ 128 ];
+ ImpDdeMgr::DdeQueryString( hszString,aBuf,sizeof(aBuf),850);
+ rStr += " (\""; rStr += aBuf; rStr += "\",";
+ HATOMTBL hAtomTable = WinQuerySystemAtomTable();
+ ULONG nRefCount = 0;
+ if( hszString )
+ nRefCount = WinQueryAtomUsage(hAtomTable, (ATOM)hszString );
+ rStr += nRefCount; rStr += ')';
+}
+
+
+void ImpWriteDdeStatus(char* aFilename, char* pAppContext)
+{
+ char aBuf[ 128 ];
+ USHORT nCtr;
+ HWND* pAppPtr;
+ ImpHCONV* pConvPtr;
+ Transaction* pTransPtr;
+
+ ImpDdeMgrData* pData = ImpDdeMgr::AccessMgrData();
+ if( !pData )
+ return;
+ SvFileStream aStrm(aFilename, STREAM_READWRITE );
+ String aLine;
+ aStrm.Seek( STREAM_SEEK_TO_END );
+ aStrm << endl;
+ aStrm.WriteLine("********************** DDEML-Log ***********************");
+ aStrm << endl;
+ if( pAppContext )
+ {
+ aLine = Application::GetAppName();
+ aLine += ':';
+ aLine += "App-Context:"; aLine += pAppContext;
+ aStrm.WriteLine( aLine ); aStrm << endl;
+ }
+ aStrm.WriteLine("----------------- ImpDdeMgrData -------------------");
+ aStrm << endl;
+ aLine= "TotalSize :"; aLine+= pData->nTotalSize; aStrm.WriteLine(aLine);
+ aLine= "nOffsAppTable :"; aLine+= pData->nOffsAppTable; aStrm.WriteLine(aLine);
+ aLine= "nOffsConvTable :"; aLine+= pData->nOffsConvTable; aStrm.WriteLine(aLine);
+ aLine= "nOffsTransTable:"; aLine+= pData->nOffsTransTable; aStrm.WriteLine(aLine);
+ aLine= "nMaxAppCount :"; aLine+= pData->nMaxAppCount; aStrm.WriteLine(aLine);
+ aLine= "nMaxConvCount :"; aLine+= pData->nMaxConvCount; aStrm.WriteLine(aLine);
+ aLine= "nMaxTransCount :"; aLine+= pData->nMaxTransCount; aStrm.WriteLine(aLine);
+ aLine= "nLastErr :"; aLine+= pData->nLastErr; aStrm.WriteLine(aLine);
+ aLine= "nCurConvCount :"; aLine+= pData->nCurConvCount; aStrm.WriteLine(aLine);
+ aLine= "nCurTransCount :"; aLine+= pData->nCurTransCount; aStrm.WriteLine(aLine);
+ aStrm << endl;
+ aStrm.WriteLine("---------- Registered DDEML-Applications -----------");
+ aStrm << endl;
+ pAppPtr = ImpDdeMgr::GetAppTable( pData );
+ for( nCtr = 0; nCtr < pData->nMaxAppCount; nCtr++, pAppPtr++ )
+ {
+ if( *pAppPtr )
+ {
+ aLine = "App."; aLine += nCtr; aLine += " HWND:";
+ aLine += (ULONG)*pAppPtr; aStrm.WriteLine(aLine);
+ }
+ }
+
+ aStrm << endl;
+ aStrm.WriteLine("-------------- Conversation handles ----------------");
+ aStrm << endl;
+
+ USHORT nCurCount = pData->nCurConvCount;
+
+ if( nCurCount )
+ {
+ pConvPtr = ImpDdeMgr::GetConvTable( pData );
+ for( nCtr = 0; nCtr < pData->nMaxConvCount; nCtr++, pConvPtr++ )
+ {
+ if( pConvPtr->hWndThis )
+ {
+ aLine = "HCONV:"; aLine += nCtr;
+ aLine += " HCONVpartner: "; aLine += (USHORT)pConvPtr->hConvPartner;
+ if( !pConvPtr->hConvPartner ) aLine += "(Non-DDEML-App)";
+ aLine += " hszPartner: "; aLine += (USHORT)pConvPtr->hszPartner;
+ ImpAddHSZ( pConvPtr->hszPartner, aLine );
+ aStrm.WriteLine( aLine );
+
+ aLine = "hszService: "; aLine += (USHORT)pConvPtr->hszServiceReq;
+ ImpAddHSZ( pConvPtr->hszServiceReq, aLine );
+ aLine += " hszTopic: "; aLine += (USHORT)pConvPtr->hszTopic;
+ ImpAddHSZ( pConvPtr->hszTopic, aLine );
+ aStrm.WriteLine( aLine );
+
+ aLine= "Status: "; aLine+= pConvPtr->nStatus;
+ if( pConvPtr->nStatus & ST_CLIENT ) aLine += " (Client)";
+ if( pConvPtr->nStatus & ST_INLIST ) aLine += " (Inlist)";
+ aStrm.WriteLine(aLine);
+
+ aLine = "pidOwner: "; aLine += (ULONG)pConvPtr->pidOwner;
+ aStrm.WriteLine( aLine );
+ aLine = "hWndThis: "; aLine += (ULONG)pConvPtr->hWndThis;
+ aStrm.WriteLine( aLine );
+ aLine = "hWndPartner: "; aLine += (ULONG)pConvPtr->hWndPartner;
+ aStrm.WriteLine( aLine );
+
+ aLine = "hConvList: "; aLine += (ULONG)pConvPtr->hConvList;
+ aLine += " Prev: "; aLine += pConvPtr->nPrevHCONV;
+ aLine += " Next: "; aLine += pConvPtr->nNextHCONV;
+ aStrm.WriteLine( aLine );
+ aStrm.WriteLine("----------------------------------------------------");
+
+ nCurCount--;
+ if( !nCurCount )
+ break;
+ }
+ }
+ }
+
+ aStrm.WriteLine("----------------- Transaction Ids ------------------");
+
+ nCurCount = pData->nCurTransCount;
+ if( nCurCount )
+ {
+ pTransPtr = ImpDdeMgr::GetTransTable( pData );
+ for( nCtr = 0; nCtr < pData->nMaxTransCount; nCtr++, pTransPtr++ )
+ {
+
+ if( pTransPtr->hConvOwner )
+ {
+ aLine = "TransactionId:"; aLine += nCtr;
+ aLine += " hConvOwner: "; aLine += (USHORT)pTransPtr->hConvOwner;
+ aStrm.WriteLine( aLine );
+ aLine = "Item: "; aLine += (USHORT)pTransPtr->hszItem;
+ ImpAddHSZ( pTransPtr->hszItem, aLine );
+ aLine += " Format: "; aLine += pTransPtr->nFormat;
+ aStrm.WriteLine( aLine );
+ aLine = "TransactionType: "; aLine += pTransPtr->nType;
+ aLine += " Convst: "; aLine += pTransPtr->nConvst;
+ aLine += " LastErr: "; aLine += pTransPtr->nLastError;
+ aLine += " Userhandle: "; aLine += pTransPtr->nUser;
+ aStrm.WriteLine( aLine );
+ aStrm.WriteLine("--------------------------------------------------");
+
+ nCurCount--;
+ if( !nCurCount )
+ break;
+ }
+ }
+ }
+ aStrm << endl;
+ aStrm.WriteLine("******************* End of DDEML-Log *******************");
+}
+
+void ImpWriteDdeData(char* aFilename, DDESTRUCT* pData)
+{
+ char aBuf[ 128 ];
+ USHORT nCtr;
+ SvFileStream aStrm(aFilename, STREAM_READWRITE );
+ aStrm.Seek( STREAM_SEEK_TO_END );
+ String aLine;
+ aStrm << endl;
+ aLine = "cbData:"; aLine += pData->cbData; aStrm.WriteLine( aLine );
+ aLine = "fsStatus:"; aLine += pData->fsStatus; aStrm.WriteLine( aLine );
+ aLine = "usFormat:"; aLine += pData->usFormat; aStrm.WriteLine( aLine );
+ aLine = "ItemName:"; aLine += (char*)((char*)pData+pData->offszItemName);
+ aStrm.WriteLine( aLine );
+ aLine = "offabData:"; aLine += pData->offabData; aStrm.WriteLine(aLine);
+ char* pBuf = (char*)pData+pData->offabData;
+ USHORT nLen = pData->cbData; // - pData->offabData;
+ while( nLen )
+ {
+ aStrm << *pBuf;
+ nLen--;
+ pBuf++;
+ }
+ aStrm << endl;
+}
+
+void ImpWriteLogFile(char* pFilename, char* pStr)
+{
+ SvFileStream aStrm(pFilename, STREAM_READWRITE );
+ aStrm.Seek( STREAM_SEEK_TO_END );
+ String aStr( Application::GetAppName() );
+ aStr += ':'; aStr += pStr;
+ aStrm.WriteLine( (char*)aStr.GetStr() );
+}
+
+#else
+
+void ImpWriteDdeStatus(char*, char* ) {}
+void ImpWriteDdeData(char*, DDESTRUCT*) {}
+void ImpWriteLogFile(char*, char*) {}
+
+#endif
+
+APIRET MyDosAllocSharedMem(void** ppBaseAddress, char* pszName, unsigned long ulObjectSize,
+ unsigned long ulFlags, char* pContextStr )
+{
+ APIRET nRet = DosAllocSharedMem(ppBaseAddress,pszName,ulObjectSize,ulFlags );
+#if 0 && defined(OV_DEBUG) && defined(LOGFILE)
+ String aStr("DosAllocSharedMem:");
+ aStr += pContextStr;
+ aStr += ": ";
+ aStr += ulObjectSize;
+ aStr += " (";
+ aStr += (ULONG)*((char**)ppBaseAddress);
+ aStr += ')';
+ ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr() );
+#endif
+ return nRet;
+}
+
+APIRET MyDosAllocMem(void** ppBaseAddress, unsigned long ulObjectSize,
+ unsigned long ulFlags, char* pContextStr )
+{
+ APIRET nRet = DosAllocMem(ppBaseAddress, ulObjectSize,ulFlags );
+#if 0 && defined(OV_DEBUG) && defined(LOGFILE)
+ String aStr("DosAllocMem:");
+ aStr += pContextStr;
+ aStr += ": ";
+ aStr += ulObjectSize;
+ aStr += " (";
+ aStr += (ULONG)*((char**)ppBaseAddress);
+ aStr += ')';
+ ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr() );
+#endif
+ return nRet;
+}
+
+
+APIRET MyDosFreeMem( void* pBaseAddress, char* pContextStr )
+{
+ APIRET nRet = DosFreeMem( pBaseAddress );
+#if 0 && defined(OV_DEBUG) && defined(LOGFILE)
+ String aStr("DosFreeMem:");
+ aStr += pContextStr;
+ aStr += ": ";
+ aStr += (ULONG)pBaseAddress;
+ ImpWriteLogFile("\\ddeml.mem", (char*)aStr.GetStr());
+#endif
+ return nRet;
+}
+
+
+
+
+
diff --git a/svtools/source/svdde/ddemldeb.hxx b/svtools/source/svdde/ddemldeb.hxx
new file mode 100644
index 000000000000..8fde6e335bbd
--- /dev/null
+++ b/svtools/source/svdde/ddemldeb.hxx
@@ -0,0 +1,100 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddemldeb.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#if defined(OV_DEBUG)
+
+void ImpWriteLogFile(char*,char*);
+void ImpAddHSZ( HSZ, String& );
+void ImpWriteDdeStatus(char*, char* );
+void ImpWriteDdeData(char*, DDESTRUCT*);
+
+#ifdef LOGFILE
+#define WRITELOG(aString) ImpWriteLogFile("\\ddeml.log",aString);
+#else
+#define WRITELOG(bla)
+#endif
+#ifdef STATUSFILE
+#define WRITESTATUS(aContext) ImpWriteDdeStatus("\\ddeml.sts",aContext);
+#else
+#define WRITESTATUS(bla)
+#endif
+#ifdef DDEDATAFILE
+#define WRITEDATA(data) ImpWriteDdeData("\\ddeml.dat",data);
+#else
+#define WRITEDATA(bla)
+#endif
+
+#else
+
+#define WRITELOG(bla)
+#define WRITESTATUS(bla)
+#define WRITEDATA(bla)
+
+#endif
+
+APIRET MyDosAllocSharedMem(void** ppBaseAddress, char* pszName, unsigned long ulObjectSize,
+ unsigned long ulFlags, char* pContextStr );
+
+APIRET MyDosAllocMem(void** ppBaseAddress, unsigned long ulObjectSize,
+ unsigned long ulFlags, char* pContextStr );
+
+APIRET MyDosFreeMem( void* pBaseAddress, char* pContextStr );
+
diff --git a/svtools/source/svdde/ddemlimp.hxx b/svtools/source/svdde/ddemlimp.hxx
new file mode 100644
index 000000000000..e26020cd6370
--- /dev/null
+++ b/svtools/source/svdde/ddemlimp.hxx
@@ -0,0 +1,467 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddemlimp.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _DDEMLIMP_HXX
+#define _DDEMLIMP_HXX
+
+
+#include <string.h>
+#include <ctype.h>
+#include "ddemlos2.h"
+
+#define DDEMLSERVICETABLE_INISIZE 8
+
+// Bezeichner der systemglobalen DDEML-Tabelle
+#define DDEMLDATA "\\SHAREMEM\\OV_DDEML.DAT"
+
+// vorlaeufig konstante Tabellengroessen
+#define CONVTABLECOUNT 2048 /* max count conversations */
+#define TRANSTABLECOUNT 2048 /* transactions */
+#define DDEMLAPPCOUNT 16 /* max count simultaniously running */
+ /* ddeml (StarDivision) applications */
+
+#define ST_TERMACKREC 0x8000 /* wird im Conversationhandle gesetzt, */
+ /* wenn die Partner-App DDE_TERMINATE */
+ /* bestaetigt hat */
+
+#define XST_TIMEOUT 17 /* Trans. hat Timeout ueberschritten */
+#define XST_WAITING_ACK 18 /* Trans. wartet auf Acknowledge */
+#define XST_WAITING_ADVDATA 19 /* Trans. wartet auf Advise-Daten */
+#define XST_WAITING_REQDATA 20 /* Trans. wartet auf angeforderte Daten */
+
+
+/* User-Flags DDESTRUCT */
+#define IMP_HDATAAPPOWNED 0x8000
+
+#define CONVLISTNAME "DdeConvListId"
+
+#define XTYPF_MASK (XTYPF_NOBLOCK | XTYPF_NODATA | XTYPF_ACKREQ)
+
+//
+// DDEML-Messages; werden nur an registrierte DDEML-Apps gesendet
+//
+
+// Msg: WM_DDEML_REGISTER
+// Empfaenger: wird allen DDEML-Applikationen nach Registrierung
+// eines neuen Services gesendet
+// Params: nPar1: hszBaseServName
+// nPar2: hszInstServName
+#define WM_DDEML_REGISTER WM_USER+1
+
+// Msg: WM_DDEML_UNREGISTER
+// Empfaenger: wird allen DDEML-Applikationen nach Deregistrierung
+// eines Services gesendet
+// Params: nPar1: hszBaseServName
+// nPar2: hszInstServName
+#define WM_DDEML_UNREGISTER WM_USER+2
+
+//
+//
+//
+
+struct ImpHCONV
+{
+ HCONV hConvPartner;
+ HSZ hszPartner; // Name of partner application
+ HSZ hszServiceReq; // Service name
+ HSZ hszTopic; // Topic name
+ USHORT nStatus; // ST_* of conversation
+ HCONVLIST hConvList; // ConvListId , wenn in ConvList
+ CONVCONTEXT aConvContext; // Conversation context
+
+ // private
+ HWND hWndThis; // 0 == Handle not used
+ HWND hWndPartner;
+ PID pidOwner; // PID des DdeManagers, der
+ // den Conv-Handle erzeugt hat.
+ USHORT nPrevHCONV; // 0 == no previous hConv or not in list
+ USHORT nNextHCONV; // 0 == no next hconv or not in list
+};
+
+struct Transaction
+{
+ HSZ hszItem; // Item name
+ USHORT nFormat; // Data format
+ USHORT nType; // Transaction type (XTYP_*)
+ // XTYP_ADVREQ [|XTYPF_NODATA] == Advise-Loop
+ // [|XTYPF_ACKREQ]
+ // XTYP_EXECUTE == laufendes Execute
+ // XTYP_REQUEST
+ // XTYP_POKE
+ // XTYP_ADVSTOP
+ // XTYP_ADVSTART
+ USHORT nConvst; // Conversation state (XST_*)
+ // 0 == idle
+ // XST_REQSENT (fuer XTYP_ADVREQ)
+ // XST_TIMEOUT (fuer alle Typen!)
+ // XST_WAITING (alle ausser XTYP_ADVREQ)
+ USHORT nLastError; // last err in transaction
+ ULONG nUser; // Userhandle
+ // private
+ HCONV hConvOwner; // 0 == Transaction not used
+};
+
+
+struct ImpWndProcParams
+{
+ HWND hWndReceiver;
+ MPARAM nPar1;
+ MPARAM nPar2;
+};
+
+struct ImpService
+{
+ HSZ hBaseServName; // Basis-Name des Service
+ HSZ hInstServName; // Basis-Name + DDEML-Server-HWND der App
+};
+
+class ImpDdeMgr;
+
+// Daten eines Conversation-Windows
+struct ImpConvWndData
+{
+ ImpDdeMgr* pThis;
+ USHORT nRefCount; // Zahl Conversations auf diesem Window
+};
+
+
+// systemglobale Daten der Library (liegen in named shared memory)
+struct ImpDdeMgrData
+{
+ ULONG nTotalSize;
+ ULONG nOffsAppTable;
+ ULONG nOffsConvTable;
+ ULONG nOffsTransTable;
+ USHORT nMaxAppCount;
+ USHORT nMaxConvCount;
+ USHORT nMaxTransCount;
+ USHORT nLastErr;
+ USHORT nReserved;
+ USHORT nCurTransCount;
+ USHORT nCurConvCount;
+ HWND aAppTable[ 1 ]; // fuer Broadcast-Messages
+ ImpHCONV aConvTable[ 1 ];
+ Transaction aTransTable[ 1 ];
+};
+
+
+
+class ImpDdeMgr
+{
+ friend MRESULT EXPENTRY ConvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2);
+ friend MRESULT EXPENTRY ServerWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2);
+ friend void ImpWriteDdeStatus(char*,char*);
+ friend void ImpAddHSZ( HSZ, String& );
+
+ static PSZ AllocAtomName( ATOM hString, ULONG& rBufLen );
+ static PDDESTRUCT MakeDDEObject( HWND hwnd, ATOM hItemName,
+ USHORT fsStatus, USHORT usFormat, PVOID pabData, ULONG usDataLen );
+ static APIRET AllocNamedSharedMem( PPVOID ppBaseAddress, PSZ pName,
+ ULONG nElementSize, ULONG nElementCount );
+
+ HWND hWndServer;
+ PID pidThis;
+ PFNCALLBACK pCallback;
+ ULONG nTransactFilter;
+ CONVCONTEXT aDefaultContext;
+ ImpDdeMgrData* pData;
+ ImpService* pServices;
+ USHORT nServiceCount;
+
+ ImpHCONV* pConvTable; // liegt in pData (nicht deleten!)
+ Transaction* pTransTable; // liegt in pData (nicht deleten!)
+ HWND* pAppTable; // liegt in pData (nicht deleten!)
+
+ static ImpHCONV* GetConvTable( ImpDdeMgrData* );
+ static Transaction* GetTransTable( ImpDdeMgrData* );
+ static HWND* GetAppTable( ImpDdeMgrData* );
+
+
+ static HWND NextFrameWin( HENUM hEnum );
+ void CreateServerWnd();
+ void DestroyServerWnd();
+ HWND CreateConversationWnd();
+ // Fktn. duerfen nur fuer HCONVs aufgerufen werden, die
+ // in der eigenen Applikation erzeugt wurden
+ static void DestroyConversationWnd( HWND hWndConv );
+ static USHORT GetConversationWndRefCount( HWND hWndConv );
+ static USHORT IncConversationWndRefCount( HWND hWndConv );
+
+ MRESULT SrvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2);
+ MRESULT ConvWndProc(HWND hWnd,ULONG nMsg,MPARAM nPar1,MPARAM nPar2);
+ void RegisterDDEMLApp();
+ void UnregisterDDEMLApp();
+ void CleanUp();
+ ImpDdeMgrData* InitAll();
+ static BOOL MyWinDdePostMsg( HWND, HWND, USHORT, PDDESTRUCT, ULONG );
+ void MyInitiateDde( HWND hWndServer, HWND hWndClient,
+ HSZ hszService, HSZ hszTopic, CONVCONTEXT* pCC );
+ DDEINIT* CreateDDEInitData( HWND hWndDest, HSZ hszService,
+ HSZ hszTopic, CONVCONTEXT* pCC );
+ // wenn pDDEData==0, muss pCC gesetzt sein
+ HCONV ConnectWithClient( HWND hWndClient, HSZ hszPartner,
+ HSZ hszService, HSZ hszTopic, BOOL bSameInst,
+ DDEINIT* pDDEData, CONVCONTEXT* pCC = 0);
+
+ HCONV CheckIncoming( ImpWndProcParams*, ULONG nTransMask,
+ HSZ& rhszItem );
+ // fuer Serverbetrieb. Ruft Callback-Fkt fuer alle offenen Advises
+ // auf, deren Owner der uebergebene HCONV ist.
+ // bFreeTransactions==TRUE: loescht die Transaktionen
+ // gibt Anzahl der getrennten Transaktionen zurueck
+ USHORT SendUnadvises( HCONV hConv,
+ USHORT nFormat, // 0==alle
+ BOOL bFreeTransactions );
+
+ BOOL WaitTransState(
+ Transaction* pTrans, ULONG nTransId,
+ USHORT nNewState,
+ ULONG nTimeout );
+
+ // DDEML ruft Callback mit XTYP_CONNECT-Transaction nur auf,
+ // wenn die App den angeforderten Service registriert hat
+ // Standardeinstellung: TRUE
+ BOOL bServFilterOn;
+
+ // Fehlercode muss noch systemglobal werden (Atom o. ae.)
+ static USHORT nLastErrInstance; // wenn 0, dann gilt globaler Fehlercode
+
+ static ImpDdeMgrData* AccessMgrData();
+
+ static HCONV CreateConvHandle( ImpDdeMgrData* pBase,
+ PID pidOwner,
+ HWND hWndThis, HWND hWndPartner,
+ HSZ hszPartner, HSZ hszServiceReq, HSZ hszTopic,
+ HCONV hPrevHCONV = 0 );
+
+ static HCONV IsConvHandleAvailable( ImpDdeMgrData* pBase );
+ static HCONV GetConvHandle( ImpDdeMgrData* pBase,
+ HWND hWndThis, HWND hWndPartner );
+ static void FreeConvHandle( ImpDdeMgrData*, HCONV,
+ BOOL bDestroyHWndThis = TRUE );
+
+ static ULONG CreateTransaction( ImpDdeMgrData* pBase,
+ HCONV hOwner, HSZ hszItem, USHORT nFormat,
+ USHORT nTransactionType );
+ static ULONG GetTransaction( ImpDdeMgrData* pBase,
+ HCONV hOwner, HSZ hszItem, USHORT nFormat );
+
+ static void FreeTransaction( ImpDdeMgrData*, ULONG nTransId );
+
+ BOOL DisconnectAll();
+ // Transaktionen muessen _vor_ den Konversationen geloescht werden!
+ static void FreeTransactions( ImpDdeMgrData*, HWND hWndThis,
+ HWND hWndPartner );
+ static void FreeTransactions( ImpDdeMgrData*, HCONV hConvOwner );
+
+ static void FreeConversations( ImpDdeMgrData*,HWND hWndThis,
+ HWND hWndPartner );
+
+ ImpService* GetService( HSZ hszService );
+ ImpService* PutService( HSZ hszService );
+ void BroadcastService( ImpService*, BOOL bRegistered );
+
+ // rh: Startposition(!) & gefundener Handle
+ static ImpHCONV* GetFirstServer( ImpDdeMgrData*, HCONVLIST, HCONV& rh);
+ static ImpHCONV* GetLastServer( ImpDdeMgrData*, HCONVLIST, HCONV& );
+ static BOOL CheckConvListId( HCONVLIST hConvListId );
+
+ BOOL IsSameInstance( HWND hWnd );
+ HSZ GetAppName( HWND hWnd );
+
+
+ // Transactions
+ MRESULT DdeAck( ImpWndProcParams* pParams );
+ MRESULT DdeAdvise( ImpWndProcParams* pParams );
+ MRESULT DdeData( ImpWndProcParams* pParams );
+ MRESULT DdeExecute( ImpWndProcParams* pParams );
+ MRESULT DdeInitiate( ImpWndProcParams* pParams );
+ MRESULT DdeInitiateAck( ImpWndProcParams* pParams );
+ MRESULT DdePoke( ImpWndProcParams* pParams );
+ MRESULT DdeRequest( ImpWndProcParams* pParams );
+ MRESULT DdeTerminate( ImpWndProcParams* pParams );
+ MRESULT DdeUnadvise( ImpWndProcParams* pParams );
+ MRESULT DdeRegister( ImpWndProcParams* pParams );
+ MRESULT DdeUnregister( ImpWndProcParams* pParams );
+ MRESULT DdeTimeout( ImpWndProcParams* pParams );
+
+ HDDEDATA Callback(
+ USHORT nTransactionType,
+ USHORT nClipboardFormat,
+ HCONV hConversationHandle,
+ HSZ hsz1,
+ HSZ hsz2,
+ HDDEDATA hData,
+ ULONG nData1,
+ ULONG nData2 );
+
+ HCONV DdeConnectImp( HSZ hszService,HSZ hszTopic,CONVCONTEXT* pCC);
+
+ // connection data
+ HCONV hCurConv; // wird im DdeInitiateAck gesetzt
+ HCONVLIST hCurListId; // fuer DdeConnectList
+ USHORT nPrevConv; // .... "" ....
+ BOOL bListConnect;
+
+ // synchr. transaction data
+ BOOL bInSyncTrans;
+ ULONG nSyncTransId;
+ HDDEDATA hSyncResponseData;
+ ULONG nSyncResponseMsg; // WM_DDE_ACK, WM_DDE_DATA, WM_TIMER
+ // TRUE==nach Ende der synchronen Transaktion eine evtl. benutzte
+ // asynchrone Transaktion beenden (typisch synchroner Request auf
+ // Advise-Loop)
+ BOOL bSyncAbandonTrans;
+
+public:
+ ImpDdeMgr();
+ ~ImpDdeMgr();
+
+ USHORT DdeInitialize( PFNCALLBACK pCallbackProc, ULONG nTransactionFilter );
+ USHORT DdeGetLastError();
+
+ HCONV DdeConnect( HSZ hszService, HSZ hszTopic, CONVCONTEXT* );
+ HCONVLIST DdeConnectList( HSZ hszService, HSZ hszTopic,
+ HCONVLIST hConvList, CONVCONTEXT* );
+ static BOOL DdeDisconnect( HCONV hConv );
+ static BOOL DdeDisconnectList( HCONVLIST hConvList );
+ static HCONV DdeReconnect(HCONV hConv);
+ static HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev);
+ static USHORT DdeQueryConvInfo(HCONV hConv, ULONG idTrans,CONVINFO* pCI);
+ static BOOL DdeSetUserHandle(HCONV hConv, ULONG id, ULONG hUser);
+ BOOL DdeAbandonTransaction( HCONV hConv, ULONG idTransaction);
+
+ BOOL DdePostAdvise( HSZ hszTopic, HSZ hszItem);
+ BOOL DdeEnableCallback( HCONV hConv, USHORT wCmd);
+
+ HDDEDATA DdeNameService( HSZ hszService, USHORT afCmd);
+
+ static HDDEDATA DdeClientTransaction(void* pData, ULONG cbData,
+ HCONV hConv, HSZ hszItem, USHORT wFmt, USHORT wType,
+ ULONG dwTimeout, ULONG* pdwResult);
+
+ // Data handles
+
+ HDDEDATA DdeCreateDataHandle( void* pSrc, ULONG cb, ULONG cbOff,
+ HSZ hszItem, USHORT wFmt, USHORT afCmd);
+ static BYTE* DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize);
+ static BOOL DdeUnaccessData(HDDEDATA hData);
+ static BOOL DdeFreeDataHandle(HDDEDATA hData);
+ static HDDEDATA DdeAddData(HDDEDATA hData,void* pSrc,ULONG cb,ULONG cbOff);
+ static ULONG DdeGetData(HDDEDATA hData,void* pDst,ULONG cbMax,ULONG cbOff);
+
+ // String handles
+
+ static HSZ DdeCreateStringHandle( PSZ pStr, int iCodePage);
+ static ULONG DdeQueryString(HSZ hsz,PSZ pStr,ULONG cchMax,int iCPage);
+ static BOOL DdeFreeStringHandle( HSZ hsz );
+ static BOOL DdeKeepStringHandle( HSZ hsz );
+ static int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2);
+
+ // mit dieser Funktion kann geprueft werden, ob eine
+ // Applikation schon eine DDEML-Instanz angelegt hat.
+ // Die aktuelle Impl. unterstuetzt nur eine DDEML-Instanz
+ // pro Applikation (wg. synchroner Transaktionen)
+ static ImpDdeMgr* GetImpDdeMgrInstance( HWND hWnd );
+
+ // gibt TRUE zurueck, wenn mind. ein lebender HCONV
+ // von diesem DdeMgr erzeugt wurde
+ BOOL OwnsConversationHandles();
+};
+
+// static
+inline ImpHCONV* ImpDdeMgr::GetConvTable( ImpDdeMgrData* pData )
+{
+ ImpHCONV* pRet;
+ if( pData )
+ pRet = (ImpHCONV*)((ULONG)(pData) + pData->nOffsConvTable);
+ else
+ pRet = 0;
+ return pRet;
+}
+
+// static
+inline Transaction* ImpDdeMgr::GetTransTable( ImpDdeMgrData* pData )
+{
+ Transaction* pRet;
+ if( pData )
+ pRet = (Transaction*)((ULONG)(pData) + pData->nOffsTransTable);
+ else
+ pRet = 0;
+ return pRet;
+}
+
+// static
+inline HWND* ImpDdeMgr::GetAppTable( ImpDdeMgrData* pData )
+{
+ HWND* pRet;
+ if( pData )
+ pRet = (HWND*)((ULONG)(pData) + pData->nOffsAppTable);
+ else
+ pRet = 0;
+ return pRet;
+}
+
+
+
+
+#endif
+
diff --git a/svtools/source/svdde/ddemlos2.h b/svtools/source/svdde/ddemlos2.h
new file mode 100644
index 000000000000..c6dd1cffcbbb
--- /dev/null
+++ b/svtools/source/svdde/ddemlos2.h
@@ -0,0 +1,411 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddemlos2.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _DDEML_H
+#define _DDEML_H
+
+#define INCL_OS2
+#define INCL_WIN
+
+#include <tools/svpm.h>
+#include <tools/solar.h>
+#include <tools/debug.hxx>
+#include <tools/stream.hxx>
+#ifndef _SYSDEP_HXX
+#include <vcl/sysdep.hxx>
+#endif
+
+typedef LHANDLE HSTR;
+
+#ifndef CALLBACK
+#define CALLBACK
+#endif
+
+
+typedef ULONG HCONVLIST;
+typedef ULONG HCONV;
+typedef ATOM HSZ;
+typedef DDESTRUCT* HDDEDATA;
+
+struct CONVINFO
+{
+ USHORT nSize; // sizeof(CONVINFO)
+ ULONG nUser; // Userhandle
+ HCONV hConvPartner; //
+ HSZ hszPartner; // Name der Partnerapp
+ HSZ hszServiceReq; // Name des angeforderten Services
+ HSZ hszTopic; // -- " -- Topics
+ HSZ hszItem; // -- " -- Items
+ USHORT nFormat; // Datenformat der akt. Transaktion
+ USHORT nType; // Typ der akt. Transaktion (XTYP_*)
+ USHORT nStatus; // ST_* der Konversation
+ USHORT nConvst; // XST_* der akt. Transaktion
+ USHORT nLastError; // letzter Fehler der Transaktion
+ HCONVLIST hConvList; // ConvListId , wenn in ConvList
+ CONVCONTEXT aConvCtxt; // conversation context
+};
+
+/* the following structure is for use with XTYP_WILDCONNECT processing. */
+
+struct HSZPAIR
+{
+ HSZ hszSvc;
+ HSZ hszTopic;
+};
+typedef HSZPAIR *PHSZPAIR;
+
+/***** conversation states (usState) *****/
+
+#define XST_NULL 0 /* quiescent states */
+#define XST_INCOMPLETE 1
+#define XST_CONNECTED 2
+#define XST_INIT1 3 /* mid-initiation states */
+#define XST_INIT2 4
+#define XST_REQSENT 5 /* active conversation states */
+#define XST_DATARCVD 6
+#define XST_POKESENT 7
+#define XST_POKEACKRCVD 8
+#define XST_EXECSENT 9
+#define XST_EXECACKRCVD 10
+#define XST_ADVSENT 11
+#define XST_UNADVSENT 12
+#define XST_ADVACKRCVD 13
+#define XST_UNADVACKRCVD 14
+#define XST_ADVDATASENT 15
+#define XST_ADVDATAACKRCVD 16
+
+/* used in LOWORD(dwData1) of XTYP_ADVREQ callbacks... */
+#define CADV_LATEACK 0xFFFF
+
+/***** conversation status bits (fsStatus) *****/
+
+#define ST_CONNECTED 0x0001
+#define ST_ADVISE 0x0002
+#define ST_ISLOCAL 0x0004
+#define ST_BLOCKED 0x0008
+#define ST_CLIENT 0x0010
+#define ST_TERMINATED 0x0020
+#define ST_INLIST 0x0040
+#define ST_BLOCKNEXT 0x0080
+#define ST_ISSELF 0x0100
+
+
+/* DDE constants for wStatus field */
+
+//#define DDE_FACK 0x8000
+//#define DDE_FBUSY 0x4000
+//#define DDE_FDEFERUPD 0x4000
+//#define DDE_FACKREQ 0x8000
+//#define DDE_FRELEASE 0x2000
+//#define DDE_FREQUESTED 0x1000
+//#define DDE_FACKRESERVED 0x3ff0
+//#define DDE_FADVRESERVED 0x3fff
+//#define DDE_FDATRESERVED 0x4fff
+//#define DDE_FPOKRESERVED 0xdfff
+//#define DDE_FAPPSTATUS 0x00ff
+#define DDE_FNOTPROCESSED 0x0000
+
+/***** message filter hook types *****/
+
+#define MSGF_DDEMGR 0x8001
+
+/***** codepage constants ****/
+
+#define CP_WINANSI 1004 /* default codepage for windows & old DDE convs. */
+
+/***** transaction types *****/
+
+#define XTYPF_NOBLOCK 0x0002 /* CBR_BLOCK will not work */
+#define XTYPF_NODATA 0x0004 /* DDE_FDEFERUPD */
+#define XTYPF_ACKREQ 0x0008 /* DDE_FACKREQ */
+
+#define XCLASS_MASK 0xFC00
+#define XCLASS_BOOL 0x1000
+#define XCLASS_DATA 0x2000
+#define XCLASS_FLAGS 0x4000
+#define XCLASS_NOTIFICATION 0x8000
+
+#define XTYP_ERROR (0x0000 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK )
+#define XTYP_ADVDATA (0x0010 | XCLASS_FLAGS )
+#define XTYP_ADVREQ (0x0020 | XCLASS_DATA | XTYPF_NOBLOCK )
+#define XTYP_ADVSTART (0x0030 | XCLASS_BOOL )
+#define XTYP_ADVSTOP (0x0040 | XCLASS_NOTIFICATION)
+#define XTYP_EXECUTE (0x0050 | XCLASS_FLAGS )
+#define XTYP_CONNECT (0x0060 | XCLASS_BOOL | XTYPF_NOBLOCK)
+#define XTYP_CONNECT_CONFIRM (0x0070 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+#define XTYP_XACT_COMPLETE (0x0080 | XCLASS_NOTIFICATION )
+#define XTYP_POKE (0x0090 | XCLASS_FLAGS )
+#define XTYP_REGISTER (0x00A0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+#define XTYP_REQUEST (0x00B0 | XCLASS_DATA )
+#define XTYP_DISCONNECT (0x00C0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+#define XTYP_UNREGISTER (0x00D0 | XCLASS_NOTIFICATION | XTYPF_NOBLOCK)
+#define XTYP_WILDCONNECT (0x00E0 | XCLASS_DATA | XTYPF_NOBLOCK)
+
+#define XTYP_MASK 0x00F0
+#define XTYP_SHIFT 4 /* shift to turn XTYP_ into an index */
+
+/***** Timeout constants *****/
+
+#define TIMEOUT_ASYNC -1L
+
+/***** Transaction ID constants *****/
+
+#define QID_SYNC -1L
+
+/****** public strings used in DDE ******/
+
+#define SZDDESYS_TOPIC "System"
+#define SZDDESYS_ITEM_TOPICS "Topics"
+#define SZDDESYS_ITEM_SYSITEMS "SysItems"
+#define SZDDESYS_ITEM_RTNMSG "ReturnMessage"
+#define SZDDESYS_ITEM_STATUS "Status"
+#define SZDDESYS_ITEM_FORMATS "Formats"
+#define SZDDESYS_ITEM_HELP "Help"
+#define SZDDE_ITEM_ITEMLIST "TopicItemList"
+
+
+/****** API entry points ******/
+
+typedef HDDEDATA CALLBACK FNCALLBACK(USHORT wType, USHORT wFmt, HCONV hConv,
+ HSZ hsz1, HSZ hsz2, HDDEDATA hData, ULONG dwData1, ULONG dwData2);
+typedef FNCALLBACK* PFNCALLBACK;
+
+#define CBR_BLOCK 0xffffffffL
+
+/* DLL registration functions */
+
+USHORT DdeInitialize(ULONG* pidInst, PFNCALLBACK pfnCallback,
+ ULONG afCmd, ULONG ulRes);
+
+/*
+ * Callback filter flags for use with standard apps.
+ */
+
+#define CBF_FAIL_SELFCONNECTIONS 0x00001000
+#define CBF_FAIL_CONNECTIONS 0x00002000
+#define CBF_FAIL_ADVISES 0x00004000
+#define CBF_FAIL_EXECUTES 0x00008000
+#define CBF_FAIL_POKES 0x00010000
+#define CBF_FAIL_REQUESTS 0x00020000
+#define CBF_FAIL_ALLSVRXACTIONS 0x0003f000
+
+#define CBF_SKIP_CONNECT_CONFIRMS 0x00040000
+#define CBF_SKIP_REGISTRATIONS 0x00080000
+#define CBF_SKIP_UNREGISTRATIONS 0x00100000
+#define CBF_SKIP_DISCONNECTS 0x00200000
+#define CBF_SKIP_ALLNOTIFICATIONS 0x003c0000
+
+/*
+ * Application command flags
+ */
+#define APPCMD_CLIENTONLY 0x00000010L
+#define APPCMD_FILTERINITS 0x00000020L
+#define APPCMD_MASK 0x00000FF0L
+
+/*
+ * Application classification flags
+ */
+#define APPCLASS_STANDARD 0x00000000L
+#define APPCLASS_MASK 0x0000000FL
+
+
+BOOL DdeUninitialize(ULONG idInst);
+
+/* conversation enumeration functions */
+
+HCONVLIST DdeConnectList(ULONG idInst, HSZ hszService, HSZ hszTopic,
+ HCONVLIST hConvList, CONVCONTEXT* pCC);
+HCONV DdeQueryNextServer(HCONVLIST hConvList, HCONV hConvPrev);
+BOOL DdeDisconnectList(HCONVLIST hConvList);
+
+/* conversation control functions */
+
+HCONV DdeConnect(ULONG idInst, HSZ hszService, HSZ hszTopic,
+ CONVCONTEXT* pCC);
+BOOL DdeDisconnect(HCONV hConv);
+HCONV DdeReconnect(HCONV hConv);
+
+USHORT DdeQueryConvInfo(HCONV hConv, ULONG idTransaction, CONVINFO* pConvInfo);
+BOOL DdeSetUserHandle(HCONV hConv, ULONG id, ULONG hUser);
+
+BOOL DdeAbandonTransaction(ULONG idInst, HCONV hConv, ULONG idTransaction);
+
+
+/* app server interface functions */
+
+BOOL DdePostAdvise(ULONG idInst, HSZ hszTopic, HSZ hszItem);
+BOOL DdeEnableCallback(ULONG idInst, HCONV hConv, USHORT wCmd);
+
+#define EC_ENABLEALL 0
+#define EC_ENABLEONE ST_BLOCKNEXT
+#define EC_DISABLE ST_BLOCKED
+#define EC_QUERYWAITING 2
+
+HDDEDATA DdeNameService(ULONG idInst, HSZ hsz1, HSZ hsz2, USHORT afCmd);
+
+#define DNS_REGISTER 0x0001
+#define DNS_UNREGISTER 0x0002
+#define DNS_FILTERON 0x0004
+#define DNS_FILTEROFF 0x0008
+
+/* app client interface functions */
+
+HDDEDATA DdeClientTransaction(void* pData, ULONG cbData,
+ HCONV hConv, HSZ hszItem, USHORT wFmt, USHORT wType,
+ ULONG dwTimeout, ULONG* pdwResult);
+
+/* data transfer functions */
+
+HDDEDATA DdeCreateDataHandle(ULONG idInst, void* pSrc, ULONG cb,
+ ULONG cbOff, HSZ hszItem, USHORT wFmt, USHORT afCmd);
+// HDDEDATA DdeAddData(HDDEDATA hData, void* pSrc, ULONG cb, ULONG cbOff);
+ULONG DdeGetData(HDDEDATA hData, void* pDst, ULONG cbMax, ULONG cbOff);
+BYTE* DdeAccessData(HDDEDATA hData, ULONG* pcbDataSize);
+BOOL DdeUnaccessData(HDDEDATA hData);
+BOOL DdeFreeDataHandle(HDDEDATA hData);
+
+#define HDATA_APPOWNED 0x0001
+
+USHORT DdeGetLastError(ULONG idInst);
+
+#define DMLERR_NO_ERROR 0 /* must be 0 */
+
+#define DMLERR_FIRST 0x4000
+
+#define DMLERR_ADVACKTIMEOUT 0x4000
+#define DMLERR_BUSY 0x4001
+#define DMLERR_DATAACKTIMEOUT 0x4002
+#define DMLERR_DLL_NOT_INITIALIZED 0x4003
+#define DMLERR_DLL_USAGE 0x4004
+#define DMLERR_EXECACKTIMEOUT 0x4005
+#define DMLERR_INVALIDPARAMETER 0x4006
+#define DMLERR_LOW_MEMORY 0x4007
+#define DMLERR_MEMORY_ERROR 0x4008
+#define DMLERR_NOTPROCESSED 0x4009
+#define DMLERR_NO_CONV_ESTABLISHED 0x400a
+#define DMLERR_POKEACKTIMEOUT 0x400b
+#define DMLERR_POSTMSG_FAILED 0x400c
+#define DMLERR_REENTRANCY 0x400d
+#define DMLERR_SERVER_DIED 0x400e
+#define DMLERR_SYS_ERROR 0x400f
+#define DMLERR_UNADVACKTIMEOUT 0x4010
+#define DMLERR_UNFOUND_QUEUE_ID 0x4011
+
+#define DMLERR_LAST 0x4011
+
+HSZ DdeCreateStringHandle(ULONG idInst, PSZ pStr, int iCodePage);
+ULONG DdeQueryString(ULONG idInst, HSZ hsz, PSZ pStr, ULONG cchMax,
+ int iCodePage);
+BOOL DdeFreeStringHandle(ULONG idInst, HSZ hsz);
+BOOL DdeKeepStringHandle(ULONG idInst, HSZ hsz);
+int DdeCmpStringHandles(HSZ hsz1, HSZ hsz2);
+
+
+
+/* von OS/2 nicht unterstuetzte Win3.1 Clipboard-Formate */
+
+#define CF_NOTSUPPORTED_BASE 0xff00
+
+#ifndef CF_DIB
+#define CF_DIB CF_NOTSUPPORTED_BASE+1
+#endif
+
+#ifndef CF_DIF
+#define CF_DIF CF_NOTSUPPORTED_BASE+2
+#endif
+
+#ifndef CF_DSPMETAFILEPICT
+#define CF_DSPMETAFILEPICT CF_NOTSUPPORTED_BASE+3
+#endif
+
+#ifndef CF_METAFILEPICT
+#define CF_METAFILEPICT CF_NOTSUPPORTED_BASE+4
+#endif
+
+#ifndef CF_OEMTEXT
+#define CF_OEMTEXT CF_NOTSUPPORTED_BASE+5
+#endif
+
+#ifndef CF_OWNERDISPLAY
+#define CF_OWNERDISPLAY CF_NOTSUPPORTED_BASE+6
+#endif
+
+#ifndef CF_PENDATA
+#define CF_PENDATA CF_NOTSUPPORTED_BASE+7
+#endif
+
+#ifndef CF_RIFF
+#define CF_RIFF CF_NOTSUPPORTED_BASE+8
+#endif
+
+#ifndef CF_SYLK
+#define CF_SYLK CF_NOTSUPPORTED_BASE+9
+#endif
+
+#ifndef CF_TIFF
+#define CF_TIFF CF_NOTSUPPORTED_BASE+10
+#endif
+
+#ifndef CF_WAVE
+#define CF_WAVE CF_NOTSUPPORTED_BASE+11
+#endif
+
+
+#endif /* _DDEML_HXX */
diff --git a/svtools/source/svdde/ddestrg.cxx b/svtools/source/svdde/ddestrg.cxx
new file mode 100644
index 000000000000..ae1865e7e1a9
--- /dev/null
+++ b/svtools/source/svdde/ddestrg.cxx
@@ -0,0 +1,109 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddestrg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define UNICODE
+
+#include "ddeimp.hxx"
+#include <svdde.hxx>
+
+#if defined( WIN ) && defined( MSC )
+#pragma code_seg( "SVDDE_MISC_CODE" )
+#endif
+
+// --- DdeString::DdeString() --------------------------------------
+
+DdeString::DdeString( DWORD hDdeInst, const sal_Unicode* p ) :
+ String( p )
+{
+ hString = DdeCreateStringHandle( hDdeInst, (LPTSTR)p, CP_WINUNICODE );
+ hInst = hDdeInst;
+}
+
+// --- DdeString::DdeString() --------------------------------------
+
+DdeString::DdeString( DWORD hDdeInst, const String& r) :
+ String( r )
+{
+ hString = DdeCreateStringHandle( hDdeInst, (LPTSTR)r.GetBuffer(), CP_WINUNICODE );
+ hInst = hDdeInst;
+}
+
+// --- DdeString::~DdeString() -------------------------------------
+
+DdeString::~DdeString()
+{
+ if ( hString )
+ DdeFreeStringHandle( hInst, hString );
+}
+
+// --- DdeString::operator==() -------------------------------------
+
+int DdeString::operator==( HSZ h )
+{
+ return( !DdeCmpStringHandles( hString, h ) );
+}
+
+// --- DdeString::operator HSZ() -----------------------------------
+
+DdeString::operator HSZ()
+{
+ return hString;
+}
diff --git a/svtools/source/svdde/ddesvr.cxx b/svtools/source/svdde/ddesvr.cxx
new file mode 100644
index 000000000000..d949a7bfb738
--- /dev/null
+++ b/svtools/source/svdde/ddesvr.cxx
@@ -0,0 +1,1136 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddesvr.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define UNICODE
+#include "ddeimp.hxx"
+#include <svdde.hxx>
+#include <svarray.hxx>
+
+#ifndef _TOOLS_DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+//static long hCurConv = 0;
+//static DWORD hDdeInst = NULL;
+//static short nInstance = 0;
+//static DdeServices* pServices;
+
+enum DdeItemType
+{
+ DDEITEM,
+ DDEGETPUTITEM
+};
+
+struct DdeItemImpData
+{
+ ULONG nHCnv;
+ USHORT nCnt;
+
+ DdeItemImpData( ULONG nH ) : nHCnv( nH ), nCnt( 1 ) {}
+};
+
+SV_DECL_VARARR( DdeItemImp, DdeItemImpData, 1, 1 )
+SV_IMPL_VARARR( DdeItemImp, DdeItemImpData )
+
+// --- DdeInternat::SvrCallback() ----------------------------------
+
+#ifdef WNT
+HDDEDATA CALLBACK DdeInternal::SvrCallback(
+ WORD nCode, WORD nCbType, HCONV hConv, HSZ hText1, HSZ hText2,
+ HDDEDATA hData, DWORD, DWORD )
+#else
+#if defined ( MTW ) || ( defined ( GCC ) && defined ( OS2 )) || defined( ICC )
+HDDEDATA CALLBACK __EXPORT DdeInternal::SvrCallback(
+ WORD nCode, WORD nCbType, HCONV hConv, HSZ hText1, HSZ hText2,
+ HDDEDATA hData, DWORD, DWORD )
+#else
+HDDEDATA CALLBACK _export DdeInternal::SvrCallback(
+ WORD nCode, WORD nCbType, HCONV hConv, HSZ hText1, HSZ hText2,
+ HDDEDATA hData, DWORD, DWORD )
+#endif
+#endif
+{
+ DdeServices& rAll = DdeService::GetServices();
+ DdeService* pService;
+ DdeTopic* pTopic;
+ DdeItem* pItem;
+ DdeData* pData;
+ Conversation* pC;
+
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+
+ switch( nCode )
+ {
+ case XTYP_WILDCONNECT:
+ {
+ short nTopics = 0;
+
+#if 1
+ TCHAR chTopicBuf[250];
+ if( hText1 )
+ DdeQueryString( pInst->hDdeInstSvr, hText1, chTopicBuf,
+ sizeof(chTopicBuf)/sizeof(TCHAR), CP_WINUNICODE );
+
+ for( pService = rAll.First();pService;pService = rAll.Next() )
+ {
+ if ( !hText2 || ( *pService->pName == hText2 ) )
+ {
+ String sTopics( pService->Topics() );
+ if( sTopics.Len() )
+ {
+ if( hText1 )
+ {
+ USHORT n = 0;
+ while( STRING_NOTFOUND != n )
+ {
+ String s( sTopics.GetToken( 0, '\t', n ));
+ if( s == chTopicBuf )
+ ++nTopics;
+ }
+ }
+ else
+ nTopics += sTopics.GetTokenCount( '\t' );
+ }
+ }
+ }
+
+#else
+ for( pService = rAll.First();pService;pService = rAll.Next() )
+ {
+ if ( !hText2 || ( *pService->pName == hText2 ) )
+ {
+ for( pTopic = pService->aTopics.First(); pTopic;
+ pTopic = pService->aTopics.Next() )
+ {
+ if ( !hText1 || (*pTopic->pName == hText1) )
+ nTopics++;
+ }
+ }
+ }
+#endif
+ if( !nTopics )
+ return (HDDEDATA)NULL;
+
+ HSZPAIR* pPairs = new HSZPAIR [nTopics + 1];
+ if ( !pPairs )
+ return (HDDEDATA)NULL;
+
+ HSZPAIR* q = pPairs;
+ for( pService = rAll.First(); pService; pService = rAll.Next() )
+ {
+ if ( !hText2 || (*pService->pName == hText2 ) )
+ {
+#if 0
+ for ( pTopic = pService->aTopics.First(); pTopic;
+ pTopic = pService->aTopics.Next() )
+ {
+ if ( !hText1 || (*pTopic->pName == hText1) )
+ {
+ q->hszSvc = *pService->pName;
+ q->hszTopic = *pTopic->pName;
+ q++;
+ }
+ }
+#else
+ String sTopics( pService->Topics() );
+ USHORT n = 0;
+ while( STRING_NOTFOUND != n )
+ {
+ String s( sTopics.GetToken( 0, '\t', n ));
+ s.EraseAllChars( '\n' ).EraseAllChars( '\r' );
+ if( !hText1 || s == chTopicBuf )
+ {
+ DdeString aDStr( pInst->hDdeInstSvr, s );
+ pTopic = FindTopic( *pService, (HSZ)aDStr );
+ if( pTopic )
+ {
+ q->hszSvc = *pService->pName;
+ q->hszTopic = *pTopic->pName;
+ q++;
+ }
+ }
+ }
+
+#endif
+ }
+ }
+
+ q->hszSvc = NULL;
+ q->hszTopic = NULL;
+ HDDEDATA h = DdeCreateDataHandle(
+ pInst->hDdeInstSvr, (LPBYTE) pPairs,
+ sizeof(HSZPAIR) * (nTopics+1),
+ 0, NULL, nCbType, 0);
+ delete pPairs;
+ return h;
+ }
+
+ case XTYP_CONNECT:
+ pService = FindService( hText2 );
+ if ( pService)
+ pTopic = FindTopic( *pService, hText1 );
+ else
+ pTopic = NULL;
+ if ( pTopic )
+ return (HDDEDATA)DDE_FACK;
+ else
+ return (HDDEDATA) NULL;
+
+ case XTYP_CONNECT_CONFIRM:
+ pService = FindService( hText2 );
+ if ( pService )
+ {
+ pTopic = FindTopic( *pService, hText1 );
+ if ( pTopic )
+ {
+ pTopic->Connect( (long) hConv );
+ pC = new Conversation;
+ pC->hConv = hConv;
+ pC->pTopic = pTopic;
+ pService->pConv->Insert( pC );
+ }
+ }
+ return (HDDEDATA)NULL;
+ }
+
+ for ( pService = rAll.First(); pService; pService = rAll.Next() )
+ {
+ for( pC = pService->pConv->First(); pC;
+ pC = pService->pConv->Next() )
+ {
+ if ( pC->hConv == hConv )
+ goto found;
+ }
+ }
+
+ return (HDDEDATA) DDE_FNOTPROCESSED;
+
+found:
+ if ( nCode == XTYP_DISCONNECT)
+ {
+ pC->pTopic->_Disconnect( (long) hConv );
+ pService->pConv->Remove( pC );
+ delete pC;
+ return (HDDEDATA)NULL;
+ }
+
+ BOOL bExec = BOOL(nCode == XTYP_EXECUTE);
+ pTopic = pC->pTopic;
+ if ( pTopic && !bExec )
+ pItem = FindItem( *pTopic, hText2 );
+ else
+ pItem = NULL;
+
+ if ( !bExec && !pService->HasCbFormat( nCbType ) )
+ pItem = NULL;
+ if ( !pItem && !bExec )
+ return (HDDEDATA)DDE_FNOTPROCESSED;
+ if ( pItem )
+ pTopic->aItem = pItem->GetName();
+ else
+ pTopic->aItem.Erase();
+
+ BOOL bRes = FALSE;
+ pInst->hCurConvSvr = (long)hConv;
+ switch( nCode )
+ {
+ case XTYP_REQUEST:
+ case XTYP_ADVREQ:
+ {
+ String aRes; // darf erst am Ende freigegeben werden!!
+ if ( pTopic->IsSystemTopic() )
+ {
+ if ( pTopic->aItem == SZDDESYS_ITEM_TOPICS )
+ aRes = pService->Topics();
+ else if ( pTopic->aItem == SZDDESYS_ITEM_SYSITEMS )
+ aRes = pService->SysItems();
+ else if ( pTopic->aItem == SZDDESYS_ITEM_STATUS )
+ aRes = pService->Status();
+ else if ( pTopic->aItem == SZDDESYS_ITEM_FORMATS )
+ aRes = pService->Formats();
+ else if ( pTopic->aItem == SZDDESYS_ITEM_HELP )
+ aRes = pService->GetHelp();
+ else
+ aRes = pService->SysTopicGet( pTopic->aItem );
+
+ if ( aRes.Len() )
+ pData = new DdeData( aRes );
+ else
+ pData = NULL;
+ }
+ else if( DDEGETPUTITEM == pItem->nType )
+ pData = ((DdeGetPutItem*)pItem)->Get(
+ DdeData( NULL, 0, nCbType ).GetFormat() );
+ else
+ pData = pTopic->Get( DdeData( NULL, 0, nCbType ).GetFormat() );
+
+ if ( pData )
+ return DdeCreateDataHandle( pInst->hDdeInstSvr,
+ (LPBYTE)pData->pImp->pData,
+ pData->pImp->nData,
+ 0, hText2, pData->pImp->nFmt, 0);
+ }
+ break;
+
+ case XTYP_POKE:
+ if ( !pTopic->IsSystemTopic() )
+ {
+ DdeData d;
+ d.pImp->hData = hData;
+ d.pImp->nFmt = nCbType;
+ d.Lock();
+ if( DDEGETPUTITEM == pItem->nType )
+ bRes = ((DdeGetPutItem*)pItem)->Put( &d );
+ else
+ bRes = pTopic->Put( &d );
+ }
+ pInst->hCurConvSvr = NULL;
+ if ( bRes )
+ return (HDDEDATA)DDE_FACK;
+ else
+ return (HDDEDATA) DDE_FNOTPROCESSED;
+
+ case XTYP_ADVSTART:
+ {
+ // wird das Item zum erstenmal ein HotLink ?
+ if( !pItem->pImpData && pTopic->StartAdviseLoop() )
+ {
+ // dann wurde das Item ausgewechselt
+ pTopic->aItems.Remove( pItem );
+ DdeItem* pTmp;
+ for( pTmp = pTopic->aItems.First(); pTmp;
+ pTmp = pTopic->aItems.Next() )
+ if( *pTmp->pName == hText2 )
+ {
+ // es wurde tatsaechlich ausgewechselt
+ delete pItem;
+ pItem = 0;
+ break;
+ }
+ if( pItem )
+ // es wurde doch nicht ausgewechselt, also wieder rein
+ pTopic->aItems.Insert( pItem );
+ else
+ pItem = pTmp;
+ }
+ pItem->IncMonitor( (long)hConv );
+ pInst->hCurConvSvr = NULL;
+ }
+ return (HDDEDATA)TRUE;
+
+ case XTYP_ADVSTOP:
+ pItem->DecMonitor( (long)hConv );
+ if( !pItem->pImpData )
+ pTopic->StopAdviseLoop();
+ pInst->hCurConvSvr = NULL;
+ return (HDDEDATA)TRUE;
+
+ case XTYP_EXECUTE:
+ {
+ DdeData aExec;
+ aExec.pImp->hData = hData;
+ aExec.pImp->nFmt = nCbType;
+ aExec.Lock();
+ String aName = (const sal_Unicode *)aExec.pImp->pData;
+
+ if( pTopic->IsSystemTopic() )
+ bRes = pService->SysTopicExecute( &aName );
+ else
+ bRes = pTopic->Execute( &aName );
+ }
+ pInst->hCurConvSvr = NULL;
+ if ( bRes )
+ return (HDDEDATA)DDE_FACK;
+ else
+ return (HDDEDATA)DDE_FNOTPROCESSED;
+ }
+
+ return (HDDEDATA)NULL;
+}
+
+// --- DdeInternat::FindService() ----------------------------------
+
+DdeService* DdeInternal::FindService( HSZ hService )
+{
+ DdeService* s;
+ DdeServices& rSvc = DdeService::GetServices();
+ for ( s = rSvc.First(); s; s = rSvc.Next() )
+ {
+ if ( *s->pName == hService )
+ return s;
+ }
+
+ return NULL;
+}
+
+// --- DdeInternat::FindTopic() ------------------------------------
+
+DdeTopic* DdeInternal::FindTopic( DdeService& rService, HSZ hTopic )
+{
+ DdeTopic* s;
+ DdeTopics& rTopics = rService.aTopics;
+ int bWeiter = FALSE;
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+
+ do { // middle check loop
+ for ( s = rTopics.First(); s; s = rTopics.Next() )
+ {
+ if ( *s->pName == hTopic )
+ return s;
+ }
+
+ bWeiter = !bWeiter;
+ if( !bWeiter )
+ break;
+
+ // dann befragen wir doch mal unsere Ableitung:
+ TCHAR chBuf[250];
+ DdeQueryString(pInst->hDdeInstSvr,hTopic,chBuf,sizeof(chBuf)/sizeof(TCHAR),CP_WINUNICODE );
+ bWeiter = rService.MakeTopic( chBuf );
+ // dann muessen wir noch mal suchen
+ } while( bWeiter );
+
+ return 0;
+}
+
+// --- DdeInternal::FindItem() -------------------------------------
+
+DdeItem* DdeInternal::FindItem( DdeTopic& rTopic, HSZ hItem )
+{
+ DdeItem* s;
+ DdeItems& rItems = rTopic.aItems;
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ int bWeiter = FALSE;
+
+ do { // middle check loop
+
+ for ( s = rItems.First(); s; s = rItems.Next() )
+ if ( *s->pName == hItem )
+ return s;
+
+ bWeiter = !bWeiter;
+ if( !bWeiter )
+ break;
+
+ // dann befragen wir doch mal unsere Ableitung:
+ TCHAR chBuf[250];
+ DdeQueryString(pInst->hDdeInstSvr,hItem,chBuf,sizeof(chBuf)/sizeof(TCHAR),CP_WINUNICODE );
+ bWeiter = rTopic.MakeItem( chBuf );
+ // dann muessen wir noch mal suchen
+ } while( bWeiter );
+
+ return 0;
+}
+
+// --- DdeService::DdeService() ------------------------------------
+
+DdeService::DdeService( const String& rService )
+{
+ DdeInstData* pInst = ImpGetInstData();
+ if( !pInst )
+ pInst = ImpInitInstData();
+ pInst->nRefCount++;
+ pInst->nInstanceSvr++;
+
+ if ( !pInst->hDdeInstSvr )
+ {
+ nStatus = DdeInitialize( &pInst->hDdeInstSvr,
+ (PFNCALLBACK)DdeInternal::SvrCallback,
+ APPCLASS_STANDARD |
+ CBF_SKIP_REGISTRATIONS |
+ CBF_SKIP_UNREGISTRATIONS, 0L );
+ pInst->pServicesSvr = new DdeServices;
+ }
+ else
+ nStatus = DMLERR_NO_ERROR;
+
+ pConv = new ConvList;
+
+ if ( pInst->pServicesSvr )
+ pInst->pServicesSvr->Insert( this );
+
+ pName = new DdeString( pInst->hDdeInstSvr, rService );
+ if ( nStatus == DMLERR_NO_ERROR )
+ if ( !DdeNameService( pInst->hDdeInstSvr, *pName, NULL,
+ DNS_REGISTER | DNS_FILTEROFF ) )
+ nStatus = DMLERR_SYS_ERROR;
+
+ AddFormat( FORMAT_STRING );
+ pSysTopic = new DdeTopic( SZDDESYS_TOPIC );
+ pSysTopic->AddItem( DdeItem( SZDDESYS_ITEM_TOPICS ) );
+ pSysTopic->AddItem( DdeItem( SZDDESYS_ITEM_SYSITEMS ) );
+ pSysTopic->AddItem( DdeItem( SZDDESYS_ITEM_STATUS ) );
+ pSysTopic->AddItem( DdeItem( SZDDESYS_ITEM_FORMATS ) );
+ pSysTopic->AddItem( DdeItem( SZDDESYS_ITEM_HELP ) );
+ AddTopic( *pSysTopic );
+}
+
+// --- DdeService::~DdeService() -----------------------------------
+
+DdeService::~DdeService()
+{
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ if ( pInst->pServicesSvr )
+ pInst->pServicesSvr->Remove( this );
+
+ // MT: Im Auftrage des Herrn (AM) auskommentiert...
+ // Grund:
+ // Bei Client/Server werden die Server nicht beendet, wenn mehr
+ // als einer gestartet.
+ // Weil keine System-Messagequeue ?!
+
+#ifndef VCL
+ DdeNameService( pInst->hDdeInstSvr, *pName, NULL, DNS_UNREGISTER );
+#endif
+
+ delete pSysTopic;
+ delete pName;
+
+ pInst->nInstanceSvr--;
+ pInst->nRefCount--;
+ if ( !pInst->nInstanceSvr && pInst->hDdeInstSvr )
+ {
+ if( DdeUninitialize( pInst->hDdeInstSvr ) )
+ {
+ pInst->hDdeInstSvr = NULL;
+ delete pInst->pServicesSvr;
+ pInst->pServicesSvr = NULL;
+ if( pInst->nRefCount == 0)
+ ImpDeinitInstData();
+ }
+ }
+ delete pConv;
+}
+
+// --- DdeService::GetName() ---------------------------------------
+
+const String& DdeService::GetName() const
+{
+ return *pName;
+}
+
+// --- DdeService::GetServices() -----------------------------------
+
+DdeServices& DdeService::GetServices()
+{
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ return *(pInst->pServicesSvr);
+}
+
+// --- DdeService::AddTopic() --------------------------------------
+
+void DdeService::AddTopic( const DdeTopic& rTopic )
+{
+ RemoveTopic( rTopic );
+ aTopics.Insert( (DdeTopic*) &rTopic );
+}
+
+// --- DdeService::RemoveTopic() -----------------------------------
+
+void DdeService::RemoveTopic( const DdeTopic& rTopic )
+{
+ DdeTopic* t;
+ for ( t = aTopics.First(); t; t = aTopics.Next() )
+ {
+ if ( !DdeCmpStringHandles (*t->pName, *rTopic.pName ) )
+ {
+ aTopics.Remove( t );
+ // JP 27.07.95: und alle Conversions loeschen !!!
+ // (sonst wird auf geloeschten Topics gearbeitet!!)
+ for( ULONG n = pConv->Count(); n; )
+ {
+ Conversation* pC = pConv->GetObject( --n );
+ if( pC->pTopic == &rTopic )
+ {
+ pConv->Remove( pC );
+ delete pC;
+ }
+ }
+ break;
+ }
+ }
+}
+
+// --- DdeService::HasCbFormat() -----------------------------------
+
+BOOL DdeService::HasCbFormat( USHORT nFmt )
+{
+ return BOOL( aFormats.GetPos( nFmt ) != LIST_ENTRY_NOTFOUND );
+}
+
+// --- DdeService::HasFormat() -------------------------------------
+
+BOOL DdeService::HasFormat( ULONG nFmt )
+{
+ DdeData d( NULL, 0, nFmt );
+ return HasCbFormat( d.pImp->nFmt );
+}
+
+// --- DdeService::AddFormat() -------------------------------------
+
+void DdeService::AddFormat( ULONG nFmt )
+{
+ DdeData d( NULL, 0, nFmt );
+ aFormats.Remove( (long)d.pImp->nFmt );
+ aFormats.Insert( (long)d.pImp->nFmt );
+}
+
+// --- DdeService::RemoveFormat() ----------------------------------
+
+void DdeService::RemoveFormat( ULONG nFmt )
+{
+ DdeData d( NULL, 0, nFmt );
+ aFormats.Remove( (long)d.pImp->nFmt );
+}
+
+// --- DdeTopic::DdeTopic() ----------------------------------------
+
+DdeTopic::DdeTopic( const String& rName )
+{
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ pName = new DdeString( pInst->hDdeInstSvr, rName );
+}
+
+// --- DdeTopic::~DdeTopic() ---------------------------------------
+
+DdeTopic::~DdeTopic()
+{
+ DdeItem* t;
+ while( ( t = aItems.First() ) != NULL )
+ {
+ aItems.Remove( t );
+ t->pMyTopic = 0;
+ delete t;
+ }
+ delete pName;
+}
+
+// --- DdeTopic::GetName() -----------------------------------------
+
+const String& DdeTopic::GetName() const
+{
+ return *pName;
+}
+
+// --- DdeTopic::IsSystemTopic() -----------------------------------
+
+BOOL DdeTopic::IsSystemTopic()
+{
+ return BOOL (GetName() == SZDDESYS_TOPIC);
+}
+
+// --- DdeTopic::AddItem() -----------------------------------------
+
+DdeItem* DdeTopic::AddItem( const DdeItem& r )
+{
+ DdeItem* s;
+ if( DDEGETPUTITEM == r.nType )
+ s = new DdeGetPutItem( r );
+ else
+ s = new DdeItem( r );
+ if ( s )
+ {
+ aItems.Insert( s );
+ s->pMyTopic = this;
+ }
+ return s;
+}
+
+// --- DdeTopic::InsertItem() -----------------------------------------
+
+void DdeTopic::InsertItem( DdeItem* pNew )
+{
+ if( pNew )
+ {
+ aItems.Insert( pNew );
+ pNew->pMyTopic = this;
+ }
+}
+
+// --- DdeTopic::RemoveItem() --------------------------------------
+
+void DdeTopic::RemoveItem( const DdeItem& r )
+{
+ DdeItem* s;
+ for ( s = aItems.First(); s; s = aItems.Next() )
+ {
+ if ( !DdeCmpStringHandles (*s->pName, *r.pName ) )
+ break;
+ }
+
+ if ( s )
+ {
+ aItems.Remove( s );
+ s->pMyTopic = 0;
+ delete s;
+ }
+}
+
+// --- DdeTopic::NotifyClient() ------------------------------------
+
+void DdeTopic::NotifyClient( const String& rItem )
+{
+ DdeItem* pItem;
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ for ( pItem = aItems.First(); pItem; pItem = aItems.Next() )
+ {
+ if ( pItem->GetName() == rItem )
+ {
+ if ( pItem->pImpData )
+ DdePostAdvise( pInst->hDdeInstSvr, *pName, *pItem->pName );
+ }
+ break;
+ }
+}
+
+// --- DdeTopic::Connect() -----------------------------------------
+
+void __EXPORT DdeTopic::Connect( long nId )
+{
+ aConnectLink.Call( (void*)nId );
+}
+
+// --- DdeTopic::Disconnect() --------------------------------------
+
+void __EXPORT DdeTopic::Disconnect( long nId )
+{
+ aDisconnectLink.Call( (void*)nId );
+}
+
+// --- DdeTopic::_Disconnect() --------------------------------------
+
+void __EXPORT DdeTopic::_Disconnect( long nId )
+{
+ for( DdeItem* pItem = aItems.First(); pItem; pItem = aItems.Next() )
+ pItem->DecMonitor( nId );
+
+ Disconnect( nId );
+}
+
+// --- DdeTopic::Get() ---------------------------------------------
+
+DdeData* __EXPORT DdeTopic::Get( ULONG nFmt )
+{
+ if ( aGetLink.IsSet() )
+ return (DdeData*)aGetLink.Call( (void*)nFmt );
+ else
+ return NULL;
+}
+
+// --- DdeTopic::Put() ---------------------------------------------
+
+BOOL __EXPORT DdeTopic::Put( const DdeData* r )
+{
+ if ( aPutLink.IsSet() )
+ return (BOOL)aPutLink.Call( (void*) r );
+ else
+ return FALSE;
+}
+
+// --- DdeTopic::Execute() -----------------------------------------
+
+BOOL __EXPORT DdeTopic::Execute( const String* r )
+{
+ if ( aExecLink.IsSet() )
+ return (BOOL)aExecLink.Call( (void*)r );
+ else
+ return FALSE;
+}
+
+// --- DdeTopic::GetConvId() ---------------------------------------
+
+long DdeTopic::GetConvId()
+{
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ return pInst->hCurConvSvr;
+}
+
+// --- DdeTopic::StartAdviseLoop() ---------------------------------
+
+BOOL DdeTopic::StartAdviseLoop()
+{
+ return FALSE;
+}
+
+// --- DdeTopic::StopAdviseLoop() ----------------------------------
+
+BOOL DdeTopic::StopAdviseLoop()
+{
+ return FALSE;
+}
+
+// --- DdeItem::DdeItem() ------------------------------------------
+
+DdeItem::DdeItem( const sal_Unicode* p )
+{
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ pName = new DdeString( pInst->hDdeInstSvr, p );
+ nType = DDEITEM;
+ pMyTopic = 0;
+ pImpData = 0;
+}
+
+// --- DdeItem::DdeItem() ------------------------------------------
+
+DdeItem::DdeItem( const String& r)
+{
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ pName = new DdeString( pInst->hDdeInstSvr, r );
+ nType = DDEITEM;
+ pMyTopic = 0;
+ pImpData = 0;
+}
+
+// --- DdeItem::DdeItem() ------------------------------------------
+
+DdeItem::DdeItem( const DdeItem& r)
+{
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ pName = new DdeString( pInst->hDdeInstSvr, *r.pName );
+ nType = DDEITEM;
+ pMyTopic = 0;
+ pImpData = 0;
+}
+
+// --- DdeItem::~DdeItem() -----------------------------------------
+
+DdeItem::~DdeItem()
+{
+ if( pMyTopic )
+ pMyTopic->aItems.Remove( this );
+ delete pName;
+ delete pImpData;
+}
+
+// --- DdeItem::GetName() ------------------------------------------
+
+const String& DdeItem::GetName() const
+{
+ return *pName;
+}
+
+// --- DdeItem::NotifyClient() ------------------------------------------
+
+void DdeItem::NotifyClient()
+{
+ if( pMyTopic && pImpData )
+ {
+ DdeInstData* pInst = ImpGetInstData();
+ DBG_ASSERT(pInst,"SVDDE:No instance data");
+ DdePostAdvise( pInst->hDdeInstSvr, *pMyTopic->pName, *pName );
+ }
+}
+
+// --- DdeItem::IncMonitor() ------------------------------------------
+
+void DdeItem::IncMonitor( ULONG nHCnv )
+{
+ if( !pImpData )
+ {
+ pImpData = new DdeItemImp;
+ if( DDEGETPUTITEM == nType )
+ ((DdeGetPutItem*)this)->AdviseLoop( TRUE );
+ }
+ else
+ {
+ for( USHORT n = pImpData->Count(); n; )
+ if( (*pImpData)[ --n ].nHCnv == nHCnv )
+ {
+ ++(*pImpData)[ n ].nHCnv;
+ return ;
+ }
+ }
+
+ pImpData->Insert( DdeItemImpData( nHCnv ), pImpData->Count() );
+}
+
+// --- DdeItem::DecMonitor() ------------------------------------------
+
+void DdeItem::DecMonitor( ULONG nHCnv )
+{
+ if( pImpData )
+ {
+ DdeItemImpData* pData = (DdeItemImpData*)pImpData->GetData();
+ for( USHORT n = pImpData->Count(); n; --n, ++pData )
+ if( pData->nHCnv == nHCnv )
+ {
+ if( !pData->nCnt || !--pData->nCnt )
+ {
+ if( 1 < pImpData->Count() )
+ pImpData->Remove( pImpData->Count() - n );
+ else
+ {
+ delete pImpData, pImpData = 0;
+ if( DDEGETPUTITEM == nType )
+ ((DdeGetPutItem*)this)->AdviseLoop( FALSE );
+ }
+ }
+ return ;
+ }
+ }
+}
+
+// --- DdeItem::GetLinks() ------------------------------------------
+
+short DdeItem::GetLinks()
+{
+ short nCnt = 0;
+ if( pImpData )
+ for( USHORT n = pImpData->Count(); n; )
+ nCnt += (*pImpData)[ --n ].nCnt;
+ return nCnt;
+}
+
+// --- DdeGetPutItem::DdeGetPutItem() ------------------------------
+
+DdeGetPutItem::DdeGetPutItem( const sal_Unicode* p )
+ : DdeItem( p )
+{
+ nType = DDEGETPUTITEM;
+}
+
+// --- DdeGetPutItem::DdeGetPutItem() ------------------------------
+
+DdeGetPutItem::DdeGetPutItem( const String& rStr )
+ : DdeItem( rStr )
+{
+ nType = DDEGETPUTITEM;
+}
+
+// --- DdeGetPutItem::DdeGetPutItem() ------------------------------
+
+DdeGetPutItem::DdeGetPutItem( const DdeItem& rItem )
+ : DdeItem( rItem )
+{
+ nType = DDEGETPUTITEM;
+}
+
+
+// --- DdeGetPutData::Get() ----------------------------------------
+
+DdeData* DdeGetPutItem::Get( ULONG )
+{
+ return 0;
+}
+
+// --- DdeGetPutData::Put() ----------------------------------------
+
+BOOL DdeGetPutItem::Put( const DdeData* )
+{
+ return FALSE;
+}
+
+// --- DdeGetPutData::AdviseLoop() ---------------------------------
+
+void DdeGetPutItem::AdviseLoop( BOOL )
+{
+}
+
+
+// --- DdeService::SysItems() --------------------------------------
+
+String DdeService::SysItems()
+{
+ String s;
+ DdeTopic* t;
+ for ( t = aTopics.First(); t; t = aTopics.Next() )
+ {
+ if ( t->GetName() == String::CreateFromAscii( (const sal_Char *)SZDDESYS_TOPIC ) )
+ {
+ short n = 0;
+ DdeItem* pi;
+ for ( pi = t->aItems.First(); pi; pi = t->aItems.Next(), n++ )
+ {
+ if ( n )
+ s += '\t';
+ s += pi->GetName();
+ }
+ s += String::CreateFromAscii("\r\n");
+ }
+ }
+
+ return s;
+}
+
+// --- DdeService::Topics() ----------------------------------------
+
+String DdeService::Topics()
+{
+ String s;
+ DdeTopic* t;
+ short n = 0;
+
+ for ( t = aTopics.First(); t; t = aTopics.Next(), n++ )
+ {
+ if ( n )
+ s += '\t';
+ s += t->GetName();
+ }
+ s += String::CreateFromAscii("\r\n");
+
+ return s;
+}
+
+// --- DdeService::Formats() ---------------------------------------
+
+String DdeService::Formats()
+{
+ String s;
+ long f;
+ TCHAR buf[128];
+ LPCTSTR p;
+ short n = 0;
+
+ for ( f = aFormats.First(); f; f = aFormats.Next(), n++ )
+ {
+ if ( n )
+ s += '\t';
+ p = buf;
+
+ switch( (USHORT)f )
+ {
+ case CF_TEXT:
+ p = String::CreateFromAscii("TEXT").GetBuffer();
+ break;
+ case CF_BITMAP:
+ p = String::CreateFromAscii("BITMAP").GetBuffer();
+ break;
+#ifdef OS2
+ case CF_DSPTEXT:
+ p = String::CreateFromAscii("TEXT").GetBuffer();
+ break;
+ case CF_DSPBITMAP:
+ p = String::CreateFromAscii("BITMAP").GetBuffer();
+ break;
+ case CF_METAFILE:
+ p = String::CreateFromAscii("METAFILE").GetBuffer();
+ break;
+ case CF_DSPMETAFILE:
+ p = String::CreateFromAscii("METAFILE").GetBuffer();
+ break;
+ case CF_PALETTE:
+ p = String::CreateFromAscii("PALETTE").GetBuffer();
+ break;
+ default:
+ p= String::CreateFromAscii("PRIVATE").GetBuffer();
+#else
+ default:
+ GetClipboardFormatName( (UINT)f, buf, sizeof(buf) / sizeof(TCHAR) );
+#endif
+ }
+ s += String( p );
+ }
+ s += String::CreateFromAscii("\r\n");
+
+ return s;
+}
+
+// --- DdeService::Status() ----------------------------------------
+
+String DdeService::Status()
+{
+ return IsBusy() ? String::CreateFromAscii("Busy\r\n") : String::CreateFromAscii("Ready\r\n");
+}
+
+// --- DdeService::IsBusy() ----------------------------------------
+
+BOOL __EXPORT DdeService::IsBusy()
+{
+ return FALSE;
+}
+
+// --- DdeService::GetHelp() ----------------------------------------
+
+String __EXPORT DdeService::GetHelp()
+{
+ return String();
+}
+
+BOOL DdeTopic::MakeItem( const String& )
+{
+ return FALSE;
+}
+
+BOOL DdeService::MakeTopic( const String& )
+{
+ return FALSE;
+}
+
+String DdeService::SysTopicGet( const String& )
+{
+ return String();
+}
+
+BOOL DdeService::SysTopicExecute( const String* )
+{
+ return FALSE;
+}
+
diff --git a/svtools/source/svdde/makefile.mk b/svtools/source/svdde/makefile.mk
new file mode 100644
index 000000000000..d7e840a52ff6
--- /dev/null
+++ b/svtools/source/svdde/makefile.mk
@@ -0,0 +1,123 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+
+.IF "$(GUIBASE)"=="WIN" || "$(GUIBASE)"=="OS2"
+
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=svdde
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES= ddecli.cxx \
+ ddesvr.cxx \
+ ddedata.cxx \
+ ddestrg.cxx \
+ ddeinf.cxx
+
+.IF "$(GUIBASE)"=="OS2"
+CXXFILES+=\
+ ddeml1.cxx \
+ ddeml2.cxx \
+ ddemldeb.cxx
+.ENDIF
+
+SLOFILES= $(SLO)$/ddecli.obj \
+ $(SLO)$/ddesvr.obj \
+ $(SLO)$/ddedata.obj \
+ $(SLO)$/ddestrg.obj \
+ $(SLO)$/ddeinf.obj
+
+.IF "$(GUIBASE)"=="OS2"
+SLOFILES+=\
+ $(SLO)$/ddeml1.obj \
+ $(SLO)$/ddeml2.obj \
+ $(SLO)$/ddemldeb.obj
+.ENDIF
+.IF "$(depend)" == ""
+
+# --- Targets -------------------------------------------------------
+
+ALL: $(SLB)$/$(TARGET).lib \
+ ALLTAR
+
+
+.ENDIF
+
+.INCLUDE : target.mk
+
+
+.ELSE
+dummy:
+ @echo GUI == "$(GUI)" - nothing to do
+
+.ENDIF
+
diff --git a/svtools/source/svhtml/htmlkey2.cxx b/svtools/source/svhtml/htmlkey2.cxx
new file mode 100644
index 000000000000..c954ed3c9e37
--- /dev/null
+++ b/svtools/source/svhtml/htmlkey2.cxx
@@ -0,0 +1,700 @@
+/*************************************************************************
+ *
+ * $RCSfile: htmlkey2.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "htmlkywd.hxx"
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_doctype32,
+ "HTML PUBLIC \"-//W3C//DTD HTML 3.2//EN\"" );
+
+
+// diese werden nur eingeschaltet
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_area, "AREA" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_base, "BASE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_comment, "!--" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_doctype, "!DOCTYPE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_embed, "EMBED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_figureoverlay, "OVERLAY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_horzrule, "HR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_horztab, "TAB" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_image, "IMG" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_image2, "IMAGE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_input, "INPUT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_isindex, "ISINDEX" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_linebreak, "BR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_li, "LI" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_link, "LINK" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_meta, "META" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_nextid, "NEXTID" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_nobr, "NOBR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_of, "OF" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_option, "OPTION" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_param, "PARAM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_range, "RANGE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_spacer, "SPACER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_wbr, "WBR" );
+
+// diese werden wieder abgeschaltet
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_abbreviation, "ABBREV" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_above, "ABOVE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_acronym, "ACRONYM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_address, "ADDRESS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_anchor, "A" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_applet, "APPLET" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_array, "ARRAY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_author, "AU" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_banner, "BANNER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_bar, "BAR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_basefont, "BASEFONT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_below, "BELOW" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_bigprint, "BIG" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_blink, "BLINK" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_blockquote, "BLOCKQUOTE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_blockquote30, "BQ" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_body, "BODY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_bold, "B" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_boldtext, "BT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_box, "BOX" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_caption, "CAPTION" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_center, "CENTER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_citiation, "CITE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_code, "CODE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_col, "COL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_colgroup, "COLGROUP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_credit, "CREDIT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_dd, "DD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_deflist, "DL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_deletedtext, "DEL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_dirlist, "DIR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_division, "DIV" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_dot, "DOT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_doubledot, "DDOT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_dt, "DT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_emphasis, "EM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_figure, "FIG" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_font, "FONT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_footnote, "FN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_form, "FORM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_frame, "FRAME" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_frameset, "FRAMESET" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_hat, "HAT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_head1, "H1" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_head2, "H2" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_head3, "H3" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_head4, "H4" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_head5, "H5" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_head6, "H6" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_head, "HEAD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_html, "HTML" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_iframe, "IFRAME" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_ilayer, "ILAYER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_insertedtext, "INS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_italic, "I" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_item, "ITEM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_keyboard, "KBD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_language, "LANG" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_layer, "LAYER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_listheader, "LH" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_map, "MAP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_math, "MATH" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_menulist, "MENU" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_multicol, "MULTICOL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_noembed, "NOEMBED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_noframe, "NOFRAME" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_noframes, "NOFRAMES" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_noscript, "NOSCRIPT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_note, "NOTE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_orderlist, "OL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_parabreak, "P" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_person, "PERSON" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_plaintext, "T" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_preformtxt, "PRE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_root, "ROOT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_row, "ROW" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_sample, "SAMP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_script, "SCRIPT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_select, "SELECT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_shortquote, "Q" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_smallprint, "SMALL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_span, "SPAN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_squareroot, "AQRT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_strikethrough, "S" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_strong, "STRONG" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_style, "STYLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_subscript, "SUB" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_superscript, "SUP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_table, "TABLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_tablerow, "TR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_tabledata, "TD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_tableheader, "TH" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_tbody, "TBODY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_teletype, "TT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_text, "TEXT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_textarea, "TEXTAREA" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_textflow, "TEXTFLOW" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_tfoot, "TFOOT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_thead, "THEAD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_tilde, "TILDE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_title, "TITLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_underline, "U" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_unorderlist, "UL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_variable, "VAR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_vector, "VEC" );
+
+// obsolete features
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_xmp, "XMP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_listing, "LISTING" );
+
+// proposed features
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_definstance, "DFN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_strike, "STRIKE" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_bgsound, "BGSOUND" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_comment2, "COMMENT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_marquee, "MARQUEE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_plaintext2, "PLAINTEXT" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_sdfield, "SDFIELD" );
+
+// die Namen fuer alle Zeichen
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_lt, "lt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_gt, "gt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_amp, "amp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_quot, "quot" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Aacute, "Aacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Agrave, "Agrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Acirc, "Acirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Atilde, "Atilde" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Aring, "Aring" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Auml, "Auml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_AElig, "AElig" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Ccedil, "Ccedil" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Eacute, "Eacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Egrave, "Egrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Ecirc, "Ecirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Euml, "Euml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Iacute, "Iacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Igrave, "Igrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Icirc, "Icirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Iuml, "Iuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_ETH, "ETH" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Ntilde, "Ntilde" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Oacute, "Oacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Ograve, "Ograve" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Ocirc, "Ocirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Otilde, "Otilde" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Ouml, "Ouml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Oslash, "Oslash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Uacute, "Uacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Ugrave, "Ugrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Ucirc, "Ucirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Uuml, "Uuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_Yacute, "Yacute" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_THORN, "THORN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_szlig, "szlig" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_aacute, "aacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_agrave, "agrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_acirc, "acirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_atilde, "atilde" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_aring, "aring" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_auml, "auml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_aelig, "aelig" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ccedil, "ccedil" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_eacute, "eacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_egrave, "egrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ecirc, "ecirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_euml, "euml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_iacute, "iacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_igrave, "igrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_icirc, "icirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_iuml, "iuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_eth, "eth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ntilde, "ntilde" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_oacute, "oacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ograve, "ograve" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ocirc, "ocirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_otilde, "otilde" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ouml, "ouml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_oslash, "oslash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_uacute, "uacute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ugrave, "ugrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ucirc, "ucirc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_uuml, "uuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_yacute, "yacute" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_thorn, "thorn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_yuml, "yuml" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_acute, "acute" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_brvbar, "brvbar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_cedil, "cedil" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_cent, "cent" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_copy, "copy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_curren, "curren" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_deg, "deg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_divide, "divide" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_frac12, "frac12" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_frac14, "frac14" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_frac34, "frac34" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_iexcl, "iexcl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_iquest, "iquest" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_laquo, "laquo" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_macr, "macr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_micro, "micro" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_middot, "middot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_nbsp, "nbsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_not, "not" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ordf, "ordf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_ordm, "ordm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_para, "para" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_plusmn, "plusmn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_pound, "pound" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_raquo, "raquo" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_reg, "reg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_sect, "sect" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_shy, "shy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_sup1, "sup1" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_sup2, "sup2" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_sup3, "sup3" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_times, "times" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_uml, "uml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_yen, "yen" );
+
+// Netscape kennt noch ein paar in Grossbuchstaben ...
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_LT, "LT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_GT, "GT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_AMP, "AMP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_C_QUOT, "QUOT" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_COPY, "COPY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_S_REG, "REG" );
+
+// HTML Attribut-Token (=Optionen)
+
+// Attribute ohne Wert
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_box, "BOX" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_checked, "CHECKED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_compact, "COMPACT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_continue, "CONTINUE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_controls, "CONTROLS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_declare, "DECLARE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_disabled, "DISABLED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_folded, "FOLDED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_ismap, "ISMAP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_mayscript, "MAYSCRIPT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_multiple, "MULTIPLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_noflow, "NOFLOW" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_nohref, "NOHREF" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_noresize, "NORESIZE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_noshade, "NOSHADE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_nowrap, "NOWRAP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_plain, "PLAIN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_sdfixed, "SDFIXED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_selected, "SELECTED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_shapes, "SHAPES" );
+
+// Attribute mit einem String als Wert
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_above, "ABOVE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_accesskey, "ACCESSKEY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_accept, "ACCEPT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_add_date, "ADD_DATE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_alt, "ALT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_axes, "AXES" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_axis, "AXIS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_below, "BELOW" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_char, "CHAR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_class, "CLASS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_clip, "CLIP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_code, "CODE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_codetype, "CODETYPE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_colspec, "COLSPEC" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_content, "CONTENT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_coords, "COORDS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_dp, "DP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_enctype, "ENCTYPE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_error, "ERROR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_face, "FACE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_frameborder, "FRAMEBORDER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_httpequiv, "HTTP-EQUIV" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_language, "LANGUAGE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_last_modified, "LAST_MODIFIED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_last_visit, "LAST_VISIT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_md, "MD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_n, "N" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_name, "NAME" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_notation, "NOTATION" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_prompt, "PROMPT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_shape, "SHAPE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_standby, "STANDBY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_style, "STYLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_title, "TITLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_value, "VALUE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDval, "SDVAL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDnum, "SDNUM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_sdlibrary, "SDLIBRARY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_sdmodule, "SDMODULE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_sdevent, "SDEVENT-" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_sdaddparam, "SDADDPARAM-" );
+
+// Attribute mit einem SGML-Identifier als Wert
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_from, "FROM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_id, "ID" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_target, "TARGET" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_to, "TO" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_until, "UNTIL" );
+
+// Attribute mit einem URI als Wert
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_action, "ACTION" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_background, "BACKGROUND" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_classid, "CLASSID" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_codebase, "CODEBASE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_data, "DATA" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_dynsrc, "DYNSRC" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_dynsync, "DYNSYNC" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_imagemap, "IMAGEMAP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_href, "HREF" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_lowsrc, "LOWSRC" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_script, "SCRIPT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_src, "SRC" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_usemap, "USEMAP" );
+
+// Attribute mit Entity-Namen als Wert
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_dingbat, "DINGBAT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_sym, "SYM" );
+
+// Attribute mit einer Farbe als Wert (alle Netscape)
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_alink, "ALINK" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_bgcolor, "BGCOLOR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_bordercolor, "BORDERCOLOR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_bordercolorlight, "BORDERCOLORLIGHT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_bordercolordark, "BORDERCOLORDARK" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_color, "COLOR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_link, "LINK" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_text, "TEXT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_vlink, "VLINK" );
+
+// Attribute mit einem numerischen Wert
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_border, "BORDER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_cellspacing, "CELLSPACING" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_cellpadding, "CELLPADDING" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_charoff, "CHAROFF" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_colspan, "COLSPAN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_framespacing, "FRAMESPACING" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_gutter, "GUTTER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_indent, "INDENT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_height, "HEIGHT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_hspace, "HSPACE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_left, "LEFT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_leftmargin, "LEFTMARGIN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_loop, "LOOP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_marginheight, "MARGINHEIGHT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_marginwidth, "MARGINWIDTH" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_max, "MAX" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_maxlength, "MAXLENGTH" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_min, "MIN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_pagex, "PAGEX" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_pagey, "PAGEY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_pointsize, "POINT-SIZE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_rowspan, "ROWSPAN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_scrollamount, "SCROLLAMOUNT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_scrolldelay, "SCROLLDELAY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_seqnum, "SEQNUM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_skip, "SKIP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_span, "SPAN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_tabindex, "TABINDEX" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_top, "TOP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_topmargin, "TOPMARGIN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_vspace, "VSPACE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_weight, "WEIGHT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_width, "WIDTH" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_x, "X" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_y, "Y" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_zindex, "Z-INDEX" );
+
+// Attribute mit Enum-Werten
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_behavior, "BEHAVIOR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_bgproperties, "BGPROPERTIES" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_clear, "CLEAR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_dir, "DIR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_direction, "DIRECTION" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_format, "FORMAT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_frame, "FRAME" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_lang, "LANG" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_method, "METHOD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_palette, "PALETTE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_rel, "REL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_rev, "REV" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_rules, "RULES" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_scrolling, "SCROLLING" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_sdreadonly, "READONLY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_subtype, "SUBTYPE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_type, "TYPE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_valign, "VALIGN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_valuetype, "VALUETYPE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_visibility, "VISIBILITY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_wrap, "WRAP" );
+
+// Attribute mit Script-Code als Wert
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onblur, "ONBLUR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onchange, "ONCHANGE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onclick, "ONCLICK" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onfocus, "ONFOCUS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onload, "ONLOAD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onmouseover, "ONMOUSEOVER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onreset, "ONRESET" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onselect, "ONSELECT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onsubmit, "ONSUBMIT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onunload, "ONUNLOAD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onabort, "ONABORT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onerror, "ONERROR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_onmouseout, "ONMOUSEOUT" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonblur, "SDONBLUR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonchange, "SDONCHANGE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonclick, "SDONCLICK" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonfocus, "SDONFOCUS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonload, "SDONLOAD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonmouseover, "SDONMOUSEOVER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonreset, "SDONRESET" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonselect, "SDONSELECT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonsubmit, "SDONSUBMIT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonunload, "SDONUNLOAD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonabort, "SDONABORT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonerror, "SDONERROR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_SDonmouseout, "SDONMOUSEOUT" );
+
+// Attribute mit Kontext-abhaengigen Werten
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_align, "ALIGN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_cols, "COLS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_rows, "ROWS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_start, "START" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_size, "SIZE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_O_units, "UNITS" );
+
+
+// Werte von <INPUT TYPE=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_text, "TEXT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_password, "PASSWORD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_checkbox, "CHECKBOX" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_radio, "RADIO" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_range, "RANGE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_scribble, "SCRIBBLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_file, "FILE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_hidden, "HIDDEN" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_submit, "SUBMIT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_image, "IMAGE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_reset, "RESET" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_IT_button, "BUTTON" );
+
+// Werte von <TABLE FRAME=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_void, "VOID" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_above, "ABOVE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_below, "BELOW" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_hsides, "HSIDES" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_lhs, "LHS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_rhs, "RHS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_vsides, "VSIDES" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_box, "BOX" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TF_border, "BORDER" );
+
+// Werte von <TABLE RULES=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TR_none, "NONE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TR_groups, "GROUPS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TR_rows, "ROWS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TR_cols, "COLS" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_TR_all, "ALL" );
+
+// Werte von <P, H?, TR, TH, TD ALIGN=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_AL_left, "LEFT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_AL_center, "CENTER" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_AL_middle, "MIDDLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_AL_right, "RIGHT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_AL_justify, "JUSTIFY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_AL_char, "CHAR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_AL_all, "ALL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_AL_none, "NONE" );
+
+// Werte von <TR VALIGN=...>, <IMG ALIGN=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_VA_top, "TOP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_VA_middle, "MIDDLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_VA_bottom, "BOTTOM" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_VA_baseline, "BASELINE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_VA_texttop, "TEXTTOP" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_VA_absmiddle, "ABSMIDDLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_VA_absbottom, "ABSBOTTOM" );
+
+// Werte von <AREA SHAPE=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SH_rect, "RECT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SH_rectangle, "RECTANGLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SH_circ, "CIRC" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SH_circle, "CIRCLE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SH_poly, "POLY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SH_polygon, "POLYGON" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SH_default, "DEFAULT" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_LG_starbasic, "STARBASIC" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_LG_javascript, "JAVASCRIPT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_LG_javascript11, "JAVASCRIPT1.1" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_LG_livescript, "LIVESCRIPT" );
+//sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_LG_vbscript, "VBSCRIPT" );
+//sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_LG_unused_javascript, "UNUSED JAVASCRIPT" );
+//sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_LG_starone, "StarScript" );
+
+// ein par Werte fuer unser StarBASIC-Support
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SB_library, "$LIBRARY:" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SB_module, "$MODULE:" );
+
+
+// Werte von <FORM METHOD=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_METHOD_get, "GET" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_METHOD_post, "POST" );
+
+// Werte von <META CONTENT/HTTP-EQUIV=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_refresh, "REFRESH" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_generator, "GENERATOR" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_author, "AUTHOR" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_classification, "CLASSIFICATION" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_description, "DESCRIPTION" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_keywords, "KEYWORDS" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_changed, "CHANGED" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_changedby, "CHANGEDBY" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_created, "CREATED" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_content_type, "CONTENT-TYPE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_content_script_type, "CONTENT-SCRIPT-TYPE" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_sdendnote, "SDENDNOTE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_META_sdfootnote, "SDFOOTNOTE" );
+
+// Werte von <UL TYPE=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_ULTYPE_disc, "DISC" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_ULTYPE_square, "SQUARE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_ULTYPE_circle, "CIRCLE" );
+
+// Werte von <FRAMESET SCROLLING=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SCROLL_yes, "YES" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SCROLL_no, "NO" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SCROLL_auto, "AUTO" );
+
+// Werte von <MULTICOL TYPE=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_MCTYPE_horizontal, "HORIZONTAL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_MCTYPE_vertical, "VERTICAL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_MCTYPE_box, "BOX" );
+
+// Werte von <MARQUEE BEHAVIOUR=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_BEHAV_scroll, "SCROLL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_BEHAV_slide, "SLIDE" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_BEHAV_alternate, "ALTERNATE" );
+
+// Werte von <MARQUEE LOOP=...>
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_LOOP_infinite, "INFINITE" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SPTYPE_block, "BLOCK" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SPTYPE_horizontal, "HORIZONTAL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_SPTYPE_vertical, "VERTICAL" );
+
+
+// interne Grafik-Namen
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_private_image, "private:image/" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_internal_gopher, "internal-gopher-" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_internal_icon, "internal-icon-" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_binary, "binary" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_image, "image" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_index, "index" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_menu, "menu" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_movie, "movie" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_sound, "sound" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_telnet, "telnet" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_text, "text" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_GOPHER_unknown, "unknown" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_ICON_baddata, "baddata" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_ICON_delayed, "delayed" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_ICON_embed, "embed" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_ICON_insecure, "insecure" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_INT_ICON_notfound, "notfound" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_sdendnote, "sdendnote" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_sdendnote_anc, "sdendnoteanc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_sdendnote_sym, "sdendnotesym" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_sdfootnote, "sdfootnote" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_sdfootnote_anc, "sdfootnoteanc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_sdfootnote_sym, "sdfootnotesym" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_FTN_anchor, "anc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_FTN_symbol, "sym" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_WW_off, "OFF" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_WW_hard, "HARD" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_WW_soft, "SOFT" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_WW_virtual, "VIRTUAL" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_WW_physical, "PHYSICAL" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_on, "on" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_ET_url, "application/x-www-form-urlencoded" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_ET_multipart, "multipart/form-data" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sHTML_ET_text, "text/plain" );
diff --git a/svtools/source/svhtml/htmlkywd.cxx b/svtools/source/svhtml/htmlkywd.cxx
new file mode 100644
index 000000000000..cc7ce74e73f4
--- /dev/null
+++ b/svtools/source/svhtml/htmlkywd.cxx
@@ -0,0 +1,1099 @@
+/*************************************************************************
+ *
+ * $RCSfile: htmlkywd.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <ctype.h>
+#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+
+#include <segmentc.hxx>
+
+#include "svparser.hxx"
+#include "htmlkywd.hxx"
+#include "htmltokn.h"
+
+// die Tabelle muss noch sortiert werden
+struct HTML_TokenEntry
+{
+ union
+ {
+ const sal_Char *sToken;
+ const String *pUToken;
+ };
+ int nToken;
+};
+
+// die Farbnamen werden nicht exportiert
+// Sie stammen aus "http://www.uio.no/~mnbjerke/colors_w.html"
+// und scheinen im Gegensatz zu denen aus
+// "http://www.infi.net/wwwimages/colorindex.html"
+// zu stimmen
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_aliceblue, "ALICEBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_antiquewhite, "ANTIQUEWHITE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_aqua, "AQUA" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_aquamarine, "AQUAMARINE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_azure, "AZURE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_beige, "BEIGE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_bisque, "BISQUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_black, "BLACK" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_blanchedalmond, "BLANCHEDALMOND" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_blue, "BLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_blueviolet, "BLUEVIOLET" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_brown, "BROWN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_burlywood, "BURLYWOOD" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_cadetblue, "CADETBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_chartreuse, "CHARTREUSE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_chocolate, "CHOCOLATE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_coral, "CORAL" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_cornflowerblue, "CORNFLOWERBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_cornsilk, "CORNSILK" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_crimson, "CRIMSON" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_cyan, "CYAN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkblue, "DARKBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkcyan, "DARKCYAN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkgoldenrod, "DARKGOLDENROD" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkgray, "DARKGRAY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkgreen, "DARKGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkkhaki, "DARKKHAKI" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkmagenta, "DARKMAGENTA" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkolivegreen, "DARKOLIVEGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkorange, "DARKORANGE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkorchid, "DARKORCHID" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkred, "DARKRED" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darksalmon, "DARKSALMON" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkseagreen, "DARKSEAGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkslateblue, "DARKSLATEBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkslategray, "DARKSLATEGRAY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkturquoise, "DARKTURQUOISE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_darkviolet, "DARKVIOLET" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_deeppink, "DEEPPINK" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_deepskyblue, "DEEPSKYBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_dimgray, "DIMGRAY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_dodgerblue, "DODGERBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_firebrick, "FIREBRICK" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_floralwhite, "FLORALWHITE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_forestgreen, "FORESTGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_fuchsia, "FUCHSIA" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_gainsboro, "GAINSBORO" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_ghostwhite, "GHOSTWHITE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_gold, "GOLD" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_goldenrod, "GOLDENROD" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_gray, "GRAY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_green, "GREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_greenyellow, "GREENYELLOW" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_honeydew, "HONEYDEW" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_hotpink, "HOTPINK" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_indianred, "INDIANRED" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_indigo, "INDIGO" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_ivory, "IVORY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_khaki, "KHAKI" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lavender, "LAVENDER" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lavenderblush, "LAVENDERBLUSH" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lawngreen, "LAWNGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lemonchiffon, "LEMONCHIFFON" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightblue, "LIGHTBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightcoral, "LIGHTCORAL" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightcyan, "LIGHTCYAN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightgoldenrodyellow, "LIGHTGOLDENRODYELLOW" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightgreen, "LIGHTGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightgrey, "LIGHTGREY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightpink, "LIGHTPINK" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightsalmon, "LIGHTSALMON" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightseagreen, "LIGHTSEAGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightskyblue, "LIGHTSKYBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightslategray, "LIGHTSLATEGRAY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightsteelblue, "LIGHTSTEELBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lightyellow, "LIGHTYELLOW" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_lime, "LIME" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_limegreen, "LIMEGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_linen, "LINEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_magenta, "MAGENTA" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_maroon, "MAROON" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumaquamarine, "MEDIUMAQUAMARINE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumblue, "MEDIUMBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumorchid, "MEDIUMORCHID" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumpurple, "MEDIUMPURPLE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumseagreen, "MEDIUMSEAGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumslateblue, "MEDIUMSLATEBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumspringgreen, "MEDIUMSPRINGGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumturquoise, "MEDIUMTURQUOISE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mediumvioletred, "MEDIUMVIOLETRED" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_midnightblue, "MIDNIGHTBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mintcream, "MINTCREAM" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_mistyrose, "MISTYROSE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_moccasin, "MOCCASIN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_navajowhite, "NAVAJOWHITE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_navy, "NAVY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_oldlace, "OLDLACE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_olive, "OLIVE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_olivedrab, "OLIVEDRAB" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_orange, "ORANGE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_orangered, "ORANGERED" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_orchid, "ORCHID" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_palegoldenrod, "PALEGOLDENROD" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_palegreen, "PALEGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_paleturquoise, "PALETURQUOISE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_palevioletred, "PALEVIOLETRED" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_papayawhip, "PAPAYAWHIP" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_peachpuff, "PEACHPUFF" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_peru, "PERU" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_pink, "PINK" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_plum, "PLUM" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_powderblue, "POWDERBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_purple, "PURPLE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_red, "RED" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_rosybrown, "ROSYBROWN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_royalblue, "ROYALBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_saddlebrown, "SADDLEBROWN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_salmon, "SALMON" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_sandybrown, "SANDYBROWN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_seagreen, "SEAGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_seashell, "SEASHELL" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_sienna, "SIENNA" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_silver, "SILVER" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_skyblue, "SKYBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_slateblue, "SLATEBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_slategray, "SLATEGRAY" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_snow, "SNOW" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_springgreen, "SPRINGGREEN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_steelblue, "STEELBLUE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_tan, "TAN" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_teal, "TEAL" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_thistle, "THISTLE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_tomato, "TOMATO" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_turquoise, "TURQUOISE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_violet, "VIOLET" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_wheat, "WHEAT" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_white, "WHITE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_whitesmoke, "WHITESMOKE" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_yellow, "YELLOW" );
+sal_Char __READONLY_DATA SVTOOLS_CONSTASCII_DEF( sHTML_COL_yellowgreen, "YELLOWGREEN" );
+
+
+// Flag: RTF-Token Tabelle wurde schon sortiert
+static int __FAR_DATA bSortKeyWords = FALSE;
+
+static HTML_TokenEntry __FAR_DATA aHTMLTokenTab[] = {
+sHTML_area, HTML_AREA, // Netscape 2.0
+sHTML_base, HTML_BASE, // HTML 3.0
+sHTML_comment, HTML_COMMENT,
+sHTML_doctype, HTML_DOCTYPE,
+sHTML_embed, HTML_EMBED, // Netscape 2.0
+sHTML_figureoverlay,HTML_FIGUREOVERLAY, // HTML 3.0
+sHTML_horzrule, HTML_HORZRULE,
+sHTML_horztab, HTML_HORZTAB, // HTML 3.0
+sHTML_image, HTML_IMAGE,
+sHTML_image2, HTML_IMAGE,
+sHTML_input, HTML_INPUT,
+sHTML_isindex, HTML_ISINDEX, // HTML 3.0
+sHTML_li, HTML_LI_ON,
+sHTML_linebreak, HTML_LINEBREAK,
+sHTML_link, HTML_LINK, // HTML 3.0
+sHTML_meta, HTML_META, // HTML 3.0
+sHTML_nextid, HTML_NEXTID, // HTML 3.0
+sHTML_of, HTML_OF, // HTML 3.0
+sHTML_option, HTML_OPTION,
+sHTML_param, HTML_PARAM, // HotJava
+sHTML_range, HTML_RANGE, // HTML 3.0
+sHTML_spacer, HTML_SPACER, // Netscape 3.0b5
+sHTML_wbr, HTML_WBR, // Netscape
+
+sHTML_abbreviation, HTML_ABBREVIATION_ON, // HTML 3.0
+sHTML_above, HTML_ABOVE_ON, // HTML 3.0
+sHTML_acronym, HTML_ACRONYM_ON, // HTML 3.0
+sHTML_address, HTML_ADDRESS_ON,
+sHTML_anchor, HTML_ANCHOR_ON,
+sHTML_applet, HTML_APPLET_ON, // HotJava
+sHTML_array, HTML_ARRAY_ON, // HTML 3.0
+sHTML_author, HTML_AUTHOR_ON, // HTML 3.0
+sHTML_banner, HTML_BANNER_ON, // HTML 3.0
+sHTML_bar, HTML_BAR_ON, // HTML 3.0
+sHTML_basefont, HTML_BASEFONT_ON, // Netscape
+sHTML_below, HTML_BELOW_ON, // HTML 3.0
+sHTML_bigprint, HTML_BIGPRINT_ON, // HTML 3.0
+sHTML_blink, HTML_BLINK_ON, // Netscape
+sHTML_blockquote, HTML_BLOCKQUOTE_ON,
+sHTML_blockquote30, HTML_BLOCKQUOTE30_ON, // HTML 3.0
+sHTML_body, HTML_BODY_ON,
+sHTML_bold, HTML_BOLD_ON,
+sHTML_boldtext, HTML_BOLDTEXT_ON, // HTML 3.0
+sHTML_box, HTML_BOX_ON, // HTML 3.0
+sHTML_caption, HTML_CAPTION_ON, // HTML 3.0
+sHTML_center, HTML_CENTER_ON, // Netscape
+sHTML_citiation, HTML_CITIATION_ON,
+sHTML_col, HTML_COL_ON, // HTML 3 Table Model Draft
+sHTML_colgroup, HTML_COLGROUP_ON, // HTML 3 Table Model Draft
+sHTML_code, HTML_CODE_ON,
+sHTML_credit, HTML_CREDIT_ON, // HTML 3.0
+sHTML_dd, HTML_DD_ON,
+sHTML_deflist, HTML_DEFLIST_ON,
+sHTML_deletedtext, HTML_DELETEDTEXT_ON, // HTML 3.0
+sHTML_dirlist, HTML_DIRLIST_ON,
+sHTML_division, HTML_DIVISION_ON, // HTML 3.0
+sHTML_dot, HTML_DOT_ON, // HTML 3.0
+sHTML_doubledot, HTML_DOUBLEDOT_ON, // HTML 3.0
+sHTML_dt, HTML_DT_ON,
+sHTML_emphasis, HTML_EMPHASIS_ON,
+sHTML_figure, HTML_FIGURE_ON, // HTML 3.0
+sHTML_font, HTML_FONT_ON, // Netscpe
+sHTML_footnote, HTML_FOOTNOTE_ON, // HTML 3.0
+sHTML_form, HTML_FORM_ON,
+sHTML_frame, HTML_FRAME_ON, // Netscape 2.0
+sHTML_frameset, HTML_FRAMESET_ON, // Netscape 2.0
+sHTML_hat, HTML_HAT_ON, // HTML 3.0
+sHTML_head, HTML_HEAD_ON,
+sHTML_head1, HTML_HEAD1_ON,
+sHTML_head2, HTML_HEAD2_ON,
+sHTML_head3, HTML_HEAD3_ON,
+sHTML_head4, HTML_HEAD4_ON,
+sHTML_head5, HTML_HEAD5_ON,
+sHTML_head6, HTML_HEAD6_ON,
+sHTML_html, HTML_HTML_ON,
+sHTML_iframe, HTML_IFRAME_ON, // IE 3.0b2
+sHTML_ilayer, HTML_ILAYER_ON,
+sHTML_insertedtext, HTML_INSERTEDTEXT_ON, // HTML 3.0
+sHTML_italic, HTML_ITALIC_ON,
+sHTML_item, HTML_ITEM_ON, // HTML 3.0
+sHTML_keyboard, HTML_KEYBOARD_ON,
+sHTML_language, HTML_LANGUAGE_ON, // HTML 3.0
+sHTML_layer, HTML_LAYER_ON,
+sHTML_listheader, HTML_LISTHEADER_ON, // HTML 3.0
+sHTML_map, HTML_MAP_ON, // Netscape 2.0
+sHTML_math, HTML_MATH_ON, // HTML 3.0
+sHTML_menulist, HTML_MENULIST_ON,
+sHTML_multicol, HTML_MULTICOL_ON, // Netscape 3.0b5
+sHTML_nobr, HTML_NOBR_ON, // Netscape
+sHTML_noembed, HTML_NOEMBED_ON, // Netscape 2.0 ???
+sHTML_noframe, HTML_NOFRAMES_ON, // Netscape 2.0 ???
+sHTML_noframes, HTML_NOFRAMES_ON, // Netscape 2.0
+sHTML_noscript, HTML_NOSCRIPT_ON, // Netscape 3.0
+sHTML_note, HTML_NOTE_ON, // HTML 3.0
+sHTML_orderlist, HTML_ORDERLIST_ON,
+sHTML_parabreak, HTML_PARABREAK_ON,
+sHTML_person, HTML_PERSON_ON, // HTML 3.0
+sHTML_plaintext, HTML_PLAINTEXT_ON, // HTML 3.0
+sHTML_preformtxt, HTML_PREFORMTXT_ON,
+sHTML_root, HTML_ROOT_ON, // HTML 3.0
+sHTML_row, HTML_ROW_ON, // HTML 3.0
+sHTML_sample, HTML_SAMPLE_ON,
+sHTML_script, HTML_SCRIPT_ON, // HTML 3.2
+sHTML_select, HTML_SELECT_ON,
+sHTML_shortquote, HTML_SHORTQUOTE_ON, // HTML 3.0
+sHTML_smallprint, HTML_SMALLPRINT_ON, // HTML 3.0
+sHTML_span, HTML_SPAN_ON, // Style Sheets
+sHTML_squareroot, HTML_SQUAREROOT_ON, // HTML 3.0
+sHTML_strikethrough,HTML_STRIKETHROUGH_ON, // HTML 3.0
+sHTML_strong, HTML_STRONG_ON,
+sHTML_style, HTML_STYLE_ON, // HTML 3.0
+sHTML_subscript, HTML_SUBSCRIPT_ON, // HTML 3.0
+sHTML_superscript, HTML_SUPERSCRIPT_ON, // HTML 3.0
+sHTML_table, HTML_TABLE_ON, // HTML 3.0
+sHTML_tabledata, HTML_TABLEDATA_ON, // HTML 3.0
+sHTML_tableheader, HTML_TABLEHEADER_ON, // HTML 3.0
+sHTML_tablerow, HTML_TABLEROW_ON, // HTML 3.0
+sHTML_tbody, HTML_TBODY_ON, // HTML 3 Table Model Draft
+sHTML_teletype, HTML_TELETYPE_ON,
+sHTML_text, HTML_TEXT_ON, // HTML 3.0
+sHTML_textarea, HTML_TEXTAREA_ON,
+sHTML_textflow, HTML_TEXTFLOW_ON,
+sHTML_tfoot, HTML_TFOOT_ON, // HTML 3 Table Model Draft
+sHTML_thead, HTML_THEAD_ON, // HTML 3 Table Model Draft
+sHTML_tilde, HTML_TILDE_ON, // HTML 3.0
+sHTML_title, HTML_TITLE_ON,
+sHTML_underline, HTML_UNDERLINE_ON,
+sHTML_unorderlist, HTML_UNORDERLIST_ON,
+sHTML_variable, HTML_VARIABLE_ON,
+sHTML_vector, HTML_VECTOR_ON, // HTML 3.0
+
+sHTML_xmp, HTML_XMP_ON,
+sHTML_listing, HTML_LISTING_ON,
+
+sHTML_definstance, HTML_DEFINSTANCE_ON,
+sHTML_strike, HTML_STRIKE_ON,
+
+sHTML_bgsound, HTML_BGSOUND,
+sHTML_comment2, HTML_COMMENT2_ON,
+sHTML_marquee, HTML_MARQUEE_ON,
+sHTML_plaintext2, HTML_PLAINTEXT2_ON,
+
+sHTML_sdfield, HTML_SDFIELD_ON,
+};
+
+
+extern "C"
+{
+
+static int
+#if defined( WNT )
+ __cdecl
+#endif
+#if defined( ICC ) && defined( OS2 )
+ _Optlink
+#endif
+ HTMLKeyCompare( const void *pFirst, const void *pSecond)
+{
+ int nRet = 0;
+ if( -1 == ((HTML_TokenEntry*)pFirst)->nToken )
+ {
+ if( -1 == ((HTML_TokenEntry*)pSecond)->nToken )
+ nRet = ((HTML_TokenEntry*)pFirst)->pUToken->CompareTo(
+ *((HTML_TokenEntry*)pSecond)->pUToken );
+ else
+ nRet = ((HTML_TokenEntry*)pFirst)->pUToken->CompareToAscii(
+ ((HTML_TokenEntry*)pSecond)->sToken );
+ }
+ else
+ {
+ if( -1 == ((HTML_TokenEntry*)pSecond)->nToken )
+ nRet = -1 * ((HTML_TokenEntry*)pSecond)->pUToken->CompareToAscii(
+ ((HTML_TokenEntry*)pFirst)->sToken );
+ else
+ nRet = strcmp( ((HTML_TokenEntry*)pFirst)->sToken,
+ ((HTML_TokenEntry*)pSecond)->sToken );
+ }
+
+ return nRet;
+}
+
+}
+
+int GetHTMLToken( const String& rName )
+{
+ if( !bSortKeyWords )
+ {
+ qsort( (void*) aHTMLTokenTab,
+ sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ),
+ sizeof( HTML_TokenEntry ),
+ HTMLKeyCompare );
+ bSortKeyWords = TRUE;
+ }
+
+ int nRet = 0;
+
+ if( !rName.CompareToAscii( sHTML_comment, 3UL) )
+ return HTML_COMMENT;
+
+ void* pFound;
+ HTML_TokenEntry aSrch;
+ aSrch.pUToken = &rName;
+ aSrch.nToken = -1;
+
+ if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch,
+ (void*) aHTMLTokenTab,
+ sizeof( aHTMLTokenTab ) / sizeof( HTML_TokenEntry ),
+ sizeof( HTML_TokenEntry ),
+ HTMLKeyCompare )))
+ nRet = ((HTML_TokenEntry*)pFound)->nToken;
+ return nRet;
+}
+
+/* */
+
+struct HTML_CharEntry
+{
+ union
+ {
+ const sal_Char *sName;
+ const String *pUName;
+ };
+ sal_Unicode cChar;
+};
+
+// Flag: RTF-Token Tabelle wurde schon sortiert
+static int __FAR_DATA bSortCharKeyWords = FALSE;
+
+static HTML_CharEntry __FAR_DATA aHTMLCharNameTab[] = {
+sHTML_C_lt, 60,
+sHTML_C_gt, 62,
+sHTML_C_amp, 38,
+sHTML_C_quot, 34,
+
+sHTML_C_Agrave, 192,
+sHTML_C_Aacute, 193,
+sHTML_C_Acirc, 194,
+sHTML_C_Atilde, 195,
+sHTML_C_Auml, 196,
+sHTML_C_Aring, 197,
+sHTML_C_AElig, 198,
+sHTML_C_Ccedil, 199,
+sHTML_C_Egrave, 200,
+sHTML_C_Eacute, 201,
+sHTML_C_Ecirc, 202,
+sHTML_C_Euml, 203,
+sHTML_C_Igrave, 204,
+sHTML_C_Iacute, 205,
+sHTML_C_Icirc, 206,
+sHTML_C_Iuml, 207,
+sHTML_C_ETH, 208,
+sHTML_C_Ntilde, 209,
+sHTML_C_Ograve, 210,
+sHTML_C_Oacute, 211,
+sHTML_C_Ocirc, 212,
+sHTML_C_Otilde, 213,
+sHTML_C_Ouml, 214,
+sHTML_C_Oslash, 216,
+sHTML_C_Ugrave, 217,
+sHTML_C_Uacute, 218,
+sHTML_C_Ucirc, 219,
+sHTML_C_Uuml, 220,
+sHTML_C_Yacute, 221,
+
+sHTML_C_THORN, 222,
+sHTML_C_szlig, 223,
+
+sHTML_S_agrave, 224,
+sHTML_S_aacute, 225,
+sHTML_S_acirc, 226,
+sHTML_S_atilde, 227,
+sHTML_S_auml, 228,
+sHTML_S_aring, 229,
+sHTML_S_aelig, 230,
+sHTML_S_ccedil, 231,
+sHTML_S_egrave, 232,
+sHTML_S_eacute, 233,
+sHTML_S_ecirc, 234,
+sHTML_S_euml, 235,
+sHTML_S_igrave, 236,
+sHTML_S_iacute, 237,
+sHTML_S_icirc, 238,
+sHTML_S_iuml, 239,
+sHTML_S_eth, 240,
+sHTML_S_ntilde, 241,
+sHTML_S_ograve, 242,
+sHTML_S_oacute, 243,
+sHTML_S_ocirc, 244,
+sHTML_S_otilde, 245,
+sHTML_S_ouml, 246,
+sHTML_S_oslash, 248,
+sHTML_S_ugrave, 249,
+sHTML_S_uacute, 250,
+sHTML_S_ucirc, 251,
+sHTML_S_uuml, 252,
+sHTML_S_yacute, 253,
+sHTML_S_thorn, 254,
+sHTML_S_yuml, 255,
+
+// Sonderzeichen
+sHTML_S_acute, 180,
+sHTML_S_brvbar, 166,
+sHTML_S_cedil, 184,
+sHTML_S_cent, 162,
+sHTML_S_copy, 169,
+sHTML_S_curren, 164,
+sHTML_S_deg, 176,
+sHTML_S_divide, 247,
+sHTML_S_frac12, 189,
+sHTML_S_frac14, 188,
+sHTML_S_frac34, 190,
+sHTML_S_iexcl, 161,
+sHTML_S_iquest, 191,
+sHTML_S_laquo, 171,
+sHTML_S_macr, 175,
+sHTML_S_micro, 181,
+sHTML_S_middot, 183,
+sHTML_S_not, 172,
+sHTML_S_ordf, 170,
+sHTML_S_ordm, 186,
+sHTML_S_para, 182,
+sHTML_S_plusmn, 177,
+sHTML_S_pound, 163,
+sHTML_S_raquo, 187,
+sHTML_S_reg, 174,
+sHTML_S_sect, 167,
+sHTML_S_sup1, 185,
+sHTML_S_sup2, 178,
+sHTML_S_sup3, 179,
+sHTML_S_times, 215,
+sHTML_S_uml, 168,
+sHTML_S_yen, 165,
+
+// Netscape kennt noch ein paar in Grossbuchstaben ...
+sHTML_C_LT, 60,
+sHTML_C_GT, 62,
+sHTML_C_AMP, 38,
+sHTML_C_QUOT, 34,
+sHTML_S_COPY, 169,
+sHTML_S_REG, 174,
+
+// Sonderzeichen, die zu Tokens konvertiert werden !!!
+sHTML_S_nbsp, 1,
+sHTML_S_shy, 2,
+};
+
+extern "C"
+{
+
+static int
+#if defined( WNT )
+ __cdecl
+#endif
+#if defined( ICC ) && defined( OS2 )
+ _Optlink
+#endif
+ HTMLCharNameCompare( const void *pFirst, const void *pSecond)
+{
+ int nRet = 0;
+ if( USHRT_MAX == ((HTML_CharEntry*)pFirst)->cChar )
+ {
+ if( USHRT_MAX == ((HTML_CharEntry*)pSecond)->cChar )
+ nRet = ((HTML_CharEntry*)pFirst)->pUName->CompareTo(
+ *((HTML_CharEntry*)pSecond)->pUName );
+ else
+ nRet = ((HTML_CharEntry*)pFirst)->pUName->CompareToAscii(
+ ((HTML_CharEntry*)pSecond)->sName );
+ }
+ else
+ {
+ if( USHRT_MAX == ((HTML_CharEntry*)pSecond)->cChar )
+ nRet = -1 * ((HTML_CharEntry*)pSecond)->pUName->CompareToAscii(
+ ((HTML_CharEntry*)pFirst)->sName );
+ else
+ nRet = strcmp( ((HTML_CharEntry*)pFirst)->sName,
+ ((HTML_CharEntry*)pSecond)->sName );
+ }
+
+ return nRet;
+}
+
+}
+
+sal_Unicode GetHTMLCharName( const String& rName )
+{
+ if( !bSortCharKeyWords )
+ {
+ qsort( (void*) aHTMLCharNameTab,
+ sizeof( aHTMLCharNameTab ) / sizeof( HTML_CharEntry ),
+ sizeof( HTML_CharEntry ),
+ HTMLCharNameCompare );
+ bSortCharKeyWords = TRUE;
+ }
+
+ sal_Unicode cRet = 0;
+ void* pFound;
+ HTML_CharEntry aSrch;
+ aSrch.pUName = &rName;
+ aSrch.cChar = USHRT_MAX;
+
+ if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch,
+ (void*) aHTMLCharNameTab,
+ sizeof( aHTMLCharNameTab) / sizeof( HTML_CharEntry ),
+ sizeof( HTML_CharEntry ),
+ HTMLCharNameCompare )))
+ cRet = ((HTML_CharEntry*)pFound)->cChar;
+ return cRet;
+}
+
+/* */
+
+// Flag: Optionen-Tabelle wurde schon sortiert
+static int __FAR_DATA bSortOptionKeyWords = FALSE;
+
+static HTML_TokenEntry __FAR_DATA aHTMLOptionTab[] = {
+
+// Attribute ohne Wert
+sHTML_O_box, HTML_O_BOX,
+sHTML_O_checked, HTML_O_CHECKED,
+sHTML_O_compact, HTML_O_COMPACT,
+sHTML_O_continue, HTML_O_CONTINUE,
+sHTML_O_controls, HTML_O_CONTROLS, // IExplorer 2.0
+sHTML_O_declare, HTML_O_DECLARE,
+sHTML_O_disabled, HTML_O_DISABLED,
+sHTML_O_folded, HTML_O_FOLDED, // Netscape internal
+sHTML_O_ismap, HTML_O_ISMAP,
+sHTML_O_mayscript, HTML_O_MAYSCRIPT,
+sHTML_O_multiple, HTML_O_MULTIPLE,
+sHTML_O_noflow, HTML_O_NOFLOW,
+sHTML_O_nohref, HTML_O_NOHREF, // Netscape 2.0
+sHTML_O_noresize, HTML_O_NORESIZE, // Netscape 2.0
+sHTML_O_noshade, HTML_O_NOSHADE, // Netscape 2.0
+sHTML_O_nowrap, HTML_O_NOWRAP,
+sHTML_O_plain, HTML_O_PLAIN,
+sHTML_O_sdfixed, HTML_O_SDFIXED,
+sHTML_O_selected, HTML_O_SELECTED,
+sHTML_O_shapes, HTML_O_SHAPES,
+
+// Attribute mit einem String als Wert
+sHTML_O_above, HTML_O_ABOVE,
+sHTML_O_accept, HTML_O_ACCEPT,
+sHTML_O_accesskey, HTML_O_ACCESSKEY,
+sHTML_O_add_date, HTML_O_ADD_DATE, // Netscape internal
+sHTML_O_alt, HTML_O_ALT,
+sHTML_O_axes, HTML_O_AXES,
+sHTML_O_axis, HTML_O_AXIS,
+sHTML_O_below, HTML_O_BELOW,
+sHTML_O_char, HTML_O_CHAR, // HTML 3 Table Model Draft
+sHTML_O_class, HTML_O_CLASS,
+sHTML_O_clip, HTML_O_CLIP,
+sHTML_O_code, HTML_O_CODE, // HotJava
+sHTML_O_codetype, HTML_O_CODETYPE,
+sHTML_O_colspec, HTML_O_COLSPEC,
+sHTML_O_content, HTML_O_CONTENT,
+sHTML_O_coords, HTML_O_COORDS, // Netscape 2.0
+sHTML_O_dp, HTML_O_DP,
+sHTML_O_enctype, HTML_O_ENCTYPE,
+sHTML_O_error, HTML_O_ERROR,
+sHTML_O_face, HTML_O_FACE, // IExplorer 2.0
+sHTML_O_frameborder, HTML_O_FRAMEBORDER, // IExplorer 3.0
+sHTML_O_httpequiv, HTML_O_HTTPEQUIV,
+sHTML_O_language, HTML_O_LANGUAGE, // JavaScript
+sHTML_O_last_modified, HTML_O_LAST_MODIFIED, // Netscape internal
+sHTML_O_last_visit, HTML_O_LAST_VISIT, // Netscape internal
+sHTML_O_md, HTML_O_MD,
+sHTML_O_n, HTML_O_N,
+sHTML_O_name, HTML_O_NAME,
+sHTML_O_notation, HTML_O_NOTATION,
+sHTML_O_prompt, HTML_O_PROMPT,
+sHTML_O_shape, HTML_O_SHAPE,
+sHTML_O_standby, HTML_O_STANDBY,
+sHTML_O_style, HTML_O_STYLE,
+sHTML_O_title, HTML_O_TITLE,
+sHTML_O_value, HTML_O_VALUE,
+sHTML_O_SDval, HTML_O_SDVAL, // StarDiv NumberValue
+sHTML_O_SDnum, HTML_O_SDNUM, // StarDiv NumberFormat
+sHTML_O_sdlibrary, HTML_O_SDLIBRARY,
+sHTML_O_sdmodule, HTML_O_SDMODULE,
+
+// Attribute mit einem SGML-Identifier als Wert
+sHTML_O_from, HTML_O_FROM,
+sHTML_O_id, HTML_O_ID,
+sHTML_O_target, HTML_O_TARGET, // Netscape 2.0
+sHTML_O_to, HTML_O_TO,
+sHTML_O_until, HTML_O_UNTIL,
+
+// Attribute mit einem URI als Wert
+sHTML_O_action, HTML_O_ACTION,
+sHTML_O_background, HTML_O_BACKGROUND,
+sHTML_O_classid, HTML_O_CLASSID,
+sHTML_O_codebase, HTML_O_CODEBASE, // HotJava
+sHTML_O_data, HTML_O_DATA,
+sHTML_O_dynsrc, HTML_O_DYNSRC, // IExplorer 3.0b1
+sHTML_O_dynsync, HTML_O_DYNSYNC, // IExplorer 2.0
+sHTML_O_imagemap, HTML_O_IMAGEMAP,
+sHTML_O_href, HTML_O_HREF,
+sHTML_O_lowsrc, HTML_O_LOWSRC, // Netscape 3.0
+sHTML_O_script, HTML_O_SCRIPT,
+sHTML_O_src, HTML_O_SRC,
+sHTML_O_usemap, HTML_O_USEMAP, // Netscape 2.0
+
+// Attribute mit Entity-Namen als Wert
+sHTML_O_dingbat, HTML_O_DINGBAT,
+sHTML_O_sym, HTML_O_SYM,
+
+// Attribute mit einer Farbe als Wert (alle Netscape)
+sHTML_O_alink, HTML_O_ALINK,
+sHTML_O_bgcolor, HTML_O_BGCOLOR,
+sHTML_O_bordercolor, HTML_O_BORDERCOLOR, // IExplorer 2.0
+sHTML_O_bordercolorlight, HTML_O_BORDERCOLORLIGHT, // IExplorer 2.0
+sHTML_O_bordercolordark, HTML_O_BORDERCOLORDARK, // IExplorer 2.0
+sHTML_O_color, HTML_O_COLOR,
+sHTML_O_link, HTML_O_LINK,
+sHTML_O_text, HTML_O_TEXT,
+sHTML_O_vlink, HTML_O_VLINK,
+
+// Attribute mit einem numerischen Wert
+sHTML_O_border, HTML_O_BORDER,
+sHTML_O_cellspacing,HTML_O_CELLSPACING, // HTML 3 Table Model Draft
+sHTML_O_cellpadding,HTML_O_CELLPADDING, // HTML 3 Table Model Draft
+sHTML_O_charoff, HTML_O_CHAROFF, // HTML 3 Table Model Draft
+sHTML_O_colspan, HTML_O_COLSPAN,
+sHTML_O_framespacing, HTML_O_FRAMESPACING, // IExplorer 3.0
+sHTML_O_gutter, HTML_O_GUTTER, // Netscape 3.0b5
+sHTML_O_indent, HTML_O_INDENT,
+sHTML_O_height, HTML_O_HEIGHT,
+sHTML_O_hspace, HTML_O_HSPACE, // Netscape
+sHTML_O_left, HTML_O_LEFT,
+sHTML_O_leftmargin, HTML_O_LEFTMARGIN, // IExplorer 2.0
+sHTML_O_loop, HTML_O_LOOP, // IExplorer 2.0
+sHTML_O_marginheight,HTML_O_MARGINHEIGHT, // Netscape 2.0
+sHTML_O_marginwidth,HTML_O_MARGINWIDTH, // Netscape 2.0
+sHTML_O_max, HTML_O_MAX,
+sHTML_O_maxlength, HTML_O_MAXLENGTH,
+sHTML_O_min, HTML_O_MIN,
+sHTML_O_pagex, HTML_O_PAGEX,
+sHTML_O_pagey, HTML_O_PAGEY,
+sHTML_O_pointsize, HTML_O_POINTSIZE,
+sHTML_O_rowspan, HTML_O_ROWSPAN,
+sHTML_O_scrollamount, HTML_O_SCROLLAMOUNT, // IExplorer 2.0
+sHTML_O_scrolldelay, HTML_O_SCROLLDELAY, // IExplorer 2.0
+sHTML_O_seqnum, HTML_O_SEQNUM,
+sHTML_O_skip, HTML_O_SKIP,
+sHTML_O_span, HTML_O_SPAN, // HTML 3 Table Model Draft
+sHTML_O_tabindex, HTML_O_TABINDEX,
+sHTML_O_top, HTML_O_TOP,
+sHTML_O_topmargin, HTML_O_TOPMARGIN, // IExplorer 2.0
+sHTML_O_vspace, HTML_O_VSPACE, // Netscape
+sHTML_O_weight, HTML_O_WEIGHT,
+sHTML_O_width, HTML_O_WIDTH,
+sHTML_O_x, HTML_O_X,
+sHTML_O_y, HTML_O_Y,
+sHTML_O_zindex, HTML_O_ZINDEX,
+
+// Attribute mit Enum-Werten
+sHTML_O_bgproperties, HTML_O_BGPROPERTIES, // IExplorer 2.0
+sHTML_O_behavior, HTML_O_BEHAVIOR, // IExplorer 2.0
+sHTML_O_clear, HTML_O_CLEAR,
+sHTML_O_dir, HTML_O_DIR, // HTML 3 Table Model Draft
+sHTML_O_direction, HTML_O_DIRECTION, // IExplorer 2.0
+sHTML_O_format, HTML_O_FORMAT,
+sHTML_O_frame, HTML_O_FRAME, // HTML 3 Table Model Draft
+sHTML_O_lang, HTML_O_LANG,
+sHTML_O_method, HTML_O_METHOD,
+sHTML_O_palette, HTML_O_PALETTE,
+sHTML_O_rel, HTML_O_REL,
+sHTML_O_rev, HTML_O_REV,
+sHTML_O_rules, HTML_O_RULES, // HTML 3 Table Model Draft
+sHTML_O_scrolling, HTML_O_SCROLLING, // Netscape 2.0
+sHTML_O_sdreadonly, HTML_O_SDREADONLY,
+sHTML_O_subtype, HTML_O_SUBTYPE,
+sHTML_O_type, HTML_O_TYPE,
+sHTML_O_valign, HTML_O_VALIGN,
+sHTML_O_valuetype, HTML_O_VALUETYPE,
+sHTML_O_wrap, HTML_O_WRAP,
+sHTML_O_visibility, HTML_O_VISIBILITY,
+
+// Attribute mit Script-Code als Wert
+sHTML_O_onblur, HTML_O_ONBLUR, // JavaScript
+sHTML_O_onchange, HTML_O_ONCHANGE, // JavaScript
+sHTML_O_onclick, HTML_O_ONCLICK, // JavaScript
+sHTML_O_onfocus, HTML_O_ONFOCUS, // JavaScript
+sHTML_O_onload, HTML_O_ONLOAD, // JavaScript
+sHTML_O_onmouseover, HTML_O_ONMOUSEOVER, // JavaScript
+sHTML_O_onreset, HTML_O_ONRESET, // JavaScript
+sHTML_O_onselect, HTML_O_ONSELECT, // JavaScript
+sHTML_O_onsubmit, HTML_O_ONSUBMIT, // JavaScript
+sHTML_O_onunload, HTML_O_ONUNLOAD, // JavaScript
+sHTML_O_onabort, HTML_O_ONABORT, // JavaScript
+sHTML_O_onerror, HTML_O_ONERROR, // JavaScript
+sHTML_O_onmouseout, HTML_O_ONMOUSEOUT, // JavaScript
+
+sHTML_O_SDonblur, HTML_O_SDONBLUR, // StarBasic
+sHTML_O_SDonchange, HTML_O_SDONCHANGE, // StarBasic
+sHTML_O_SDonclick, HTML_O_SDONCLICK, // StarBasic
+sHTML_O_SDonfocus, HTML_O_SDONFOCUS, // StarBasic
+sHTML_O_SDonload, HTML_O_SDONLOAD, // StarBasic
+sHTML_O_SDonmouseover, HTML_O_SDONMOUSEOVER, // StarBasic
+sHTML_O_SDonreset, HTML_O_SDONRESET, // StarBasic
+sHTML_O_SDonselect, HTML_O_SDONSELECT, // StarBasic
+sHTML_O_SDonsubmit, HTML_O_SDONSUBMIT, // StarBasic
+sHTML_O_SDonunload, HTML_O_SDONUNLOAD, // StarBasic
+sHTML_O_SDonabort, HTML_O_SDONABORT, // StarBasic
+sHTML_O_SDonerror, HTML_O_SDONERROR, // StarBasic
+sHTML_O_SDonmouseout, HTML_O_SDONMOUSEOUT, // StarBasic
+
+// Attribute mit Kontext-abhaengigen Werten
+sHTML_O_align, HTML_O_ALIGN,
+sHTML_O_cols, HTML_O_COLS, // Netscape 2.0 vs HTML 2.0
+sHTML_O_rows, HTML_O_ROWS, // Netscape 2.0 vs HTML 2.0
+sHTML_O_size, HTML_O_SIZE,
+sHTML_O_start, HTML_O_START, // Netscape 2.0 vs IExplorer 2.0
+sHTML_O_units, HTML_O_UNITS
+};
+
+int GetHTMLOption( const String& rName )
+{
+ if( !bSortOptionKeyWords )
+ {
+ qsort( (void*) aHTMLOptionTab,
+ sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ),
+ sizeof( HTML_TokenEntry ),
+ HTMLKeyCompare );
+ bSortOptionKeyWords = TRUE;
+ }
+
+ int nRet = HTML_O_UNKNOWN;
+ void* pFound;
+ HTML_TokenEntry aSrch;
+ aSrch.pUToken = &rName;
+ aSrch.nToken = -1;
+
+ if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch,
+ (void*) aHTMLOptionTab,
+ sizeof( aHTMLOptionTab ) / sizeof( HTML_TokenEntry ),
+ sizeof( HTML_TokenEntry ),
+ HTMLKeyCompare )))
+ nRet = ((HTML_TokenEntry*)pFound)->nToken;
+ return nRet;
+}
+
+/* */
+
+// Flag: Farb-Tabelle wurde schon sortiert
+struct HTML_ColorEntry
+{
+ union
+ {
+ const sal_Char* sName;
+ const String *pUName;
+ };
+ ULONG nColor;
+};
+
+static int __FAR_DATA bSortColorKeyWords = FALSE;
+
+#define HTML_NO_COLOR 0xffffffffUL
+
+static HTML_ColorEntry __FAR_DATA aHTMLColorNameTab[] = {
+sHTML_COL_aliceblue, 0x00f0f8ffUL,
+sHTML_COL_antiquewhite, 0x00faebd7UL,
+sHTML_COL_aqua, 0x0000ffffUL,
+sHTML_COL_aquamarine, 0x007fffd4UL,
+sHTML_COL_azure, 0x00f0ffffUL,
+sHTML_COL_beige, 0x00f5f5dcUL,
+sHTML_COL_bisque, 0x00ffe4c4UL,
+sHTML_COL_black, 0x00000000UL,
+sHTML_COL_blanchedalmond, 0x00ffebcdUL,
+sHTML_COL_blue, 0x000000ffUL,
+sHTML_COL_blueviolet, 0x008a2be2UL,
+sHTML_COL_brown, 0x00a52a2aUL,
+sHTML_COL_burlywood, 0x00deb887UL,
+sHTML_COL_cadetblue, 0x005f9ea0UL,
+sHTML_COL_chartreuse, 0x007fff00UL,
+sHTML_COL_chocolate, 0x00d2691eUL,
+sHTML_COL_coral, 0x00ff7f50UL,
+sHTML_COL_cornflowerblue, 0x006495edUL,
+sHTML_COL_cornsilk, 0x00fff8dcUL,
+sHTML_COL_crimson, 0x00dc143cUL,
+sHTML_COL_cyan, 0x0000ffffUL,
+sHTML_COL_darkblue, 0x0000008bUL,
+sHTML_COL_darkcyan, 0x00008b8bUL,
+sHTML_COL_darkgoldenrod, 0x00b8860bUL,
+sHTML_COL_darkgray, 0x00a9a9a9UL,
+sHTML_COL_darkgreen, 0x00006400UL,
+sHTML_COL_darkkhaki, 0x00bdb76bUL,
+sHTML_COL_darkmagenta, 0x008b008bUL,
+sHTML_COL_darkolivegreen, 0x00556b2fUL,
+sHTML_COL_darkorange, 0x00ff8c00UL,
+sHTML_COL_darkorchid, 0x009932ccUL,
+sHTML_COL_darkred, 0x008b0000UL,
+sHTML_COL_darksalmon, 0x00e9967aUL,
+sHTML_COL_darkseagreen, 0x008fbc8fUL,
+sHTML_COL_darkslateblue, 0x00483d8bUL,
+sHTML_COL_darkslategray, 0x002f4f4fUL,
+sHTML_COL_darkturquoise, 0x0000ced1UL,
+sHTML_COL_darkviolet, 0x009400d3UL,
+sHTML_COL_deeppink, 0x00ff1493UL,
+sHTML_COL_deepskyblue, 0x0000bfffUL,
+sHTML_COL_dimgray, 0x00696969UL,
+sHTML_COL_dodgerblue, 0x001e90ffUL,
+sHTML_COL_firebrick, 0x00b22222UL,
+sHTML_COL_floralwhite, 0x00fffaf0UL,
+sHTML_COL_forestgreen, 0x00228b22UL,
+sHTML_COL_fuchsia, 0x00ff00ffUL,
+sHTML_COL_gainsboro, 0x00dcdcdcUL,
+sHTML_COL_ghostwhite, 0x00f8f8ffUL,
+sHTML_COL_gold, 0x00ffd700UL,
+sHTML_COL_goldenrod, 0x00daa520UL,
+sHTML_COL_gray, 0x00808080UL,
+sHTML_COL_green, 0x00008000UL,
+sHTML_COL_greenyellow, 0x00adff2fUL,
+sHTML_COL_honeydew, 0x00f0fff0UL,
+sHTML_COL_hotpink, 0x00ff69b4UL,
+sHTML_COL_indianred, 0x00cd5c5cUL,
+sHTML_COL_indigo, 0x004b0082UL,
+sHTML_COL_ivory, 0x00fffff0UL,
+sHTML_COL_khaki, 0x00f0e68cUL,
+sHTML_COL_lavender, 0x00e6e6faUL,
+sHTML_COL_lavenderblush, 0x00fff0f5UL,
+sHTML_COL_lawngreen, 0x007cfc00UL,
+sHTML_COL_lemonchiffon, 0x00fffacdUL,
+sHTML_COL_lightblue, 0x00add8e6UL,
+sHTML_COL_lightcoral, 0x00f08080UL,
+sHTML_COL_lightcyan, 0x00e0ffffUL,
+sHTML_COL_lightgoldenrodyellow, 0x00fafad2UL,
+sHTML_COL_lightgreen, 0x0090ee90UL,
+sHTML_COL_lightgrey, 0x00d3d3d3UL,
+sHTML_COL_lightpink, 0x00ffb6c1UL,
+sHTML_COL_lightsalmon, 0x00ffa07aUL,
+sHTML_COL_lightseagreen, 0x0020b2aaUL,
+sHTML_COL_lightskyblue, 0x0087cefaUL,
+sHTML_COL_lightslategray, 0x00778899UL,
+sHTML_COL_lightsteelblue, 0x00b0c4deUL,
+sHTML_COL_lightyellow, 0x00ffffe0UL,
+sHTML_COL_lime, 0x0000ff00UL,
+sHTML_COL_limegreen, 0x0032cd32UL,
+sHTML_COL_linen, 0x00faf0e6UL,
+sHTML_COL_magenta, 0x00ff00ffUL,
+sHTML_COL_maroon, 0x00800000UL,
+sHTML_COL_mediumaquamarine, 0x0066cdaaUL,
+sHTML_COL_mediumblue, 0x000000cdUL,
+sHTML_COL_mediumorchid, 0x00ba55d3UL,
+sHTML_COL_mediumpurple, 0x009370dbUL,
+sHTML_COL_mediumseagreen, 0x003cb371UL,
+sHTML_COL_mediumslateblue, 0x007b68eeUL,
+sHTML_COL_mediumspringgreen, 0x0000fa9aUL,
+sHTML_COL_mediumturquoise, 0x0048d1ccUL,
+sHTML_COL_mediumvioletred, 0x00c71585UL,
+sHTML_COL_midnightblue, 0x00191970UL,
+sHTML_COL_mintcream, 0x00f5fffaUL,
+sHTML_COL_mistyrose, 0x00ffe4e1UL,
+sHTML_COL_moccasin, 0x00ffe4b5UL,
+sHTML_COL_navajowhite, 0x00ffdeadUL,
+sHTML_COL_navy, 0x00000080UL,
+sHTML_COL_oldlace, 0x00fdf5e6UL,
+sHTML_COL_olive, 0x00808000UL,
+sHTML_COL_olivedrab, 0x006b8e23UL,
+sHTML_COL_orange, 0x00ffa500UL,
+sHTML_COL_orangered, 0x00ff4500UL,
+sHTML_COL_orchid, 0x00da70d6UL,
+sHTML_COL_palegoldenrod, 0x00eee8aaUL,
+sHTML_COL_palegreen, 0x0098fb98UL,
+sHTML_COL_paleturquoise, 0x00afeeeeUL,
+sHTML_COL_palevioletred, 0x00db7093UL,
+sHTML_COL_papayawhip, 0x00ffefd5UL,
+sHTML_COL_peachpuff, 0x00ffdab9UL,
+sHTML_COL_peru, 0x00cd853fUL,
+sHTML_COL_pink, 0x00ffc0cbUL,
+sHTML_COL_plum, 0x00dda0ddUL,
+sHTML_COL_powderblue, 0x00b0e0e6UL,
+sHTML_COL_purple, 0x00800080UL,
+sHTML_COL_red, 0x00ff0000UL,
+sHTML_COL_rosybrown, 0x00bc8f8fUL,
+sHTML_COL_royalblue, 0x004169e1UL,
+sHTML_COL_saddlebrown, 0x008b4513UL,
+sHTML_COL_salmon, 0x00fa8072UL,
+sHTML_COL_sandybrown, 0x00f4a460UL,
+sHTML_COL_seagreen, 0x002e8b57UL,
+sHTML_COL_seashell, 0x00fff5eeUL,
+sHTML_COL_sienna, 0x00a0522dUL,
+sHTML_COL_silver, 0x00c0c0c0UL,
+sHTML_COL_skyblue, 0x0087ceebUL,
+sHTML_COL_slateblue, 0x006a5acdUL,
+sHTML_COL_slategray, 0x00708090UL,
+sHTML_COL_snow, 0x00fffafaUL,
+sHTML_COL_springgreen, 0x0000ff7fUL,
+sHTML_COL_steelblue, 0x004682b4UL,
+sHTML_COL_tan, 0x00d2b48cUL,
+sHTML_COL_teal, 0x00008080UL,
+sHTML_COL_thistle, 0x00d8bfd8UL,
+sHTML_COL_tomato, 0x00ff6347UL,
+sHTML_COL_turquoise, 0x0040e0d0UL,
+sHTML_COL_violet, 0x00ee82eeUL,
+sHTML_COL_wheat, 0x00f5deb3UL,
+sHTML_COL_white, 0x00ffffffUL,
+sHTML_COL_whitesmoke, 0x00f5f5f5UL,
+sHTML_COL_yellow, 0x00ffff00UL,
+sHTML_COL_yellowgreen, 0x009acd32UL
+};
+
+extern "C"
+{
+
+static int
+#if defined( WNT )
+ __cdecl
+#endif
+#if defined( ICC ) && defined( OS2 )
+ _Optlink
+#endif
+ HTMLColorNameCompare( const void *pFirst, const void *pSecond)
+{
+ int nRet = 0;
+ if( HTML_NO_COLOR == ((HTML_ColorEntry*)pFirst)->nColor )
+ {
+ if( HTML_NO_COLOR == ((HTML_ColorEntry*)pSecond)->nColor )
+ nRet = ((HTML_ColorEntry*)pFirst)->pUName->CompareTo(
+ *((HTML_ColorEntry*)pSecond)->pUName );
+ else
+ nRet = ((HTML_ColorEntry*)pFirst)->pUName->CompareToAscii(
+ ((HTML_ColorEntry*)pSecond)->sName );
+ }
+ else
+ {
+ if( HTML_NO_COLOR == ((HTML_ColorEntry*)pSecond)->nColor )
+ nRet = -1 * ((HTML_ColorEntry*)pSecond)->pUName->CompareToAscii(
+ ((HTML_ColorEntry*)pFirst)->sName );
+ else
+ nRet = strcmp( ((HTML_ColorEntry*)pFirst)->sName,
+ ((HTML_ColorEntry*)pSecond)->sName );
+ }
+
+ return nRet;
+}
+
+}
+
+ULONG GetHTMLColor( const String& rName )
+{
+ if( !bSortColorKeyWords )
+ {
+ qsort( (void*) aHTMLColorNameTab,
+ sizeof( aHTMLColorNameTab ) / sizeof( HTML_ColorEntry ),
+ sizeof( HTML_ColorEntry ),
+ HTMLColorNameCompare );
+ bSortColorKeyWords = TRUE;
+ }
+
+ ULONG nRet = ULONG_MAX;
+ void* pFound;
+ HTML_ColorEntry aSrch;
+ aSrch.pUName = &rName;
+ aSrch.nColor = HTML_NO_COLOR;
+
+ if( 0 != ( pFound = bsearch( (sal_Char *) &aSrch,
+ (void*) aHTMLColorNameTab,
+ sizeof( aHTMLColorNameTab) / sizeof( HTML_ColorEntry ),
+ sizeof( HTML_ColorEntry ),
+ HTMLColorNameCompare )))
+ nRet = ((HTML_ColorEntry*)pFound)->nColor;
+
+ return nRet;
+}
+
diff --git a/svtools/source/svhtml/htmlout.cxx b/svtools/source/svhtml/htmlout.cxx
new file mode 100644
index 000000000000..a30e2ec175de
--- /dev/null
+++ b/svtools/source/svhtml/htmlout.cxx
@@ -0,0 +1,708 @@
+/*************************************************************************
+ *
+ * $RCSfile: htmlout.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <tools/urlobj.hxx>
+
+#ifndef _ZFORMAT_HXX //autogen
+#include <zformat.hxx>
+#endif
+
+#ifndef _SFXMACITEM_HXX
+#include <macitem.hxx>
+#endif
+#ifndef _CACHESTR_HXX //autogen
+#include <tools/cachestr.hxx>
+#endif
+#ifndef _SV_SYSTEM_HXX //autogen
+#include <vcl/system.hxx>
+#endif
+
+#ifndef _ZFORLIST_HXX //autogen
+#include <zforlist.hxx>
+#endif
+
+#ifndef _SV_CLIP_HXX //autogen
+#include <vcl/clip.hxx>
+#endif
+
+#include "htmlout.hxx"
+#include "htmlkywd.hxx"
+#include "imap.hxx"
+#include "imaprect.hxx"
+#include "imapcirc.hxx"
+#include "imappoly.hxx"
+
+#ifndef RTL_CONSTASCII_STRINGPARAM
+#define RTL_CONSTASCII_STRINGPARAM( c ) c, sizeof(c)-1
+#endif
+
+#if defined(MAC)
+const sal_Char HTMLOutFuncs::sNewLine = '\015';
+#elif defined(UNX)
+const sal_Char HTMLOutFuncs::sNewLine = '\012';
+#else
+const sal_Char __FAR_DATA HTMLOutFuncs::sNewLine[] = "\015\012";
+#endif
+
+const sal_Char *lcl_svhtml_GetEntityForANSIChar( sal_Char c )
+{
+ const sal_Char* pStr = 0;
+ switch( (unsigned char)c )
+ {
+// case '\x0a': return HTMLOutFuncs::Out_Tag( rStream, sHTML_linebreak );
+
+ case '<': pStr = sHTML_C_lt; break;
+ case '>': pStr = sHTML_C_gt; break;
+ case '&': pStr = sHTML_C_amp; break;
+ case '"': pStr = sHTML_C_quot; break;
+
+ case 161: pStr = sHTML_S_iexcl; break;
+ case 162: pStr = sHTML_S_cent; break;
+ case 163: pStr = sHTML_S_pound; break;
+ case 164: pStr = sHTML_S_curren; break;
+ case 165: pStr = sHTML_S_yen; break;
+ case 166: pStr = sHTML_S_brvbar; break;
+ case 167: pStr = sHTML_S_sect; break;
+ case 168: pStr = sHTML_S_uml; break;
+ case 169: pStr = sHTML_S_copy; break;
+ case 170: pStr = sHTML_S_ordf; break;
+ case 171: pStr = sHTML_S_laquo; break;
+ case 172: pStr = sHTML_S_not; break;
+ case 174: pStr = sHTML_S_reg; break;
+ case 175: pStr = sHTML_S_macr; break;
+ case 176: pStr = sHTML_S_deg; break;
+ case 177: pStr = sHTML_S_plusmn; break;
+ case 178: pStr = sHTML_S_sup2; break;
+ case 179: pStr = sHTML_S_sup3; break;
+ case 180: pStr = sHTML_S_acute; break;
+ case 181: pStr = sHTML_S_micro; break;
+ case 182: pStr = sHTML_S_para; break;
+ case 183: pStr = sHTML_S_middot; break;
+ case 184: pStr = sHTML_S_cedil; break;
+ case 185: pStr = sHTML_S_sup1; break;
+ case 186: pStr = sHTML_S_ordm; break;
+ case 187: pStr = sHTML_S_raquo; break;
+ case 188: pStr = sHTML_S_frac14; break;
+ case 189: pStr = sHTML_S_frac12; break;
+ case 190: pStr = sHTML_S_frac34; break;
+ case 191: pStr = sHTML_S_iquest; break;
+
+ case 192: pStr = sHTML_C_Agrave; break;
+ case 193: pStr = sHTML_C_Aacute; break;
+ case 194: pStr = sHTML_C_Acirc; break;
+ case 195: pStr = sHTML_C_Atilde; break;
+ case 196: pStr = sHTML_C_Auml; break;
+ case 197: pStr = sHTML_C_Aring; break;
+ case 198: pStr = sHTML_C_AElig; break;
+ case 199: pStr = sHTML_C_Ccedil; break;
+ case 200: pStr = sHTML_C_Egrave; break;
+ case 201: pStr = sHTML_C_Eacute; break;
+ case 202: pStr = sHTML_C_Ecirc; break;
+ case 203: pStr = sHTML_C_Euml; break;
+ case 204: pStr = sHTML_C_Igrave; break;
+ case 205: pStr = sHTML_C_Iacute; break;
+ case 206: pStr = sHTML_C_Icirc; break;
+ case 207: pStr = sHTML_C_Iuml; break;
+ case 208: pStr = sHTML_C_ETH; break;
+ case 209: pStr = sHTML_C_Ntilde; break;
+ case 210: pStr = sHTML_C_Ograve; break;
+ case 211: pStr = sHTML_C_Oacute; break;
+ case 212: pStr = sHTML_C_Ocirc; break;
+ case 213: pStr = sHTML_C_Otilde; break;
+ case 214: pStr = sHTML_C_Ouml; break;
+ case 215: pStr = sHTML_S_times; break;
+ case 216: pStr = sHTML_C_Oslash; break;
+ case 217: pStr = sHTML_C_Ugrave; break;
+ case 218: pStr = sHTML_C_Uacute; break;
+ case 219: pStr = sHTML_C_Ucirc; break;
+ case 220: pStr = sHTML_C_Uuml; break;
+ case 221: pStr = sHTML_C_Yacute; break;
+
+ case 222: pStr = sHTML_C_THORN; break;
+ case 223: pStr = sHTML_C_szlig; break;
+
+ case 224: pStr = sHTML_S_agrave; break;
+ case 225: pStr = sHTML_S_aacute; break;
+ case 226: pStr = sHTML_S_acirc; break;
+ case 227: pStr = sHTML_S_atilde; break;
+ case 228: pStr = sHTML_S_auml; break;
+ case 229: pStr = sHTML_S_aring; break;
+ case 230: pStr = sHTML_S_aelig; break;
+ case 231: pStr = sHTML_S_ccedil; break;
+ case 232: pStr = sHTML_S_egrave; break;
+ case 233: pStr = sHTML_S_eacute; break;
+ case 234: pStr = sHTML_S_ecirc; break;
+ case 235: pStr = sHTML_S_euml; break;
+ case 236: pStr = sHTML_S_igrave; break;
+ case 237: pStr = sHTML_S_iacute; break;
+ case 238: pStr = sHTML_S_icirc; break;
+ case 239: pStr = sHTML_S_iuml; break;
+ case 240: pStr = sHTML_S_eth; break;
+ case 241: pStr = sHTML_S_ntilde; break;
+ case 242: pStr = sHTML_S_ograve; break;
+ case 243: pStr = sHTML_S_oacute; break;
+ case 244: pStr = sHTML_S_ocirc; break;
+ case 245: pStr = sHTML_S_otilde; break;
+ case 246: pStr = sHTML_S_ouml; break;
+ case 247: pStr = sHTML_S_divide; break;
+ case 248: pStr = sHTML_S_oslash; break;
+ case 249: pStr = sHTML_S_ugrave; break;
+ case 250: pStr = sHTML_S_uacute; break;
+ case 251: pStr = sHTML_S_ucirc; break;
+ case 252: pStr = sHTML_S_uuml; break;
+ case 253: pStr = sHTML_S_yacute; break;
+ case 254: pStr = sHTML_S_thorn; break;
+ case 255: pStr = sHTML_S_yuml; break;
+
+ }
+
+ return pStr;
+}
+
+void lcl_ConvertCharToHTML( sal_Unicode c, ByteString& rDest,
+ rtl_TextEncoding eDestEnc )
+{
+ DBG_ASSERT( RTL_TEXTENCODING_DONTKNOW != eDestEnc,
+ "wrong destination encoding" );
+ const sal_Char *pStr = 0;
+ sal_Char cOut = 0U;
+
+ switch( c )
+ {
+ case 0xA0: // is a hard blank
+//!! the TextConverter has a problem with this character - so change it to
+// a hard space - that's the same as our 5.2
+ case 0x2011: // is a hard hyphen
+ pStr = sHTML_S_nbsp;
+ break;
+ case 0xAD: // is a soft hyphen
+ pStr = sHTML_S_shy;
+ break;
+
+ default:
+ // Convert character to ISO8859-1 temporarily
+ sal_Char cANSI = ByteString::ConvertFromUnicode(
+ c, RTL_TEXTENCODING_ISO_8859_1, FALSE );
+ // If it could be converted, there may be an entity for the character.
+ if( cANSI )
+ pStr = lcl_svhtml_GetEntityForANSIChar( cANSI );
+
+ if( !pStr )
+ {
+ cOut = RTL_TEXTENCODING_ISO_8859_1 == eDestEnc
+ ? cANSI
+ : ByteString::ConvertFromUnicode( c, eDestEnc, FALSE );
+
+ // If the character could not be converted to the destination
+ // character set, the original character code is truncated to
+ // an 8-bit-character code.
+ if( !cOut )
+ cOut = (sal_Char)c;
+ }
+ break;
+ }
+
+ if( !pStr && ( (cOut>=' ' && cOut<='~') || cOut=='\t' ||
+ RTL_TEXTENCODING_ISO_8859_1 == eDestEnc ) )
+ rDest += cOut;
+ else
+ {
+ rDest += '&';
+ if( pStr )
+ rDest += pStr;
+ else
+ (rDest += '#') +=
+ ByteString::CreateFromInt32( (sal_Int32)cOut );
+ rDest += ';';
+ }
+}
+
+void HTMLOutFuncs::ConvertStringToHTML( const String& rSrc,
+ ByteString& rDest,
+ rtl_TextEncoding eDestEnc )
+{
+ if( RTL_TEXTENCODING_DONTKNOW == eDestEnc )
+ eDestEnc = gsl_getSystemTextEncoding();
+
+ for( sal_uInt32 i=0UL, nLen = rSrc.Len(); i < nLen; i++ )
+ lcl_ConvertCharToHTML( rSrc.GetChar( i ), rDest, eDestEnc );
+}
+
+SvStream& HTMLOutFuncs::Out_AsciiTag( SvStream& rStream, const sal_Char *pStr,
+ BOOL bOn, rtl_TextEncoding )
+{
+ sal_Char sStt[3] = "</";
+ if( bOn )
+ sStt[1] = 0;
+ return (rStream << sStt << pStr << '>');
+}
+
+SvStream& HTMLOutFuncs::Out_Char( SvStream& rStream, sal_Unicode c,
+ rtl_TextEncoding eDestEnc )
+{
+ if( RTL_TEXTENCODING_DONTKNOW == eDestEnc )
+ eDestEnc = gsl_getSystemTextEncoding();
+
+ ByteString sOut;
+ lcl_ConvertCharToHTML( c, sOut, eDestEnc );
+ rStream << sOut.GetBuffer();
+ return rStream;
+}
+
+SvStream& HTMLOutFuncs::Out_String( SvStream& rStream, const String& rStr,
+ rtl_TextEncoding eDestEnc )
+{
+ for( sal_uInt32 n = 0UL; n < rStr.Len(); n++ )
+ HTMLOutFuncs::Out_Char( rStream, rStr.GetChar( n ), eDestEnc );
+ return rStream;
+}
+
+SvStream& HTMLOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen,
+ rtl_TextEncoding )
+{ // in einen Stream aus
+ sal_Char aNToABuf[] = "0000000000000000";
+
+ DBG_ASSERT( nLen < sizeof(aNToABuf), "zu viele Stellen" );
+ if( nLen>=sizeof(aNToABuf) )
+ nLen = (sizeof(aNToABuf)-1);
+
+ // Pointer an das Bufferende setzen
+ sal_Char *pStr = aNToABuf + (sizeof(aNToABuf)-1);
+ for( BYTE n = 0; n < nLen; ++n )
+ {
+ *(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
+ if( *pStr > '9' )
+ *pStr += 39;
+ nHex >>= 4;
+ }
+ return rStream << pStr;
+}
+
+
+SvStream& HTMLOutFuncs::Out_Color( SvStream& rStream, const Color& rColor,
+ rtl_TextEncoding )
+{
+ rStream << "\"#";
+ Out_Hex( rStream, rColor.GetRed(), 2 );
+ Out_Hex( rStream, rColor.GetGreen(), 2 );
+ Out_Hex( rStream, rColor.GetBlue(), 2 );
+ rStream << '\"';
+
+ return rStream;
+}
+
+SvStream& HTMLOutFuncs::Out_ImageMap( SvStream& rStream,
+ const ImageMap& rIMap,
+ const String& rName,
+ const HTMLOutEvent *pEventTable,
+ BOOL bOutStarBasic,
+ const sal_Char *pDelim,
+ const sal_Char *pIndentArea,
+ const sal_Char *pIndentMap,
+ rtl_TextEncoding eDestEnc )
+{
+ if( RTL_TEXTENCODING_DONTKNOW == eDestEnc )
+ eDestEnc = gsl_getSystemTextEncoding();
+
+ const String& rOutName = rName.Len() ? rName : rIMap.GetName();
+ DBG_ASSERT( rOutName.Len(), "Kein ImageMap-Name" )
+ if( !rOutName.Len() )
+ return rStream;
+
+ ByteString sOut( '<' );
+ sOut.Append( RTL_CONSTASCII_STRINGPARAM(sHTML_map ) );
+ sOut.Append( ' ' );
+ sOut.Append( RTL_CONSTASCII_STRINGPARAM(sHTML_O_name) );
+ sOut.Append( RTL_CONSTASCII_STRINGPARAM("=\"") );
+ rStream << sOut.GetBuffer();
+ sOut.Erase();
+ Out_String( rStream, rOutName, eDestEnc );
+ rStream << '\"';
+
+ for( USHORT i=0U; i<rIMap.GetIMapObjectCount(); i++ )
+ {
+ const IMapObject* pObj = rIMap.GetIMapObject( i );
+ DBG_ASSERT( pObj, "Wo ist das ImageMap-Object?" );
+
+ if( pObj )
+ {
+ const sal_Char *pShape = 0;
+ ByteString aCoords;
+ switch( pObj->GetType() )
+ {
+ case( IMAP_OBJ_RECTANGLE ):
+ {
+ const IMapRectangleObject* pRectObj =
+ (const IMapRectangleObject *)pObj;
+ pShape = sHTML_SH_rect;
+ Rectangle aRect( pRectObj->GetRectangle() );
+ ((((((aCoords =
+ ByteString::CreateFromInt32(aRect.Left())) += ',')
+ += ByteString::CreateFromInt32(aRect.Top())) += ',')
+ += ByteString::CreateFromInt32(aRect.Right())) += ',')
+ += ByteString::CreateFromInt32(aRect.Bottom());
+ }
+ break;
+ case( IMAP_OBJ_CIRCLE ):
+ {
+ const IMapCircleObject* pCirc =
+ (const IMapCircleObject *)pObj;
+ pShape= sHTML_SH_circ;
+ Point aCenter( pCirc->GetCenter() );
+ long nOff = pCirc->GetRadius();
+ ((((aCoords =
+ ByteString::CreateFromInt32(aCenter.X())) += ',')
+ += ByteString::CreateFromInt32(aCenter.Y())) += ',')
+ += ByteString::CreateFromInt32(nOff);
+ }
+ break;
+ case( IMAP_OBJ_POLYGON ):
+ {
+ const IMapPolygonObject* pPolyObj =
+ (const IMapPolygonObject *)pObj;
+ pShape= sHTML_SH_poly;
+ Polygon aPoly( pPolyObj->GetPolygon() );
+ USHORT nCount = aPoly.GetSize();
+ if( nCount>0 )
+ {
+ const Point& rPoint = aPoly[0];
+ ((aCoords =
+ ByteString::CreateFromInt32(rPoint.X())) += ',')
+ += ByteString::CreateFromInt32(rPoint.Y());
+ }
+ for( USHORT j=1; j<nCount; j++ )
+ {
+ const Point& rPoint = aPoly[j];
+ (((aCoords += ',')
+ += ByteString::CreateFromInt32(rPoint.X())) += ',')
+ += ByteString::CreateFromInt32(rPoint.Y());
+ }
+ }
+ break;
+ default:
+ DBG_ASSERT( pShape, "unbekanntes IMapObject" );
+ break;
+ }
+
+ if( pShape )
+ {
+ if( pDelim )
+ rStream << pDelim;
+ if( pIndentArea )
+ rStream << pIndentArea;
+
+ ((((((((((sOut = '<') += sHTML_area) += ' ')
+ += sHTML_O_shape) += '=') += pShape) += ' ')
+ += sHTML_O_coords) += "=\"") += aCoords) += "\" ";
+ rStream << sOut.GetBuffer();
+
+ String aURL( pObj->GetURL() );
+ if( aURL.Len() && pObj->IsActive() )
+ {
+ aURL = INetURLObject::AbsToRel( aURL );
+ (sOut = sHTML_O_href) += "=\"";
+ rStream << sOut.GetBuffer();
+ Out_String( rStream, aURL, eDestEnc ) << '\"';
+ }
+ else
+ rStream << sHTML_O_nohref;
+
+ const String& rName = pObj->GetName();
+ if( rName.Len() )
+ {
+ ((sOut = ' ') += sHTML_O_name) += "=\"";
+ rStream << sOut.GetBuffer();
+ Out_String( rStream, rName, eDestEnc ) << '\"';
+ }
+
+ const String& rTarget = pObj->GetTarget();
+ if( rTarget.Len() && pObj->IsActive() )
+ {
+ ((sOut = ' ') += sHTML_O_target) += "=\"";
+ rStream << sOut.GetBuffer();
+ Out_String( rStream, rTarget, eDestEnc ) << '\"';
+ }
+
+ const String& rDesc = pObj->GetDescription();
+ if( rDesc.Len() )
+ {
+ ((sOut = ' ') += sHTML_O_alt) += "=\"";
+ rStream << sOut.GetBuffer();
+ Out_String( rStream, rDesc, eDestEnc ) << '\"';
+ }
+
+ const SvxMacroTableDtor& rMacroTab = pObj->GetMacroTable();
+ if( pEventTable && rMacroTab.Count() )
+ Out_Events( rStream, rMacroTab, pEventTable,
+ bOutStarBasic, eDestEnc );
+
+ rStream << '>';
+ }
+ }
+
+ }
+
+ if( pDelim )
+ rStream << pDelim;
+ if( pIndentMap )
+ rStream << pIndentMap;
+ Out_AsciiTag( rStream, sHTML_map, FALSE );
+
+ return rStream;
+}
+
+SvStream& HTMLOutFuncs::OutScript( SvStream& rStrm, const String& rSource,
+ const String& rLanguage,
+ ScriptType eScriptType,
+ const String& rSrc,
+ const String *pSBLibrary,
+ const String *pSBModule,
+ rtl_TextEncoding eDestEnc )
+{
+ if( RTL_TEXTENCODING_DONTKNOW == eDestEnc )
+ eDestEnc = gsl_getSystemTextEncoding();
+
+ // Script wird komplett nicht eingerueckt!
+ ByteString sOut( '<' );
+ sOut.Append( RTL_CONSTASCII_STRINGPARAM(sHTML_script) );
+
+ if( rLanguage.Len() )
+ {
+ sOut.Append( ' ' );
+ sOut.Append( RTL_CONSTASCII_STRINGPARAM(sHTML_O_language) );
+ sOut.Append( RTL_CONSTASCII_STRINGPARAM("=\"") );
+ rStrm << sOut.GetBuffer();
+ Out_String( rStrm, rLanguage, eDestEnc );
+ sOut = '\"';
+ }
+
+ if( rSrc.Len() )
+ {
+ ((sOut += ' ') += sHTML_O_src) += "=\"";
+ rStrm << sOut.GetBuffer();
+ Out_String( rStrm, INetURLObject::AbsToRel(rSrc), eDestEnc );
+ sOut = '\"';
+ }
+
+ if( STARBASIC != eScriptType && pSBLibrary )
+ {
+ ((sOut += ' ') += sHTML_O_sdlibrary) += "=\"";
+ rStrm << sOut.GetBuffer();
+ Out_String( rStrm, *pSBLibrary, eDestEnc );
+ sOut = '\"';
+ }
+
+ if( STARBASIC != eScriptType && pSBModule )
+ {
+ ((sOut += ' ') += sHTML_O_sdmodule) += "=\"";
+ rStrm << sOut.GetBuffer();
+ Out_String( rStrm, *pSBModule, eDestEnc );
+ sOut = '\"';
+ }
+
+ sOut += '>';
+
+ rStrm << sOut.GetBuffer();
+
+ if( rSource.Len() || pSBLibrary || pSBModule )
+ {
+ rStrm << sNewLine;
+
+ if( JAVASCRIPT != eScriptType )
+ {
+ rStrm << "<!--"
+ << sNewLine;
+ }
+
+ if( STARBASIC == eScriptType )
+ {
+ if( pSBLibrary )
+ {
+ sOut.Assign( RTL_CONSTASCII_STRINGPARAM("' ") );
+ sOut.Append( RTL_CONSTASCII_STRINGPARAM(sHTML_SB_library) );
+ sOut.Append( ' ' );
+ ByteString sTmp( *pSBLibrary, eDestEnc );
+ sOut.Append( sTmp );
+ rStrm << sOut.GetBuffer() << sNewLine;
+ }
+
+ if( pSBModule )
+ {
+ sOut.Assign( RTL_CONSTASCII_STRINGPARAM("' ") );
+ sOut.Append( RTL_CONSTASCII_STRINGPARAM(sHTML_SB_module) );
+ sOut.Append( ' ' );
+ ByteString sTmp( *pSBModule, eDestEnc );
+ sOut.Append( sTmp );
+ rStrm << sOut.GetBuffer() << sNewLine;
+ }
+ }
+
+ if( rSource.Len() )
+ {
+ // Wir schreiben das Modul mm ANSI-Zeichensatz, aber mit
+ // System-Zeilenumbruechen raus.
+ ByteString sSource( rSource, eDestEnc );
+ sSource.ConvertLineEnd( GetSystemLineEnd() );
+ rStrm << sSource.GetBuffer();
+ }
+ rStrm << sNewLine;
+
+ if( JAVASCRIPT != eScriptType )
+ {
+ // MIB/MM: Wenn es kein StarBasic ist, kann ein // natuerlich
+ // falsch sein. Da der Kommentar aber beim Einlesen wider
+ // entfernt wird, schickt uns das nicht weiter ...
+ rStrm << (STARBASIC == eScriptType ? "' -->" : "// -->")
+ << sNewLine;
+ }
+ }
+
+ HTMLOutFuncs::Out_AsciiTag( rStrm, sHTML_script, FALSE );
+
+ return rStrm;
+}
+
+
+SvStream& HTMLOutFuncs::Out_Events( SvStream& rStrm,
+ const SvxMacroTableDtor& rMacroTable,
+ const HTMLOutEvent *pEventTable,
+ BOOL bOutStarBasic,
+ rtl_TextEncoding eDestEnc )
+{
+ USHORT i=0;
+ while( pEventTable[i].pBasicName || pEventTable[i].pJavaName )
+ {
+ const SvxMacro *pMacro =
+ rMacroTable.Get( pEventTable[i].nEvent );
+
+ if( pMacro && pMacro->GetMacName().Len() &&
+ ( JAVASCRIPT == pMacro->GetScriptType() || bOutStarBasic ))
+ {
+ const sal_Char *pStr = STARBASIC == pMacro->GetScriptType()
+ ? pEventTable[i].pBasicName
+ : pEventTable[i].pJavaName;
+
+ if( pStr )
+ {
+ ByteString sOut( ' ' );
+ (sOut += pStr) += "=\"";
+ rStrm << sOut.GetBuffer();
+
+ Out_String( rStrm, pMacro->GetMacName(), eDestEnc ) << '\"';
+ }
+ }
+ i++;
+ }
+
+ return rStrm;
+}
+
+ByteString& HTMLOutFuncs::CreateTableDataOptionsValNum( ByteString& aStrTD,
+ BOOL bValue,
+ double fVal, ULONG nFormat, SvNumberFormatter& rFormatter,
+ rtl_TextEncoding eDestEnc )
+{
+ if ( bValue )
+ {
+ // printf / scanf ist zu ungenau
+ String aValStr;
+ rFormatter.GetInputLineString( fVal, 0, aValStr );
+ ByteString sTmp( aValStr, eDestEnc );
+ ((((aStrTD += ' ') += sHTML_O_SDval) += "=\"") += sTmp) += '\"';
+ }
+ if ( bValue || nFormat )
+ {
+ ((aStrTD += ' ') += sHTML_O_SDnum) += "=\"";
+ (aStrTD += ByteString::CreateFromInt32(System::GetLanguage()))
+ += ';'; // Language fuer Format 0
+ if ( nFormat )
+ {
+ ByteString aNumStr;
+ LanguageType nLang;
+ const SvNumberformat* pFormatEntry = rFormatter.GetEntry( nFormat );
+ if ( pFormatEntry )
+ {
+ ByteString sTmp( pFormatEntry->GetFormatstring(), eDestEnc );
+ aNumStr = sTmp;
+ nLang = pFormatEntry->GetLanguage();
+ }
+ else
+ nLang = LANGUAGE_SYSTEM;
+ ((aStrTD += nLang) += ';') += aNumStr;
+ }
+ aStrTD += '\"';
+ }
+ return aStrTD;
+}
+
+BOOL HTMLOutFuncs::PrivateURLToInternalImg( String& rURL )
+{
+ if( rURL.Len() > 14UL &&
+ rURL.CompareToAscii( sHTML_private_image, 14UL ) == COMPARE_EQUAL )
+ {
+ rURL.Erase( 0UL, 14UL );
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
diff --git a/svtools/source/svhtml/htmlsupp.cxx b/svtools/source/svhtml/htmlsupp.cxx
new file mode 100644
index 000000000000..3a38dbb522fc
--- /dev/null
+++ b/svtools/source/svhtml/htmlsupp.cxx
@@ -0,0 +1,205 @@
+/*************************************************************************
+ *
+ * $RCSfile: htmlsupp.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <ctype.h>
+#include <stdio.h>
+#include <tools/urlobj.hxx>
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_ULONGS
+#include <svstdarr.hxx>
+#endif
+
+#include "parhtml.hxx"
+#include "htmltokn.h"
+#include "htmlkywd.hxx"
+
+/* */
+
+// Tabellen zum Umwandeln von Options-Werten in Strings
+
+static HTMLOptionEnum __READONLY_DATA aScriptLangOptEnums[] =
+{
+ { sHTML_LG_starbasic, HTML_SL_STARBASIC },
+ { sHTML_LG_javascript, HTML_SL_JAVASCRIPT },
+ { sHTML_LG_javascript11,HTML_SL_JAVASCRIPT },
+ { sHTML_LG_livescript, HTML_SL_JAVASCRIPT },
+// { sHTML_LG_unused_javascript, HTML_SL_UNUSEDJS },
+// { sHTML_LG_vbscript, HTML_SL_VBSCRIPT },
+// { sHTML_LG_starone, HTML_SL_STARONE },
+ { 0, 0 }
+};
+
+BOOL HTMLParser::ParseScriptOptions( String& rLangString,
+ HTMLScriptLanguage& rLang,
+ String& rSrc,
+ String& rLibrary,
+ String& rModule )
+{
+ const HTMLOptions *pOptions = GetOptions();
+
+ rLangString.Erase();
+ rLang = HTML_SL_JAVASCRIPT;
+ rSrc.Erase();
+ rLibrary.Erase();
+ rModule.Erase();
+
+ for( USHORT i = pOptions->Count(); i; )
+ {
+ const HTMLOption *pOption = (*pOptions)[ --i ];
+ switch( pOption->GetToken() )
+ {
+ case HTML_O_LANGUAGE:
+ {
+ rLangString = pOption->GetString();
+ USHORT nLang;
+ if( pOption->GetEnum( nLang, aScriptLangOptEnums ) )
+ rLang = (HTMLScriptLanguage)nLang;
+ else
+ rLang = HTML_SL_UNKNOWN;
+ }
+ break;
+
+ case HTML_O_SRC:
+ rSrc = INetURLObject::RelToAbs( pOption->GetString() );
+ break;
+
+ case HTML_O_SDLIBRARY:
+ rLibrary = pOption->GetString();
+ break;
+
+ case HTML_O_SDMODULE:
+ rModule = pOption->GetString();
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+void HTMLParser::RemoveSGMLComment( String &rString, BOOL bFull )
+{
+ sal_Unicode c;
+ while( rString.Len() &&
+ ( ' '==(c=rString.GetChar(0UL)) || '\t'==c || '\r'==c || '\n'==c ) )
+ rString.Erase( 0UL, 1UL );
+
+ while( rString.Len() &&
+ ( ' '==(c=rString.GetChar( rString.Len()-1UL))
+ || '\t'==c || '\r'==c || '\n'==c ) )
+ rString.Erase( rString.Len()-1UL );
+
+
+ // SGML-Kommentare entfernen
+ if( rString.Len() >= 4UL &&
+ rString.CompareToAscii( "<!--", 4UL ) == COMPARE_EQUAL )
+ {
+ sal_uInt32 nPos = 3UL;
+ if( bFull )
+ {
+ // die gesamte Zeile !
+ nPos = 4UL;
+ while( nPos < rString.Len() &&
+ ( ( c = rString.GetChar( nPos )) != '\r' && c != '\n' ) )
+ ++nPos;
+ if( c == '\r' && nPos+1UL < rString.Len() &&
+ '\n' == rString.GetChar( nPos+1UL ))
+ ++nPos;
+ else if( c != '\n' )
+ nPos = 3UL;
+ }
+ rString.Erase( 0UL, ++nPos );
+ }
+
+ if( rString.Len() >=3UL &&
+ rString.Copy(rString.Len()-3UL).CompareToAscii("-->")
+ == COMPARE_EQUAL )
+ {
+ rString.Erase( rString.Len()-3UL );
+ if( bFull )
+ {
+ // auch noch ein "//" oder "'" und ggf CR/LF davor
+ rString.EraseTrailingChars();
+ sal_uInt32 nDel = 0UL, nLen = rString.Len();
+ if( nLen >= 2UL &&
+ rString.Copy(nLen-2UL).CompareToAscii("//") == COMPARE_EQUAL )
+ {
+ nDel = 2UL;
+ }
+ else if( nLen && '\'' == rString.GetChar(nLen-1UL) )
+ {
+ nDel = 1UL;
+ }
+ if( nDel && nLen >= nDel+1UL )
+ {
+ c = rString.GetChar( nLen-(nDel+1UL) );
+ if( '\r'==c || '\n'==c )
+ {
+ nDel++;
+ if( '\n'==c && nLen >= nDel+1UL &&
+ '\r'==rString.GetChar( nLen-(nDel+1UL) ) )
+ nDel++;
+ }
+ }
+ rString.Erase( nLen-nDel );
+ }
+ }
+}
+
diff --git a/svtools/source/svhtml/makefile.mk b/svtools/source/svhtml/makefile.mk
new file mode 100644
index 000000000000..c1e726b83a23
--- /dev/null
+++ b/svtools/source/svhtml/makefile.mk
@@ -0,0 +1,112 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=svhtml
+AUTOSEG=true
+LIBTARGET=NO
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(header)" == ""
+
+CXXFILES = \
+ parhtml.cxx \
+ htmlkywd.cxx \
+ htmlkey2.cxx \
+ htmlsupp.cxx \
+ htmlout.cxx
+
+OBJFILES = $(OBJ)$/htmlkey2.obj
+
+SLOFILES=\
+ $(LIB3OBJFILES) \
+ $(LIB4OBJFILES)
+
+# nur damit's was zum builden gibt
+LIB2TARGET =$(LB)$/svhtmlk2.lib
+LIB2OBJFILES =$(OBJFILES)
+
+LIB3TARGET=$(SLB)$/svhtml1.lib
+LIB3OBJFILES=\
+ $(SLO)$/htmlkey2.obj \
+ $(SLO)$/htmlkywd.obj \
+ $(SLO)$/htmlsupp.obj \
+ $(SLO)$/parhtml.obj
+
+LIB4TARGET=$(SLB)$/svhtml2.lib
+LIB4OBJFILES=\
+ $(SLO)$/htmlout.obj
+
+.ENDIF
+
+# ==========================================================================
+
+.INCLUDE : target.mk
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
new file mode 100644
index 000000000000..c9a0e2ab51dc
--- /dev/null
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -0,0 +1,2043 @@
+/*************************************************************************
+ *
+ * $RCSfile: parhtml.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <ctype.h>
+#include <stdio.h>
+
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _TOOLS_COLOR_HXX
+#include <tools/color.hxx>
+#endif
+
+#ifndef _RTL_USTRBUF_HXX_
+#include <rtl/ustrbuf.hxx>
+#endif
+#ifndef _RTL_STRBUF_HXX_
+#include <rtl/strbuf.hxx>
+#endif
+#ifndef _SVSTDARR_HXX
+#define _SVSTDARR_ULONGS
+#include <svstdarr.hxx>
+#endif
+
+#include "parhtml.hxx"
+#include "htmltokn.h"
+#include "htmlkywd.hxx"
+
+const sal_Int32 MAX_LEN = 1024L;
+//static sal_Unicode sTmpBuffer[ MAX_LEN+1 ];
+const sal_Int32 MAX_MACRO_LEN = 1024;
+
+/* */
+
+// Tabellen zum Umwandeln von Options-Werten in Strings
+
+// <INPUT TYPE=xxx>
+static HTMLOptionEnum __READONLY_DATA aInputTypeOptEnums[] =
+{
+ { sHTML_IT_text, HTML_IT_TEXT },
+ { sHTML_IT_password, HTML_IT_PASSWORD },
+ { sHTML_IT_checkbox, HTML_IT_CHECKBOX },
+ { sHTML_IT_radio, HTML_IT_RADIO },
+ { sHTML_IT_range, HTML_IT_RANGE },
+ { sHTML_IT_scribble, HTML_IT_SCRIBBLE },
+ { sHTML_IT_file, HTML_IT_FILE },
+ { sHTML_IT_hidden, HTML_IT_HIDDEN },
+ { sHTML_IT_submit, HTML_IT_SUBMIT },
+ { sHTML_IT_image, HTML_IT_IMAGE },
+ { sHTML_IT_reset, HTML_IT_RESET },
+ { sHTML_IT_button, HTML_IT_BUTTON },
+ { 0, 0 }
+};
+
+// <TABLE FRAME=xxx>
+static HTMLOptionEnum __READONLY_DATA aTableFrameOptEnums[] =
+{
+ { sHTML_TF_void, HTML_TF_VOID },
+ { sHTML_TF_above, HTML_TF_ABOVE },
+ { sHTML_TF_below, HTML_TF_BELOW },
+ { sHTML_TF_hsides, HTML_TF_HSIDES },
+ { sHTML_TF_lhs, HTML_TF_LHS },
+ { sHTML_TF_rhs, HTML_TF_RHS },
+ { sHTML_TF_vsides, HTML_TF_VSIDES },
+ { sHTML_TF_box, HTML_TF_BOX },
+ { sHTML_TF_border, HTML_TF_BOX },
+ { 0, 0 }
+};
+
+// <TABLE RULES=xxx>
+static HTMLOptionEnum __READONLY_DATA aTableRulesOptEnums[] =
+{
+ { sHTML_TR_none, HTML_TR_NONE },
+ { sHTML_TR_groups, HTML_TR_GROUPS },
+ { sHTML_TR_rows, HTML_TR_ROWS },
+ { sHTML_TR_cols, HTML_TR_COLS },
+ { sHTML_TR_all, HTML_TR_ALL },
+ { 0, 0 }
+};
+
+
+SV_IMPL_PTRARR(HTMLOptions,HTMLOptionPtr)
+
+/* */
+
+USHORT HTMLOption::GetEnum( const HTMLOptionEnum *pOptEnums, USHORT nDflt ) const
+{
+ USHORT nValue = nDflt;
+
+ while( pOptEnums->pName )
+ if( aValue.EqualsIgnoreCaseAscii( pOptEnums->pName ) )
+ break;
+ else
+ pOptEnums++;
+
+ if( pOptEnums->pName )
+ nValue = pOptEnums->nValue;
+
+ return nValue;
+}
+
+BOOL HTMLOption::GetEnum( USHORT &rEnum, const HTMLOptionEnum *pOptEnums ) const
+{
+ while( pOptEnums->pName )
+ {
+ if( aValue.EqualsIgnoreCaseAscii( pOptEnums->pName ) )
+ break;
+ else
+ pOptEnums++;
+ }
+
+ const sal_Char *pName = pOptEnums->pName;
+ if( pName )
+ rEnum = pOptEnums->nValue;
+
+ return (pName != 0);
+}
+
+HTMLOption::HTMLOption( USHORT nTok, const String& rToken,
+ const String& rValue )
+ : nToken( nTok ), aToken(rToken), aValue(rValue)
+{
+ DBG_ASSERT( nToken>=HTML_OPTION_START && nToken<HTML_OPTION_END,
+ "HTMLOption: unbekanntes Token" );
+}
+
+ULONG HTMLOption::GetNumber() const
+{
+ DBG_ASSERT( (nToken>=HTML_OPTION_NUMBER_START &&
+ nToken<HTML_OPTION_NUMBER_END) ||
+ (nToken>=HTML_OPTION_CONTEXT_START &&
+ nToken<HTML_OPTION_CONTEXT_END) ||
+ nToken==HTML_O_VALUE,
+ "GetNumber: Option ist nicht numerisch" );
+ String aTmp( aValue );
+ aTmp.EraseLeadingChars();
+ sal_Int32 nTmp = aTmp.ToInt32();
+ return nTmp >= 0L ? (sal_uInt32)nTmp : 0UL;
+}
+
+INT32 HTMLOption::GetSNumber() const
+{
+ DBG_ASSERT( (nToken>=HTML_OPTION_NUMBER_START && nToken<HTML_OPTION_NUMBER_END) ||
+ (nToken>=HTML_OPTION_CONTEXT_START && nToken<HTML_OPTION_CONTEXT_END),
+ "GetSNumber: Option ist nicht numerisch" );
+ String aTmp( aValue );
+ aTmp.EraseLeadingChars();
+ return aTmp.ToInt32();
+}
+
+void HTMLOption::GetNumbers( SvULongs &rLongs, BOOL bSpaceDelim ) const
+{
+ if( rLongs.Count() )
+ rLongs.Remove( 0, rLongs.Count() );
+
+ if( bSpaceDelim )
+ {
+ // das ist ein sehr stark vereinfachter Scanner. Er sucht einfach
+ // alle Tiffern aus dem String
+ BOOL bInNum = FALSE;
+ ULONG nNum = 0UL;
+ for( sal_uInt32 i=0UL; i<aValue.Len(); i++ )
+ {
+ register sal_Unicode c = aValue.GetChar( i );
+ if( c>='0' && c<='9' )
+ {
+ nNum *= 10UL;
+ nNum += (c - '0');
+ bInNum = TRUE;
+ }
+ else if( bInNum )
+ {
+ rLongs.Insert( nNum, rLongs.Count() );
+ bInNum = FALSE;
+ nNum = 0UL;
+ }
+ }
+ if( bInNum )
+ {
+ rLongs.Insert( nNum, rLongs.Count() );
+ }
+ }
+ else
+ {
+ // hier wird auf die korrekte Trennung der Zahlen durch ',' geachtet
+ // und auch mal eine 0 eingefuegt
+ sal_uInt32 nPos = 0UL;
+ while( nPos < aValue.Len() )
+ {
+ register sal_Unicode c;
+ while( nPos < aValue.Len() &&
+ ((c=aValue.GetChar(nPos)) == ' ' || c == '\t' ||
+ c == '\n' || c== '\r' ) )
+ nPos++;
+
+ if( nPos==aValue.Len() )
+ rLongs.Insert( 0UL, rLongs.Count() );
+ else
+ {
+ sal_uInt32 nEnd = aValue.Search( (sal_Unicode)',', nPos );
+ if( STRING_NOTFOUND==nEnd )
+ {
+ sal_Int32 nTmp = aValue.Copy(nPos).ToInt32();
+ rLongs.Insert( nTmp >= 0L ? (sal_uInt32)nTmp : 0UL,
+ rLongs.Count() );
+ nPos = aValue.Len();
+ }
+ else
+ {
+ sal_Int32 nTmp =
+ aValue.Copy(nPos,nEnd-nPos).ToInt32();
+ rLongs.Insert( nTmp >= 0L ? (sal_uInt32)nTmp : 0UL,
+ rLongs.Count() );
+ nPos = nEnd+1UL;
+ }
+ }
+ }
+ }
+}
+
+void HTMLOption::GetColor( Color& rColor ) const
+{
+ DBG_ASSERT( (nToken>=HTML_OPTION_COLOR_START && nToken<HTML_OPTION_COLOR_END) || nToken==HTML_O_SIZE,
+ "GetColor: Option spezifiziert keine Farbe" );
+
+ String aTmp( aValue );
+ aTmp.ToUpperAscii();
+ ULONG nColor = ULONG_MAX;
+ if( '#'!=aTmp.GetChar( 0UL ) )
+ nColor = GetHTMLColor( aTmp );
+
+ if( ULONG_MAX == nColor )
+ {
+ nColor = 0UL;
+ sal_uInt32 nPos = 0UL;
+ for( sal_uInt32 i=0UL; i<6UL; i++ )
+ {
+ // MIB 26.06.97: Wie auch immer Netscape Farbwerte ermittelt,
+ // maximal drei Zeichen, die kleiner als '0' sind werden
+ // ignoriert. Bug #40901# stimmt damit. Mal schauen, was sich
+ // irgendwelche HTML-Autoren noch so einfallen lassen...
+ register sal_Unicode c = nPos<aTmp.Len() ? aTmp.GetChar( nPos++ )
+ : '0';
+ if( c < '0' )
+ {
+ c = nPos<aTmp.Len() ? aTmp.GetChar(nPos++) : '0';
+ if( c < '0' )
+ c = nPos<aTmp.Len() ? aTmp.GetChar(nPos++) : '0';
+ }
+ nColor *= 16UL;
+ if( c >= '0' && c <= '9' )
+ nColor += (c - 48);
+ else if( c >= 'A' && c <= 'F' )
+ nColor += (c - 55);
+ }
+ }
+
+ rColor.SetRed( (BYTE)((nColor & 0x00ff0000UL) >> 16) );
+ rColor.SetGreen( (BYTE)((nColor & 0x0000ff00UL) >> 8));
+ rColor.SetBlue( (BYTE)(nColor & 0x000000ffUL) );
+}
+
+HTMLInputType HTMLOption::GetInputType() const
+{
+ DBG_ASSERT( nToken==HTML_O_TYPE, "GetInputType: Option nicht TYPE" );
+ return (HTMLInputType)GetEnum( aInputTypeOptEnums, HTML_IT_TEXT );
+}
+
+HTMLTableFrame HTMLOption::GetTableFrame() const
+{
+ DBG_ASSERT( nToken==HTML_O_FRAME, "GetTableFrame: Option nicht FRAME" );
+ return (HTMLTableFrame)GetEnum( aTableFrameOptEnums, HTML_TF_VOID );
+}
+
+HTMLTableRules HTMLOption::GetTableRules() const
+{
+ DBG_ASSERT( nToken==HTML_O_RULES, "GetTableRules: Option nicht RULES" );
+ return (HTMLTableRules)GetEnum( aTableRulesOptEnums, HTML_TR_NONE );
+}
+
+/* */
+
+HTMLParser::HTMLParser( SvStream& rIn, int bReadNewDoc )
+ : SvParser( rIn )
+{
+ bNewDoc = bReadNewDoc;
+ bReadListing = bReadXMP = bReadPRE = bReadTextArea =
+ bReadScript = bReadStyle =
+ bEndTokenFound = bIsInBody = bReadNextChar =
+ bReadComment = FALSE;
+ bIsInHeader = TRUE;
+ pOptions = new HTMLOptions;
+}
+
+HTMLParser::~HTMLParser()
+{
+ if( pOptions && pOptions->Count() )
+ pOptions->DeleteAndDestroy( 0, pOptions->Count() );
+ delete pOptions;
+}
+
+SvParserState __EXPORT HTMLParser::CallParser()
+{
+ eState = SVPAR_WORKING;
+ nNextCh = GetNextChar();
+ SaveState( 0 );
+
+ nPre_LinePos = 0UL;
+ bPre_IgnoreNewPara = FALSE;
+
+ AddRef();
+ Continue( 0 );
+ if( SVPAR_PENDING != eState )
+ ReleaseRef(); // dann brauchen wir den Parser nicht mehr!
+
+ return eState;
+}
+
+void HTMLParser::Continue( int nToken )
+{
+ if( !nToken )
+ nToken = GetNextToken();
+
+ while( IsParserWorking() )
+ {
+ SaveState( nToken );
+ nToken = FilterToken( nToken );
+
+ if( nToken )
+ NextToken( nToken );
+
+ if( IsParserWorking() )
+ SaveState( 0 ); // bis hierhin abgearbeitet,
+ // weiter mit neuem Token!
+ nToken = GetNextToken();
+ }
+}
+
+int HTMLParser::FilterToken( int nToken )
+{
+ switch( nToken )
+ {
+ case sal_Unicode(EOF):
+ nToken = 0;
+ break; // nicht verschicken
+
+ case HTML_HEAD_OFF:
+ bIsInBody = TRUE;
+ case HTML_HEAD_ON:
+ bIsInHeader = HTML_HEAD_ON == nToken;
+ break;
+
+ case HTML_BODY_ON:
+ case HTML_FRAMESET_ON:
+ bIsInHeader = FALSE;
+ bIsInBody = HTML_BODY_ON == nToken;
+ break;
+
+ case HTML_BODY_OFF:
+ bIsInBody = bReadPRE = bReadListing = bReadXMP = FALSE;
+ break;
+
+ case HTML_HTML_OFF:
+ nToken = 0;
+ bReadPRE = bReadListing = bReadXMP = FALSE;
+ break; // HTML_ON wurde auch nicht verschickt !
+
+ case HTML_PREFORMTXT_ON:
+ StartPRE();
+ break;
+
+ case HTML_PREFORMTXT_OFF:
+ FinishPRE();
+ break;
+
+ case HTML_LISTING_ON:
+ StartListing();
+ break;
+
+ case HTML_LISTING_OFF:
+ FinishListing();
+ break;
+
+ case HTML_XMP_ON:
+ StartXMP();
+ break;
+
+ case HTML_XMP_OFF:
+ FinishXMP();
+ break;
+
+ default:
+ if( bReadPRE )
+ nToken = FilterPRE( nToken );
+ else if( bReadListing )
+ nToken = FilterListing( nToken );
+ else if( bReadXMP )
+ nToken = FilterXMP( nToken );
+
+ break;
+ }
+
+ return nToken;
+}
+
+#define HTML_ISDIGIT( c ) (c >= '0' && c <= '9')
+#define HTML_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') )
+#define HTML_ISALNUM( c ) ( HTML_ISALPHA(c) || HTML_ISDIGIT(c) )
+#define HTML_ISSPACE( c ) ( ' ' == c || (c >= 0x09 && c <= 0x0d) )
+#define HTML_ISPRINTABLE( c ) ( c >= 32 && c != 127)
+
+int HTMLParser::ScanText( const sal_Unicode cBreak )
+{
+ ::rtl::OUStringBuffer sTmpBuffer( MAX_LEN );
+ int bWeiter = TRUE;
+ int bEqSignFound = FALSE;
+ sal_Unicode cQuote = 0U;
+
+ while( bWeiter && IsParserWorking() )
+ {
+ int bNextCh = TRUE;
+ switch( nNextCh )
+ {
+ case '&':
+ bEqSignFound = FALSE;
+ if( bReadXMP )
+ sTmpBuffer.append( (sal_Unicode)'&' );
+ else
+ {
+ ULONG nStreamPos = rInput.Tell();
+ ULONG nLinePos = GetLinePos();
+
+ sal_Unicode cChar = 0U;
+ if( '#' == (nNextCh = GetNextChar()) )
+ {
+ nNextCh = GetNextChar();
+ if( HTML_ISDIGIT(nNextCh) )
+ {
+ do
+ {
+ cChar = cChar * 10U + sal_Unicode( nNextCh - '0');
+ nNextCh = GetNextChar();
+ }
+ while( HTML_ISDIGIT(nNextCh) );
+
+ if( RTL_TEXTENCODING_DONTKNOW != eSrcEnc &&
+ RTL_TEXTENCODING_UCS2 != eSrcEnc &&
+ RTL_TEXTENCODING_UTF8 != eSrcEnc )
+ {
+ sal_Unicode cOrig = cChar;
+ cChar = ByteString::ConvertToUnicode(
+ (sal_Char)cChar, eSrcEnc );
+ if( 0U == cChar )
+ {
+ // #73398#: If the character could not be
+ // converted, because a conversion is not
+ // available, do no conversion at all.
+ cChar = cOrig;
+ }
+ }
+ }
+ else
+ nNextCh = 0U;
+ }
+ else if( HTML_ISALPHA( nNextCh ) )
+ {
+ ::rtl::OUStringBuffer sEntityBuffer( 6L );
+ sal_Int32 nPos = 0L;
+ do
+ {
+ sEntityBuffer.append( nNextCh );
+ nPos++;
+ nNextCh = GetNextChar();
+ }
+ while( nPos < 6L && HTML_ISALNUM( nNextCh ) &&
+ !rInput.IsEof() );
+
+ if( IsParserWorking() && !rInput.IsEof() )
+ {
+ String sEntity( sEntityBuffer.getStr(),
+ (sal_uInt32)nPos );
+ cChar = GetHTMLCharName( sEntity );
+
+ // nicht gefunden ( == 0 ), dann Klartext
+ // oder ein Zeichen das als Attribut eingefuegt
+ // wird
+ if( 0U == cChar && ';' != nNextCh )
+ {
+ DBG_ASSERT( rInput.Tell() - nStreamPos ==
+ (ULONG)(nPos+1L)*GetCharSize(),
+ "UTF-8 geht hier schief" );
+ for( sal_Int32 i=nPos-1L; i>1L; i-- )
+ {
+ nNextCh = sEntityBuffer[i];
+ sEntityBuffer.setLength( i );
+ sEntity.Assign( sEntityBuffer.getStr(),
+ (sal_uInt32)i );
+ cChar = GetHTMLCharName( sEntity );
+ if( cChar )
+ {
+ rInput.SeekRel( -(long)
+ ((nPos-i)*GetCharSize()) );
+ nlLinePos -= sal_uInt32(nPos-i);
+ nPos = i;
+ break;
+ }
+ }
+ }
+
+ if( !cChar ) // unbekanntes Zeichen?
+ {
+ // dann im Stream zurueck, das '&' als Zeichen
+ // einfuegen und mit dem nachfolgenden Zeichen
+ // wieder aufsetzen
+ sTmpBuffer.append( (sal_Unicode)'&' );
+
+// rInput.SeekRel( -(long)(++nPos*GetCharSize()) );
+// nlLinePos -= nPos;
+ DBG_ASSERT( rInput.Tell()-nStreamPos ==
+ (ULONG)(nPos+1)*GetCharSize(),
+ "Falsche Stream-Position" );
+ DBG_ASSERT( nlLinePos-nLinePos ==
+ (ULONG)(nPos+1),
+ "Falsche Zeilen-Position" );
+ rInput.Seek( nStreamPos );
+ nlLinePos = nLinePos;
+ break;
+ }
+
+ // 1 == Non Breaking Space
+ // 2 == SoftHyphen
+
+ if( cChar < 3U )
+ {
+ if( '>' == cBreak )
+ {
+ // Wenn der Inhalt eines Tags gelesen wird,
+ // muessen wir ein Space bzw. - daraus machen
+ switch( cChar )
+ {
+ case 1U: cChar = ' '; break;
+ case 2U: cChar = '-'; break;
+ default:
+ DBG_ASSERT( cChar==1U,
+ "\0x00 sollte doch schon laengt abgefangen sein!" );
+ break;
+ }
+ }
+ else
+ {
+ // Wenn kein Tag gescannt wird, enstprechendes
+ // Token zurueckgeben
+ aToken +=
+ String( sTmpBuffer.makeStringAndClear() );
+ if( cChar )
+ {
+ if( aToken.Len() )
+ {
+ // mit dem Zeichen wieder aufsetzen
+ nNextCh = '&';
+// rInput.SeekRel( -(long)(++nPos*GetCharSize()) );
+// nlLinePos -= nPos;
+ DBG_ASSERT( rInput.Tell()-nStreamPos ==
+ (ULONG)(nPos+1)*GetCharSize(),
+ "Falsche Stream-Position" );
+ DBG_ASSERT( nlLinePos-nLinePos ==
+ (ULONG)(nPos+1),
+ "Falsche Zeilen-Position" );
+ rInput.Seek( nStreamPos );
+ nlLinePos = nLinePos;
+ return HTML_TEXTTOKEN;
+ }
+
+ // Hack: _GetNextChar soll nicht das
+ // naechste Zeichen lesen
+ if( ';' != nNextCh )
+ aToken += ' ';
+ if( 1U == cChar )
+ return HTML_NONBREAKSPACE;
+ if( 2U == cChar )
+ return HTML_SOFTHYPH;
+ }
+ aToken += (sal_Unicode)'&';
+ aToken +=
+ String(sEntityBuffer.makeStringAndClear());
+ break;
+ }
+ }
+ }
+ else
+ nNextCh = 0U;
+ }
+ // MIB 03/02/2000: &{...};-JavaScript-Macros are not
+ // supported any longer.
+ else if( IsParserWorking() )
+ {
+ sTmpBuffer.append( (sal_Unicode)'&' );
+ bNextCh = FALSE;
+ break;
+ }
+
+ bNextCh = (';' == nNextCh);
+ if( cBreak=='>' && (cChar=='\\' || cChar=='\'' ||
+ cChar=='\"' || cChar==' ') )
+ {
+ // ' und " mussen innerhalb von Tags mit einem \
+ // gekennzeichnet werden, um sie von ' und " als Klammern
+ // um Optionen zu unterscheiden. Logischerweise muss
+ // deshalb auch ein \ gekeenzeichnet werden. Ausserdem
+ // schuetzen wir ein Space, weil es kein Trennzeichen
+ // zwischen Optionen ist.
+ sTmpBuffer.append( (sal_Unicode)'\\' );
+ if( MAX_LEN == sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+ }
+ if( IsParserWorking() )
+ {
+ if( cChar )
+ sTmpBuffer.append( cChar );
+ }
+ else if( SVPAR_PENDING==eState && '>'!=cBreak )
+ {
+ // Mit dem '&' Zeichen wieder aufsetzen, der Rest
+ // wird als Texttoken zurueckgegeben.
+ if( aToken.Len() || sTmpBuffer.getLength() )
+ {
+ // Der bisherige Text wird von _GetNextChar()
+ // zurueckgegeben und beim naechsten Aufruf wird
+ // ein neues Zeichen gelesen. Also muessen wir uns
+ // noch vor das & stellen.
+ nNextCh = 0U;
+ rInput.Seek( nStreamPos-(sal_uInt32)GetCharSize() );
+ nlLinePos = nLinePos-1UL;
+ bReadNextChar = TRUE;
+ }
+ bNextCh = FALSE;
+ }
+ }
+ break;
+ case '=':
+ if( '>'==cBreak && !cQuote )
+ bEqSignFound = TRUE;
+ sTmpBuffer.append( nNextCh );
+ break;
+
+ case '\\':
+ if( '>'==cBreak )
+ {
+ // Innerhalb von Tags kennzeichnen
+ sTmpBuffer.append( (sal_Unicode)'\\' );
+ if( MAX_LEN == sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+ }
+ sTmpBuffer.append( (sal_Unicode)'\\' );
+ break;
+
+ case '\"':
+ case '\'':
+ if( '>'==cBreak )
+ {
+ if( bEqSignFound )
+ cQuote = nNextCh;
+ else if( cQuote && (cQuote==nNextCh ) )
+ cQuote = 0U;
+ }
+ sTmpBuffer.append( nNextCh );
+ bEqSignFound = FALSE;
+ break;
+
+ case sal_Unicode(EOF):
+ if( rInput.IsEof() )
+ {
+// MIB 20.11.98: Das macht hier keinen Sinn, oder doch: Zumindest wird
+// abc&auml;<EOF> nicht angezeigt, also lassen wir das in Zukunft.
+// if( '>' != cBreak )
+// eState = SVPAR_ACCEPTED;
+ bWeiter = FALSE;
+ }
+ else
+ {
+ sTmpBuffer.append( nNextCh );
+ }
+ break;
+
+ case '<':
+ bEqSignFound = FALSE;
+ if( '>'==cBreak )
+ sTmpBuffer.append( nNextCh );
+ else
+ bWeiter = FALSE; // Abbrechen, String zusammen
+ break;
+
+ case '\f':
+ if( '>' == cBreak )
+ {
+ // Beim Scannen von Optionen wie ein Space behandeln
+ sTmpBuffer.append( (sal_Unicode)' ' );
+ }
+ else
+ {
+ // sonst wird es ein eigenes Token
+ bWeiter = FALSE;
+ }
+ break;
+
+ case '\r':
+ case '\n':
+ if( '>'==cBreak )
+ {
+ // #26979# cr/lf in Tag wird in _GetNextToken() behandeln
+ sTmpBuffer.append( nNextCh );
+ break;
+ }
+ else if( bReadListing || bReadXMP || bReadPRE || bReadTextArea )
+ {
+ bWeiter = FALSE;
+ break;
+ }
+ // Bug 18984: CR-LF -> Blank
+ // Folge von CR/LF/BLANK/TAB nur in ein Blank wandeln
+ // kein break!!
+ case '\t':
+ if( '\t'==nNextCh && bReadPRE && '>'!=cBreak )
+ {
+ // In <PRE>: Tabs nach oben durchreichen
+ bWeiter = FALSE;
+ break;
+ }
+ // kein break
+ case '\x0b':
+ if( '\x0b'==nNextCh && (bReadPRE || bReadXMP ||bReadListing) &&
+ '>'!=cBreak )
+ {
+ break;
+ }
+ nNextCh = ' ';
+ // kein break;
+ case ' ':
+ sTmpBuffer.append( nNextCh );
+ if( '>'!=cBreak && (!bReadListing && !bReadXMP &&
+ !bReadPRE && !bReadTextArea) )
+ {
+ // alle Folgen von Blanks/Tabs/CR/LF zu einem Blank umwandeln
+ do {
+ if( sal_Unicode(EOF) == (nNextCh = GetNextChar()) &&
+ rInput.IsEof() )
+ {
+ if( aToken.Len() || sTmpBuffer.getLength() > 1L )
+ {
+ // ausser den Blanks wurde noch etwas geselen
+ aToken += String(sTmpBuffer.makeStringAndClear());
+ return HTML_TEXTTOKEN;
+ }
+ else
+ // nur Blanks gelesen: dann darf kein Text
+ // mehr zurueckgegeben werden und _GetNextToken
+ // muss auf EOF laufen
+ return 0;
+ }
+ } while ( ' ' == nNextCh || '\t' == nNextCh ||
+ '\r' == nNextCh || '\n' == nNextCh ||
+ '\x0b' == nNextCh );
+ bNextCh = FALSE;
+ }
+ break;
+
+ default:
+ bEqSignFound = FALSE;
+ if( (nNextCh==cBreak && !cQuote) ||
+ (ULONG(aToken.Len()) + MAX_LEN) > ULONG(STRING_MAXLEN & ~1 ))
+ bWeiter = FALSE;
+ else
+ {
+ do {
+ // alle anderen Zeichen kommen in den Text
+ sTmpBuffer.append( nNextCh );
+ if( MAX_LEN == sTmpBuffer.getLength() )
+ {
+ aToken += String(sTmpBuffer.makeStringAndClear());
+ if( (ULONG(aToken.Len()) + MAX_LEN) >
+ ULONG(STRING_MAXLEN & ~1 ) )
+ {
+ nNextCh = GetNextChar();
+ return HTML_TEXTTOKEN;
+ }
+ }
+ if( ( sal_Unicode(EOF) == (nNextCh = GetNextChar()) &&
+ rInput.IsEof() ) ||
+ !IsParserWorking() )
+ {
+ if( sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+ return HTML_TEXTTOKEN;
+ }
+ } while( HTML_ISALPHA( nNextCh ) || HTML_ISDIGIT( nNextCh ) );
+ bNextCh = FALSE;
+ }
+ }
+
+ if( MAX_LEN == sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+
+ if( bWeiter && bNextCh )
+ nNextCh = GetNextChar();
+ }
+
+ if( sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+
+ return HTML_TEXTTOKEN;
+}
+
+int HTMLParser::_GetNextRawToken()
+{
+ ::rtl::OUStringBuffer sTmpBuffer( MAX_LEN );
+
+ if( bEndTokenFound )
+ {
+ // beim letzten Aufruf haben wir das End-Token bereits gefunden,
+ // deshalb muessen wir es nicht noch einmal suchen
+ bReadScript = FALSE;
+ bReadStyle = FALSE;
+ aEndToken.Erase();
+ bEndTokenFound = FALSE;
+
+ return 0;
+ }
+
+ // per default geben wir HTML_RAWDATA zurueck
+ int bWeiter = TRUE;
+ int nToken = HTML_RAWDATA;
+ SaveState( 0 );
+ while( bWeiter && IsParserWorking() )
+ {
+ int bNextCh = TRUE;
+ switch( nNextCh )
+ {
+ case '<':
+ {
+ // Vielleicht haben wir das Ende erreicht
+
+ // das bisher gelesene erstmal retten
+ aToken += String(sTmpBuffer.makeStringAndClear());
+
+ // und die Position im Stream merken
+ ULONG nStreamPos = rInput.Tell();
+ ULONG nLineNr = GetLineNr();
+ ULONG nLinePos = GetLinePos();
+
+ // Start eines End-Token?
+ int bOffState = FALSE;
+ if( '/' == (nNextCh = GetNextChar()) )
+ {
+ bOffState = TRUE;
+ nNextCh = GetNextChar();
+ }
+ else if( '!' == nNextCh )
+ {
+ sTmpBuffer.append( nNextCh );
+ nNextCh = GetNextChar();
+ }
+
+ // jetzt die Buchstaben danach lesen
+ while( (HTML_ISALPHA(nNextCh) || '-'==nNextCh) &&
+ IsParserWorking() && sTmpBuffer.getLength() < MAX_LEN )
+ {
+ sTmpBuffer.append( nNextCh );
+ nNextCh = GetNextChar();
+ }
+
+ String aTok( sTmpBuffer.getStr(),
+ (sal_uInt32)sTmpBuffer.getLength() );
+ aTok.ToUpperAscii();
+ BOOL bDone = FALSE;
+ if( bReadScript || aEndToken.Len() )
+ {
+ if( !bReadComment )
+ {
+ if( aTok.CompareToAscii( sHTML_comment, 3UL )
+ == COMPARE_EQUAL )
+ {
+ bReadComment = TRUE;
+ }
+ else
+ {
+ // ein Script muss mit "</SCRIPT>" aufhoehren, wobei
+ // wir es mit dem ">" aus sicherheitsgruenden
+ // erstmal nicht so genau nehmen
+ bDone = bOffState && // '>'==nNextCh &&
+ COMPARE_EQUAL == ( bReadScript
+ ? aTok.CompareToAscii(sHTML_script)
+ : aTok.CompareTo(aEndToken) );
+ }
+ }
+ if( bReadComment && '>'==nNextCh && aTok.Len() >= 2UL &&
+ aTok.Copy( aTok.Len()-2UL ).EqualsAscii( "--" ) )
+ {
+ // hier ist ein Kommentar der Art <!-----> zuende
+ bReadComment = FALSE;
+ }
+ }
+ else
+ {
+ // ein Style-Sheet kann mit </STYLE>, </HEAD> oder
+ // <BODY> aughoehren
+ if( bOffState )
+ bDone = aTok.CompareToAscii(sHTML_style)
+ == COMPARE_EQUAL ||
+ aTok.CompareToAscii(sHTML_head)
+ == COMPARE_EQUAL;
+ else
+ bDone =
+ aTok.CompareToAscii(sHTML_body) == COMPARE_EQUAL;
+ }
+
+ if( bDone )
+ {
+ // das war's, jetzt muessen wir gegebenenfalls den
+ // bisher gelesenen String zurueckgeben und dnach normal
+ // weitermachen
+
+ bWeiter = FALSE;
+
+ // nToken==0 heisst, dass _GetNextToken gleich weiterliest
+ if( !aToken.Len() && (bReadStyle || bReadScript) )
+ {
+ // wir koennen sofort die Umgebung beeden und
+ // das End-Token parsen
+ bReadScript = FALSE;
+ bReadStyle = FALSE;
+ aEndToken.Erase();
+ nToken = 0;
+ }
+ else
+ {
+ // wir muessen bReadScript/bReadStyle noch am
+ // Leben lassen und koennen erst beim naechsten
+ // mal das End-Token Parsen
+ bEndTokenFound = TRUE;
+ }
+
+ // jetzt fahren wir im Stream auf das '<' zurueck
+ rInput.Seek( nStreamPos );
+ SetLineNr( nLineNr );
+ SetLinePos( nLinePos );
+ nNextCh = '<';
+
+ // den String wollen wir nicht an das Token haengen
+ sTmpBuffer.setLength( 0L );
+ }
+ else
+ {
+ // "</" merken, alles andere steht noch im buffer
+ aToken += (sal_Unicode)'<';
+ if( bOffState )
+ aToken += (sal_Unicode)'/';
+
+ bNextCh = FALSE;
+ }
+ }
+ break;
+ case '-':
+ sTmpBuffer.append( nNextCh );
+ if( bReadComment )
+ {
+ BOOL bTwoMinus = FALSE;
+ nNextCh = GetNextChar();
+ while( '-' == nNextCh && IsParserWorking() )
+ {
+ bTwoMinus = TRUE;
+
+ if( MAX_LEN == sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+ sTmpBuffer.append( nNextCh );
+ nNextCh = GetNextChar();
+ }
+
+ if( '>' == nNextCh && IsParserWorking() && bTwoMinus )
+ bReadComment = FALSE;
+
+ bNextCh = FALSE;
+ }
+ break;
+
+ case '\r':
+ // \r\n? beendet das aktuelle Text-Token (auch wenn es leer ist)
+ nNextCh = GetNextChar();
+ if( nNextCh=='\n' )
+ nNextCh = GetNextChar();
+ bWeiter = FALSE;
+ break;
+ case '\n':
+ // \n beendet das aktuelle Text-Token (auch wenn es leer ist)
+ nNextCh = GetNextChar();
+ bWeiter = FALSE;
+ break;
+ case sal_Unicode(EOF):
+ // eof beendet das aktuelle Text-Token und tut so, als ob
+ // ein End-Token gelesen wurde
+ if( rInput.IsEof() )
+ {
+ bWeiter = FALSE;
+ if( aToken.Len() || sTmpBuffer.getLength() )
+ {
+ bEndTokenFound = TRUE;
+ }
+ else
+ {
+ bReadScript = FALSE;
+ bReadStyle = FALSE;
+ aEndToken.Erase();
+ nToken = 0;
+ }
+ break;
+ }
+ // kein break
+ default:
+ // alle anderen Zeichen landen im Buffer
+ sTmpBuffer.append( nNextCh );
+ break;
+ }
+
+ if( (!bWeiter && sTmpBuffer.getLength() > 0L) ||
+ MAX_LEN == sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+
+ if( bWeiter && bNextCh )
+ nNextCh = GetNextChar();
+ }
+
+ if( IsParserWorking() )
+ SaveState( 0 );
+ else
+ nToken = 0;
+
+ return nToken;
+}
+
+// scanne das naechste Token,
+int __EXPORT HTMLParser::_GetNextToken()
+{
+ int nRet = 0;
+ sSaveToken.Erase();
+
+ // die Optionen loeschen
+ if( pOptions->Count() )
+ pOptions->DeleteAndDestroy( 0, pOptions->Count() );
+
+ if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter!
+ return 0;
+
+ BOOL bReadNextCharSave = bReadNextChar;
+ if( bReadNextChar )
+ {
+ DBG_ASSERT( !bEndTokenFound,
+ "</SCRIPT> gelesen und trotzdem noch ein Zeichen lesen?" );
+ nNextCh = GetNextChar();
+ if( !IsParserWorking() ) // wenn schon Fehler, dann nicht weiter!
+ return 0;
+ bReadNextChar = FALSE;
+ }
+
+ if( bReadScript || bReadStyle || aEndToken.Len() )
+ {
+ nRet = _GetNextRawToken();
+ if( nRet || !IsParserWorking() )
+ return nRet;
+ }
+
+ do {
+ int bNextCh = TRUE;
+ switch( nNextCh )
+ {
+ case '<':
+ {
+ ULONG nStreamPos = rInput.Tell();
+ ULONG nLineNr = GetLineNr();
+ ULONG nLinePos = GetLinePos();
+
+ int bOffState = FALSE;
+ if( '/' == (nNextCh = GetNextChar()) )
+ {
+ bOffState = TRUE;
+ nNextCh = GetNextChar();
+ }
+ if( HTML_ISALPHA( nNextCh ) || '!'==nNextCh ) // fix #26984#
+ {
+ ::rtl::OUStringBuffer sTmpBuffer;
+ do {
+ sTmpBuffer.append( nNextCh );
+ if( MAX_LEN == sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+ nNextCh = GetNextChar();
+ } while( '>' != nNextCh && !HTML_ISSPACE( nNextCh ) &&
+ IsParserWorking() && !rInput.IsEof() );
+
+ if( sTmpBuffer.getLength() )
+ aToken += String(sTmpBuffer.makeStringAndClear());
+
+ // Blanks ueberlesen
+ while( HTML_ISSPACE( nNextCh ) && IsParserWorking() )
+ nNextCh = GetNextChar();
+
+ if( !IsParserWorking() )
+ {
+ if( SVPAR_PENDING == eState )
+ bReadNextChar = bReadNextCharSave;
+ break;
+ }
+
+ // suche das Token in der Tabelle:
+ sSaveToken = aToken;
+ aToken.ToUpperAscii();
+ if( 0 == (nRet = GetHTMLToken( aToken )) )
+ // Unknown Control
+ nRet = HTML_UNKNOWNCONTROL_ON;
+
+ // Wenn es ein Token zum ausschalten ist ...
+ if( bOffState )
+ {
+ if( HTML_TOKEN_ONOFF & nRet )
+ {
+ // und es ein Off-Token gibt, das daraus machen
+ ++nRet;
+ }
+ else if( HTML_LINEBREAK!=nRet )
+ {
+ // und es kein Off-Token gibt, ein unbekanntes
+ // Token daraus machen (ausser </BR>, das wird
+ // wie <BR> behandelt
+ nRet = HTML_UNKNOWNCONTROL_OFF;
+ }
+ }
+
+ if( nRet == HTML_COMMENT )
+ {
+ // fix: sSaveToken wegen Gross-/Kleinschreibung
+ // als Anfang des Kommentars benutzen und ein
+ // Space anhaengen.
+ aToken = sSaveToken;
+ if( '>'!=nNextCh )
+ aToken += (sal_Unicode)' ';
+ ULONG nCStreamPos = 0UL;
+ ULONG nCLineNr, nCLinePos;
+ sal_uInt32 nCStrLen;
+
+ BOOL bDone = FALSE;
+ // bis zum schliessenden --> lesen. wenn keins gefunden
+ // wurde beim der ersten > wieder aufsetzen
+ while( !bDone && !rInput.IsEof() && IsParserWorking() )
+ {
+ if( '>'==nNextCh )
+ {
+ if( !nCStreamPos )
+ {
+ nCStreamPos = rInput.Tell();
+ nCStrLen = aToken.Len();
+ nCLineNr = GetLineNr();
+ nCLinePos = GetLinePos();
+ }
+ bDone = aToken.Len() >= 2UL &&
+ aToken.Copy(aToken.Len()-2UL,2UL).
+ EqualsAscii( "--" );
+ if( !bDone )
+ aToken += nNextCh;
+ }
+ else
+ aToken += nNextCh;
+ if( !bDone )
+ nNextCh = GetNextChar();
+ }
+ if( !bDone && IsParserWorking() && nCStreamPos )
+ {
+ rInput.Seek( nCStreamPos );
+ SetLineNr( nCLineNr );
+ SetLinePos( nCLinePos );
+ aToken.Erase( nCStrLen );
+ nNextCh = '>';
+ }
+ }
+ else
+ {
+ // den TokenString koennen wir jetzt verwerfen
+ aToken.Erase();
+ }
+
+ // dann lesen wir mal alles bis zur schliessenden '>'
+ if( '>' != nNextCh && IsParserWorking() )
+ {
+ ScanText( '>' );
+ if( sal_Unicode(EOF) == nNextCh && rInput.IsEof() )
+ {
+ // zurueck hinter die < gehen und dort neu
+ // aufsetzen, das < als Text zurueckgeben
+ rInput.Seek( nStreamPos );
+ SetLineNr( nLineNr );
+ SetLinePos( nLinePos );
+
+ aToken = '<';
+ nRet = HTML_TEXTTOKEN;
+ nNextCh = GetNextChar();
+ bNextCh = FALSE;
+ break;
+ }
+ }
+ if( SVPAR_PENDING == eState )
+ bReadNextChar = bReadNextCharSave;
+ }
+ else
+ {
+ if( bOffState )
+ {
+ // einfach alles wegschmeissen
+ ScanText( '>' );
+ if( sal_Unicode(EOF) == nNextCh && rInput.IsEof() )
+ {
+ // zurueck hinter die < gehen und dort neu
+ // aufsetzen, das < als Text zurueckgeben
+ rInput.Seek( nStreamPos );
+ SetLineNr( nLineNr );
+ SetLinePos( nLinePos );
+
+ aToken = '<';
+ nRet = HTML_TEXTTOKEN;
+ nNextCh = GetNextChar();
+ bNextCh = FALSE;
+ break;
+ }
+ if( SVPAR_PENDING == eState )
+ bReadNextChar = bReadNextCharSave;
+ aToken.Erase();
+ }
+ else if( '%' == nNextCh )
+ {
+ nRet = HTML_UNKNOWNCONTROL_ON;
+
+ ULONG nCStreamPos = rInput.Tell();
+ ULONG nCLineNr = GetLineNr(), nCLinePos = GetLinePos();
+
+ BOOL bDone = FALSE;
+ // bis zum schliessenden %> lesen. wenn keins gefunden
+ // wurde beim der ersten > wieder aufsetzen
+ while( !bDone && !rInput.IsEof() && IsParserWorking() )
+ {
+ bDone = '>'==nNextCh && aToken.Len() >= 1UL &&
+ '%' == aToken.GetChar( aToken.Len()-1UL );
+ if( !bDone )
+ {
+ aToken += nNextCh;
+ nNextCh = GetNextChar();
+ }
+ }
+ if( !bDone && IsParserWorking() )
+ {
+ rInput.Seek( nCStreamPos );
+ SetLineNr( nCLineNr );
+ SetLinePos( nCLinePos );
+ aToken.AssignAscii( "<%", 2UL );
+ nRet = HTML_TEXTTOKEN;
+ break;
+ }
+ if( IsParserWorking() )
+ {
+ sSaveToken = aToken;
+ aToken.Erase();
+ }
+ }
+ else
+ {
+ aToken = '<';
+ nRet = HTML_TEXTTOKEN;
+ bNextCh = FALSE;
+ break;
+ }
+ }
+
+ if( IsParserWorking() )
+ {
+ bNextCh = '>' == nNextCh;
+ switch( nRet )
+ {
+ case HTML_TEXTAREA_ON:
+ bReadTextArea = TRUE;
+ break;
+ case HTML_TEXTAREA_OFF:
+ bReadTextArea = FALSE;
+ break;
+ case HTML_SCRIPT_ON:
+ if( !bReadTextArea )
+ bReadScript = TRUE;
+ break;
+ case HTML_SCRIPT_OFF:
+ if( !bReadTextArea )
+ {
+ bReadScript = FALSE;
+ // JavaScript kann den Stream veraendern
+ // also muss das letzte Zeichen nochmals
+ // gelesen werden
+ bReadNextChar = TRUE;
+ bNextCh = FALSE;
+ }
+ break;
+
+ case HTML_STYLE_ON:
+ bReadStyle = TRUE;
+ break;
+ case HTML_STYLE_OFF:
+ bReadStyle = FALSE;
+ break;
+ }
+
+ }
+ }
+ break;
+
+ case sal_Unicode(EOF):
+ if( rInput.IsEof() )
+ {
+ eState = SVPAR_ACCEPTED;
+ nRet = nNextCh;
+ }
+ else
+ {
+ // normalen Text lesen
+ goto scan_text;
+ }
+ break;
+
+ case '\f':
+ // Form-Feeds werden jetzt extra nach oben gereicht
+ nRet = HTML_LINEFEEDCHAR; // !!! eigentlich FORMFEEDCHAR
+ break;
+
+ case '\n':
+ case '\r':
+ if( bReadListing || bReadXMP || bReadPRE || bReadTextArea )
+ {
+ sal_Unicode c = GetNextChar();
+ if( ( '\n' != nNextCh || '\r' != c ) &&
+ ( '\r' != nNextCh || '\n' != c ) )
+ {
+ bNextCh = FALSE;
+ nNextCh = c;
+ }
+ nRet = HTML_NEWPARA;
+ break;
+ }
+ // kein break !
+ case '\t':
+ if( bReadPRE )
+ {
+ nRet = HTML_TABCHAR;
+ break;
+ }
+ // kein break !
+ case ' ':
+ // kein break !
+ default:
+
+scan_text:
+ // es folgt "normaler" Text
+ nRet = ScanText();
+ bNextCh = 0 == aToken.Len();
+
+ // der Text sollte noch verarbeitet werden
+ if( !bNextCh && eState == SVPAR_PENDING )
+ {
+ eState = SVPAR_WORKING;
+ bReadNextChar = TRUE;
+ }
+
+ break;
+ }
+
+ if( bNextCh && SVPAR_WORKING == eState )
+ {
+ nNextCh = GetNextChar();
+ if( SVPAR_PENDING == eState && nRet && HTML_TEXTTOKEN != nRet )
+ {
+ bReadNextChar = TRUE;
+ eState = SVPAR_WORKING;
+ }
+ }
+
+ } while( !nRet && SVPAR_WORKING == eState );
+
+ if( SVPAR_PENDING == eState )
+ nRet = -1; // irgendwas ungueltiges
+
+ return nRet;
+}
+
+void HTMLParser::UnescapeToken()
+{
+ sal_uInt32 nPos=0UL;
+
+ BOOL bEscape = FALSE;
+ while( nPos < aToken.Len() )
+ {
+ BOOL bOldEscape = bEscape;
+ bEscape = FALSE;
+ if( '\\'==aToken.GetChar(nPos) && !bOldEscape )
+ {
+ aToken.Erase( nPos, 1UL );
+ bEscape = TRUE;
+ }
+ else
+ {
+ nPos++;
+ }
+ }
+}
+
+// hole die Optionen
+const HTMLOptions *HTMLParser::GetOptions( USHORT *pNoConvertToken ) const
+{
+ // wenn die Option fuer das aktuelle Token schon einmal
+ // geholt wurden, geben wir sie noch einmal zurueck
+ if( pOptions->Count() )
+ return pOptions;
+
+ sal_uInt32 nPos = 0UL;
+ while( nPos < aToken.Len() )
+ {
+ // ein Zeichen ? Dann faengt hier eine Option an
+ if( HTML_ISALPHA( aToken.GetChar(nPos) ) )
+ {
+ USHORT nToken;
+ String aValue;
+ sal_uInt32 nStt = nPos;
+ register sal_Unicode c;
+
+ // Eigentlich sind hier nur ganz bestimmte Zeichen erlaubt.
+ // Netscape achtet aber nur auf "=" und Leerzeichen (siehe
+ // Mozilla: PA_FetchRequestedNameValues in
+ // lipparse/pa_mdl.c
+// while( nPos < aToken.Len() &&
+// ( '-'==(c=aToken[nPos]) || isalnum(c) || '.'==c || '_'==c) )
+ while( nPos < aToken.Len() && '=' != (c=aToken.GetChar(nPos)) &&
+ HTML_ISPRINTABLE(c) && !HTML_ISSPACE(c) )
+ nPos++;
+
+ String sName( aToken.Copy( nStt, nPos-nStt ) );
+
+//JP 23.03.97: die PlugIns wollen die TokenName im "Original" haben
+// also nur fuers Suchen in UpperCase wandeln
+ String sNameUpperCase( sName );
+ sNameUpperCase.ToUpperAscii();
+
+ nToken = GetHTMLOption( sNameUpperCase ); // der Name ist fertig
+ DBG_ASSERTWARNING( nToken!=HTML_O_UNKNOWN,
+ "GetOption: unbekannte HTML-Option" );
+ BOOL bStripCRLF = (nToken < HTML_OPTION_SCRIPT_START ||
+ nToken >= HTML_OPTION_SCRIPT_END) &&
+ (!pNoConvertToken || nToken != *pNoConvertToken);
+
+ while( nPos < aToken.Len() &&
+ ( !HTML_ISPRINTABLE( (c=aToken.GetChar(nPos)) ) ||
+ HTML_ISSPACE(c) ) )
+ nPos++;
+
+ // hat die Option auch einen Wert?
+ if( nPos!=aToken.Len() && '='==c )
+ {
+ nPos++;
+
+ while( nPos < aToken.Len() &&
+ ( !HTML_ISPRINTABLE( (c=aToken.GetChar(nPos)) ) ||
+ ' '==c || '\t'==c || '\r'==c || '\n'==c ) )
+ nPos++;
+
+ if( nPos != aToken.Len() )
+ {
+ sal_uInt32 nLen = 0UL;
+ nStt = nPos;
+ if( ('"'==c) || ('\'')==c )
+ {
+ sal_Unicode cEnd = c;
+ nPos++; nStt++;
+ BOOL bDone = FALSE;
+ BOOL bEscape = FALSE;
+ while( nPos < aToken.Len() && !bDone )
+ {
+ BOOL bOldEscape = bEscape;
+ bEscape = FALSE;
+ c = aToken.GetChar(nPos);
+ switch( c )
+ {
+ case '\r':
+ case '\n':
+ if( bStripCRLF )
+ ((String &)aToken).Erase( nPos, 1UL );
+ else
+ nPos++, nLen++;
+ break;
+ case '\\':
+ if( bOldEscape )
+ {
+ nPos++, nLen++;
+ }
+ else
+ {
+ ((String &)aToken).Erase( nPos, 1UL );
+ bEscape = TRUE;
+ }
+ break;
+ case '"':
+ case '\'':
+ bDone = !bOldEscape && c==cEnd;
+ if( !bDone )
+ nPos++, nLen++;
+ break;
+ default:
+ nPos++, nLen++;
+ break;
+ }
+ }
+ if( nPos!=aToken.Len() )
+ nPos++;
+ }
+ else
+ {
+ // hier sind wir etwas laxer als der
+ // Standard und erlauben alles druckbare
+ BOOL bEscape = FALSE;
+ BOOL bDone = FALSE;
+ while( nPos < aToken.Len() && !bDone )
+ {
+ BOOL bOldEscape = bEscape;
+ bEscape = FALSE;
+ sal_Unicode c = aToken.GetChar(nPos);
+ switch( c )
+ {
+ case ' ':
+ bDone = !bOldEscape;
+ if( !bDone )
+ nPos++, nLen++;
+ break;
+
+ case '\t':
+ case '\r':
+ case '\n':
+ bDone = TRUE;
+ break;
+
+ case '\\':
+ if( bOldEscape )
+ {
+ nPos++, nLen++;
+ }
+ else
+ {
+ ((String &)aToken).Erase( nPos, 1UL );
+ bEscape = TRUE;
+ }
+ break;
+
+ default:
+ if( HTML_ISPRINTABLE( c ) )
+ nPos++, nLen++;
+ else
+ bDone = TRUE;
+ break;
+ }
+ }
+ }
+
+ if( nLen )
+ aValue = aToken.Copy( nStt, nLen );
+ }
+ }
+
+ // Wir kennen das Token und koennen es Speichern
+ HTMLOption *pOption =
+ new HTMLOption( nToken, sName, aValue );
+
+ pOptions->Insert( pOption, pOptions->Count() );
+
+ }
+ else
+ // white space un unerwartete Zeichen ignorieren wie
+ nPos++;
+ }
+
+ return pOptions;
+}
+
+int HTMLParser::FilterPRE( int nToken )
+{
+ switch( nToken )
+ {
+#ifdef HTML_BEHAVIOUR
+ // diese werden laut Definition zu LFs
+ case HTML_PARABREAK_ON:
+ case HTML_LINEBREAK:
+ nToken = HTML_NEWPARA;
+#else
+ // in Netscape zeigen sie aber nur in nicht-leeren Absaetzen Wirkung
+ case HTML_PARABREAK_ON:
+ nToken = HTML_LINEBREAK;
+ case HTML_LINEBREAK:
+#endif
+ case HTML_NEWPARA:
+ nPre_LinePos = 0UL;
+ if( bPre_IgnoreNewPara )
+ nToken = 0;
+ break;
+
+ case HTML_TABCHAR:
+ {
+ sal_uInt32 nSpaces = 8UL - (nPre_LinePos % 8UL);
+ DBG_ASSERT( !aToken.Len(), "Wieso ist das Token nicht leer?" );
+ aToken.Expand( nSpaces, ' ' );
+ nPre_LinePos += nSpaces;
+ nToken = HTML_TEXTTOKEN;
+ }
+ break;
+ // diese bleiben erhalten
+ case HTML_TEXTTOKEN:
+ nPre_LinePos += aToken.Len();
+ break;
+
+ case HTML_SELECT_ON:
+ case HTML_SELECT_OFF:
+ case HTML_BODY_ON:
+ case HTML_FORM_ON:
+ case HTML_FORM_OFF:
+ case HTML_INPUT:
+ case HTML_OPTION:
+ case HTML_TEXTAREA_ON:
+ case HTML_TEXTAREA_OFF:
+
+ case HTML_IMAGE:
+ case HTML_APPLET_ON:
+ case HTML_APPLET_OFF:
+ case HTML_PARAM:
+ case HTML_EMBED:
+
+ case HTML_HEAD1_ON:
+ case HTML_HEAD1_OFF:
+ case HTML_HEAD2_ON:
+ case HTML_HEAD2_OFF:
+ case HTML_HEAD3_ON:
+ case HTML_HEAD3_OFF:
+ case HTML_HEAD4_ON:
+ case HTML_HEAD4_OFF:
+ case HTML_HEAD5_ON:
+ case HTML_HEAD5_OFF:
+ case HTML_HEAD6_ON:
+ case HTML_HEAD6_OFF:
+ case HTML_BLOCKQUOTE_ON:
+ case HTML_BLOCKQUOTE_OFF:
+ case HTML_ADDRESS_ON:
+ case HTML_ADDRESS_OFF:
+ case HTML_HORZRULE:
+
+ case HTML_CENTER_ON:
+ case HTML_CENTER_OFF:
+ case HTML_DIVISION_ON:
+ case HTML_DIVISION_OFF:
+
+ case HTML_SCRIPT_ON:
+ case HTML_SCRIPT_OFF:
+ case HTML_RAWDATA:
+
+ case HTML_TABLE_ON:
+ case HTML_TABLE_OFF:
+ case HTML_CAPTION_ON:
+ case HTML_CAPTION_OFF:
+ case HTML_COLGROUP_ON:
+ case HTML_COLGROUP_OFF:
+ case HTML_COL_ON:
+ case HTML_COL_OFF:
+ case HTML_THEAD_ON:
+ case HTML_THEAD_OFF:
+ case HTML_TFOOT_ON:
+ case HTML_TFOOT_OFF:
+ case HTML_TBODY_ON:
+ case HTML_TBODY_OFF:
+ case HTML_TABLEROW_ON:
+ case HTML_TABLEROW_OFF:
+ case HTML_TABLEDATA_ON:
+ case HTML_TABLEDATA_OFF:
+ case HTML_TABLEHEADER_ON:
+ case HTML_TABLEHEADER_OFF:
+
+ case HTML_ANCHOR_ON:
+ case HTML_ANCHOR_OFF:
+ case HTML_BOLD_ON:
+ case HTML_BOLD_OFF:
+ case HTML_ITALIC_ON:
+ case HTML_ITALIC_OFF:
+ case HTML_UNDERLINE_ON:
+ case HTML_UNDERLINE_OFF:
+ case HTML_BASEFONT_ON:
+ case HTML_BASEFONT_OFF:
+ case HTML_FONT_ON:
+ case HTML_FONT_OFF:
+ case HTML_BLINK_ON:
+ case HTML_BLINK_OFF:
+ case HTML_SPAN_ON:
+ case HTML_SPAN_OFF:
+ break;
+
+ // der Rest wird als unbekanntes Token behandelt
+ default:
+ if( nToken )
+ {
+ nToken =
+ ( ((HTML_TOKEN_ONOFF & nToken) && (1 & nToken))
+ ? HTML_UNKNOWNCONTROL_OFF
+ : HTML_UNKNOWNCONTROL_ON );
+ }
+ break;
+ }
+
+ bPre_IgnoreNewPara = FALSE;
+
+ return nToken;
+}
+
+int HTMLParser::FilterXMP( int nToken )
+{
+ switch( nToken )
+ {
+ case HTML_NEWPARA:
+ if( bPre_IgnoreNewPara )
+ nToken = 0;
+ case HTML_TEXTTOKEN:
+ case HTML_NONBREAKSPACE:
+ case HTML_SOFTHYPH:
+ break; // bleiben erhalten
+
+ default:
+ if( nToken )
+ {
+ if( (HTML_TOKEN_ONOFF & nToken) && (1 & nToken) )
+ {
+ sSaveToken.Insert( '<', 0UL );
+ sSaveToken.Insert( '/', 1UL );
+ }
+ else
+ sSaveToken.Insert( '<', 0UL );
+ if( aToken.Len() )
+ {
+ UnescapeToken();
+ sSaveToken += (sal_Unicode)' ';
+ aToken.Insert( sSaveToken, 0UL );
+ }
+ else
+ aToken = sSaveToken;
+ aToken += (sal_Unicode)'>';
+ nToken = HTML_TEXTTOKEN;
+ }
+ break;
+ }
+
+ bPre_IgnoreNewPara = FALSE;
+
+ return nToken;
+}
+
+int HTMLParser::FilterListing( int nToken )
+{
+ switch( nToken )
+ {
+ case HTML_NEWPARA:
+ if( bPre_IgnoreNewPara )
+ nToken = 0;
+ case HTML_TEXTTOKEN:
+ case HTML_NONBREAKSPACE:
+ case HTML_SOFTHYPH:
+ break; // bleiben erhalten
+
+ default:
+ if( nToken )
+ {
+ nToken =
+ ( ((HTML_TOKEN_ONOFF & nToken) && (1 & nToken))
+ ? HTML_UNKNOWNCONTROL_OFF
+ : HTML_UNKNOWNCONTROL_ON );
+ }
+ break;
+ }
+
+ bPre_IgnoreNewPara = FALSE;
+
+ return nToken;
+}
+
+FASTBOOL HTMLParser::IsHTMLFormat( const sal_Char* pHeader,
+ BOOL bSwitchToUCS2,
+ rtl_TextEncoding eEnc )
+{
+ // Einer der folgenden regulaeren Ausdrucke muss sich auf den String
+ // anwenden lassen, damit das Dok ein HTML-Dokument ist.
+ //
+ // ^[^<]*<[^ \t]*[> \t]
+ // -------
+ // ^<!
+ //
+ // wobei der unterstrichene Teilausdruck einem HTML-Token
+ // ensprechen muss
+
+ ByteString sCmp;
+ BOOL bUCS2B = FALSE;
+ if( bSwitchToUCS2 )
+ {
+ if( 0xfeU == (sal_Char)pHeader[0] &&
+ 0xffU == (sal_Char)pHeader[1] )
+ {
+ eEnc = RTL_TEXTENCODING_UCS2;
+ bUCS2B = TRUE;
+ }
+ else if( 0xffU == (sal_Char)pHeader[0] &&
+ 0xfeU == (sal_Char)pHeader[1] )
+ {
+ eEnc = RTL_TEXTENCODING_UCS2;
+ }
+ }
+ if( RTL_TEXTENCODING_UCS2 == eEnc &&
+ (0xfe == (sal_Char)pHeader[0] && 0xff == (sal_Char)pHeader[1]) ||
+ (0xff == (sal_Char)pHeader[0] && 0xfe == (sal_Char)pHeader[1]) )
+ {
+ if( 0xfe == (sal_Char)pHeader[0] )
+ bUCS2B = TRUE;
+
+ sal_uInt32 nLen;
+ for( nLen = 2UL;
+ pHeader[nLen] != 0 || pHeader[nLen+1UL] != 0;
+ nLen+=2 )
+ ;
+
+ ::rtl::OStringBuffer sTmp( (nLen - 2UL)/2UL );
+ for( sal_uInt32 nPos = 2UL; nPos < nLen; nPos += 2UL )
+ {
+ sal_Unicode cUC;
+ if( bUCS2B )
+ cUC = (sal_Unicode(pHeader[nPos]) << 8) | pHeader[nPos+1UL];
+ else
+ cUC = (sal_Unicode(pHeader[nPos+1UL]) << 8) | pHeader[nPos];
+ if( 0U == cUC )
+ break;
+
+ sTmp.append( cUC < 256U ? (sal_Char)cUC : '.' );
+ }
+ sCmp = ByteString( sTmp.makeStringAndClear() );
+ }
+ else
+ {
+ sCmp = (sal_Char *)pHeader;
+ }
+
+ sCmp.ToUpperAscii();
+
+ // Ein HTML-Dokument muss in der ersten Zeile ein '<' besitzen
+ sal_uInt32 nStart = sCmp.Search( '<' );
+ if( STRING_NOTFOUND == nStart )
+ return FALSE;
+ nStart++;
+
+ // danach duerfen beliebige andere Zeichen bis zu einem blank oder
+ // '>' kommen
+ sal_Char c;
+ sal_uInt32 nPos;
+ for( nPos = nStart; nPos<sCmp.Len(); nPos++ )
+ {
+ if( '>'==(c=sCmp.GetChar(nPos)) || HTML_ISSPACE(c) )
+ break;
+ }
+
+ // wenn das Dokeument hinter dem < aufhoert ist es wohl kein HTML
+ if( nPos==nStart )
+ return FALSE;
+
+ // die Zeichenkette nach dem '<' muss ausserdem ein bekanntes
+ // HTML Token sein. Damit die Ausgabe eines DOS-dir-Befehls nicht
+ // als HTML interpretiert wird, wird ein <DIR> jedoch nicht als HTML
+ // interpretiert.
+ String sTest( sCmp.Copy( nStart, nPos-nStart ), RTL_TEXTENCODING_ASCII_US );
+ int nTok = GetHTMLToken( sTest );
+ if( 0 != nTok && HTML_DIRLIST_ON != nTok )
+ return TRUE;
+
+ // oder es handelt sich um ein "<!" ganz am Anfang der Datei (fix #27092#)
+ if( nStart == 1UL && '!' == sCmp.GetChar( 1UL ) )
+ return TRUE;
+
+ // oder wir finden irgendwo ein <HTML> in den ersten 80 Zeichen
+ nStart = sCmp.Search( sHTML_html );
+ if( nStart!=STRING_NOTFOUND &&
+ nStart>0UL && '<'==sCmp.GetChar(nStart-1UL) &&
+ nStart+4UL < sCmp.Len() && '>'==sCmp.GetChar(nStart+4UL) )
+ return TRUE;
+
+ // sonst ist es wohl doch eher kein HTML-Dokument
+ return FALSE;
+}
+
+BOOL HTMLParser::InternalImgToPrivateURL( String& rURL )
+{
+ if( rURL.Len() < 19UL || 'i' != rURL.GetChar(0UL) ||
+ rURL.CompareToAscii( sHTML_internal_gopher, 9UL ) != COMPARE_EQUAL )
+ return FALSE;
+
+ BOOL bFound = FALSE;
+
+ if( rURL.CompareToAscii( sHTML_internal_gopher,16UL) == COMPARE_EQUAL )
+ {
+ String aName( rURL.Copy(16UL) );
+ switch( aName.GetChar(0UL) )
+ {
+ case 'b':
+ bFound = aName.EqualsAscii( sHTML_INT_GOPHER_binary );
+ break;
+ case 'i':
+ bFound = aName.EqualsAscii( sHTML_INT_GOPHER_image ) ||
+ aName.EqualsAscii( sHTML_INT_GOPHER_index );
+ break;
+ case 'm':
+ bFound = aName.EqualsAscii( sHTML_INT_GOPHER_menu ) ||
+ aName.EqualsAscii( sHTML_INT_GOPHER_movie );
+ break;
+ case 's':
+ bFound = aName.EqualsAscii( sHTML_INT_GOPHER_sound );
+ break;
+ case 't':
+ bFound = aName.EqualsAscii( sHTML_INT_GOPHER_telnet ) ||
+ aName.EqualsAscii( sHTML_INT_GOPHER_text );
+ break;
+ case 'u':
+ bFound = aName.EqualsAscii( sHTML_INT_GOPHER_unknown );
+ break;
+ }
+ }
+ else if( rURL.CompareToAscii( sHTML_internal_icon,14UL) == COMPARE_EQUAL )
+ {
+ String aName( rURL.Copy(14UL) );
+ switch( aName.GetChar(0UL) )
+ {
+ case 'b':
+ bFound = aName.EqualsAscii( sHTML_INT_ICON_baddata );
+ break;
+ case 'd':
+ bFound = aName.EqualsAscii( sHTML_INT_ICON_delayed );
+ break;
+ case 'e':
+ bFound = aName.EqualsAscii( sHTML_INT_ICON_embed );
+ break;
+ case 'i':
+ bFound = aName.EqualsAscii( sHTML_INT_ICON_insecure );
+ break;
+ case 'n':
+ bFound = aName.EqualsAscii( sHTML_INT_ICON_notfound );
+ break;
+ }
+ }
+ if( bFound )
+ {
+ String sTmp ( rURL );
+ rURL.AssignAscii( sHTML_private_image );
+ rURL.Append( sTmp );
+ }
+
+ return bFound;
+}
+
+
+#ifdef USED
+void HTMLParser::SaveState( int nToken )
+{
+ SvParser::SaveState( nToken );
+}
+
+void HTMLParser::RestoreState()
+{
+ SvParser::RestoreState();
+}
+#endif
+
diff --git a/svtools/source/svrtf/makefile.mk b/svtools/source/svrtf/makefile.mk
new file mode 100644
index 000000000000..ca7c598ef083
--- /dev/null
+++ b/svtools/source/svrtf/makefile.mk
@@ -0,0 +1,105 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=svrtf
+AUTOSEG=true
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(header)" == ""
+
+CXXFILES = \
+ svparser.cxx \
+ parrtf.cxx \
+ rtfout.cxx \
+ rtfkeywd.cxx \
+ rtfkey2.cxx
+
+OBJFILES = $(OBJ)$/rtfkey2.obj
+
+SLOFILES = \
+ $(SLO)$/svparser.obj \
+ $(SLO)$/parrtf.obj \
+ $(SLO)$/rtfout.obj \
+ $(SLO)$/rtfkeywd.obj \
+ $(SLO)$/rtfkey2.obj
+
+# nur damit's was zum builden gibt
+LIB2TARGET =$(LB)$/svrtfk2.lib
+LIB2OBJFILES =$(OBJFILES)
+
+.ENDIF
+
+# ==========================================================================
+
+
+.INCLUDE : target.mk
+
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx
new file mode 100644
index 000000000000..c5da72a9cbf5
--- /dev/null
+++ b/svtools/source/svrtf/parrtf.cxx
@@ -0,0 +1,591 @@
+/*************************************************************************
+ *
+ * $RCSfile: parrtf.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <stdio.h> // for EOF
+
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#include "rtftoken.h"
+#include "rtfkeywd.hxx"
+#include "parrtf.hxx"
+
+const int MAX_STRING_LEN = 1024;
+const int MAX_TOKEN_LEN = 128;
+
+#define RTF_ISDIGIT( c ) (c >= '0' && c <= '9')
+#define RTF_ISALPHA( c ) ( (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') )
+
+SvRTFParser::SvRTFParser( SvStream& rIn, BYTE nStackSize )
+ : SvParser( rIn, nStackSize ),
+ eUNICodeSet( RTL_TEXTENCODING_MS_1252 ) // default ist ANSI-CodeSet
+{
+ // default ist ANSI-CodeSet
+ SetSrcEncoding( RTL_TEXTENCODING_MS_1252 );
+ bRTF_InTextRead = FALSE;
+}
+
+SvRTFParser::~SvRTFParser()
+{
+}
+
+int SvRTFParser::_GetNextToken()
+{
+ int nRet = 0;
+ do {
+ int bNextCh = TRUE;
+ switch( nNextCh )
+ {
+ case '\\':
+ {
+ // Steuerzeichen
+ switch( nNextCh = GetNextChar() )
+ {
+ case '{':
+ case '}':
+ case '\\':
+ aToken = nNextCh;
+ goto ISCHAR_SCANTEXT;
+ case '~': // nonbreaking space
+ aToken = 0xA0;
+ goto ISCHAR_SCANTEXT;
+ case '-': // optional hyphen
+ aToken = 0xAD;
+ goto ISCHAR_SCANTEXT;
+ case '_': // nonbreaking hyphen
+ aToken = 0x2011;
+ goto ISCHAR_SCANTEXT;
+
+ case '\'': // HexValue
+ // es folgt normaler Text
+ aToken = ByteString::ConvertToUnicode( GetHexValue(),
+ GetSrcEncoding() );
+ISCHAR_SCANTEXT:
+ nNextCh = GetNextChar();
+ ScanText();
+ nRet = RTF_TEXTTOKEN;
+ bNextCh = 0 == nNextCh;
+ break;
+
+ case '*': // ignoreflag
+ nRet = RTF_IGNOREFLAG;
+ break;
+ case ':': // subentry in an index entry
+ nRet = RTF_SUBENTRYINDEX;
+ break;
+ case '|': // formula-charakter
+ nRet = RTF_FORMULA;
+ break;
+
+ case 0x0a:
+ case 0x0d:
+ nRet = RTF_PAR;
+ break;
+
+ default:
+ if( RTF_ISALPHA( nNextCh ) )
+ {
+ aToken = '\\';
+ {
+ String aStrBuffer;
+ sal_Unicode* pStr = aStrBuffer.AllocBuffer(
+ MAX_TOKEN_LEN );
+ int nStrLen = 0;
+ do {
+ *(pStr + nStrLen++) = ByteString::
+ ConvertToUnicode( nNextCh,
+ GetSrcEncoding() );
+ if( MAX_TOKEN_LEN == nStrLen )
+ {
+ aToken += aStrBuffer;
+ aToken.GetBufferAccess(); // make unique string!
+ nStrLen = 0;
+ }
+ nNextCh = GetNextChar();
+ } while( RTF_ISALPHA( nNextCh ) );
+ if( nStrLen )
+ {
+ aStrBuffer.ReleaseBufferAccess( nStrLen );
+ aToken += aStrBuffer;
+ }
+ }
+
+ // Minus fuer numerischen Parameter
+ int bNegValue = FALSE;
+ if( '-' == nNextCh )
+ {
+ bNegValue = TRUE;
+ nNextCh = GetNextChar();
+ }
+
+ // evt. Numerischer Parameter
+ if( RTF_ISDIGIT( nNextCh ) )
+ {
+ nTokenValue = 0;
+ do {
+ nTokenValue *= 10;
+ nTokenValue += nNextCh - '0';
+ nNextCh = GetNextChar();
+ } while( RTF_ISDIGIT( nNextCh ) );
+ if( bNegValue )
+ nTokenValue = -nTokenValue;
+ }
+ else if( bNegValue ) // das Minus wieder zurueck
+ {
+ nNextCh = '-';
+ rInput.SeekRel( -1 );
+ }
+ if( ' ' == nNextCh ) // Blank gehoert zum Token!
+ nNextCh = GetNextChar();
+
+ // suche das Token in der Tabelle:
+ if( 0 == (nRet = GetRTFToken( aToken )) )
+ // Unknown Control
+ nRet = RTF_UNKNOWNCONTROL;
+
+ // bug 76812 - unicode token handled as normal text
+ if( !bRTF_InTextRead && RTF_U == nRet )
+ {
+ nRet = RTF_TEXTTOKEN;
+ aToken = (sal_Unicode)nTokenValue;
+
+ // das naechste Zeichen noch ueberlesen
+ // JP 10.12.98: das kann auch ein \{, \}, \'88 sein!
+ sal_Unicode cAnsi = nNextCh;
+ while( 0xD == cAnsi )
+ cAnsi = GetNextChar();
+ while( 0xA == cAnsi )
+ cAnsi = GetNextChar();
+
+ if( '\\' == cAnsi &&
+ '\'' == ( cAnsi = GetNextChar() ))
+ // HexValue ueberlesen
+ cAnsi = GetHexValue();
+
+ // the next char must be read
+ bNextCh = TRUE;
+ break;
+ }
+ }
+ else if( SVPAR_PENDING != eState )
+ {
+ // Bug 34631 - "\ " ueberlesen - Blank als Zeichen
+ // eState = SVPAR_ERROR;
+ }
+
+ bNextCh = FALSE;
+ break;
+ }
+ }
+ break;
+
+ case sal_Unicode(EOF):
+ eState = SVPAR_ACCEPTED;
+ nRet = nNextCh;
+ break;
+
+ case '{':
+ ++nOpenBrakets;
+ nRet = nNextCh;
+ break;
+
+ case '}':
+ --nOpenBrakets;
+ nRet = nNextCh;
+ break;
+
+ case 0x0d:
+ case 0x0a:
+ break;
+
+ default:
+ // es folgt normaler Text
+ ScanText();
+ nRet = RTF_TEXTTOKEN;
+ bNextCh = 0 == nNextCh;
+ break;
+ }
+
+ if( bNextCh )
+ nNextCh = GetNextChar();
+
+ } while( !nRet && SVPAR_WORKING == eState );
+ return nRet;
+}
+
+
+sal_Unicode SvRTFParser::GetHexValue()
+{
+ // Hex-Wert sammeln
+ register int n;
+ register sal_Unicode nHexVal = 0;
+
+ for( n = 0; n < 2; ++n )
+ {
+ nHexVal *= 16;
+ nNextCh = GetNextChar();
+ if( nNextCh >= '0' && nNextCh <= '9' )
+ nHexVal += (nNextCh - 48);
+ else if( nNextCh >= 'a' && nNextCh <= 'f' )
+ nHexVal += (nNextCh - 87);
+ else if( nNextCh >= 'A' && nNextCh <= 'F' )
+ nHexVal += (nNextCh - 55);
+ }
+ return nHexVal;
+}
+
+void SvRTFParser::ScanText( const sal_Unicode cBreak )
+{
+ String aStrBuffer;
+ sal_Unicode* pStr = aStrBuffer.AllocBuffer( MAX_STRING_LEN );
+ int nStrLen = 0;
+ int bWeiter = TRUE;
+ while( bWeiter && IsParserWorking() )
+ {
+ int bNextCh = TRUE;
+ switch( nNextCh )
+ {
+ case '\\':
+ {
+ switch( nNextCh = GetNextChar() )
+ {
+ case '\'':
+ *(pStr + nStrLen++) = ByteString::ConvertToUnicode(
+ GetHexValue(), GetSrcEncoding() );
+ break;
+
+ case '\\':
+ case '}':
+ case '{':
+ case '+': // habe ich in einem RTF-File gefunden
+ *(pStr + nStrLen++) = (sal_Char)nNextCh;
+ break;
+ case '~': // nonbreaking space
+ *(pStr + nStrLen++) = 0xA0;
+ break;
+ case '-': // optional hyphen
+ *(pStr + nStrLen++) = 0xAD;
+ break;
+ case '_': // nonbreaking hyphen
+ *(pStr + nStrLen++) = 0x2011;
+ break;
+
+ case 'u':
+ // UNI-Code Zeichen lesen
+ {
+ nNextCh = GetNextChar();
+ rInput.SeekRel( -2 );
+
+ if( '-' == nNextCh || RTF_ISDIGIT( nNextCh ) )
+ {
+ bRTF_InTextRead = TRUE;
+
+ String sSave( aToken );
+ nNextCh = '\\';
+ int nToken = _GetNextToken();
+ DBG_ASSERT( RTF_U == nToken, "doch kein UNI-Code Zeichen" );
+ // dont convert symbol chars
+ *(pStr + nStrLen++) = (sal_Unicode)nTokenValue;
+
+ // das naechste Zeichen noch ueberlesen
+ // JP 10.12.98: das kann auch ein \{, \}, \'88 sein!
+ sal_Unicode cAnsi = nNextCh;
+ while( 0xD == cAnsi )
+ cAnsi = GetNextChar();
+ while( 0xA == cAnsi )
+ cAnsi = GetNextChar();
+
+ if( '\\' == cAnsi &&
+ '\'' == ( cAnsi = GetNextChar() ))
+ // HexValue ueberlesen
+ cAnsi = GetHexValue();
+
+ aToken = sSave;
+ bRTF_InTextRead = FALSE;
+ }
+ else
+ {
+ nNextCh = '\\';
+ bWeiter = FALSE; // Abbrechen, String zusammen
+ }
+ }
+ break;
+
+ default:
+ rInput.SeekRel( -1 );
+ nNextCh = '\\';
+ bWeiter = FALSE; // Abbrechen, String zusammen
+ break;
+ }
+ }
+ break;
+
+ case sal_Unicode(EOF):
+ eState = SVPAR_ERROR;
+ // weiter
+ case '{':
+ case '}':
+ bWeiter = FALSE;
+ break;
+
+ case 0x0a:
+ case 0x0d:
+ break;
+
+ default:
+ if( nNextCh == cBreak ||
+ aToken.Len() >= ( STRING_MAXLEN - MAX_STRING_LEN ))
+ bWeiter = FALSE;
+ else
+ {
+ do {
+ // alle anderen Zeichen kommen in den Text
+ *(pStr + nStrLen++) = ByteString::ConvertToUnicode(
+ nNextCh, GetSrcEncoding() );
+
+ if( MAX_STRING_LEN == nStrLen )
+ {
+ aToken += aStrBuffer;
+ aToken.GetBufferAccess(); // make unique string!
+ nStrLen = 0;
+ if( aToken.Len() >=
+ ( STRING_MAXLEN - MAX_STRING_LEN ))
+ {
+ nNextCh = GetNextChar();
+ return;
+ }
+ }
+ if( sal_Unicode(EOF) == (nNextCh = GetNextChar() ))
+ {
+ if( nStrLen )
+ {
+ aStrBuffer.ReleaseBufferAccess( nStrLen );
+ aToken += aStrBuffer;
+ }
+ return;
+ }
+ } while( RTF_ISALPHA( nNextCh ) || RTF_ISDIGIT( nNextCh ) );
+ bNextCh = FALSE;
+ }
+ }
+
+ if( MAX_STRING_LEN == nStrLen )
+ {
+ aToken += aStrBuffer;
+ aToken.GetBufferAccess(); // make unique string!
+ nStrLen = 0;
+ }
+
+ if( bWeiter && bNextCh )
+ nNextCh = GetNextChar();
+ }
+ if( nStrLen )
+ {
+ aStrBuffer.ReleaseBufferAccess( nStrLen );
+ aToken += aStrBuffer;
+ }
+}
+
+
+void SvRTFParser::SkipGroup()
+{
+ short nBrackets = 1;
+ sal_Unicode cPrev = 0;
+ do {
+ switch( nNextCh )
+ {
+ case '{':
+ if( '\\' != cPrev )
+ ++nBrackets;
+ break;
+
+ case '}':
+ if( '\\' != cPrev && !--nBrackets )
+ return;
+ break;
+
+ case '\\':
+ if( '\\' == cPrev )
+ nNextCh = 0;
+ break;
+ }
+ cPrev = nNextCh;
+ nNextCh = GetNextChar();
+ } while( sal_Unicode(EOF) != nNextCh && IsParserWorking() );
+
+ if( SVPAR_PENDING != eState && '}' != nNextCh )
+ eState = SVPAR_ERROR;
+}
+
+void SvRTFParser::ReadUnknownData() { SkipGroup(); }
+void SvRTFParser::ReadBitmapData() { SkipGroup(); }
+void SvRTFParser::ReadOLEData() { SkipGroup(); }
+
+
+SvParserState SvRTFParser::CallParser()
+{
+ sal_Char cFirstCh;
+ rInput >> cFirstCh; nNextCh = cFirstCh;
+ eState = SVPAR_WORKING;
+ nOpenBrakets = 0;
+ SetSrcEncoding( RTL_TEXTENCODING_MS_1252 );
+ eUNICodeSet = RTL_TEXTENCODING_MS_1252; // default ist ANSI-CodeSet
+
+ // die 1. beiden Token muessen '{' und \\rtf sein !!
+ if( '{' == GetNextToken() && RTF_RTF == GetNextToken() )
+ {
+ AddRef();
+ Continue( 0 );
+ if( SVPAR_PENDING != eState )
+ ReleaseRef(); // dann brauchen wir den Parser nicht mehr!
+ }
+ else
+ eState = SVPAR_ERROR;
+
+ return eState;
+}
+
+void SvRTFParser::Continue( int nToken )
+{
+// DBG_ASSERT( SVPAR_CS_DONTKNOW == GetCharSet(),
+// "Zeichensatz wurde geaendert." );
+
+ if( !nToken )
+ nToken = GetNextToken();
+
+ while( IsParserWorking() )
+ {
+ SaveState( nToken );
+ switch( nToken )
+ {
+ case '}':
+ if( nOpenBrakets )
+ goto NEXTTOKEN;
+ eState = SVPAR_ACCEPTED;
+ break;
+
+ case '{':
+ // eine unbekannte Gruppe ?
+ {
+ if( RTF_IGNOREFLAG != GetNextToken() )
+ nToken = SkipToken( -1 );
+ else if( RTF_UNKNOWNCONTROL != GetNextToken() )
+ nToken = SkipToken( -2 );
+ else
+ {
+ // gleich herausfiltern
+ ReadUnknownData();
+ nToken = GetNextToken();
+ if( '}' != nToken )
+ eState = SVPAR_ERROR;
+ break; // auf zum naechsten Token!!
+ }
+ }
+ goto NEXTTOKEN;
+
+ case RTF_UNKNOWNCONTROL:
+ break; // unbekannte Token ueberspringen
+
+ case RTF_NEXTTYPE:
+ case RTF_ANSITYPE: SetSrcEncoding( RTL_TEXTENCODING_MS_1252 ); break;
+ case RTF_MACTYPE: SetSrcEncoding( RTL_TEXTENCODING_APPLE_ROMAN ); break;
+ case RTF_PCTYPE: SetSrcEncoding( RTL_TEXTENCODING_IBM_437 ); break;
+ case RTF_PCATYPE: SetSrcEncoding( RTL_TEXTENCODING_IBM_850 ); break;
+
+/*
+ case RTF_ANSICPG:
+ switch( nTokenValue )
+ {
+??? case 1252: SetUNICodeSet( CHARSET_ANSI ); break;
+ }
+ break;
+*/
+ default:
+NEXTTOKEN:
+ NextToken( nToken );
+ break;
+ }
+ if( IsParserWorking() )
+ SaveState( 0 ); // bis hierhin abgearbeitet,
+ // weiter mit neuem Token!
+ nToken = GetNextToken();
+ }
+ if( SVPAR_ACCEPTED == eState && 0 < nOpenBrakets )
+ eState = SVPAR_ERROR;
+}
+
+
+#ifdef USED
+void SvRTFParser::SaveState( int nToken )
+{
+ SvParser::SaveState( nToken );
+}
+
+void SvRTFParser::RestoreState()
+{
+ SvParser::RestoreState();
+}
+#endif
+
+
diff --git a/svtools/source/svrtf/rtfkey2.cxx b/svtools/source/svrtf/rtfkey2.cxx
new file mode 100644
index 000000000000..f77deed8ab94
--- /dev/null
+++ b/svtools/source/svrtf/rtfkey2.cxx
@@ -0,0 +1,1112 @@
+/*************************************************************************
+ *
+ * $RCSfile: rtfkey2.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include "rtfkeywd.hxx"
+
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEXCHAR, "\\'" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_IGNORE, "\\*" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OPTHYPH, "\\-" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SUBENTRY, "\\:" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ABSH, "\\absh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ABSW, "\\absw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ALT, "\\alt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ANNOTATION, "\\annotation" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ANSI, "\\ansi" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ATNID, "\\atnid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AUTHOR, "\\author" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_B, "\\b" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGBDIAG, "\\bgbdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGCROSS, "\\bgcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGDCROSS, "\\bgdcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGDKBDIAG, "\\bgdkbdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGDKCROSS, "\\bgdkcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGDKDCROSS, "\\bgdkdcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGDKFDIAG, "\\bgdkfdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGDKHORIZ, "\\bgdkhoriz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGDKVERT, "\\bgdkvert" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGFDIAG, "\\bgfdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGHORIZ, "\\bghoriz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BGVERT, "\\bgvert" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BIN, "\\bin" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BINFSXN, "\\binfsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BINSXN, "\\binsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BKMKCOLF, "\\bkmkcolf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BKMKCOLL, "\\bkmkcoll" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BKMKEND, "\\bkmkend" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BKMKSTART, "\\bkmkstart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BLUE, "\\blue" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BOX, "\\box" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRB, "\\brdrb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRBAR, "\\brdrbar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRBTW, "\\brdrbtw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRCF, "\\brdrcf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDB, "\\brdrdb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDOT, "\\brdrdot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRHAIR, "\\brdrhair" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRL, "\\brdrl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRR, "\\brdrr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRS, "\\brdrs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRSH, "\\brdrsh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRT, "\\brdrt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTH, "\\brdrth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRW, "\\brdrw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRSP, "\\brsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BULLET, "\\bullet" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BUPTIM, "\\buptim" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BXE, "\\bxe" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CAPS, "\\caps" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CB, "\\cb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CBPAT, "\\cbpat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CELL, "\\cell" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CELLX, "\\cellx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CF, "\\cf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CFPAT, "\\cfpat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHATN, "\\chatn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHDATE, "\\chdate" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHDPA, "\\chdpa" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHDPL, "\\chdpl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHFTN, "\\chftn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHFTNSEP, "\\chftnsep" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHFTNSEPC, "\\chftnsepc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHPGN, "\\chpgn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHTIME, "\\chtime" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGBDIAG, "\\clbgbdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGCROSS, "\\clbgcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDCROSS, "\\clbgdcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKBDIAG, "\\clbgdkbdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKCROSS, "\\clbgdkcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKDCROSS, "\\clbgdkdcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKFDIAG, "\\clbgdkfdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKHOR, "\\clbgdkhor" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGDKVERT, "\\clbgdkvert" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGFDIAG, "\\clbgfdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGHORIZ, "\\clbghoriz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBGVERT, "\\clbgvert" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRB, "\\clbrdrb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRL, "\\clbrdrl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRR, "\\clbrdrr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLBRDRT, "\\clbrdrt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLCBPAT, "\\clcbpat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLCFPAT, "\\clcfpat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLMGF, "\\clmgf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLMRG, "\\clmrg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLSHDNG, "\\clshdng" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COLNO, "\\colno" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COLORTBL, "\\colortbl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COLS, "\\cols" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COLSR, "\\colsr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COLSX, "\\colsx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COLUMN, "\\column" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COLW, "\\colw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COMMENT, "\\comment" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CREATIM, "\\creatim" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CTRL, "\\ctrl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DEFF, "\\deff" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DEFFORMAT, "\\defformat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DEFLANG, "\\deflang" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DEFTAB, "\\deftab" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DELETED, "\\deleted" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTX, "\\dfrmtxtx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTY, "\\dfrmtxty" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DIBITMAP, "\\dibitmap" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DN, "\\dn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOCCOMM, "\\doccomm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOCTEMP, "\\doctemp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DROPCAPLI, "\\dropcapli" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DROPCAPLT, "\\dropcapt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DXFRTEXT, "\\dxfrtext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DY, "\\dy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_EDMINS, "\\edmins" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_EMDASH, "\\emdash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ENDASH, "\\endash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ENDDOC, "\\enddoc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ENDNHERE, "\\endnhere" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ENDNOTES, "\\endnotes" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_EXPND, "\\expnd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_EXPNDTW, "\\expndtw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_F, "\\f" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FACINGP, "\\facingp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FACPGSXN, "\\facpgsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FALT, "\\falt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FCHARSET, "\\fcharset" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FDECOR, "\\fdecor" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FI, "\\fi" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FIELD, "\\field" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLDDIRTY, "\\flddirty" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLDEDIT, "\\fldedit" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLDINST, "\\fldinst" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLDLOCK, "\\fldlock" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLDPRIV, "\\fldpriv" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLDRSLT, "\\fldrslt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FMODERN, "\\fmodern" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FN, "\\fn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FNIL, "\\fnil" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FONTTBL, "\\fonttbl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTER, "\\footer" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERF, "\\footerf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERL, "\\footerl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERR, "\\footerr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERY, "\\footery" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTNOTE, "\\footnote" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FPRQ, "\\fprq" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FRACWIDTH, "\\fracwidth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FROMAN, "\\froman" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FS, "\\fs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FSCRIPT, "\\fscript" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FSWISS, "\\fswiss" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTECH, "\\ftech" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNBJ, "\\ftnbj" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNCN, "\\ftncn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNRESTART, "\\ftnrestart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNSEP, "\\ftnsep" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNSEPC, "\\ftnsepc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNSTART, "\\ftnstart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNTJ, "\\ftntj" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_GREEN, "\\green" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_GUTTER, "\\gutter" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_GUTTERSXN, "\\guttersxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADER, "\\header" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADERF, "\\headerf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADERL, "\\headerl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADERR, "\\headerr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADERY, "\\headery" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HR, "\\hr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHHOTZ, "\\hyphhotz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_I, "\\i" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ID, "\\id" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_INFO, "\\info" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_INTBL, "\\intbl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_IXE, "\\ixe" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_KEEP, "\\keep" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_KEEPN, "\\keepn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_KERNING, "\\kerning" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_KEYCODE, "\\keycode" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_KEYWORDS, "\\keywords" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LANDSCAPE, "\\landscape" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LANG, "\\lang" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LDBLQUOTE, "\\ldblquote" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVEL, "\\level" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LI, "\\li" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINE, "\\line" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINEBETCOL, "\\linebetcol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINECONT, "\\linecont" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINEMOD, "\\linemod" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINEPPAGE, "\\lineppage" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINERESTART, "\\linerestart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINESTART, "\\linestart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINESTARTS, "\\linestarts" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINEX, "\\linex" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LNDSCPSXN, "\\lndscpsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LQUOTE, "\\lquote" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MAC, "\\mac" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MACPICT, "\\macpict" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MAKEBACKUP, "\\makebackup" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGB, "\\margb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGBSXN, "\\margbsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGL, "\\margl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGLSXN, "\\marglsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGMIRROR, "\\margmirror" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGR, "\\margr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGRSXN, "\\margrsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGT, "\\margt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MARGTSXN, "\\margtsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MIN, "\\min" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MO, "\\mo" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NEXTCSET, "\\nextcset" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NEXTFILE, "\\nextfile" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOFCHARS, "\\nofchars" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOFPAGES, "\\nofpages" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOFWORDS, "\\nofwords" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOLINE, "\\noline" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOSUPERSUB, "\\nosupersub" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOWRAP, "\\nowrap" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OPERATOR, "\\operator" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OUTL, "\\outl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PAGE, "\\page" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PAGEBB, "\\pagebb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PAPERH, "\\paperh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PAPERW, "\\paperw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PAR, "\\par" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PARD, "\\pard" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PC, "\\pc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PCA, "\\pca" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGHSXN, "\\pghsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNCONT, "\\pgncont" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNDEC, "\\pgndec" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNLCLTR, "\\pgnlcltr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNLCRM, "\\pgnlcrm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNRESTART, "\\pgnrestart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNSTART, "\\pgnstart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNSTARTS, "\\pgnstarts" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNUCLTR, "\\pgnucltr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNUCRM, "\\pgnucrm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNX, "\\pgnx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNY, "\\pgny" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGWSXN, "\\pgwsxn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PHCOL, "\\phcol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PHMRG, "\\phmrg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PHPG, "\\phpg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPB, "\\piccropb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPL, "\\piccropl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPR, "\\piccropr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICCROPT, "\\piccropt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICH, "\\pich" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICHGOAL, "\\pichgoal" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALED, "\\picscaled" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALEX, "\\picscalex" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICSCALEY, "\\picscaley" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICT, "\\pict" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICW, "\\picw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICWGOAL, "\\picwgoal" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PLAIN, "\\plain" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PMMETAFILE, "\\pmmetafile" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSNEGX, "\\posnegx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSNEGY, "\\posnegy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSX, "\\posx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSXC, "\\posxc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSXI, "\\posxi" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSXL, "\\posxl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSXO, "\\posxo" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSXR, "\\posxr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSY, "\\posy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSYB, "\\posyb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSYC, "\\posyc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSYIL, "\\posyil" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSYT, "\\posyt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PRINTIM, "\\printim" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PSOVER, "\\psover" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PVMRG, "\\pvmrg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PVPARA, "\\pvpara" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PVPG, "\\pvpg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_QC, "\\qc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_QJ, "\\qj" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_QL, "\\ql" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_QR, "\\qr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RDBLQUOTE, "\\rdblquote" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RED, "\\red" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVBAR, "\\revbar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVISED, "\\revised" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVISIONS, "\\revisions" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVPROP, "\\revprop" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVTIM, "\\revtim" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RI, "\\ri" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ROW, "\\row" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RQUOTE, "\\rquote" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RTF, "\\rtf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RXE, "\\rxe" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_S, "\\s" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SA, "\\sa" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SB, "\\sb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SBASEDON, "\\sbasedon" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SBKCOL, "\\sbkcol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SBKEVEN, "\\sbkeven" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SBKNONE, "\\sbknone" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SBKODD, "\\sbkodd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SBKPAGE, "\\sbkpage" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SBYS, "\\sbys" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SCAPS, "\\scaps" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECT, "\\sect" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECTD, "\\sectd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHAD, "\\shad" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHADING, "\\shading" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHIFT, "\\shift" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SL, "\\sl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SNEXT, "\\snext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_STRIKE, "\\strike" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_STYLESHEET, "\\stylesheet" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SUB, "\\sub" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SUBJECT, "\\subject" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SUPER, "\\super" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TAB, "\\tab" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TB, "\\tb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TC, "\\tc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TCF, "\\tcf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TCL, "\\tcl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TEMPLATE, "\\template" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TITLE, "\\title" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TITLEPG, "\\titlepg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TLDOT, "\\tldot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TLEQ, "\\tleq" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TLHYPH, "\\tlhyph" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TLTH, "\\tlth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TLUL, "\\tlul" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TQC, "\\tqc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TQDEC, "\\tqdec" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TQR, "\\tqr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TQL, "\\tql" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRGAPH, "\\trgaph" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRLEFT, "\\trleft" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TROWD, "\\trowd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRQC, "\\trqc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRQL, "\\trql" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRQR, "\\trqr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRRH, "\\trrh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TX, "\\tx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TXE, "\\txe" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_UL, "\\ul" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULD, "\\uld" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULDB, "\\uldb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULNONE, "\\ulnone" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULW, "\\ulw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_UP, "\\up" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_V, "\\v" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VERN, "\\vern" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VERSION, "\\version" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VERTALB, "\\vertalb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VERTALC, "\\vertalc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VERTALJ, "\\vertalj" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VERTALT, "\\vertalt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WBITMAP, "\\wbitmap" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WBMBITSPIXEL, "\\wbmbitspixel" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WBMPLANES, "\\wbmplanes" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WBMWIDTHBYTES, "\\wbmwidthbytes" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WIDOWCTRL, "\\widowctrl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WMETAFILE, "\\wmetafile" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_XE, "\\xe" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_YR, "\\yr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOBRKHYPH, "\\_" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FORMULA, "\\|" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOBREAK, "\\~" );
+
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AB, "\\ab" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ACAPS, "\\acaps" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ACF, "\\acf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ADDITIVE, "\\additive" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ADN, "\\adn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AENDDOC, "\\aenddoc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AENDNOTES, "\\aendnotes" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AEXPND, "\\aexpnd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AF, "\\af" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFS, "\\afs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNBJ, "\\aftnbj" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNCN, "\\aftncn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNALC, "\\aftnnalc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNAR, "\\aftnnar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNAUC, "\\aftnnauc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCHI, "\\aftnnchi" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNRLC, "\\aftnnrlc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNRUC, "\\aftnnruc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNRESTART, "\\aftnrestart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNRSTCONT, "\\aftnrstcont" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSEP, "\\aftnsep" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSEPC, "\\aftnsepc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNSTART, "\\aftnstart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNTJ, "\\aftntj" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AI, "\\ai" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ALANG, "\\alang" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ALLPROT, "\\allprot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ANNOTPROT, "\\annotprot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AOUTL, "\\aoutl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ASCAPS, "\\ascaps" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ASHAD, "\\ashad" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ASTRIKE, "\\astrike" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ATNAUTHOR, "\\atnauthor" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ATNICN, "\\atnicn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ATNREF, "\\atnref" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ATNTIME, "\\atntime" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ATRFEND, "\\atrfend" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ATRFSTART, "\\atrfstart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AUL, "\\aul" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AULD, "\\auld" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AULDB, "\\auldb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AULNONE, "\\aulnone" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AULW, "\\aulw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AUP, "\\aup" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BKMKPUB, "\\bkmkpub" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASH, "\\brdrdash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRKFRM, "\\brkfrm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CCHS, "\\cchs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CPG, "\\cpg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CS, "\\cs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CVMME, "\\cvmme" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DATAFIELD, "\\datafield" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DO, "\\do" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOBXCOLUMN, "\\dobxcolumn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOBXMARGIN, "\\dobxmargin" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOBXPAGE, "\\dobxpage" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOBYMARGIN, "\\dobymargin" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOBYPAGE, "\\dobypage" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOBYPARA, "\\dobypara" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DODHGT, "\\dodhgt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOLOCK, "\\dolock" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDHOL, "\\dpaendhol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDL, "\\dpaendl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDSOL, "\\dpaendsol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPAENDW, "\\dpaendw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPARC, "\\dparc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPARCFLIPX, "\\dparcflipx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPARCFLIPY, "\\dparcflipy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTHOL, "\\dpastarthol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTL, "\\dpastartl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTSOL, "\\dpastartsol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPASTARTW, "\\dpastartw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCALLOUT, "\\dpcallout" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOA, "\\dpcoa" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOACCENT, "\\dpcoaccent" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOBESTFIT, "\\dpcobestfit" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOBORDER, "\\dpcoborder" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCODABS, "\\dpcodabs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCODBOTTOM, "\\dpcodbottom" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCODCENTER, "\\dpcodcenter" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCODTOP, "\\dpcodtop" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOLENGTH, "\\dpcolength" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOMINUSX, "\\dpcominusx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOMINUSY, "\\dpcominusy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOOFFSET, "\\dpcooffset" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOSMARTA, "\\dpcosmarta" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTDOUBLE, "\\dpcotdouble" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTRIGHT, "\\dpcotright" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTSINGLE, "\\dpcotsingle" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOTTRIPLE, "\\dpcottriple" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCOUNT, "\\dpcount" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPELLIPSE, "\\dpellipse" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPENDGROUP, "\\dpendgroup" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCB, "\\dpfillbgcb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCG, "\\dpfillbgcg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGCR, "\\dpfillbgcr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGGRAY, "\\dpfillbggray" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLBGPAL, "\\dpfillbgpal" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCB, "\\dpfillfgcb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCG, "\\dpfillfgcg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGCR, "\\dpfillfgcr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGGRAY, "\\dpfillfggray" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLFGPAL, "\\dpfillfgpal" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPFILLPAT, "\\dpfillpat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPGROUP, "\\dpgroup" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINE, "\\dpline" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOB, "\\dplinecob" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOG, "\\dplinecog" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINECOR, "\\dplinecor" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDADO, "\\dplinedado" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDADODO, "\\dplinedadodo" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDASH, "\\dplinedash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEDOT, "\\dplinedot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEGRAY, "\\dplinegray" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEHOLLOW, "\\dplinehollow" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEPAL, "\\dplinepal" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINESOLID, "\\dplinesolid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPLINEW, "\\dplinew" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYCOUNT, "\\dppolycount" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYGON, "\\dppolygon" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPPOLYLINE, "\\dppolyline" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPPTX, "\\dpptx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPPTY, "\\dppty" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPRECT, "\\dprect" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPROUNDR, "\\dproundr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADOW, "\\dpshadow" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADX, "\\dpshadx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPSHADY, "\\dpshady" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBX, "\\dptxbx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBXMAR, "\\dptxbxmar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPTXBXTEXT, "\\dptxbxtext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPX, "\\dpx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPXSIZE, "\\dpxsize" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPY, "\\dpy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPYSIZE, "\\dpysize" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DS, "\\ds" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_EMSPACE, "\\emspace" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ENSPACE, "\\enspace" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FBIDI, "\\fbidi" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FET, "\\fet" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FID, "\\fid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FILE, "\\file" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FILETBL, "\\filetbl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLDALT, "\\fldalt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FNETWORK, "\\fnetwork" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FONTEMB, "\\fontemb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FONTFILE, "\\fontfile" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FORMDISP, "\\formdisp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FORMPROT, "\\formprot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FORMSHADE, "\\formshade" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOSNUM, "\\fosnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FRELATIVE, "\\frelative" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNALT, "\\ftnalt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNIL, "\\ftnil" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNALC, "\\ftnnalc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNAR, "\\ftnnar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNAUC, "\\ftnnauc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCHI, "\\ftnnchi" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNRLC, "\\ftnnrlc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNRUC, "\\ftnnruc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNRSTCONT, "\\ftnrstcont" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNRSTPG, "\\ftnrstpg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTTRUETYPE, "\\fttruetype" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDDOS, "\\fvaliddos" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDHPFS, "\\fvalidhpfs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDMAC, "\\fvalidmac" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FVALIDNTFS, "\\fvalidntfs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHAUTO, "\\hyphauto" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHCAPS, "\\hyphcaps" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHCONSEC, "\\hyphconsec" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHPAR, "\\hyphpar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINKSELF, "\\linkself" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINKSTYLES, "\\linkstyles" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LTRCH, "\\ltrch" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LTRDOC, "\\ltrdoc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LTRMARK, "\\ltrmark" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LTRPAR, "\\ltrpar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LTRROW, "\\ltrrow" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LTRSECT, "\\ltrsect" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOCOLBAL, "\\nocolbal" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOEXTRASPRL, "\\noextrasprl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOTABIND, "\\notabind" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOWIDCTLPAR, "\\nowidctlpar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJALIAS, "\\objalias" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJALIGN, "\\objalign" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJAUTLINK, "\\objautlink" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJCLASS, "\\objclass" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPB, "\\objcropb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPL, "\\objcropl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPR, "\\objcropr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJCROPT, "\\objcropt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJDATA, "\\objdata" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJECT, "\\object" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJEMB, "\\objemb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJH, "\\objh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJICEMB, "\\objicemb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJLINK, "\\objlink" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJLOCK, "\\objlock" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJNAME, "\\objname" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJPUB, "\\objpub" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJSCALEX, "\\objscalex" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJSCALEY, "\\objscaley" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJSECT, "\\objsect" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJSETSIZE, "\\objsetsize" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJSUB, "\\objsub" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJTIME, "\\objtime" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJTRANSY, "\\objtransy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJUPDATE, "\\objupdate" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJW, "\\objw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OTBLRUL, "\\otblrul" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNHN, "\\pgnhn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSC, "\\pgnhnsc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSH, "\\pgnhnsh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSM, "\\pgnhnsm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSN, "\\pgnhnsn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNHNSP, "\\pgnhnsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICBMP, "\\picbmp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICBPP, "\\picbpp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PN, "\\pn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNACROSS, "\\pnacross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNB, "\\pnb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNCAPS, "\\pncaps" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNCARD, "\\pncard" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNCF, "\\pncf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNDEC, "\\pndec" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNF, "\\pnf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNFS, "\\pnfs" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNHANG, "\\pnhang" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNI, "\\pni" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNINDENT, "\\pnindent" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNLCLTR, "\\pnlcltr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNLCRM, "\\pnlcrm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNLVL, "\\pnlvl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLBLT, "\\pnlvlblt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLBODY, "\\pnlvlbody" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNLVLCONT, "\\pnlvlcont" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNNUMONCE, "\\pnnumonce" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNORD, "\\pnord" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNORDT, "\\pnordt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNPREV, "\\pnprev" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNQC, "\\pnqc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNQL, "\\pnql" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNQR, "\\pnqr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRESTART, "\\pnrestart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNSCAPS, "\\pnscaps" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNSECLVL, "\\pnseclvl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNSP, "\\pnsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNSTART, "\\pnstart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNSTRIKE, "\\pnstrike" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNTEXT, "\\pntext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNTXTA, "\\pntxta" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNTXTB, "\\pntxtb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNUCLTR, "\\pnucltr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNUCRM, "\\pnucrm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNUL, "\\pnul" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNULD, "\\pnuld" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNULDB, "\\pnuldb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNULNONE, "\\pnulnone" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNULW, "\\pnulw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PRCOLBL, "\\prcolbl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PRINTDATA, "\\printdata" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PSZ, "\\psz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PUBAUTO, "\\pubauto" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RESULT, "\\result" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVAUTH, "\\revauth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVDTTM, "\\revdttm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVPROT, "\\revprot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVTBL, "\\revtbl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RSLTBMP, "\\rsltbmp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RSLTMERGE, "\\rsltmerge" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RSLTPICT, "\\rsltpict" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RSLTRTF, "\\rsltrtf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RSLTTXT, "\\rslttxt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RTLCH, "\\rtlch" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RTLDOC, "\\rtldoc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RTLMARK, "\\rtlmark" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RTLPAR, "\\rtlpar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RTLROW, "\\rtlrow" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_RTLSECT, "\\rtlsect" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SEC, "\\sec" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECTNUM, "\\sectnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECTUNLOCKED, "\\sectunlocked" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SLMULT, "\\slmult" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SOFTCOL, "\\softcol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SOFTLHEIGHT, "\\softlheight" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SOFTLINE, "\\softline" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SOFTPAGE, "\\softpage" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SPRSSPBF, "\\sprsspbf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SPRSTSP, "\\sprstsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SUBDOCUMENT, "\\subdocument" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SWPBDR, "\\swpbdr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TCN, "\\tcn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRANSMF, "\\transmf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRB, "\\trbrdrb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRH, "\\trbrdrh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRL, "\\trbrdrl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRR, "\\trbrdrr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRT, "\\trbrdrt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRBRDRV, "\\trbrdrv" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRHDR, "\\trhdr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRKEEP, "\\trkeep" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WRAPTRSP, "\\wraptrsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_XEF, "\\xef" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ZWJ, "\\zwj" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ZWNJ, "\\zwnj" );
+
+// neue Tokens zur 1.5
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ABSLOCK, "\\abslock" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ADJUSTRIGHT, "\\adjustright" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCHOSUNG, "\\aftnnchosung" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNCNUM, "\\aftnncnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBAR, "\\aftnndbar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUM, "\\aftnndbnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMD, "\\aftnndbnumd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMK, "\\aftnndbnumk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNDBNUMT, "\\aftnndbnumt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGANADA, "\\aftnnganada" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUM, "\\aftnngbnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUMD, "\\aftnngbnumd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUMK, "\\aftnngbnumk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNGBNUML, "\\aftnngbnuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIAC, "\\aftnnzodiac" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIACD, "\\aftnnzodiacd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_AFTNNZODIACL, "\\aftnnzodiacl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ANIMTEXT, "\\animtext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ANSICPG, "\\ansicpg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BACKGROUND, "\\background" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BDBFHDR, "\\bdbfhdr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BLIPTAG, "\\bliptag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BLIPUID, "\\blipuid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BLIPUPI, "\\blipupi" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRART, "\\brdrart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHD, "\\brdrdashd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHDD, "\\brdrdashdd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHDOTSTR, "\\brdrdashdotstr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRDASHSM, "\\brdrdashsm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDREMBOSS, "\\brdremboss" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRENGRAVE, "\\brdrengrave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRFRAME, "\\brdrframe" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNLG, "\\brdrthtnlg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNMG, "\\brdrthtnmg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTHTNSG, "\\brdrthtnsg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHLG, "\\brdrtnthlg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHMG, "\\brdrtnthmg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHSG, "\\brdrtnthsg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNLG, "\\brdrtnthtnlg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNMG, "\\brdrtnthtnmg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTNTHTNSG, "\\brdrtnthtnsg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRTRIPLE, "\\brdrtriple" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRWAVY, "\\brdrwavy" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDRWAVYDB, "\\brdrwavydb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CATEGORY, "\\category" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CGRID, "\\cgrid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHARSCALEX, "\\charscalex" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGBDIAG, "\\chbgbdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGCROSS, "\\chbgcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDCROSS, "\\chbgdcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKBDIAG, "\\chbgdkbdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKCROSS, "\\chbgdkcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKDCROSS, "\\chbgdkdcross" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKFDIAG, "\\chbgdkfdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKHORIZ, "\\chbgdkhoriz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGDKVERT, "\\chbgdkvert" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGFDIAG, "\\chbgfdiag" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGHORIZ, "\\chbghoriz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBGVERT, "\\chbgvert" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHBRDR, "\\chbrdr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHCBPAT, "\\chcbpat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHCFPAT, "\\chcfpat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CHSHDNG, "\\chshdng" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLTXLRTB, "\\cltxlrtb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLTXTBRL, "\\cltxtbrl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALB, "\\clvertalb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALC, "\\clvertalc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLVERTALT, "\\clvertalt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLVMGF, "\\clvmgf" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLVMRG, "\\clvmrg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLTXTBRLV, "\\cltxtbrlv" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLTXBTLR, "\\cltxbtlr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CLTXLRTBV, "\\cltxlrtbv" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_COMPANY, "\\company" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CRAUTH, "\\crauth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_CRDATE, "\\crdate" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DATE, "\\date" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DEFLANGFE, "\\deflangfe" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRAUTH, "\\dfrauth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRDATE, "\\dfrdate" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRSTART, "\\dfrstart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRSTOP, "\\dfrstop" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRXST, "\\dfrxst" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DGMARGIN, "\\dgmargin" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DNTBLNSBDB, "\\dntblnsbdb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOCTYPE, "\\doctype" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DOCVAR, "\\docvar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DPCODESCENT, "\\dpcodescent" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_EMBO, "\\embo" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_EMFBLIP, "\\emfblip" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_EXPSHRTN, "\\expshrtn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FAAUTO, "\\faauto" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FBIAS, "\\fbias" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFDEFRES, "\\ffdefres" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFDEFTEXT, "\\ffdeftext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFENTRYMCR, "\\ffentrymcr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFEXITMCR, "\\ffexitmcr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFFORMAT, "\\ffformat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFHASLISTBOX, "\\ffhaslistbox" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFHELPTEXT, "\\ffhelptext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFHPS, "\\ffhps" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFL, "\\ffl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFMAXLEN, "\\ffmaxlen" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFNAME, "\\ffname" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFOWNHELP, "\\ffownhelp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFOWNSTAT, "\\ffownstat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFPROT, "\\ffprot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFRECALC, "\\ffrecalc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFRES, "\\ffres" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFSIZE, "\\ffsize" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFSTATTEXT, "\\ffstattext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFTYPE, "\\fftype" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FFTYPETXT, "\\fftypetxt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLDTYPE, "\\fldtype" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FNAME, "\\fname" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FORMFIELD, "\\formfield" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FROMTEXT, "\\fromtext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCHOSUNG, "\\ftnnchosung" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNCNUM, "\\ftnncnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBAR, "\\ftnndbar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUM, "\\ftnndbnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMD, "\\ftnndbnumd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMK, "\\ftnndbnumk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNDBNUMT, "\\ftnndbnumt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGANADA, "\\ftnnganada" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUM, "\\ftnngbnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUMD, "\\ftnngbnumd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUMK, "\\ftnngbnumk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNGBNUML, "\\ftnngbnuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIAC, "\\ftnnzodiac" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIACD, "\\ftnnzodiacd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FTNNZODIACL, "\\ftnnzodiacl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_G, "\\g" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_GCW, "\\gcw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_GRIDTBL, "\\gridtbl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HIGHLIGHT, "\\highlight" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HLFR, "\\hlfr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HLINKBASE, "\\hlinkbase" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HLLOC, "\\hlloc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HLSRC, "\\hlsrc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ILVL, "\\ilvl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_IMPR, "\\impr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_JPEGBLIP, "\\jpegblip" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELFOLLOW, "\\levelfollow" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELINDENT, "\\levelindent" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELJC, "\\leveljc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELLEGAL, "\\levellegal" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNFC, "\\levelnfc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNORESTART, "\\levelnorestart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELNUMBERS, "\\levelnumbers" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELOLD, "\\levelold" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELPREV, "\\levelprev" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELPREVSPACE, "\\levelprevspace" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELSPACE, "\\levelspace" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELSTARTAT, "\\levelstartat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LEVELTEXT, "\\leveltext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LINKVAL, "\\linkval" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LIST, "\\list" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTID, "\\listid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTLEVEL, "\\listlevel" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTNAME, "\\listname" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDE, "\\listoverride" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDECOUNT, "\\listoverridecount" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDEFORMAT, "\\listoverrideformat" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDESTART, "\\listoverridestart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTOVERRIDETABLE, "\\listoverridetable" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTRESTARTHDN, "\\listrestarthdn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTSIMPLE, "\\listsimple" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTTABLE, "\\listtable" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTTEMPLATEID, "\\listtemplateid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LISTTEXT, "\\listtext" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LS, "\\ls" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LYTEXCTTP, "\\lytexcttp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LYTPRTMET, "\\lytprtmet" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MANAGER, "\\manager" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_MSMCAP, "\\msmcap" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOFCHARSWS, "\\nofcharsws" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOLEAD, "\\nolead" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NONSHPPICT, "\\nonshppict" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOSECTEXPAND, "\\nosectexpand" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOSNAPLINEGRID, "\\nosnaplinegrid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOSPACEFORUL, "\\nospaceforul" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOULTRLSPC, "\\noultrlspc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_NOXLATTOYEN, "\\noxlattoyen" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJATTPH, "\\objattph" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJHTML, "\\objhtml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OBJOCX, "\\objocx" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OLDLINEWRAP, "\\oldlinewrap" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OUTLINELEVEL, "\\outlinelevel" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_OVERLAY, "\\overlay" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PANOSE, "\\panose" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRB, "\\pgbrdrb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRFOOT, "\\pgbrdrfoot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRHEAD, "\\pgbrdrhead" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRL, "\\pgbrdrl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDROPT, "\\pgbrdropt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRR, "\\pgbrdrr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRSNAP, "\\pgbrdrsnap" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRDRT, "\\pgbrdrt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNCHOSUNG, "\\pgnchosung" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNCNUM, "\\pgncnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNDBNUMK, "\\pgndbnumk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNDBNUMT, "\\pgndbnumt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNGANADA, "\\pgnganada" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUM, "\\pgngbnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUMD, "\\pgngbnumd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUMK, "\\pgngbnumk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNGBNUML, "\\pgngbnuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIAC, "\\pgnzodiac" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIACD, "\\pgnzodiacd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGNZODIACL, "\\pgnzodiacl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PICPROP, "\\picprop" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNAIUEO, "\\pnaiueo" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNAIUEOD, "\\pnaiueod" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNCHOSUNG, "\\pnchosung" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMD, "\\pndbnumd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMK, "\\pndbnumk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUML, "\\pndbnuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNDBNUMT, "\\pndbnumt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNGANADA, "\\pnganada" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNGBLIP, "\\pngblip" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUM, "\\pngbnum" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUMD, "\\pngbnumd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUMK, "\\pngbnumk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNGBNUML, "\\pngbnuml" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRAUTH, "\\pnrauth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRDATE, "\\pnrdate" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRNFC, "\\pnrnfc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRNOT, "\\pnrnot" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRPNBR, "\\pnrpnbr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRRGB, "\\pnrrgb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRSTART, "\\pnrstart" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRSTOP, "\\pnrstop" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNRXST, "\\pnrxst" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIAC, "\\pnzodiac" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIACD, "\\pnzodiacd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PNZODIACL, "\\pnzodiacl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_LFOLEVEL, "\\lfolevel" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSYIN, "\\posyin" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_POSYOUT, "\\posyout" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PRIVATE, "\\private" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PROPNAME, "\\propname" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PROPTYPE, "\\proptype" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVAUTHDEL, "\\revauthdel" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_REVDTTMDEL, "\\revdttmdel" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SAUTOUPD, "\\sautoupd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECTDEFAULTCL, "\\sectdefaultcl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECTEXPAND, "\\sectexpand" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECTLINEGRID, "\\sectlinegrid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECTSPECIFYCL, "\\sectspecifycl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SECTSPECIFYL, "\\sectspecifyl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHIDDEN, "\\shidden" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPBOTTOM, "\\shpbottom" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXCOLUMN, "\\shpbxcolumn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXMARGIN, "\\shpbxmargin" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPBXPAGE, "\\shpbxpage" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYMARGIN, "\\shpbymargin" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYPAGE, "\\shpbypage" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPBYPARA, "\\shpbypara" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPFBLWTXT, "\\shpfblwtxt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPFHDR, "\\shpfhdr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPGRP, "\\shpgrp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPLEFT, "\\shpleft" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPLID, "\\shplid" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPLOCKANCHOR, "\\shplockanchor" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPPICT, "\\shppict" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPRIGHT, "\\shpright" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPRSLT, "\\shprslt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPTOP, "\\shptop" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPTXT, "\\shptxt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPWRK, "\\shpwrk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPWR, "\\shpwr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHPZ, "\\shpz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SPRSBSP, "\\sprsbsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SPRSLNSP, "\\sprslnsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SPRSTSM, "\\sprstsm" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_STATICVAL, "\\staticval" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_STEXTFLOW, "\\stextflow" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_STRIKEDL, "\\strikedl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SUBFONTBYSIZE, "\\subfontbysize" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TCELLD, "\\tcelld" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TIME, "\\time" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TRUNCATEFONTHEIGHT, "\\truncatefontheight" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_UC, "\\uc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_UD, "\\ud" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULDASH, "\\uldash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULDASHD, "\\uldashd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULDASHDD, "\\uldashdd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULTH, "\\ulth" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULWAVE, "\\ulwave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_U, "\\u" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_UPR, "\\upr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_USERPROPS, "\\userprops" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VIEWKIND, "\\viewkind" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VIEWSCALE, "\\viewscale" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_VIEWZK, "\\viewzk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WIDCTLPAR, "\\widctlpar" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WINDOWCAPTION, "\\windowcaption" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WPEQN, "\\wpeqn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WPJST, "\\wpjst" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_WPSP, "\\wpsp" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_YXE, "\\yxe" );
+
+// MS-2000 Tokens
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULTHD, "\\ulthd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASH, "\\ulthdash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULLDASH, "\\ulldash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULTHLDASH, "\\ulthldash" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASHD, "\\ulthdashd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULTHDASHDD, "\\ulthdashdd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULHWAVE, "\\ulhwave" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_ULULDBWAVE, "\\ululdbwave" );
+
+// SWG spezifische Attribute
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_GRFALIGNV, "\\grfalignv" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_GRFALIGNH, "\\grfalignh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_GRFMIRROR, "\\grfmirror" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADERYB, "\\headeryb" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADERXL, "\\headerxl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADERXR, "\\headerxr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERYT, "\\footeryt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERXL, "\\footerxl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERXR, "\\footerxr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HEADERYH, "\\headeryh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FOOTERYH, "\\footeryh" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BALANCEDCOLUMN, "\\swcolmnblnc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_UPDNPROP, "\\updnprop" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PRTDATA, "\\prtdata" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BKMKKEY, "\\bkmkkey" );
+
+// Attribute fuer die freifliegenden Rahmen
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYPRINT, "\\flyprint" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYOPAQUE, "\\flyopaque" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYPRTCTD, "\\flyprtctd" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYMAINCNT, "\\flymaincnt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYVERT, "\\flyvert" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYHORZ, "\\flyhorz" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTL, "\\dfrmtxtl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTR, "\\dfrmtxtr" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTU, "\\dfrmtxtu" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_DFRMTXTW, "\\dfrmtxtw" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYANCHOR, "\\flyanchor" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYCNTNT, "\\flycntnt" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYCOLUMN, "\\flycolumn" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYPAGE, "\\flypage" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_FLYINPARA, "\\flyinpara" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDBOX, "\\brdbox" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNCOL, "\\brdlncol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNIN, "\\brdlnin" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNOUT, "\\brdlnout" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_BRDLNDIST, "\\brdlndist" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHADOW, "\\shadow" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHDWDIST, "\\shdwdist" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHDWSTYLE, "\\shdwstyle" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHDWCOL, "\\shdwcol" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SHDWFCOL, "\\shdwfcol" );
+
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCTBL, "\\pgdsctbl" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGDSC, "\\pgdsc" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCUSE, "\\pgdscuse" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCNXT, "\\pgdscnxt" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHEN, "\\hyphen" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHLEAD, "\\hyphlead" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHTRAIL, "\\hyphtrail" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_HYPHMAX, "\\hyphmax" );
+
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_TLSWG, "\\tlswg" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGBRK, "\\pgbrk" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_PGDSCNO, "\\pgdscno" );
+sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DEF( sRTF_SOUTLVL, "\\soutlvl" );
+
diff --git a/svtools/source/svrtf/rtfkeywd.cxx b/svtools/source/svrtf/rtfkeywd.cxx
new file mode 100644
index 000000000000..d9daee909e6e
--- /dev/null
+++ b/svtools/source/svrtf/rtfkeywd.cxx
@@ -0,0 +1,1198 @@
+/*************************************************************************
+ *
+ * $RCSfile: rtfkeywd.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <string.h>
+#include <ctype.h>
+#include <stdlib.h>
+
+#include "rtfkeywd.hxx"
+#include "rtftoken.h"
+
+// die Tabelle muss noch sortiert werden
+struct RTF_TokenEntry
+{
+ union{
+ const sal_Char* sToken;
+ const String* pUToken;
+ };
+ int nToken;
+};
+
+// Flag: RTF-Token Tabelle wurde schon sortiert
+static int __FAR_DATA bSortKeyWords = FALSE;
+
+static RTF_TokenEntry __FAR_DATA aRTFTokenTab[] = {
+sRTF_IGNORE, RTF_IGNOREFLAG,
+sRTF_RTF, RTF_RTF,
+sRTF_ANSI, RTF_ANSITYPE,
+sRTF_MAC, RTF_MACTYPE,
+sRTF_PC, RTF_PCTYPE,
+sRTF_PCA, RTF_PCATYPE,
+sRTF_NEXTCSET, RTF_NEXTTYPE,
+sRTF_STYLESHEET, RTF_STYLESHEET,
+sRTF_SBASEDON, RTF_SBASEDON,
+sRTF_SNEXT, RTF_SNEXT,
+sRTF_FONTTBL, RTF_FONTTBL,
+sRTF_DEFF, RTF_DEFF,
+sRTF_FNIL, RTF_FNIL,
+sRTF_FROMAN, RTF_FROMAN,
+sRTF_FSWISS, RTF_FSWISS,
+sRTF_FMODERN, RTF_FMODERN,
+sRTF_FSCRIPT, RTF_FSCRIPT,
+sRTF_FDECOR, RTF_FDECOR,
+sRTF_FTECH, RTF_FTECH,
+sRTF_FCHARSET, RTF_FCHARSET,
+sRTF_FALT, RTF_FALT,
+sRTF_FPRQ, RTF_FPRQ,
+sRTF_COLORTBL, RTF_COLORTBL,
+sRTF_RED, RTF_RED,
+sRTF_GREEN, RTF_GREEN,
+sRTF_BLUE, RTF_BLUE,
+sRTF_CF, RTF_CF,
+sRTF_CB, RTF_CB,
+sRTF_INFO, RTF_INFO,
+sRTF_TITLE, RTF_TITLE,
+sRTF_SUBJECT, RTF_SUBJECT,
+sRTF_AUTHOR, RTF_AUTHOR,
+sRTF_OPERATOR, RTF_OPERATOR,
+sRTF_KEYWORDS, RTF_KEYWORDS,
+sRTF_COMMENT, RTF_COMMENT,
+sRTF_VERSION, RTF_VERSION,
+sRTF_DOCCOMM, RTF_DOCCOMM,
+sRTF_VERN, RTF_VERN,
+sRTF_CREATIM, RTF_CREATIM,
+sRTF_REVTIM, RTF_REVTIM,
+sRTF_PRINTIM, RTF_PRINTIM,
+sRTF_BUPTIM, RTF_BUPTIM,
+sRTF_EDMINS, RTF_EDMINS,
+sRTF_NOFPAGES, RTF_NOFPAGES,
+sRTF_NOFWORDS, RTF_NOFWORDS,
+sRTF_NOFCHARS, RTF_NOFCHARS,
+sRTF_ID, RTF_ID,
+sRTF_YR, RTF_YR,
+sRTF_MO, RTF_MO,
+sRTF_DY, RTF_DY,
+sRTF_HR, RTF_HR,
+sRTF_MIN, RTF_MIN,
+sRTF_ANNOTATION, RTF_ANNOTATION,
+sRTF_ATNID, RTF_ATNID,
+sRTF_FOOTNOTE, RTF_FOOTNOTE,
+sRTF_FOOTER, RTF_FOOTER,
+sRTF_FOOTERL, RTF_FOOTERL,
+sRTF_FOOTERR, RTF_FOOTERR,
+sRTF_FOOTERF, RTF_FOOTERF,
+sRTF_HEADER, RTF_HEADER,
+sRTF_HEADERL, RTF_HEADERL,
+sRTF_HEADERR, RTF_HEADERR,
+sRTF_HEADERF, RTF_HEADERF,
+sRTF_XE, RTF_XE,
+sRTF_BXE, RTF_BXE,
+sRTF_IXE, RTF_IXE,
+sRTF_RXE, RTF_RXE,
+sRTF_TXE, RTF_TXE,
+sRTF_TC, RTF_TC,
+sRTF_TCF, RTF_TCF,
+sRTF_TCL, RTF_TCL,
+sRTF_BKMKSTART, RTF_BKMKSTART,
+sRTF_BKMKEND, RTF_BKMKEND,
+sRTF_PICT, RTF_PICT,
+sRTF_PICW, RTF_PICW,
+sRTF_PICH, RTF_PICH,
+sRTF_WBMBITSPIXEL, RTF_WBMBITSPIXEL,
+sRTF_WBMPLANES, RTF_WBMPLANES,
+sRTF_WBMWIDTHBYTES, RTF_WBMWIDTHBYTES,
+sRTF_PICWGOAL, RTF_PICWGOAL,
+sRTF_PICHGOAL, RTF_PICHGOAL,
+sRTF_BIN, RTF_BIN,
+sRTF_PICSCALEX, RTF_PICSCALEX,
+sRTF_PICSCALEY, RTF_PICSCALEY,
+sRTF_PICSCALED, RTF_PICSCALED,
+sRTF_WBITMAP, RTF_WBITMAP,
+sRTF_WMETAFILE, RTF_WMETAFILE,
+sRTF_MACPICT, RTF_MACPICT,
+sRTF_PICCROPT, RTF_PICCROPT,
+sRTF_PICCROPB, RTF_PICCROPB,
+sRTF_PICCROPL, RTF_PICCROPL,
+sRTF_PICCROPR, RTF_PICCROPR,
+sRTF_FIELD, RTF_FIELD,
+sRTF_FLDDIRTY, RTF_FLDDIRTY,
+sRTF_FLDEDIT, RTF_FLDEDIT,
+sRTF_FLDLOCK, RTF_FLDLOCK,
+sRTF_FLDPRIV, RTF_FLDPRIV,
+sRTF_FLDINST, RTF_FLDINST,
+sRTF_FLDRSLT, RTF_FLDRSLT,
+sRTF_PAPERW, RTF_PAPERW,
+sRTF_PAPERH, RTF_PAPERH,
+sRTF_MARGL, RTF_MARGL,
+sRTF_MARGR, RTF_MARGR,
+sRTF_MARGT, RTF_MARGT,
+sRTF_MARGB, RTF_MARGB,
+sRTF_FACINGP, RTF_FACINGP,
+sRTF_GUTTER, RTF_GUTTER,
+sRTF_DEFTAB, RTF_DEFTAB,
+sRTF_WIDOWCTRL, RTF_WIDOWCTRL,
+sRTF_HYPHHOTZ, RTF_HYPHHOTZ,
+sRTF_FTNSEP, RTF_FTNSEP,
+sRTF_FTNSEPC, RTF_FTNSEPC,
+sRTF_FTNCN, RTF_FTNCN,
+sRTF_ENDNOTES, RTF_ENDNOTES,
+sRTF_ENDDOC, RTF_ENDDOC,
+sRTF_FTNTJ, RTF_FTNTJ,
+sRTF_FTNBJ, RTF_FTNBJ,
+sRTF_FTNSTART, RTF_FTNSTART,
+sRTF_FTNRESTART, RTF_FTNRESTART,
+sRTF_PGNSTART, RTF_PGNSTART,
+sRTF_LINESTART, RTF_LINESTART,
+sRTF_LANDSCAPE, RTF_LANDSCAPE,
+sRTF_FRACWIDTH, RTF_FRACWIDTH,
+sRTF_NEXTFILE, RTF_NEXTFILE,
+sRTF_TEMPLATE, RTF_TEMPLATE,
+sRTF_MAKEBACKUP, RTF_MAKEBACKUP,
+sRTF_DEFFORMAT, RTF_DEFFORMAT,
+sRTF_REVISIONS, RTF_REVISIONS,
+sRTF_MARGMIRROR, RTF_MARGMIRROR,
+sRTF_REVPROP, RTF_REVPROP,
+sRTF_REVBAR, RTF_REVBAR,
+sRTF_SECTD, RTF_SECTD,
+sRTF_SBKNONE, RTF_SBKNONE,
+sRTF_SBKCOL, RTF_SBKCOL,
+sRTF_SBKPAGE, RTF_SBKPAGE,
+sRTF_SBKEVEN, RTF_SBKEVEN,
+sRTF_SBKODD, RTF_SBKODD,
+sRTF_PGNSTARTS, RTF_PGNSTARTS,
+sRTF_PGNCONT, RTF_PGNCONT,
+sRTF_PGNRESTART, RTF_PGNRESTART,
+sRTF_PGNDEC, RTF_PGNDEC,
+sRTF_PGNUCRM, RTF_PGNUCRM,
+sRTF_PGNLCRM, RTF_PGNLCRM,
+sRTF_PGNUCLTR, RTF_PGNUCLTR,
+sRTF_PGNLCLTR, RTF_PGNLCLTR,
+sRTF_PGNX, RTF_PGNX,
+sRTF_PGNY, RTF_PGNY,
+sRTF_HEADERY, RTF_HEADERY,
+sRTF_FOOTERY, RTF_FOOTERY,
+sRTF_LINEMOD, RTF_LINEMOD,
+sRTF_LINEX, RTF_LINEX,
+sRTF_LINESTARTS, RTF_LINESTARTS,
+sRTF_LINERESTART, RTF_LINERESTART,
+sRTF_LINEPPAGE, RTF_LINEPAGE,
+sRTF_LINECONT, RTF_LINECONT,
+sRTF_VERTALT, RTF_VERTALT,
+sRTF_VERTALB, RTF_VERTALB,
+sRTF_VERTALC, RTF_VERTALC,
+sRTF_VERTALJ, RTF_VERTALJ,
+sRTF_COLS, RTF_COLS,
+sRTF_COLSX, RTF_COLSX,
+sRTF_COLNO, RTF_COLNO,
+sRTF_COLSR, RTF_COLSR,
+sRTF_COLW, RTF_COLW,
+sRTF_LINEBETCOL, RTF_LINEBETCOL,
+sRTF_ENDNHERE, RTF_ENDNHERE,
+sRTF_TITLEPG, RTF_TITLEPG,
+sRTF_PARD, RTF_PARD,
+sRTF_S, RTF_S,
+sRTF_QL, RTF_QL,
+sRTF_QR, RTF_QR,
+sRTF_QJ, RTF_QJ,
+sRTF_QC, RTF_QC,
+sRTF_FI, RTF_FI,
+sRTF_LI, RTF_LI,
+sRTF_RI, RTF_RI,
+sRTF_SB, RTF_SB,
+sRTF_SA, RTF_SA,
+sRTF_SL, RTF_SL,
+sRTF_INTBL, RTF_INTBL,
+sRTF_KEEP, RTF_KEEP,
+sRTF_KEEPN, RTF_KEEPN,
+sRTF_LEVEL, RTF_LEVEL,
+sRTF_SBYS, RTF_SBYS,
+sRTF_PAGEBB, RTF_PAGEBB,
+sRTF_NOLINE, RTF_NOLINE,
+sRTF_TX, RTF_TX,
+sRTF_TQL, RTF_TQL,
+sRTF_TQR, RTF_TQR,
+sRTF_TQC, RTF_TQC,
+sRTF_TQDEC, RTF_TQDEC,
+sRTF_TB, RTF_TB,
+sRTF_BRDRT, RTF_BRDRT,
+sRTF_BRDRB, RTF_BRDRB,
+sRTF_BRDRL, RTF_BRDRL,
+sRTF_BRDRR, RTF_BRDRR,
+sRTF_BOX, RTF_BOX,
+sRTF_BRDRS, RTF_BRDRS,
+sRTF_BRDRTH, RTF_BRDRTH,
+sRTF_BRDRSH, RTF_BRDRSH,
+sRTF_BRDRDB, RTF_BRDRDB,
+sRTF_BRDRDOT, RTF_BRDRDOT,
+sRTF_BRDRHAIR, RTF_BRDRHAIR,
+sRTF_BRSP, RTF_BRSP,
+sRTF_TLDOT, RTF_TLDOT,
+sRTF_TLHYPH, RTF_TLHYPH,
+sRTF_TLUL, RTF_TLUL,
+sRTF_TLTH, RTF_TLTH,
+sRTF_POSX, RTF_POSX,
+sRTF_POSXC, RTF_POSXC,
+sRTF_POSXI, RTF_POSXI,
+sRTF_POSXL, RTF_POSXL,
+sRTF_POSXO, RTF_POSXO,
+sRTF_POSXR, RTF_POSXR,
+sRTF_POSY, RTF_POSY,
+sRTF_POSYIL, RTF_POSYIL,
+sRTF_POSYT, RTF_POSYT,
+sRTF_POSYC, RTF_POSYC,
+sRTF_POSYB, RTF_POSYB,
+sRTF_ABSW, RTF_ABSW,
+sRTF_DXFRTEXT, RTF_DXFRTEXT,
+sRTF_PVMRG, RTF_PVMRG,
+sRTF_PVPG, RTF_PVPG,
+sRTF_PHMRG, RTF_PHMRG,
+sRTF_PHPG, RTF_PHPG,
+sRTF_PHCOL, RTF_PHCOL,
+sRTF_CLBRDRB, RTF_CLBRDRB,
+sRTF_CLBRDRT, RTF_CLBRDRT,
+sRTF_CLBRDRL, RTF_CLBRDRL,
+sRTF_CLBRDRR, RTF_CLBRDRR,
+sRTF_TROWD, RTF_TROWD,
+sRTF_TRQL, RTF_TRQL,
+sRTF_TRQR, RTF_TRQR,
+sRTF_TRQC, RTF_TRQC,
+sRTF_TRGAPH, RTF_TRGAPH,
+sRTF_TRRH, RTF_TRRH,
+sRTF_TRLEFT, RTF_TRLEFT,
+sRTF_CELLX, RTF_CELLX,
+sRTF_CLMGF, RTF_CLMGF,
+sRTF_CLMRG, RTF_CLMRG,
+sRTF_PLAIN, RTF_PLAIN,
+sRTF_B, RTF_B,
+sRTF_I, RTF_I,
+sRTF_STRIKE, RTF_STRIKE,
+sRTF_OUTL, RTF_OUTL,
+sRTF_SHAD, RTF_SHAD,
+sRTF_SCAPS, RTF_SCAPS,
+sRTF_CAPS, RTF_CAPS,
+sRTF_V, RTF_V,
+sRTF_F, RTF_F,
+sRTF_FS, RTF_FS,
+sRTF_EXPND, RTF_EXPND,
+sRTF_EXPNDTW, RTF_EXPNDTW,
+sRTF_KERNING, RTF_KERNING,
+sRTF_UL, RTF_UL,
+sRTF_ULW, RTF_ULW,
+sRTF_ULD, RTF_ULD,
+sRTF_ULDB, RTF_ULDB,
+sRTF_ULNONE, RTF_ULNONE,
+sRTF_UP, RTF_UP,
+sRTF_DN, RTF_DN,
+sRTF_REVISED, RTF_REVISED,
+sRTF_SUB, RTF_SUB,
+sRTF_NOSUPERSUB, RTF_NOSUPERSUB,
+sRTF_SUPER, RTF_SUPER,
+sRTF_CHDATE, RTF_CHDATE,
+sRTF_CHTIME, RTF_CHTIME,
+sRTF_CHPGN, RTF_CHPGN,
+sRTF_CHFTN, RTF_CHFTN,
+sRTF_CHATN, RTF_CHATN,
+sRTF_CHFTNSEP, RTF_CHFTNSEP,
+sRTF_CHFTNSEPC, RTF_CHFTNSEPC,
+sRTF_FORMULA, RTF_FORMULA,
+sRTF_NOBREAK, RTF_NONBREAKINGSPACE,
+sRTF_OPTHYPH, RTF_OPTIONALHYPHEN,
+sRTF_NOBRKHYPH, RTF_NONBREAKINGHYPHEN,
+sRTF_HEXCHAR, RTF_HEX,
+sRTF_CELL, RTF_CELL,
+sRTF_ROW, RTF_ROW,
+sRTF_PAR, RTF_PAR,
+sRTF_SECT, RTF_SECT,
+sRTF_PAGE, RTF_PAGE,
+sRTF_COLUMN, RTF_COLUM,
+sRTF_LINE, RTF_LINE,
+sRTF_TAB, RTF_TAB,
+sRTF_SUBENTRY, RTF_SUBENTRYINDEX,
+
+sRTF_DEFLANG, RTF_DEFLANG,
+sRTF_LANG, RTF_LANG,
+sRTF_PMMETAFILE, RTF_OSMETAFILE,
+sRTF_DIBITMAP, RTF_DIBITMAP,
+sRTF_KEYCODE, RTF_KEYCODE,
+sRTF_FN, RTF_FNKEY,
+sRTF_ALT, RTF_ALTKEY,
+sRTF_SHIFT, RTF_SHIFTKEY,
+sRTF_CTRL, RTF_CTRLKEY,
+sRTF_CHDPL, RTF_CHDATEL,
+sRTF_CHDPA, RTF_CHDATEA,
+sRTF_EMDASH, RTF_EMDASH,
+sRTF_ENDASH, RTF_ENDASH,
+sRTF_BULLET, RTF_BULLET,
+sRTF_LQUOTE, RTF_LQUOTE,
+sRTF_RQUOTE, RTF_RQUOTE,
+sRTF_LDBLQUOTE, RTF_LDBLQUOTE,
+sRTF_RDBLQUOTE, RTF_RDBLQUOTE,
+
+sRTF_BKMKCOLF, RTF_BKMKCOLF,
+sRTF_BKMKCOLL, RTF_BKMKCOLL,
+sRTF_PSOVER, RTF_PSOVER,
+sRTF_DOCTEMP, RTF_DOCTEMP,
+sRTF_BINFSXN, RTF_BINFSXN,
+sRTF_BINSXN, RTF_BINSXN,
+sRTF_PGWSXN, RTF_PGWSXN,
+sRTF_PGHSXN, RTF_PGHSXN,
+sRTF_MARGLSXN, RTF_MARGLSXN,
+sRTF_MARGRSXN, RTF_MARGRSXN,
+sRTF_MARGTSXN, RTF_MARGTSXN,
+sRTF_MARGBSXN, RTF_MARGBSXN,
+sRTF_GUTTERSXN, RTF_GUTTERSXN,
+sRTF_LNDSCPSXN, RTF_LNDSCPSXN,
+sRTF_FACPGSXN, RTF_FACPGSXN,
+sRTF_TLEQ, RTF_TLEQ,
+sRTF_BRDRBTW, RTF_BRDRBTW,
+sRTF_BRDRBAR, RTF_BRDRBAR,
+sRTF_BRDRW, RTF_BRDRW,
+sRTF_BRDRCF, RTF_BRDRCF,
+sRTF_ABSH, RTF_ABSH,
+sRTF_PVPARA, RTF_PVPARA,
+sRTF_NOWRAP, RTF_NOWRAP,
+sRTF_DFRMTXTX, RTF_DFRMTXTX,
+sRTF_DFRMTXTY, RTF_DFRMTXTY,
+sRTF_DROPCAPLI, RTF_DROPCAPLI,
+sRTF_DROPCAPLT, RTF_DROPCAPLT,
+sRTF_POSNEGX, RTF_POSNEGX,
+sRTF_POSNEGY, RTF_POSNEGY,
+sRTF_DELETED, RTF_DELETED,
+
+sRTF_SHADING, RTF_SHADING,
+sRTF_BGHORIZ, RTF_BGHORIZ,
+sRTF_BGVERT, RTF_BGVERT,
+sRTF_BGFDIAG, RTF_BGFDIAG,
+sRTF_BGBDIAG, RTF_BGBDIAG,
+sRTF_BGCROSS, RTF_BGCROSS,
+sRTF_BGDCROSS, RTF_BGDCROSS,
+sRTF_BGDKHORIZ, RTF_BGDKHORIZ,
+sRTF_BGDKVERT, RTF_BGDKVERT,
+sRTF_BGDKFDIAG, RTF_BGDKFDIAG,
+sRTF_BGDKBDIAG, RTF_BGDKBDIAG,
+sRTF_BGDKCROSS, RTF_BGDKCROSS,
+sRTF_BGDKDCROSS, RTF_BGDKDCROSS,
+sRTF_CFPAT, RTF_CFPAT,
+sRTF_CBPAT, RTF_CBPAT,
+
+sRTF_CLSHDNG, RTF_CLSHDNG,
+sRTF_CLBGHORIZ, RTF_CLBGHORIZ,
+sRTF_CLBGVERT, RTF_CLBGVERT,
+sRTF_CLBGFDIAG, RTF_CLBGFDIAG,
+sRTF_CLBGBDIAG, RTF_CLBGBDIAG,
+sRTF_CLBGCROSS, RTF_CLBGCROSS,
+sRTF_CLBGDCROSS, RTF_CLBGDCROSS,
+sRTF_CLBGDKHOR, RTF_CLBGDKHOR,
+sRTF_CLBGDKVERT, RTF_CLBGDKVERT,
+sRTF_CLBGDKFDIAG, RTF_CLBGDKFDIAG,
+sRTF_CLBGDKBDIAG, RTF_CLBGDKBDIAG,
+sRTF_CLBGDKCROSS, RTF_CLBGDKCROSS,
+sRTF_CLBGDKDCROSS, RTF_CLBGDKDCROSS,
+sRTF_CLCFPAT, RTF_CLCFPAT,
+sRTF_CLCBPAT, RTF_CLCBPAT,
+
+sRTF_AB, RTF_AB,
+sRTF_ACAPS, RTF_ACAPS,
+sRTF_ACF, RTF_ACF,
+sRTF_ADDITIVE, RTF_ADDITIVE,
+sRTF_ADN, RTF_ADN,
+sRTF_AENDDOC, RTF_AENDDOC,
+sRTF_AENDNOTES, RTF_AENDNOTES,
+sRTF_AEXPND, RTF_AEXPND,
+sRTF_AF, RTF_AF,
+sRTF_AFS, RTF_AFS,
+sRTF_AFTNBJ, RTF_AFTNBJ,
+sRTF_AFTNCN, RTF_AFTNCN,
+sRTF_AFTNNALC, RTF_AFTNNALC,
+sRTF_AFTNNAR, RTF_AFTNNAR,
+sRTF_AFTNNAUC, RTF_AFTNNAUC,
+sRTF_AFTNNCHI, RTF_AFTNNCHI,
+sRTF_AFTNNRLC, RTF_AFTNNRLC,
+sRTF_AFTNNRUC, RTF_AFTNNRUC,
+sRTF_AFTNRESTART, RTF_AFTNRESTART,
+sRTF_AFTNRSTCONT, RTF_AFTNRSTCONT,
+sRTF_AFTNSEP, RTF_AFTNSEP,
+sRTF_AFTNSEPC, RTF_AFTNSEPC,
+sRTF_AFTNSTART, RTF_AFTNSTART,
+sRTF_AFTNTJ, RTF_AFTNTJ,
+sRTF_AI, RTF_AI,
+sRTF_ALANG, RTF_ALANG,
+sRTF_ALLPROT, RTF_ALLPROT,
+sRTF_ANNOTPROT, RTF_ANNOTPROT,
+sRTF_AOUTL, RTF_AOUTL,
+sRTF_ASCAPS, RTF_ASCAPS,
+sRTF_ASHAD, RTF_ASHAD,
+sRTF_ASTRIKE, RTF_ASTRIKE,
+sRTF_ATNAUTHOR, RTF_ATNAUTHOR,
+sRTF_ATNICN, RTF_ATNICN,
+sRTF_ATNREF, RTF_ATNREF,
+sRTF_ATNTIME, RTF_ATNTIME,
+sRTF_ATRFEND, RTF_ATRFEND,
+sRTF_ATRFSTART, RTF_ATRFSTART,
+sRTF_AUL, RTF_AUL,
+sRTF_AULD, RTF_AULD,
+sRTF_AULDB, RTF_AULDB,
+sRTF_AULNONE, RTF_AULNONE,
+sRTF_AULW, RTF_AULW,
+sRTF_AUP, RTF_AUP,
+sRTF_BKMKPUB, RTF_BKMKPUB,
+sRTF_BRDRDASH, RTF_BRDRDASH,
+sRTF_BRKFRM, RTF_BRKFRM,
+sRTF_CCHS, RTF_CCHS,
+sRTF_CPG, RTF_CPG,
+sRTF_CS, RTF_CS,
+sRTF_CVMME, RTF_CVMME,
+sRTF_DATAFIELD, RTF_DATAFIELD,
+sRTF_DO, RTF_DO,
+sRTF_DOBXCOLUMN, RTF_DOBXCOLUMN,
+sRTF_DOBXMARGIN, RTF_DOBXMARGIN,
+sRTF_DOBXPAGE, RTF_DOBXPAGE,
+sRTF_DOBYMARGIN, RTF_DOBYMARGIN,
+sRTF_DOBYPAGE, RTF_DOBYPAGE,
+sRTF_DOBYPARA, RTF_DOBYPARA,
+sRTF_DODHGT, RTF_DODHGT,
+sRTF_DOLOCK, RTF_DOLOCK,
+sRTF_DPAENDHOL, RTF_DPAENDHOL,
+sRTF_DPAENDL, RTF_DPAENDL,
+sRTF_DPAENDSOL, RTF_DPAENDSOL,
+sRTF_DPAENDW, RTF_DPAENDW,
+sRTF_DPARC, RTF_DPARC,
+sRTF_DPARCFLIPX, RTF_DPARCFLIPX,
+sRTF_DPARCFLIPY, RTF_DPARCFLIPY,
+sRTF_DPASTARTHOL, RTF_DPASTARTHOL,
+sRTF_DPASTARTL, RTF_DPASTARTL,
+sRTF_DPASTARTSOL, RTF_DPASTARTSOL,
+sRTF_DPASTARTW, RTF_DPASTARTW,
+sRTF_DPCALLOUT, RTF_DPCALLOUT,
+sRTF_DPCOA, RTF_DPCOA,
+sRTF_DPCOACCENT, RTF_DPCOACCENT,
+sRTF_DPCOBESTFIT, RTF_DPCOBESTFIT,
+sRTF_DPCOBORDER, RTF_DPCOBORDER,
+sRTF_DPCODABS, RTF_DPCODABS,
+sRTF_DPCODBOTTOM, RTF_DPCODBOTTOM,
+sRTF_DPCODCENTER, RTF_DPCODCENTER,
+sRTF_DPCODTOP, RTF_DPCODTOP,
+sRTF_DPCOLENGTH, RTF_DPCOLENGTH,
+sRTF_DPCOMINUSX, RTF_DPCOMINUSX,
+sRTF_DPCOMINUSY, RTF_DPCOMINUSY,
+sRTF_DPCOOFFSET, RTF_DPCOOFFSET,
+sRTF_DPCOSMARTA, RTF_DPCOSMARTA,
+sRTF_DPCOTDOUBLE, RTF_DPCOTDOUBLE,
+sRTF_DPCOTRIGHT, RTF_DPCOTRIGHT,
+sRTF_DPCOTSINGLE, RTF_DPCOTSINGLE,
+sRTF_DPCOTTRIPLE, RTF_DPCOTTRIPLE,
+sRTF_DPCOUNT, RTF_DPCOUNT,
+sRTF_DPELLIPSE, RTF_DPELLIPSE,
+sRTF_DPENDGROUP, RTF_DPENDGROUP,
+sRTF_DPFILLBGCB, RTF_DPFILLBGCB,
+sRTF_DPFILLBGCG, RTF_DPFILLBGCG,
+sRTF_DPFILLBGCR, RTF_DPFILLBGCR,
+sRTF_DPFILLBGGRAY, RTF_DPFILLBGGRAY,
+sRTF_DPFILLBGPAL, RTF_DPFILLBGPAL,
+sRTF_DPFILLFGCB, RTF_DPFILLFGCB,
+sRTF_DPFILLFGCG, RTF_DPFILLFGCG,
+sRTF_DPFILLFGCR, RTF_DPFILLFGCR,
+sRTF_DPFILLFGGRAY, RTF_DPFILLFGGRAY,
+sRTF_DPFILLFGPAL, RTF_DPFILLFGPAL,
+sRTF_DPFILLPAT, RTF_DPFILLPAT,
+sRTF_DPGROUP, RTF_DPGROUP,
+sRTF_DPLINE, RTF_DPLINE,
+sRTF_DPLINECOB, RTF_DPLINECOB,
+sRTF_DPLINECOG, RTF_DPLINECOG,
+sRTF_DPLINECOR, RTF_DPLINECOR,
+sRTF_DPLINEDADO, RTF_DPLINEDADO,
+sRTF_DPLINEDADODO, RTF_DPLINEDADODO,
+sRTF_DPLINEDASH, RTF_DPLINEDASH,
+sRTF_DPLINEDOT, RTF_DPLINEDOT,
+sRTF_DPLINEGRAY, RTF_DPLINEGRAY,
+sRTF_DPLINEHOLLOW, RTF_DPLINEHOLLOW,
+sRTF_DPLINEPAL, RTF_DPLINEPAL,
+sRTF_DPLINESOLID, RTF_DPLINESOLID,
+sRTF_DPLINEW, RTF_DPLINEW,
+sRTF_DPPOLYCOUNT, RTF_DPPOLYCOUNT,
+sRTF_DPPOLYGON, RTF_DPPOLYGON,
+sRTF_DPPOLYLINE, RTF_DPPOLYLINE,
+sRTF_DPPTX, RTF_DPPTX,
+sRTF_DPPTY, RTF_DPPTY,
+sRTF_DPRECT, RTF_DPRECT,
+sRTF_DPROUNDR, RTF_DPROUNDR,
+sRTF_DPSHADOW, RTF_DPSHADOW,
+sRTF_DPSHADX, RTF_DPSHADX,
+sRTF_DPSHADY, RTF_DPSHADY,
+sRTF_DPTXBX, RTF_DPTXBX,
+sRTF_DPTXBXMAR, RTF_DPTXBXMAR,
+sRTF_DPTXBXTEXT, RTF_DPTXBXTEXT,
+sRTF_DPX, RTF_DPX,
+sRTF_DPXSIZE, RTF_DPXSIZE,
+sRTF_DPY, RTF_DPY,
+sRTF_DPYSIZE, RTF_DPYSIZE,
+sRTF_DS, RTF_DS,
+sRTF_EMSPACE, RTF_EMSPACE,
+sRTF_ENSPACE, RTF_ENSPACE,
+sRTF_FBIDI, RTF_FBIDI,
+sRTF_FET, RTF_FET,
+sRTF_FID, RTF_FID,
+sRTF_FILE, RTF_FILE,
+sRTF_FILETBL, RTF_FILETBL,
+sRTF_FLDALT, RTF_FLDALT,
+sRTF_FNETWORK, RTF_FNETWORK,
+sRTF_FONTEMB, RTF_FONTEMB,
+sRTF_FONTFILE, RTF_FONTFILE,
+sRTF_FORMDISP, RTF_FORMDISP,
+sRTF_FORMPROT, RTF_FORMPROT,
+sRTF_FORMSHADE, RTF_FORMSHADE,
+sRTF_FOSNUM, RTF_FOSNUM,
+sRTF_FRELATIVE, RTF_FRELATIVE,
+sRTF_FTNALT, RTF_FTNALT,
+sRTF_FTNIL, RTF_FTNIL,
+sRTF_FTNNALC, RTF_FTNNALC,
+sRTF_FTNNAR, RTF_FTNNAR,
+sRTF_FTNNAUC, RTF_FTNNAUC,
+sRTF_FTNNCHI, RTF_FTNNCHI,
+sRTF_FTNNRLC, RTF_FTNNRLC,
+sRTF_FTNNRUC, RTF_FTNNRUC,
+sRTF_FTNRSTCONT, RTF_FTNRSTCONT,
+sRTF_FTNRSTPG, RTF_FTNRSTPG,
+sRTF_FTTRUETYPE, RTF_FTTRUETYPE,
+sRTF_FVALIDDOS, RTF_FVALIDDOS,
+sRTF_FVALIDHPFS, RTF_FVALIDHPFS,
+sRTF_FVALIDMAC, RTF_FVALIDMAC,
+sRTF_FVALIDNTFS, RTF_FVALIDNTFS,
+sRTF_HYPHAUTO, RTF_HYPHAUTO,
+sRTF_HYPHCAPS, RTF_HYPHCAPS,
+sRTF_HYPHCONSEC, RTF_HYPHCONSEC,
+sRTF_HYPHPAR, RTF_HYPHPAR,
+sRTF_LINKSELF, RTF_LINKSELF,
+sRTF_LINKSTYLES, RTF_LINKSTYLES,
+sRTF_LTRCH, RTF_LTRCH,
+sRTF_LTRDOC, RTF_LTRDOC,
+sRTF_LTRMARK, RTF_LTRMARK,
+sRTF_LTRPAR, RTF_LTRPAR,
+sRTF_LTRROW, RTF_LTRROW,
+sRTF_LTRSECT, RTF_LTRSECT,
+sRTF_NOCOLBAL, RTF_NOCOLBAL,
+sRTF_NOEXTRASPRL, RTF_NOEXTRASPRL,
+sRTF_NOTABIND, RTF_NOTABIND,
+sRTF_NOWIDCTLPAR, RTF_NOWIDCTLPAR,
+sRTF_OBJALIAS, RTF_OBJALIAS,
+sRTF_OBJALIGN, RTF_OBJALIGN,
+sRTF_OBJAUTLINK, RTF_OBJAUTLINK,
+sRTF_OBJCLASS, RTF_OBJCLASS,
+sRTF_OBJCROPB, RTF_OBJCROPB,
+sRTF_OBJCROPL, RTF_OBJCROPL,
+sRTF_OBJCROPR, RTF_OBJCROPR,
+sRTF_OBJCROPT, RTF_OBJCROPT,
+sRTF_OBJDATA, RTF_OBJDATA,
+sRTF_OBJECT, RTF_OBJECT,
+sRTF_OBJEMB, RTF_OBJEMB,
+sRTF_OBJH, RTF_OBJH,
+sRTF_OBJICEMB, RTF_OBJICEMB,
+sRTF_OBJLINK, RTF_OBJLINK,
+sRTF_OBJLOCK, RTF_OBJLOCK,
+sRTF_OBJNAME, RTF_OBJNAME,
+sRTF_OBJPUB, RTF_OBJPUB,
+sRTF_OBJSCALEX, RTF_OBJSCALEX,
+sRTF_OBJSCALEY, RTF_OBJSCALEY,
+sRTF_OBJSECT, RTF_OBJSECT,
+sRTF_OBJSETSIZE, RTF_OBJSETSIZE,
+sRTF_OBJSUB, RTF_OBJSUB,
+sRTF_OBJTIME, RTF_OBJTIME,
+sRTF_OBJTRANSY, RTF_OBJTRANSY,
+sRTF_OBJUPDATE, RTF_OBJUPDATE,
+sRTF_OBJW, RTF_OBJW,
+sRTF_OTBLRUL, RTF_OTBLRUL,
+sRTF_PGNHN, RTF_PGNHN,
+sRTF_PGNHNSC, RTF_PGNHNSC,
+sRTF_PGNHNSH, RTF_PGNHNSH,
+sRTF_PGNHNSM, RTF_PGNHNSM,
+sRTF_PGNHNSN, RTF_PGNHNSN,
+sRTF_PGNHNSP, RTF_PGNHNSP,
+sRTF_PICBMP, RTF_PICBMP,
+sRTF_PICBPP, RTF_PICBPP,
+sRTF_PN, RTF_PN,
+sRTF_PNACROSS, RTF_PNACROSS,
+sRTF_PNB, RTF_PNB,
+sRTF_PNCAPS, RTF_PNCAPS,
+sRTF_PNCARD, RTF_PNCARD,
+sRTF_PNCF, RTF_PNCF,
+sRTF_PNDEC, RTF_PNDEC,
+sRTF_PNF, RTF_PNF,
+sRTF_PNFS, RTF_PNFS,
+sRTF_PNHANG, RTF_PNHANG,
+sRTF_PNI, RTF_PNI,
+sRTF_PNINDENT, RTF_PNINDENT,
+sRTF_PNLCLTR, RTF_PNLCLTR,
+sRTF_PNLCRM, RTF_PNLCRM,
+sRTF_PNLVL, RTF_PNLVL,
+sRTF_PNLVLBLT, RTF_PNLVLBLT,
+sRTF_PNLVLBODY, RTF_PNLVLBODY,
+sRTF_PNLVLCONT, RTF_PNLVLCONT,
+sRTF_PNNUMONCE, RTF_PNNUMONCE,
+sRTF_PNORD, RTF_PNORD,
+sRTF_PNORDT, RTF_PNORDT,
+sRTF_PNPREV, RTF_PNPREV,
+sRTF_PNQC, RTF_PNQC,
+sRTF_PNQL, RTF_PNQL,
+sRTF_PNQR, RTF_PNQR,
+sRTF_PNRESTART, RTF_PNRESTART,
+sRTF_PNSCAPS, RTF_PNSCAPS,
+sRTF_PNSECLVL, RTF_PNSECLVL,
+sRTF_PNSP, RTF_PNSP,
+sRTF_PNSTART, RTF_PNSTART,
+sRTF_PNSTRIKE, RTF_PNSTRIKE,
+sRTF_PNTEXT, RTF_PNTEXT,
+sRTF_PNTXTA, RTF_PNTXTA,
+sRTF_PNTXTB, RTF_PNTXTB,
+sRTF_PNUCLTR, RTF_PNUCLTR,
+sRTF_PNUCRM, RTF_PNUCRM,
+sRTF_PNUL, RTF_PNUL,
+sRTF_PNULD, RTF_PNULD,
+sRTF_PNULDB, RTF_PNULDB,
+sRTF_PNULNONE, RTF_PNULNONE,
+sRTF_PNULW, RTF_PNULW,
+sRTF_PRCOLBL, RTF_PRCOLBL,
+sRTF_PRINTDATA, RTF_PRINTDATA,
+sRTF_PSZ, RTF_PSZ,
+sRTF_PUBAUTO, RTF_PUBAUTO,
+sRTF_RESULT, RTF_RESULT,
+sRTF_REVAUTH, RTF_REVAUTH,
+sRTF_REVDTTM, RTF_REVDTTM,
+sRTF_REVPROT, RTF_REVPROT,
+sRTF_REVTBL, RTF_REVTBL,
+sRTF_RSLTBMP, RTF_RSLTBMP,
+sRTF_RSLTMERGE, RTF_RSLTMERGE,
+sRTF_RSLTPICT, RTF_RSLTPICT,
+sRTF_RSLTRTF, RTF_RSLTRTF,
+sRTF_RSLTTXT, RTF_RSLTTXT,
+sRTF_RTLCH, RTF_RTLCH,
+sRTF_RTLDOC, RTF_RTLDOC,
+sRTF_RTLMARK, RTF_RTLMARK,
+sRTF_RTLPAR, RTF_RTLPAR,
+sRTF_RTLROW, RTF_RTLROW,
+sRTF_RTLSECT, RTF_RTLSECT,
+sRTF_SEC, RTF_SEC,
+sRTF_SECTNUM, RTF_SECTNUM,
+sRTF_SECTUNLOCKED, RTF_SECTUNLOCKED,
+sRTF_SLMULT, RTF_SLMULT,
+sRTF_SOFTCOL, RTF_SOFTCOL,
+sRTF_SOFTLHEIGHT, RTF_SOFTLHEIGHT,
+sRTF_SOFTLINE, RTF_SOFTLINE,
+sRTF_SOFTPAGE, RTF_SOFTPAGE,
+sRTF_SPRSSPBF, RTF_SPRSSPBF,
+sRTF_SPRSTSP, RTF_SPRSTSP,
+sRTF_SUBDOCUMENT, RTF_SUBDOCUMENT,
+sRTF_SWPBDR, RTF_SWPBDR,
+sRTF_TCN, RTF_TCN,
+sRTF_TRANSMF, RTF_TRANSMF,
+sRTF_TRBRDRB, RTF_TRBRDRB,
+sRTF_TRBRDRH, RTF_TRBRDRH,
+sRTF_TRBRDRL, RTF_TRBRDRL,
+sRTF_TRBRDRR, RTF_TRBRDRR,
+sRTF_TRBRDRT, RTF_TRBRDRT,
+sRTF_TRBRDRV, RTF_TRBRDRV,
+sRTF_TRHDR, RTF_TRHDR,
+sRTF_TRKEEP, RTF_TRKEEP,
+sRTF_WRAPTRSP, RTF_WRAPTRSP,
+sRTF_XEF, RTF_XEF,
+sRTF_ZWJ, RTF_ZWJ,
+sRTF_ZWNJ, RTF_ZWNJ,
+
+
+sRTF_ABSLOCK, RTF_ABSLOCK,
+sRTF_ADJUSTRIGHT, RTF_ADJUSTRIGHT,
+sRTF_AFTNNCHOSUNG, RTF_AFTNNCHOSUNG,
+sRTF_AFTNNCNUM, RTF_AFTNNCNUM,
+sRTF_AFTNNDBAR, RTF_AFTNNDBAR,
+sRTF_AFTNNDBNUM, RTF_AFTNNDBNUM,
+sRTF_AFTNNDBNUMD, RTF_AFTNNDBNUMD,
+sRTF_AFTNNDBNUMK, RTF_AFTNNDBNUMK,
+sRTF_AFTNNDBNUMT, RTF_AFTNNDBNUMT,
+sRTF_AFTNNGANADA, RTF_AFTNNGANADA,
+sRTF_AFTNNGBNUM, RTF_AFTNNGBNUM,
+sRTF_AFTNNGBNUMD, RTF_AFTNNGBNUMD,
+sRTF_AFTNNGBNUMK, RTF_AFTNNGBNUMK,
+sRTF_AFTNNGBNUML, RTF_AFTNNGBNUML,
+sRTF_AFTNNZODIAC, RTF_AFTNNZODIAC,
+sRTF_AFTNNZODIACD, RTF_AFTNNZODIACD,
+sRTF_AFTNNZODIACL, RTF_AFTNNZODIACL,
+sRTF_ANIMTEXT, RTF_ANIMTEXT,
+sRTF_ANSICPG, RTF_ANSICPG,
+sRTF_BACKGROUND, RTF_BACKGROUND,
+sRTF_BDBFHDR, RTF_BDBFHDR,
+sRTF_BLIPTAG, RTF_BLIPTAG,
+sRTF_BLIPUID, RTF_BLIPUID,
+sRTF_BLIPUPI, RTF_BLIPUPI,
+sRTF_BRDRART, RTF_BRDRART,
+sRTF_BRDRDASHD, RTF_BRDRDASHD,
+sRTF_BRDRDASHDD, RTF_BRDRDASHDD,
+sRTF_BRDRDASHDOTSTR,RTF_BRDRDASHDOTSTR,
+sRTF_BRDRDASHSM, RTF_BRDRDASHSM,
+sRTF_BRDREMBOSS, RTF_BRDREMBOSS,
+sRTF_BRDRENGRAVE, RTF_BRDRENGRAVE,
+sRTF_BRDRFRAME, RTF_BRDRFRAME,
+sRTF_BRDRTHTNLG, RTF_BRDRTHTNLG,
+sRTF_BRDRTHTNMG, RTF_BRDRTHTNMG,
+sRTF_BRDRTHTNSG, RTF_BRDRTHTNSG,
+sRTF_BRDRTNTHLG, RTF_BRDRTNTHLG,
+sRTF_BRDRTNTHMG, RTF_BRDRTNTHMG,
+sRTF_BRDRTNTHSG, RTF_BRDRTNTHSG,
+sRTF_BRDRTNTHTNLG, RTF_BRDRTNTHTNLG,
+sRTF_BRDRTNTHTNMG, RTF_BRDRTNTHTNMG,
+sRTF_BRDRTNTHTNSG, RTF_BRDRTNTHTNSG,
+sRTF_BRDRTRIPLE, RTF_BRDRTRIPLE,
+sRTF_BRDRWAVY, RTF_BRDRWAVY,
+sRTF_BRDRWAVYDB, RTF_BRDRWAVYDB,
+sRTF_CATEGORY, RTF_CATEGORY,
+sRTF_CGRID, RTF_CGRID,
+sRTF_CHARSCALEX, RTF_CHARSCALEX,
+sRTF_CHBGBDIAG, RTF_CHBGBDIAG,
+sRTF_CHBGCROSS, RTF_CHBGCROSS,
+sRTF_CHBGDCROSS, RTF_CHBGDCROSS,
+sRTF_CHBGDKBDIAG, RTF_CHBGDKBDIAG,
+sRTF_CHBGDKCROSS, RTF_CHBGDKCROSS,
+sRTF_CHBGDKDCROSS, RTF_CHBGDKDCROSS,
+sRTF_CHBGDKFDIAG, RTF_CHBGDKFDIAG,
+sRTF_CHBGDKHORIZ, RTF_CHBGDKHORIZ,
+sRTF_CHBGDKVERT, RTF_CHBGDKVERT,
+sRTF_CHBGFDIAG, RTF_CHBGFDIAG,
+sRTF_CHBGHORIZ, RTF_CHBGHORIZ,
+sRTF_CHBGVERT, RTF_CHBGVERT,
+sRTF_CHBRDR, RTF_CHBRDR,
+sRTF_CHCBPAT, RTF_CHCBPAT,
+sRTF_CHCFPAT, RTF_CHCFPAT,
+sRTF_CHSHDNG, RTF_CHSHDNG,
+sRTF_CLTXLRTB, RTF_CLTXLRTB,
+sRTF_CLTXTBRL, RTF_CLTXTBRL,
+sRTF_CLVERTALB, RTF_CLVERTALB,
+sRTF_CLVERTALC, RTF_CLVERTALC,
+sRTF_CLVERTALT, RTF_CLVERTALT,
+sRTF_CLVMGF, RTF_CLVMGF,
+sRTF_CLVMRG, RTF_CLVMRG,
+sRTF_CLTXTBRLV, RTF_CLTXTBRLV,
+sRTF_CLTXBTLR, RTF_CLTXBTLR,
+sRTF_CLTXLRTBV, RTF_CLTXLRTBV,
+sRTF_COMPANY, RTF_COMPANY,
+sRTF_CRAUTH, RTF_CRAUTH,
+sRTF_CRDATE, RTF_CRDATE,
+sRTF_DATE, RTF_DATE,
+sRTF_DEFLANGFE, RTF_DEFLANGFE,
+sRTF_DFRAUTH, RTF_DFRAUTH,
+sRTF_DFRDATE, RTF_DFRDATE,
+sRTF_DFRSTART, RTF_DFRSTART,
+sRTF_DFRSTOP, RTF_DFRSTOP,
+sRTF_DFRXST, RTF_DFRXST,
+sRTF_DGMARGIN, RTF_DGMARGIN,
+sRTF_DNTBLNSBDB, RTF_DNTBLNSBDB,
+sRTF_DOCTYPE, RTF_DOCTYPE,
+sRTF_DOCVAR, RTF_DOCVAR,
+sRTF_DPCODESCENT, RTF_DPCODESCENT,
+sRTF_EMBO, RTF_EMBO,
+sRTF_EMFBLIP, RTF_EMFBLIP,
+sRTF_EXPSHRTN, RTF_EXPSHRTN,
+sRTF_FAAUTO, RTF_FAAUTO,
+sRTF_FBIAS, RTF_FBIAS,
+sRTF_FFDEFRES, RTF_FFDEFRES,
+sRTF_FFDEFTEXT, RTF_FFDEFTEXT,
+sRTF_FFENTRYMCR, RTF_FFENTRYMCR,
+sRTF_FFEXITMCR, RTF_FFEXITMCR,
+sRTF_FFFORMAT, RTF_FFFORMAT,
+sRTF_FFHASLISTBOX, RTF_FFHASLISTBOX,
+sRTF_FFHELPTEXT, RTF_FFHELPTEXT,
+sRTF_FFHPS, RTF_FFHPS,
+sRTF_FFL, RTF_FFL,
+sRTF_FFMAXLEN, RTF_FFMAXLEN,
+sRTF_FFNAME, RTF_FFNAME,
+sRTF_FFOWNHELP, RTF_FFOWNHELP,
+sRTF_FFOWNSTAT, RTF_FFOWNSTAT,
+sRTF_FFPROT, RTF_FFPROT,
+sRTF_FFRECALC, RTF_FFRECALC,
+sRTF_FFRES, RTF_FFRES,
+sRTF_FFSIZE, RTF_FFSIZE,
+sRTF_FFSTATTEXT, RTF_FFSTATTEXT,
+sRTF_FFTYPE, RTF_FFTYPE,
+sRTF_FFTYPETXT, RTF_FFTYPETXT,
+sRTF_FLDTYPE, RTF_FLDTYPE,
+sRTF_FNAME, RTF_FNAME,
+sRTF_FORMFIELD, RTF_FORMFIELD,
+sRTF_FROMTEXT, RTF_FROMTEXT,
+sRTF_FTNNCHOSUNG, RTF_FTNNCHOSUNG,
+sRTF_FTNNCNUM, RTF_FTNNCNUM,
+sRTF_FTNNDBAR, RTF_FTNNDBAR,
+sRTF_FTNNDBNUM, RTF_FTNNDBNUM,
+sRTF_FTNNDBNUMD, RTF_FTNNDBNUMD,
+sRTF_FTNNDBNUMK, RTF_FTNNDBNUMK,
+sRTF_FTNNDBNUMT, RTF_FTNNDBNUMT,
+sRTF_FTNNGANADA, RTF_FTNNGANADA,
+sRTF_FTNNGBNUM, RTF_FTNNGBNUM,
+sRTF_FTNNGBNUMD, RTF_FTNNGBNUMD,
+sRTF_FTNNGBNUMK, RTF_FTNNGBNUMK,
+sRTF_FTNNGBNUML, RTF_FTNNGBNUML,
+sRTF_FTNNZODIAC, RTF_FTNNZODIAC,
+sRTF_FTNNZODIACD, RTF_FTNNZODIACD,
+sRTF_FTNNZODIACL, RTF_FTNNZODIACL,
+sRTF_G, RTF_G,
+sRTF_GCW, RTF_GCW,
+sRTF_GRIDTBL, RTF_GRIDTBL,
+sRTF_HIGHLIGHT, RTF_HIGHLIGHT,
+sRTF_HLFR, RTF_HLFR,
+sRTF_HLINKBASE, RTF_HLINKBASE,
+sRTF_HLLOC, RTF_HLLOC,
+sRTF_HLSRC, RTF_HLSRC,
+sRTF_ILVL, RTF_ILVL,
+sRTF_IMPR, RTF_IMPR,
+sRTF_JPEGBLIP, RTF_JPEGBLIP,
+sRTF_LEVELFOLLOW, RTF_LEVELFOLLOW,
+sRTF_LEVELINDENT, RTF_LEVELINDENT,
+sRTF_LEVELJC, RTF_LEVELJC,
+sRTF_LEVELLEGAL, RTF_LEVELLEGAL,
+sRTF_LEVELNFC, RTF_LEVELNFC,
+sRTF_LEVELNORESTART,RTF_LEVELNORESTART,
+sRTF_LEVELNUMBERS, RTF_LEVELNUMBERS,
+sRTF_LEVELOLD, RTF_LEVELOLD,
+sRTF_LEVELPREV, RTF_LEVELPREV,
+sRTF_LEVELPREVSPACE,RTF_LEVELPREVSPACE,
+sRTF_LEVELSPACE, RTF_LEVELSPACE,
+sRTF_LEVELSTARTAT, RTF_LEVELSTARTAT,
+sRTF_LEVELTEXT, RTF_LEVELTEXT,
+sRTF_LINKVAL, RTF_LINKVAL,
+sRTF_LIST, RTF_LIST,
+sRTF_LISTID, RTF_LISTID,
+sRTF_LISTLEVEL, RTF_LISTLEVEL,
+sRTF_LISTNAME, RTF_LISTNAME,
+sRTF_LISTOVERRIDE, RTF_LISTOVERRIDE,
+sRTF_LISTOVERRIDECOUNT, RTF_LISTOVERRIDECOUNT,
+sRTF_LISTOVERRIDEFORMAT, RTF_LISTOVERRIDEFORMAT,
+sRTF_LISTOVERRIDESTART, RTF_LISTOVERRIDESTART,
+sRTF_LISTOVERRIDETABLE, RTF_LISTOVERRIDETABLE,
+sRTF_LISTRESTARTHDN,RTF_LISTRESTARTHDN,
+sRTF_LISTSIMPLE, RTF_LISTSIMPLE,
+sRTF_LISTTABLE, RTF_LISTTABLE,
+sRTF_LISTTEMPLATEID,RTF_LISTTEMPLATEID,
+sRTF_LISTTEXT, RTF_LISTTEXT,
+sRTF_LS, RTF_LS,
+sRTF_LYTEXCTTP, RTF_LYTEXCTTP,
+sRTF_LYTPRTMET, RTF_LYTPRTMET,
+sRTF_MANAGER, RTF_MANAGER,
+sRTF_MSMCAP, RTF_MSMCAP,
+sRTF_NOFCHARSWS, RTF_NOFCHARSWS,
+sRTF_NOLEAD, RTF_NOLEAD,
+sRTF_NONSHPPICT, RTF_NONSHPPICT,
+sRTF_NOSECTEXPAND, RTF_NOSECTEXPAND,
+sRTF_NOSNAPLINEGRID,RTF_NOSNAPLINEGRID,
+sRTF_NOSPACEFORUL, RTF_NOSPACEFORUL,
+sRTF_NOULTRLSPC, RTF_NOULTRLSPC,
+sRTF_NOXLATTOYEN, RTF_NOXLATTOYEN,
+sRTF_OBJATTPH, RTF_OBJATTPH,
+sRTF_OBJHTML, RTF_OBJHTML,
+sRTF_OBJOCX, RTF_OBJOCX,
+sRTF_OLDLINEWRAP, RTF_OLDLINEWRAP,
+sRTF_OUTLINELEVEL, RTF_OUTLINELEVEL,
+sRTF_OVERLAY, RTF_OVERLAY,
+sRTF_PANOSE, RTF_PANOSE,
+sRTF_PGBRDRB, RTF_PGBRDRB,
+sRTF_PGBRDRFOOT, RTF_PGBRDRFOOT,
+sRTF_PGBRDRHEAD, RTF_PGBRDRHEAD,
+sRTF_PGBRDRL, RTF_PGBRDRL,
+sRTF_PGBRDROPT, RTF_PGBRDROPT,
+sRTF_PGBRDRR, RTF_PGBRDRR,
+sRTF_PGBRDRSNAP, RTF_PGBRDRSNAP,
+sRTF_PGBRDRT, RTF_PGBRDRT,
+sRTF_PGNCHOSUNG, RTF_PGNCHOSUNG,
+sRTF_PGNCNUM, RTF_PGNCNUM,
+sRTF_PGNDBNUMK, RTF_PGNDBNUMK,
+sRTF_PGNDBNUMT, RTF_PGNDBNUMT,
+sRTF_PGNGANADA, RTF_PGNGANADA,
+sRTF_PGNGBNUM, RTF_PGNGBNUM,
+sRTF_PGNGBNUMD, RTF_PGNGBNUMD,
+sRTF_PGNGBNUMK, RTF_PGNGBNUMK,
+sRTF_PGNGBNUML, RTF_PGNGBNUML,
+sRTF_PGNZODIAC, RTF_PGNZODIAC,
+sRTF_PGNZODIACD, RTF_PGNZODIACD,
+sRTF_PGNZODIACL, RTF_PGNZODIACL,
+sRTF_PICPROP, RTF_PICPROP,
+sRTF_PNAIUEO, RTF_PNAIUEO,
+sRTF_PNAIUEOD, RTF_PNAIUEOD,
+sRTF_PNCHOSUNG, RTF_PNCHOSUNG,
+sRTF_PNDBNUMD, RTF_PNDBNUMD,
+sRTF_PNDBNUMK, RTF_PNDBNUMK,
+sRTF_PNDBNUML, RTF_PNDBNUML,
+sRTF_PNDBNUMT, RTF_PNDBNUMT,
+sRTF_PNGANADA, RTF_PNGANADA,
+sRTF_PNGBLIP, RTF_PNGBLIP,
+sRTF_PNGBNUM, RTF_PNGBNUM,
+sRTF_PNGBNUMD, RTF_PNGBNUMD,
+sRTF_PNGBNUMK, RTF_PNGBNUMK,
+sRTF_PNGBNUML, RTF_PNGBNUML,
+sRTF_PNRAUTH, RTF_PNRAUTH,
+sRTF_PNRDATE, RTF_PNRDATE,
+sRTF_PNRNFC, RTF_PNRNFC,
+sRTF_PNRNOT, RTF_PNRNOT,
+sRTF_PNRPNBR, RTF_PNRPNBR,
+sRTF_PNRRGB, RTF_PNRRGB,
+sRTF_PNRSTART, RTF_PNRSTART,
+sRTF_PNRSTOP, RTF_PNRSTOP,
+sRTF_PNRXST, RTF_PNRXST,
+sRTF_PNZODIAC, RTF_PNZODIAC,
+sRTF_PNZODIACD, RTF_PNZODIACD,
+sRTF_PNZODIACL, RTF_PNZODIACL,
+sRTF_LFOLEVEL, RTF_LFOLEVEL,
+sRTF_POSYIN, RTF_POSYIN,
+sRTF_POSYOUT, RTF_POSYOUT,
+sRTF_PRIVATE, RTF_PRIVATE,
+sRTF_PROPNAME, RTF_PROPNAME,
+sRTF_PROPTYPE, RTF_PROPTYPE,
+sRTF_REVAUTHDEL, RTF_REVAUTHDEL,
+sRTF_REVDTTMDEL, RTF_REVDTTMDEL,
+sRTF_SAUTOUPD, RTF_SAUTOUPD,
+sRTF_SECTDEFAULTCL, RTF_SECTDEFAULTCL,
+sRTF_SECTEXPAND, RTF_SECTEXPAND,
+sRTF_SECTLINEGRID, RTF_SECTLINEGRID,
+sRTF_SECTSPECIFYCL, RTF_SECTSPECIFYCL,
+sRTF_SECTSPECIFYL, RTF_SECTSPECIFYL,
+sRTF_SHIDDEN, RTF_SHIDDEN,
+sRTF_SHPBOTTOM, RTF_SHPBOTTOM,
+sRTF_SHPBXCOLUMN, RTF_SHPBXCOLUMN,
+sRTF_SHPBXMARGIN, RTF_SHPBXMARGIN,
+sRTF_SHPBXPAGE, RTF_SHPBXPAGE,
+sRTF_SHPBYMARGIN, RTF_SHPBYMARGIN,
+sRTF_SHPBYPAGE, RTF_SHPBYPAGE,
+sRTF_SHPBYPARA, RTF_SHPBYPARA,
+sRTF_SHPFBLWTXT, RTF_SHPFBLWTXT,
+sRTF_SHPFHDR, RTF_SHPFHDR,
+sRTF_SHPGRP, RTF_SHPGRP,
+sRTF_SHPLEFT, RTF_SHPLEFT,
+sRTF_SHPLID, RTF_SHPLID,
+sRTF_SHPLOCKANCHOR, RTF_SHPLOCKANCHOR,
+sRTF_SHPPICT, RTF_SHPPICT,
+sRTF_SHPRIGHT, RTF_SHPRIGHT,
+sRTF_SHPRSLT, RTF_SHPRSLT,
+sRTF_SHPTOP, RTF_SHPTOP,
+sRTF_SHPTXT, RTF_SHPTXT,
+sRTF_SHPWRK, RTF_SHPWRK,
+sRTF_SHPWR, RTF_SHPWR,
+sRTF_SHPZ, RTF_SHPZ,
+sRTF_SPRSBSP, RTF_SPRSBSP,
+sRTF_SPRSLNSP, RTF_SPRSLNSP,
+sRTF_SPRSTSM, RTF_SPRSTSM,
+sRTF_STATICVAL, RTF_STATICVAL,
+sRTF_STEXTFLOW, RTF_STEXTFLOW,
+sRTF_STRIKEDL, RTF_STRIKEDL,
+sRTF_SUBFONTBYSIZE, RTF_SUBFONTBYSIZE,
+sRTF_TCELLD, RTF_TCELLD,
+sRTF_TIME, RTF_TIME,
+sRTF_TRUNCATEFONTHEIGHT, RTF_TRUNCATEFONTHEIGHT,
+sRTF_UC, RTF_UC,
+sRTF_UD, RTF_UD,
+sRTF_ULDASH, RTF_ULDASH,
+sRTF_ULDASHD, RTF_ULDASHD,
+sRTF_ULDASHDD, RTF_ULDASHDD,
+sRTF_ULTH, RTF_ULTH,
+sRTF_ULWAVE, RTF_ULWAVE,
+sRTF_U, RTF_U,
+sRTF_UPR, RTF_UPR,
+sRTF_USERPROPS, RTF_USERPROPS,
+sRTF_VIEWKIND, RTF_VIEWKIND,
+sRTF_VIEWSCALE, RTF_VIEWSCALE,
+sRTF_VIEWZK, RTF_VIEWZK,
+sRTF_WIDCTLPAR, RTF_WIDCTLPAR,
+sRTF_WINDOWCAPTION, RTF_WINDOWCAPTION,
+sRTF_WPEQN, RTF_WPEQN,
+sRTF_WPJST, RTF_WPJST,
+sRTF_WPSP, RTF_WPSP,
+sRTF_YXE, RTF_YXE,
+
+// MS-2000 Tokens
+sRTF_ULTHD, RTF_ULTHD,
+sRTF_ULTHDASH, RTF_ULTHDASH,
+sRTF_ULLDASH, RTF_ULLDASH,
+sRTF_ULTHLDASH, RTF_ULTHLDASH,
+sRTF_ULTHDASHD, RTF_ULTHDASHD,
+sRTF_ULTHDASHDD, RTF_ULTHDASHDD,
+sRTF_ULHWAVE, RTF_ULHWAVE,
+sRTF_ULULDBWAVE, RTF_ULULDBWAVE,
+
+
+// SWG spezifische Attribute
+sRTF_GRFALIGNV, RTF_GRF_ALIGNV,
+sRTF_GRFALIGNH, RTF_GRF_ALIGNH,
+sRTF_GRFMIRROR, RTF_GRF_MIRROR,
+sRTF_HEADERYB, RTF_HEADER_YB,
+sRTF_HEADERXL, RTF_HEADER_XL,
+sRTF_HEADERXR, RTF_HEADER_XR,
+sRTF_FOOTERYT, RTF_FOOTER_YT,
+sRTF_FOOTERXL, RTF_FOOTER_XL,
+sRTF_FOOTERXR, RTF_FOOTER_XR,
+sRTF_HEADERYH, RTF_HEADER_YH,
+sRTF_FOOTERYH, RTF_FOOTER_YH,
+sRTF_BALANCEDCOLUMN,RTF_BALANCED_COLUMN,
+sRTF_UPDNPROP, RTF_SWG_ESCPROP,
+sRTF_PRTDATA, RTF_SWG_PRTDATA,
+sRTF_BKMKKEY, RTF_BKMK_KEY,
+
+// Attribute fuer die freifliegenden Rahmen
+sRTF_FLYPRINT, RTF_FLYPRINT,
+sRTF_FLYOPAQUE, RTF_FLYOPAQUE,
+sRTF_FLYPRTCTD, RTF_FLYPRTCTD,
+sRTF_FLYMAINCNT, RTF_FLYMAINCNT,
+sRTF_FLYVERT, RTF_FLYVERT,
+sRTF_FLYHORZ, RTF_FLYHORZ,
+sRTF_DFRMTXTL, RTF_FLYOUTLEFT,
+sRTF_DFRMTXTR, RTF_FLYOUTRIGHT,
+sRTF_DFRMTXTU, RTF_FLYOUTUPPER,
+sRTF_DFRMTXTW, RTF_FLYOUTLOWER,
+sRTF_FLYANCHOR, RTF_FLYANCHOR,
+sRTF_FLYCNTNT, RTF_FLY_CNTNT,
+sRTF_FLYCOLUMN, RTF_FLY_COLUMN,
+sRTF_FLYPAGE, RTF_FLY_PAGE,
+
+sRTF_BRDBOX, RTF_BRDBOX,
+sRTF_BRDLNCOL, RTF_BRDLINE_COL,
+sRTF_BRDLNIN, RTF_BRDLINE_IN,
+sRTF_BRDLNOUT, RTF_BRDLINE_OUT,
+sRTF_BRDLNDIST, RTF_BRDLINE_DIST,
+
+sRTF_SHADOW, RTF_SHADOW,
+sRTF_SHDWDIST, RTF_SHDW_DIST,
+sRTF_SHDWSTYLE, RTF_SHDW_STYLE,
+sRTF_SHDWCOL, RTF_SHDW_COL,
+sRTF_SHDWFCOL, RTF_SHDW_FCOL,
+
+sRTF_FLYINPARA, RTF_FLY_INPARA,
+
+sRTF_PGDSCTBL, RTF_PGDSCTBL,
+sRTF_PGDSC, RTF_PGDSC,
+sRTF_PGDSCUSE, RTF_PGDSCUSE,
+sRTF_PGDSCNXT, RTF_PGDSCNXT,
+
+sRTF_HYPHEN, RTF_HYPHEN,
+sRTF_HYPHLEAD, RTF_HYPHLEAD,
+sRTF_HYPHTRAIL, RTF_HYPHTRAIL,
+sRTF_HYPHMAX, RTF_HYPHMAX,
+
+sRTF_TLSWG, RTF_TLSWG,
+sRTF_PGBRK, RTF_PGBRK,
+
+sRTF_PGDSCNO, RTF_PGDSCNO,
+sRTF_SOUTLVL, RTF_SOUTLVL
+
+};
+
+
+
+static int
+#if defined( WNT )
+ __cdecl
+#endif
+#if defined( ICC ) && defined( OS2 )
+_Optlink
+#endif
+ RTFKeyCompare( const void *pFirst, const void *pSecond)
+{
+ int nRet = 0;
+ if( -1 == ((RTF_TokenEntry*)pFirst)->nToken )
+ {
+ if( -1 == ((RTF_TokenEntry*)pSecond)->nToken )
+ nRet = ((RTF_TokenEntry*)pFirst)->pUToken->CompareTo(
+ *((RTF_TokenEntry*)pSecond)->pUToken );
+ else
+ nRet = ((RTF_TokenEntry*)pFirst)->pUToken->CompareToAscii(
+ ((RTF_TokenEntry*)pSecond)->sToken );
+ }
+ else
+ {
+ if( -1 == ((RTF_TokenEntry*)pSecond)->nToken )
+ nRet = -1 * ((RTF_TokenEntry*)pSecond)->pUToken->CompareToAscii(
+ ((RTF_TokenEntry*)pFirst)->sToken );
+ else
+ nRet = strcmp( ((RTF_TokenEntry*)pFirst)->sToken,
+ ((RTF_TokenEntry*)pSecond)->sToken );
+ }
+
+ return nRet;
+}
+
+int GetRTFToken( const String& rSearch )
+{
+ if( !bSortKeyWords )
+ {
+ qsort( (void*) aRTFTokenTab,
+ sizeof( aRTFTokenTab ) / sizeof( RTF_TokenEntry ),
+ sizeof( RTF_TokenEntry ),
+ RTFKeyCompare );
+ bSortKeyWords = TRUE;
+ }
+
+ int nRet = 0;
+ void* pFound;
+ RTF_TokenEntry aSrch;
+ aSrch.pUToken = &rSearch;
+ aSrch.nToken = -1;
+
+ if( 0 != ( pFound = bsearch( (char *) &aSrch,
+ (void*) aRTFTokenTab,
+ sizeof( aRTFTokenTab ) / sizeof( RTF_TokenEntry ),
+ sizeof( RTF_TokenEntry ),
+ RTFKeyCompare )))
+ nRet = ((RTF_TokenEntry*)pFound)->nToken;
+ return nRet;
+}
+
+
diff --git a/svtools/source/svrtf/rtfkeywd.hxx b/svtools/source/svrtf/rtfkeywd.hxx
new file mode 100644
index 000000000000..f498c1c2f147
--- /dev/null
+++ b/svtools/source/svrtf/rtfkeywd.hxx
@@ -0,0 +1,1197 @@
+/*************************************************************************
+ *
+ * $RCSfile: rtfkeywd.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _RTFKEYWD_HXX
+#define _RTFKEYWD_HXX
+
+#ifndef _STRING_HXX //autogen
+#include <tools/string.hxx>
+#endif
+
+#ifndef SVTOOLS_CONSTASCII_DECL
+#define SVTOOLS_CONSTASCII_DECL( n, s ) n[sizeof(s)]
+#endif
+#ifndef SVTOOLS_CONSTASCII_DEF
+#define SVTOOLS_CONSTASCII_DEF( n, s ) n[sizeof(s)] = s
+#endif
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEXCHAR, "\\'" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_IGNORE, "\\*" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OPTHYPH, "\\-" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SUBENTRY, "\\:" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ABSH, "\\absh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ABSW, "\\absw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ALT, "\\alt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ANNOTATION, "\\annotation" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ANSI, "\\ansi" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ATNID, "\\atnid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AUTHOR, "\\author" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_B, "\\b" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGBDIAG, "\\bgbdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGCROSS, "\\bgcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGDCROSS, "\\bgdcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGDKBDIAG, "\\bgdkbdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGDKCROSS, "\\bgdkcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGDKDCROSS, "\\bgdkdcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGDKFDIAG, "\\bgdkfdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGDKHORIZ, "\\bgdkhoriz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGDKVERT, "\\bgdkvert" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGFDIAG, "\\bgfdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGHORIZ, "\\bghoriz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BGVERT, "\\bgvert" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BIN, "\\bin" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BINFSXN, "\\binfsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BINSXN, "\\binsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BKMKCOLF, "\\bkmkcolf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BKMKCOLL, "\\bkmkcoll" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BKMKEND, "\\bkmkend" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BKMKSTART, "\\bkmkstart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BLUE, "\\blue" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BOX, "\\box" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRB, "\\brdrb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRBAR, "\\brdrbar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRBTW, "\\brdrbtw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRCF, "\\brdrcf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRDB, "\\brdrdb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRDOT, "\\brdrdot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRHAIR, "\\brdrhair" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRL, "\\brdrl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRR, "\\brdrr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRS, "\\brdrs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRSH, "\\brdrsh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRT, "\\brdrt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTH, "\\brdrth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRW, "\\brdrw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRSP, "\\brsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BULLET, "\\bullet" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BUPTIM, "\\buptim" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BXE, "\\bxe" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CAPS, "\\caps" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CB, "\\cb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CBPAT, "\\cbpat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CELL, "\\cell" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CELLX, "\\cellx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CF, "\\cf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CFPAT, "\\cfpat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHATN, "\\chatn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHDATE, "\\chdate" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHDPA, "\\chdpa" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHDPL, "\\chdpl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHFTN, "\\chftn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHFTNSEP, "\\chftnsep" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHFTNSEPC, "\\chftnsepc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHPGN, "\\chpgn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHTIME, "\\chtime" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGBDIAG, "\\clbgbdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGCROSS, "\\clbgcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGDCROSS, "\\clbgdcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGDKBDIAG, "\\clbgdkbdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGDKCROSS, "\\clbgdkcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGDKDCROSS, "\\clbgdkdcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGDKFDIAG, "\\clbgdkfdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGDKHOR, "\\clbgdkhor" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGDKVERT, "\\clbgdkvert" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGFDIAG, "\\clbgfdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGHORIZ, "\\clbghoriz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBGVERT, "\\clbgvert" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBRDRB, "\\clbrdrb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBRDRL, "\\clbrdrl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBRDRR, "\\clbrdrr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLBRDRT, "\\clbrdrt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLCBPAT, "\\clcbpat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLCFPAT, "\\clcfpat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLMGF, "\\clmgf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLMRG, "\\clmrg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLSHDNG, "\\clshdng" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COLNO, "\\colno" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COLORTBL, "\\colortbl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COLS, "\\cols" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COLSR, "\\colsr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COLSX, "\\colsx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COLUMN, "\\column" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COLW, "\\colw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COMMENT, "\\comment" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CREATIM, "\\creatim" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CTRL, "\\ctrl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DEFF, "\\deff" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DEFFORMAT, "\\defformat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DEFLANG, "\\deflang" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DEFTAB, "\\deftab" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DELETED, "\\deleted" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRMTXTX, "\\dfrmtxtx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRMTXTY, "\\dfrmtxty" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DIBITMAP, "\\dibitmap" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DN, "\\dn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOCCOMM, "\\doccomm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOCTEMP, "\\doctemp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DROPCAPLI, "\\dropcapli" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DROPCAPLT, "\\dropcapt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DXFRTEXT, "\\dxfrtext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DY, "\\dy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_EDMINS, "\\edmins" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_EMDASH, "\\emdash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ENDASH, "\\endash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ENDDOC, "\\enddoc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ENDNHERE, "\\endnhere" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ENDNOTES, "\\endnotes" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_EXPND, "\\expnd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_EXPNDTW, "\\expndtw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_F, "\\f" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FACINGP, "\\facingp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FACPGSXN, "\\facpgsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FALT, "\\falt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FCHARSET, "\\fcharset" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FDECOR, "\\fdecor" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FI, "\\fi" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FIELD, "\\field" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLDDIRTY, "\\flddirty" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLDEDIT, "\\fldedit" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLDINST, "\\fldinst" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLDLOCK, "\\fldlock" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLDPRIV, "\\fldpriv" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLDRSLT, "\\fldrslt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FMODERN, "\\fmodern" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FN, "\\fn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FNIL, "\\fnil" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FONTTBL, "\\fonttbl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTER, "\\footer" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTERF, "\\footerf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTERL, "\\footerl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTERR, "\\footerr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTERY, "\\footery" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTNOTE, "\\footnote" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FPRQ, "\\fprq" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FRACWIDTH, "\\fracwidth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FROMAN, "\\froman" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FS, "\\fs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FSCRIPT, "\\fscript" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FSWISS, "\\fswiss" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTECH, "\\ftech" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNBJ, "\\ftnbj" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNCN, "\\ftncn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNRESTART, "\\ftnrestart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNSEP, "\\ftnsep" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNSEPC, "\\ftnsepc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNSTART, "\\ftnstart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNTJ, "\\ftntj" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_GREEN, "\\green" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_GUTTER, "\\gutter" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_GUTTERSXN, "\\guttersxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADER, "\\header" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADERF, "\\headerf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADERL, "\\headerl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADERR, "\\headerr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADERY, "\\headery" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HR, "\\hr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHHOTZ, "\\hyphhotz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_I, "\\i" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ID, "\\id" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_INFO, "\\info" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_INTBL, "\\intbl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_IXE, "\\ixe" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_KEEP, "\\keep" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_KEEPN, "\\keepn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_KERNING, "\\kerning" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_KEYCODE, "\\keycode" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_KEYWORDS, "\\keywords" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LANDSCAPE, "\\landscape" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LANG, "\\lang" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LDBLQUOTE, "\\ldblquote" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVEL, "\\level" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LI, "\\li" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINE, "\\line" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINEBETCOL, "\\linebetcol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINECONT, "\\linecont" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINEMOD, "\\linemod" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINEPPAGE, "\\lineppage" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINERESTART, "\\linerestart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINESTART, "\\linestart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINESTARTS, "\\linestarts" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINEX, "\\linex" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LNDSCPSXN, "\\lndscpsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LQUOTE, "\\lquote" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MAC, "\\mac" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MACPICT, "\\macpict" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MAKEBACKUP, "\\makebackup" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGB, "\\margb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGBSXN, "\\margbsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGL, "\\margl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGLSXN, "\\marglsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGMIRROR, "\\margmirror" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGR, "\\margr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGRSXN, "\\margrsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGT, "\\margt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MARGTSXN, "\\margtsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MIN, "\\min" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MO, "\\mo" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NEXTCSET, "\\nextcset" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NEXTFILE, "\\nextfile" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOFCHARS, "\\nofchars" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOFPAGES, "\\nofpages" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOFWORDS, "\\nofwords" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOLINE, "\\noline" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOSUPERSUB, "\\nosupersub" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOWRAP, "\\nowrap" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OPERATOR, "\\operator" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OUTL, "\\outl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PAGE, "\\page" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PAGEBB, "\\pagebb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PAPERH, "\\paperh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PAPERW, "\\paperw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PAR, "\\par" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PARD, "\\pard" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PC, "\\pc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PCA, "\\pca" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGHSXN, "\\pghsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNCONT, "\\pgncont" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNDEC, "\\pgndec" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNLCLTR, "\\pgnlcltr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNLCRM, "\\pgnlcrm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNRESTART, "\\pgnrestart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNSTART, "\\pgnstart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNSTARTS, "\\pgnstarts" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNUCLTR, "\\pgnucltr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNUCRM, "\\pgnucrm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNX, "\\pgnx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNY, "\\pgny" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGWSXN, "\\pgwsxn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PHCOL, "\\phcol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PHMRG, "\\phmrg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PHPG, "\\phpg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICCROPB, "\\piccropb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICCROPL, "\\piccropl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICCROPR, "\\piccropr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICCROPT, "\\piccropt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICH, "\\pich" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICHGOAL, "\\pichgoal" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICSCALED, "\\picscaled" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICSCALEX, "\\picscalex" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICSCALEY, "\\picscaley" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICT, "\\pict" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICW, "\\picw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICWGOAL, "\\picwgoal" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PLAIN, "\\plain" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PMMETAFILE, "\\pmmetafile" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSNEGX, "\\posnegx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSNEGY, "\\posnegy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSX, "\\posx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSXC, "\\posxc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSXI, "\\posxi" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSXL, "\\posxl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSXO, "\\posxo" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSXR, "\\posxr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSY, "\\posy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSYB, "\\posyb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSYC, "\\posyc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSYIL, "\\posyil" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSYT, "\\posyt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PRINTIM, "\\printim" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PSOVER, "\\psover" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PVMRG, "\\pvmrg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PVPARA, "\\pvpara" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PVPG, "\\pvpg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_QC, "\\qc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_QJ, "\\qj" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_QL, "\\ql" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_QR, "\\qr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RDBLQUOTE, "\\rdblquote" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RED, "\\red" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVBAR, "\\revbar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVISED, "\\revised" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVISIONS, "\\revisions" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVPROP, "\\revprop" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVTIM, "\\revtim" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RI, "\\ri" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ROW, "\\row" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RQUOTE, "\\rquote" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RTF, "\\rtf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RXE, "\\rxe" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_S, "\\s" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SA, "\\sa" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SB, "\\sb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SBASEDON, "\\sbasedon" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SBKCOL, "\\sbkcol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SBKEVEN, "\\sbkeven" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SBKNONE, "\\sbknone" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SBKODD, "\\sbkodd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SBKPAGE, "\\sbkpage" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SBYS, "\\sbys" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SCAPS, "\\scaps" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECT, "\\sect" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECTD, "\\sectd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHAD, "\\shad" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHADING, "\\shading" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHIFT, "\\shift" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SL, "\\sl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SNEXT, "\\snext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_STRIKE, "\\strike" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_STYLESHEET, "\\stylesheet" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SUB, "\\sub" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SUBJECT, "\\subject" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SUPER, "\\super" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TAB, "\\tab" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TB, "\\tb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TC, "\\tc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TCF, "\\tcf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TCL, "\\tcl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TEMPLATE, "\\template" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TITLE, "\\title" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TITLEPG, "\\titlepg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TLDOT, "\\tldot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TLEQ, "\\tleq" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TLHYPH, "\\tlhyph" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TLTH, "\\tlth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TLUL, "\\tlul" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TQC, "\\tqc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TQDEC, "\\tqdec" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TQR, "\\tqr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TQL, "\\tql" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRGAPH, "\\trgaph" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRLEFT, "\\trleft" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TROWD, "\\trowd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRQC, "\\trqc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRQL, "\\trql" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRQR, "\\trqr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRRH, "\\trrh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TX, "\\tx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TXE, "\\txe" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_UL, "\\ul" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULD, "\\uld" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULDB, "\\uldb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULNONE, "\\ulnone" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULW, "\\ulw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_UP, "\\up" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_V, "\\v" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VERN, "\\vern" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VERSION, "\\version" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VERTALB, "\\vertalb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VERTALC, "\\vertalc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VERTALJ, "\\vertalj" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VERTALT, "\\vertalt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WBITMAP, "\\wbitmap" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WBMBITSPIXEL, "\\wbmbitspixel" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WBMPLANES, "\\wbmplanes" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WBMWIDTHBYTES, "\\wbmwidthbytes" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WIDOWCTRL, "\\widowctrl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WMETAFILE, "\\wmetafile" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_XE, "\\xe" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_YR, "\\yr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOBRKHYPH, "\\_" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FORMULA, "\\|" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOBREAK, "\\~" );
+
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AB, "\\ab" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ACAPS, "\\acaps" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ACF, "\\acf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ADDITIVE, "\\additive" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ADN, "\\adn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AENDDOC, "\\aenddoc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AENDNOTES, "\\aendnotes" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AEXPND, "\\aexpnd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AF, "\\af" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFS, "\\afs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNBJ, "\\aftnbj" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNCN, "\\aftncn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNALC, "\\aftnnalc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNAR, "\\aftnnar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNAUC, "\\aftnnauc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNCHI, "\\aftnnchi" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNRLC, "\\aftnnrlc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNRUC, "\\aftnnruc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNRESTART, "\\aftnrestart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNRSTCONT, "\\aftnrstcont" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNSEP, "\\aftnsep" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNSEPC, "\\aftnsepc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNSTART, "\\aftnstart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNTJ, "\\aftntj" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AI, "\\ai" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ALANG, "\\alang" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ALLPROT, "\\allprot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ANNOTPROT, "\\annotprot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AOUTL, "\\aoutl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ASCAPS, "\\ascaps" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ASHAD, "\\ashad" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ASTRIKE, "\\astrike" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ATNAUTHOR, "\\atnauthor" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ATNICN, "\\atnicn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ATNREF, "\\atnref" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ATNTIME, "\\atntime" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ATRFEND, "\\atrfend" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ATRFSTART, "\\atrfstart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AUL, "\\aul" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AULD, "\\auld" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AULDB, "\\auldb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AULNONE, "\\aulnone" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AULW, "\\aulw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AUP, "\\aup" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BKMKPUB, "\\bkmkpub" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRDASH, "\\brdrdash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRKFRM, "\\brkfrm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CCHS, "\\cchs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CPG, "\\cpg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CS, "\\cs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CVMME, "\\cvmme" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DATAFIELD, "\\datafield" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DO, "\\do" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOBXCOLUMN, "\\dobxcolumn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOBXMARGIN, "\\dobxmargin" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOBXPAGE, "\\dobxpage" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOBYMARGIN, "\\dobymargin" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOBYPAGE, "\\dobypage" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOBYPARA, "\\dobypara" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DODHGT, "\\dodhgt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOLOCK, "\\dolock" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPAENDHOL, "\\dpaendhol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPAENDL, "\\dpaendl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPAENDSOL, "\\dpaendsol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPAENDW, "\\dpaendw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPARC, "\\dparc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPARCFLIPX, "\\dparcflipx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPARCFLIPY, "\\dparcflipy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPASTARTHOL, "\\dpastarthol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPASTARTL, "\\dpastartl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPASTARTSOL, "\\dpastartsol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPASTARTW, "\\dpastartw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCALLOUT, "\\dpcallout" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOA, "\\dpcoa" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOACCENT, "\\dpcoaccent" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOBESTFIT, "\\dpcobestfit" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOBORDER, "\\dpcoborder" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCODABS, "\\dpcodabs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCODBOTTOM, "\\dpcodbottom" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCODCENTER, "\\dpcodcenter" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCODTOP, "\\dpcodtop" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOLENGTH, "\\dpcolength" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOMINUSX, "\\dpcominusx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOMINUSY, "\\dpcominusy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOOFFSET, "\\dpcooffset" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOSMARTA, "\\dpcosmarta" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOTDOUBLE, "\\dpcotdouble" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOTRIGHT, "\\dpcotright" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOTSINGLE, "\\dpcotsingle" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOTTRIPLE, "\\dpcottriple" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCOUNT, "\\dpcount" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPELLIPSE, "\\dpellipse" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPENDGROUP, "\\dpendgroup" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLBGCB, "\\dpfillbgcb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLBGCG, "\\dpfillbgcg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLBGCR, "\\dpfillbgcr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLBGGRAY, "\\dpfillbggray" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLBGPAL, "\\dpfillbgpal" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLFGCB, "\\dpfillfgcb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLFGCG, "\\dpfillfgcg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLFGCR, "\\dpfillfgcr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLFGGRAY, "\\dpfillfggray" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLFGPAL, "\\dpfillfgpal" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPFILLPAT, "\\dpfillpat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPGROUP, "\\dpgroup" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINE, "\\dpline" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINECOB, "\\dplinecob" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINECOG, "\\dplinecog" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINECOR, "\\dplinecor" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINEDADO, "\\dplinedado" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINEDADODO, "\\dplinedadodo" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINEDASH, "\\dplinedash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINEDOT, "\\dplinedot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINEGRAY, "\\dplinegray" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINEHOLLOW, "\\dplinehollow" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINEPAL, "\\dplinepal" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINESOLID, "\\dplinesolid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPLINEW, "\\dplinew" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPPOLYCOUNT, "\\dppolycount" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPPOLYGON, "\\dppolygon" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPPOLYLINE, "\\dppolyline" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPPTX, "\\dpptx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPPTY, "\\dppty" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPRECT, "\\dprect" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPROUNDR, "\\dproundr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPSHADOW, "\\dpshadow" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPSHADX, "\\dpshadx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPSHADY, "\\dpshady" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPTXBX, "\\dptxbx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPTXBXMAR, "\\dptxbxmar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPTXBXTEXT, "\\dptxbxtext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPX, "\\dpx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPXSIZE, "\\dpxsize" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPY, "\\dpy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPYSIZE, "\\dpysize" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DS, "\\ds" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_EMSPACE, "\\emspace" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ENSPACE, "\\enspace" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FBIDI, "\\fbidi" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FET, "\\fet" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FID, "\\fid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FILE, "\\file" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FILETBL, "\\filetbl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLDALT, "\\fldalt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FNETWORK, "\\fnetwork" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FONTEMB, "\\fontemb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FONTFILE, "\\fontfile" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FORMDISP, "\\formdisp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FORMPROT, "\\formprot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FORMSHADE, "\\formshade" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOSNUM, "\\fosnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FRELATIVE, "\\frelative" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNALT, "\\ftnalt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNIL, "\\ftnil" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNALC, "\\ftnnalc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNAR, "\\ftnnar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNAUC, "\\ftnnauc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNCHI, "\\ftnnchi" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNRLC, "\\ftnnrlc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNRUC, "\\ftnnruc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNRSTCONT, "\\ftnrstcont" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNRSTPG, "\\ftnrstpg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTTRUETYPE, "\\fttruetype" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FVALIDDOS, "\\fvaliddos" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FVALIDHPFS, "\\fvalidhpfs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FVALIDMAC, "\\fvalidmac" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FVALIDNTFS, "\\fvalidntfs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHAUTO, "\\hyphauto" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHCAPS, "\\hyphcaps" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHCONSEC, "\\hyphconsec" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHPAR, "\\hyphpar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINKSELF, "\\linkself" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINKSTYLES, "\\linkstyles" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LTRCH, "\\ltrch" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LTRDOC, "\\ltrdoc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LTRMARK, "\\ltrmark" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LTRPAR, "\\ltrpar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LTRROW, "\\ltrrow" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LTRSECT, "\\ltrsect" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOCOLBAL, "\\nocolbal" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOEXTRASPRL, "\\noextrasprl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOTABIND, "\\notabind" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOWIDCTLPAR, "\\nowidctlpar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJALIAS, "\\objalias" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJALIGN, "\\objalign" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJAUTLINK, "\\objautlink" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJCLASS, "\\objclass" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJCROPB, "\\objcropb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJCROPL, "\\objcropl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJCROPR, "\\objcropr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJCROPT, "\\objcropt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJDATA, "\\objdata" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJECT, "\\object" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJEMB, "\\objemb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJH, "\\objh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJICEMB, "\\objicemb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJLINK, "\\objlink" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJLOCK, "\\objlock" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJNAME, "\\objname" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJPUB, "\\objpub" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJSCALEX, "\\objscalex" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJSCALEY, "\\objscaley" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJSECT, "\\objsect" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJSETSIZE, "\\objsetsize" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJSUB, "\\objsub" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJTIME, "\\objtime" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJTRANSY, "\\objtransy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJUPDATE, "\\objupdate" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJW, "\\objw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OTBLRUL, "\\otblrul" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNHN, "\\pgnhn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNHNSC, "\\pgnhnsc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNHNSH, "\\pgnhnsh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNHNSM, "\\pgnhnsm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNHNSN, "\\pgnhnsn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNHNSP, "\\pgnhnsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICBMP, "\\picbmp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICBPP, "\\picbpp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PN, "\\pn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNACROSS, "\\pnacross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNB, "\\pnb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNCAPS, "\\pncaps" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNCARD, "\\pncard" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNCF, "\\pncf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNDEC, "\\pndec" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNF, "\\pnf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNFS, "\\pnfs" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNHANG, "\\pnhang" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNI, "\\pni" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNINDENT, "\\pnindent" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNLCLTR, "\\pnlcltr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNLCRM, "\\pnlcrm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNLVL, "\\pnlvl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNLVLBLT, "\\pnlvlblt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNLVLBODY, "\\pnlvlbody" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNLVLCONT, "\\pnlvlcont" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNNUMONCE, "\\pnnumonce" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNORD, "\\pnord" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNORDT, "\\pnordt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNPREV, "\\pnprev" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNQC, "\\pnqc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNQL, "\\pnql" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNQR, "\\pnqr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRESTART, "\\pnrestart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNSCAPS, "\\pnscaps" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNSECLVL, "\\pnseclvl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNSP, "\\pnsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNSTART, "\\pnstart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNSTRIKE, "\\pnstrike" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNTEXT, "\\pntext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNTXTA, "\\pntxta" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNTXTB, "\\pntxtb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNUCLTR, "\\pnucltr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNUCRM, "\\pnucrm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNUL, "\\pnul" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNULD, "\\pnuld" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNULDB, "\\pnuldb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNULNONE, "\\pnulnone" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNULW, "\\pnulw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PRCOLBL, "\\prcolbl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PRINTDATA, "\\printdata" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PSZ, "\\psz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PUBAUTO, "\\pubauto" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RESULT, "\\result" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVAUTH, "\\revauth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVDTTM, "\\revdttm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVPROT, "\\revprot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVTBL, "\\revtbl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RSLTBMP, "\\rsltbmp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RSLTMERGE, "\\rsltmerge" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RSLTPICT, "\\rsltpict" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RSLTRTF, "\\rsltrtf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RSLTTXT, "\\rslttxt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RTLCH, "\\rtlch" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RTLDOC, "\\rtldoc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RTLMARK, "\\rtlmark" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RTLPAR, "\\rtlpar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RTLROW, "\\rtlrow" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_RTLSECT, "\\rtlsect" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SEC, "\\sec" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECTNUM, "\\sectnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECTUNLOCKED, "\\sectunlocked" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SLMULT, "\\slmult" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SOFTCOL, "\\softcol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SOFTLHEIGHT, "\\softlheight" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SOFTLINE, "\\softline" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SOFTPAGE, "\\softpage" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SPRSSPBF, "\\sprsspbf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SPRSTSP, "\\sprstsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SUBDOCUMENT, "\\subdocument" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SWPBDR, "\\swpbdr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TCN, "\\tcn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRANSMF, "\\transmf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRBRDRB, "\\trbrdrb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRBRDRH, "\\trbrdrh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRBRDRL, "\\trbrdrl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRBRDRR, "\\trbrdrr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRBRDRT, "\\trbrdrt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRBRDRV, "\\trbrdrv" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRHDR, "\\trhdr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRKEEP, "\\trkeep" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WRAPTRSP, "\\wraptrsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_XEF, "\\xef" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ZWJ, "\\zwj" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ZWNJ, "\\zwnj" );
+
+// neue Tokens zur 1.5
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ABSLOCK, "\\abslock" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ADJUSTRIGHT, "\\adjustright" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNCHOSUNG, "\\aftnnchosung" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNCNUM, "\\aftnncnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNDBAR, "\\aftnndbar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNDBNUM, "\\aftnndbnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNDBNUMD, "\\aftnndbnumd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNDBNUMK, "\\aftnndbnumk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNDBNUMT, "\\aftnndbnumt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNGANADA, "\\aftnnganada" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNGBNUM, "\\aftnngbnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNGBNUMD, "\\aftnngbnumd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNGBNUMK, "\\aftnngbnumk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNGBNUML, "\\aftnngbnuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNZODIAC, "\\aftnnzodiac" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNZODIACD, "\\aftnnzodiacd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_AFTNNZODIACL, "\\aftnnzodiacl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ANIMTEXT, "\\animtext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ANSICPG, "\\ansicpg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BACKGROUND, "\\background" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BDBFHDR, "\\bdbfhdr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BLIPTAG, "\\bliptag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BLIPUID, "\\blipuid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BLIPUPI, "\\blipupi" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRART, "\\brdrart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRDASHD, "\\brdrdashd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRDASHDD, "\\brdrdashdd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRDASHDOTSTR, "\\brdrdashdotstr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRDASHSM, "\\brdrdashsm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDREMBOSS, "\\brdremboss" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRENGRAVE, "\\brdrengrave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRFRAME, "\\brdrframe" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTHTNLG, "\\brdrthtnlg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTHTNMG, "\\brdrthtnmg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTHTNSG, "\\brdrthtnsg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTNTHLG, "\\brdrtnthlg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTNTHMG, "\\brdrtnthmg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTNTHSG, "\\brdrtnthsg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTNTHTNLG, "\\brdrtnthtnlg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTNTHTNMG, "\\brdrtnthtnmg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTNTHTNSG, "\\brdrtnthtnsg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRTRIPLE, "\\brdrtriple" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRWAVY, "\\brdrwavy" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDRWAVYDB, "\\brdrwavydb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CATEGORY, "\\category" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CGRID, "\\cgrid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHARSCALEX, "\\charscalex" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGBDIAG, "\\chbgbdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGCROSS, "\\chbgcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGDCROSS, "\\chbgdcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGDKBDIAG, "\\chbgdkbdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGDKCROSS, "\\chbgdkcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGDKDCROSS, "\\chbgdkdcross" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGDKFDIAG, "\\chbgdkfdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGDKHORIZ, "\\chbgdkhoriz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGDKVERT, "\\chbgdkvert" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGFDIAG, "\\chbgfdiag" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGHORIZ, "\\chbghoriz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBGVERT, "\\chbgvert" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHBRDR, "\\chbrdr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHCBPAT, "\\chcbpat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHCFPAT, "\\chcfpat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CHSHDNG, "\\chshdng" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLTXLRTB, "\\cltxlrtb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLTXTBRL, "\\cltxtbrl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLVERTALB, "\\clvertalb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLVERTALC, "\\clvertalc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLVERTALT, "\\clvertalt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLVMGF, "\\clvmgf" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLVMRG, "\\clvmrg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLTXTBRLV, "\\cltxtbrlv" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLTXBTLR, "\\cltxbtlr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CLTXLRTBV, "\\cltxlrtbv" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_COMPANY, "\\company" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CRAUTH, "\\crauth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_CRDATE, "\\crdate" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DATE, "\\date" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DEFLANGFE, "\\deflangfe" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRAUTH, "\\dfrauth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRDATE, "\\dfrdate" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRSTART, "\\dfrstart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRSTOP, "\\dfrstop" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRXST, "\\dfrxst" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DGMARGIN, "\\dgmargin" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DNTBLNSBDB, "\\dntblnsbdb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOCTYPE, "\\doctype" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DOCVAR, "\\docvar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DPCODESCENT, "\\dpcodescent" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_EMBO, "\\embo" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_EMFBLIP, "\\emfblip" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_EXPSHRTN, "\\expshrtn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FAAUTO, "\\faauto" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FBIAS, "\\fbias" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFDEFRES, "\\ffdefres" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFDEFTEXT, "\\ffdeftext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFENTRYMCR, "\\ffentrymcr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFEXITMCR, "\\ffexitmcr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFFORMAT, "\\ffformat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFHASLISTBOX, "\\ffhaslistbox" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFHELPTEXT, "\\ffhelptext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFHPS, "\\ffhps" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFL, "\\ffl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFMAXLEN, "\\ffmaxlen" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFNAME, "\\ffname" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFOWNHELP, "\\ffownhelp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFOWNSTAT, "\\ffownstat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFPROT, "\\ffprot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFRECALC, "\\ffrecalc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFRES, "\\ffres" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFSIZE, "\\ffsize" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFSTATTEXT, "\\ffstattext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFTYPE, "\\fftype" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FFTYPETXT, "\\fftypetxt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLDTYPE, "\\fldtype" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FNAME, "\\fname" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FORMFIELD, "\\formfield" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FROMTEXT, "\\fromtext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNCHOSUNG, "\\ftnnchosung" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNCNUM, "\\ftnncnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNDBAR, "\\ftnndbar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNDBNUM, "\\ftnndbnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNDBNUMD, "\\ftnndbnumd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNDBNUMK, "\\ftnndbnumk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNDBNUMT, "\\ftnndbnumt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNGANADA, "\\ftnnganada" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNGBNUM, "\\ftnngbnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNGBNUMD, "\\ftnngbnumd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNGBNUMK, "\\ftnngbnumk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNGBNUML, "\\ftnngbnuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNZODIAC, "\\ftnnzodiac" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNZODIACD, "\\ftnnzodiacd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FTNNZODIACL, "\\ftnnzodiacl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_G, "\\g" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_GCW, "\\gcw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_GRIDTBL, "\\gridtbl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HIGHLIGHT, "\\highlight" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HLFR, "\\hlfr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HLINKBASE, "\\hlinkbase" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HLLOC, "\\hlloc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HLSRC, "\\hlsrc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ILVL, "\\ilvl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_IMPR, "\\impr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_JPEGBLIP, "\\jpegblip" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELFOLLOW, "\\levelfollow" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELINDENT, "\\levelindent" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELJC, "\\leveljc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELLEGAL, "\\levellegal" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELNFC, "\\levelnfc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELNORESTART, "\\levelnorestart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELNUMBERS, "\\levelnumbers" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELOLD, "\\levelold" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELPREV, "\\levelprev" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELPREVSPACE, "\\levelprevspace" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELSPACE, "\\levelspace" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELSTARTAT, "\\levelstartat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LEVELTEXT, "\\leveltext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LINKVAL, "\\linkval" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LIST, "\\list" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTID, "\\listid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTLEVEL, "\\listlevel" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTNAME, "\\listname" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTOVERRIDE, "\\listoverride" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTOVERRIDECOUNT, "\\listoverridecount" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTOVERRIDEFORMAT, "\\listoverrideformat" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTOVERRIDESTART, "\\listoverridestart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTOVERRIDETABLE, "\\listoverridetable" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTRESTARTHDN, "\\listrestarthdn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTSIMPLE, "\\listsimple" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTTABLE, "\\listtable" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTTEMPLATEID, "\\listtemplateid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LISTTEXT, "\\listtext" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LS, "\\ls" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LYTEXCTTP, "\\lytexcttp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LYTPRTMET, "\\lytprtmet" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MANAGER, "\\manager" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_MSMCAP, "\\msmcap" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOFCHARSWS, "\\nofcharsws" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOLEAD, "\\nolead" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NONSHPPICT, "\\nonshppict" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOSECTEXPAND, "\\nosectexpand" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOSNAPLINEGRID, "\\nosnaplinegrid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOSPACEFORUL, "\\nospaceforul" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOULTRLSPC, "\\noultrlspc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_NOXLATTOYEN, "\\noxlattoyen" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJATTPH, "\\objattph" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJHTML, "\\objhtml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OBJOCX, "\\objocx" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OLDLINEWRAP, "\\oldlinewrap" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OUTLINELEVEL, "\\outlinelevel" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_OVERLAY, "\\overlay" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PANOSE, "\\panose" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRDRB, "\\pgbrdrb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRDRFOOT, "\\pgbrdrfoot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRDRHEAD, "\\pgbrdrhead" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRDRL, "\\pgbrdrl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRDROPT, "\\pgbrdropt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRDRR, "\\pgbrdrr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRDRSNAP, "\\pgbrdrsnap" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRDRT, "\\pgbrdrt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNCHOSUNG, "\\pgnchosung" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNCNUM, "\\pgncnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNDBNUMK, "\\pgndbnumk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNDBNUMT, "\\pgndbnumt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNGANADA, "\\pgnganada" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNGBNUM, "\\pgngbnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNGBNUMD, "\\pgngbnumd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNGBNUMK, "\\pgngbnumk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNGBNUML, "\\pgngbnuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNZODIAC, "\\pgnzodiac" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNZODIACD, "\\pgnzodiacd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGNZODIACL, "\\pgnzodiacl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PICPROP, "\\picprop" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNAIUEO, "\\pnaiueo" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNAIUEOD, "\\pnaiueod" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNCHOSUNG, "\\pnchosung" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNDBNUMD, "\\pndbnumd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNDBNUMK, "\\pndbnumk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNDBNUML, "\\pndbnuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNDBNUMT, "\\pndbnumt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNGANADA, "\\pnganada" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNGBLIP, "\\pngblip" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNGBNUM, "\\pngbnum" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNGBNUMD, "\\pngbnumd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNGBNUMK, "\\pngbnumk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNGBNUML, "\\pngbnuml" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRAUTH, "\\pnrauth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRDATE, "\\pnrdate" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRNFC, "\\pnrnfc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRNOT, "\\pnrnot" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRPNBR, "\\pnrpnbr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRRGB, "\\pnrrgb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRSTART, "\\pnrstart" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRSTOP, "\\pnrstop" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNRXST, "\\pnrxst" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNZODIAC, "\\pnzodiac" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNZODIACD, "\\pnzodiacd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PNZODIACL, "\\pnzodiacl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_LFOLEVEL, "\\lfolevel" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSYIN, "\\posyin" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_POSYOUT, "\\posyout" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PRIVATE, "\\private" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PROPNAME, "\\propname" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PROPTYPE, "\\proptype" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVAUTHDEL, "\\revauthdel" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_REVDTTMDEL, "\\revdttmdel" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SAUTOUPD, "\\sautoupd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECTDEFAULTCL, "\\sectdefaultcl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECTEXPAND, "\\sectexpand" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECTLINEGRID, "\\sectlinegrid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECTSPECIFYCL, "\\sectspecifycl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SECTSPECIFYL, "\\sectspecifyl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHIDDEN, "\\shidden" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPBOTTOM, "\\shpbottom" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPBXCOLUMN, "\\shpbxcolumn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPBXMARGIN, "\\shpbxmargin" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPBXPAGE, "\\shpbxpage" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPBYMARGIN, "\\shpbymargin" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPBYPAGE, "\\shpbypage" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPBYPARA, "\\shpbypara" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPFBLWTXT, "\\shpfblwtxt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPFHDR, "\\shpfhdr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPGRP, "\\shpgrp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPLEFT, "\\shpleft" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPLID, "\\shplid" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPLOCKANCHOR, "\\shplockanchor" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPPICT, "\\shppict" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPRIGHT, "\\shpright" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPRSLT, "\\shprslt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPTOP, "\\shptop" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPTXT, "\\shptxt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPWRK, "\\shpwrk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPWR, "\\shpwr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHPZ, "\\shpz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SPRSBSP, "\\sprsbsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SPRSLNSP, "\\sprslnsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SPRSTSM, "\\sprstsm" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_STATICVAL, "\\staticval" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_STEXTFLOW, "\\stextflow" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_STRIKEDL, "\\strikedl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SUBFONTBYSIZE, "\\subfontbysize" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TCELLD, "\\tcelld" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TIME, "\\time" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TRUNCATEFONTHEIGHT, "\\truncatefontheight" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_UC, "\\uc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_UD, "\\ud" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULDASH, "\\uldash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULDASHD, "\\uldashd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULDASHDD, "\\uldashdd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULTH, "\\ulth" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULWAVE, "\\ulwave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_U, "\\u" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_UPR, "\\upr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_USERPROPS, "\\userprops" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VIEWKIND, "\\viewkind" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VIEWSCALE, "\\viewscale" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_VIEWZK, "\\viewzk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WIDCTLPAR, "\\widctlpar" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WINDOWCAPTION, "\\windowcaption" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WPEQN, "\\wpeqn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WPJST, "\\wpjst" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_WPSP, "\\wpsp" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_YXE, "\\yxe" );
+
+// MS-2000 Tokens
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULTHD, "\\ulthd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULTHDASH, "\\ulthdash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULLDASH, "\\ulldash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULTHLDASH, "\\ulthldash" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULTHDASHD, "\\ulthdashd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULTHDASHDD, "\\ulthdashdd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULHWAVE, "\\ulhwave" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_ULULDBWAVE, "\\ululdbwave" );
+
+// SWG spezifische Attribute
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_GRFALIGNV, "\\grfalignv" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_GRFALIGNH, "\\grfalignh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_GRFMIRROR, "\\grfmirror" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADERYB, "\\headeryb" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADERXL, "\\headerxl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADERXR, "\\headerxr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTERYT, "\\footeryt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTERXL, "\\footerxl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTERXR, "\\footerxr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HEADERYH, "\\headeryh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FOOTERYH, "\\footeryh" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BALANCEDCOLUMN, "\\swcolmnblnc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_UPDNPROP, "\\updnprop" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PRTDATA, "\\prtdata" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BKMKKEY, "\\bkmkkey" );
+
+// Attribute fuer die freifliegenden Rahmen
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYPRINT, "\\flyprint" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYOPAQUE, "\\flyopaque" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYPRTCTD, "\\flyprtctd" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYMAINCNT, "\\flymaincnt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYVERT, "\\flyvert" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYHORZ, "\\flyhorz" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRMTXTL, "\\dfrmtxtl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRMTXTR, "\\dfrmtxtr" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRMTXTU, "\\dfrmtxtu" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_DFRMTXTW, "\\dfrmtxtw" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYANCHOR, "\\flyanchor" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYCNTNT, "\\flycntnt" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYCOLUMN, "\\flycolumn" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYPAGE, "\\flypage" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_FLYINPARA, "\\flyinpara" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDBOX, "\\brdbox" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDLNCOL, "\\brdlncol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDLNIN, "\\brdlnin" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDLNOUT, "\\brdlnout" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_BRDLNDIST, "\\brdlndist" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHADOW, "\\shadow" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHDWDIST, "\\shdwdist" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHDWSTYLE, "\\shdwstyle" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHDWCOL, "\\shdwcol" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SHDWFCOL, "\\shdwfcol" );
+
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGDSCTBL, "\\pgdsctbl" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGDSC, "\\pgdsc" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGDSCUSE, "\\pgdscuse" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGDSCNXT, "\\pgdscnxt" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHEN, "\\hyphen" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHLEAD, "\\hyphlead" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHTRAIL, "\\hyphtrail" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_HYPHMAX, "\\hyphmax" );
+
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_TLSWG, "\\tlswg" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGBRK, "\\pgbrk" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_PGDSCNO, "\\pgdscno" );
+extern sal_Char __FAR_DATA SVTOOLS_CONSTASCII_DECL( sRTF_SOUTLVL, "\\soutlvl" );
+
+/*************************************************************************
+
+ Source Code Control System - Header
+
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/svtools/source/svrtf/rtfkeywd.hxx,v 1.1.1.1 2000-09-18 16:59:05 hr Exp $
+
+ Source Code Control System - Update
+
+ $Log: not supported by cvs2svn $
+ Revision 1.19 2000/09/18 14:13:46 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.18 2000/08/31 13:51:38 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.17 2000/03/28 11:47:53 jp
+ changes for Unicode
+
+ Revision 1.16 2000/01/07 10:46:14 jp
+ Task #71411#: new SW token
+
+ Revision 1.15 1999/11/01 11:27:39 jp
+ neue tokens
+
+ Revision 1.14 1999/10/25 14:36:55 jp
+ Bug #69464#: new tabstop token tql
+
+ Revision 1.13 1999/07/22 17:44:51 jp
+ new RTF-Tokens for Header/Footer height
+
+ Revision 1.12 1999/02/16 11:01:16 JP
+ Task #61633#: neue Unter-/Durchstreichungs Werte
+
+
+ Rev 1.11 16 Feb 1999 12:01:16 JP
+ Task #61633#: neue Unter-/Durchstreichungs Werte
+
+ Rev 1.10 27 May 1998 21:22:34 JP
+ Bug #50585#: fehlendes Token lfolevel zugefuegt
+
+ Rev 1.9 03 Apr 1998 18:55:20 JP
+ RTF-Parser um neue Tokens erweitert, nTokenValue wurde ein long
+
+ Rev 1.8 20 Nov 1997 22:28:02 JP
+ HeaderFile Umstellung
+
+ Rev 1.7 08 Oct 1996 13:51:18 JP
+ neue RTF-Token zugefuegt
+
+ Rev 1.6 16 Oct 1995 17:01:16 JP
+ neue Tokens
+
+ Rev 1.5 29 Sep 1995 20:03:30 JP
+ neues Token: kerning
+
+ Rev 1.4 10 Aug 1995 21:02:26 JP
+ neue Token fuer Fonts; Segmentierung
+
+ Rev 1.3 29 Jul 1995 22:40:04 JP
+ neue Token lesen/auswerten: expand/-tw
+
+ Rev 1.2 05 Jul 1995 13:58:22 JP
+ neue Tokens COLSX/COLNO/COLSR
+
+ Rev 1.1 04 Jan 1995 16:20:32 JP
+ TokenName und Token korrigiert
+
+ Rev 1.0 22 Dec 1994 17:19:52 JP
+ Initial revision.
+
+*************************************************************************/
+
+#endif
+ // _RTFKEYWD_HXX
diff --git a/svtools/source/svrtf/rtfout.cxx b/svtools/source/svrtf/rtfout.cxx
new file mode 100644
index 000000000000..8793547f06b3
--- /dev/null
+++ b/svtools/source/svrtf/rtfout.cxx
@@ -0,0 +1,224 @@
+/*************************************************************************
+ *
+ * $RCSfile: rtfout.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+ /*************************************************************************
+#*
+#* $Workfile: rtfout.cxx $
+#*
+#* class HTMLOutFuncs
+#*
+#* Beschreibung DOKUNAME.DOC
+#*
+#* Ersterstellung JP 20.02.96
+#* Letzte Aenderung $Author: hr $ $Date: 2000-09-18 16:59:05 $
+#* $Revision: 1.1.1.1 $
+#*
+#* $Logfile: T:/svtools/source/svrtf/rtfout.cxv $
+#*
+#* Copyright (c) 1989 - 2000, STAR DIVISION
+#*
+#*************************************************************************/
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _STREAM_HXX
+#include <tools/stream.hxx>
+#endif
+#ifndef _STRING_HXX
+#include <tools/string.hxx>
+#endif
+
+#ifndef _RTFKEYWD_HXX
+#include <rtfkeywd.hxx>
+#endif
+#ifndef _RTFOUT_HXX
+#include <rtfout.hxx>
+#endif
+
+
+#if defined(MAC)
+const sal_Char RTFOutFuncs::sNewLine = '\015';
+#elif defined(UNX)
+const sal_Char RTFOutFuncs::sNewLine = '\012';
+#else
+const sal_Char __FAR_DATA RTFOutFuncs::sNewLine[] = "\015\012";
+#endif
+
+
+// ER 01.04.99 diese Methode wurde aus sw/source/filter/rtf/rtfatr.cxx
+// Writer& OutRTF_SwChar( Writer& rWrt, BYTE c ) kopiert und angepasst
+SvStream& RTFOutFuncs::Out_Char( SvStream& rStream, sal_Unicode c,
+ rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile )
+{
+ const sal_Char* pStr = 0;
+ switch( c )
+ {
+ case 0x1: // this are control character of our textattributes and
+ case 0x2: // will never be written
+ break;
+
+ case 0xA0: rStream << "\\~"; break;
+ case 0xAD: rStream << "\\-"; break;
+ case 0x2011: rStream << "\\_"; break;
+ case '\n': pStr = sRTF_LINE; break;
+ case '\t': pStr = sRTF_TAB; break;
+
+ default:
+ {
+ sal_Unicode cCh = c;
+ c = (BYTE)ByteString::ConvertFromUnicode( c, eDestEnc, FALSE );
+ if( !c )
+ {
+ // then write as unicode - character
+ // rWrt.Strm() << "\\u";
+ // rWrt.OutULong( eCh ) << " ?";
+ rStream << "\\'";
+ Out_Hex( rStream, cCh, 2 );
+ break;
+ }
+
+ if( !bWriteHelpFile )
+ switch( c )
+ {
+#ifdef MAC
+ case 0xa5: pStr = sRTF_BULLET; break;
+ case 0xd0: pStr = sRTF_ENDASH; break;
+ case 0xd1: pStr = sRTF_EMDASH; break;
+ case 0xd4: pStr = sRTF_LQUOTE; break;
+ case 0xd5: pStr = sRTF_RQUOTE; break;
+ case 0xd2: pStr = sRTF_LDBLQUOTE; break;
+ case 0xd3: pStr = sRTF_RDBLQUOTE; break;
+#else
+ case 149: pStr = sRTF_BULLET; break;
+ case 150: pStr = sRTF_ENDASH; break;
+ case 151: pStr = sRTF_EMDASH; break;
+ case 145: pStr = sRTF_LQUOTE; break;
+ case 146: pStr = sRTF_RQUOTE; break;
+ case 147: pStr = sRTF_LDBLQUOTE; break;
+ case 148: pStr = sRTF_RDBLQUOTE; break;
+#endif
+ // MAC
+ }
+ if( !pStr )
+ switch ( c )
+ {
+ case '\\':
+ case '}':
+ case '{': rStream << '\\' << (sal_Char)c; break;
+
+ default:
+ if( c >= ' ' && c <= '~' )
+ rStream << (sal_Char)c;
+ else if( 0xFF < c )
+ {
+ // write as unicode-char
+ ByteString aNumStr( ByteString::CreateFromInt32( c ));
+ rStream << "\\u" << aNumStr.GetBuffer() << " ?";
+ }
+ else
+ {
+ rStream << "\\'";
+ Out_Hex( rStream, c, 2 );
+ }
+ break;
+ }
+ }
+ break;
+ }
+
+ if( pStr )
+ rStream << pStr << ' ';
+
+ return rStream;
+}
+
+
+SvStream& RTFOutFuncs::Out_String( SvStream& rStream, const String& rStr,
+ rtl_TextEncoding eDestEnc, BOOL bWriteHelpFile )
+{
+ for( xub_StrLen n = 0; n < rStr.Len(); n++ )
+ Out_Char( rStream, rStr.GetChar( n ), eDestEnc, bWriteHelpFile );
+ return rStream;
+}
+
+
+SvStream& RTFOutFuncs::Out_Hex( SvStream& rStream, ULONG nHex, BYTE nLen )
+{
+ sal_Char aNToABuf[] = "0000000000000000";
+
+ DBG_ASSERT( nLen < sizeof(aNToABuf), "zu viele Stellen" );
+ if( nLen >= sizeof(aNToABuf) )
+ nLen = (sizeof(aNToABuf)-1);
+
+ // Pointer an das Bufferende setzen
+ sal_Char* pStr = aNToABuf + (sizeof(aNToABuf)-1);
+ for( BYTE n = 0; n < nLen; ++n )
+ {
+ *(--pStr) = (sal_Char)(nHex & 0xf ) + 48;
+ if( *pStr > '9' )
+ *pStr += 39;
+ nHex >>= 4;
+ }
+ return rStream << pStr;
+}
+
+
+
diff --git a/svtools/source/svrtf/rtfout.hxx b/svtools/source/svrtf/rtfout.hxx
new file mode 100644
index 000000000000..fde71d03de73
--- /dev/null
+++ b/svtools/source/svrtf/rtfout.hxx
@@ -0,0 +1,93 @@
+/*************************************************************************
+ *
+ * $RCSfile: rtfout.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _RTFOUT_HXX
+#define _RTFOUT_HXX
+
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+class String;
+class SvStream;
+
+class RTFOutFuncs
+{
+public:
+#if defined(MAC) || defined(UNX)
+ static const sal_Char sNewLine; // nur \012 oder \015
+#else
+ static const sal_Char __FAR_DATA sNewLine[]; // \015\012
+#endif
+
+ static SvStream& Out_Char( SvStream&, sal_Unicode cChar,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ BOOL bWriteHelpFile = FALSE );
+ static SvStream& Out_String( SvStream&, const String&,
+ rtl_TextEncoding eDestEnc = RTL_TEXTENCODING_MS_1252,
+ BOOL bWriteHelpFile = FALSE );
+ static SvStream& Out_Hex( SvStream&, ULONG nHex, BYTE nLen );
+};
+
+
+#endif
+
+
diff --git a/svtools/source/svrtf/rtftoken.h b/svtools/source/svrtf/rtftoken.h
new file mode 100644
index 000000000000..08dce8728b7e
--- /dev/null
+++ b/svtools/source/svrtf/rtftoken.h
@@ -0,0 +1,1304 @@
+/*************************************************************************
+ *
+ * $RCSfile: rtftoken.h,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _RTFTOKEN_H
+#define _RTFTOKEN_H
+
+// suche die TokenID zu dem Token
+int GetRTFToken( const String& rSearch );
+
+enum RTF_TOKEN_RANGES {
+ RTF_NOGROUP = 0x0100,
+ RTF_DOCFMT = 0x0200,
+ RTF_SECTFMT = 0x0300,
+ RTF_PARFMT = 0x0400,
+ RTF_TABSTOPDEF = 0x0500,
+ RTF_BRDRDEF = 0x0600,
+ RTF_CHRFMT = 0x0700,
+ RTF_SPECCHAR = 0x0800,
+ RTF_APOCTL = 0x0900,
+ RTF_SHADINGDEF = 0x0A00,
+ RTF_ASSCHARPROP = 0x0B00,
+ RTF_DRAWOBJECTS = 0x0C00,
+ RTF_OBJECTS = 0x0D00,
+ RTF_NUMBULLETS = 0x0E00,
+
+ // !!! kann hinein verodert werden (Border/Background) !!!!
+ RTF_TABLEDEF = 0x1000,
+
+ // !!! kann hinein verodert werden (Border/Tab) !!!!
+ RTF_SWGDEFS = 0x4000
+};
+
+enum RTF_TOKEN_IDS {
+
+ RTF_TEXTTOKEN = RTF_NOGROUP,
+ RTF_SINGLECHAR,
+ RTF_UNKNOWNCONTROL,
+ RTF_UNKNOWNDATA,
+
+ RTF_RTF,
+ RTF_ANSITYPE,
+ RTF_MACTYPE,
+ RTF_PCTYPE,
+ RTF_PCATYPE,
+ RTF_NEXTTYPE,
+
+ RTF_STYLESHEET,
+ RTF_SBASEDON,
+ RTF_SNEXT,
+ RTF_SHIDDEN,
+ RTF_SAUTOUPD,
+
+ RTF_KEYCODE,
+ RTF_FNKEY,
+ RTF_ALTKEY,
+ RTF_SHIFTKEY,
+ RTF_CTRLKEY,
+
+ RTF_FONTTBL,
+ RTF_DEFF,
+ RTF_FNIL,
+ RTF_FROMAN,
+ RTF_FSWISS,
+ RTF_FMODERN,
+ RTF_FSCRIPT,
+ RTF_FDECOR,
+ RTF_FTECH,
+
+ RTF_COLORTBL,
+ RTF_RED,
+ RTF_GREEN,
+ RTF_BLUE,
+
+ RTF_INFO,
+ RTF_TITLE,
+ RTF_SUBJECT,
+ RTF_AUTHOR,
+ RTF_OPERATOR,
+ RTF_KEYWORDS,
+ RTF_COMMENT,
+ RTF_VERSION,
+ RTF_DOCCOMM,
+ RTF_VERN,
+ RTF_CREATIM,
+ RTF_REVTIM,
+ RTF_PRINTIM,
+ RTF_BUPTIM,
+ RTF_EDMINS,
+ RTF_NOFPAGES,
+ RTF_NOFWORDS,
+ RTF_NOFCHARS,
+ RTF_ID,
+ RTF_YR,
+ RTF_MO,
+ RTF_DY,
+ RTF_HR,
+ RTF_MIN,
+ RTF_USERPROPS,
+ RTF_CATEGORY,
+ RTF_COMPANY,
+ RTF_MANAGER,
+ RTF_PROPNAME,
+ RTF_LINKVAL,
+ RTF_NOFCHARSWS,
+ RTF_HLINKBASE,
+ RTF_STATICVAL,
+ RTF_PROPTYPE,
+
+ RTF_ANNOTATION,
+ RTF_ATNID,
+
+ RTF_FOOTNOTE,
+
+ RTF_XE,
+ RTF_BXE,
+ RTF_IXE,
+ RTF_RXE,
+ RTF_TXE,
+ RTF_YXE,
+
+ RTF_TC,
+ RTF_TCF,
+ RTF_TCL,
+
+ RTF_BKMKSTART,
+ RTF_BKMKEND,
+
+ RTF_PICT, // Bitmaps
+ RTF_PICW,
+ RTF_PICH,
+ RTF_WBMBITSPIXEL,
+ RTF_WBMPLANES,
+ RTF_WBMWIDTHBYTES,
+ RTF_PICWGOAL,
+ RTF_PICHGOAL,
+ RTF_BIN,
+ RTF_PICSCALEX,
+ RTF_PICSCALEY,
+ RTF_PICSCALED,
+ RTF_WBITMAP,
+ RTF_WMETAFILE,
+ RTF_MACPICT,
+ RTF_OSMETAFILE,
+ RTF_DIBITMAP,
+ RTF_PICCROPT,
+ RTF_PICCROPB,
+ RTF_PICCROPL,
+ RTF_PICCROPR,
+ RTF_PICDATA,
+ RTF_PICBMP,
+ RTF_PICBPP,
+ RTF_PICPROP,
+ RTF_SHPPICT,
+ RTF_EMFBLIP,
+ RTF_PNGBLIP,
+ RTF_JPEGBLIP,
+ RTF_NONSHPPICT,
+ RTF_BLIPTAG,
+ RTF_BLIPUID,
+ RTF_BLIPUPI,
+
+ RTF_FIELD, // Felder
+ RTF_FLDDIRTY,
+ RTF_FLDEDIT,
+ RTF_FLDLOCK,
+ RTF_FLDPRIV,
+ RTF_FLDINST,
+ RTF_FLDRSLT,
+ RTF_FLDTYPE,
+ RTF_TIME,
+ RTF_DATE,
+ RTF_WPEQN,
+
+ RTF_NOLINE,
+ RTF_REVISED,
+
+ RTF_BKMKCOLF,
+ RTF_BKMKCOLL,
+ RTF_PSOVER,
+ RTF_DOCTEMP,
+ RTF_DELETED,
+
+ RTF_FCHARSET,
+ RTF_FALT,
+ RTF_FPRQ,
+ RTF_PANOSE,
+ RTF_FNAME,
+ RTF_FBIAS,
+
+ RTF_ADDITIVE,
+ RTF_BKMKPUB,
+ RTF_CPG,
+ RTF_DATAFIELD,
+
+ RTF_FBIDI,
+ RTF_FID,
+ RTF_FILE,
+ RTF_FILETBL,
+ RTF_FNETWORK,
+ RTF_FONTEMB,
+ RTF_FONTFILE,
+ RTF_FOSNUM,
+ RTF_FRELATIVE,
+ RTF_FTNIL,
+ RTF_FTTRUETYPE,
+ RTF_FVALIDDOS,
+ RTF_FVALIDHPFS,
+ RTF_FVALIDMAC,
+ RTF_FVALIDNTFS,
+ RTF_LINKSELF,
+ RTF_PUBAUTO,
+ RTF_REVTBL,
+ RTF_RTLMARK,
+ RTF_SEC,
+ RTF_TCN,
+ RTF_XEF,
+
+ RTF_UD, // Unicode
+ RTF_UPR,
+ RTF_U,
+ RTF_UC,
+ RTF_ANSICPG,
+
+ RTF_FFEXITMCR, // Form Fields
+ RTF_FFENTRYMCR,
+ RTF_FFDEFTEXT,
+ RTF_FFFORMAT,
+ RTF_FFSTATTEXT,
+ RTF_FORMFIELD,
+ RTF_FFNAME,
+ RTF_FFHELPTEXT,
+ RTF_FFL,
+ RTF_FFOWNHELP,
+ RTF_FFOWNSTAT,
+ RTF_FFMAXLEN,
+ RTF_FFHASLISTBOX,
+ RTF_FFHPS,
+ RTF_FFPROT,
+ RTF_FFTYPE,
+ RTF_FFTYPETXT,
+ RTF_FFSIZE,
+ RTF_FFRECALC,
+ RTF_FFRES,
+ RTF_FFDEFRES,
+
+ RTF_HIGHLIGHT,
+
+/* */
+
+ RTF_DEFTAB = RTF_DOCFMT,
+ RTF_HYPHHOTZ,
+ RTF_LINESTART,
+ RTF_FRACWIDTH,
+ RTF_NEXTFILE,
+ RTF_TEMPLATE,
+ RTF_MAKEBACKUP,
+ RTF_DEFFORMAT,
+ RTF_DEFLANG,
+ RTF_FTNSEP,
+ RTF_FTNSEPC,
+ RTF_FTNCN,
+ RTF_ENDNOTES,
+ RTF_ENDDOC,
+ RTF_FTNTJ,
+ RTF_FTNBJ,
+ RTF_FTNSTART,
+ RTF_FTNRESTART,
+ RTF_PAPERW,
+ RTF_PAPERH,
+ RTF_MARGL,
+ RTF_MARGR,
+ RTF_MARGT,
+ RTF_MARGB,
+ RTF_FACINGP,
+ RTF_GUTTER,
+ RTF_MARGMIRROR,
+ RTF_LANDSCAPE,
+ RTF_PGNSTART,
+ RTF_WIDOWCTRL,
+ RTF_REVISIONS,
+ RTF_REVPROP,
+ RTF_REVBAR,
+
+ RTF_AENDDOC,
+ RTF_AENDNOTES,
+ RTF_AFTNBJ,
+ RTF_AFTNCN,
+ RTF_AFTNNALC,
+ RTF_AFTNNAR,
+ RTF_AFTNNAUC,
+ RTF_AFTNNCHI,
+ RTF_AFTNNRLC,
+ RTF_AFTNNRUC,
+ RTF_AFTNRESTART,
+ RTF_AFTNRSTCONT,
+ RTF_AFTNSEP,
+ RTF_AFTNSEPC,
+ RTF_AFTNSTART,
+ RTF_AFTNTJ,
+ RTF_ALLPROT,
+ RTF_ANNOTPROT,
+ RTF_ATNAUTHOR,
+ RTF_ATNICN,
+ RTF_ATNREF,
+ RTF_ATNTIME,
+ RTF_ATRFEND,
+ RTF_ATRFSTART,
+ RTF_BRKFRM,
+ RTF_CVMME,
+ RTF_FET,
+ RTF_FLDALT,
+ RTF_FORMDISP,
+ RTF_FORMPROT,
+ RTF_FORMSHADE,
+ RTF_FTNALT,
+ RTF_FTNNALC,
+ RTF_FTNNAR,
+ RTF_FTNNAUC,
+ RTF_FTNNCHI,
+ RTF_FTNNRLC,
+ RTF_FTNNRUC,
+ RTF_FTNRSTCONT,
+ RTF_FTNRSTPG,
+ RTF_HYPHAUTO,
+ RTF_HYPHCAPS,
+ RTF_HYPHCONSEC,
+ RTF_LINKSTYLES,
+ RTF_LTRDOC,
+ RTF_NOCOLBAL,
+ RTF_NOEXTRASPRL,
+ RTF_NOTABIND,
+ RTF_OTBLRUL,
+ RTF_PRCOLBL,
+ RTF_PRINTDATA,
+ RTF_PSZ,
+ RTF_REVPROT,
+ RTF_RTLDOC,
+ RTF_SPRSSPBF,
+ RTF_SPRSTSP,
+ RTF_SWPBDR,
+ RTF_TRANSMF,
+ RTF_WRAPTRSP,
+
+ RTF_PRIVATE,
+ RTF_NOULTRLSPC,
+ RTF_MSMCAP,
+ RTF_NOLEAD,
+ RTF_NOSPACEFORUL,
+ RTF_LYTEXCTTP,
+ RTF_LYTPRTMET,
+ RTF_DNTBLNSBDB,
+ RTF_FROMTEXT,
+ RTF_EXPSHRTN,
+ RTF_PGBRDRT,
+ RTF_SPRSBSP,
+ RTF_PGBRDRR,
+ RTF_PGBRDRSNAP,
+ RTF_BDBFHDR,
+ RTF_SUBFONTBYSIZE,
+ RTF_TRUNCATEFONTHEIGHT,
+ RTF_SPRSLNSP,
+ RTF_SPRSTSM,
+ RTF_PGBRDRL,
+ RTF_WPJST,
+ RTF_PGBRDRB,
+ RTF_WPSP,
+ RTF_NOXLATTOYEN,
+ RTF_OLDLINEWRAP,
+ RTF_PGBRDRFOOT,
+ RTF_PGBRDRHEAD,
+ RTF_DEFLANGFE,
+ RTF_DOCTYPE,
+ RTF_PGBRDROPT,
+ RTF_VIEWKIND,
+ RTF_VIEWSCALE,
+ RTF_WINDOWCAPTION,
+ RTF_BRDRART,
+ RTF_VIEWZK,
+ RTF_DOCVAR,
+
+ RTF_DGMARGIN,
+ RTF_AFTNNCHOSUNG,
+ RTF_AFTNNCNUM,
+ RTF_AFTNNDBAR,
+ RTF_AFTNNDBNUM,
+ RTF_AFTNNDBNUMD,
+ RTF_AFTNNDBNUMK,
+ RTF_AFTNNDBNUMT,
+ RTF_AFTNNGANADA,
+ RTF_AFTNNGBNUM,
+ RTF_AFTNNGBNUMD,
+ RTF_AFTNNGBNUMK,
+ RTF_AFTNNGBNUML,
+ RTF_AFTNNZODIAC,
+ RTF_AFTNNZODIACD,
+ RTF_AFTNNZODIACL,
+ RTF_FTNNCHOSUNG,
+ RTF_FTNNCNUM,
+ RTF_FTNNDBAR,
+ RTF_FTNNDBNUM,
+ RTF_FTNNDBNUMD,
+ RTF_FTNNDBNUMK,
+ RTF_FTNNDBNUMT,
+ RTF_FTNNGANADA,
+ RTF_FTNNGBNUM,
+ RTF_FTNNGBNUMD,
+ RTF_FTNNGBNUMK,
+ RTF_FTNNGBNUML,
+ RTF_FTNNZODIAC,
+ RTF_FTNNZODIACD,
+ RTF_FTNNZODIACL,
+
+/* */
+
+ RTF_SECTD = RTF_SECTFMT,
+ RTF_ENDNHERE,
+ RTF_BINFSXN,
+ RTF_BINSXN,
+ RTF_SBKNONE,
+ RTF_SBKCOL,
+ RTF_SBKPAGE,
+ RTF_SBKEVEN,
+ RTF_SBKODD,
+ RTF_COLS,
+ RTF_COLSX,
+ RTF_COLNO,
+ RTF_COLSR,
+ RTF_COLW,
+ RTF_LINEBETCOL,
+ RTF_LINEMOD,
+ RTF_LINEX,
+ RTF_LINESTARTS,
+ RTF_LINERESTART,
+ RTF_LINEPAGE,
+ RTF_LINECONT,
+ RTF_PGWSXN,
+ RTF_PGHSXN,
+ RTF_MARGLSXN,
+ RTF_MARGRSXN,
+ RTF_MARGTSXN,
+ RTF_MARGBSXN,
+ RTF_GUTTERSXN,
+ RTF_LNDSCPSXN,
+ RTF_FACPGSXN,
+ RTF_TITLEPG,
+ RTF_HEADERY,
+ RTF_FOOTERY,
+ RTF_PGNSTARTS,
+ RTF_PGNCONT,
+ RTF_PGNRESTART,
+ RTF_PGNX,
+ RTF_PGNY,
+ RTF_PGNDEC,
+ RTF_PGNUCRM,
+ RTF_PGNLCRM,
+ RTF_PGNUCLTR,
+ RTF_PGNLCLTR,
+ RTF_VERTALT,
+ RTF_VERTALB,
+ RTF_VERTALC,
+ RTF_VERTALJ,
+
+ RTF_FOOTER,
+ RTF_FOOTERL,
+ RTF_FOOTERR,
+ RTF_FOOTERF,
+ RTF_HEADER,
+ RTF_HEADERL,
+ RTF_HEADERR,
+ RTF_HEADERF,
+ RTF_DS,
+ RTF_LTRSECT,
+ RTF_PGNHN,
+ RTF_PGNHNSC,
+ RTF_PGNHNSH,
+ RTF_PGNHNSM,
+ RTF_PGNHNSN,
+ RTF_PGNHNSP,
+ RTF_RTLSECT,
+ RTF_SECTUNLOCKED,
+ RTF_STEXTFLOW,
+ RTF_PGNCHOSUNG,
+ RTF_PGNCNUM,
+ RTF_PGNDBNUMK,
+ RTF_PGNDBNUMT,
+ RTF_PGNGANADA,
+ RTF_PGNGBNUM,
+ RTF_PGNGBNUMD,
+ RTF_PGNGBNUMK,
+ RTF_PGNGBNUML,
+ RTF_PGNZODIAC,
+ RTF_PGNZODIACD,
+ RTF_PGNZODIACL,
+ RTF_SECTDEFAULTCL,
+ RTF_SECTEXPAND,
+ RTF_SECTLINEGRID,
+ RTF_SECTSPECIFYCL,
+ RTF_SECTSPECIFYL,
+
+ // Swg-Header/Footer-Tokens
+ RTF_HEADER_YB = (RTF_SECTFMT|RTF_SWGDEFS),
+ RTF_HEADER_XL,
+ RTF_HEADER_XR,
+ RTF_FOOTER_YT,
+ RTF_FOOTER_XL,
+ RTF_FOOTER_XR,
+ RTF_HEADER_YH,
+ RTF_FOOTER_YH,
+ RTF_BALANCED_COLUMN,
+
+
+/* */
+
+ RTF_PARD = RTF_PARFMT,
+ RTF_S,
+ RTF_INTBL,
+ RTF_KEEP,
+ RTF_KEEPN,
+ RTF_LEVEL,
+ RTF_PAGEBB,
+ RTF_SBYS,
+ RTF_QL,
+ RTF_QR,
+ RTF_QJ,
+ RTF_QC,
+ RTF_FI,
+ RTF_LI,
+ RTF_RI,
+ RTF_SB,
+ RTF_SA,
+ RTF_SL,
+ RTF_HYPHPAR,
+ RTF_LTRPAR,
+ RTF_NOWIDCTLPAR,
+ RTF_RTLPAR,
+ RTF_SLMULT,
+ RTF_SUBDOCUMENT,
+
+ RTF_WIDCTLPAR,
+
+ RTF_LISTTEXT,
+ RTF_POSYIN,
+ RTF_PNRNOT,
+ RTF_BRDRDASHDOTSTR,
+ RTF_POSYOUT,
+ RTF_BRDRDASHD,
+ RTF_BRDRDASHDD,
+ RTF_BRDRENGRAVE,
+ RTF_BRDRTHTNLG,
+ RTF_BRDREMBOSS,
+ RTF_BRDRTNTHTNLG,
+ RTF_BRDRDASHSM,
+ RTF_BRDRTHTNMG,
+ RTF_OVERLAY,
+ RTF_BRDRTNTHSG,
+ RTF_BRDRTNTHMG,
+ RTF_BRDRTHTNSG,
+ RTF_BRDRTNTHLG,
+ RTF_BRDRTRIPLE,
+ RTF_BRDRTNTHTNSG,
+ RTF_BRDRTNTHTNMG,
+ RTF_BRDRWAVYDB,
+ RTF_BRDRWAVY,
+ RTF_ILVL,
+ RTF_DFRSTOP,
+ RTF_DFRXST,
+ RTF_PNRAUTH,
+ RTF_DFRSTART,
+ RTF_OUTLINELEVEL,
+ RTF_DFRAUTH,
+ RTF_DFRDATE,
+ RTF_PNRRGB,
+ RTF_PNRPNBR,
+ RTF_PNRSTART,
+ RTF_PNRXST,
+ RTF_PNRSTOP,
+ RTF_PNRDATE,
+ RTF_PNRNFC,
+ RTF_NOSNAPLINEGRID,
+ RTF_FAAUTO,
+
+ RTF_ADJUSTRIGHT,
+ RTF_LS,
+
+
+/* */
+
+ RTF_TX = RTF_TABSTOPDEF,
+ RTF_TB,
+ RTF_TQL,
+ RTF_TQR,
+ RTF_TQC,
+ RTF_TQDEC,
+ RTF_TLDOT,
+ RTF_TLHYPH,
+ RTF_TLUL,
+ RTF_TLTH,
+ RTF_TLEQ,
+
+ // Swg-TabStop-Tokens
+ RTF_TLSWG = (RTF_TABSTOPDEF|RTF_SWGDEFS),
+
+/* */
+
+ RTF_BRDRT = RTF_BRDRDEF,
+ RTF_BRDRB,
+ RTF_BRDRL,
+ RTF_BRDRR,
+ RTF_BRDRBTW,
+ RTF_BRDRBAR,
+ RTF_BOX,
+ RTF_BRSP,
+ RTF_BRDRW,
+ RTF_BRDRCF,
+ RTF_BRDRS,
+ RTF_BRDRTH,
+ RTF_BRDRSH,
+ RTF_BRDRDB,
+ RTF_BRDRDOT,
+ RTF_BRDRHAIR,
+ RTF_BRDRDASH,
+ RTF_BRDRFRAME,
+
+ // Swg-Border-Tokens
+ RTF_BRDBOX = (RTF_BRDRDEF|RTF_SWGDEFS),
+ RTF_BRDLINE_COL,
+ RTF_BRDLINE_IN,
+ RTF_BRDLINE_OUT,
+ RTF_BRDLINE_DIST,
+
+/* */
+
+ RTF_PLAIN = RTF_CHRFMT,
+ RTF_B,
+ RTF_CAPS,
+ RTF_DN,
+ RTF_SUB,
+ RTF_NOSUPERSUB,
+ RTF_EXPND,
+ RTF_EXPNDTW,
+ RTF_KERNING,
+ RTF_F,
+ RTF_FS,
+ RTF_I,
+ RTF_OUTL,
+ RTF_SCAPS,
+ RTF_SHAD,
+ RTF_STRIKE,
+ RTF_UL,
+ RTF_ULD,
+ RTF_ULDB,
+ RTF_ULNONE,
+ RTF_ULW,
+ RTF_UP,
+ RTF_SUPER,
+ RTF_V,
+ RTF_CF,
+ RTF_CB,
+ RTF_LANG,
+ RTF_CCHS,
+ RTF_CS,
+ RTF_LTRCH,
+ RTF_REVAUTH,
+ RTF_REVDTTM,
+ RTF_RTLCH,
+
+ RTF_CHBGFDIAG,
+ RTF_CHBGDKVERT,
+ RTF_CHBGDKHORIZ,
+ RTF_CHBRDR,
+ RTF_CHBGVERT,
+ RTF_CHBGHORIZ,
+ RTF_CHBGDKFDIAG,
+ RTF_CHBGDCROSS,
+ RTF_CHBGCROSS,
+ RTF_CHBGBDIAG,
+ RTF_CHBGDKDCROSS,
+ RTF_CHBGDKCROSS,
+ RTF_CHBGDKBDIAG,
+ RTF_ULDASHD,
+ RTF_ULDASH,
+ RTF_ULDASHDD,
+ RTF_ULWAVE,
+ RTF_ULTH,
+ RTF_EMBO,
+ RTF_IMPR,
+ RTF_STRIKEDL,
+ RTF_CRDATE,
+ RTF_CRAUTH,
+ RTF_CHARSCALEX,
+ RTF_CHCBPAT,
+ RTF_CHCFPAT,
+ RTF_CHSHDNG,
+ RTF_REVAUTHDEL,
+ RTF_REVDTTMDEL,
+ RTF_CGRID,
+ RTF_GCW,
+ RTF_NOSECTEXPAND,
+ RTF_GRIDTBL,
+ RTF_G,
+ RTF_ANIMTEXT,
+ RTF_ULTHD,
+ RTF_ULTHDASH,
+ RTF_ULLDASH,
+ RTF_ULTHLDASH,
+ RTF_ULTHDASHD,
+ RTF_ULTHDASHDD,
+ RTF_ULHWAVE,
+ RTF_ULULDBWAVE,
+
+ // Swg-Border-Tokens
+ RTF_SWG_ESCPROP = (RTF_CHRFMT|RTF_SWGDEFS),
+ RTF_HYPHEN,
+ RTF_HYPHLEAD,
+ RTF_HYPHTRAIL,
+ RTF_HYPHMAX,
+
+
+/* */
+
+ RTF_CHDATE = RTF_SPECCHAR,
+ RTF_CHDATEL,
+ RTF_CHDATEA,
+ RTF_CHTIME,
+ RTF_CHPGN,
+ RTF_CHFTN,
+ RTF_CHATN,
+ RTF_CHFTNSEP,
+ RTF_CHFTNSEPC,
+ RTF_CELL,
+ RTF_ROW,
+ RTF_PAR,
+ RTF_SECT,
+ RTF_PAGE,
+ RTF_COLUM,
+ RTF_LINE,
+ RTF_TAB,
+ RTF_EMDASH,
+ RTF_ENDASH,
+ RTF_BULLET,
+ RTF_LQUOTE,
+ RTF_RQUOTE,
+ RTF_LDBLQUOTE,
+ RTF_RDBLQUOTE,
+ RTF_FORMULA,
+ RTF_NONBREAKINGSPACE,
+ RTF_OPTIONALHYPHEN,
+ RTF_NONBREAKINGHYPHEN,
+ RTF_SUBENTRYINDEX,
+ RTF_IGNOREFLAG,
+ RTF_HEX,
+ RTF_EMSPACE,
+ RTF_ENSPACE,
+ RTF_LTRMARK,
+ RTF_SECTNUM,
+ RTF_SOFTCOL,
+ RTF_SOFTLHEIGHT,
+ RTF_SOFTLINE,
+ RTF_SOFTPAGE,
+ RTF_ZWJ,
+ RTF_ZWNJ,
+
+/* */
+
+ RTF_ABSW = RTF_APOCTL,
+ RTF_ABSH,
+ RTF_NOWRAP,
+ RTF_DXFRTEXT,
+ RTF_DFRMTXTX,
+ RTF_DFRMTXTY,
+ RTF_DROPCAPLI,
+ RTF_DROPCAPLT,
+ RTF_PHMRG,
+ RTF_PHPG,
+ RTF_PHCOL,
+ RTF_POSX,
+ RTF_POSNEGX,
+ RTF_POSXC,
+ RTF_POSXI,
+ RTF_POSXO,
+ RTF_POSXL,
+ RTF_POSXR,
+ RTF_PVMRG,
+ RTF_PVPG,
+ RTF_PVPARA,
+ RTF_POSY,
+ RTF_POSNEGY,
+ RTF_POSYT,
+ RTF_POSYIL,
+ RTF_POSYB,
+ RTF_POSYC,
+ RTF_ABSLOCK,
+
+ // Swg-Frame-Tokens
+ RTF_FLYPRINT = (RTF_APOCTL|RTF_SWGDEFS),
+ RTF_FLYOPAQUE,
+ RTF_FLYPRTCTD,
+ RTF_FLYMAINCNT,
+ RTF_FLYVERT,
+ RTF_FLYHORZ,
+ RTF_FLYOUTLEFT,
+ RTF_FLYOUTRIGHT,
+ RTF_FLYOUTUPPER,
+ RTF_FLYOUTLOWER,
+ RTF_FLYANCHOR,
+ RTF_FLY_CNTNT,
+ RTF_FLY_COLUMN,
+ RTF_FLY_PAGE,
+ RTF_FLY_INPARA,
+
+
+/* */
+
+ RTF_SHADING = RTF_SHADINGDEF,
+ RTF_CFPAT,
+ RTF_CBPAT,
+ RTF_BGHORIZ,
+ RTF_BGVERT,
+ RTF_BGFDIAG,
+ RTF_BGBDIAG,
+ RTF_BGCROSS,
+ RTF_BGDCROSS,
+ RTF_BGDKHORIZ,
+ RTF_BGDKVERT,
+ RTF_BGDKFDIAG,
+ RTF_BGDKBDIAG,
+ RTF_BGDKCROSS,
+ RTF_BGDKDCROSS,
+
+/* */
+
+ RTF_TROWD = RTF_TABLEDEF,
+ RTF_TRGAPH,
+ RTF_TRLEFT,
+ RTF_TRRH,
+
+ RTF_TRQL,
+ RTF_TRQR,
+ RTF_TRQC,
+
+ RTF_CLMGF,
+ RTF_CLMRG,
+ RTF_CELLX,
+ RTF_LTRROW,
+ RTF_RTLROW,
+ RTF_TRBRDRB,
+ RTF_TRBRDRH,
+ RTF_TRBRDRL,
+ RTF_TRBRDRR,
+ RTF_TRBRDRT,
+ RTF_TRBRDRV,
+ RTF_TRHDR,
+ RTF_TRKEEP,
+ RTF_TCELLD,
+ RTF_CLTXTBRL,
+ RTF_CLTXLRTB,
+ RTF_CLVERTALB,
+ RTF_CLVERTALT,
+ RTF_CLVERTALC,
+ RTF_CLVMGF,
+ RTF_CLVMRG,
+ RTF_CLTXTBRLV,
+ RTF_CLTXBTLR,
+ RTF_CLTXLRTBV,
+
+ RTF_CLBRDRT = (RTF_BRDRDEF|RTF_TABLEDEF),
+ RTF_CLBRDRL,
+ RTF_CLBRDRB,
+ RTF_CLBRDRR,
+
+ RTF_CLCFPAT = (RTF_SHADINGDEF|RTF_TABLEDEF),
+ RTF_CLCBPAT,
+ RTF_CLSHDNG,
+ RTF_CLBGHORIZ,
+ RTF_CLBGVERT,
+ RTF_CLBGFDIAG,
+ RTF_CLBGBDIAG,
+ RTF_CLBGCROSS,
+ RTF_CLBGDCROSS,
+ RTF_CLBGDKHOR,
+ RTF_CLBGDKVERT,
+ RTF_CLBGDKFDIAG,
+ RTF_CLBGDKBDIAG,
+ RTF_CLBGDKCROSS,
+ RTF_CLBGDKDCROSS,
+
+/* */
+
+ RTF_AB = RTF_ASSCHARPROP,
+ RTF_ACAPS,
+ RTF_ACF,
+ RTF_ADN,
+ RTF_AEXPND,
+ RTF_AF,
+ RTF_AFS,
+ RTF_AI,
+ RTF_ALANG,
+ RTF_AOUTL,
+ RTF_ASCAPS,
+ RTF_ASHAD,
+ RTF_ASTRIKE,
+ RTF_AUL,
+ RTF_AULD,
+ RTF_AULDB,
+ RTF_AULNONE,
+ RTF_AULW,
+ RTF_AUP,
+
+/* */
+
+ RTF_DO = RTF_DRAWOBJECTS,
+ RTF_DOBXCOLUMN,
+ RTF_DOBXMARGIN,
+ RTF_DOBXPAGE,
+ RTF_DOBYMARGIN,
+ RTF_DOBYPAGE,
+ RTF_DOBYPARA,
+ RTF_DODHGT,
+ RTF_DOLOCK,
+ RTF_DPAENDHOL,
+ RTF_DPAENDL,
+ RTF_DPAENDSOL,
+ RTF_DPAENDW,
+ RTF_DPARC,
+ RTF_DPARCFLIPX,
+ RTF_DPARCFLIPY,
+ RTF_DPASTARTHOL,
+ RTF_DPASTARTL,
+ RTF_DPASTARTSOL,
+ RTF_DPASTARTW,
+ RTF_DPCALLOUT,
+ RTF_DPCOA,
+ RTF_DPCOACCENT,
+ RTF_DPCOBESTFIT,
+ RTF_DPCOBORDER,
+ RTF_DPCODABS,
+ RTF_DPCODBOTTOM,
+ RTF_DPCODCENTER,
+ RTF_DPCODTOP,
+ RTF_DPCOLENGTH,
+ RTF_DPCOMINUSX,
+ RTF_DPCOMINUSY,
+ RTF_DPCOOFFSET,
+ RTF_DPCOSMARTA,
+ RTF_DPCOTDOUBLE,
+ RTF_DPCOTRIGHT,
+ RTF_DPCOTSINGLE,
+ RTF_DPCOTTRIPLE,
+ RTF_DPCOUNT,
+ RTF_DPELLIPSE,
+ RTF_DPENDGROUP,
+ RTF_DPFILLBGCB,
+ RTF_DPFILLBGCG,
+ RTF_DPFILLBGCR,
+ RTF_DPFILLBGGRAY,
+ RTF_DPFILLBGPAL,
+ RTF_DPFILLFGCB,
+ RTF_DPFILLFGCG,
+ RTF_DPFILLFGCR,
+ RTF_DPFILLFGGRAY,
+ RTF_DPFILLFGPAL,
+ RTF_DPFILLPAT,
+ RTF_DPGROUP,
+ RTF_DPLINE,
+ RTF_DPLINECOB,
+ RTF_DPLINECOG,
+ RTF_DPLINECOR,
+ RTF_DPLINEDADO,
+ RTF_DPLINEDADODO,
+ RTF_DPLINEDASH,
+ RTF_DPLINEDOT,
+ RTF_DPLINEGRAY,
+ RTF_DPLINEHOLLOW,
+ RTF_DPLINEPAL,
+ RTF_DPLINESOLID,
+ RTF_DPLINEW,
+ RTF_DPPOLYCOUNT,
+ RTF_DPPOLYGON,
+ RTF_DPPOLYLINE,
+ RTF_DPPTX,
+ RTF_DPPTY,
+ RTF_DPRECT,
+ RTF_DPROUNDR,
+ RTF_DPSHADOW,
+ RTF_DPSHADX,
+ RTF_DPSHADY,
+ RTF_DPTXBX,
+ RTF_DPTXBXMAR,
+ RTF_DPTXBXTEXT,
+ RTF_DPX,
+ RTF_DPXSIZE,
+ RTF_DPY,
+ RTF_DPYSIZE,
+
+ RTF_DPCODESCENT,
+ RTF_BACKGROUND,
+ RTF_SHPBYPAGE,
+ RTF_SHPBYPARA,
+ RTF_SHPBYMARGIN,
+ RTF_SHPBXCOLUMN,
+ RTF_SHPBXMARGIN,
+ RTF_SHPBXPAGE,
+ RTF_SHPLOCKANCHOR,
+ RTF_SHPWR,
+ RTF_HLLOC,
+ RTF_HLSRC,
+ RTF_SHPWRK,
+ RTF_SHPTOP,
+ RTF_SHPRSLT,
+ RTF_HLFR,
+ RTF_SHPTXT,
+ RTF_SHPFHDR,
+ RTF_SHPGRP,
+ RTF_SHPRIGHT,
+ RTF_SHPFBLWTXT,
+ RTF_SHPZ,
+ RTF_SHPBOTTOM,
+ RTF_SHPLEFT,
+ RTF_SHPLID,
+
+/* */
+
+ RTF_OBJALIAS = RTF_OBJECTS,
+ RTF_OBJALIGN,
+ RTF_OBJAUTLINK,
+ RTF_OBJCLASS,
+ RTF_OBJCROPB,
+ RTF_OBJCROPL,
+ RTF_OBJCROPR,
+ RTF_OBJCROPT,
+ RTF_OBJDATA,
+ RTF_OBJECT,
+ RTF_OBJEMB,
+ RTF_OBJH,
+ RTF_OBJICEMB,
+ RTF_OBJLINK,
+ RTF_OBJLOCK,
+ RTF_OBJNAME,
+ RTF_OBJPUB,
+ RTF_OBJSCALEX,
+ RTF_OBJSCALEY,
+ RTF_OBJSECT,
+ RTF_OBJSETSIZE,
+ RTF_OBJSUB,
+ RTF_OBJTIME,
+ RTF_OBJTRANSY,
+ RTF_OBJUPDATE,
+ RTF_OBJW,
+ RTF_RESULT,
+ RTF_RSLTBMP,
+ RTF_RSLTMERGE,
+ RTF_RSLTPICT,
+ RTF_RSLTRTF,
+ RTF_RSLTTXT,
+ RTF_OBJOCX,
+ RTF_OBJHTML,
+ RTF_OBJATTPH,
+
+/* */
+
+ RTF_PN = RTF_NUMBULLETS,
+ RTF_PNACROSS,
+ RTF_PNB,
+ RTF_PNCAPS,
+ RTF_PNCARD,
+ RTF_PNCF,
+ RTF_PNDEC,
+ RTF_PNF,
+ RTF_PNFS,
+ RTF_PNHANG,
+ RTF_PNI,
+ RTF_PNINDENT,
+ RTF_PNLCLTR,
+ RTF_PNLCRM,
+ RTF_PNLVL,
+ RTF_PNLVLBLT,
+ RTF_PNLVLBODY,
+ RTF_PNLVLCONT,
+ RTF_PNNUMONCE,
+ RTF_PNORD,
+ RTF_PNORDT,
+ RTF_PNPREV,
+ RTF_PNQC,
+ RTF_PNQL,
+ RTF_PNQR,
+ RTF_PNRESTART,
+ RTF_PNSCAPS,
+ RTF_PNSECLVL,
+ RTF_PNSP,
+ RTF_PNSTART,
+ RTF_PNSTRIKE,
+ RTF_PNTEXT,
+ RTF_PNTXTA,
+ RTF_PNTXTB,
+ RTF_PNUCLTR,
+ RTF_PNUCRM,
+ RTF_PNUL,
+ RTF_PNULD,
+ RTF_PNULDB,
+ RTF_PNULNONE,
+ RTF_PNULW,
+ RTF_LIST,
+ RTF_LISTLEVEL,
+ RTF_LISTOVERRIDE,
+ RTF_LISTOVERRIDETABLE,
+ RTF_LISTTABLE,
+ RTF_LISTNAME,
+ RTF_LEVELNUMBERS,
+ RTF_LEVELNORESTART,
+ RTF_LEVELNFC,
+ RTF_LEVELOLD,
+ RTF_LISTOVERRIDECOUNT,
+ RTF_LISTTEMPLATEID,
+ RTF_LEVELINDENT,
+ RTF_LEVELFOLLOW,
+ RTF_LEVELLEGAL,
+ RTF_LEVELJC,
+ RTF_LISTOVERRIDESTART,
+ RTF_LISTID,
+ RTF_LISTRESTARTHDN,
+ RTF_LEVELTEXT,
+ RTF_LISTOVERRIDEFORMAT,
+ RTF_LEVELPREVSPACE,
+ RTF_LEVELPREV,
+ RTF_LEVELSPACE,
+ RTF_LISTSIMPLE,
+ RTF_LEVELSTARTAT,
+ RTF_PNAIUEO,
+ RTF_PNAIUEOD,
+ RTF_PNCHOSUNG,
+ RTF_PNDBNUMD,
+ RTF_PNDBNUMK,
+ RTF_PNDBNUML,
+ RTF_PNDBNUMT,
+ RTF_PNGANADA,
+ RTF_PNGBNUM,
+ RTF_PNGBNUMD,
+ RTF_PNGBNUMK,
+ RTF_PNGBNUML,
+ RTF_PNZODIAC,
+ RTF_PNZODIACD,
+ RTF_PNZODIACL,
+ RTF_LFOLEVEL,
+
+/* */
+
+ RTF_GRF_ALIGNV= RTF_SWGDEFS,
+ RTF_GRF_ALIGNH,
+ RTF_GRF_MIRROR,
+ RTF_SWG_PRTDATA,
+ RTF_BKMK_KEY,
+ RTF_SHADOW,
+ RTF_SHDW_DIST,
+ RTF_SHDW_STYLE,
+ RTF_SHDW_COL,
+ RTF_SHDW_FCOL,
+ RTF_PGDSCTBL,
+ RTF_PGDSC,
+ RTF_PGDSCUSE,
+ RTF_PGDSCNXT,
+ RTF_PGDSCNO,
+ RTF_PGBRK,
+ RTF_SOUTLVL
+
+};
+
+
+
+/*************************************************************************
+
+ Source Code Control System - Header
+
+ $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/svtools/source/svrtf/rtftoken.h,v 1.1.1.1 2000-09-18 16:59:05 hr Exp $
+
+ Source Code Control System - Update
+
+ $Log: not supported by cvs2svn $
+ Revision 1.20 2000/09/18 14:13:47 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.19 2000/08/31 13:51:38 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.18 2000/03/28 11:47:56 jp
+ changes for Unicode
+
+ Revision 1.17 2000/01/07 10:46:18 jp
+ Task #71411#: new SW token
+
+ Revision 1.16 1999/11/01 11:27:43 jp
+ neue tokens
+
+ Revision 1.15 1999/10/25 14:36:59 jp
+ Bug #69464#: new tabstop token tql
+
+ Revision 1.14 1999/07/22 17:44:52 jp
+ new RTF-Tokens for Header/Footer height
+
+ Revision 1.13 1999/02/16 11:01:18 JP
+ Task #61633#: neue Unter-/Durchstreichungs Werte
+
+
+ Rev 1.12 16 Feb 1999 12:01:18 JP
+ Task #61633#: neue Unter-/Durchstreichungs Werte
+
+ Rev 1.11 27 May 1998 22:15:48 JP
+ vertikales Alignment in Zellen ist ein Tabellen- und kein Absatztoken
+
+ Rev 1.10 27 May 1998 21:22:32 JP
+ Bug #50585#: fehlendes Token lfolevel zugefuegt
+
+ Rev 1.9 03 Apr 1998 18:55:22 JP
+ RTF-Parser um neue Tokens erweitert, nTokenValue wurde ein long
+
+ Rev 1.8 08 Oct 1996 13:51:20 JP
+ neue RTF-Token zugefuegt
+
+ Rev 1.7 16 Oct 1995 17:01:16 JP
+ neue Tokens
+
+ Rev 1.6 29 Sep 1995 20:03:40 JP
+ neues Token: kerning
+
+ Rev 1.5 10 Aug 1995 21:02:28 JP
+ neue Token fuer Fonts; Segmentierung
+
+ Rev 1.4 29 Jul 1995 22:40:06 JP
+ neue Token lesen/auswerten: expand/-tw
+
+ Rev 1.3 05 Jul 1995 13:41:18 JP
+ neue Tokens COLSX/COLNO/COLSR
+
+ Rev 1.2 04 Jan 1995 16:19:46 JP
+ Tokengruppierung fuer Tabellen
+
+ Rev 1.1 23 Dec 1994 15:01:52 JP
+ jetzt auch mit BrushItem
+
+ Rev 1.0 22 Dec 1994 17:19:52 JP
+ Initial revision.
+
+*************************************************************************/
+
+
+#endif
+ // _RTFTOKEN_H
diff --git a/svtools/source/svrtf/svparser.cxx b/svtools/source/svrtf/svparser.cxx
new file mode 100644
index 000000000000..a440ff4acfe5
--- /dev/null
+++ b/svtools/source/svrtf/svparser.cxx
@@ -0,0 +1,692 @@
+/*************************************************************************
+ *
+ * $RCSfile: svparser.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#include <stdio.h>
+#include "svparser.hxx"
+#ifndef _STREAM_HXX //autogen
+#include <tools/stream.hxx>
+#endif
+#ifndef _TOOLS_DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+#define _SVSTDARR_USHORTS
+#include <svstdarr.hxx>
+
+#define SVPAR_CSM_
+
+#define SVPAR_CSM_ANSI 0x0001U
+#define SVPAR_CSM_UTF8 0x0002U
+#define SVPAR_CSM_UCS2B 0x0004U
+#define SVPAR_CSM_UCS2L 0x0008U
+#define SVPAR_CSM_SWITCH 0x8000U
+
+#ifdef ASYNCHRON_TEST
+//HACK
+#include "svgen.hxx"
+#include "toolerr.hxx"
+class _SvLockBytes_Impl
+{
+ AutoTimer aTimer;
+ SvStream& rIn;
+
+ ULONG nDataRead;
+ Link aCallDataRead;
+
+ DECL_STATIC_LINK( _SvLockBytes_Impl, DataRead, Timer* );
+
+public:
+ _SvLockBytes_Impl( SvStream& rInput, const Link& rCallBack );
+ ~_SvLockBytes_Impl();
+
+ ErrCode ReadAt( ULONG nPos, void* pArr, ULONG nCount, ULONG* pReadCnt );
+};
+//HACK
+#endif
+
+// Struktur, um sich die akt. Daten zumerken
+struct SvParser_Impl
+{
+ String aToken; // gescanntes Token
+ ULONG nFilePos; // akt. Position im Stream
+ ULONG nlLineNr; // akt. Zeilen Nummer
+ ULONG nlLinePos; // akt. Spalten Nummer
+ long nTokenValue; // zusaetzlicher Wert (RTF)
+ int nToken; // akt. Token
+ sal_Unicode nNextCh; // akt. Zeichen
+
+ int nSaveToken; // das Token vom Continue
+
+#ifdef ASYNCHRON_TEST
+// HACK
+_SvLockBytes_Impl* pLB;
+//HACK
+#endif
+#ifndef PRODUCT
+ SvFileStream aOut;
+#endif
+};
+
+
+
+// Konstruktor
+SvParser::SvParser( SvStream& rIn, BYTE nStackSize )
+ : rInput( rIn ), eState( SVPAR_NOTSTARTED ),
+ nlLineNr( 1 ), nlLinePos( 1 ),
+ nTokenStackSize( nStackSize ), nTokenStackPos( 0 ),
+ nTokenValue( 0 ),
+ pImplData( 0 ),
+// bWaitForData( FALSE )
+ bDownloadingFile( FALSE ),
+ eSrcEnc( RTL_TEXTENCODING_DONTKNOW )
+{
+ bUCS2BSrcEnc = bSwitchToUCS2 = FALSE;
+ eState = SVPAR_NOTSTARTED;
+ if( nTokenStackSize < 3 )
+ nTokenStackSize = 3;
+ pTokenStack = new TokenStackType[ nTokenStackSize ];
+ pTokenStackPos = pTokenStack;
+
+
+#ifdef ASYNCHRON_TEST
+//HACK
+ pImplData = new SvParser_Impl;
+ pImplData->pLB = new _SvLockBytes_Impl( rInput,
+ STATIC_LINK( this, SvParser, NewDataRead ) );
+//HACK
+#endif
+#ifndef PRODUCT
+
+ // wenn die Datei schon existiert, dann Anhaengen:
+ if( !pImplData )
+ pImplData = new SvParser_Impl;
+ pImplData->aOut.Open( String::CreateFromAscii( "\\parser.dmp" ),
+ STREAM_STD_WRITE | STREAM_NOCREATE );
+ if( pImplData->aOut.GetError() || !pImplData->aOut.IsOpen() )
+ pImplData->aOut.Close();
+ else
+ {
+ pImplData->aOut.Seek( STREAM_SEEK_TO_END );
+ pImplData->aOut << "\x0c\n\n >>>>>>>>>>>>>>> Dump Start <<<<<<<<<<<<<<<\n";
+ }
+#endif
+}
+
+SvParser::~SvParser()
+{
+//HACK
+#ifdef ASYNCHRON_TEST
+delete pImplData->pLB;
+#endif
+//HACK
+#ifndef PRODUCT
+ if( pImplData->aOut.IsOpen() )
+ pImplData->aOut << "\n\n >>>>>>>>>>>>>>> Dump Ende <<<<<<<<<<<<<<<\n";
+ pImplData->aOut.Close();
+#endif
+
+ delete pImplData;
+
+#ifdef MPW
+ // der MPW-Compiler ruft sonst keine Dtoren!
+ for (int n = 0; n < nTokenStackSize; ++n )
+ (pTokenStack+n)->TokenStackType::~TokenStackType();
+ delete (void*) pTokenStack;
+#else
+ __DELETE(nTokenStackSize) pTokenStack;
+#endif
+}
+
+void SvParser::SetSrcEncoding( rtl_TextEncoding eEnc )
+{
+ if( ( eEnc < RTL_TEXTENCODING_STD_COUNT &&
+ eEnc != RTL_TEXTENCODING_UTF7 ) ||
+ RTL_TEXTENCODING_UCS2 == eEnc )
+ {
+ eSrcEnc = eEnc;
+ }
+ else
+ {
+ DBG_ASSERT( !this,
+ "SvParser::SetSrcEncoding: invalid source encoding" );
+ eSrcEnc = RTL_TEXTENCODING_DONTKNOW;
+ }
+}
+
+sal_Unicode SvParser::GetNextChar()
+{
+ sal_Unicode c = 0U;
+
+#ifdef ASYNCHRON_TEST
+//HACK
+ ULONG nRead;
+ sal_Char cAsync;
+ ULONG nErr = pImplData->pLB->ReadAt( rInput.Tell(), &cAsync, 1, &nRead );
+ if( ERRCODE_IO_PENDING == nErr )
+ {
+/* if( bWaitForData )
+ {
+ eState = SVPAR_WAITFORDATA;
+ while( SVPAR_WAITFORDATA == eState )
+ Application::Reschedule();
+ pImplData->pLB->ReadAt( rInput.Tell(), &c, 1, &nRead );
+ }
+ else
+*/ {
+ eState = SVPAR_PENDING;
+ return cAsync;
+ }
+ }
+
+ // Fehlerfall?
+ if( !nRead )
+ {
+ eState = rInput.IsEof() ? SVPAR_ACCEPTED : SVPAR_ERROR;
+ return cAsync;
+ }
+
+ if( rInput.IsEof() )
+ return EOF;
+
+ c = cAsnyc
+//HACK
+#else
+
+ BOOL bErr;
+ if( bSwitchToUCS2 && 0 == rInput.Tell() )
+ {
+ sal_Char c1, c2;
+ BOOL bSeekBack = TRUE;
+
+ rInput >> c1;
+ if( !(bErr = (rInput.IsEof() || rInput.GetError())) )
+ {
+ if( 0xff == c1 || 0xfe == c1 )
+ {
+ rInput >> c2;
+ if( !(bErr = (rInput.IsEof() || rInput.GetError())) )
+ {
+ if( 0xfe == c1 && 0xff == c2 )
+ {
+ eSrcEnc = RTL_TEXTENCODING_UCS2;
+ bUCS2BSrcEnc = TRUE;
+ bSeekBack = FALSE;
+ }
+ else if( 0xff == c1 && 0xfe == c2 )
+ {
+ eSrcEnc = RTL_TEXTENCODING_UCS2;
+ bUCS2BSrcEnc = FALSE;
+ bSeekBack = FALSE;
+ }
+ }
+ }
+ }
+ if( bSeekBack )
+ rInput.Seek( 0 );
+
+ bSwitchToUCS2 = FALSE;
+ }
+
+ if( RTL_TEXTENCODING_UCS2 == eSrcEnc || RTL_TEXTENCODING_UTF8 == eSrcEnc )
+ {
+ sal_Unicode cUC = USHRT_MAX;
+ sal_Char c1, c2, c3;
+
+ if( RTL_TEXTENCODING_UTF8 == eSrcEnc )
+ {
+ rInput >> c1;
+ if( !(bErr = (rInput.IsEof() || rInput.GetError())) )
+ {
+ switch( c1 >> 4 )
+ {
+ case 0: case 1: case 2: case 3:
+ case 4: case 5: case 6: case 7:
+ // 0xxxxxxx
+ cUC = c1;
+ break;
+
+ case 12: case 13:
+ // 110x xxxx 10xx xxxx
+ rInput >> c2;
+ if( !(bErr = (rInput.IsEof() || rInput.GetError())) )
+ {
+ if( (c2 & 0xC0) == 0x80 )
+ {
+ cUC = (sal_Unicode(c1 & 0x1F) << 6) |
+ (c2 & 0x3F);
+ }
+ else
+ {
+ // Kein UTF-8? Dann Zeichen direkt einfuegen
+ cUC = c1;
+ rInput.SeekRel( -1 );
+ }
+ }
+ break;
+
+ case 14:
+ // 1110 xxxx 10xx xxxx 10xx xxxx
+ rInput >> c2 >> c3;
+ if( !(bErr = (rInput.IsEof() || rInput.GetError())) )
+ {
+ if( (c2 & 0xC0) == 0x80 && (c3 & 0xC0) == 0x80 )
+ {
+ cUC = (sal_Unicode(c1 & 0x0F) << 12) |
+ (sal_Unicode(c2 & 0x3F) << 6) |
+ (c3 & 0x3F);
+ }
+ else
+ {
+ // Kein UTF-8? Dann Zeichen direkt einfuegen
+ cUC = c1;
+ rInput.SeekRel( -2 );
+ }
+ }
+ break;
+
+ default:
+ cUC = c1;
+ break;
+ }
+ }
+ }
+ else
+ {
+ rInput >> c1 >> c2;
+ if( 2 == rInput.Tell() && !
+ !(rInput.IsEof() || rInput.GetError()) &&
+ ( (bUCS2BSrcEnc && 0xfe == c1 && 0xff == c2) ||
+ (!bUCS2BSrcEnc && 0xff == c1 && 0xfe == c2) ) )
+ rInput >> c1 >> c2;
+
+ if( !(bErr = (rInput.IsEof() || rInput.GetError())) )
+ {
+ if( bUCS2BSrcEnc )
+ cUC = (sal_Unicode(c1) << 8) | c2;
+ else
+ cUC = (sal_Unicode(c2) << 8) | c1;
+ }
+ }
+
+ if( !bErr )
+ {
+ c = cUC;
+ }
+ }
+ else
+ {
+ sal_Char c1;
+ rInput >> c1;
+ if( RTL_TEXTENCODING_DONTKNOW != eSrcEnc)
+ {
+ // #73398#: If the character could not be converted,
+ // because a conversion is not available, do no conversion at all.
+ sal_Unicode cUC = ByteString::ConvertToUnicode( c1, eSrcEnc );
+ c = 0U != cUC ? cUC : (sal_Unicode)c;
+ }
+
+ bErr = rInput.IsEof() || rInput.GetError();
+ }
+ if( bErr )
+ {
+ if( ERRCODE_IO_PENDING == rInput.GetError() )
+ {
+ eState = SVPAR_PENDING;
+ return c;
+ }
+ else
+ return sal_Unicode(EOF);
+ }
+
+#endif
+
+#ifndef PRODUCT
+ if( pImplData->aOut.IsOpen() )
+ pImplData->aOut << ByteString::ConvertFromUnicode( c,
+ RTL_TEXTENCODING_MS_1251 );
+#endif
+
+ if( c == '\n' )
+ {
+ IncLineNr();
+ SetLinePos( 1L );
+ }
+ else
+ IncLinePos();
+ return c;
+}
+
+int SvParser::GetNextToken()
+{
+ int nRet = 0;
+
+ if( !nTokenStackPos )
+ {
+ aToken.Erase(); // Token-Buffer loeschen
+ nTokenValue = -1; // Kennzeichen fuer kein Value gelesen
+
+ nRet = _GetNextToken();
+ if( SVPAR_PENDING == eState )
+ return nRet;
+ }
+
+ ++pTokenStackPos;
+ if( pTokenStackPos == pTokenStack + nTokenStackSize )
+ pTokenStackPos = pTokenStack;
+
+ // vom Stack holen ??
+ if( nTokenStackPos )
+ {
+ --nTokenStackPos;
+ nTokenValue = pTokenStackPos->nTokenValue;
+ aToken = pTokenStackPos->sToken;
+ nRet = pTokenStackPos->nTokenId;
+ }
+ // nein, dann das aktuelle auf den Stack
+ else if( SVPAR_WORKING == eState )
+ {
+ pTokenStackPos->sToken = aToken;
+ pTokenStackPos->nTokenValue = nTokenValue;
+ pTokenStackPos->nTokenId = nRet;
+ }
+ else if( SVPAR_ACCEPTED != eState && SVPAR_PENDING != eState )
+ eState = SVPAR_ERROR; // irgend ein Fehler
+
+ return nRet;
+}
+
+int SvParser::SkipToken( short nCnt ) // n Tokens zurueck "skippen"
+{
+ pTokenStackPos = GetStackPtr( nCnt );
+ short nTmp = nTokenStackPos - nCnt;
+ if( nTmp < 0 )
+ nTmp = 0;
+ else if( nTmp > nTokenStackSize )
+ nTmp = nTokenStackSize;
+ nTokenStackPos = BYTE(nTmp);
+
+ // und die Werte zurueck
+ aToken = pTokenStackPos->sToken;
+ nTokenValue = pTokenStackPos->nTokenValue;
+
+ return pTokenStackPos->nTokenId;
+}
+
+SvParser::TokenStackType* SvParser::GetStackPtr( short nCnt )
+{
+ BYTE nAktPos = BYTE(pTokenStackPos - pTokenStack );
+ if( nCnt > 0 )
+ {
+ if( nCnt >= nTokenStackSize )
+ nCnt = (nTokenStackSize-1);
+ if( nAktPos + nCnt < nTokenStackSize )
+ nAktPos += BYTE(nCnt);
+ else
+ nAktPos += nCnt - nTokenStackSize;
+ }
+ else if( nCnt < 0 )
+ {
+ if( -nCnt >= nTokenStackSize )
+ nCnt = -nTokenStackSize+1;
+ if( -nCnt <= nAktPos )
+ nAktPos += BYTE(nCnt);
+ else
+ nAktPos += nCnt + nTokenStackSize;
+ }
+ return pTokenStack + nAktPos;
+}
+
+// wird fuer jedes Token gerufen, das in CallParser erkannt wird
+void SvParser::NextToken( int nToken )
+{
+}
+
+
+// fuers asynchrone lesen aus dem SvStream
+
+int SvParser::GetSaveToken() const
+{
+ return pImplData ? pImplData->nSaveToken : 0;
+}
+
+void SvParser::SaveState( int nToken )
+{
+ // aktuellen Status merken
+ if( !pImplData )
+ {
+ pImplData = new SvParser_Impl;
+ pImplData->nSaveToken = 0;
+ }
+
+ pImplData->nFilePos = rInput.Tell();
+ pImplData->nToken = nToken;
+
+ pImplData->aToken = aToken;
+ pImplData->nlLineNr = nlLineNr;
+ pImplData->nlLinePos = nlLinePos;
+ pImplData->nTokenValue= nTokenValue;
+ pImplData->nNextCh = nNextCh;
+}
+
+void SvParser::RestoreState()
+{
+ // alten Status wieder zurueck setzen
+ if( pImplData )
+ {
+ if( ERRCODE_IO_PENDING == rInput.GetError() )
+ rInput.ResetError();
+ aToken = pImplData->aToken;
+ nlLineNr = pImplData->nlLineNr;
+ nlLinePos = pImplData->nlLinePos;
+ nTokenValue= pImplData->nTokenValue;
+ nNextCh = pImplData->nNextCh;
+
+ pImplData->nSaveToken = pImplData->nToken;
+
+ rInput.Seek( pImplData->nFilePos );
+ }
+}
+
+void SvParser::Continue( int nToken )
+{
+}
+
+void SvParser::BuildWhichTbl( SvUShorts &rWhichMap,
+ USHORT *pWhichIds,
+ USHORT nWhichIds )
+{
+ USHORT aNewRange[2];
+
+ for( USHORT nCnt = 0; nCnt < nWhichIds; ++nCnt, ++pWhichIds )
+ if( *pWhichIds )
+ {
+ aNewRange[0] = aNewRange[1] = *pWhichIds;
+ BOOL bIns = TRUE;
+
+ // Position suchen
+ for ( USHORT nOfs = 0; rWhichMap[nOfs]; nOfs += 2 )
+ {
+ if( *pWhichIds < rWhichMap[nOfs] - 1 )
+ {
+ // neuen Range davor
+ rWhichMap.Insert( aNewRange, 2, nOfs );
+ bIns = FALSE;
+ break;
+ }
+ else if( *pWhichIds == rWhichMap[nOfs] - 1 )
+ {
+ // diesen Range nach unten erweitern
+ rWhichMap[nOfs] = *pWhichIds;
+ bIns = FALSE;
+ break;
+ }
+ else if( *pWhichIds == rWhichMap[nOfs+1] + 1 )
+ {
+ if( rWhichMap[nOfs+2] != 0 && rWhichMap[nOfs+2] == *pWhichIds + 1 )
+ {
+ // mit dem naechsten Bereich mergen
+ rWhichMap[nOfs+1] = rWhichMap[nOfs+3];
+ rWhichMap.Remove( nOfs+2, 2 );
+ }
+ else
+ // diesen Range nach oben erweitern
+ rWhichMap[nOfs+1] = *pWhichIds;
+ bIns = FALSE;
+ break;
+ }
+ }
+
+ // einen Range hinten anhaengen
+ if( bIns )
+ rWhichMap.Insert( aNewRange, 2, rWhichMap.Count()-1 );
+ }
+}
+
+
+IMPL_STATIC_LINK( SvParser, NewDataRead, void*, EMPTYARG )
+{
+ switch( pThis->eState )
+ {
+ case SVPAR_PENDING:
+ // Wenn gerade ein File geladen wird duerfen wir nicht weiterlaufen,
+ // sondern muessen den Aufruf ignorieren.
+ if( pThis->IsDownloadingFile() )
+ break;
+
+ pThis->eState = SVPAR_WORKING;
+ pThis->RestoreState();
+
+ pThis->Continue( pThis->pImplData->nToken );
+
+ if( ERRCODE_IO_PENDING == pThis->rInput.GetError() )
+ pThis->rInput.ResetError();
+
+ if( SVPAR_PENDING != pThis->eState )
+ pThis->ReleaseRef(); // ansonsten sind wir fertig!
+ break;
+
+ case SVPAR_WAITFORDATA:
+ pThis->eState = SVPAR_WORKING;
+ break;
+
+ case SVPAR_NOTSTARTED:
+ case SVPAR_WORKING:
+ break;
+
+ default:
+ pThis->ReleaseRef(); // ansonsten sind wir fertig!
+ break;
+ }
+
+ return 0;
+}
+
+
+/* */
+#ifdef ASYNCHRON_TEST
+
+_SvLockBytes_Impl::_SvLockBytes_Impl( SvStream& rInput, const Link& rCallback )
+ : rIn( rInput ), aCallDataRead( rCallback )
+{
+ nDataRead = 50;
+
+ aTimer.SetTimeout( 1000 ); // jede Sekunde 100 Zeichen lesen
+ aTimer.SetTimeoutHdl( STATIC_LINK( this, _SvLockBytes_Impl, DataRead ));
+ aTimer.Start();
+}
+
+_SvLockBytes_Impl::~_SvLockBytes_Impl()
+{
+ aTimer.Stop();
+}
+
+ErrCode _SvLockBytes_Impl::ReadAt( ULONG nPos, void* pArr, ULONG nCount,
+ ULONG* pReadCnt )
+{
+ ErrCode nRet = 0;
+ if( nPos + nCount > nDataRead )
+ {
+ nCount = nDataRead - nPos;
+ nRet = ERRCODE_IO_PENDING;
+ }
+
+ if( nCount )
+ {
+ rIn.Seek( nPos );
+ *pReadCnt = rIn.Read( pArr, nCount );
+ }
+ else
+ *pReadCnt = 0;
+ return rIn.GetError() ? rIn.GetError()
+ : ( rIn.IsEof() ? 0 : nRet );
+}
+
+IMPL_STATIC_LINK( _SvLockBytes_Impl, DataRead, Timer*, pTimer )
+{
+ pThis->nDataRead += 100;
+ pThis->aCallDataRead.Call( pThis );
+
+ return 0;
+}
+
+#endif
+
+
diff --git a/svtools/source/svsql/converter.cxx b/svtools/source/svsql/converter.cxx
new file mode 100644
index 000000000000..496d4691c672
--- /dev/null
+++ b/svtools/source/svsql/converter.cxx
@@ -0,0 +1,75 @@
+/*************************************************************************
+ *
+ * $RCSfile: converter.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SV_CONVERTER_HXX_
+#include "converter.hxx"
+#endif
+
+INT32 SvDbaseConverter::ConvertPrecisionToDbase(INT32 _nLen, INT32 _nScale)
+{
+ return _nScale ? _nLen +2 : _nLen +1;
+}
+//------------------------------------------------------------------------
+INT32 SvDbaseConverter::ConvertPrecisionToOdbc(INT32 _nLen, INT32 _nScale)
+{
+ return _nScale ? _nLen -2 : _nLen -1;
+}
+
+
diff --git a/svtools/source/svsql/converter.hxx b/svtools/source/svsql/converter.hxx
new file mode 100644
index 000000000000..6d57aac65586
--- /dev/null
+++ b/svtools/source/svsql/converter.hxx
@@ -0,0 +1,76 @@
+/*************************************************************************
+ *
+ * $RCSfile: converter.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:05 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SV_CONVERTER_HXX_
+#define _SV_CONVERTER_HXX_
+#ifndef _SOLAR_H
+#include <tools/solar.h>
+#endif
+
+class SvDbaseConverter
+{
+public:
+ static INT32 ConvertPrecisionToDbase(INT32 _nLen, INT32 _nScale);
+ static INT32 ConvertPrecisionToOdbc(INT32 _nLen, INT32 _nScale);
+};
+#endif //_CONVERTER_HXX_
+
+
+
diff --git a/svtools/source/svsql/makefile.mk b/svtools/source/svsql/makefile.mk
new file mode 100644
index 000000000000..a805348e8e4f
--- /dev/null
+++ b/svtools/source/svsql/makefile.mk
@@ -0,0 +1,124 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=svsql
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+UNOUCRDEP=$(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/applicat.rdb
+
+# Every source directory generates headers in a own output directory to
+# enable parallel building of the source directories within a project!
+UNOUCROUT=$(OUT)$/inc$/$(PRJNAME)$/$(TARGET)
+INCPRE+=$(UNOUCROUT)
+
+UNOTYPES = com.sun.star.util.XNumberFormatsSupplier \
+ com.sun.star.util.XNumberFormatter \
+ com.sun.star.util.XNumberFormatTypes \
+ com.sun.star.util.Date \
+ com.sun.star.data.DatabaseFieldType \
+ com.sun.star.data.DatabaseInfo \
+ com.sun.star.data.XDatabaseDescriptor \
+ com.sun.star.sdbc.XDatabaseMetaData \
+ com.sun.star.lang.Locale \
+ com.sun.star.beans.XPropertySet \
+ com.sun.star.uno.TypeClass
+
+SRCFILES = svsql.src
+
+SLOFILES = \
+ $(SLO)$/sdbbison.obj \
+ $(SLO)$/sdbflex.obj \
+ $(SLO)$/sdbsql.obj \
+ $(SLO)$/sdbnode.obj \
+ $(SLO)$/converter.obj
+
+EXCEPTIONSFILES= \
+ $(SLO)$/sdbbison.obj \
+ $(SLO)$/sdbsql.obj
+
+all: \
+ $(MISC)$/sdbflex.cxx \
+ $(MISC)$/sdbbison.cxx \
+ ALLTAR
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
+$(MISC)$/sdbflex.cxx: sdblex.l
+ +flex -i -8 -PSQLyy -L -o$(MISC)$/sdbflex.cxx sdblex.l
+
+$(MISC)$/sdbbison.cxx: sdbyacc.y
+ +bison -v -d -pSQLyy -l -bsql -o$(MISC)$/sdbbison.cxx sdbyacc.y
+ -$(MKDIR) $(OUT)$/inc$/svtools
+ +$(COPY) $(MISC)$/sdbbison.cxx.h $(OUT)$/inc$/svtools$/sdbbison.hxx
diff --git a/svtools/source/undo/makefile.mk b/svtools/source/undo/makefile.mk
new file mode 100644
index 000000000000..3695df13584a
--- /dev/null
+++ b/svtools/source/undo/makefile.mk
@@ -0,0 +1,88 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=undo
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES = \
+ undo.cxx
+
+SLOFILES = \
+ $(SLO)$/undo.obj
+
+OBJFILES = \
+ $(OBJ)$/undo.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svtools/source/undo/undo.cxx b/svtools/source/undo/undo.cxx
new file mode 100644
index 000000000000..00d7b22ef2af
--- /dev/null
+++ b/svtools/source/undo/undo.cxx
@@ -0,0 +1,988 @@
+/*************************************************************************
+ *
+ * $RCSfile: undo.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+#ifndef _DEBUG_HXX //autogen
+#include <tools/debug.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "undo.hxx"
+#include "svarray.hxx"
+
+#include "segmentc.hxx"
+
+//========================================================================
+
+SV_DECL_PTRARR( SfxUndoActions, SfxUndoAction*, 20, 8 )
+
+//====================================================================
+
+struct SfxUndoArray
+{
+ SfxUndoActions aUndoActions;
+ USHORT nMaxUndoActions;
+ USHORT nCurUndoAction;
+ SfxUndoArray *pFatherUndoArray;
+ SfxUndoArray(USHORT nMax=0) : pFatherUndoArray(0),
+ nCurUndoAction(0),nMaxUndoActions(nMax){}
+ ~SfxUndoArray();
+};
+
+//=========================================================================
+
+class SfxListUndoAction : public SfxUndoAction, public SfxUndoArray
+
+/* [Beschreibung]
+
+ UndoAction zur Klammerung mehrerer Undos in einer UndoAction.
+ Diese Actions werden vom SfxUndoManager verwendet. Dort
+ wird mit < SfxUndoManager::EnterListAction > eine Klammerebene
+ geoeffnet und mit <SfxUndoManager::LeaveListAction > wieder
+ geschlossen. Redo und Undo auf SfxListUndoActions wirken
+ Elementweise.
+
+*/
+
+
+
+
+{
+ public:
+ TYPEINFO();
+
+#ifndef ENABLEUNICODE
+ SfxListUndoAction( const String &rComment,
+ const String rRepeatComment, USHORT Id, SfxUndoArray *pFather);
+#else
+ SfxListUndoAction( const UniString &rComment,
+ const UniString rRepeatComment, USHORT Id, SfxUndoArray *pFather);
+#endif
+ virtual void Undo();
+ virtual void Redo();
+ virtual void Repeat(SfxRepeatTarget&);
+ virtual BOOL CanRepeat(SfxRepeatTarget&) const;
+
+#ifndef ENABLEUNICODE
+ virtual String GetComment() const;
+ virtual String GetRepeatComment(SfxRepeatTarget&) const;
+#else
+ virtual UniString GetComment() const;
+ virtual UniString GetRepeatComment(SfxRepeatTarget&) const;
+#endif
+ virtual USHORT GetId() const;
+
+
+ private:
+
+ USHORT nId;
+#ifndef ENABLEUNICODE
+ String aComment, aRepeatComment;
+#else
+ UniString aComment, aRepeatComment;
+#endif
+
+};
+
+// STATIC DATA -----------------------------------------------------------
+
+DBG_NAME(SfxUndoAction);
+
+SEG_EOFGLOBALS()
+
+//========================================================================
+
+TYPEINIT0(SfxUndoAction);
+TYPEINIT0(SfxListUndoAction);
+TYPEINIT0(SfxLinkUndoAction);
+TYPEINIT0(SfxRepeatTarget);
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_01)
+
+SfxRepeatTarget::~SfxRepeatTarget()
+{
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_34)
+
+BOOL SfxUndoAction::IsLinked()
+{
+ return bLinked;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_35)
+
+void SfxUndoAction::SetLinked( BOOL bIsLinked )
+{
+ bLinked = bIsLinked;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_36)
+
+SfxUndoAction::~SfxUndoAction()
+{
+ DBG_DTOR(SfxUndoAction, 0);
+ DBG_ASSERT( !IsLinked(), "Gelinkte Action geloescht" )
+}
+
+
+#pragma SEG_FUNCDEF(undo_02)
+
+SfxUndoAction::SfxUndoAction()
+{
+ DBG_CTOR(SfxUndoAction, 0);
+ SetLinked( FALSE );
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_03)
+
+BOOL SfxUndoAction::Merge( SfxUndoAction * )
+{
+ DBG_CHKTHIS(SfxUndoAction, 0);
+ return FALSE;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_04)
+
+XubString SfxUndoAction::GetComment() const
+{
+ DBG_CHKTHIS(SfxUndoAction, 0);
+ return XubString();
+}
+
+//------------------------------------------------------------------------
+
+
+#pragma SEG_FUNCDEF(undo_05)
+
+USHORT SfxUndoAction::GetId() const
+{
+ DBG_CHKTHIS(SfxUndoAction, 0);
+ return 0;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_06)
+
+XubString SfxUndoAction::GetRepeatComment(SfxRepeatTarget&) const
+{
+ DBG_CHKTHIS(SfxUndoAction, 0);
+ return GetComment();
+}
+
+//------------------------------------------------------------------------
+
+
+#pragma SEG_FUNCDEF(undo_07)
+
+void SfxUndoAction::Undo()
+{
+ // die sind nur konzeptuell pure virtual
+ DBG_ERROR( "pure virtual function called: SfxUndoAction::Undo()" );
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_08)
+
+void SfxUndoAction::Redo()
+{
+ // die sind nur konzeptuell pure virtual
+ DBG_ERROR( "pure virtual function called: SfxUndoAction::Redo()" );
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_09)
+
+void SfxUndoAction::Repeat(SfxRepeatTarget&)
+{
+ // die sind nur konzeptuell pure virtual
+ DBG_ERROR( "pure virtual function called: SfxUndoAction::Repeat()" );
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_0A)
+
+BOOL SfxUndoAction::CanRepeat(SfxRepeatTarget&) const
+{
+ return TRUE;
+}
+
+//========================================================================
+
+#pragma SEG_FUNCDEF(undo_0B)
+
+SfxUndoManager::SfxUndoManager( USHORT nMaxUndoActionCount )
+ : pFatherUndoArray(0)
+{
+ pUndoArray=new SfxUndoArray(nMaxUndoActionCount);
+ pActUndoArray=pUndoArray;
+
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_0C)
+
+SfxUndoManager::~SfxUndoManager()
+{
+ delete pUndoArray;
+}
+
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_0D)
+
+void SfxUndoManager::SetMaxUndoActionCount( USHORT nMaxUndoActionCount )
+{
+ // Redo-Actions loeschen
+ for ( USHORT nPos = pActUndoArray->aUndoActions.Count();
+ nPos > pActUndoArray->nCurUndoAction &&
+ !pActUndoArray->aUndoActions[nPos - 1 ]->IsLinked();
+ --nPos )
+ {
+ delete pActUndoArray->aUndoActions[nPos-1];
+ pActUndoArray->aUndoActions.Remove(
+ nPos - 1 );
+ }
+
+ while ( nMaxUndoActionCount < pActUndoArray->aUndoActions.Count() &&
+ !pActUndoArray->aUndoActions[0]->IsLinked())
+ {
+ delete pActUndoArray->aUndoActions[0];
+ pActUndoArray->aUndoActions.Remove(0);
+ --pActUndoArray->nCurUndoAction;
+ }
+
+ pActUndoArray->nMaxUndoActions = nMaxUndoActionCount;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_0E)
+
+USHORT SfxUndoManager::GetMaxUndoActionCount() const
+{
+ return pActUndoArray->nMaxUndoActions;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_0F)
+
+void SfxUndoManager::Clear()
+{
+ while ( pActUndoArray->aUndoActions.Count() )
+ {
+ SfxUndoAction *pAction=
+ pActUndoArray->aUndoActions[pActUndoArray->aUndoActions.Count() - 1];
+ pActUndoArray->aUndoActions.Remove( pActUndoArray->aUndoActions.Count() - 1 );
+ delete pAction;
+ }
+
+ pActUndoArray->nCurUndoAction = 0;
+}
+
+//------------------------------------------------------------------------
+
+void SfxUndoManager::ClearRedo()
+{
+ while ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction )
+ {
+ SfxUndoAction *pAction=
+ pActUndoArray->aUndoActions[pActUndoArray->aUndoActions.Count() - 1];
+ pActUndoArray->aUndoActions.Remove( pActUndoArray->aUndoActions.Count() - 1 );
+ delete pAction;
+ }
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_10)
+
+void SfxUndoManager::AddUndoAction( SfxUndoAction *pAction, BOOL bTryMerge )
+{
+ // Redo-Actions loeschen
+ for ( USHORT nPos = pActUndoArray->aUndoActions.Count();
+ nPos > pActUndoArray->nCurUndoAction; --nPos )
+ delete pActUndoArray->aUndoActions[nPos-1];
+
+ pActUndoArray->aUndoActions.Remove(
+ pActUndoArray->nCurUndoAction,
+ pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction );
+
+ if ( pActUndoArray->nMaxUndoActions )
+ {
+ SfxUndoAction *pTmpAction = pActUndoArray->nCurUndoAction ?
+ pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1] : 0;
+
+ if ( !bTryMerge || !(pTmpAction && pTmpAction->Merge(pAction)) )
+ {
+ // auf Max-Anzahl anpassen
+ if( pActUndoArray == pUndoArray )
+ while( pActUndoArray->aUndoActions.Count() >=
+ pActUndoArray->nMaxUndoActions &&
+ !pActUndoArray->aUndoActions[0]->IsLinked() )
+ {
+ delete pActUndoArray->aUndoActions[0];
+ pActUndoArray->aUndoActions.Remove(0);
+ --pActUndoArray->nCurUndoAction;
+ }
+
+ // neue Action anh"angen
+ const SfxUndoAction* pTemp = pAction;
+ pActUndoArray->aUndoActions.Insert(
+ pTemp, pActUndoArray->nCurUndoAction++ );
+ return;
+ }
+ }
+
+ delete pAction;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_11)
+
+USHORT SfxUndoManager::GetUndoActionCount() const
+{
+ return pActUndoArray->nCurUndoAction;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_12)
+
+XubString SfxUndoManager::GetUndoActionComment( USHORT nNo ) const
+{
+ return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]->GetComment(); //!
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_13)
+
+USHORT SfxUndoManager::GetUndoActionId( USHORT nNo ) const
+{
+ return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1-nNo]->GetId(); //!
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_14)
+
+BOOL SfxUndoManager::Undo( USHORT nCount )
+{
+ if ( pActUndoArray->nCurUndoAction )
+ {
+ Undo( *pActUndoArray->aUndoActions[ --pActUndoArray->nCurUndoAction ] );
+ return TRUE;
+ }
+ return FALSE;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_15)
+
+void SfxUndoManager::Undo( SfxUndoAction &rAction )
+{
+ rAction.Undo();
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_16)
+
+USHORT SfxUndoManager::GetRedoActionCount() const
+{
+ return pActUndoArray->aUndoActions.Count() - pActUndoArray->nCurUndoAction; //!
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_17)
+
+XubString SfxUndoManager::GetRedoActionComment( USHORT nNo ) const
+{
+ return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetComment(); //!
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_18)
+
+USHORT SfxUndoManager::GetRedoActionId( USHORT nNo ) const
+{
+ return pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction+nNo]->GetId(); //!
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_19)
+
+BOOL SfxUndoManager::Redo( USHORT nNumber )
+{
+ if ( pActUndoArray->aUndoActions.Count() > pActUndoArray->nCurUndoAction )
+ {
+ Redo( *pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction++] );
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_1A)
+
+void SfxUndoManager::Redo( SfxUndoAction &rAction )
+{
+ rAction.Redo();
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_1B)
+
+USHORT SfxUndoManager::GetRepeatActionCount() const
+{
+ return pActUndoArray->aUndoActions.Count();
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_1C)
+
+XubString SfxUndoManager::GetRepeatActionComment( SfxRepeatTarget &rTarget, USHORT nNo ) const
+{
+ return pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 - nNo ]
+ ->GetRepeatComment(rTarget);
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_1D)
+
+BOOL SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, USHORT nFrom, USHORT nCount )
+{
+ if ( pActUndoArray->aUndoActions.Count() )
+ {
+ Repeat( rTarget, *pActUndoArray->aUndoActions[ pActUndoArray->aUndoActions.Count() - 1 ] );
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_1E)
+
+void SfxUndoManager::Repeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction )
+{
+ if ( rAction.CanRepeat(rTarget) )
+ rAction.Repeat(rTarget);
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_1F)
+
+BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, SfxUndoAction &rAction ) const
+{
+ return rAction.CanRepeat(rTarget);
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_20)
+
+BOOL SfxUndoManager::CanRepeat( SfxRepeatTarget &rTarget, USHORT nNo ) const
+{
+ if ( pActUndoArray->aUndoActions.Count() > nNo )
+ {
+ USHORT nActionNo = pActUndoArray->aUndoActions.Count() - 1 - nNo;
+ return pActUndoArray->aUndoActions[nActionNo]->CanRepeat(rTarget);
+ }
+
+ return FALSE;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_21)
+
+void SfxUndoManager::EnterListAction(
+ const XubString& rComment, const XubString &rRepeatComment, USHORT nId )
+
+/* [Beschreibung]
+
+ Fuegt eine ListUndoAction ein und setzt dessen UndoArray als aktuelles.
+*/
+
+{
+ if ( !pUndoArray->nMaxUndoActions )
+ return;
+
+ pFatherUndoArray=pActUndoArray;
+ SfxListUndoAction *pAction=new SfxListUndoAction(
+ rComment, rRepeatComment, nId, pActUndoArray);
+ AddUndoAction( pAction );
+ pActUndoArray=pAction;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_22)
+
+void SfxUndoManager::LeaveListAction()
+
+/* [Beschreibung]
+
+ Verlaesst die aktuelle ListAction und geht eine Ebene nach oben.
+*/
+{
+ if ( !pUndoArray->nMaxUndoActions )
+ return;
+
+ DBG_ASSERT(pActUndoArray->pFatherUndoArray,"Keine hoehere Undo Ebene existent");
+
+ SfxUndoArray* pTmp=pActUndoArray;
+ pActUndoArray=pActUndoArray->pFatherUndoArray;
+
+//Falls keine UndoAction eingefuegt wurde, entferne die UndoListAction
+
+ if(!pTmp->nCurUndoAction)
+ {
+ SfxUndoAction *pTmpAction=
+ pActUndoArray->aUndoActions[pActUndoArray->nCurUndoAction-1];
+ pActUndoArray->aUndoActions.Remove( --pActUndoArray->nCurUndoAction);
+ delete pTmpAction;
+ }
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_23)
+
+USHORT SfxListUndoAction::GetId() const
+{
+ return nId;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_24)
+
+XubString SfxListUndoAction::GetComment() const
+{
+ return aComment;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_25)
+
+XubString SfxListUndoAction::GetRepeatComment(SfxRepeatTarget &r) const
+{
+ return aRepeatComment;
+}
+
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_26)
+
+SfxListUndoAction::SfxListUndoAction
+(
+ const XubString &rComment,
+ const XubString rRepeatComment,
+ USHORT Id,
+ SfxUndoArray *pFather
+)
+: aComment(rComment), aRepeatComment(rRepeatComment), nId(Id)
+{
+ pFatherUndoArray = pFather;
+ nMaxUndoActions = USHRT_MAX;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_27)
+
+void SfxListUndoAction::Undo()
+{
+ for(INT16 i=nCurUndoAction-1;i>=0;i--)
+ aUndoActions[i]->Undo();
+ nCurUndoAction=0;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_28)
+
+void SfxListUndoAction::Redo()
+{
+ for(USHORT i=nCurUndoAction;i<aUndoActions.Count();i++)
+ aUndoActions[i]->Redo();
+ nCurUndoAction = aUndoActions.Count();
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_29)
+
+void SfxListUndoAction::Repeat(SfxRepeatTarget&rTarget)
+{
+ for(USHORT i=0;i<nCurUndoAction;i++)
+ aUndoActions[i]->Repeat(rTarget);
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_2A)
+
+BOOL SfxListUndoAction::CanRepeat(SfxRepeatTarget&r) const
+{
+ for(USHORT i=0;i<nCurUndoAction;i++)
+ if(!aUndoActions[i]->CanRepeat(r))
+ return FALSE;
+ return TRUE;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_2B)
+
+SfxLinkUndoAction::SfxLinkUndoAction(SfxUndoManager *pManager)
+/* [Beschreibung]
+
+ Richtet eine LinkAction ein, die auf einen weiteren UndoManager zeigt.
+ Holt sich als zugehoerige Action des weiteren UndoManagers dessen
+ aktuelle Action.
+*/
+
+{
+ pUndoManager = pManager;
+ if ( pManager->GetMaxUndoActionCount() )
+ {
+ USHORT nPos = pManager->GetUndoActionCount()-1;
+ pAction = pManager->pActUndoArray->aUndoActions[nPos];
+ pAction->SetLinked();
+ }
+ else
+ pAction = 0;
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_2C)
+
+void SfxLinkUndoAction::Undo()
+{
+ if ( pAction )
+ pUndoManager->Undo(1);
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_2D)
+
+void SfxLinkUndoAction::Redo()
+{
+ if ( pAction )
+ pUndoManager->Redo(1);
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_2E)
+
+BOOL SfxLinkUndoAction::CanRepeat(SfxRepeatTarget& r) const
+{
+ return pAction && pUndoManager->CanRepeat(r,*pAction);
+}
+
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_2F)
+
+void SfxLinkUndoAction::Repeat(SfxRepeatTarget&r)
+{
+ if ( pAction )
+ pUndoManager->Repeat(r,*pAction);
+}
+
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_30)
+
+XubString SfxLinkUndoAction::GetComment() const
+{
+ if ( pAction )
+ return pAction->GetComment();
+ else
+ return XubString();
+}
+
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_31)
+
+XubString SfxLinkUndoAction::GetRepeatComment(SfxRepeatTarget&r) const
+{
+ if ( pAction )
+ return pAction->GetRepeatComment(r);
+ else
+ return XubString();
+}
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_37)
+
+SfxLinkUndoAction::~SfxLinkUndoAction()
+{
+ if( pAction )
+ pAction->SetLinked( FALSE );
+}
+
+
+//------------------------------------------------------------------------
+
+#pragma SEG_FUNCDEF(undo_32)
+
+USHORT SfxLinkUndoAction::GetId() const
+{
+ return pAction ? pAction->GetId() : 0;
+}
+
+#pragma SEG_FUNCDEF(undo_33)
+
+SfxUndoArray::~SfxUndoArray()
+{
+ while ( aUndoActions.Count() )
+ {
+ SfxUndoAction *pAction =
+ aUndoActions[ aUndoActions.Count() - 1 ];
+ aUndoActions.Remove( aUndoActions.Count() - 1 );
+ delete pAction;
+ }
+}
+
+
+
+/*------------------------------------------------------------------------
+
+ $Log: not supported by cvs2svn $
+ Revision 1.44 2000/09/18 14:13:48 willem.vandorp
+ OpenOffice header added.
+
+ Revision 1.43 2000/08/31 13:53:28 willem.vandorp
+ Header and footer replaced
+
+ Revision 1.42 2000/02/09 16:29:42 hr
+ #70473# changes for unicode ( patched by automated patchtool )
+
+ Revision 1.41 1998/01/20 09:08:18 MH
+ chg: header
+
+
+ Rev 1.40 20 Jan 1998 10:08:18 MH
+ chg: header
+
+ Rev 1.39 07 Aug 1997 16:32:38 TJ
+ include
+
+ Rev 1.38 01 Oct 1996 13:29:00 MI
+ ClearRedo()
+
+ Rev 1.37 13 Jun 1996 10:47:00 MI
+ weniger Compiler-Keys
+
+ Rev 1.36 21 Mar 1996 14:56:34 MI
+ alte C_VErSION
+
+ Rev 1.35 19 Mar 1996 12:05:34 TLX
+ #25200# noch vorsichtiger mit gelinten Actions
+
+ Rev 1.34 14 Mar 1996 17:42:58 MH
+ del: S_VERSION
+
+ Rev 1.33 09 Feb 1996 18:43:38 TLX
+ #25200# Bei Remove von Undoactions Linking beachten
+
+ Rev 1.32 01 Dec 1995 17:40:34 TLX
+ Loesche gemergte Actions
+
+ Rev 1.31 29 Nov 1995 12:09:28 TLX
+ Destruktor fuer UndoArrays
+
+ Rev 1.30 23 Nov 1995 16:39:42 AB
+ Unicode-Anpassung
+
+ Rev 1.29 13 Nov 1995 10:48:38 TLX
+ SetMaxUndoCount loescht nur noch ueberzaehlige Actions
+
+ Rev 1.27 06 Nov 1995 16:18:18 MI
+ Bugfix Absturz bei ListActions und zu kleinem MaxCount
+
+ Rev 1.26 04 Oct 1995 16:28:10 MI
+ CanRepeat-Syntax-Fehler in 257
+
+ Rev 1.25 29 Sep 1995 08:30:08 MI
+ neue Methode SfxUndoManager::CanRepeat() mit Index
+
+ Rev 1.24 07 Aug 1995 19:49:42 TLX
+ Auschneiden gibt keinen gpf mehr
+
+ Rev 1.23 31 Jul 1995 14:28:26 MT
+ Undo/Redo in ListUndoAction behoben (nCurPos)
+
+ Rev 1.22 31 Jul 1995 13:09:04 PB
+
+ Rev 1.21 31 Jul 1995 12:50:36 PB
+
+ Rev 1.20 31 Jul 1995 12:46:14 PB
+
+ Rev 1.19 31 Jul 1995 12:38:54 PB
+
+ Rev 1.18 31 Jul 1995 11:22:20 TLX
+
+ Rev 1.17 05 Jul 1995 16:10:48 TLX
+ Neue Undofeatures
+
+ Rev 1.16 06 Jun 1995 18:48:26 TRI
+ ~SfxRepeatTarget impl.
+
+ Rev 1.15 06 Jun 1995 13:26:54 MI
+ SfxRepeatTarget -- INKOMPATIBEL
+
+ Rev 1.14 02 May 1995 18:40:36 TRI
+ WATCOM Anpassung
+
+ Rev 1.13 18 Apr 1995 19:03:50 MI
+ neue Methode Clear() -- kompatibel
+
+ Rev 1.12 29 Mar 1995 17:30:48 MI
+ Bugfix: AddUndoAction
+
+ Rev 1.11 23 Mar 1995 18:45:20 MI
+ Begrenzung implementiert
+
+ Rev 1.10 15 Dec 1994 09:32:38 MI
+ svmem
+
+ Rev 1.9 31 Oct 1994 11:22:54 MI
+ CanRepeat
+
+ Rev 1.8 25 Oct 1994 12:00:48 VB
+ hdrstop
+
+ Rev 1.7 20 Oct 1994 17:10:54 MI
+ Jobsetup
+
+ Rev 1.6 28 Sep 1994 19:29:30 MI
+ pch-Probleme und Printing
+
+ Rev 1.5 23 Sep 1994 09:43:14 MI
+ Bugfix: Syntaxfehler
+
+ Rev 1.4 23 Sep 1994 09:10:56 MI
+ repeat dummy ersetzt
+
+ Rev 1.3 23 Sep 1994 09:01:52 MI
+ repeat-dummy
+
+ Rev 1.2 22 Sep 1994 17:37:02 MI
+ Undo und ItemSet immer mit Pool
+
+ Rev 1.1 21 Sep 1994 10:49:04 MI
+ pch
+
+ Rev 1.0 19 Sep 1994 17:04:18 MI
+ Initial revision.
+
+------------------------------------------------------------------------*/
+
+#pragma SEG_EOFMODULE
+
diff --git a/svtools/source/uno/makefile.mk b/svtools/source/uno/makefile.mk
new file mode 100644
index 000000000000..46e22c8c3823
--- /dev/null
+++ b/svtools/source/uno/makefile.mk
@@ -0,0 +1,253 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=unoiface
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+.IF "$(header)" == ""
+
+UNOUCRDEP=$(SOLARBINDIR)$/applicat.rdb
+UNOUCRRDB=$(SOLARBINDIR)$/applicat.rdb
+UNOUCROUT=$(OUT)$/inc
+
+#not all needed...
+
+UNOTYPES= \
+ com.sun.star.awt.CharSet \
+ com.sun.star.awt.DeviceCapability \
+ com.sun.star.awt.FontDescriptor \
+ com.sun.star.awt.FontPitch \
+ com.sun.star.awt.FontSlant \
+ com.sun.star.awt.FontStrikeout \
+ com.sun.star.awt.FontStrikeout \
+ com.sun.star.awt.FontType \
+ com.sun.star.awt.FontUnderline \
+ com.sun.star.awt.FontWeight \
+ com.sun.star.awt.FontWidth \
+ com.sun.star.awt.KeyModifier \
+ com.sun.star.awt.MenuItemStyle \
+ com.sun.star.awt.MessageBoxCommand \
+ com.sun.star.awt.MouseButton \
+ com.sun.star.awt.PopupMenuDirection \
+ com.sun.star.awt.ScrollBarOrientation \
+ com.sun.star.awt.Style \
+ com.sun.star.awt.TextAlign \
+ com.sun.star.awt.VclWindowPeerAttribute \
+ com.sun.star.awt.WindowAttribute \
+ com.sun.star.awt.XActionListener \
+ com.sun.star.awt.XAdjustmentListener \
+ com.sun.star.awt.XBitmap \
+ com.sun.star.awt.XButton \
+ com.sun.star.awt.XCheckBox \
+ com.sun.star.awt.XComboBox \
+ com.sun.star.awt.XControl \
+ com.sun.star.awt.XControlContainer \
+ com.sun.star.awt.XControlModel \
+ com.sun.star.awt.XCurrencyField \
+ com.sun.star.awt.XDateField \
+ com.sun.star.awt.XDevice \
+ com.sun.star.awt.XDialog \
+ com.sun.star.awt.XFileDialog \
+ com.sun.star.awt.XFixedText \
+ com.sun.star.awt.XFocusListener \
+ com.sun.star.awt.XFont \
+ com.sun.star.awt.XGraphics \
+ com.sun.star.awt.XImageButton \
+ com.sun.star.awt.XImageConsumer \
+ com.sun.star.awt.XImageProducer \
+ com.sun.star.awt.ImageStatus \
+ com.sun.star.awt.XInfoPrinter \
+ com.sun.star.awt.XItemListener \
+ com.sun.star.awt.XKeyListener \
+ com.sun.star.awt.XLayoutConstrains \
+ com.sun.star.awt.XListBox \
+ com.sun.star.awt.XMenuListener \
+ com.sun.star.awt.XMessageBox \
+ com.sun.star.awt.XMouseListener \
+ com.sun.star.awt.XMouseMotionListener \
+ com.sun.star.awt.XNumericField \
+ com.sun.star.util.XNumberFormatsSupplier \
+ com.sun.star.awt.XPaintListener \
+ com.sun.star.awt.XPatternField \
+ com.sun.star.awt.XPointer \
+ com.sun.star.awt.XPrinter \
+ com.sun.star.awt.XPrinterPropertySet \
+ com.sun.star.awt.XPrinterServer \
+ com.sun.star.awt.XProgressBar \
+ com.sun.star.awt.XProgressMonitor \
+ com.sun.star.awt.XRadioButton \
+ com.sun.star.awt.XRegion \
+ com.sun.star.awt.XScrollBar \
+ com.sun.star.awt.XSpinField \
+ com.sun.star.awt.XSpinListener \
+ com.sun.star.awt.XSystemDependentWindowPeer \
+ com.sun.star.awt.XTabController \
+ com.sun.star.awt.XTabControllerModel \
+ com.sun.star.awt.XTextArea \
+ com.sun.star.awt.XTextComponent \
+ com.sun.star.awt.XTextEditField \
+ com.sun.star.awt.XTextLayoutConstrains \
+ com.sun.star.awt.XTextListener \
+ com.sun.star.awt.XTimeField \
+ com.sun.star.awt.XToolkit \
+ com.sun.star.awt.XTopWindow \
+ com.sun.star.awt.XTopWindowListener \
+ com.sun.star.awt.XUnoControlContainer \
+ com.sun.star.awt.XVclContainer \
+ com.sun.star.awt.XVclContainerListener \
+ com.sun.star.awt.XVclContainerPeer \
+ com.sun.star.awt.XVclWindowPeer \
+ com.sun.star.awt.XWindow \
+ com.sun.star.awt.XWindowListener \
+ com.sun.star.beans.PropertyAttribute \
+ com.sun.star.beans.PropertyChangeEvent \
+ com.sun.star.beans.PropertyState \
+ com.sun.star.beans.PropertyStateChangeEvent \
+ com.sun.star.beans.PropertyValue \
+ com.sun.star.beans.PropertyValues \
+ com.sun.star.beans.XFastPropertySet \
+ com.sun.star.beans.XMultiPropertySet \
+ com.sun.star.beans.XPropertiesChangeListener \
+ com.sun.star.beans.XPropertyAccess \
+ com.sun.star.beans.XPropertyChangeListener \
+ com.sun.star.beans.XPropertyContainer \
+ com.sun.star.beans.XPropertySet \
+ com.sun.star.beans.XPropertySetInfo \
+ com.sun.star.beans.XPropertyState \
+ com.sun.star.beans.XVetoableChangeListener \
+ com.sun.star.container.XContainer \
+ com.sun.star.container.XContainerListener \
+ com.sun.star.container.XNameContainer \
+ com.sun.star.frame.XModel \
+ com.sun.star.frame.XFrameLoader \
+ com.sun.star.frame.XLoadEventListener \
+ com.sun.star.frame.XController \
+ com.sun.star.frame.XDispatch \
+ com.sun.star.frame.XDispatchProvider \
+ com.sun.star.frame.XStorable \
+ com.sun.star.frame.XFrame \
+ com.sun.star.frame.FeatureStateEvent \
+ com.sun.star.frame.DispatchDescriptor \
+ com.sun.star.io.XInputStream \
+ com.sun.star.io.XMarkableStream \
+ com.sun.star.io.XObjectInputStream \
+ com.sun.star.io.XConnectable \
+ com.sun.star.io.XActiveDataControl \
+ com.sun.star.io.XActiveDataSink \
+ com.sun.star.io.XActiveDataSource \
+ com.sun.star.lang.IllegalArgumentException \
+ com.sun.star.lang.SystemDependent \
+ com.sun.star.lang.XEventListener \
+ com.sun.star.lang.XMultiServiceFactory \
+ com.sun.star.lang.XServiceInfo \
+ com.sun.star.lang.XServiceName \
+ com.sun.star.lang.XSingleServiceFactory \
+ com.sun.star.lang.XTypeProvider \
+ com.sun.star.lang.XUnoTunnel \
+ com.sun.star.registry.XRegistryKey \
+ com.sun.star.uno.TypeClass \
+ com.sun.star.util.XSearchable \
+ com.sun.star.util.XSearchDescriptor \
+ com.sun.star.util.XURLTransformer \
+ com.sun.star.view.XScreenCursor \
+ com.sun.star.text.XTextCursor \
+ com.sun.star.text.XText \
+ com.sun.star.text.XTextRange \
+ com.sun.star.text.XTextViewCursor \
+ com.sun.star.text.XTextViewCursorSupplier \
+ com.sun.star.uno.XAggregation \
+ com.sun.star.uno.XWeak
+
+
+.IF "$(GUI)"!="DOS"
+SRS1NAME= uno
+SRC1FILES= unoifac2.src
+.ENDIF
+
+SLOFILES= \
+ $(SLO)$/registerservices.obj \
+ $(SLO)$/unoifac3.obj \
+ $(SLO)$/unoifac2.obj \
+ $(SLO)$/unoiface.obj \
+ $(SLO)$/imgprod.obj
+
+LIB1TARGET= $(SLB)$/$(TARGET).lib
+LIB1OBJFILES= $(SLOFILES)
+
+.ENDIF
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/source/uno/registerservices.cxx b/svtools/source/uno/registerservices.cxx
new file mode 100644
index 000000000000..97b73de10a4f
--- /dev/null
+++ b/svtools/source/uno/registerservices.cxx
@@ -0,0 +1,187 @@
+/*************************************************************************
+ *
+ * $RCSfile: registerservices.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP_
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#endif
+
+#include <cppuhelper/factory.hxx>
+
+#ifndef _CPPUHELPER_WEAK_HXX_
+#include <cppuhelper/weak.hxx>
+#endif
+#ifndef _OSL_MUTEX_HXX_
+#include <osl/mutex.hxx>
+#endif
+
+#include <unoifac3.hxx>
+#include <unoiface.hxx>
+
+#include <toolkit/helper/macros.hxx>
+
+#define IMPL_CREATEINSTANCE( ImplName ) \
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& ) \
+ { return ::com::sun::star::uno::Reference < ::com::sun::star::uno::XInterface >( ( ::cppu::OWeakObject* ) new ImplName ); }
+
+// for CreateInstance functions implemented elsewhere
+#define DECLARE_CREATEINSTANCE( ImplName ) \
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL ImplName##_CreateInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& );
+
+// -------------------------------------------------------------------------------------
+
+IMPL_CREATEINSTANCE( SvtTextLoader )
+IMPL_CREATEINSTANCE( ExtVCLXToolkit )
+DECLARE_CREATEINSTANCE( SvNumberFormatsSupplierServiceObject )
+
+extern "C"
+{
+
+void SAL_CALL component_getImplementationEnvironment( const sal_Char** ppEnvTypeName, uno_Environment** ppEnv )
+{
+ *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+sal_Bool SAL_CALL component_writeInfo( void* _pServiceManager, void* _pRegistryKey )
+{
+ if (_pRegistryKey)
+ {
+ ::com::sun::star::registry::XRegistryKey * pRegistryKey = reinterpret_cast< ::com::sun::star::registry::XRegistryKey* >( _pRegistryKey );
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xNewKey;
+
+ xNewKey = pRegistryKey->createKey( ::rtl::OUString::createFromAscii( "/stardiv.svtools.ExtVCLXToolkit/UNO/SERVICES" ) );
+ xNewKey->createKey( ::rtl::OUString::createFromAscii( "com.sun.star.awt.ExtToolkit" ) );
+
+ xNewKey = pRegistryKey->createKey( ::rtl::OUString::createFromAscii( "/stardiv.svtools.SvtTextLoader/UNO/SERVICES" ) );
+ xNewKey->createKey( ::rtl::OUString::createFromAscii( "stardiv.one.frame.FrameLoader" ) );
+ xNewKey->createKey( ::rtl::OUString::createFromAscii( "stardiv.one.frame.TextLoader" ) );
+ xNewKey = pRegistryKey->createKey( ::rtl::OUString::createFromAscii( "/stardiv.svtools.SvtTextLoader/UNO/Loader" ) );
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xLoaderKey = pRegistryKey->createKey( ::rtl::OUString::createFromAscii( "/stardiv.svtools.SvtTextLoader/Loader" ) );
+ xNewKey = xLoaderKey->createKey( ::rtl::OUString::createFromAscii( "Pattern" ) );
+ xNewKey->setAsciiValue( ::rtl::OUString::createFromAscii( ".component:Text*" ) );
+
+ xNewKey = pRegistryKey->createKey( ::rtl::OUString::createFromAscii( "/com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject/UNO/SERVICES" ) );
+ xNewKey->createKey( ::rtl::OUString::createFromAscii( "com.sun.star.util.NumberFormatsSupplier" ) );
+
+// !!!
+/*
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xKey;
+ uno2smart(xKey, *xUnoKey);
+
+ ::rtl::OUString aImpl( L"/" );
+ aImpl += SvUnoAttributeContainer::getStaticImplementationName();
+ aImpl += L"/UNO/SERVICES";
+ ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey > xNewKey = xKey->createKey( aImpl );
+ ::com::sun::star::uno::Sequence <::rtl::OUString> aSequ = SvUnoAttributeContainer::getStaticSupportedServiceNames();
+ const ::rtl::OUString* pArray = aSequ.getConstArray();
+ for( sal_Int32 i = 0; i < aSequ.getLength(); i++ )
+ xNewKey->createKey( pArray[i] );
+*/
+
+ }
+ return sal_True;
+}
+
+void* SAL_CALL component_getFactory( const sal_Char* sImplementationName, void* _pServiceManager, void* _pRegistryKey )
+{
+ void* pRet = NULL;
+
+ if ( _pServiceManager )
+ {
+ ::com::sun::star::lang::XMultiServiceFactory* pServiceManager = reinterpret_cast< ::com::sun::star::lang::XMultiServiceFactory* >( _pServiceManager );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xFactory;
+
+ if ( rtl_str_compare( sImplementationName, "stardiv.svtools.SvtTextLoader") == 0 )
+ {
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aServiceNames(2);
+ aServiceNames.getArray()[0] = ::rtl::OUString::createFromAscii( "stardiv.one.frame.FrameLoader" );
+ aServiceNames.getArray()[1] = ::rtl::OUString::createFromAscii( "stardiv.one.frame.TextLoader" );
+ xFactory = ::cppu::createSingleFactory( pServiceManager, ::rtl::OUString::createFromAscii( sImplementationName ), SvtTextLoader_CreateInstance, aServiceNames );
+ }
+ else if ( rtl_str_compare( sImplementationName, "stardiv.svtools.ExtVCLXToolkit" ) == 0 )
+ {
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aServiceNames(1);
+ aServiceNames.getArray()[0] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.ExtToolkit" );
+ xFactory = ::cppu::createSingleFactory( pServiceManager, ::rtl::OUString::createFromAscii( sImplementationName ), ExtVCLXToolkit_CreateInstance, aServiceNames );
+ }
+ if ( rtl_str_compare( sImplementationName, "com.sun.star.uno.util.numbers.SvNumberFormatsSupplierServiceObject") == 0 )
+ {
+ ::com::sun::star::uno::Sequence< ::rtl::OUString > aServiceNames(1);
+ aServiceNames.getArray()[0] = ::rtl::OUString::createFromAscii( "com.sun.star.util.NumberFormatsSupplier" );
+ xFactory = ::cppu::createSingleFactory( pServiceManager, ::rtl::OUString::createFromAscii( sImplementationName ), SvNumberFormatsSupplierServiceObject_CreateInstance, aServiceNames );
+ }
+
+ if ( xFactory.is() )
+ {
+ xFactory->acquire();
+ pRet = xFactory.get();
+ }
+ }
+ return pRet;
+}
+
+} // "C"
+
diff --git a/svtools/source/uno/unoifac2.hrc b/svtools/source/uno/unoifac2.hrc
new file mode 100644
index 000000000000..3fff8059c489
--- /dev/null
+++ b/svtools/source/uno/unoifac2.hrc
@@ -0,0 +1,86 @@
+/*************************************************************************
+ *
+ * $RCSfile: unoifac2.hrc,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#ifndef _SVT_UNO_UNOIFAC_HRC_
+#define _SVT_UNO_UNOIFAC_HRC_
+
+
+#ifndef _SOLAR_HRC
+#include <solar.hrc>
+#endif
+
+//! Um den Überblick über alle benutzten HelpID's zu behalten sind diese
+//! zentral in <helpid.hrc>
+#ifndef _SVT_HELPID_HRC
+#include <helpid.hrc>
+#endif
+
+// RID's fuer das Kontextmenu der Textkomponente
+#define RID_CONTEXTMENU (RID_APP_START + 1024)
+#define RID_OPEN_LINK (RID_APP_START + 10)
+#define RID_OPEN_LINK_NEW (RID_APP_START + 11)
+#define RID_DOWNLOAD (RID_APP_START + 12)
+#define RID_ADD_BOOKMARK (RID_APP_START + 13)
+#define RID_COPY_LINK (RID_APP_START + 14)
+
+
+#endif
+
diff --git a/svtools/source/uno/unoifac2.src b/svtools/source/uno/unoifac2.src
new file mode 100644
index 000000000000..b201c22be192
--- /dev/null
+++ b/svtools/source/uno/unoifac2.src
@@ -0,0 +1,223 @@
+/*************************************************************************
+ *
+ * $RCSfile: unoifac2.src,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+
+
+#ifndef _SVT_UNO_UNOIFAC_HRC_
+#include <unoifac2.hrc>
+#endif
+
+
+Menu RID_CONTEXTMENU
+{
+ ItemList =
+ {
+ MenuItem
+ {
+ Identifier = RID_OPEN_LINK ;
+ HelpId = HID_TEXTCPNT_OPEN_LINK ;
+ Text = "Öff~nen" ;
+ Text[ English ] = "~Open" ;
+ Text[ italian ] = "~Apri";
+ Text[ portuguese_brazilian ] = "Öff~nen";
+ Text[ portuguese ] = "~Abrir";
+ Text[ danish ] = "Å~bn";
+ Text[ french ] = "Ouvrir";
+ Text[ swedish ] = "~Öppna";
+ Text[ dutch ] = "Ope~nen";
+ Text[ spanish ] = "~Abrir";
+ Text[ english_us ] = "~Open";
+ Text[ chinese_simplified ] = "´ò¿ª(~O)";
+ Text[ russian ] = "Îòêðûòü";
+ Text[ polish ] = "Otwórz";
+ Text[ japanese ] = "ŠJ‚­(~O)";
+ Text[ chinese_traditional ] = "¶}±Ò·sÀÉ(~O)";
+ Text[ arabic ] = "ÝÊÍ";
+ Text[ dutch ] = "Ope~nen";
+ Text[ chinese_simplified ] = "´ò¿ª(~O)";
+ Text[ greek ] = "¢~íïéãìá";
+ Text[ korean ] = "¿­±â(~O)";
+ Text[ turkish ] = "Aç";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = RID_OPEN_LINK_NEW ;
+ HelpId = HID_TEXTCPNT_OPEN_LINK_NEW ;
+ Text = "Öffnen in neuem ~Fenster" ;
+ Text[ English ] = "Open in ~new window" ;
+ Text[ italian ] = "Apri nella ~finestra nuova";
+ Text[ portuguese_brazilian ] = "Öff~nen in neuem ~Fenster";
+ Text[ portuguese ] = "Abrir em ~nova janela";
+ Text[ danish ] = "Åbn i nyt vindue";
+ Text[ french ] = "Ouvrir dans une nouvelle ~fenêtre";
+ Text[ swedish ] = "~Öppna i ett nytt fönster";
+ Text[ dutch ] = "Openen in nieuw ~venster";
+ Text[ spanish ] = "Abrir en ~ventana nueva";
+ Text[ english_us ] = "Open in New ~Window";
+ Text[ chinese_simplified ] = "ʹÓÃÒ»¸öÐÂÊÓ´°´ò¿ª(~W)";
+ Text[ russian ] = "Îòêðûòü â íîâîì îêíå";
+ Text[ polish ] = "Otwórz w nowym oknie";
+ Text[ japanese ] = "V‚µ‚¢³¨ÝÄÞ³‚ðŠJ‚­(~W)";
+ Text[ chinese_traditional ] = "¥Î¤@­Ó·sµøµ¡¶}±Ò(~W)";
+ Text[ arabic ] = "ÝÊÍ Ýí äÇÝÐÉ ÌÏíÏÉ";
+ Text[ dutch ] = "Openen in nieuw ~venster";
+ Text[ chinese_simplified ] = "ʹÓÃÒ»¸öÐÂÊÓ´°´ò¿ª(~W)";
+ Text[ greek ] = "¢íïéãìá óå íÝï ~ðáñÜèõñï";
+ Text[ korean ] = "»õ â¿¡¼­ ¿­±â(~W)";
+ Text[ turkish ] = "Yeni bir pencerede aç";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Identifier = RID_DOWNLOAD ;
+ HelpId = HID_TEXTCPNT_DOWNLOAD ;
+ Text = "~Download..." ;
+ Text[ English ] = "~Download..." ;
+ Text[ italian ] = "~Download...";
+ Text[ portuguese_brazilian ] = "~Download...";
+ Text[ portuguese ] = "~Download...";
+ Text[ danish ] = "Overfør...";
+ Text[ french ] = "~Téléchargement...";
+ Text[ swedish ] = "~Ladda ned...";
+ Text[ dutch ] = "~Downloaden...";
+ Text[ spanish ] = "~Descargar...";
+ Text[ english_us ] = "~Download...";
+ Text[ chinese_simplified ] = "ÏÂÔØ(~D)...";
+ Text[ russian ] = "Çàãðóçêà...";
+ Text[ polish ] = "Pobieranie...";
+ Text[ japanese ] = "ÀÞ³ÝÛ°ÄÞ(~D)...";
+ Text[ chinese_traditional ] = "¤U¸ü(~D)...";
+ Text[ arabic ] = "ÊäÒíá...";
+ Text[ dutch ] = "~Downloaden...";
+ Text[ chinese_simplified ] = "ÏÂÔØ(~D)...";
+ Text[ greek ] = "~ËÞøç áñ÷åßùí...";
+ Text[ korean ] = "´Ù¿î·Îµå(~D)...";
+ Text[ turkish ] = "Ýndir...";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = RID_ADD_BOOKMARK ;
+ HelpId = HID_TEXTCPNT_ADD_BOOKMARK ;
+ Text = "Verknüpfung ~hinzufügen" ;
+ Text[ English ] = "~Add bookmark" ;
+ Text[ italian ] = "~Aggiungi collegamento";
+ Text[ portuguese_brazilian ] = "Verknüpfung ~hinzufügen";
+ Text[ portuguese ] = "Adicionar ~ligação";
+ Text[ danish ] = "Tilføj kæde";
+ Text[ french ] = "~Ajouter un lien";
+ Text[ swedish ] = "Lägg till l~änk";
+ Text[ dutch ] = "Koppeling ~toevoegen";
+ Text[ spanish ] = "~Añadir vínculo";
+ Text[ english_us ] = "Add ~Link";
+ Text[ chinese_simplified ] = "ÐÂÔöÁ´½Ó(~L)";
+ Text[ russian ] = "Äîáàâèòü ññûëêó";
+ Text[ polish ] = "Dodaj ³¹cze";
+ Text[ japanese ] = "Øݸ‚̒ljÁ(~L)";
+ Text[ chinese_traditional ] = "¥[¤J±¶®|(~L)";
+ Text[ arabic ] = "ÅÖÇÝÉ ÇÑÊÈÇØ";
+ Text[ dutch ] = "Koppeling ~toevoegen";
+ Text[ chinese_simplified ] = "ÐÂÔöÁ´½Ó(~L)";
+ Text[ greek ] = "ÐñïóèÞê~ç óýíäåóçò";
+ Text[ korean ] = "¿¬°á Ãß°¡(~L)";
+ Text[ turkish ] = "Baðlantýyý ekle";
+ Text[ language_user1 ] = " ";
+ };
+ MenuItem
+ {
+ Separator = TRUE;
+ };
+ MenuItem
+ {
+ Identifier = RID_COPY_LINK ;
+ HelpId = HID_TEXTCPNT_COPY_LINK ;
+ Text = "~Link kopieren" ;
+ Text[ English ] = "~Copy Link" ;
+ Text[ english_us ] = "Cop~y Link" ;
+ Text[ portuguese ] = "~Copiar ligação" ;
+ Text[ portuguese_brazilian ] = "~Link kopieren" ;
+ Text[ swedish ] = "~Kopiera länk" ;
+ Text[ danish ] = "Kopier kæde" ;
+ Text[ italian ] = "Copia ~link" ;
+ Text[ spanish ] = "Copiar ~vínculo" ;
+ Text[ french ] = "Copier le ~lien" ;
+ Text[ dutch ] = "~Link kopiëren" ;
+ Text[ chinese_simplified ] = "¸´ÖÆÁ´½Ó(~Y)";
+ Text[ russian ] = "Êîïèðîâàòü ññûëêó";
+ Text[ polish ] = "Kopiuj ³¹cze";
+ Text[ japanese ] = "Øݸ‚̺Ëß°(~Y)";
+ Text[ chinese_traditional ] = "Î`»s±¶®|(~Y)";
+ Text[ arabic ] = "äÓÎ ÇáÇÑÊÈÇØ";
+ Text[ dutch ] = "~Link kopiëren";
+ Text[ chinese_simplified ] = "¸´ÖÆÁ´½Ó(~Y)";
+ Text[ greek ] = "ÁíôéãñáöÞ ~óýíäåóçò";
+ Text[ korean ] = "¿¬°á º¹»ç(~Y)";
+ Text[ turkish ] = "Baðlantýyý kopyala";
+ Text[ language_user1 ] = " ";
+ };
+ };
+};
+
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
new file mode 100644
index 000000000000..d325e028a36f
--- /dev/null
+++ b/svtools/source/uno/unoiface.cxx
@@ -0,0 +1,1756 @@
+/*************************************************************************
+ *
+ * $RCSfile: unoiface.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#define _SVT_UNOIFACE_CXX
+
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+
+#ifndef _SV_SVAPP_HXX
+#include <vcl/svapp.hxx>
+#endif
+
+#include <svmedit.hxx>
+#ifndef _SVT_UNOIFACE_HXX
+#include <unoiface.hxx>
+#endif
+#include <filedlg.hxx>
+#include <filectrl.hxx>
+
+#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#endif
+#ifndef _COM_SUN_STAR_LANG_XSINGLESERVICEFACTORY_HPP_
+#include <com/sun/star/lang/XSingleServiceFactory.hpp>
+#endif
+
+#ifndef _TOOLKIT_HELPER_CONVERT_HXX_
+#include <toolkit/helper/convert.hxx>
+#endif
+#ifndef _TOOLKIT_HELPER_PROPERTY_HXX_
+#include <toolkit/helper/property.hxx>
+#endif
+
+#ifndef _PRODUCE_HXX
+#include <imgprod.hxx>
+#endif
+
+#ifndef _FMTFIELD_HXX_
+#include <fmtfield.hxx>
+#endif
+
+#ifndef _NUMUNO_HXX
+#include <numuno.hxx>
+#endif
+
+#ifndef _CALENDAR_HXX
+#include <calendar.hxx>
+#endif
+
+// ----------------------------------------------------
+// class ExtUnoWrapper
+// ----------------------------------------------------
+void ExtUnoWrapper::RegisterUnoServices()
+{
+/*
+ UnoWrapper::RegisterUnoServices();
+
+ // ImageProducer registrieren...
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF = ::usr::getProcessServiceManager();
+
+ ::rtl::OUString aServiceName( L"stardiv.uno.awt.ImageProducer" );
+ ::com::sun::star::uno::Sequence< ::rtl::OUString> aServiceNames( &aServiceName, 1 );
+ ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > xSSF = ::usr::createOneInstanceFactory
+ ( xMSF, L"ImageProducer", ImageProducer_CreateInstance, aServiceNames );
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::container::XSet > xS( xMSF, UNO_QUERY );
+ ::com::sun::star::uno::Any aAny( &xSSF, ::getCppuType((const ::com::sun::star::container::XSet*)0) );
+ xS->insert( aAny );
+*/
+}
+
+// ----------------------------------------------------
+// class ExtVCLXToolkit
+// ----------------------------------------------------
+Window* ExtVCLXToolkit::CreateComponent( VCLXWindow** ppNewComp, const ::com::sun::star::awt::WindowDescriptor& rDescriptor, Window* pParent, sal_uInt32 nWinBits )
+{
+ Window* pWindow = NULL;
+ String aServiceName( rDescriptor.WindowServiceName );
+ if ( aServiceName.EqualsIgnoreCaseAscii( "MultiLineEdit" ) )
+ {
+ if ( pParent )
+ {
+ pWindow = new MultiLineEdit( pParent, nWinBits|WB_IGNORETAB);
+ *ppNewComp = new VCLXMultiLineEdit;
+ }
+ else
+ {
+ *ppNewComp = NULL;
+ return NULL;
+ }
+ }
+ // irgendwas muss ich mir noch fuer 'Custom-Bits' einfallen lassen,
+ // jetzt erstmal verschiedene Service-Namen:
+// else if ( aServiceName.ICompare( "FileDialog_open" ) == COMPARE_EQUAL )
+// {
+// pWindow = new FileDialog( pParent, nWinBits|WB_OPEN );
+// *ppNewComp = new VCLXFileDialog;
+// }
+// else if ( aServiceName.ICompare( "FileDialog_save" ) == COMPARE_EQUAL )
+// {
+// pWindow = new FileDialog( pParent, nWinBits|WB_SAVEAS );
+// *ppNewComp = new VCLXFileDialog;
+// }
+ else if ( aServiceName.EqualsIgnoreCaseAscii( "FileControl" ) )
+ {
+ if ( pParent )
+ {
+ pWindow = new FileControl( pParent, nWinBits );
+ *ppNewComp = new VCLXFileControl;
+ }
+ else
+ {
+ *ppNewComp = NULL;
+ return NULL;
+ }
+ }
+ else if (aServiceName.EqualsIgnoreCaseAscii("FormattedField") )
+ {
+ pWindow = new FormattedField(pParent, nWinBits);
+ *ppNewComp = new SVTXFormattedField;
+ }
+ else if (aServiceName.EqualsIgnoreCaseAscii("NumericField") )
+ {
+ pWindow = new DoubleNumericField( pParent, nWinBits );
+ *ppNewComp = new SVTXNumericField;
+ }
+ else if (aServiceName.EqualsIgnoreCaseAscii("LongCurrencyField") )
+ {
+ pWindow = new DoubleCurrencyField( pParent, nWinBits );
+ *ppNewComp = new SVTXCurrencyField;
+ }
+ else if (aServiceName.EqualsIgnoreCaseAscii("datefield") )
+ {
+ pWindow = new CalendarField( pParent, nWinBits);
+ static_cast<CalendarField*>(pWindow)->EnableToday();
+ static_cast<CalendarField*>(pWindow)->EnableNone();
+ static_cast<CalendarField*>(pWindow)->EnableEmptyFieldValue( TRUE );
+ *ppNewComp = new VCLXDateField;
+ ((VCLXFormattedSpinField*)*ppNewComp)->SetFormatter( (FormatterBase*)(DateField*)pWindow );
+ }
+
+ if ( !pWindow )
+ pWindow = VCLXToolkit::CreateComponent( ppNewComp, rDescriptor, pParent, nWinBits );
+
+ return pWindow;
+}
+
+// ----------------------------------------------------
+// INIT
+// ----------------------------------------------------
+void InitExtVclToolkit()
+{
+ ExtUnoWrapper* pWrapper = new ExtUnoWrapper;
+// pWrapper->SetToolkitCreateFunction( ExtVCLXToolkit_CreateInstance );
+ Application::SetUnoWrapper( pWrapper );
+}
+
+
+ // ----------------------------------------------------
+// class VCLXMultiLineEdit
+// ----------------------------------------------------
+VCLXMultiLineEdit::VCLXMultiLineEdit() : maTextListeners( *this )
+{
+}
+
+VCLXMultiLineEdit::~VCLXMultiLineEdit()
+{
+ MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ if ( pEdit )
+ pEdit->SetModifyHdl( Link() );
+}
+
+::com::sun::star::uno::Any VCLXMultiLineEdit::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
+ SAL_STATIC_CAST( ::com::sun::star::awt::XTextComponent*, this ),
+ SAL_STATIC_CAST( ::com::sun::star::awt::XTextArea*, this ),
+ SAL_STATIC_CAST( ::com::sun::star::awt::XTextLayoutConstrains*, this ),
+ SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) );
+ return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
+}
+
+// ::com::sun::star::lang::XTypeProvider
+IMPL_XTYPEPROVIDER_START( VCLXMultiLineEdit )
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextComponent>* ) NULL ),
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextArea>* ) NULL ),
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextLayoutConstrains>* ) NULL ),
+ VCLXWindow::getTypes()
+IMPL_XTYPEPROVIDER_END
+
+void VCLXMultiLineEdit::SetWindow( Window* pWindow )
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pPrevMultiLineEdit = (MultiLineEdit*) GetWindow();
+ if ( pPrevMultiLineEdit )
+ pPrevMultiLineEdit->SetModifyHdl( Link() );
+
+ MultiLineEdit* pNewMultiLineEdit = (MultiLineEdit*) pWindow;
+ if ( pNewMultiLineEdit )
+ pNewMultiLineEdit->SetModifyHdl( LINK( this, VCLXMultiLineEdit, ModifyHdl ) );
+
+ VCLXWindow::SetWindow( pWindow );
+}
+
+void VCLXMultiLineEdit::addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException)
+{
+ maTextListeners.addInterface( l );
+}
+
+void VCLXMultiLineEdit::removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException)
+{
+ maTextListeners.removeInterface( l );
+}
+
+void VCLXMultiLineEdit::setText( const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
+ if ( pEdit )
+ {
+ pEdit->SetText( aText );
+
+ // In JAVA wird auch ein textChanged ausgeloest, in VCL nicht.
+ // ::com::sun::star::awt::Toolkit soll JAVA-komform sein...
+ ModifyHdl( NULL );
+ }
+}
+
+void VCLXMultiLineEdit::insertText( const ::com::sun::star::awt::Selection& rSel, const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
+ if ( pEdit )
+ {
+ setSelection( rSel );
+ pEdit->ReplaceSelected( aText );
+ }
+}
+
+::rtl::OUString VCLXMultiLineEdit::getText() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::rtl::OUString aText;
+ MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
+ if ( pEdit )
+ aText = pEdit->GetText();
+ return aText;
+}
+
+::rtl::OUString VCLXMultiLineEdit::getSelectedText() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::rtl::OUString aText;
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ if ( pMultiLineEdit)
+ aText = pMultiLineEdit->GetSelected();
+ return aText;
+
+}
+
+void VCLXMultiLineEdit::setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ if ( pMultiLineEdit )
+ {
+ pMultiLineEdit->SetSelection( Selection( aSelection.Min, aSelection.Max ) );
+ }
+}
+
+::com::sun::star::awt::Selection VCLXMultiLineEdit::getSelection() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::awt::Selection aSel;
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ if ( pMultiLineEdit )
+ {
+ aSel.Min = pMultiLineEdit->GetSelection().Min();
+ aSel.Max = pMultiLineEdit->GetSelection().Max();
+ }
+ return aSel;
+}
+
+sal_Bool VCLXMultiLineEdit::isEditable() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ return ( pMultiLineEdit && !pMultiLineEdit->IsReadOnly() && pMultiLineEdit->IsEnabled() ) ? sal_True : sal_False;
+}
+
+void VCLXMultiLineEdit::setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ if ( pMultiLineEdit )
+ pMultiLineEdit->SetReadOnly( !bEditable );
+}
+
+void VCLXMultiLineEdit::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ if ( pMultiLineEdit )
+ pMultiLineEdit->SetMaxTextLen( nLen );
+}
+
+sal_Int16 VCLXMultiLineEdit::getMaxTextLen() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*) GetWindow();
+ return pMultiLineEdit ? pMultiLineEdit->GetMaxTextLen() : 0;
+}
+
+::rtl::OUString VCLXMultiLineEdit::getTextLines() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::rtl::OUString aText;
+ MultiLineEdit* pEdit = (MultiLineEdit*)GetWindow();
+ if ( pEdit )
+ aText = pEdit->GetTextLines();
+ return aText;
+}
+
+::com::sun::star::awt::Size VCLXMultiLineEdit::getMinimumSize() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::awt::Size aSz;
+ MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ if ( pEdit )
+ aSz = AWTSize(pEdit->CalcMinimumSize());
+ return aSz;
+}
+
+::com::sun::star::awt::Size VCLXMultiLineEdit::getPreferredSize() throw(::com::sun::star::uno::RuntimeException)
+{
+ return getMinimumSize();
+}
+
+::com::sun::star::awt::Size VCLXMultiLineEdit::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::awt::Size aSz = rNewSize;
+ MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ if ( pEdit )
+ aSz = AWTSize(pEdit->CalcAdjustedSize( VCLSize(rNewSize )));
+ return aSz;
+}
+
+::com::sun::star::awt::Size VCLXMultiLineEdit::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::awt::Size aSz;
+ MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ if ( pEdit )
+ aSz = AWTSize(pEdit->CalcSize( nCols, nLines ));
+ return aSz;
+}
+
+void VCLXMultiLineEdit::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ nCols = nLines = 0;
+ MultiLineEdit* pEdit = (MultiLineEdit*) GetWindow();
+ if ( pEdit )
+ {
+ sal_uInt16 nC, nL;
+ pEdit->GetMaxVisColumnsAndLines( nC, nL );
+ nCols = nC;
+ nLines = nL;
+ }
+}
+
+IMPL_LINK( VCLXMultiLineEdit, ModifyHdl, MultiLineEdit*, EMPTYARG )
+{
+ ::com::sun::star::awt::TextEvent aEvent;
+ aEvent.Source = (::cppu::OWeakObject*)this;
+ maTextListeners.textChanged( aEvent );
+
+ return 1;
+}
+
+void VCLXMultiLineEdit::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*)GetWindow();
+ if ( pMultiLineEdit )
+ {
+ sal_uInt16 nPropType = GetPropertyId( PropertyName );
+ switch ( nPropType )
+ {
+ case BASEPROPERTY_READONLY:
+ {
+ sal_Bool b;
+ if ( Value >>= b )
+ pMultiLineEdit->SetReadOnly( b );
+ }
+ break;
+ case BASEPROPERTY_MAXTEXTLEN:
+ {
+ sal_Int16 n;
+ if ( Value >>= n )
+ pMultiLineEdit->SetMaxTextLen( n );
+ }
+ break;
+ case BASEPROPERTY_FOCUSSELECTIONHIDE:
+ {
+ sal_Bool b;
+ if ( Value >>= b )
+ pMultiLineEdit->EnableFocusSelectionHide( b );
+ }
+ break;
+ default:
+ {
+ VCLXWindow::setProperty( PropertyName, Value );
+ }
+ }
+ }
+}
+
+::com::sun::star::uno::Any VCLXMultiLineEdit::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::uno::Any aProp;
+ MultiLineEdit* pMultiLineEdit = (MultiLineEdit*)GetWindow();
+ if ( pMultiLineEdit )
+ {
+ sal_uInt16 nPropType = GetPropertyId( PropertyName );
+ switch ( nPropType )
+ {
+ case BASEPROPERTY_READONLY:
+ {
+ aProp <<= pMultiLineEdit->IsReadOnly();
+ }
+ break;
+ case BASEPROPERTY_MAXTEXTLEN:
+ {
+ aProp <<= (sal_Int16) pMultiLineEdit->GetMaxTextLen();
+ }
+ break;
+ default:
+ {
+ aProp <<= VCLXWindow::getProperty( PropertyName );
+ }
+ }
+ }
+ return aProp;
+}
+
+
+// ----------------------------------------------------
+// class VCLXFileDialog
+// ----------------------------------------------------
+/*
+VCLXFileDialog::VCLXFileDialog()
+{
+}
+
+VCLXFileDialog::~VCLXFileDialog()
+{
+}
+
+::com::sun::star::uno::Any VCLXFileDialog::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
+ SAL_STATIC_CAST( ::com::sun::star::awt::XXX*, this ) );
+ return (aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType ));
+}
+
+// ::com::sun::star::lang::XTypeProvider
+IMPL_XTYPEPROVIDER_START( VCLXFileDialog )
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XXX>* ) NULL )
+IMPL_XTYPEPROVIDER_END
+
+void VCLXFileDialog::setPath( const ::rtl::OUString& rPath )
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileDialog* pDlg = (FileDialog*)GetWindow();
+ if ( pDlg )
+ pDlg->SetPath( ::rtl::OUStringToOString( rPath, CHARSET_SYSTEM ) );
+}
+
+::rtl::OUString VCLXFileDialog::getPath()
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::rtl::OUString aPath;
+ FileDialog* pDlg = (FileDialog*)GetWindow();
+ if ( pDlg )
+ aPath = StringToOUString( pDlg->GetPath(), CHARSET_SYSTEM );
+ return aPath;
+}
+
+void VCLXFileDialog::setFilters( const ::com::sun::star::uno::Sequence< ::rtl::OUString>& rFilterNames, const ::com::sun::star::uno::Sequence< ::rtl::OUString>& rMasks )
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileDialog* pDlg = (FileDialog*)GetWindow();
+ if ( pDlg )
+ {
+ sal_uInt32 nFlts = rFilterNames.getLength();
+ for ( sal_uInt32 n = 0; n < nFlts; n++ )
+ pDlg->AddFilter(
+ ::rtl::OUStringToOString( rFilterNames.getConstArray()[n], CHARSET_SYSTEM ),
+ ::rtl::OUStringToOString( rMasks.getConstArray()[n], CHARSET_SYSTEM ) );
+ }
+}
+
+void VCLXFileDialog::setCurrentFilter( const ::rtl::OUString& rFilterName )
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileDialog* pDlg = (FileDialog*)GetWindow();
+ if ( pDlg )
+ pDlg->SetCurFilter( ::rtl::OUStringToOString( rFilterName, CHARSET_SYSTEM ) );
+}
+
+::rtl::OUString VCLXFileDialog::getCurrentFilter()
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::rtl::OUString aFilter;
+ FileDialog* pDlg = (FileDialog*)GetWindow();
+ if ( pDlg )
+ aFilter = StringToOUString( pDlg->GetCurFilter(), CHARSET_SYSTEM );
+ return aFilter;
+}
+*/
+
+// ----------------------------------------------------
+// class VCLXFileControl
+// ----------------------------------------------------
+VCLXFileControl::VCLXFileControl() : maTextListeners( *this )
+{
+}
+
+VCLXFileControl::~VCLXFileControl()
+{
+ FileControl* pControl = (FileControl*) GetWindow();
+ if ( pControl )
+ pControl->GetEdit().SetModifyHdl( Link() );
+}
+
+::com::sun::star::uno::Any VCLXFileControl::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
+ SAL_STATIC_CAST( ::com::sun::star::awt::XTextComponent*, this ),
+ SAL_STATIC_CAST( ::com::sun::star::awt::XTextLayoutConstrains*, this ),
+ SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) );
+ return (aRet.hasValue() ? aRet : VCLXWindow::queryInterface( rType ));
+}
+
+// ::com::sun::star::lang::XTypeProvider
+IMPL_XTYPEPROVIDER_START( VCLXFileControl )
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextComponent>* ) NULL ),
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextLayoutConstrains>* ) NULL ),
+ VCLXWindow::getTypes()
+IMPL_XTYPEPROVIDER_END
+
+
+void VCLXFileControl::SetWindow( Window* pWindow )
+{
+ FileControl* pPrevFileControl = (FileControl*) GetWindow();
+ if ( pPrevFileControl )
+ pPrevFileControl->GetEdit().SetModifyHdl( Link() );
+
+ FileControl* pNewFileControl = (FileControl*) pWindow;
+ if ( pNewFileControl )
+ pNewFileControl->GetEdit().SetModifyHdl( LINK( this, VCLXFileControl, ModifyHdl ) );
+
+ VCLXWindow::SetWindow( pWindow );
+}
+
+void VCLXFileControl::addTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException)
+{
+ maTextListeners.addInterface( l );
+}
+
+void VCLXFileControl::removeTextListener( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XTextListener > & l ) throw(::com::sun::star::uno::RuntimeException)
+{
+ maTextListeners.removeInterface( l );
+}
+
+void VCLXFileControl::setText( const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ Window* pWindow = GetWindow();
+ if ( pWindow )
+ {
+ pWindow->SetText( aText );
+
+ // In JAVA wird auch ein textChanged ausgeloest, in VCL nicht.
+ // ::com::sun::star::awt::Toolkit soll JAVA-komform sein...
+ ModifyHdl( NULL );
+ }
+}
+
+void VCLXFileControl::insertText( const ::com::sun::star::awt::Selection& rSel, const ::rtl::OUString& aText ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileControl* pFileControl = (FileControl*) GetWindow();
+ if ( pFileControl )
+ {
+ pFileControl->GetEdit().SetSelection( Selection( rSel.Min, rSel.Max ) );
+ pFileControl->GetEdit().ReplaceSelected( aText );
+ }
+}
+
+::rtl::OUString VCLXFileControl::getText() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::rtl::OUString aText;
+ Window* pWindow = GetWindow();
+ if ( pWindow )
+ aText = pWindow->GetText();
+ return aText;
+}
+
+::rtl::OUString VCLXFileControl::getSelectedText() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::rtl::OUString aText;
+ FileControl* pFileControl = (FileControl*) GetWindow();
+ if ( pFileControl)
+ aText = pFileControl->GetEdit().GetSelected();
+ return aText;
+
+}
+
+void VCLXFileControl::setSelection( const ::com::sun::star::awt::Selection& aSelection ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileControl* pFileControl = (FileControl*) GetWindow();
+ if ( pFileControl )
+ pFileControl->GetEdit().SetSelection( Selection( aSelection.Min, aSelection.Max ) );
+}
+
+::com::sun::star::awt::Selection VCLXFileControl::getSelection() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::awt::Selection aSel;
+ FileControl* pFileControl = (FileControl*) GetWindow();
+ if ( pFileControl )
+ {
+ aSel.Min = pFileControl->GetEdit().GetSelection().Min();
+ aSel.Max = pFileControl->GetEdit().GetSelection().Max();
+ }
+ return aSel;
+}
+
+sal_Bool VCLXFileControl::isEditable() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileControl* pFileControl = (FileControl*) GetWindow();
+ return ( pFileControl && !pFileControl->GetEdit().IsReadOnly() && pFileControl->GetEdit().IsEnabled() ) ? sal_True : sal_False;
+}
+
+void VCLXFileControl::setEditable( sal_Bool bEditable ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileControl* pFileControl = (FileControl*) GetWindow();
+ if ( pFileControl )
+ pFileControl->GetEdit().SetReadOnly( !bEditable );
+}
+
+void VCLXFileControl::setMaxTextLen( sal_Int16 nLen ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileControl* pFileControl = (FileControl*) GetWindow();
+ if ( pFileControl )
+ pFileControl->GetEdit().SetMaxTextLen( nLen );
+}
+
+sal_Int16 VCLXFileControl::getMaxTextLen() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FileControl* pFileControl = (FileControl*) GetWindow();
+ return pFileControl ? pFileControl->GetEdit().GetMaxTextLen() : 0;
+}
+
+
+IMPL_LINK( VCLXFileControl, ModifyHdl, Edit*, EMPTYARG )
+{
+ ::com::sun::star::awt::TextEvent aEvent;
+ aEvent.Source = (::cppu::OWeakObject*)this;
+ maTextListeners.textChanged( aEvent );
+
+ return 1;
+}
+
+::com::sun::star::awt::Size VCLXFileControl::getMinimumSize() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::awt::Size aSz;
+ FileControl* pControl = (FileControl*) GetWindow();
+ if ( pControl )
+ {
+ Size aTmpSize = pControl->GetEdit().CalcMinimumSize();
+ aTmpSize.Width() += pControl->GetButton().CalcMinimumSize().Width();
+ aSz = AWTSize(pControl->CalcWindowSize( aTmpSize ));
+ }
+ return aSz;
+}
+
+::com::sun::star::awt::Size VCLXFileControl::getPreferredSize() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::awt::Size aSz = getMinimumSize();
+ aSz.Height += 4;
+ return aSz;
+}
+
+::com::sun::star::awt::Size VCLXFileControl::calcAdjustedSize( const ::com::sun::star::awt::Size& rNewSize ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::awt::Size aSz =rNewSize;
+ FileControl* pControl = (FileControl*) GetWindow();
+ if ( pControl )
+ {
+ ::com::sun::star::awt::Size aMinSz = getMinimumSize();
+ if ( aSz.Height != aMinSz.Height )
+ aSz.Height = aMinSz.Height;
+ }
+ return aSz;
+}
+
+::com::sun::star::awt::Size VCLXFileControl::getMinimumSize( sal_Int16 nCols, sal_Int16 nLines ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::awt::Size aSz;
+ FileControl* pControl = (FileControl*) GetWindow();
+ if ( pControl )
+ {
+ aSz = AWTSize(pControl->GetEdit().CalcSize( nCols ));
+ aSz.Width += pControl->GetButton().CalcMinimumSize().Width();
+ }
+ return aSz;
+}
+
+void VCLXFileControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ nCols = 0;
+ nLines = 1;
+ FileControl* pControl = (FileControl*) GetWindow();
+ if ( pControl )
+ nCols = (sal_Int16) pControl->GetEdit().GetMaxVisChars();
+}
+
+// ----------------------------------------------------
+// class SVTXFormattedField
+// ----------------------------------------------------
+// --------------------------------------------------------------------------------------
+SVTXFormattedField::SVTXFormattedField()
+ :m_pCurrentSupplier(NULL)
+ ,bIsStandardSupplier(sal_True)
+ ,nKeyToSetDelayed(-1)
+{
+}
+
+// --------------------------------------------------------------------------------------
+SVTXFormattedField::~SVTXFormattedField()
+{
+ if (m_pCurrentSupplier)
+ {
+ m_pCurrentSupplier->release();
+ m_pCurrentSupplier = NULL;
+ }
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ {
+ sal_uInt16 nPropType = GetPropertyId( PropertyName );
+ switch (nPropType)
+ {
+ case BASEPROPERTY_EFFECTIVE_MIN:
+ case BASEPROPERTY_VALUEMIN_DOUBLE:
+ SetMinValue(Value);
+ break;
+
+ case BASEPROPERTY_EFFECTIVE_MAX:
+ case BASEPROPERTY_VALUEMAX_DOUBLE:
+ SetMaxValue(Value);
+ break;
+
+ case BASEPROPERTY_EFFECTIVE_DEFAULT:
+ SetDefaultValue(Value);
+ break;
+
+ case BASEPROPERTY_TREATASNUMBER:
+ sal_Bool b;
+ if ( Value >>= b )
+ SetTreatAsNumber(b);
+ break;
+
+ case BASEPROPERTY_FORMATSSUPPLIER:
+ if (!Value.hasValue())
+ setFormatsSupplier(::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > (NULL));
+ else
+ {
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > xNFS;
+ if ( Value >>= xNFS )
+ setFormatsSupplier(xNFS);
+ }
+ break;
+ case BASEPROPERTY_FORMATKEY:
+ if (!Value.hasValue())
+ setFormatKey(0);
+ else
+ {
+ sal_Int32 n;
+ if ( Value >>= n )
+ setFormatKey(n);
+ }
+ break;
+
+ case BASEPROPERTY_EFFECTIVE_VALUE:
+ case BASEPROPERTY_VALUE_DOUBLE:
+ {
+ const ::com::sun::star::uno::TypeClass rTC = Value.getValueType().getTypeClass();
+ if ((rTC != ::com::sun::star::uno::TypeClass_VOID) && (rTC != ::com::sun::star::uno::TypeClass_STRING) && (rTC != ::com::sun::star::uno::TypeClass_DOUBLE))
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ SetValue(Value);
+ }
+ break;
+ case BASEPROPERTY_VALUESTEP_DOUBLE:
+ {
+ sal_Int32 n;
+ if ( Value >>= n )
+ pField->SetSpinSize( n );
+ }
+ break;
+ case BASEPROPERTY_DECIMALACCURACY:
+ {
+ sal_Int32 n;
+ if ( Value >>= n )
+ pField->SetDecimalDigits( n );
+ }
+ break;
+ case BASEPROPERTY_NUMSHOWTHOUSANDSEP:
+ {
+ sal_Bool b;
+ if ( Value >>= b )
+ pField->SetThousandsSep( b );
+ }
+ break;
+
+ default:
+ VCLXSpinField::setProperty( PropertyName, Value );
+ }
+ }
+}
+
+// --------------------------------------------------------------------------------------
+::com::sun::star::uno::Any SVTXFormattedField::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::uno::Any aReturn;
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ {
+ sal_uInt16 nPropType = GetPropertyId( PropertyName );
+ switch (nPropType)
+ {
+ case BASEPROPERTY_EFFECTIVE_MIN:
+ case BASEPROPERTY_VALUEMIN_DOUBLE:
+ aReturn <<= GetMinValue();
+ break;
+
+ case BASEPROPERTY_EFFECTIVE_MAX:
+ case BASEPROPERTY_VALUEMAX_DOUBLE:
+ aReturn <<= GetMaxValue();
+ break;
+
+ case BASEPROPERTY_EFFECTIVE_DEFAULT:
+ aReturn <<= GetDefaultValue();
+ break;
+
+ case BASEPROPERTY_TREATASNUMBER:
+ aReturn <<= GetTreatAsNumber();
+ break;
+
+ case BASEPROPERTY_EFFECTIVE_VALUE:
+ case BASEPROPERTY_VALUE_DOUBLE:
+ aReturn <<= GetValue();
+ break;
+
+ case BASEPROPERTY_VALUESTEP_DOUBLE:
+ aReturn <<= pField->GetSpinSize();
+ break;
+
+ case BASEPROPERTY_DECIMALACCURACY:
+ aReturn <<= pField->GetDecimalDigits();
+ break;
+
+ case BASEPROPERTY_FORMATSSUPPLIER:
+ {
+ if (!bIsStandardSupplier)
+ { // ansonsten void
+ ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > xSupplier = getFormatsSupplier();
+ aReturn <<= xSupplier;
+ }
+ }
+ break;
+
+ case BASEPROPERTY_FORMATKEY:
+ {
+ if (!bIsStandardSupplier)
+ aReturn <<= getFormatKey();
+ }
+ break;
+
+ default:
+ aReturn <<= VCLXSpinField::getProperty(PropertyName);
+ }
+ }
+ return aReturn;
+}
+
+// --------------------------------------------------------------------------------------
+::com::sun::star::uno::Any SVTXFormattedField::convertEffectiveValue(const ::com::sun::star::uno::Any& rValue)
+{
+ ::com::sun::star::uno::Any aReturn;
+
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField)
+ return aReturn;
+
+ switch (rValue.getValueType().getTypeClass())
+ {
+ case ::com::sun::star::uno::TypeClass_DOUBLE:
+ if (pField->TreatingAsNumber())
+ {
+ double d;
+ rValue >>= d;
+ aReturn <<= d;
+ }
+ else
+ {
+ SvNumberFormatter* pFormatter = pField->GetFormatter();
+ if (!pFormatter)
+ pFormatter = pField->StandardFormatter();
+ // should never fail
+
+ Color* pDummy;
+ double d;
+ rValue >>= d;
+ String sConverted;
+ pFormatter->GetOutputString(d, 0, sConverted, &pDummy);
+ aReturn <<= ::rtl::OUString( sConverted );
+ }
+ break;
+ case ::com::sun::star::uno::TypeClass_STRING:
+ {
+ ::rtl::OUString aStr;
+ rValue >>= aStr;
+ String sValue = aStr;
+ if (pField->TreatingAsNumber())
+ {
+ SvNumberFormatter* pFormatter = pField->GetFormatter();
+ if (!pFormatter)
+ pFormatter = pField->StandardFormatter();
+
+ double dVal;
+ sal_uInt32 nTestFormat(0);
+ if (!pFormatter->IsNumberFormat(sValue, nTestFormat, dVal))
+ aReturn.clear();
+ aReturn <<=dVal;
+ }
+ else
+ aReturn <<= aStr;
+ }
+ break;
+ default:
+ aReturn.clear();
+ break;
+ }
+ return aReturn;
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::SetMinValue(const ::com::sun::star::uno::Any& rValue)
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField)
+ return;
+
+ switch (rValue.getValueType().getTypeClass())
+
+ {
+ case ::com::sun::star::uno::TypeClass_DOUBLE:
+ double d;
+ rValue >>= d;
+ pField->SetMinValue(d);
+ break;
+ default:
+ DBG_ASSERT(rValue.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_VOID, "SVTXFormattedField::SetMinValue : invalid argument (an exception will be thrown) !");
+ if ( rValue.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID )
+
+ {
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ }
+ pField->ClearMinValue();
+ break;
+ }
+}
+
+// --------------------------------------------------------------------------------------
+::com::sun::star::uno::Any SVTXFormattedField::GetMinValue()
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField || !pField->HasMinValue())
+ return ::com::sun::star::uno::Any();
+
+ ::com::sun::star::uno::Any aReturn;
+ aReturn <<= pField->GetMinValue();
+ return aReturn;
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::SetMaxValue(const ::com::sun::star::uno::Any& rValue)
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField)
+ return;
+
+ switch (rValue.getValueType().getTypeClass())
+
+ {
+ case ::com::sun::star::uno::TypeClass_DOUBLE:
+ double d;
+ rValue >>= d;
+ pField->SetMaxValue(d);
+ break;
+ default:
+ if (rValue.getValueType().getTypeClass() != ::com::sun::star::uno::TypeClass_VOID)
+
+ {
+ throw ::com::sun::star::lang::IllegalArgumentException();
+ }
+ pField->ClearMaxValue();
+ break;
+ }
+}
+
+// --------------------------------------------------------------------------------------
+::com::sun::star::uno::Any SVTXFormattedField::GetMaxValue()
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField || !pField->HasMaxValue())
+ return ::com::sun::star::uno::Any();
+
+ ::com::sun::star::uno::Any aReturn;
+ aReturn <<= pField->GetMaxValue();
+ return aReturn;
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::SetDefaultValue(const ::com::sun::star::uno::Any& rValue)
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField)
+ return;
+
+ ::com::sun::star::uno::Any aConverted = convertEffectiveValue(rValue);
+
+ switch (aConverted.getValueType().getTypeClass())
+
+ {
+ case ::com::sun::star::uno::TypeClass_DOUBLE:
+ {
+ double d;
+ aConverted >>= d;
+ pField->SetDefaultValue(d);
+ }
+ break;
+ case ::com::sun::star::uno::TypeClass_STRING:
+ {
+ ::rtl::OUString aStr;
+ aConverted >>= aStr;
+ pField->SetDefaultText( aStr );
+ }
+ break;
+ default:
+ pField->EnableEmptyField(sal_True);
+ // nur noch void erlaubt
+ break;
+ }
+}
+
+// --------------------------------------------------------------------------------------
+::com::sun::star::uno::Any SVTXFormattedField::GetDefaultValue()
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField || pField->IsEmptyFieldEnabled())
+ return ::com::sun::star::uno::Any();
+
+ ::com::sun::star::uno::Any aReturn;
+ if (pField->TreatingAsNumber())
+ aReturn <<= pField->GetDefaultValue();
+ else
+ aReturn <<= ::rtl::OUString( pField->GetDefaultText() );
+ return aReturn;
+}
+
+// --------------------------------------------------------------------------------------
+sal_Bool SVTXFormattedField::GetTreatAsNumber()
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (pField)
+ return pField->TreatingAsNumber();
+
+ return sal_True;
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::SetTreatAsNumber(sal_Bool bSet)
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (pField)
+ pField->TreatAsNumber(bSet);
+}
+
+// --------------------------------------------------------------------------------------
+::com::sun::star::uno::Any SVTXFormattedField::GetValue()
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField)
+ return ::com::sun::star::uno::Any();
+
+ ::com::sun::star::uno::Any aReturn;
+ if (!pField->TreatingAsNumber())
+ {
+ ::rtl::OUString sText = pField->GetTextValue();
+ aReturn <<= sText;
+ }
+ else
+ {
+ if (pField->GetText().Len()) // empty wird erst mal standardmaessig als void nach draussen gereicht
+ aReturn <<= pField->GetValue();
+ }
+
+ return aReturn;
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::SetValue(const ::com::sun::star::uno::Any& rValue)
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (!pField)
+ return;
+
+ if (!rValue.hasValue())
+ {
+ pField->SetText(String());
+ }
+ else
+ {
+ if (rValue.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_DOUBLE )
+ {
+ double d;
+ rValue >>= d;
+ pField->SetValue(d);
+ }
+ else
+ {
+ DBG_ASSERT(rValue.getValueType().getTypeClass() == ::com::sun::star::uno::TypeClass_STRING, "SVTXFormattedField::SetValue : invalid argument !");
+
+ ::rtl::OUString sText;
+ rValue >>= sText;
+ String aStr( sText );
+ if (!pField->TreatingAsNumber())
+ pField->SetTextFormatted(aStr);
+ else
+ pField->SetTextValue(aStr);
+ }
+ }
+// NotifyTextListeners();
+}
+
+// --------------------------------------------------------------------------------------
+::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > SVTXFormattedField::getFormatsSupplier(void) const
+{
+ return ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > ((::com::sun::star::util::XNumberFormatsSupplier*)m_pCurrentSupplier);
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::setFormatsSupplier(const ::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatsSupplier > & xSupplier)
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+
+ SvNumberFormatsSupplierObj* pNew = NULL;
+ if (!xSupplier.is())
+ {
+ if (pField)
+ {
+ pNew = new SvNumberFormatsSupplierObj(pField->StandardFormatter());
+ bIsStandardSupplier = sal_True;
+ }
+ }
+ else
+ {
+ pNew = SvNumberFormatsSupplierObj::getImplementation(xSupplier);
+ bIsStandardSupplier = sal_False;
+ }
+
+ if (!pNew)
+ return; // TODO : wie das behandeln ?
+
+ if (m_pCurrentSupplier)
+ m_pCurrentSupplier->release();
+ m_pCurrentSupplier = pNew;
+ m_pCurrentSupplier->acquire();
+
+ if (pField)
+ {
+ // den aktuellen Value mit hinueberretten
+ ::com::sun::star::uno::Any aCurrent = GetValue();
+ pField->SetFormatter(m_pCurrentSupplier->GetNumberFormatter(), sal_False);
+ if (nKeyToSetDelayed != -1)
+ {
+ pField->SetFormatKey(nKeyToSetDelayed);
+ nKeyToSetDelayed = -1;
+ }
+ SetValue(aCurrent);
+ NotifyTextListeners();
+ }
+}
+
+// --------------------------------------------------------------------------------------
+sal_Int32 SVTXFormattedField::getFormatKey(void) const
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ return pField ? pField->GetFormatKey() : 0;
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::setFormatKey(sal_Int32 nKey)
+{
+ FormattedField* pField = (FormattedField*)GetWindow();
+ if (pField)
+ {
+ if (pField->GetFormatter())
+ pField->SetFormatKey(nKey);
+ else
+ { // Wahrscheinlich bin ich gerade in einem Block, in dem erst der Key und dann der Formatter gesetzt
+ // wird, das passiert initial mit ziemlicher Sicherheit, da die Properties in alphabetischer Reihenfolge
+ // gesetzt werden, und der FormatsSupplier nun mal vor dem FormatKey kommt
+ nKeyToSetDelayed = nKey;
+ }
+ NotifyTextListeners();
+ }
+}
+
+// --------------------------------------------------------------------------------------
+void SVTXFormattedField::NotifyTextListeners()
+{
+ if ( GetTextListeners().getLength() )
+ {
+ ::com::sun::star::awt::TextEvent aEvent;
+ aEvent.Source = (::cppu::OWeakObject*)this;
+ GetTextListeners().textChanged( aEvent );
+ }
+}
+
+ // ----------------------------------------------------
+// class SVTXNumericField
+// ----------------------------------------------------
+SVTXNumericField::SVTXNumericField()
+{
+}
+
+SVTXNumericField::~SVTXNumericField()
+{
+}
+
+::com::sun::star::uno::Any SVTXNumericField::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
+ SAL_STATIC_CAST( ::com::sun::star::awt::XNumericField*, this ),
+ SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) );
+ return (aRet.hasValue() ? aRet : SVTXFormattedField::queryInterface( rType ));
+}
+
+// ::com::sun::star::lang::XTypeProvider
+IMPL_XTYPEPROVIDER_START( SVTXNumericField )
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XNumericField>* ) NULL ),
+ SVTXFormattedField::getTypes()
+IMPL_XTYPEPROVIDER_END
+
+
+void SVTXNumericField::setValue( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetValue( Value );
+}
+
+double SVTXNumericField::getValue() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetValue() : 0;
+}
+
+void SVTXNumericField::setMin( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetMinValue( Value );
+}
+
+double SVTXNumericField::getMin() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetMinValue() : 0;
+}
+
+void SVTXNumericField::setMax( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetMaxValue( Value );
+}
+
+double SVTXNumericField::getMax() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetMaxValue() : 0;
+}
+
+void SVTXNumericField::setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetSpinFirst( Value );
+}
+
+double SVTXNumericField::getFirst() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetSpinFirst() : 0;
+}
+
+void SVTXNumericField::setLast( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetSpinLast( Value );
+}
+
+double SVTXNumericField::getLast() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetSpinLast() : 0;
+}
+
+void SVTXNumericField::setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetSpinSize( Value );
+}
+
+double SVTXNumericField::getSpinSize() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetSpinSize() : 0;
+}
+
+void SVTXNumericField::setDecimalDigits( sal_Int16 Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetDecimalDigits( Value );
+}
+
+sal_Int16 SVTXNumericField::getDecimalDigits() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetDecimalDigits() : 0;
+}
+
+void SVTXNumericField::setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetStrictFormat( bStrict );
+}
+
+sal_Bool SVTXNumericField::isStrictFormat() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->IsStrictFormat() : sal_False;
+}
+
+
+ // ----------------------------------------------------
+// class SVTXCurrencyField
+// ----------------------------------------------------
+SVTXCurrencyField::SVTXCurrencyField()
+{
+}
+
+SVTXCurrencyField::~SVTXCurrencyField()
+{
+}
+
+::com::sun::star::uno::Any SVTXCurrencyField::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::com::sun::star::uno::Any aRet = ::cppu::queryInterface( rType,
+ SAL_STATIC_CAST( ::com::sun::star::awt::XCurrencyField*, this ),
+ SAL_STATIC_CAST( ::com::sun::star::lang::XTypeProvider*, this ) );
+ return (aRet.hasValue() ? aRet : SVTXFormattedField::queryInterface( rType ));
+}
+
+// ::com::sun::star::lang::XTypeProvider
+IMPL_XTYPEPROVIDER_START( SVTXCurrencyField )
+ getCppuType( ( ::com::sun::star::uno::Reference< ::com::sun::star::awt::XCurrencyField>* ) NULL ),
+ SVTXFormattedField::getTypes()
+IMPL_XTYPEPROVIDER_END
+
+void SVTXCurrencyField::setValue( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetValue( Value );
+}
+
+double SVTXCurrencyField::getValue() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetValue() : 0;
+}
+
+void SVTXCurrencyField::setMin( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetMinValue( Value );
+}
+
+double SVTXCurrencyField::getMin() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetMinValue() : 0;
+}
+
+void SVTXCurrencyField::setMax( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetMaxValue( Value );
+}
+
+double SVTXCurrencyField::getMax() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetMaxValue() : 0;
+}
+
+void SVTXCurrencyField::setFirst( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetSpinFirst( Value );
+}
+
+double SVTXCurrencyField::getFirst() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetSpinFirst() : 0;
+}
+
+void SVTXCurrencyField::setLast( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetSpinLast( Value );
+}
+
+double SVTXCurrencyField::getLast() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetSpinLast() : 0;
+}
+
+void SVTXCurrencyField::setSpinSize( double Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetSpinSize( Value );
+}
+
+double SVTXCurrencyField::getSpinSize() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetSpinSize() : 0;
+}
+
+void SVTXCurrencyField::setDecimalDigits( sal_Int16 Value ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetDecimalDigits( Value );
+}
+
+sal_Int16 SVTXCurrencyField::getDecimalDigits() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->GetDecimalDigits() : 0;
+}
+
+void SVTXCurrencyField::setStrictFormat( sal_Bool bStrict ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ if ( pField )
+ pField->SetStrictFormat( bStrict );
+}
+
+sal_Bool SVTXCurrencyField::isStrictFormat() throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ FormattedField* pField = GetFormattedField();
+ return pField ? pField->IsStrictFormat() : sal_False;
+}
+
+void SVTXCurrencyField::setProperty( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Any& Value) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::uno::Any aReturn;
+
+ DoubleCurrencyField* pField = (DoubleCurrencyField*)GetFormattedField();
+ if ( pField )
+ {
+#ifdef DBG_UTIL
+ String sAssertion( String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "SVTXCurrencyField::setProperty(" ) ) );
+ sAssertion += String( PropertyName );
+ sAssertion.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ") : invalid value !" ) );
+#endif
+ sal_uInt16 nPropType = GetPropertyId( PropertyName );
+ switch (nPropType)
+ {
+ case BASEPROPERTY_CURRENCYSYMBOL:
+ {
+ ::rtl::OUString aStr;
+ Value >>= aStr;
+ pField->setCurrencySymbol( aStr );
+ }
+ break;
+ case BASEPROPERTY_CURSYM_POSITION:
+ {
+ sal_Bool b;
+ Value >>= b;
+ pField->setPrependCurrSym(b);
+ }
+ break;
+
+ default:
+ SVTXFormattedField::setProperty(PropertyName, Value);
+ }
+ }
+ else
+ SVTXFormattedField::setProperty(PropertyName, Value);
+}
+
+::com::sun::star::uno::Any SVTXCurrencyField::getProperty( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::uno::RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ ::com::sun::star::uno::Any aReturn;
+
+ DoubleCurrencyField* pField = (DoubleCurrencyField*)GetFormattedField();
+ if ( pField )
+ {
+ sal_uInt16 nPropType = GetPropertyId( PropertyName );
+ switch (nPropType)
+ {
+ case BASEPROPERTY_CURRENCYSYMBOL:
+ {
+ aReturn <<= ::rtl::OUString( pField->getCurrencySymbol() );
+ }
+ break;
+ case BASEPROPERTY_CURSYM_POSITION:
+ {
+ aReturn <<= pField->getPrependCurrSym();
+ }
+ break;
+ default:
+ return SVTXFormattedField::getProperty(PropertyName);
+ }
+ }
+ return SVTXFormattedField::getProperty(PropertyName);
+}
+
diff --git a/svtools/source/urlobj/inetimg.cxx b/svtools/source/urlobj/inetimg.cxx
new file mode 100644
index 000000000000..a19cac29c1da
--- /dev/null
+++ b/svtools/source/urlobj/inetimg.cxx
@@ -0,0 +1,236 @@
+/*************************************************************************
+ *
+ * $RCSfile: inetimg.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _TOOLS_DEBUG_HXX
+#include <tools/debug.hxx>
+#endif
+#ifndef _SOT_DTRANS_HXX
+#include <sot/dtrans.hxx>
+#endif
+#ifndef _SOT_EXCHANGE_HXX
+#include <sot/exchange.hxx>
+#endif
+#ifndef _SOT_FORMATS_HXX
+#include <sot/formats.hxx>
+#endif
+
+#pragma hdrstop
+
+#include "inetimg.hxx"
+
+// Die folgende Struktur wurde den Netscape-Sourcen entnommen:
+// netscape/source/ns/cmd/winfe/feimages.cpp
+struct ImageData_Impl {
+ int iSize; // size of all data, including variable length strings
+ BOOL bIsMap; // For server side maps
+ INT32 iWidth; // Fixed size data correspond to fields in LO_ImageDataStruct
+ INT32 iHeight; // and EDT_ImageData
+ INT32 iHSpace;
+ INT32 iVSpace;
+ INT32 iBorder;
+ int iLowResOffset; // Offsets into string_data. If 0, string is NULL (not used)
+ int iAltOffset; // (alternate text?)
+ int iAnchorOffset; // HREF in image
+ int iExtraHTML_Offset; // Extra HTML (stored in CImageElement)
+ sal_Char pImageURL[1]; // Append all variable-length strings starting here
+};
+
+#define TOKEN_SEPARATOR '\001'
+//=======================================================================
+
+String INetImage::CopyExchange() const
+{
+ String aString;
+ aString += aImageURL;
+ aString += TOKEN_SEPARATOR;
+ aString += aTargetURL;
+ aString += TOKEN_SEPARATOR;
+ aString += aTargetFrame;
+ aString += TOKEN_SEPARATOR;
+ aString += aAlternateText;
+ aString += TOKEN_SEPARATOR;
+ aString += String::CreateFromInt32( aSizePixel.Width() );
+ aString += TOKEN_SEPARATOR;
+ aString += String::CreateFromInt32( aSizePixel.Height() );
+ return aString;
+}
+
+//-----------------------------------------------------------------------
+
+void INetImage::PasteExchange( String aString )
+{
+ USHORT nStart = 0;
+ aImageURL = aString.GetToken( 0, TOKEN_SEPARATOR, nStart );
+ aTargetURL = aString.GetToken( 0, TOKEN_SEPARATOR, nStart );
+ aTargetFrame = aString.GetToken( 0, TOKEN_SEPARATOR, nStart );
+ aAlternateText = aString.GetToken( 0, TOKEN_SEPARATOR, nStart );
+ aSizePixel.Width() = aString.GetToken( 0, TOKEN_SEPARATOR, nStart ).ToInt32();
+ aSizePixel.Height() = aString.GetToken( 0, TOKEN_SEPARATOR, nStart ).ToInt32();
+}
+
+//-----------------------------------------------------------------------
+
+ULONG INetImage::HasFormat( SotDataObject& rObj )
+{
+ ULONG nFmt;
+ const SvDataTypeList& rTypeLst = rObj.GetTypeList();
+ if( !rTypeLst.Get( nFmt = SOT_FORMATSTR_ID_INET_IMAGE ) &&
+ !rTypeLst.Get( nFmt = SOT_FORMATSTR_ID_NETSCAPE_IMAGE ))
+ nFmt = 0;
+ return nFmt;
+}
+
+//-----------------------------------------------------------------------
+
+BOOL INetImage::SetData( SvData& rData ) const
+
+/* [Beschreibung]
+
+ Liefert TRUE, falls in dem SvDataObject ein entsp. Image-Format
+ steht, das wir unterstuetzen. Wenn ja, werden unsere Daten ins
+ Data-Object kopiert.
+*/
+{
+ BOOL bOK = FALSE;
+ const ULONG lFormat = rData.GetFormat();
+
+ if( lFormat == SOT_FORMATSTR_ID_INET_IMAGE )
+ {
+ rData.SetData( CopyExchange() );
+ bOK = TRUE;
+ }
+ else if( lFormat == SOT_FORMATSTR_ID_NETSCAPE_IMAGE )
+ {
+ // Netscape koennen wir nicht exportieren
+ }
+ return bOK;
+}
+
+//-----------------------------------------------------------------------
+
+BOOL INetImage::Copy( SotDataMemberObject& rObj ) const
+
+/* [Beschreibung]
+ Anmerkung: Das Netscape-Image-Format koennen wir nicht exportieren
+*/
+{
+ SvData* pData = new SvData( SOT_FORMATSTR_ID_INET_IMAGE, MEDIUM_MEMORY );
+ ((INetImage*)this)->SetData( *pData );
+ rObj.Append( pData );
+ return TRUE;
+}
+
+//-----------------------------------------------------------------------
+
+BOOL INetImage::Paste( SotDataObject& rObj, ULONG nFormat )
+
+/* [Beschreibung]
+
+ Diese Methode "uberschreibt den Wert dieser Instanz mit dem
+ Inhalt des uebergebenen Datenobjects.
+ nFormat: Typischerweise das Ergebnis von HasFormat
+*/
+
+{
+ BOOL bRet = FALSE;
+
+ SvData aData( nFormat, MEDIUM_ALL );
+ if( rObj.GetData( &aData ) )
+ {
+ void *pData;
+ aData.GetData( &pData, TRANSFER_REFERENCE );
+ UINT32 nLen = aData.GetMinMemorySize();
+ rtl_TextEncoding eSysCSet = gsl_getSystemTextEncoding();
+
+ if( nFormat == SOT_FORMATSTR_ID_INET_IMAGE )
+ {
+ PasteExchange( String( (sal_Char*)pData, eSysCSet ) );
+ bRet = TRUE;
+ }
+ else if( nFormat == SOT_FORMATSTR_ID_NETSCAPE_IMAGE )
+ {
+ ImageData_Impl* pImgData = (ImageData_Impl*)pData;
+
+ const sal_Char* pStart = (const sal_Char*)pImgData;
+ aImageURL = String( (const sal_Char*)&(pImgData->pImageURL[0]),
+ eSysCSet );
+ if( pImgData->iAltOffset )
+ aAlternateText = String( (pStart + pImgData->iAltOffset), eSysCSet );
+ if( pImgData->iAnchorOffset )
+ aTargetURL = String( (pStart + pImgData->iAnchorOffset), eSysCSet );
+
+ aSizePixel.Width() = pImgData->iWidth;
+ aSizePixel.Height() = pImgData->iHeight;
+ bRet = TRUE;
+ }
+ }
+ return bRet;
+}
+
+BOOL INetImage::CopyFormats( SotDataObject& rObj ) const
+{
+ SvDataTypeList& rTypeList = (SvDataTypeList&)rObj.GetTypeList();
+ rTypeList.Append( SvDataType( SOT_FORMATSTR_ID_INET_IMAGE, MEDIUM_MEMORY ) );
+ // Netscape koennen wir nicht exportieren
+ // rTypeList.Append( SvDataType( SOT_FORMATSTR_ID_NETSCAPE_IMAGE, MEDIUM_MEMORY ) );
+ return TRUE;
+}
+
+
diff --git a/svtools/source/urlobj/makefile.mk b/svtools/source/urlobj/makefile.mk
new file mode 100644
index 000000000000..c31618a976be
--- /dev/null
+++ b/svtools/source/urlobj/makefile.mk
@@ -0,0 +1,89 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:06 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=urlobj
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES = \
+ urlbmk.cxx \
+ inetimg.cxx
+
+
+SLOFILES = \
+ $(SLO)$/urlbmk.obj \
+ $(SLO)$/inetimg.obj
+
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svtools/unx/inc/convert.hxx b/svtools/unx/inc/convert.hxx
new file mode 100644
index 000000000000..812041252935
--- /dev/null
+++ b/svtools/unx/inc/convert.hxx
@@ -0,0 +1,97 @@
+/*************************************************************************
+ *
+ * $RCSfile: convert.hxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _CONVERT_HXX
+#define _CONVERT_HXX
+
+/*
+#define _SWAPSHORT(x) ((((x) & 0xFF00)>>8) | (((x) & 0x00FF)<<8))
+#define _SWAPLONG(x) ((((x) & 0xFF000000)>>24) | (((x) & 0x00FF0000)>>8) | \
+ (((x) & 0x0000FF00)<<8) | (((x) & 0x000000FF)<<24))
+*/
+class Convert
+{
+public:
+ static void Swap( long & nValue )
+ { nValue = SWAPLONG( nValue ); }
+ static void Swap( ULONG & nValue )
+ { nValue = SWAPLONG( nValue ); }
+ static void Swap( short & nValue )
+ { nValue = SWAPSHORT( nValue ); }
+ static void Swap( USHORT & nValue )
+ { nValue = SWAPSHORT( nValue ); }
+ static void Swap( Point & aPtr )
+ { Swap( aPtr.X() ); Swap( aPtr.Y() ); }
+ static void Swap( Size & aSize )
+ { Swap( aSize.Width() ); Swap( aSize.Height() ); }
+ static void Swap( Rectangle & rRect )
+ { Swap( rRect.Top() ); Swap( rRect.Bottom() );
+ Swap( rRect.Left() ); Swap( rRect.Right() ); }
+/*
+ static USHORT AnsiFloatSize() const { return 6; }
+ static float AnsiToFloat( void * pAnsiFloat )
+ { return 0; }
+ static USHORT AnsiDoubleSize() const { return 12; }
+ static double AnsiToDouble( void * pAnsiDouble )
+ { return 0; }
+*/
+};
+
+#endif // _CONVERT_HXX
diff --git a/svtools/unx/source/svdde/ddedummy.cxx b/svtools/unx/source/svdde/ddedummy.cxx
new file mode 100644
index 000000000000..e172cf91e5c0
--- /dev/null
+++ b/svtools/unx/source/svdde/ddedummy.cxx
@@ -0,0 +1,367 @@
+/*************************************************************************
+ *
+ * $RCSfile: ddedummy.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifndef _SVDDE_HXX
+#include <svdde.hxx>
+#endif
+
+static String aString;
+
+DdeData::DdeData()
+{
+}
+
+DdeData::DdeData( const String& )
+{
+}
+
+DdeData::DdeData( const DdeData& )
+{
+}
+
+DdeData::DdeData( const void*, long, ULONG)
+{
+}
+
+DdeData::~DdeData( void )
+{
+}
+
+void DdeData::SetFormat( ULONG )
+{
+}
+
+ULONG DdeData::GetFormat() const
+{
+ return 0L;
+}
+
+DdeData& DdeData::operator = ( const DdeData& rDdeData )
+{
+ return *this;
+}
+
+DdeData::operator long() const
+{
+ return 0L;
+}
+
+DdeData::operator const void*() const
+{
+ return NULL;
+}
+
+long DdeConnection::GetError()
+{
+ return 0L;
+}
+
+DdeConnection::DdeConnection( const String&, const String& )
+{
+}
+
+DdeConnection::~DdeConnection( void )
+{
+}
+
+const String& DdeConnection::GetServiceName()
+{
+ return aString;
+}
+
+const String& DdeConnection::GetTopicName()
+{
+ return aString;
+}
+
+DdeTransaction::DdeTransaction( DdeConnection& rConnection, const String&, long ) :
+ rDde( rConnection )
+{
+}
+
+DdeTransaction::DdeTransaction( const DdeTransaction& rTransaction ) :
+ rDde( rTransaction.rDde )
+{
+}
+
+void DdeTransaction::Execute(void)
+{
+}
+
+void DdeTransaction::Done( BOOL bDataValid )
+{
+}
+
+void DdeTransaction::Data( const DdeData* )
+{
+}
+
+DdeTransaction::~DdeTransaction(void)
+{
+}
+
+DdeRequest::DdeRequest(DdeConnection& rConnection, const String& rString, long lLong ) :
+ DdeTransaction( rConnection, rString, lLong )
+{
+}
+
+DdeExecute::DdeExecute( DdeConnection& rConnection, const String& rString, long lLong ) :
+ DdeTransaction( rConnection, rString, lLong )
+{
+}
+
+DdePoke::DdePoke( DdeConnection& rConnection, const String& rString, const DdeData&, long lLong ) :
+ DdeTransaction( rConnection, rString, lLong )
+{
+}
+
+
+DdeTopic::DdeTopic( const String& )
+{
+}
+
+DdeTopic::~DdeTopic()
+{
+}
+
+void DdeTopic::Connect (long )
+{
+}
+
+void DdeTopic::Disconnect( long )
+{
+}
+
+void DdeTopic::InsertItem( DdeItem* )
+{
+}
+
+DdeItem* DdeTopic::AddItem( const DdeItem& rDdeItem )
+{
+ return (DdeItem*) &rDdeItem;
+}
+
+void DdeTopic::RemoveItem( const DdeItem& )
+{
+}
+
+DdeData* DdeTopic::Get( ULONG )
+{
+ return NULL;
+}
+
+BOOL DdeTopic::MakeItem( const String& )
+{
+ return FALSE;
+}
+
+BOOL DdeTopic::StartAdviseLoop()
+{
+ return FALSE;
+}
+
+BOOL DdeTopic::StopAdviseLoop()
+{
+ return FALSE;
+}
+
+BOOL DdeTopic::Execute( const String* )
+{
+ return FALSE;
+}
+
+BOOL DdeTopic::Put( const DdeData* )
+{
+ return FALSE;
+}
+
+const String& DdeTopic::GetName() const
+{
+ return aString;
+}
+
+DdeService::DdeService( const String& )
+{
+ nStatus = 0;
+}
+
+String DdeService::Topics() {
+ return String();
+}
+
+String DdeService::Formats() {
+ return String();
+}
+
+String DdeService::SysItems() {
+ return String();
+}
+
+String DdeService::Status() {
+ return String();
+}
+
+String DdeService::SysTopicGet(const String& rString) {
+ return rString;
+}
+
+BOOL DdeService::SysTopicExecute(const String*) {
+ return FALSE;
+}
+
+DdeService::~DdeService()
+{
+}
+
+BOOL DdeService::IsBusy()
+{
+ return FALSE;
+}
+
+String DdeService::GetHelp()
+{
+ return aString;
+}
+
+void DdeService::AddFormat( ULONG )
+{
+}
+
+void DdeService::AddTopic( const DdeTopic& )
+{
+}
+
+void DdeService::RemoveTopic( const DdeTopic& )
+{
+}
+
+BOOL DdeService::MakeTopic( const String& )
+{
+ return FALSE;
+}
+
+const String& DdeService::GetName() const
+{
+ return aString;
+}
+
+static DdeServices aDdeServices;
+DdeServices& DdeService::GetServices()
+{
+ return aDdeServices;
+}
+
+DdeItem::DdeItem( const String& )
+{
+}
+
+DdeItem::DdeItem( const DdeItem& )
+{
+}
+
+DdeItem::~DdeItem()
+{
+}
+
+void DdeItem::NotifyClient()
+{
+}
+
+DdeGetPutItem::DdeGetPutItem( const String& rStr ) :
+DdeItem( rStr )
+{
+}
+
+DdeGetPutItem::DdeGetPutItem( const DdeItem& rItem ) :
+DdeItem( rItem )
+{
+}
+
+DdeData* DdeGetPutItem::Get( ULONG )
+{
+ return NULL;
+}
+
+BOOL DdeGetPutItem::Put( const DdeData* )
+{
+ return FALSE;
+}
+
+void DdeGetPutItem::AdviseLoop( BOOL )
+{
+}
+
+DdeLink::DdeLink( DdeConnection& rConnection, const String& rString, long l ) :
+DdeTransaction( rConnection, rString, l )
+{
+}
+
+DdeLink::~DdeLink()
+{
+}
+
+void DdeLink::Notify()
+{
+}
+
+DdeHotLink::DdeHotLink( DdeConnection& rConnection, const String& rString, long l ) :
+DdeLink( rConnection, rString, l )
+{
+}
diff --git a/svtools/unx/source/svdde/makefile.mk b/svtools/unx/source/svdde/makefile.mk
new file mode 100644
index 000000000000..338c0ebc7516
--- /dev/null
+++ b/svtools/unx/source/svdde/makefile.mk
@@ -0,0 +1,85 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=SVTOOLS
+TARGET=svdde
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+CXXFILES = \
+ ddedummy.cxx
+
+SLOFILES = \
+ $(SLO)/ddedummy.obj
+
+# --- Tagets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svtools/util/makefile.mk b/svtools/util/makefile.mk
new file mode 100644
index 000000000000..d89efafca35b
--- /dev/null
+++ b/svtools/util/makefile.mk
@@ -0,0 +1,472 @@
+#*************************************************************************
+#*
+#* $RCSfile: makefile.mk,v $
+#*
+#* $Revision: 1.1.1.1 $
+#*
+#* last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+#*
+#* The Contents of this file are made available subject to the terms of
+#* either of the following licenses
+#*
+#* - GNU Lesser General Public License Version 2.1
+#* - Sun Industry Standards Source License Version 1.1
+#*
+#* Sun Microsystems Inc., October, 2000
+#*
+#* GNU Lesser General Public License Version 2.1
+#* =============================================
+#* Copyright 2000 by Sun Microsystems, Inc.
+#* 901 San Antonio Road, Palo Alto, CA 94303, USA
+#*
+#* This library is free software; you can redistribute it and/or
+#* modify it under the terms of the GNU Lesser General Public
+#* License version 2.1, as published by the Free Software Foundation.
+#*
+#* This library 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 for more details.
+#*
+#* You should have received a copy of the GNU Lesser General Public
+#* License along with this library; if not, write to the Free Software
+#* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+#* MA 02111-1307 USA
+#*
+#*
+#* Sun Industry Standards Source License Version 1.1
+#* =================================================
+#* The contents of this file are subject to the Sun Industry Standards
+#* Source License Version 1.1 (the "License"); You may not use this file
+#* except in compliance with the License. You may obtain a copy of the
+#* License at http://www.openoffice.org/license.html.
+#*
+#* Software provided under this License is provided on an "AS IS" basis,
+#* WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+#* WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+#* MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+#* See the License for the specific provisions governing your rights and
+#* obligations concerning the Software.
+#*
+#* The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#*
+#* Copyright: 2000 by Sun Microsystems, Inc.
+#*
+#* All Rights Reserved.
+#*
+#* Contributor(s): _______________________________________
+#*
+#*
+#*************************************************************************
+
+PRJ=..
+
+PRJNAME=svtools
+TARGET=svtool
+RESTARGET=svt
+RESTARGETSIMPLE=svs
+VERSION=$(UPD)
+GEN_HID=TRUE
+ENABLE_EXCEPTIONS=TRUE
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+USE_LDUMP2=TRUE
+
+.IF "$(COM)"=="ICC"
+LINKFLAGS+=/SEGMENTS:1024 /PACKD:32768
+.ENDIF
+
+# --- Allgemein ----------------------------------------------------
+
+LIB1TARGET= $(LB)$/svmem.lib
+LIB1ARCHIV= $(LB)$/libsvarray.a
+LIB1FILES= $(LB)$/svarray.lib
+
+LIB2TARGET= $(LB)$/filearch.lib
+LIB2OBJFILES= $(OBJ)$/filearch.obj
+
+.IF "$(GUI)"!="UNX"
+LIB3TARGET= $(LB)$/svtool.lib
+LIB3FILES= $(LB)$/_svt.lib
+LIB3OBJFILES=\
+ $(OBJ)$/wordsel2.obj \
+ $(OBJ)$/rtfkey2.obj
+.ENDIF
+
+.IF "$(GUI)"!="UNX"
+LIB4TARGET= $(LB)$/isvl.lib
+LIB4FILES= $(LB)$/_isvl.lib
+LIB4OBJFILES=\
+ $(OBJ)$/htmlkey2.obj
+.ENDIF
+
+LIB7TARGET= $(SLB)$/svt.lib
+#LIB7ARCHIV= $(LB)$/libsvt$(UPD)$(DLLPOSTFIX).a
+LIB7FILES= \
+ $(SLB)$/misc2.lib \
+ $(SLB)$/items2.lib \
+ $(SLB)$/browse.lib \
+ $(SLB)$/config.lib \
+ $(SLB)$/ctrl.lib \
+ $(SLB)$/dialogs.lib \
+ $(SLB)$/edit.lib \
+ $(SLB)$/unoiface.lib \
+ $(SLB)$/filter.lib \
+ $(SLB)$/igif.lib \
+ $(SLB)$/ipng.lib \
+ $(SLB)$/jpeg.lib \
+ $(SLB)$/ixpm.lib \
+ $(SLB)$/ixbm.lib \
+ $(SLB)$/sbx.lib \
+ $(SLB)$/numbers.lib \
+ $(SLB)$/wmf.lib \
+ $(SLB)$/undo.lib \
+ $(SLB)$/urlobj.lib \
+ $(SLB)$/plugapp.lib \
+ $(SLB)$/svcontnr.lib \
+ $(SLB)$/svhtml2.lib
+
+
+.IF "$(GUI)" == "OS2"
+LIB7FILES+= $(SLB)$/eaimp.lib
+.ENDIF
+
+.IF "$(GUI)" == "UNX"
+LIB7FILES+= $(SLB)$/eaimp.lib
+.ENDIF
+
+LIB7FILES+= \
+ $(SLB)$/svdde.lib
+
+LIB8TARGET= $(SLB)$/svl.lib
+#LIB8ARCHIV= $(LB)$/libsvl$(UPD)$(DLLPOSTFIX).a
+LIB8OBJFILES= $(OBJ)$/svtdata.obj
+LIB8FILES= \
+ $(SLB)$/filerec.lib \
+ $(SLB)$/items1.lib \
+ $(SLB)$/libcall.lib \
+ $(SLB)$/misc1.lib \
+ $(SLB)$/notify.lib \
+ $(SLB)$/srch.lib \
+ $(SLB)$/svarray.lib \
+ $(SLB)$/svhtml1.lib \
+ $(SLB)$/svsql.lib \
+ $(SLB)$/svrtf.lib \
+ $(SLB)$/cmdparse.lib
+
+# Bilden der dyn. Resourcen-DLL --------------------------------------------------
+
+RESLIB1NAME= $(RESTARGET)
+RESLIB1SRSFILES=$(SRS)$/filter.srs \
+ $(SRS)$/misc.srs \
+ $(SRS)$/sbx.srs \
+ $(SRS)$/ctrl.srs \
+ $(SRS)$/items.srs \
+ $(SRS)$/dialogs.srs \
+ $(SRS)$/plugapp.srs \
+ $(SRS)$/uno.srs
+RESLIB2NAME= $(RESTARGETSIMPLE)
+RESLIB2SRSFILES=\
+ $(SRS)$/mediatyp.srs \
+ $(SRS)$/svsql.srs
+
+# Bilden der DLL --------------------------------------------------
+
+SHL1TARGET= svt$(VERSION)$(DLLPOSTFIX)
+SHL1IMPLIB= _svt
+SHL1STDLIBS=$(TOOLSLIB) \
+ $(VOSLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(RTLLIB) \
+ $(SVLIB) \
+ $(TKLIB) \
+ $(SVLLIB) \
+ $(SALLIB) \
+ $(UNOTOOLSLIB) \
+ $(UCBHELPERLIB)
+
+
+.IF "$(GUI)"=="WIN"
+SHL1STDLIBS+= \
+ $(LIBPRE) ddeml.lib \
+ $(LIBPRE) shell.lib \
+ $(LIBPRE) ver.lib
+.ENDIF
+
+.IF "$(GUI)"=="WNT"
+SHL1STDLIBS+= \
+ $(LIBCIMT) \
+ $(LIBPRE) advapi32.lib \
+ $(LIBPRE) gdi32.lib
+.ENDIF
+
+.IF "$(VCL)" != ""
+SHL1STDLIBS+= \
+ $(SOTLIB)
+.ENDIF
+
+SHL1STDLIBS += $(JPEG3RDLIB)
+
+#SHL1DEPNU=$(LB)$/isvl.lib
+#SHL1DEPNU=$(SHL2TARGETN)
+SHL1LIBS= \
+ $(SLB)$/svt.lib \
+ $(LB)$/svmem.lib
+
+SHL1DEF= $(MISC)$/$(SHL1TARGET).def
+
+DEF1NAME= $(SHL1TARGET)
+DEF1DEPN= $(MISC)$/$(SHL1TARGET).flt
+DEFLIB1NAME =svt
+DEF1DES =SvTools
+
+.IF "$(GUI)"=="WNT"
+DEF1EXPORT1 = component_writeInfo
+DEF1EXPORT2 = component_getFactory
+.ELSE
+.IF "$(COM)"=="ICC"
+DEF1EXPORT1 = component_writeInfo
+DEF1EXPORT2 = component_getFactory
+.ELSE
+DEF1EXPORT1 = _component_writeInfo
+DEF1EXPORT2 = _component_getFactory
+.ENDIF
+.ENDIF
+
+# --- svtools lite --------------------------------------------------
+
+SHL2TARGET= svl$(VERSION)$(DLLPOSTFIX)
+SHL2IMPLIB= _isvl
+SHL1OBJS=$(SLO)$/svtdata.obj
+SHL2STDLIBS=$(TOOLSLIB) \
+ $(VOSLIB) \
+ $(CPPULIB) \
+ $(CPPUHELPERLIB) \
+ $(RTLLIB) \
+ $(SALLIB) \
+ $(UNOTOOLSLIB)
+
+.IF "$(GUI)"=="WNT"
+SHL2STDLIBS+= \
+ $(LIBCIMT) \
+ $(LIBPRE) advapi32.lib \
+ $(LIBPRE) gdi32.lib
+.ENDIF
+
+SHL2LIBS= $(SLB)$/svl.lib
+
+SHL2DEF= $(MISC)$/$(SHL2TARGET).def
+
+DEF2NAME= $(SHL2TARGET)
+DEF2DEPN= $(MISC)$/$(SHL2TARGET).flt $(SLB)$/svl.lib
+DEFLIB2NAME=svl
+DEF2DES =SvTools lite
+
+# --- Targets ------------------------------------------------------
+
+.IF "$(GUI)"=="UNX"
+SVTTARGETS= $(LB)$/lib$(SHL2TARGET)$(DLLPOST) $(LB)$/lib$(SHL1TARGET)$(DLLPOST)
+.ELSE
+SVTTARGETS= $(LB)$/isvl.lib \
+ $(BIN)$/$(SHL2TARGET)$(DLLPOST) $(BIN)$/$(SHL1TARGET)$(DLLPOST)
+.ENDIF
+
+ALL: $(SLB)$/svl.lib \
+ $(SLB)$/svt.lib \
+ $(MISC)$/$(SHL2TARGET).flt \
+ $(MISC)$/$(SHL1TARGET).flt \
+ $(MISC)$/$(SHL2TARGET).def \
+ $(MISC)$/$(SHL1TARGET).def \
+ $(SVTTARGETS) \
+ ALLTAR
+
+.INCLUDE : target.mk
+
+# --- Svtools-Control-Filter-Datei ---
+
+$(MISC)$/$(SHL1TARGET).flt: makefile.mk
+ @echo ------------------------------
+ @echo Making: $@
+ @echo AUTO_CODE > $@
+ @echo BrowserDataWin >> $@
+ @echo BrowserColumn >> $@
+ @echo ButtonFrame >> $@
+ @echo CreateLoader >> $@
+ @echo DdeString >> $@
+ @echo DlgSource >> $@
+ @echo DlgExport >> $@
+ @echo EditWindow >> $@
+ @echo FileEntry >> $@
+ @echo GIFLZWDecompressor >> $@
+ @echo GIFReader >> $@
+ @echo PNGReader >> $@
+ @echo ImpDetect >> $@
+ @echo ImpDraw >> $@
+ @echo ImpGet >> $@
+ @echo ImpPut >>$@
+ @echo ImpSv >> $@
+ @echo JPEGReader >> $@
+ @echo WMFReader >> $@
+ @echo EnhWMFReader >> $@
+ @echo WMFWriter >> $@
+ @echo LinkStub >> $@
+ @echo MultiTextLineInfo >> $@
+ @echo Regexpr >> $@
+ @echo RemoteControlServer >> $@
+ @echo RemoteControlService >> $@
+ @echo RetStream >> $@
+ @echo SCmdStream >> $@
+ @echo SbxArrayRef >> $@
+ @echo SbxBasicFormater >> $@
+ @echo SbxRes >> $@
+ @echo SbxVariableRef >> $@
+ @echo SfxListUndoAction >> $@
+ @echo SfxPointerEntry >> $@
+ @echo SfxUINT32s >> $@
+ @echo SfxULongRangeItem >> $@
+ @echo SfxULongRanges >> $@
+ @echo SfxULongRangesItem >> $@
+ @echo SgfFontLst >> $@
+ @echo SgfFontOne >> $@
+ @echo StatementCommand >> $@
+ @echo StatementControl >> $@
+ @echo StatementFlow >> $@
+ @echo StatementList >> $@
+ @echo StatementSlot >> $@
+ @echo SVDDE_MISC_CODE >> $@
+ @echo SvInterfaceClient >> $@
+ @echo SvImp >> $@
+ @echo SvStringLockBytes >> $@
+ @echo svtools >> $@
+ @echo SVTOOLS_FILTER >> $@
+ @echo SVTOOLS_CODE >> $@
+ @echo SVTOOLS_FILTER4 >> $@
+ @echo SVTOOLS_FILTER_CODE >> $@
+ @echo ValueSetItem >> $@
+ @echo WMFRecord >> $@
+ @echo WriteRecord >> $@
+ @echo XPMReader >> $@
+ @echo XBMReader >> $@
+ @echo _grow >> $@
+ @echo _ImplINetHistoryLoadTimer >> $@
+ @echo _ImplINetHistoryStoreTimer >> $@
+ @echo sRTF_>>$@
+ @echo sHTML_>>$@
+ @echo unnamed>>$@
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="WIN"
+ @echo WEP>>$@
+ @echo LIBMAIN>>$@
+ @echo LibMain>>$@
+.ENDIF
+.IF "$(COM)"=="MSC"
+ @echo ??_7>>$@
+ @echo ??_8>>$@
+ @echo ??_C>>$@
+ @echo ??_E>>$@
+ @echo ??_F>>$@
+ @echo ??_G>>$@
+ @echo ??_H>>$@
+ @echo ??_I>>$@
+ @echo 0Imp>>$@
+ @echo Impl@@>>$@
+ @echo Imp@@>>$@
+ @echo __CT>>$@
+.ENDIF
+
+$(MISC)$/$(SHL2TARGET).flt: makefile.mk
+ @echo ------------------------------
+ @echo Making: $@
+ @echo AUTO_CODE > $@
+ @echo BrowserDataWin >> $@
+ @echo BrowserColumn >> $@
+ @echo ButtonFrame >> $@
+ @echo CreateLoader >> $@
+ @echo DdeString >> $@
+ @echo DlgSource >> $@
+ @echo DlgExport >> $@
+ @echo EditWindow >> $@
+ @echo FileEntry >> $@
+ @echo GIFLZWDecompressor >> $@
+ @echo GIFReader >> $@
+ @echo PNGReader >> $@
+ @echo ImpDetect >> $@
+ @echo ImpDraw >> $@
+ @echo ImpGet >> $@
+ @echo ImpPut >>$@
+ @echo ImpSvNum >>$@
+ @echo JPEGReader >> $@
+ @echo WMFReader >> $@
+ @echo EnhWMFReader >> $@
+ @echo WMFWriter >> $@
+ @echo LinkStub >> $@
+ @echo MultiTextLineInfo >> $@
+ @echo Regexpr >> $@
+ @echo RemoteControlServer >> $@
+ @echo RemoteControlService >> $@
+ @echo RetStream >> $@
+ @echo SCmdStream >> $@
+ @echo SbxArrayRef >> $@
+ @echo SbxBasicFormater >> $@
+ @echo SbxRes >> $@
+ @echo SbxVariableRef >> $@
+ @echo SfxListUndoAction >> $@
+ @echo SfxPointerEntry >> $@
+ @echo SfxUINT32s >> $@
+ @echo SfxULongRangeItem >> $@
+ @echo SfxULongRanges >> $@
+ @echo SfxULongRangesItem >> $@
+ @echo SgfFontLst >> $@
+ @echo SgfFontOne >> $@
+ @echo StatementCommand >> $@
+ @echo StatementControl >> $@
+ @echo StatementFlow >> $@
+ @echo StatementList >> $@
+ @echo StatementSlot >> $@
+ @echo SVDDE_MISC_CODE >> $@
+ @echo SvInterfaceClient >> $@
+ @echo SvImp >> $@
+ @echo SvStringLockBytes >> $@
+ @echo svtools >> $@
+ @echo SVTOOLS_FILTER >> $@
+ @echo SVTOOLS_CODE >> $@
+ @echo SVTOOLS_FILTER4 >> $@
+ @echo SVTOOLS_FILTER_CODE >> $@
+ @echo ValueSetItem >> $@
+ @echo WMFRecord >> $@
+ @echo WriteRecord >> $@
+ @echo XPMReader >> $@
+ @echo XBMReader >> $@
+ @echo _grow >> $@
+ @echo _ImplINetHistoryLoadTimer >> $@
+ @echo _ImplINetHistoryStoreTimer >> $@
+ @echo sRTF_>>$@
+ @echo sHTML_>>$@
+ @echo SdbSqlScanner>>$@
+ @echo Sdbyy_scan>>$@
+ @echo SqlInternalNode>>$@
+ @echo unnamed>>$@
+.IF "$(GUI)"=="WNT" || "$(GUI)"=="WIN"
+ @echo WEP>>$@
+ @echo LIBMAIN>>$@
+ @echo LibMain>>$@
+.ENDIF
+.IF "$(COM)"=="MSC"
+ @echo ??_7>>$@
+ @echo ??_8>>$@
+ @echo ??_C>>$@
+ @echo ??_E>>$@
+ @echo ??_F>>$@
+ @echo ??_G>>$@
+ @echo ??_H>>$@
+ @echo ??_I>>$@
+ @echo 0Imp>>$@
+ @echo Impl@@>>$@
+ @echo Imp@@>>$@
+ @echo __CT>>$@
+.ENDIF
+
diff --git a/svtools/win/res/makefile.mk b/svtools/win/res/makefile.mk
new file mode 100644
index 000000000000..2e422ce51946
--- /dev/null
+++ b/svtools/win/res/makefile.mk
@@ -0,0 +1,61 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
diff --git a/svtools/workben/browser.cxx b/svtools/workben/browser.cxx
new file mode 100644
index 000000000000..593f13e22ce3
--- /dev/null
+++ b/svtools/workben/browser.cxx
@@ -0,0 +1,882 @@
+/*************************************************************************
+ *
+ * $RCSfile: browser.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#pragma hdrstop
+
+//#undef VCL
+
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+
+#ifndef _SV_SOUND_HXX //autogen
+#include <vcl/sound.hxx>
+#endif
+
+#ifndef _SV_MSGBOX_HXX //autogen
+#include <vcl/msgbox.hxx>
+#endif
+
+#ifndef _SV_FLOATWIN_HXX //autogen
+#include <vcl/floatwin.hxx>
+#endif
+
+#ifndef _SV_MENU_HXX //autogen
+#include <vcl/menu.hxx>
+#endif
+
+#ifndef _SV_WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+
+#ifndef _SV_EDIT_HXX //autogen
+#include <vcl/edit.hxx>
+#endif
+
+#ifndef _SVX_BRWBOX_HXX //autogen
+#include <brwbox.hxx>
+#endif
+
+#ifndef _SV_GROUP_HXX //autogen
+#include <vcl/group.hxx>
+#endif
+
+#ifndef _SV_BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+
+#ifndef _SV_DIALOG_HXX //autogen
+#include <vcl/dialog.hxx>
+#endif
+
+#define MID_BROWSER 10
+#define MID_MODE 11
+#define MID_EVENTVIEW 12
+#define MID_INVALIDATE 13
+#define MID_CLEAR 14
+#define MID_ROW 20
+#define MID_INSERTROW_BEFORE 21
+#define MID_INSERTROW_AT 22
+#define MID_INSERTROW_BEHIND 23
+#define MID_REMOVEROW_BEFORE 24
+#define MID_REMOVEROW_AT 25
+#define MID_REMOVEROW_BEHIND 26
+#define MID_MODIFYROW_BEFORE 27
+#define MID_MODIFYROW_AT 28
+#define MID_MODIFYROW_BEHIND 29
+#define MID_COL 30
+#define MID_INSERTCOL 31
+#define MID_REMOVECOL 32
+#define MID_MOVECOLLEFT 33
+#define MID_MOVECOLRIGHT 34
+#define MID_SELECTIONS 60
+#define MID_SELECTROW 61
+#define MID_SELECTALL 62
+#define MID_SELECTNONE 63
+#define MID_INVERSE 64
+#define MID_EXTRAS 70
+#define MID_STARMONEY_1 71
+
+//==================================================================
+
+class BrowseModeDialog: public ModalDialog
+{
+ RadioButton aSingleSel;
+ RadioButton aMultiSel;
+ GroupBox aSelGroup;
+
+ CheckBox aKeepHighlight;
+ CheckBox aColumnCursor;
+ CheckBox aThumbDragging;
+ GroupBox aOptGroup;
+
+ RadioButton aNoHLines;
+ RadioButton aDottedHLines;
+ RadioButton aFullHLines;
+ GroupBox aHLinGroup;
+
+ RadioButton aNoVLines;
+ RadioButton aDottedVLines;
+ RadioButton aFullVLines;
+ GroupBox aVLinGroup;
+
+ OKButton aOKButton;
+ CancelButton aCancelButton;
+
+public:
+ BrowseModeDialog( Window *pParent );
+
+ void SetMode( BrowserMode eMode );
+ BrowserMode GetMode() const;
+};
+
+//==================================================================
+
+DECLARE_LIST(DataList,long);
+
+class Browser: public BrowseBox
+{
+friend class AppWindow;
+
+ DataList aRows;
+ BOOL bInverse;
+ Edit* pEdit;
+
+protected:
+ virtual long GetRowCount() const;
+ virtual BOOL SeekRow( long nRow );
+ virtual void PaintField( OutputDevice& rDev, const Rectangle& rRect,
+ USHORT nColumnId ) const;
+
+ virtual void Select();
+ virtual void DoubleClick();
+ virtual void CursorMoved();
+ virtual void StartScroll();
+ virtual void EndScroll();
+ virtual void Command( const CommandEvent &eEvt );
+
+ virtual BOOL StartDragging( Pointer& rMovePtr,
+ Pointer& rCopyPtr );
+ virtual void EndDragging( const DropAction &rAction );
+ virtual void MouseButtonDown( const BrowserMouseEvent &rEvt );
+
+public:
+ Browser( AppWindow* pParent, BrowserMode eMode );
+ ~Browser();
+
+ void SetInverseSelection( BOOL bInverseSel )
+ { bInverse = bInverseSel; }
+};
+
+//------------------------------------------------------------------
+
+class AppWindow: public WorkWindow
+{
+ MenuBar aMenu;
+ PopupMenu aBrwMenu, aRowMenu, aColMenu, aSelMenu, aExtMenu;
+ Edit aEdit;
+ Browser aBrowser;
+ BrowserMode eCurMode;
+ FloatingWindow *pEventView;
+ ULONG nNewRowNo;
+
+private:
+ DECL_LINK( Modify, void * );
+ DECL_LINK( MenuSelect, Menu * );
+
+protected:
+ void Resize();
+ void Activate();
+
+public:
+ AppWindow();
+ ~AppWindow();
+
+ void Event( const String &rEvent );
+};
+
+//------------------------------------------------------------------
+
+class App: public Application
+{
+protected:
+#ifdef VCL
+ void Main();
+#else
+ void Main( int, char *[] );
+#endif
+
+public:
+ App();
+ ~App();
+};
+
+//==================================================================
+
+App aApp;
+
+//==================================================================
+
+BrowseModeDialog::BrowseModeDialog( Window *pParent ):
+ ModalDialog( pParent, WinBits( WB_MOVEABLE | WB_CLOSEABLE | WB_SVLOOK ) ),
+
+ aSingleSel( this ),
+ aMultiSel( this ),
+ aSelGroup( this ),
+
+ aKeepHighlight( this ),
+ aColumnCursor( this ),
+ aThumbDragging( this ),
+ aOptGroup( this ),
+
+ aNoHLines( this ),
+ aDottedHLines( this ),
+ aFullHLines( this ),
+ aHLinGroup( this ),
+
+ aNoVLines( this, WinBits( WB_GROUP ) ),
+ aDottedVLines( this ),
+ aFullVLines( this ),
+ aVLinGroup( this ),
+
+ aOKButton( this ),
+ aCancelButton( this )
+{
+ SetOutputSizePixel( Size( 290, 220 ) );
+ SetText( String( "Browse Mode", RTL_TEXTENCODING_IBM_850 ) );
+
+ aSingleSel.SetText( String( "single", RTL_TEXTENCODING_IBM_850 ) );
+ aMultiSel.SetText( String( "multi", RTL_TEXTENCODING_IBM_850 ) );
+ aSelGroup.SetText( String( " Selection ", RTL_TEXTENCODING_IBM_850 ) );
+
+ aKeepHighlight.SetText( String( "keep highlight", RTL_TEXTENCODING_IBM_850 ) );
+ aColumnCursor.SetText( String( "column cursor", RTL_TEXTENCODING_IBM_850 ) );
+ aThumbDragging.SetText( String( "thumb dragging", RTL_TEXTENCODING_IBM_850 ) );
+ aOptGroup.SetText( String( " Options ", RTL_TEXTENCODING_IBM_850 ) );
+
+ aNoHLines.SetText( String( "none", RTL_TEXTENCODING_IBM_850 ) );
+ aDottedHLines.SetText( String( "dotted", RTL_TEXTENCODING_IBM_850 ) );
+ aFullHLines.SetText( String( "full", RTL_TEXTENCODING_IBM_850 ) );
+ aHLinGroup.SetText( String( " Horizontal ", RTL_TEXTENCODING_IBM_850 ) );
+
+ aNoVLines.SetText( String( "none", RTL_TEXTENCODING_IBM_850 ) );
+ aDottedVLines.SetText( String( "dotted", RTL_TEXTENCODING_IBM_850 ) );
+ aFullVLines.SetText( String( "full", RTL_TEXTENCODING_IBM_850 ) );
+ aVLinGroup.SetText( String( " Vertical ", RTL_TEXTENCODING_IBM_850 ) );
+
+ aSingleSel.SetPosSizePixel( Point( 20, 30 ), Size( 80, 14 ) );
+ aMultiSel.SetPosSizePixel( Point( 20, 70 ), Size( 80, 14 ) );
+ aSelGroup.SetPosSizePixel( Point( 10, 10 ), Size( 100, 80 ) );
+ aSelGroup.SetText( String( " Selection ", RTL_TEXTENCODING_IBM_850 ) );
+
+ aKeepHighlight.SetPosSizePixel( Point( 130, 30 ), Size( 140, 14 ) );
+ aColumnCursor.SetPosSizePixel( Point( 130, 50 ), Size( 140, 14 ) );
+ aThumbDragging.SetPosSizePixel( Point( 130, 70 ), Size( 140, 14 ) );
+ aOptGroup.SetPosSizePixel( Point( 120, 10 ), Size( 160, 80 ) );
+ aOptGroup.SetText( String( " Options ", RTL_TEXTENCODING_IBM_850 ) );
+
+ aNoHLines.SetPosSizePixel( Point( 20, 120 ), Size( 80, 14 ) );
+ aDottedHLines.SetPosSizePixel( Point( 20, 140 ), Size( 80, 14 ) );
+ aFullHLines.SetPosSizePixel( Point( 20, 160 ), Size( 80, 14 ) );
+ aHLinGroup.SetPosSizePixel( Point( 10, 100 ), Size( 100, 80 ) );
+ aHLinGroup.SetText( String( " horizontal ", RTL_TEXTENCODING_IBM_850 ) );
+
+ aNoVLines.SetPosSizePixel( Point( 130, 120 ), Size( 80, 14 ) );
+ aDottedVLines.SetPosSizePixel( Point( 130, 140 ), Size( 80, 14 ) );
+ aFullVLines.SetPosSizePixel( Point( 130, 160 ), Size( 80, 14 ) );
+ aVLinGroup.SetPosSizePixel( Point( 120, 100 ), Size( 100, 80 ) );
+ aVLinGroup.SetText( String( " vertical ", RTL_TEXTENCODING_IBM_850 ) );
+
+ aOKButton.SetPosSizePixel( Point( 10, 190 ), Size( 100, 22 ) );
+ aCancelButton.SetPosSizePixel( Point( 120, 190 ), Size( 100, 22 ) );
+
+ aSingleSel.Check();
+ aNoHLines.Check();
+ aNoVLines.Check();
+
+ aSingleSel.Show();
+ aMultiSel.Show();
+ aSelGroup.Show();
+
+ aKeepHighlight.Show();
+ aColumnCursor.Show();
+ aThumbDragging.Show();
+ aOptGroup.Show();
+
+ aNoHLines.Show();
+ aDottedHLines.Show();
+ aFullHLines.Show();
+ aHLinGroup.Show();
+
+ aNoVLines.Show();
+ aDottedVLines.Show();
+ aFullVLines.Show();
+ aVLinGroup.Show();
+
+ aOKButton.Show();
+ aCancelButton.Show();
+}
+
+//------------------------------------------------------------------
+
+void BrowseModeDialog::SetMode( BrowserMode eMode )
+{
+ if ( ( eMode & BROWSER_COLUMNSELECTION ) == BROWSER_COLUMNSELECTION )
+ aColumnCursor.Check();
+ if ( ( eMode & BROWSER_MULTISELECTION ) == BROWSER_MULTISELECTION )
+ aMultiSel.Check();
+ if ( ( eMode & BROWSER_THUMBDRAGGING ) == BROWSER_THUMBDRAGGING )
+ aThumbDragging.Check();
+ if ( ( eMode & BROWSER_KEEPHIGHLIGHT ) == BROWSER_KEEPHIGHLIGHT )
+ aKeepHighlight.Check();
+ if ( ( eMode & BROWSER_HLINESFULL ) == BROWSER_HLINESFULL )
+ aFullHLines.Check();
+ if ( ( eMode & BROWSER_VLINESFULL ) == BROWSER_VLINESFULL )
+ aFullVLines.Check();
+ if ( ( eMode & BROWSER_HLINESDOTS ) == BROWSER_HLINESDOTS )
+ aDottedHLines.Check();
+ if ( ( eMode & BROWSER_VLINESDOTS ) == BROWSER_VLINESDOTS )
+ aDottedVLines.Check();
+}
+
+//------------------------------------------------------------------
+
+BrowserMode BrowseModeDialog::GetMode() const
+{
+ BrowserMode eMode = 0;
+
+ if ( aColumnCursor.IsChecked() )
+ eMode |= BROWSER_COLUMNSELECTION;
+ if ( aMultiSel.IsChecked() )
+ eMode |= BROWSER_MULTISELECTION;
+
+ if ( aKeepHighlight.IsChecked() )
+ eMode |= BROWSER_KEEPHIGHLIGHT;
+ if ( aThumbDragging.IsChecked() )
+ eMode |= BROWSER_THUMBDRAGGING;
+
+ if ( aDottedHLines.IsChecked() )
+ eMode |= BROWSER_HLINESDOTS;
+ if ( aFullHLines.IsChecked() )
+ eMode |= BROWSER_HLINESFULL;
+
+ if ( aDottedVLines.IsChecked() )
+ eMode |= BROWSER_VLINESDOTS;
+ if ( aFullVLines.IsChecked() )
+ eMode |= BROWSER_VLINESFULL;
+
+ return eMode;
+}
+
+//==================================================================
+
+Browser::Browser( AppWindow* pParent, BrowserMode eMode ):
+ BrowseBox( pParent, WinBits(WB_DRAG), eMode ),
+ bInverse(FALSE),
+ pEdit( 0 )
+{
+ for ( long n = 0; n < 100; ++n )
+ aRows.Insert( n, LIST_APPEND );
+
+ //InsertHandleColumn( 30 );
+ InsertDataColumn( 1, String( "eins", RTL_TEXTENCODING_IBM_850 ), 85 ); // FreezeColumn( 1 );
+ InsertDataColumn( 2, String( "zwei", RTL_TEXTENCODING_IBM_850 ), 85 ); // FreezeColumn( 2 );
+ InsertDataColumn( 3, String( "drei", RTL_TEXTENCODING_IBM_850 ), 85 );
+ InsertDataColumn( 4, String( "vier", RTL_TEXTENCODING_IBM_850 ), 85 );
+ InsertDataColumn( 5, String( "fuenf", RTL_TEXTENCODING_IBM_850 ), 85 );
+ InsertDataColumn( 6, String( "sechs", RTL_TEXTENCODING_IBM_850 ), 85 );
+ InsertDataColumn( 7, String( "sieben", RTL_TEXTENCODING_IBM_850 ), 85 );
+ InsertDataColumn( 8, String( "acht", RTL_TEXTENCODING_IBM_850 ), 85 );
+ InsertDataColumn( 9, String( "neun", RTL_TEXTENCODING_IBM_850 ), 85 );
+ InsertDataColumn(10, String( "zehn", RTL_TEXTENCODING_IBM_850 ), 85 );
+}
+
+//------------------------------------------------------------------
+
+Browser::~Browser()
+{
+ delete pEdit;
+}
+
+//------------------------------------------------------------------
+
+BOOL Browser::StartDragging( Pointer& rMovePtr, Pointer& rCopyPtr )
+{
+ rMovePtr = Pointer( POINTER_MOVEDATA );
+ rCopyPtr = Pointer( POINTER_COPYDATA );
+ return TRUE;
+}
+
+//------------------------------------------------------------------
+
+void Browser::MouseButtonDown( const BrowserMouseEvent &rEvt )
+{
+ if ( 3 == rEvt.GetClicks() )
+ InfoBox( 0, String( GetColumnAtXPosPixel(rEvt.GetPosPixel().X() ) ) ).Execute();
+ else
+ BrowseBox::MouseButtonDown( rEvt );
+}
+
+//------------------------------------------------------------------
+
+void Browser::EndDragging( const DropAction &rAction )
+{
+}
+
+//------------------------------------------------------------------
+
+void Browser::StartScroll()
+{
+ ( (AppWindow*) GetParent() )->Event( String( "StartScroll", RTL_TEXTENCODING_IBM_850 ) );
+ if ( pEdit )
+ pEdit->Hide();
+ BrowseBox::StartScroll();
+}
+
+//------------------------------------------------------------------
+
+void Browser::EndScroll()
+{
+ BrowseBox::EndScroll();
+ ( (AppWindow*) GetParent() )->Event( String( "EndScroll", RTL_TEXTENCODING_IBM_850 ) );
+ if ( pEdit )
+ pEdit->Show();
+}
+//------------------------------------------------------------------
+
+void Browser::Command( const CommandEvent &rEvt )
+{
+ String aEvent( String( "Command at ", RTL_TEXTENCODING_IBM_850 ) );
+ aEvent += rEvt.GetMousePosPixel().X();
+ aEvent += String( ":", RTL_TEXTENCODING_IBM_850 );
+ aEvent += rEvt.GetMousePosPixel().Y();
+ ( (AppWindow*) GetParent() )->Event( aEvent );
+ BrowseBox::Command(rEvt);
+}
+
+//------------------------------------------------------------------
+
+void Browser::Select()
+{
+ String aEvent( String( "Select: ", RTL_TEXTENCODING_IBM_850 ) );
+ DELETEZ(pEdit);
+ for ( long nRow = FirstSelectedRow(bInverse); nRow >= 0; nRow = NextSelectedRow() )
+ {
+ if ( bInverse )
+ aEvent += String( String( "~", RTL_TEXTENCODING_IBM_850 ) );
+ aEvent += String( nRow );
+ aEvent += String( ", ", RTL_TEXTENCODING_IBM_850 );
+ }
+ aEvent.Erase( aEvent.Len() - 2 );
+
+ ( (AppWindow*) GetParent() )->Event( aEvent );
+}
+
+//------------------------------------------------------------------
+
+void Browser::DoubleClick()
+{
+ String aEvent( String( "DoubleClick: ", RTL_TEXTENCODING_IBM_850 ) );
+ aEvent += String( GetCurRow() );
+ aEvent += String( String( ", ", RTL_TEXTENCODING_IBM_850 ) );
+ aEvent += String( FirstSelectedRow() );
+ ( (AppWindow*) GetParent() )->Event( aEvent );
+
+ SetNoSelection();
+ if ( !pEdit )
+ pEdit = new Edit( &GetDataWindow() );
+ Rectangle aRect( GetFieldRect( GetCurColumnId() ) );
+ pEdit->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
+ pEdit->Show();
+ pEdit->GrabFocus();
+}
+
+//------------------------------------------------------------------
+
+void Browser::CursorMoved()
+{
+ String aEvent( String( "Cursor: ", RTL_TEXTENCODING_IBM_850 ) );
+ aEvent += String( GetCurRow() );
+ aEvent += String( ":", RTL_TEXTENCODING_IBM_850 );
+ aEvent += String( GetCurColumnId() );
+ ( (AppWindow*) GetParent() )->Event( aEvent );
+ if ( IsFieldVisible( GetCurRow(), GetCurColumnId(), TRUE ) )
+ ( (AppWindow*) GetParent() )->Event( String( "completely visible", RTL_TEXTENCODING_IBM_850 ) );
+ else if ( IsFieldVisible( 1, GetCurColumnId(), FALSE) )
+ ( (AppWindow*) GetParent() )->Event( String( "partly visible", RTL_TEXTENCODING_IBM_850 ) );
+ else
+ ( (AppWindow*) GetParent() )->Event( String( "not visible", RTL_TEXTENCODING_IBM_850 ) );
+
+ DELETEZ(pEdit);
+}
+
+//------------------------------------------------------------------
+
+long Browser::GetRowCount() const
+{
+ return aRows.Count();
+}
+
+//------------------------------------------------------------------
+
+BOOL Browser::SeekRow( long nRow )
+{
+ if ( nRow >= 0 && nRow < (long) aRows.Count() )
+ {
+ aRows.Seek(nRow);
+ return TRUE;
+ }
+ return FALSE;
+}
+
+//------------------------------------------------------------------
+
+void Browser::PaintField( OutputDevice& rDev, const Rectangle& rRect,
+ USHORT nColumnId ) const
+{
+ rDev.SetClipRegion( rRect );
+ String aText( aRows.GetCurObject() );
+ aText += String( ".", RTL_TEXTENCODING_IBM_850 );
+ aText += String( nColumnId );
+ rDev.DrawText( rRect.TopLeft(), aText );
+}
+
+//==================================================================
+
+AppWindow::AppWindow():
+ WorkWindow( 0, WinBits(WB_APP|WB_STDWORK) ),
+ aEdit( this, WinBits( WB_BORDER ) ),
+ aBrowser( this, 0 ),
+ eCurMode( 0 ),
+ pEventView( 0 ),
+ nNewRowNo( 2000L )
+{
+ SetText( String( "BrowseBox Testframe", RTL_TEXTENCODING_IBM_850 ) );
+
+ aMenu.InsertItem( MID_BROWSER, String( "~Browser", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.SetPopupMenu( MID_BROWSER, &aBrwMenu );
+ aBrwMenu.InsertItem( MID_MODE, String( "~Mode...", RTL_TEXTENCODING_IBM_850 ) );
+ aBrwMenu.InsertItem( MID_EVENTVIEW, String( "~Event-Viewer", RTL_TEXTENCODING_IBM_850 ) );
+ aBrwMenu.InsertSeparator();
+ aBrwMenu.InsertItem( MID_INVALIDATE, String( "~Invalidate", RTL_TEXTENCODING_IBM_850 ) );
+ aBrwMenu.InsertItem( MID_CLEAR, String( "~Clear", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.InsertItem( MID_ROW, String( "~Row", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.SetPopupMenu( MID_ROW, &aRowMenu );
+ aRowMenu.InsertItem( MID_INSERTROW_BEFORE, String( "Insert before current", RTL_TEXTENCODING_IBM_850 ) );
+ aRowMenu.InsertItem( MID_INSERTROW_AT, String( "~Insert at current", RTL_TEXTENCODING_IBM_850 ) );
+ aRowMenu.InsertItem( MID_INSERTROW_BEHIND, String( "~Insert behind current", RTL_TEXTENCODING_IBM_850 ) );
+ aRowMenu.InsertSeparator();
+ aRowMenu.InsertItem( MID_REMOVEROW_BEFORE, String( "Remove before current", RTL_TEXTENCODING_IBM_850 ) );
+ aRowMenu.InsertItem( MID_REMOVEROW_AT, String( "~Remove at current", RTL_TEXTENCODING_IBM_850 ) );
+ aRowMenu.InsertItem( MID_REMOVEROW_BEHIND, String( "~Remove behind current", RTL_TEXTENCODING_IBM_850 ) );
+ aRowMenu.InsertSeparator();
+ aRowMenu.InsertItem( MID_MODIFYROW_BEFORE, String( "Modify before current", RTL_TEXTENCODING_IBM_850 ) );
+ aRowMenu.InsertItem( MID_MODIFYROW_AT, String( "~Modify at current", RTL_TEXTENCODING_IBM_850 ) );
+ aRowMenu.InsertItem( MID_MODIFYROW_BEHIND, String( "~Modify behind current", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.InsertItem( MID_COL, String( "~Column", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.SetPopupMenu( MID_COL, &aColMenu );
+ aColMenu.InsertItem( MID_INSERTCOL, String( "~Insert", RTL_TEXTENCODING_IBM_850 ) );
+ aColMenu.InsertItem( MID_REMOVECOL, String( "Re~move", RTL_TEXTENCODING_IBM_850 ) );
+ aColMenu.InsertItem( MID_MOVECOLLEFT, String( "Move ~Left", RTL_TEXTENCODING_IBM_850 ) );
+ aColMenu.InsertItem( MID_MOVECOLRIGHT, String( "Move ~Right", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.InsertItem( MID_SELECTIONS, String( "Selections", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.SetPopupMenu( MID_SELECTIONS, &aSelMenu );
+ aSelMenu.InsertItem( MID_SELECTROW, String( "Row", RTL_TEXTENCODING_IBM_850 ) );
+ aSelMenu.InsertItem( MID_SELECTALL, String( "All", RTL_TEXTENCODING_IBM_850 ) );
+ aSelMenu.InsertItem( MID_SELECTNONE, String( "None", RTL_TEXTENCODING_IBM_850 ) );
+ aSelMenu.InsertItem( MID_INVERSE, String( "Inverse", RTL_TEXTENCODING_IBM_850 ), MENU_APPEND, MIB_CHECKABLE );
+ aMenu.InsertItem( MID_EXTRAS, String( "Extras", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.SetPopupMenu( MID_EXTRAS, &aExtMenu );
+ aExtMenu.InsertItem( MID_STARMONEY_1, String( "StarMoney: SelectRow(+1)+DeleteRow", RTL_TEXTENCODING_IBM_850 ) );
+ aMenu.PushSelectHdl( LINK(this, AppWindow, MenuSelect) );
+
+ aEdit.SetModifyHdl( LINK(this,AppWindow,Modify) );
+
+ aEdit.Show();
+ aBrowser.Show();
+ Show();
+}
+
+//------------------------------------------------------------------
+
+AppWindow::~AppWindow()
+{
+ GetpApp()->SetAppMenu( 0 );
+ if ( pEventView )
+ delete pEventView;
+}
+
+//------------------------------------------------------------------
+
+IMPL_LINK_INLINE_START( AppWindow, Modify, void *, pCaller )
+{
+ Edit *pEdit = (Edit*) pCaller;
+ aBrowser.GoToRow( pEdit->GetText().ToInt32() );
+ aBrowser.GrabFocus();
+
+ return TRUE;
+}
+IMPL_LINK_INLINE_END( AppWindow, Modify, void *, pCaller )
+
+//------------------------------------------------------------------
+
+IMPL_LINK( AppWindow, MenuSelect, Menu *, pMenu )
+{
+ ULONG nPos;
+
+ switch ( pMenu->GetCurItemId() )
+ {
+ case MID_MODE:
+ {
+ BrowseModeDialog *pDlg = new BrowseModeDialog( this );
+ pDlg->SetMode( eCurMode );
+ if ( pDlg->Execute() == RET_OK )
+ {
+ eCurMode = pDlg->GetMode();
+ aBrowser.SetMode( eCurMode | BROWSER_AUTOSIZE_LASTCOL );
+ }
+ delete pDlg;
+ break;
+ }
+
+ case MID_INVALIDATE:
+ aBrowser.Invalidate();
+ break;
+
+ case MID_INSERTROW_BEFORE:
+ if ( aBrowser.GetCurRow() == 0 )
+ {
+ Sound::Beep();
+ break;
+ }
+ nPos = aBrowser.GetCurRow() - 1;
+ aBrowser.aRows.Insert( nNewRowNo++, nPos );
+ aBrowser.RowInserted( aBrowser.GetCurRow()-1 );
+ break;
+
+ case MID_INSERTROW_AT:
+ nPos = aBrowser.GetCurRow();
+ if ( nPos == BROWSER_ENDOFSELECTION )
+ nPos = 0;
+ aBrowser.aRows.Insert( nNewRowNo++, nPos );
+ aBrowser.RowInserted( nPos );
+ break;
+
+ case MID_INSERTROW_BEHIND:
+ nPos = aBrowser.GetCurRow() + 1;
+ aBrowser.aRows.Insert( nNewRowNo++, nPos );
+ aBrowser.RowInserted( nPos );
+ break;
+
+ case MID_REMOVEROW_BEFORE:
+ if ( aBrowser.GetCurRow() == 0 )
+ {
+ Sound::Beep();
+ break;
+ }
+ nPos = aBrowser.GetCurRow() - 1;
+ aBrowser.aRows.Remove( nPos );
+ aBrowser.RowRemoved( nPos );
+ break;
+
+ case MID_REMOVEROW_AT:
+ nPos = aBrowser.GetCurRow();
+ aBrowser.aRows.Remove( nPos );
+ aBrowser.RowRemoved( nPos );
+ break;
+
+ case MID_REMOVEROW_BEHIND:
+ if ( (aBrowser.GetCurRow()+1) >= aBrowser.GetRowCount() )
+ {
+ Sound::Beep();
+ break;
+ }
+ nPos = aBrowser.GetCurRow() + 1;
+ aBrowser.aRows.Remove( nPos );
+ aBrowser.RowRemoved( nPos );
+ break;
+
+ case MID_MODIFYROW_BEFORE:
+ if ( aBrowser.GetCurRow() == 0 )
+ {
+ Sound::Beep();
+ break;
+ }
+ nPos = aBrowser.GetCurRow() - 1;
+ aBrowser.aRows.Replace( nNewRowNo++, nPos );
+ aBrowser.RowModified( nPos );
+ break;
+
+ case MID_MODIFYROW_AT:
+ nPos = aBrowser.GetCurRow();
+ aBrowser.aRows.Replace( nNewRowNo++, nPos );
+ aBrowser.RowModified( nPos );
+ break;
+
+ case MID_MODIFYROW_BEHIND:
+ if ( (aBrowser.GetCurRow()+1) >= aBrowser.GetRowCount() )
+ {
+ Sound::Beep();
+ break;
+ }
+ nPos = aBrowser.GetCurRow() + 1;
+ aBrowser.aRows.Replace( nNewRowNo++, nPos );
+ aBrowser.RowModified( nPos );
+ break;
+
+ case MID_EVENTVIEW:
+ if ( pEventView )
+ {
+ delete pEventView;
+ pEventView = 0;
+ }
+ else
+ {
+ pEventView = new FloatingWindow( this );
+ pEventView->SetPosPixel( Point( 100, 100 ) );
+ pEventView->SetOutputSizePixel(
+ Size( 320, 8*GetTextHeight() ) );
+ pEventView->Show();
+ aBrowser.CursorMoved();
+ aBrowser.Select();
+ }
+ break;
+
+ case MID_SELECTROW:
+ aBrowser.SelectRow( aBrowser.GetCurRow(),
+ !aBrowser.IsRowSelected( aBrowser.GetCurRow() ) );
+ break;
+
+ case MID_SELECTALL:
+ aBrowser.SelectAll();
+ break;
+
+ case MID_SELECTNONE:
+ aBrowser.SetNoSelection();
+ break;
+
+ case MID_INVERSE:
+ {
+ BOOL bChecked = pMenu->IsItemChecked( MID_INVERSE );
+ pMenu->CheckItem( MID_INVERSE, !bChecked );
+ aBrowser.SetInverseSelection( !bChecked );
+ break;
+ }
+
+ case MID_CLEAR:
+ aBrowser.Clear();
+ break;
+
+ case MID_STARMONEY_1:
+ {
+ nPos = aBrowser.GetCurRow();
+ aBrowser.SelectRow( nPos + 1, TRUE );
+ aBrowser.aRows.Remove( nPos );
+ aBrowser.RowRemoved( nPos );
+ break;
+ }
+ }
+
+ return TRUE;
+}
+
+//------------------------------------------------------------------
+
+void AppWindow::Resize()
+{
+ Size aOutSz( GetOutputSizePixel() );
+
+ aEdit.SetPosSizePixel(
+ Point( 0, 0 ),
+ Size( aOutSz.Width(), 24 ) );
+
+ aBrowser.SetPosSizePixel(
+ Point( 0, aEdit.GetSizePixel().Height() ),
+ Size( aOutSz.Width(), aOutSz.Height() - 24 ) );
+}
+
+//------------------------------------------------------------------
+
+void AppWindow::Activate()
+{
+ GetpApp()->SetAppMenu( &aMenu );
+ aBrowser.GrabFocus();
+}
+
+//------------------------------------------------------------------
+
+void AppWindow::Event( const String &rEvent )
+{
+ if ( pEventView )
+ {
+ pEventView->Scroll( 0, -GetTextHeight() );
+ pEventView->Update();
+ pEventView->DrawText( Point(0, 7*GetTextHeight() ), rEvent );
+ }
+}
+
+//==================================================================
+
+App::App()
+{
+}
+
+//------------------------------------------------------------------
+
+App::~App()
+{
+}
+
+//------------------------------------------------------------------
+
+#ifdef VCL
+void App::Main( )
+#else
+void App::Main( int, char *[] )
+#endif
+{
+ EnableSVLook();
+
+ AppWindow aAppWin;
+
+
+ Execute();
+}
+
diff --git a/svtools/workben/cui/loadlib.cxx b/svtools/workben/cui/loadlib.cxx
new file mode 100644
index 000000000000..8fdca9e60b62
--- /dev/null
+++ b/svtools/workben/cui/loadlib.cxx
@@ -0,0 +1,121 @@
+/*************************************************************************
+ *
+ * $RCSfile: loadlib.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <tools/string.hxx>
+#include <libcall.hxx>
+
+
+extern "C" {
+
+struct VersionInfo
+{
+ char aTime[20];
+ char aDate[20];
+ char aUpd[5];
+ char aMinor;
+ char aBuild[5];
+#if SUPD>564
+ char aInpath[20];
+#endif
+};
+
+#ifdef WNT
+__declspec(dllexport)
+#endif
+ VersionInfo *GetVersionInfo();
+};
+
+typedef VersionInfo*(__LOADONCALLAPI *PFUNC)(void);
+
+int __LOADONCALLAPI main( int argc, char **argv )
+{
+ VersionInfo *pInfo = 0L;
+ PFUNC pFunc;
+
+ if ( argc != 2 )
+ {
+ fprintf( stderr, "USAGE: %s DllName \n", argv[0] );
+ exit(0);
+ }
+ SvLibrary aLibrary(argv[1]);
+ pFunc = (PFUNC) aLibrary.GetFunction( "GetVersionInfo" );
+ if ( pFunc )
+ pInfo = (*pFunc)();
+ if ( pInfo )
+ {
+ fprintf( stdout, "Date : %s\n", pInfo->aDate );
+ fprintf( stdout, "Time : %s\n", pInfo->aTime );
+ fprintf( stdout, "UPD : %s\n", pInfo->aUpd );
+ fprintf( stdout, "Minor : %c\n", pInfo->aMinor );
+ fprintf( stdout, "Build : %s\n", pInfo->aBuild );
+#if SUPD>564
+ fprintf( stdout, "Inpath : %s\n", pInfo->aInpath );
+#endif
+ }
+ else
+ fprintf( stderr, "VersionInfo not Found !\n" );
+ return 0;
+}
+
diff --git a/svtools/workben/cui/makefile.mk b/svtools/workben/cui/makefile.mk
new file mode 100644
index 000000000000..1fd22a706d60
--- /dev/null
+++ b/svtools/workben/cui/makefile.mk
@@ -0,0 +1,106 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..$/..
+
+PRJNAME=SVTOOLS
+TARGET=cuidem
+LIBTARGET=NO
+
+TARGETTYPE=CUI
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+OBJFILES= $(OBJ)$/loadlib.obj
+
+APP4TARGET= dllver
+.IF "$(GUI)" != "MAC"
+APP4STDLIBS= \
+ $(SVMEMLIB) \
+ $(SVTOOLLIB) \
+ $(SVLLIB) \
+ $(SVLIB) \
+ $(TOOLSLIB) \
+ $(VOSLIB) \
+ $(SALLIB)
+.IF "$(GUI)"=="WNT" || "$(COM)"=="GCC"
+APP4STDLIBS+= $(CPPULIB)
+.ENDIF
+.ELSE
+APP4STDLIBS=$(SOLARBINDIR)$/TL$(UPD)$(DLLPOSTFIX).DLL \
+ $(SOLARBINDIR)$/VCL$(UPD)$(DLLPOSTFIX).DLL \
+ $(SOLARBINDIR)$/SVT$(UPD)$(DLLPOSTFIX).DLL
+APP4LIBS = $(SOLARLIBDIR)$/SALMAIN.MAC.LIB \
+ $(SOLARLIBDIR)$/NOSHAREDMAIN.LIB
+.ENDIF
+APP4OBJS= $(OBJ)$/loadlib.obj
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/svtools/workben/makefile.mk b/svtools/workben/makefile.mk
new file mode 100644
index 000000000000..08ab359143dc
--- /dev/null
+++ b/svtools/workben/makefile.mk
@@ -0,0 +1,180 @@
+#*************************************************************************
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.1.1.1 $
+#
+# last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+#
+# The Contents of this file are made available subject to the terms of
+# either of the following licenses
+#
+# - GNU Lesser General Public License Version 2.1
+# - Sun Industry Standards Source License Version 1.1
+#
+# Sun Microsystems Inc., October, 2000
+#
+# GNU Lesser General Public License Version 2.1
+# =============================================
+# Copyright 2000 by Sun Microsystems, Inc.
+# 901 San Antonio Road, Palo Alto, CA 94303, USA
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License version 2.1, as published by the Free Software Foundation.
+#
+# This library 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 for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+#
+# Sun Industry Standards Source License Version 1.1
+# =================================================
+# The contents of this file are subject to the Sun Industry Standards
+# Source License Version 1.1 (the "License"); You may not use this file
+# except in compliance with the License. You may obtain a copy of the
+# License at http://www.openoffice.org/license.html.
+#
+# Software provided under this License is provided on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+# See the License for the specific provisions governing your rights and
+# obligations concerning the Software.
+#
+# The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+#
+# Copyright: 2000 by Sun Microsystems, Inc.
+#
+# All Rights Reserved.
+#
+# Contributor(s): _______________________________________
+#
+#
+#
+#*************************************************************************
+
+PRJ=..
+
+PRJNAME=SVTOOLS
+TARGET=svdem
+LIBTARGET=NO
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : svpre.mk
+.INCLUDE : settings.mk
+.INCLUDE : sv.mk
+
+# --- Files --------------------------------------------------------
+
+OBJFILES= $(OBJ)$/svdem.obj
+# removed, because these files aren't ported to Unicode
+# $(OBJ)$/browser.obj \
+# $(OBJ)$/stest.obj \
+# $(OBJ)$/grptest.obj
+
+APP1TARGET= $(TARGET)
+.IF "$(GUI)" != "MAC"
+APP1STDLIBS= $(SVTOOLLIB) \
+ $(SVLIB) \
+ $(TOOLSLIB) \
+ $(SALLIB) \
+ $(VOSLIB) \
+ $(CPPULIB)
+.ELSE
+APP1STDLIBS= $(SOLARBINDIR)$/TL$(UPD)$(DLLPOSTFIX).DLL \
+ $(SOLARBINDIR)$/VCL$(UPD)$(DLLPOSTFIX).DLL \
+ $(SOLARBINDIR)$/SVT$(UPD)$(DLLPOSTFIX).DLL
+APP1LIBS= $(SOLARLIBDIR)$/SALMAIN.MAC.LIB \
+ $(SOLARLIBDIR)$/NOSHAREDMAIN.LIB
+.ENDIF
+.IF "$(GUI)" != "MAC"
+APP1DEPN= $(L)$/itools.lib $(SVLIBDEPEND) $(LB)$/_svt.lib
+.ENDIF
+APP1OBJS= $(OBJ)$/svdem.obj
+APP1STACK= 32768
+
+# removed, because these files aren't ported to Unicode
+#APP2TARGET= browser
+.IF "$(GUI)" != "MAC"
+#APP2STDLIBS= $(SVTOOLLIB) \
+# $(SVLIB) \
+# $(SALLIB) \
+# $(TOOLSLIB) \
+# $(VOSLIB) \
+# $(CPPULIB)
+.ELSE
+#APP2STDLIBS= $(SOLARBINDIR)$/TL$(UPD)$(DLLPOSTFIX).DLL \
+# $(SOLARBINDIR)$/VCL$(UPD)$(DLLPOSTFIX).DLL \
+# $(SOLARBINDIR)$/SVT$(UPD)$(DLLPOSTFIX).DLL
+#APP2LIBS= $(SOLARLIBDIR)$/SALMAIN.MAC.LIB \
+# $(SOLARLIBDIR)$/NOSHAREDMAIN.LIB
+.ENDIF
+.IF "$(GUI)" != "MAC"
+#APP2DEPN= $(LB)$/_svt.lib $(L)$/itools.lib $(SVLIBDEPEND)
+.ENDIF
+#APP2OBJS= $(OBJ)$/browser.obj
+#APP2STACK= 32768
+
+# removed, because these files aren't ported to Unicode
+#APP3TARGET= stest
+.IF "$(GUI)" != "MAC"
+#APP3STDLIBS= $(SVMEMLIB) \
+# $(SVTOOLLIB) \
+# $(SVLIB) \
+# $(SALLIB) \
+# $(TOOLSLIB) \
+# $(VOSLIB) \
+# $(SVLLIB) \
+# $(CPPULIB)
+.ELSE
+#APP3STDLIBS= $(SOLARBINDIR)$/TL$(UPD)$(DLLPOSTFIX).DLL \
+# $(SOLARBINDIR)$/VCL$(UPD)$(DLLPOSTFIX).DLL \
+# $(SOLARBINDIR)$/SVT$(UPD)$(DLLPOSTFIX).DLL
+#APP3LIBS= $(SOLARLIBDIR)$/SALMAIN.MAC.LIB \
+# $(SOLARLIBDIR)$/NOSHAREDMAIN.LIB
+.ENDIF
+.IF "$(GUI)" != "MAC"
+#APP3DEPN= $(L)$/itools.lib $(SVLIBDEPEND) $(LB)$/svmem.lib $(LB)$/_svt.lib
+.ENDIF
+#APP3OBJS= $(OBJ)$/stest.obj
+#APP3STACK= 32768
+
+# removed, because these files aren't ported to Unicode
+#APP4TARGET= grptest
+.IF "$(GUI)" != "MAC"
+#APP4STDLIBS= $(SVMEMLIB) \
+# $(SVTOOLLIB) \
+# $(SVLIB) \
+# $(SALLIB) \
+# $(TOOLSLIB) \
+# $(VOSLIB) \
+# $(CPPULIB)
+.ELSE
+#APP4STDLIBS= $(SOLARBINDIR)$/TL$(UPD)$(DLLPOSTFIX).DLL \
+# $(SOLARBINDIR)$/VCL$(UPD)$(DLLPOSTFIX).DLL \
+# $(SOLARBINDIR)$/SVT$(UPD)$(DLLPOSTFIX).DLL
+#APP4LIBS= $(SOLARLIBDIR)$/SALMAIN.MAC.LIB \
+# $(SOLARLIBDIR)$/NOSHAREDMAIN.LIB
+.ENDIF
+.IF "$(GUI)" != "MAC"
+#APP4DEPN= $(L)$/itools.lib $(SVLIBDEPEND) $(LB)$/svmem.lib $(LB)$/_svt.lib
+.ENDIF
+#APP4OBJS= $(OBJ)$/grptest.obj
+#APP4STACK= 32768
+
+
+.IF "$(GUI)" == "MAC"
+MACRES = $(SV_RES)SV.R $(SV_RES)SV_DEMO.R $(SV_RES)SV_POWER.R
+.ENDIF
+
+# --- Targets -------------------------------------------------------
+
+.INCLUDE : target.mk
diff --git a/svtools/workben/stest.cxx b/svtools/workben/stest.cxx
new file mode 100644
index 000000000000..83d946a7a4bf
--- /dev/null
+++ b/svtools/workben/stest.cxx
@@ -0,0 +1,239 @@
+/*************************************************************************
+ *
+ * $RCSfile: stest.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#ifdef VCL
+#include <svmedit.hxx>
+#endif
+
+#ifndef _TXTCMP_HXX //autogen
+#include <txtcmp.hxx>
+#endif
+
+#ifndef _SV_BUTTON_HXX //autogen
+#include <vcl/button.hxx>
+#endif
+
+#ifndef _SV_WRKWIN_HXX //autogen
+#include <vcl/wrkwin.hxx>
+#endif
+
+#ifndef _SV_FIXED_HXX //autogen
+#include <vcl/fixed.hxx>
+#endif
+
+#ifndef _SV_SVAPP_HXX //autogen
+#include <vcl/svapp.hxx>
+#endif
+
+class MyApp : public Application
+{
+public:
+#ifndef VCL
+ virtual void Main( int, char*[] );
+#else
+ virtual void Main( );
+#endif
+};
+
+class SearchWindow : public WorkWindow
+{
+ PushButton aPB;
+ FixedText aFT1, aFT2, aFT3;
+ MultiLineEdit aEText, aESrch;
+ RadioButton aModeN, aModeR, aModeL;
+ SearchParam aParam;
+
+public:
+ SearchWindow();
+
+ DECL_LINK( ClickHdl, Button * );
+};
+
+// --- SearchWindow::SearchWindow() ------------------------------------
+
+SearchWindow::SearchWindow() :
+ WorkWindow( NULL, WinBits( WB_APP | WB_STDWORK )),
+ aPB( this, WinBits( 0 )),
+ aFT1( this, WinBits( 0 )),
+ aFT2( this, WinBits( 0 )),
+ aFT3( this, WinBits( 0 )),
+ aEText( this, WinBits( WB_BORDER )),
+ aESrch( this, WinBits( WB_BORDER )),
+ aModeN( this, WinBits( 0 )),
+ aModeR( this, WinBits( 0 )),
+ aModeL( this, WinBits( 0 )),
+ aParam( "" )
+{
+ aPB.SetClickHdl( LINK( this, SearchWindow, ClickHdl ));
+ aModeN.SetClickHdl( LINK( this, SearchWindow, ClickHdl ));
+ aModeR.SetClickHdl( LINK( this, SearchWindow, ClickHdl ));
+ aModeL.SetClickHdl( LINK( this, SearchWindow, ClickHdl ));
+
+ SetMapMode( MapMode( MAP_APPFONT ));
+ SetSizePixel( LogicToPixel( Size( 300, 180 ) ) );
+
+ aEText.SetPosSizePixel( LogicToPixel( Point( 0, 22 )), LogicToPixel(Size( 270, 32 )) );
+ aFT1.SetPosSizePixel( LogicToPixel( Point( 0, 10 )), LogicToPixel(Size( 18, 11 )) );
+ aFT2.SetPosSizePixel( LogicToPixel( Point( 0, 60 )), LogicToPixel(Size( 24, 10 )) );
+ aESrch.SetPosSizePixel( LogicToPixel( Point( 0, 70 )), LogicToPixel(Size( 270, 24 )) );
+ aPB.SetPosSizePixel( LogicToPixel( Point( 223, 139 )), LogicToPixel(Size( 48, 12 )) );
+ aFT3.SetPosSizePixel( LogicToPixel( Point( 0, 104 )), LogicToPixel(Size( 270, 15 )) );
+ aModeN.SetPosSizePixel( LogicToPixel( Point( 5, 116 ) ), LogicToPixel( Size( 40, 12 ) ) );
+ aModeR.SetPosSizePixel( LogicToPixel( Point( 5, 126 ) ), LogicToPixel( Size( 40, 12 ) ) );
+ aModeL.SetPosSizePixel( LogicToPixel( Point( 5, 136 ) ), LogicToPixel( Size( 40, 12 ) ) );
+
+ aEText.Show();
+ aFT1.Show();
+ aFT2.Show();
+ aESrch.Show();
+ aPB.Show();
+ aFT3.Show();
+ aModeN.Show();
+ aModeR.Show();
+ aModeL.Show();
+
+ aFT3.SetText( "gefunden:" );
+ aFT1.SetText( "Text:" );
+ aFT2.SetText( "Suche:" );
+ aPB.SetText( "starte Suche" );
+ aModeN.SetText( "normal" );
+ aModeR.SetText( "RegExp" );
+ aModeL.SetText( "LevDis" );
+
+ SetText( "Such-Demo" );
+}
+
+
+// --- SearchWindow::SearchSelectHdl() ---------------------------------
+
+IMPL_LINK( SearchWindow, ClickHdl, Button *, pButton )
+{
+ if( pButton == &aPB )
+ {
+ String sText( aEText.GetText() );
+ String sSrch( aESrch.GetText() );
+
+/* InfoBox( this, String( "T: " ) + sText +
+ String( "\nS: " ) + sSrch ).Execute();
+*/
+ BOOL bRet = FALSE;
+ USHORT nStt = 0, nEnd = sText.Len();
+
+ {
+ aParam.SetSrchStr( sSrch );
+ SearchText aSrchText( aParam, GetpApp()->GetAppInternational() );
+ bRet = aSrchText.SearchFrwrd( sText, &nStt, &nEnd );
+
+// BOOL SearchBkwrd( const String &rStr, USHORT* pStart, USHORT* pEnde );
+ }
+
+ String sFound( "gefunden" );
+ if( !bRet )
+ sFound.Insert( "nicht ", 0 );
+
+ sFound += ": S<";
+ sFound += nStt;
+ sFound += "> E<";
+ sFound += nEnd;
+ sFound += '>';
+
+ if( bRet )
+ {
+ sFound += '<';
+ sFound += sText.Copy( nStt, nEnd - nStt +1 );
+ sFound += '>';
+ }
+
+ aFT3.SetText( sFound );
+ }
+ else if( pButton == &aModeN )
+ {
+ aParam.SetSrchType( SearchParam::SRCH_NORMAL );
+ }
+ else if( pButton == &aModeR )
+ {
+ aParam.SetSrchType( SearchParam::SRCH_REGEXP );
+ }
+ else if( pButton == &aModeL )
+ {
+ aParam.SetSrchType( SearchParam::SRCH_LEVDIST );
+ }
+ return 0;
+}
+
+
+// --- MyApp::Main() -----------------------------------------------
+
+#ifndef VCL
+void MyApp::Main( int, char*[] )
+#else
+void MyApp::Main( )
+#endif
+{
+ SearchWindow* pSearchWindow = new SearchWindow;
+ pSearchWindow->Show();
+ Execute();
+ delete pSearchWindow;
+
+}
+
+// --- aMyApp ------------------------------------------------------
+
+MyApp aMyApp;
diff --git a/svtools/workben/svdem.cxx b/svtools/workben/svdem.cxx
new file mode 100644
index 000000000000..9de046fae423
--- /dev/null
+++ b/svtools/workben/svdem.cxx
@@ -0,0 +1,1176 @@
+/*************************************************************************
+ *
+ * $RCSfile: svdem.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+#include <vcl/wrkwin.hxx>
+#include <vcl/dialog.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/drag.hxx>
+#include <vcl/print.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/help.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/button.hxx>
+#include <vcl/scrbar.hxx>
+#include <vcl/slider.hxx>
+#include <vcl/group.hxx>
+#include <vcl/toolbox.hxx>
+#include <vcl/status.hxx>
+#include <stdmenu.hxx>
+#include <ctrltool.hxx>
+#include <ctrlbox.hxx>
+#include <tabbar.hxx>
+#include <valueset.hxx>
+#include <headbar.hxx>
+#include <prgsbar.hxx>
+#include <calendar.hxx>
+#include <prnsetup.hxx>
+#include <printdlg.hxx>
+
+// -----------------------------------------------------------------------
+
+class MyApp : public Application
+{
+public:
+ void Main();
+};
+
+// -----------------------------------------------------------------------
+
+class ShowBitmap : public WorkWindow
+{
+ Bitmap aBmp;
+
+public:
+ ShowBitmap( Window* pParent, const Bitmap& rBmp );
+
+ virtual void Paint( const Rectangle& );
+ virtual BOOL Close();
+};
+
+// -----------------------------------------------------------------------
+
+class ShowFont : public Control
+{
+public:
+ ShowFont( Window* pParent );
+
+ virtual void Paint( const Rectangle& );
+ void SetFont( const Font& rFont )
+ { Invalidate(); Control::SetFont( rFont ); }
+};
+
+// --- class OrientSlider ------------------------------------------------
+
+class OrientSlider : public Slider
+{
+public:
+ OrientSlider( Window* pParent );
+
+ short GetOrientation() const { return (short)GetThumbPos(); }
+};
+
+// -----------------------------------------------------------------------
+
+OrientSlider::OrientSlider( Window* pParent ) :
+ Slider( pParent, WB_HORZ | WB_DRAG )
+{
+ SetThumbPos( 0 );
+ SetLineSize( 10 );
+ SetPageSize( 100 );
+ SetRange( Range( 0, 3600 ) );
+}
+
+// -----------------------------------------------------------------------
+
+class MyFontDialog : public ModalDialog
+{
+private:
+ FontList* pList;
+ Font aCurFont;
+ Printer aPrinter;
+ FontNameBox aFontBox;
+ FontStyleBox aStyleBox;
+ FontSizeBox aSizeBox;
+ ListBox aUnderlineBox;
+ ListBox aStrikeoutBox;
+ CheckBox aWordLineBox;
+ CheckBox aShadowBox;
+ CheckBox aOutlineBox;
+ ColorListBox aColorBox;
+ GroupBox aEffectBox;
+ OrientSlider aLineOrientSlider;
+ ShowFont aShowFont;
+ GroupBox aSampleBox;
+ FixedText aMapText;
+ OKButton aOKBtn;
+ CancelButton aCancelBtn;
+
+public:
+ MyFontDialog( Window* pParent );
+
+ DECL_LINK( SelectFont, ComboBox* );
+ DECL_LINK( SelectStyle, ComboBox* );
+ DECL_LINK( AttrHdl, Window * );
+ void SetAttr();
+ short Execute();
+};
+
+// -----------------------------------------------------------------------
+
+class MyTabBar : public TabBar
+{
+public:
+ MyTabBar( Window* pParent,
+ WinBits nWinStyle = WB_STDTABBAR ) :
+ TabBar( pParent, nWinStyle ) {}
+
+ virtual long DeactivatePage();
+ virtual long AllowRenaming();
+ virtual void Split();
+ virtual void Command( const CommandEvent& rCEvt );
+ virtual BOOL QueryDrop( DropEvent& rDEvt );
+};
+
+// -----------------------------------------------------------------------
+
+class MyCalendar : public WorkWindow
+{
+ MenuBar aMenuBar;
+ PopupMenu aWeekStartMenu;
+ PopupMenu aWeekCountMenu;
+ Calendar aCalendar;
+ Color aInfoColor;
+ Color aHolidayColor;
+ Color aFrameColor;
+
+public:
+ MyCalendar( Window* pParent );
+ ~MyCalendar();
+
+ DECL_LINK( RequestDateInfoHdl, Calendar* );
+ DECL_LINK( DoubleClickHdl, Calendar* );
+ DECL_LINK( MenuSelectHdl, Menu* );
+
+ void Resize();
+};
+
+// -----------------------------------------------------------------------
+
+class MyWin : public WorkWindow
+{
+private:
+ Printer aPrn;
+ ToolBox aBox;
+ StatusBar aBar;
+ HeaderBar aHeadBar;
+ ColorListBox aColorList;
+ LineListBox aLineList;
+ ValueSet aValueSet;
+ CalendarField aCalendarField;
+ CalendarField aCalendarField2;
+ MyTabBar aTabBar;
+ ProgressBar aPrgsBar;
+ PushButton aFontBtn;
+ PushButton aCalendarBtn;
+ PushButton aPrnSetupBtn;
+ PushButton aPrnDlgBtn;
+ Size aBoxSize;
+ MyCalendar* pCalendar;
+ PopupMenu* pMenu;
+ FontNameMenu* pNameMenu;
+ FontStyleMenu* pStyleMenu;
+ FontSizeMenu* pSizeMenu;
+
+public:
+ MyWin( Window* pParent, WinBits aWinStyle );
+ ~MyWin();
+
+ DECL_LINK( Test, PushButton* );
+ DECL_LINK( SelectHdl, Window* );
+ DECL_LINK( CalSelectHdl, CalendarField* );
+ void ContextMenu( const Point& rPos );
+
+ void Command( const CommandEvent& rCEvt );
+ void MouseButtonDown( const MouseEvent& rMEvt );
+ void KeyInput( const KeyEvent& rKEvt );
+ void Paint( const Rectangle& rRect );
+ void Resize();
+};
+
+// -----------------------------------------------------------------------
+
+void MyApp::Main()
+{
+ Help aHelp;
+ SetHelp( &aHelp );
+ Help::EnableContextHelp();
+ Help::EnableExtHelp();
+ Help::EnableBalloonHelp();
+ Help::EnableQuickHelp();
+
+ MyWin aMainWin( NULL, WinBits( WB_APP | WB_STDWORK | WB_CLIPCHILDREN ) );
+ aMainWin.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "SVTOOLS - Workbench" ) ) );
+ aMainWin.GrabFocus();
+ aMainWin.Show();
+
+ Execute();
+}
+
+// -----------------------------------------------------------------------
+
+ShowBitmap::ShowBitmap( Window* pParent, const Bitmap& rBmp ) :
+ WorkWindow( pParent, WB_STDWORK ),
+ aBmp( rBmp )
+{
+ SetOutputSizePixel( rBmp.GetSizePixel() );
+ SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Bitmap-Viewer" ) ) );
+ Show();
+}
+
+// -----------------------------------------------------------------------
+
+void ShowBitmap::Paint( const Rectangle& )
+{
+ DrawBitmap( Point(), GetOutputSizePixel(), aBmp );
+}
+
+// -----------------------------------------------------------------------
+
+BOOL ShowBitmap::Close()
+{
+ Hide();
+ delete this;
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+ShowFont::ShowFont( Window* pParent ) :
+ Control( pParent, WB_BORDER )
+{
+ SetMapMode( MapMode( MAP_POINT, Point(),
+ Fraction( 1, 10 ), Fraction( 1, 10 ) ) );
+ SetBackground( Wallpaper( Color( COL_WHITE ) ) );
+}
+
+// -----------------------------------------------------------------------
+
+void ShowFont::Paint( const Rectangle& )
+{
+ const Font& rFont = GetFont();
+ String aText;
+ Size aWindowSize( GetOutputSize() );
+ long x,y;
+
+ if ( rFont.GetLineOrientation() )
+ {
+ aText.Append( String::CreateFromInt32( rFont.GetLineOrientation()/10 ) );
+ aText.AppendAscii( " degree." );
+
+ x = aWindowSize.Width()/2;
+ y = aWindowSize.Height()/2;
+ }
+ else
+ {
+ aText = rFont.GetName();
+ if ( !aText.Len() )
+ aText.AssignAscii( "Sample" );
+
+ x = aWindowSize.Width()/2 - GetTextWidth( aText )/2;
+ y = aWindowSize.Height()/2 - GetTextHeight()/2;
+ }
+
+ DrawText( Point( x, y ), aText );
+}
+
+// -----------------------------------------------------------------------
+
+MyFontDialog::MyFontDialog( Window* pParent ) :
+ ModalDialog( pParent, WB_SVLOOK | WB_STDMODAL ),
+ aFontBox( this ),
+ aStyleBox( this ),
+ aSizeBox( this ),
+ aUnderlineBox( this, WB_DROPDOWN ),
+ aStrikeoutBox( this, WB_DROPDOWN ),
+ aWordLineBox( this ),
+ aShadowBox( this ),
+ aOutlineBox( this ),
+ aColorBox( this, WB_DROPDOWN ),
+ aEffectBox( this ),
+ aLineOrientSlider( this ),
+ aShowFont( this ),
+ aSampleBox( this ),
+ aMapText( this, WB_LEFT | WB_WORDBREAK ),
+ aOKBtn( this, WB_DEFBUTTON ),
+ aCancelBtn( this )
+{
+ pList = NULL;
+
+ aFontBox.EnableWYSIWYG( TRUE );
+ aFontBox.EnableSymbols( TRUE );
+ aFontBox.SetPosSizePixel( Point( 10, 10 ), Size( 140, 140 ) );
+ aFontBox.SetSelectHdl( LINK( this, MyFontDialog, SelectFont ) );
+ aFontBox.SetLoseFocusHdl( LINK( this, MyFontDialog, SelectFont ) );
+ aFontBox.Show();
+
+ aStyleBox.SetPosSizePixel( Point( 160, 10 ), Size( 100, 140 ) );
+ aStyleBox.SetSelectHdl( LINK( this, MyFontDialog, SelectStyle ) );
+ aStyleBox.SetLoseFocusHdl( LINK( this, MyFontDialog, SelectStyle ) );
+ aStyleBox.Show();
+
+ aSizeBox.SetPosSizePixel( Point( 270, 10 ), Size( 60, 140 ) );
+ aSizeBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aSizeBox.SetLoseFocusHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aSizeBox.Show();
+
+ aUnderlineBox.SetPosSizePixel( Point( 15, 180 ), Size( 130, 100 ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_NONE" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_SINGLE" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DOUBLE" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DOTTED" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DONTKNOW" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DASH" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_LONGDASH" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DASHDOT" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DASHDOTDOT" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_SMALLWAVE" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_WAVE" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_DOUBLEWAVE" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLD" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDDOTTED" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDDASH" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDLONGDASH" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDDASHDOT" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDDASHDOTDOT" ) ) );
+ aUnderlineBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "UNDERLINE_BOLDWAVE" ) ) );
+ aUnderlineBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aUnderlineBox.Show();
+
+ aStrikeoutBox.SetPosSizePixel( Point( 15, 210 ), Size( 130, 100 ) );
+ aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_NONE" ) ) );
+ aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_SINGLE" ) ) );
+ aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_DOUBLE" ) ) );
+ aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_DONTKNOW" ) ) );
+ aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_BOLD" ) ) );
+ aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_SLASH" ) ) );
+ aStrikeoutBox.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "STRIKEOUT_X" ) ) );
+ aStrikeoutBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aStrikeoutBox.Show();
+
+ aWordLineBox.SetPosSizePixel( Point( 15, 240 ), Size( 130, 19 ) );
+ aWordLineBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Only ~Words" ) ) );
+ aWordLineBox.SetClickHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aWordLineBox.Show();
+
+ aShadowBox.SetPosSizePixel( Point( 15, 260 ), Size( 130, 19 ) );
+ aShadowBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Shadow" ) ) );
+ aShadowBox.SetClickHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aShadowBox.Show();
+
+ aOutlineBox.SetPosSizePixel( Point( 15, 280 ), Size( 130, 19 ) );
+ aOutlineBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "~Outline" ) ) );
+ aOutlineBox.SetClickHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aOutlineBox.Show();
+
+ {
+ aColorBox.SetPosSizePixel( Point( 15, 305 ), Size( 130, 100 ) );
+ aColorBox.SetSelectHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aColorBox.SetUpdateMode( FALSE );
+ aColorBox.InsertEntry( Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) );
+ aColorBox.InsertEntry( Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) );
+ aColorBox.InsertEntry( Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) );
+ aColorBox.InsertEntry( Color( COL_CYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Cyan" ) ) );
+ aColorBox.InsertEntry( Color( COL_RED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Red" ) ) );
+ aColorBox.InsertEntry( Color( COL_MAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Magenta" ) ) );
+ aColorBox.InsertEntry( Color( COL_BROWN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Brown" ) ) );
+ aColorBox.InsertEntry( Color( COL_GRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Gray" ) ) );
+ aColorBox.InsertEntry( Color( COL_LIGHTGRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGray" ) ) );
+ aColorBox.InsertEntry( Color( COL_LIGHTBLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightBlue" ) ) );
+ aColorBox.InsertEntry( Color( COL_LIGHTGREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGreen" ) ) );
+ aColorBox.InsertEntry( Color( COL_LIGHTCYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightCyan" ) ) );
+ aColorBox.InsertEntry( Color( COL_LIGHTRED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightRed" ) ) );
+ aColorBox.InsertEntry( Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) );
+ aColorBox.InsertEntry( Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) );
+ aColorBox.InsertEntry( Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) );
+ aColorBox.SetUpdateMode( TRUE );
+ aColorBox.Show();
+ }
+
+ aEffectBox.SetPosSizePixel( Point( 10, 160 ), Size( 140, 175 ) );
+ aEffectBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Effects" ) ) );
+ aEffectBox.Show();
+
+ Size aSliderSize = aLineOrientSlider.GetSizePixel();
+ aLineOrientSlider.SetPosSizePixel( Point( 160, 335-aSliderSize.Height() ),
+ Size( 250, aSliderSize.Height() ) );
+ aLineOrientSlider.SetSlideHdl( LINK( this, MyFontDialog, AttrHdl ) );
+ aLineOrientSlider.Show();
+
+ aShowFont.SetPosSizePixel( Point( 165, 180 ), Size( 240, 70 ) );
+ aShowFont.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Sample" ) ) );
+ aShowFont.Show();
+
+ aSampleBox.SetPosSizePixel( Point( 160, 160 ), Size( 250, 100 ) );
+ aSampleBox.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Sample" ) ) );
+ aSampleBox.Show();
+
+ aMapText.SetPosSizePixel( Point( 160, 270 ), Size( 250, 35 ) );
+ aMapText.Show();
+
+ aOKBtn.SetPosSizePixel( Point( 340, 10 ), Size( 70, 25 ) );
+ aOKBtn.Show();
+
+ aCancelBtn.SetPosSizePixel( Point( 340, 40 ), Size( 70, 25 ) );
+ aCancelBtn.Show();
+
+ SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "FontDialog" ) ) );
+ SetOutputSizePixel( Size( 420, 345 ) );
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyFontDialog, SelectFont, ComboBox*, EMPTYARG )
+{
+ aStyleBox.Fill( aFontBox.GetText(), pList );
+ FontInfo aInfo = pList->Get( aFontBox.GetText(), aStyleBox.GetText() );
+ aSizeBox.Fill( aInfo, pList );
+ SetAttr();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyFontDialog, SelectStyle, ComboBox*, EMPTYARG )
+{
+ FontInfo aInfo = pList->Get( aFontBox.GetText(), aStyleBox.GetText() );
+ aSizeBox.Fill( aInfo, pList );
+ SetAttr();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyFontDialog, AttrHdl, Window*, EMPTYARG )
+{
+ SetAttr();
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void MyFontDialog::SetAttr()
+{
+ FontInfo aFont( pList->Get( aFontBox.GetText(), aStyleBox.GetText() ) );
+ aFont.SetSize( Size( 0, aSizeBox.GetValue() ) );
+ aFont.SetUnderline( (FontUnderline)aUnderlineBox.GetSelectEntryPos() );
+ aFont.SetStrikeout( (FontStrikeout)aStrikeoutBox.GetSelectEntryPos() );
+ aFont.SetColor( Color( (ColorName)aColorBox.GetSelectEntryPos() ) );
+ aFont.SetWordLineMode( aWordLineBox.IsChecked() );
+ aFont.SetShadow( aShadowBox.IsChecked() );
+ aFont.SetOutline( aOutlineBox.IsChecked() );
+ aFont.SetLineOrientation( aLineOrientSlider.GetOrientation() );
+ aFont.SetTransparent( TRUE );
+ aMapText.SetText( pList->GetFontMapText( aFont ) );
+ aShowFont.SetFont( aFont );
+}
+
+// -----------------------------------------------------------------------
+
+short MyFontDialog::Execute()
+{
+ pList = new FontList( &aPrinter, this );
+ aFontBox.Fill( pList );
+ aSizeBox.SetValue( 120 );
+ aUnderlineBox.SelectEntryPos( 0 );
+ aStrikeoutBox.SelectEntryPos( 0 );
+ aColorBox.SelectEntryPos( 0 );
+ SelectFont( &aFontBox );
+ short nRet = ModalDialog::Execute();
+ delete pList;
+ return nRet;
+}
+
+// -----------------------------------------------------------------------
+
+long MyTabBar::DeactivatePage()
+{
+ if ( GetCurPageId() == 6 )
+ {
+ QueryBox aQueryBox( this, WB_YES_NO | WB_DEF_YES,
+ XubString( RTL_CONSTASCII_USTRINGPARAM( "Deactivate" ) ) );
+ if ( aQueryBox.Execute() == RET_YES )
+ return TRUE;
+ else
+ return FALSE;
+ }
+ else
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+long MyTabBar::AllowRenaming()
+{
+ XubString aStr( RTL_CONSTASCII_USTRINGPARAM( "Allow renaming: " ) );
+ aStr += GetEditText();
+ QueryBox aQueryBox( this, WB_YES_NO_CANCEL | WB_DEF_YES, aStr );
+ long nRet = aQueryBox.Execute();
+ if ( nRet == RET_YES )
+ return TAB_RENAMING_YES;
+ else if ( nRet == RET_NO )
+ return TAB_RENAMING_NO;
+ else // ( nRet == RET_CANCEL )
+ return TAB_RENAMING_CANCEL;
+}
+
+// -----------------------------------------------------------------------
+
+void MyTabBar::Split()
+{
+ Size aSize = GetSizePixel();
+ long nWidth = GetSplitSize();
+ long nMaxWidth = GetParent()->GetOutputSizePixel().Width()-50;
+ if ( nWidth < GetMinSize() )
+ nWidth = GetMinSize();
+ else if ( nWidth > nMaxWidth )
+ nWidth = nMaxWidth;
+ SetSizePixel( Size( nWidth, aSize.Height() ) );
+}
+
+// -----------------------------------------------------------------------
+
+void MyTabBar::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.GetCommand() == COMMAND_STARTDRAG )
+ {
+ Region aRegion;
+ if ( StartDrag( rCEvt, aRegion ) )
+ {
+ DragServer::Clear();
+ DragServer::CopyString( XubString( RTL_CONSTASCII_USTRINGPARAM( "TabBar" ) ) );
+ if ( GetSelectPageCount() > 1 )
+ {
+ ExecuteDrag( Pointer( POINTER_MOVEFILES ),
+ Pointer( POINTER_COPYFILES ),
+ DRAG_ALL, &aRegion );
+ }
+ else
+ {
+ ExecuteDrag( Pointer( POINTER_MOVEFILE ),
+ Pointer( POINTER_COPYFILE ),
+ DRAG_ALL, &aRegion );
+ }
+ HideDropPos();
+ }
+ }
+}
+
+// -----------------------------------------------------------------------
+
+BOOL MyTabBar::QueryDrop( DropEvent& rDEvt )
+{
+ if ( rDEvt.IsLeaveWindow() )
+ HideDropPos();
+ else
+ ShowDropPos( rDEvt.GetPosPixel() );
+/*
+ if ( rDEvt.IsLeaveWindow() )
+ EndSwitchPage();
+ else
+ SwitchPage( rDEvt.GetPosPixel() );
+*/
+
+ return TRUE;
+}
+
+// -----------------------------------------------------------------------
+
+MyCalendar::MyCalendar( Window* pParent ) :
+ WorkWindow( pParent, WB_STDWORK ),
+ aCalendar( this, WB_TABSTOP | WB_WEEKNUMBER | WB_BOLDTEXT | WB_FRAMEINFO | WB_MULTISELECT ),
+ aInfoColor( COL_LIGHTBLUE ),
+ aHolidayColor( COL_LIGHTRED ),
+ aFrameColor( COL_LIGHTRED )
+{
+ const International& rIntn = aCalendar.GetInternational();
+ aMenuBar.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Wochen~anfang" ) ) );
+ aMenuBar.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Erste Woche" ) ) );
+ aMenuBar.SetPopupMenu( 1, &aWeekStartMenu );
+ aMenuBar.SetPopupMenu( 2, &aWeekCountMenu );
+ for ( USHORT i = 0; i < 7; i++ )
+ aWeekStartMenu.InsertItem( 10+i, rIntn.GetDayText( (DayOfWeek)i ), MIB_AUTOCHECK | MIB_RADIOCHECK );
+ aWeekStartMenu.CheckItem( 10+(USHORT)rIntn.GetWeekStart() );
+ aWeekCountMenu.InsertItem( 20, XubString( RTL_CONSTASCII_USTRINGPARAM( "~1. Januar" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
+ aWeekCountMenu.InsertItem( 21, XubString( RTL_CONSTASCII_USTRINGPARAM( "Erste 4 ~Tage-Woche" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
+ aWeekCountMenu.InsertItem( 22, XubString( RTL_CONSTASCII_USTRINGPARAM( "Erste ~volle Woche" ) ), MIB_AUTOCHECK | MIB_RADIOCHECK );
+ aWeekCountMenu.CheckItem( 20+(USHORT)rIntn.GetWeekCountStart() );
+ aMenuBar.SetSelectHdl( LINK( this, MyCalendar, MenuSelectHdl ) );
+ SetMenuBar( &aMenuBar );
+
+ Date aCurDate = aCalendar.GetCurDate();
+ aCalendar.SetRequestDateInfoHdl( LINK( this, MyCalendar, RequestDateInfoHdl ) );
+ aCalendar.SetDoubleClickHdl( LINK( this, MyCalendar, DoubleClickHdl ) );
+ aCalendar.SetSaturdayColor( Color( COL_LIGHTGREEN ) );
+ aCalendar.SetSundayColor( aHolidayColor );
+ aCalendar.AddDateInfo( Date( 1, 1, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Neujahr" ) ), &aHolidayColor, NULL );
+ aCalendar.AddDateInfo( Date( 24, 12, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Heiligabend" ) ), &aInfoColor, NULL );
+ aCalendar.AddDateInfo( Date( 25, 12, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "1. Weihnachttag" ) ), &aHolidayColor, NULL );
+ aCalendar.AddDateInfo( Date( 26, 12, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "2. Weihnachttag" ) ), &aHolidayColor, NULL );
+ aCalendar.AddDateInfo( Date( 31, 12, 0 ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Silvester" ) ), &aInfoColor, NULL );
+ aCalendar.SetPosPixel( Point() );
+ aCalendar.SetFirstDate( Date( 1, 1, aCurDate.GetYear() ) );
+ aCalendar.Show();
+
+ SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Calendar" ) ) );
+ SetOutputSizePixel( aCalendar.CalcWindowSizePixel( 3, 4 ) );
+}
+
+// -----------------------------------------------------------------------
+
+MyCalendar::~MyCalendar()
+{
+ SetMenuBar( NULL );
+ aMenuBar.SetPopupMenu( 1, NULL );
+ aMenuBar.SetPopupMenu( 2, NULL );
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyCalendar, RequestDateInfoHdl, Calendar*, EMPTYARG )
+{
+ USHORT nRequestYear = aCalendar.GetRequestYear();
+ if ( (nRequestYear >= 1954) && (nRequestYear <= 1989) )
+ aCalendar.AddDateInfo( Date( 17, 6, nRequestYear ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Tag der deutschen Einheit" ) ), &aHolidayColor, NULL );
+ else if ( nRequestYear >= 1990 )
+ aCalendar.AddDateInfo( Date( 3, 10, nRequestYear ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Tag der deutschen Einheit" ) ), &aHolidayColor, NULL );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyCalendar, DoubleClickHdl, Calendar*, EMPTYARG )
+{
+ Date aDate = aCalendar.GetCurDate();
+ String aStr( RTL_CONSTASCII_USTRINGPARAM( "Info: " ) );
+ aStr += Application::GetAppInternational().GetDate( aDate );
+ aCalendar.AddDateInfo( aDate, aStr, NULL, &aFrameColor, DIB_BOLD );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyCalendar, MenuSelectHdl, Menu*, pMenu )
+{
+ International aIntn = aCalendar.GetInternational();
+ USHORT nItemId = pMenu->GetCurItemId();
+
+ if ( (nItemId >= 10) && (nItemId <= 19) )
+ aIntn.SetWeekStart( (DayOfWeek)(nItemId-10) );
+ else if ( (nItemId >= 20) && (nItemId <= 29) )
+ aIntn.SetWeekCountStart( (WeekCountStart)(nItemId-20) );
+ aCalendar.SetInternational( aIntn );
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void MyCalendar::Resize()
+{
+ aCalendar.SetSizePixel( GetOutputSizePixel() );
+}
+
+// -----------------------------------------------------------------------
+
+MyWin::MyWin( Window* pParent, WinBits aWinStyle ) :
+ WorkWindow(pParent, aWinStyle | WB_SVLOOK ),
+ aBox( this, WB_BORDER | WB_SVLOOK ),
+ aBar( this, WB_BORDER | WB_SVLOOK | WB_RIGHT ),
+ aHeadBar( this, WB_BORDER | WB_SVLOOK | WB_DRAG | WB_BUTTONSTYLE ),
+ aColorList( this ),
+ aLineList( this ),
+ aValueSet( this, WB_TABSTOP | WB_NAMEFIELD | WB_NONEFIELD | WB_BORDER | WB_ITEMBORDER | WB_VSCROLL /* | WB_FLATVALUESET */ ),
+ aCalendarField( this, WB_TABSTOP | WB_SPIN | WB_REPEAT | WB_DROPDOWN | WB_BORDER ),
+ aCalendarField2( this, WB_TABSTOP | WB_SPIN | WB_REPEAT | WB_DROPDOWN | WB_BORDER ),
+ aTabBar( this, WB_BORDER | WB_MULTISELECT | WB_SCROLL | WB_SIZEABLE | WB_DRAG ),
+ aPrgsBar( this ),
+ aFontBtn( this ),
+ aCalendarBtn( this ),
+ aPrnSetupBtn( this ),
+ aPrnDlgBtn( this )
+{
+ SetBackground( Wallpaper( GetSettings().GetStyleSettings().GetFaceColor() ) );
+
+ pCalendar = NULL;
+ pMenu = NULL;
+
+ Bitmap aBmp;
+ aBox.InsertItem( 1, aBmp );
+ aBox.InsertItem( 2, aBmp );
+ aBox.InsertItem( 3, aBmp );
+ aBox.InsertItem( 4, aBmp );
+ aBox.InsertSeparator();
+ aBox.InsertItem( 5, aBmp );
+ aBox.InsertItem( 6, aBmp );
+ aBox.InsertItem( 7, aBmp );
+ aBox.InsertItem( 8, aBmp );
+ aBox.InsertSpace();
+ aBox.InsertItem( 9, aBmp );
+ aBox.SetPosPixel( Point( 0, 0 ) );
+ aBoxSize = aBox.GetSizePixel();
+ aBox.Show();
+
+ aBar.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Ready" ) ) );
+ aBar.InsertItem( 1, 35 );
+ aBar.InsertItem( 2, 55 );
+ aBar.InsertItem( 3, 55 );
+ aBar.SetItemText( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ) );
+ aBar.SetItemText( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "21.01.93" ) ) );
+ aBar.SetItemText( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "12:00:00" ) ) );
+ aBar.Show();
+
+ long nY = aBox.GetSizePixel().Height()+10;
+ {
+ aHeadBar.SetPosPixel( Point( 0, nY ) );
+ aHeadBar.InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Sender" ) ), 150 );
+ aHeadBar.InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Subject" ) ), 150, HIB_CENTER | HIB_VCENTER | HIB_CLICKABLE );
+ aHeadBar.InsertItem( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "Date" ) ), 75 );
+ aHeadBar.InsertItem( 4, XubString( RTL_CONSTASCII_USTRINGPARAM( "Size" ) ), 60, HIB_RIGHT | HIB_VCENTER | HIB_CLICKABLE );
+ aHeadBar.InsertItem( 9999, String(), HEADERBAR_FULLSIZE, HIB_RIGHT | HIB_VCENTER | HIB_FIXEDPOS );
+ aHeadBar.SetSelectHdl( LINK( this, MyWin, SelectHdl ) );
+ aHeadBar.Show();
+ nY += aHeadBar.GetSizePixel().Height() += 10;
+ }
+
+ {
+ aColorList.SetPosSizePixel( Point( 10, nY ), Size( 130, 180 ) );
+ aColorList.SetUpdateMode( FALSE );
+ aColorList.InsertEntry( Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) );
+ aColorList.InsertEntry( Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) );
+ aColorList.InsertEntry( Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) );
+ aColorList.InsertEntry( Color( COL_CYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Cyan" ) ) );
+ aColorList.InsertEntry( Color( COL_RED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Red" ) ) );
+ aColorList.InsertEntry( Color( COL_MAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Magenta" ) ) );
+ aColorList.InsertEntry( Color( COL_BROWN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Brown" ) ) );
+ aColorList.InsertEntry( Color( COL_GRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Gray" ) ) );
+ aColorList.InsertEntry( Color( COL_LIGHTGRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGray" ) ) );
+ aColorList.InsertEntry( Color( COL_LIGHTBLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightBlue" ) ) );
+ aColorList.InsertEntry( Color( COL_LIGHTGREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGreen" ) ) );
+ aColorList.InsertEntry( Color( COL_LIGHTCYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightCyan" ) ) );
+ aColorList.InsertEntry( Color( COL_LIGHTRED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightRed" ) ) );
+ aColorList.InsertEntry( Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) );
+ aColorList.InsertEntry( Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) );
+ aColorList.InsertEntry( Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) );
+ aColorList.SetUpdateMode( TRUE );
+ aColorList.SetSelectHdl( LINK( this, MyWin, SelectHdl ) );
+ aColorList.Show();
+ }
+
+ {
+ aLineList.SetPosSizePixel( Point( 150, nY ), Size( 130, 180 ) );
+ aLineList.SetUnit( FUNIT_POINT );
+ aLineList.SetSourceUnit( FUNIT_TWIP );
+ aLineList.InsertEntry( XubString( RTL_CONSTASCII_USTRINGPARAM( "Hairline" ) ) );
+ aLineList.InsertEntry( 1500 );
+ aLineList.InsertEntry( 3000 );
+ aLineList.InsertEntry( 4500 );
+ aLineList.InsertEntry( 6000 );
+ aLineList.InsertEntry( 7500 );
+ aLineList.InsertEntry( 9000 );
+ aLineList.InsertEntry( 1500, 1500, 1500 );
+ aLineList.InsertEntry( 3000, 1500, 1500 );
+ aLineList.InsertEntry( 4500, 1500, 1500 );
+ aLineList.InsertEntry( 3000, 3000, 1500 );
+ aLineList.InsertEntry( 4500, 3000, 1500 );
+ aLineList.InsertEntry( 4500, 4500, 1500 );
+ aLineList.Show();
+ }
+
+ {
+ aValueSet.SetPosSizePixel( Point( 290, nY ), Size( 130, 180 ) );
+ aValueSet.InsertItem( 9, Color( COL_BLACK ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Black" ) ) );
+ aValueSet.InsertItem( 10, Color( COL_BLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Blue" ) ) );
+ aValueSet.InsertItem( 11, Color( COL_GREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Green" ) ) );
+ aValueSet.InsertItem( 12, Color( COL_CYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Cyan" ) ) );
+ aValueSet.InsertItem( 13, Color( COL_RED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Red" ) ) );
+ aValueSet.InsertItem( 14, Color( COL_MAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Magenta" ) ) );
+ aValueSet.InsertItem( 15, Color( COL_BROWN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Brown" ) ) );
+ aValueSet.InsertItem( 16, Color( COL_GRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Gray" ) ) );
+ aValueSet.InsertItem( 17, Color( COL_LIGHTGRAY ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGray" ) ) );
+ aValueSet.InsertItem( 18, Color( COL_LIGHTBLUE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightBlue" ) ) );
+ aValueSet.InsertItem( 19, Color( COL_LIGHTGREEN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightGreen" ) ) );
+ aValueSet.InsertItem( 20, Color( COL_LIGHTCYAN ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightCyan" ) ) );
+ aValueSet.InsertItem( 21, Color( COL_LIGHTRED ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightRed" ) ) );
+ aValueSet.InsertItem( 22, Color( COL_LIGHTMAGENTA ), XubString( RTL_CONSTASCII_USTRINGPARAM( "LightMagenta" ) ) );
+ aValueSet.InsertItem( 23, Color( COL_YELLOW ), XubString( RTL_CONSTASCII_USTRINGPARAM( "Yellow" ) ) );
+ aValueSet.InsertItem( 24, Color( COL_WHITE ), XubString( RTL_CONSTASCII_USTRINGPARAM( "White" ) ) );
+ aValueSet.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "None" ) ) );
+ aValueSet.SetColCount( 4 );
+ aValueSet.SetLineCount( 4 );
+ aValueSet.SetSelectHdl( LINK( this, MyWin, SelectHdl ) );
+ aValueSet.Show();
+ }
+
+ {
+ aCalendarField.EnableEmptyFieldValue( TRUE );
+ aCalendarField.SetCalendarStyle( aCalendarField.GetCalendarStyle() | WB_RANGESELECT );
+ aCalendarField.SetSelectHdl( LINK( this, MyWin, CalSelectHdl ) );
+// aCalendarField.SetDate( Date() );
+ aCalendarField.SetEmptyDate();
+ aCalendarField.EnableToday();
+ aCalendarField.EnableNone();
+ aCalendarField.SetPosSizePixel( Point( 430, nY ), Size( 130, 20 ) );
+ aCalendarField.Show();
+ }
+
+ {
+ aCalendarField2.SetDate( Date() );
+ aCalendarField2.SetPosSizePixel( Point( 570, nY ), Size( 130, 20 ) );
+ aCalendarField2.Show();
+ }
+
+ nY += 200;
+ {
+ aTabBar.SetPosSizePixel( Point( 10, nY ),
+ Size( 300, aTabBar.GetSizePixel().Height() ) );
+ aTabBar.InsertPage( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 1" ) ) );
+ aTabBar.InsertPage( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 2" ) ) );
+ aTabBar.InsertPage( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 3" ) ) );
+ aTabBar.InsertPage( 4, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 4" ) ) );
+ aTabBar.InsertPage( 5, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 5" ) ) );
+ aTabBar.InsertPage( 6, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 6" ) ) );
+ aTabBar.InsertPage( 7, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 7" ) ) );
+ aTabBar.InsertPage( 8, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 8" ) ) );
+ aTabBar.InsertPage( 9, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 9" ) ) );
+ aTabBar.InsertPage( 10, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 10" ) ) );
+ aTabBar.InsertPage( 11, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 11" ) ) );
+ aTabBar.InsertPage( 12, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 12" ) ) );
+ aTabBar.InsertPage( 13, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 13" ) ) );
+ aTabBar.InsertPage( 14, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 14" ) ) );
+ aTabBar.InsertPage( 15, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 15" ) ) );
+ aTabBar.InsertPage( 16, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 16" ) ) );
+ aTabBar.InsertPage( 17, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 17" ) ) );
+ aTabBar.InsertPage( 18, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 18" ) ) );
+ aTabBar.InsertPage( 19, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 19" ) ) );
+ aTabBar.InsertPage( 20, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 20" ) ) );
+ aTabBar.InsertPage( 21, XubString( RTL_CONSTASCII_USTRINGPARAM( "This is a long Page Text" ) ) );
+ aTabBar.InsertPage( 22, XubString( RTL_CONSTASCII_USTRINGPARAM( "Short Text" ) ) );
+ aTabBar.InsertPage( 23, XubString( RTL_CONSTASCII_USTRINGPARAM( "And now a very very long Page Text" ) ) );
+ aTabBar.InsertPage( 24, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 24" ) ) );
+ aTabBar.InsertPage( 25, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 25" ) ) );
+ aTabBar.InsertPage( 26, XubString( RTL_CONSTASCII_USTRINGPARAM( "And now a very long Page Text" ) ) );
+ aTabBar.InsertPage( 27, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 27" ) ) );
+ aTabBar.InsertPage( 28, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 28" ) ) );
+ aTabBar.InsertPage( 29, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 29" ) ) );
+ aTabBar.InsertPage( 30, XubString( RTL_CONSTASCII_USTRINGPARAM( "Page 30" ) ) );
+ aTabBar.EnableEditMode();
+ aTabBar.Show();
+ }
+
+ nY += 35;
+ {
+ aPrgsBar.SetPosPixel( Point( 10, nY ) );
+ aPrgsBar.Show();
+ }
+
+ nY += 40;
+ {
+ aFontBtn.SetPosSizePixel( Point( 10, nY ), Size( 100, 30 ) );
+ aFontBtn.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Font..." ) ) );
+ aFontBtn.SetClickHdl( LINK( this, MyWin, Test ) );
+ aFontBtn.Show();
+
+ aCalendarBtn.SetPosSizePixel( Point( 120, nY ), Size( 100, 30 ) );
+ aCalendarBtn.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Calendar" ) ) );
+ aCalendarBtn.SetClickHdl( LINK( this, MyWin, Test ) );
+ aCalendarBtn.Show();
+
+ aPrnSetupBtn.SetPosSizePixel( Point( 230, nY ), Size( 100, 30 ) );
+ aPrnSetupBtn.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "PrnSetup..." ) ) );
+ aPrnSetupBtn.SetClickHdl( LINK( this, MyWin, Test ) );
+ aPrnSetupBtn.Show();
+
+ aPrnDlgBtn.SetPosSizePixel( Point( 340, nY ), Size( 100, 30 ) );
+ aPrnDlgBtn.SetText( XubString( RTL_CONSTASCII_USTRINGPARAM( "Print...." ) ) );
+ aPrnDlgBtn.SetClickHdl( LINK( this, MyWin, Test ) );
+ aPrnDlgBtn.Show();
+ }
+}
+
+// -----------------------------------------------------------------------
+
+MyWin::~MyWin()
+{
+ if ( pCalendar )
+ delete pCalendar;
+
+ if ( pMenu )
+ {
+ delete pMenu;
+ delete pNameMenu;
+ delete pStyleMenu;
+ delete pSizeMenu;
+ }
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyWin, Test, PushButton*, pBtn )
+{
+ if ( pBtn == &aFontBtn )
+ {
+ MyFontDialog* pDlg = new MyFontDialog( this );
+ pDlg->Execute();
+ delete pDlg;
+ }
+ else if ( pBtn == &aCalendarBtn )
+ {
+ if ( !pCalendar )
+ pCalendar = new MyCalendar( this );
+ pCalendar->ToTop();
+ pCalendar->Show();
+ }
+ else if ( pBtn == &aPrnSetupBtn )
+ {
+ PrinterSetupDialog* pDlg = new PrinterSetupDialog( this );
+ pDlg->SetPrinter( &aPrn );
+ pDlg->Execute();
+ delete pDlg;
+ }
+ else if ( pBtn == &aPrnDlgBtn )
+ {
+ PrintDialog* pDlg = new PrintDialog( this );
+ pDlg->SetPrinter( &aPrn );
+ pDlg->EnableRange( PRINTDIALOG_ALL );
+ pDlg->EnableRange( PRINTDIALOG_RANGE );
+ pDlg->Execute();
+ delete pDlg;
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyWin, SelectHdl, Window*, pCtrl )
+{
+ if ( pCtrl == &aColorList )
+ {
+ Color aColor = aColorList.GetSelectEntryColor();
+ aValueSet.SetColor( aColor );
+ aLineList.SetColor( aColor );
+ }
+ else if ( pCtrl == &aValueSet )
+ {
+ USHORT nId = aValueSet.GetSelectItemId();
+ if ( nId > 8 )
+ {
+ Color aColor = aValueSet.GetItemColor( nId );
+ aValueSet.SetFillColor( aColor );
+ }
+ }
+ else if ( pCtrl == &aHeadBar )
+ {
+ USHORT nCurItemId = aHeadBar.GetCurItemId();
+ for ( USHORT i = 0; i < aHeadBar.GetItemCount(); i++ )
+ {
+ USHORT nItemId = aHeadBar.GetItemId( i );
+ HeaderBarItemBits nBits = aHeadBar.GetItemBits( nItemId );
+ if ( nItemId == nCurItemId )
+ {
+ HeaderBarItemBits nOldBits = nBits;
+ nBits &= ~(HIB_DOWNARROW | HIB_UPARROW);
+ if ( nOldBits & HIB_DOWNARROW )
+ nBits |= HIB_UPARROW;
+ else
+ nBits |= HIB_DOWNARROW;
+ }
+ else
+ nBits &= ~(HIB_DOWNARROW | HIB_UPARROW);
+ aHeadBar.SetItemBits( nItemId, nBits );
+ }
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+IMPL_LINK( MyWin, CalSelectHdl, CalendarField*, pCtrl )
+{
+ if ( pCtrl == &aCalendarField )
+ {
+ Calendar* pCalendar = pCtrl->GetCalendar();
+ aCalendarField2.SetDate( pCalendar->GetSelectDate( pCalendar->GetSelectDateCount()-1 ) );
+ }
+
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
+void MyWin::ContextMenu( const Point& rPos )
+{
+ FontList aList( this );
+
+ if ( !pMenu )
+ {
+ pMenu = new PopupMenu;
+ pNameMenu = new FontNameMenu;
+ pStyleMenu = new FontStyleMenu;
+ pSizeMenu = new FontSizeMenu;
+
+ pMenu->InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "Font" ) ) );
+ pMenu->InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Attribute" ) ) );
+ pMenu->InsertItem( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "Height" ) ) );
+ pMenu->SetPopupMenu( 1, pNameMenu );
+ pMenu->SetPopupMenu( 2, pStyleMenu );
+ pMenu->SetPopupMenu( 3, pSizeMenu );
+
+ pNameMenu->Fill( &aList );
+ pNameMenu->SetCurName( aList.GetFontName( 0 ).GetName() );
+
+ pStyleMenu->InsertSeparator();
+ pStyleMenu->InsertItem( 1, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Underline" ) ), MIB_CHECKABLE | MIB_AUTOCHECK );
+ pStyleMenu->InsertItem( 2, XubString( RTL_CONSTASCII_USTRINGPARAM( "Stri~keout" ) ), MIB_CHECKABLE | MIB_AUTOCHECK );
+ pStyleMenu->InsertItem( 3, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Shadow" ) ), MIB_CHECKABLE | MIB_AUTOCHECK );
+ pStyleMenu->InsertItem( 4, XubString( RTL_CONSTASCII_USTRINGPARAM( "~Outline" ) ), MIB_CHECKABLE | MIB_AUTOCHECK );
+ }
+
+ pStyleMenu->Fill( pNameMenu->GetCurName(), &aList );
+ pSizeMenu->Fill( aList.Get( pNameMenu->GetCurName(),
+ pStyleMenu->GetCurStyle() ), &aList );
+
+ pMenu->Execute( this, rPos );
+}
+
+// -----------------------------------------------------------------------
+
+void MyWin::Command( const CommandEvent& rCEvt )
+{
+ if ( rCEvt.GetCommand() == COMMAND_CONTEXTMENU )
+ ContextMenu( OutputToScreenPixel( rCEvt.GetMousePosPixel() ) );
+}
+
+// -----------------------------------------------------------------------
+
+void MyWin::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ aValueSet.StartSelection();
+ WorkWindow::MouseButtonDown( rMEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void MyWin::KeyInput( const KeyEvent& rKEvt )
+{
+ if ( rKEvt.GetKeyCode().GetCode() == KEY_P )
+ {
+ for ( USHORT i = 0; i <= 130; i += 2 )
+ {
+ for ( USHORT j = 0; j < 6000; j++ )
+ {
+ aPrgsBar.SetValue( i );
+ Application::Reschedule();
+ }
+ }
+ }
+ else if ( rKEvt.GetCharCode() == '+' )
+ aHeadBar.SetOffset( aHeadBar.GetOffset()+1 );
+ else if ( rKEvt.GetCharCode() == '-' )
+ aHeadBar.SetOffset( aHeadBar.GetOffset()-1 );
+
+ WorkWindow::KeyInput( rKEvt );
+}
+
+// -----------------------------------------------------------------------
+
+void MyWin::Paint( const Rectangle& rRect )
+{
+ WorkWindow::Paint( rRect );
+}
+
+// -----------------------------------------------------------------------
+
+void MyWin::Resize()
+{
+ Size aWinSize = GetOutputSizePixel();
+
+ aBox.SetSizePixel( Size( aWinSize.Width(), aBoxSize.Height() ) );
+
+ Size aSize = aBar.GetSizePixel();
+ aBar.SetPosSizePixel( Point( 0, aWinSize.Height()-aSize.Height() ),
+ Size( aWinSize.Width(), aSize.Height() ) );
+
+ Size aBarSize = aSize;
+ Point aPos = aHeadBar.GetPosPixel();
+ aSize = aHeadBar.GetSizePixel();
+ aHeadBar.SetSizePixel( Size( aWinSize.Width(), aSize.Height() ) );
+ aHeadBar.SetDragSize( aWinSize.Height() - aSize.Height() - aPos.Y() - aBarSize.Height() );
+
+ aPos = aPrgsBar.GetPosPixel();
+ aSize = aPrgsBar.GetSizePixel();
+ if ( aPos.X() < aWinSize.Width()-10 )
+ aPrgsBar.SetSizePixel( Size( aWinSize.Width()-aPos.X()-10, aSize.Height() ) );
+}
+
+// -----------------------------------------------------------------------
+
+MyApp aMyApp;
diff --git a/svtools/workben/urange.cxx b/svtools/workben/urange.cxx
new file mode 100644
index 000000000000..44e9e868362c
--- /dev/null
+++ b/svtools/workben/urange.cxx
@@ -0,0 +1,251 @@
+/*************************************************************************
+ *
+ * $RCSfile: urange.cxx,v $
+ *
+ * $Revision: 1.1.1.1 $
+ *
+ * last change: $Author: hr $ $Date: 2000-09-18 16:59:07 $
+ *
+ * The Contents of this file are made available subject to the terms of
+ * either of the following licenses
+ *
+ * - GNU Lesser General Public License Version 2.1
+ * - Sun Industry Standards Source License Version 1.1
+ *
+ * Sun Microsystems Inc., October, 2000
+ *
+ * GNU Lesser General Public License Version 2.1
+ * =============================================
+ * Copyright 2000 by Sun Microsystems, Inc.
+ * 901 San Antonio Road, Palo Alto, CA 94303, USA
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software Foundation.
+ *
+ * This library 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 for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ *
+ * Sun Industry Standards Source License Version 1.1
+ * =================================================
+ * The contents of this file are subject to the Sun Industry Standards
+ * Source License Version 1.1 (the "License"); You may not use this file
+ * except in compliance with the License. You may obtain a copy of the
+ * License at http://www.openoffice.org/license.html.
+ *
+ * Software provided under this License is provided on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
+ * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
+ * See the License for the specific provisions governing your rights and
+ * obligations concerning the Software.
+ *
+ * The Initial Developer of the Original Code is: Sun Microsystems, Inc.
+ *
+ * Copyright: 2000 by Sun Microsystems, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * Contributor(s): _______________________________________
+ *
+ *
+ ************************************************************************/
+
+/* Test the SfxUShortRanges class */
+
+#ifndef _SFXITEMS_HXX
+#include <sfxitems.hxx>
+#endif
+
+USHORT nValues1[] = {340,472,482,4288,4374,4890,5026,5356,5724,6130,6186,6666,9222,9764,9908,
+ 10110,11302,11748,11946,12298,12344,12642,12958,13076,13410,13496,14462,
+ 14480,14592,16292,16788,17102,17792,17844,18182,18396,18522,18974,19292,
+ 19630,20336,21808,21972,22382,23568,25156,26978,27158,27730,28014,28280,
+ 28774,29258,30920,30938,31356,31582,32194,32734,32893,33757,33911,34013,
+ 34565,35283,38895,40273,41281,42157,44429,44553,45825,46367,48163,48417,
+ 49501,50499,52105,53035,53715,53899,54015,54131,54865,55155,55507,56325,
+ 57045,59243,59833,59859,59951,60361,61387,62453,62703,63155,63517,63621,
+ 63895,0};
+
+USHORT nValues2[] = {2362,3100,3286,3548,4056,4224,5058,5198,5398,5990,6910,7034,7046,8574,8762,
+ 9360,9494,9720,11432,12900,12946,13626,13844,14344,15028,16306,16494,16972,
+ 17340,17504,17610,18270,18506,19832,19962,20356,20792,21146,21270,21722,
+ 22486,22752,23554,24148,24210,24910,25006,25500,26464,26952,27216,28394,
+ 28398,29602,31130,31642,31894,33343,34191,34593,34931,36221,36637,37287,
+ 37765,39853,41231,41711,41799,44213,44863,46491,47459,48707,48911,49353,
+ 49923,49997,50117,51357,51519,52043,52563,52727,53781,54065,54249,55333,
+ 56549,57361,57777,58165,58507,59229,59719,60379,60845,62697,63123,65169,0};
+
+#include <sv.hxx>
+
+SfxUShortRanges aRanges1a( nValues1 );
+SfxUShortRanges aRanges1b( nValues1 );
+SfxUShortRanges aRanges1c( nValues1 );
+SfxUShortRanges aRanges2( nValues2 );
+
+
+String aStr1;
+String aStr2;
+String aStr3;
+
+
+static String MakeString_Impl( SfxUShortRanges& aRanges )
+{
+ String aStr;
+
+ USHORT nPos = 0;
+ const USHORT* pRanges = ( const USHORT*)aRanges;
+
+ while( pRanges[ nPos ] != 0 )
+ {
+ aStr += pRanges[ nPos ];
+ aStr += " - ";
+ aStr += pRanges[ nPos+1 ];
+ aStr += ", ";
+ nPos += 2;
+ }
+
+
+ return aStr;
+}
+
+
+// -------------------------------------------------------------------------
+
+class MyApp : public Application
+{
+public:
+ void Main( int, char* [] );
+};
+
+// -------------------------------------------------------------------------
+
+class MyDialog : public ModalDialog
+{
+private:
+ GroupBox aGroup1;
+ MultiLineEdit aEdit1;
+ GroupBox aGroup2;
+ MultiLineEdit aEdit2;
+ GroupBox aGroup3;
+ MultiLineEdit aEdit3;
+ OKButton aBtn1;
+ CancelButton aBtn2;
+
+public:
+ MyDialog( Window* pParent );
+
+ void MouseButtonDown( const MouseEvent& rMEvt );
+};
+
+// -------------------------------------------------------------------------
+
+MyDialog::MyDialog( Window* pParent ) :
+ ModalDialog( pParent, WB_STDMODAL | WB_SVLOOK ),
+ aGroup1( this ),
+ aEdit1( this, WB_BORDER | WB_READONLY ),
+ aGroup2( this ),
+ aEdit2( this, WB_BORDER | WB_READONLY ),
+ aGroup3( this ),
+ aEdit3( this, WB_BORDER | WB_READONLY ),
+ aBtn1( this, WB_DEFBUTTON ),
+ aBtn2( this )
+{
+ aGroup1.SetText( "Union" );
+ aGroup1.SetPosSizePixel( Point( 5, 5 ), Size( 330, 80 ) );
+ aGroup1.Show();
+
+ aEdit1.SetPosSizePixel( Point ( 10, 20 ), Size( 320, 60 ) );
+ aEdit1.SetText( aStr1 );
+ aEdit1.Show();
+
+ aGroup2.SetText( "Difference" );
+ aGroup2.SetPosSizePixel( Point( 5, 90 ), Size( 330, 80 ) );
+ aGroup2.Show();
+
+ aEdit2.SetPosSizePixel( Point( 10, 105 ), Size( 320, 60 ) );
+ aEdit2.SetText( aStr2 );
+ aEdit2.Show();
+
+ aGroup3.SetText( "Intersection" );
+ aGroup3.SetPosSizePixel( Point( 5, 175 ), Size( 330, 80 ) );
+ aGroup3.Show();
+
+ aEdit3.SetPosSizePixel( Point( 10, 190 ), Size( 320, 60 ) );
+ aEdit3.SetText( aStr3 );
+ aEdit3.Show();
+
+ aBtn1.SetPosSizePixel( Point( 10, 310 ), Size( 100, 25 ) );
+ aBtn1.Show();
+
+ aBtn2.SetPosSizePixel( Point( 120, 310 ), Size( 100, 25 ) );
+ aBtn2.Show();
+
+ SetOutputSizePixel( Size( 340, 345 ) );
+ SetText( "SfxUShortRanges Test" );
+}
+
+// -------------------------------------------------------------------------
+
+void MyDialog::MouseButtonDown( const MouseEvent& rMEvt )
+{
+}
+
+
+// -------------------------------------------------------------------------
+
+class MyWin : public WorkWindow
+{
+public:
+ MyWin( Window* pParent, WinBits aWinStyle ) :
+ WorkWindow( pParent, aWinStyle )
+ {}
+
+ void MouseButtonDown( const MouseEvent& );
+};
+
+
+// -------------------------------------------------------------------------
+
+MyApp aMyApp;
+
+void MyApp::Main( int, char* [] )
+{
+ EnableSVLook();
+ SetAppFont( System::GetStandardFont( STDFONT_APP ) );
+
+ MyWin aMainWin( NULL, WB_APP | WB_STDWORK );
+ aMainWin.SetText( "SfxUShortRanges - Test" );
+ aMainWin.Show();
+
+ aRanges1a += aRanges2;
+ aRanges1b -= aRanges2;
+ aRanges1c /= aRanges2;
+
+ aStr1 = MakeString_Impl( aRanges1a );
+ aStr2 = MakeString_Impl( aRanges1b );
+ aStr3 = MakeString_Impl( aRanges1c );
+
+ Execute();
+}
+
+// -------------------------------------------------------------------------
+
+void MyWin::MouseButtonDown( const MouseEvent& rMEvt )
+{
+ if( rMEvt.IsLeft() )
+ {
+ MyDialog* pDialog = new MyDialog( this );
+ pDialog->Execute();
+ delete pDialog;
+ }
+}
+