summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--basegfx/test/basegfx2d.cxx7
-rwxr-xr-xcanvas/source/directx/dx_winstuff.hxx12
-rw-r--r--comphelper/inc/comphelper/weakeventlistener.hxx2
-rw-r--r--comphelper/source/property/opropertybag.cxx9
-rw-r--r--comphelper/source/property/property.cxx25
-rw-r--r--cppcanvas/inc/cppcanvas/color.hxx10
-rw-r--r--goodies/source/filter.vcl/ieps/ieps.cxx68
-rw-r--r--goodies/source/filter.vcl/ipbm/ipbm.cxx11
-rw-r--r--l10ntools/inc/cfgmerge.hxx (renamed from transex3/inc/cfgmerge.hxx)0
-rw-r--r--l10ntools/inc/export.hxx (renamed from transex3/inc/export.hxx)6
-rw-r--r--l10ntools/inc/gsicheck.hxx (renamed from transex3/inc/gsicheck.hxx)0
-rw-r--r--l10ntools/inc/helpmerge.hxx (renamed from transex3/inc/helpmerge.hxx)0
-rw-r--r--l10ntools/inc/inireader.hxx (renamed from transex3/inc/inireader.hxx)0
-rw-r--r--l10ntools/inc/l10ntools/directory.hxx (renamed from transex3/inc/transex3/directory.hxx)6
-rw-r--r--l10ntools/inc/l10ntools/file.hxx (renamed from transex3/inc/transex3/file.hxx)0
-rw-r--r--l10ntools/inc/l10ntools/vosapp.hxx (renamed from transex3/inc/transex3/vosapp.hxx)0
-rw-r--r--l10ntools/inc/lngmerge.hxx (renamed from transex3/inc/lngmerge.hxx)0
-rw-r--r--l10ntools/inc/makefile.mk (renamed from transex3/inc/makefile.mk)2
-rw-r--r--l10ntools/inc/pch/precompiled_l10ntools.cxx (renamed from transex3/inc/pch/precompiled_transex3.cxx)2
-rw-r--r--l10ntools/inc/pch/precompiled_l10ntools.hxx (renamed from transex3/inc/pch/precompiled_transex3.hxx)0
-rw-r--r--l10ntools/inc/srciter.hxx (renamed from transex3/inc/srciter.hxx)6
-rw-r--r--l10ntools/inc/tagtest.hxx (renamed from transex3/inc/tagtest.hxx)0
-rw-r--r--l10ntools/inc/tokens.h (renamed from transex3/inc/tokens.h)0
-rw-r--r--l10ntools/inc/treeconfig.hxx (renamed from transex3/inc/treeconfig.hxx)0
-rw-r--r--l10ntools/inc/utf8conv.hxx (renamed from transex3/inc/utf8conv.hxx)0
-rw-r--r--l10ntools/inc/wrdtrans.hxx (renamed from transex3/inc/wrdtrans.hxx)0
-rw-r--r--l10ntools/inc/wtranode.hxx (renamed from transex3/inc/wtranode.hxx)0
-rw-r--r--l10ntools/inc/wtratree.hxx (renamed from transex3/inc/wtratree.hxx)0
-rw-r--r--l10ntools/inc/xmlparse.hxx (renamed from transex3/inc/xmlparse.hxx)0
-rw-r--r--l10ntools/inc/xmlutil.hxx (renamed from transex3/inc/xmlutil.hxx)0
-rw-r--r--l10ntools/inc/xrmmerge.hxx (renamed from transex3/inc/xrmmerge.hxx)0
-rwxr-xr-xl10ntools/java/l10nconv/build.xml (renamed from transex3/java/l10nconv/build.xml)0
-rwxr-xr-xl10ntools/java/l10nconv/converter.MF (renamed from transex3/java/l10nconv/converter.MF)0
-rwxr-xr-xl10ntools/java/l10nconv/documentation/readmeConverter.sxw (renamed from transex3/java/l10nconv/documentation/readmeConverter.sxw)bin9824 -> 9824 bytes
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java)0
-rwxr-xr-xl10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map (renamed from transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map)0
-rwxr-xr-xl10ntools/java/l10nconv/makefile.mk (renamed from transex3/java/l10nconv/makefile.mk)2
-rwxr-xr-xl10ntools/java/receditor/build.xml (renamed from transex3/java/receditor/build.xml)0
-rw-r--r--l10ntools/java/receditor/java/transex3/controller/EditorController.java (renamed from transex3/java/receditor/java/transex3/controller/EditorController.java)0
-rw-r--r--l10ntools/java/receditor/java/transex3/controller/Main.java (renamed from transex3/java/receditor/java/transex3/controller/Main.java)0
-rw-r--r--l10ntools/java/receditor/java/transex3/model/ResourceFile.java (renamed from transex3/java/receditor/java/transex3/model/ResourceFile.java)0
-rw-r--r--l10ntools/java/receditor/java/transex3/model/SdfEntity.java (renamed from transex3/java/receditor/java/transex3/model/SdfEntity.java)0
-rw-r--r--l10ntools/java/receditor/java/transex3/model/SdfString.java (renamed from transex3/java/receditor/java/transex3/model/SdfString.java)0
-rw-r--r--l10ntools/java/receditor/java/transex3/view/Editor.java (renamed from transex3/java/receditor/java/transex3/view/Editor.java)0
-rw-r--r--l10ntools/java/receditor/java/transex3/view/SdfTable.java (renamed from transex3/java/receditor/java/transex3/view/SdfTable.java)0
-rwxr-xr-xl10ntools/java/receditor/makefile.mk (renamed from transex3/java/receditor/makefile.mk)2
-rwxr-xr-xl10ntools/java/receditor/receditor.MF (renamed from transex3/java/receditor/receditor.MF)0
-rw-r--r--l10ntools/layout/README (renamed from transex3/layout/README)0
-rw-r--r--l10ntools/layout/layoutparse.cxx (renamed from transex3/layout/layoutparse.cxx)0
-rw-r--r--l10ntools/layout/layoutparse.hxx (renamed from transex3/layout/layoutparse.hxx)0
-rw-r--r--l10ntools/layout/loc.sdf (renamed from transex3/layout/loc.sdf)0
-rw-r--r--l10ntools/layout/makefile.mk (renamed from transex3/layout/makefile.mk)2
-rw-r--r--l10ntools/layout/tralay.cxx (renamed from transex3/layout/tralay.cxx)2
-rw-r--r--l10ntools/layout/zoom.xml (renamed from transex3/layout/zoom.xml)0
-rw-r--r--l10ntools/prj/build.lst10
-rw-r--r--l10ntools/prj/d.lst (renamed from transex3/prj/d.lst)16
-rw-r--r--l10ntools/scripts/fast_merge.pl (renamed from transex3/scripts/fast_merge.pl)0
-rw-r--r--l10ntools/scripts/keyidGen.pl (renamed from transex3/scripts/keyidGen.pl)0
-rwxr-xr-xl10ntools/scripts/localize.pl (renamed from transex3/scripts/localize.pl)13
-rwxr-xr-xl10ntools/scripts/localize_old.pl (renamed from transex3/scripts/localize_old.pl)0
-rw-r--r--l10ntools/source/cfg_yy_wrapper.c (renamed from transex3/source/cfg_yy_wrapper.c)0
-rw-r--r--l10ntools/source/cfglex.l (renamed from transex3/source/cfglex.l)0
-rw-r--r--l10ntools/source/cfgmerge.cxx (renamed from transex3/source/cfgmerge.cxx)2
-rw-r--r--l10ntools/source/directory.cxx (renamed from transex3/source/directory.cxx)4
-rw-r--r--l10ntools/source/export.cxx (renamed from transex3/source/export.cxx)2
-rw-r--r--l10ntools/source/export2.cxx (renamed from transex3/source/export2.cxx)9
-rw-r--r--l10ntools/source/file.cxx (renamed from transex3/source/file.cxx)4
-rw-r--r--l10ntools/source/filter/merge/FCFGMerge.cfg (renamed from transex3/source/filter/merge/FCFGMerge.cfg)0
-rw-r--r--l10ntools/source/filter/merge/FCFGMerge.java (renamed from transex3/source/filter/merge/FCFGMerge.java)0
-rw-r--r--l10ntools/source/filter/merge/Manifest.mf (renamed from transex3/source/filter/merge/Manifest.mf)0
-rw-r--r--l10ntools/source/filter/merge/Merger.java (renamed from transex3/source/filter/merge/Merger.java)0
-rw-r--r--l10ntools/source/filter/merge/makefile.mk (renamed from transex3/source/filter/merge/makefile.mk)2
-rw-r--r--l10ntools/source/filter/utils/AnalyzeStartupLog.java (renamed from transex3/source/filter/utils/AnalyzeStartupLog.java)0
-rw-r--r--l10ntools/source/filter/utils/Cache.java (renamed from transex3/source/filter/utils/Cache.java)0
-rw-r--r--l10ntools/source/filter/utils/ConfigHelper.java (renamed from transex3/source/filter/utils/ConfigHelper.java)0
-rw-r--r--l10ntools/source/filter/utils/FileHelper.java (renamed from transex3/source/filter/utils/FileHelper.java)0
-rw-r--r--l10ntools/source/filter/utils/Logger.java (renamed from transex3/source/filter/utils/Logger.java)0
-rw-r--r--l10ntools/source/filter/utils/MalformedCommandLineException.java (renamed from transex3/source/filter/utils/MalformedCommandLineException.java)0
-rw-r--r--l10ntools/source/filter/utils/XMLHelper.java (renamed from transex3/source/filter/utils/XMLHelper.java)0
-rw-r--r--l10ntools/source/filter/utils/makefile.mk (renamed from transex3/source/filter/utils/makefile.mk)2
-rw-r--r--l10ntools/source/gsicheck.cxx (renamed from transex3/source/gsicheck.cxx)2
-rw-r--r--l10ntools/source/gsiconv.cxx (renamed from transex3/source/gsiconv.cxx)2
-rw-r--r--l10ntools/source/help/HelpCompiler.cxx (renamed from transex3/source/help/HelpCompiler.cxx)0
-rw-r--r--l10ntools/source/help/HelpCompiler.hxx (renamed from transex3/source/help/HelpCompiler.hxx)0
-rw-r--r--l10ntools/source/help/HelpFileDocument.java (renamed from transex3/source/help/HelpFileDocument.java)0
-rw-r--r--l10ntools/source/help/HelpIndexerTool.java (renamed from transex3/source/help/HelpIndexerTool.java)0
-rw-r--r--l10ntools/source/help/HelpLinker.cxx (renamed from transex3/source/help/HelpLinker.cxx)0
-rw-r--r--l10ntools/source/help/compilehelp.hxx (renamed from transex3/source/help/compilehelp.hxx)0
-rw-r--r--l10ntools/source/help/helplinker.pmk (renamed from transex3/source/help/helplinker.pmk)0
-rw-r--r--l10ntools/source/help/makefile.mk (renamed from transex3/source/help/makefile.mk)2
-rw-r--r--l10ntools/source/helpex.cxx (renamed from transex3/source/helpex.cxx)2
-rw-r--r--l10ntools/source/helpmerge.cxx (renamed from transex3/source/helpmerge.cxx)2
-rw-r--r--l10ntools/source/inireader.cxx (renamed from transex3/source/inireader.cxx)2
-rw-r--r--l10ntools/source/lngex.cxx (renamed from transex3/source/lngex.cxx)2
-rw-r--r--l10ntools/source/lngmerge.cxx (renamed from transex3/source/lngmerge.cxx)2
-rw-r--r--l10ntools/source/localize.cxx (renamed from transex3/source/localize.cxx)25
-rw-r--r--l10ntools/source/makefile.mk (renamed from transex3/source/makefile.mk)2
-rw-r--r--l10ntools/source/merge.cxx (renamed from transex3/source/merge.cxx)2
-rw-r--r--l10ntools/source/src_yy_wrapper.c (renamed from transex3/source/src_yy_wrapper.c)0
-rw-r--r--l10ntools/source/srciter.cxx (renamed from transex3/source/srciter.cxx)2
-rw-r--r--l10ntools/source/srclex.l (renamed from transex3/source/srclex.l)0
-rw-r--r--l10ntools/source/tagtest.cxx (renamed from transex3/source/tagtest.cxx)2
-rw-r--r--l10ntools/source/treeconfig.cxx (renamed from transex3/source/treeconfig.cxx)0
-rw-r--r--l10ntools/source/utf8conv.cxx (renamed from transex3/source/utf8conv.cxx)2
-rw-r--r--l10ntools/source/wrdtrans.cxx (renamed from transex3/source/wrdtrans.cxx)2
-rw-r--r--l10ntools/source/wtranode.cxx (renamed from transex3/source/wtranode.cxx)2
-rw-r--r--l10ntools/source/wtratree.cxx (renamed from transex3/source/wtratree.cxx)2
-rw-r--r--l10ntools/source/xgfconv.cxx (renamed from transex3/source/xgfconv.cxx)2
-rw-r--r--l10ntools/source/xmlparse.cxx (renamed from transex3/source/xmlparse.cxx)2
-rw-r--r--l10ntools/source/xrm_yy_wrapper.c (renamed from transex3/source/xrm_yy_wrapper.c)0
-rw-r--r--l10ntools/source/xrmlex.l (renamed from transex3/source/xrmlex.l)0
-rw-r--r--l10ntools/source/xrmmerge.cxx (renamed from transex3/source/xrmmerge.cxx)2
-rw-r--r--l10ntools/workbench/gsicheck_errors.sdf (renamed from transex3/workbench/gsicheck_errors.sdf)0
-rw-r--r--l10ntools/workbench/gsicheck_errors_err-.sdf (renamed from transex3/workbench/gsicheck_errors_err-.sdf)0
-rw-r--r--l10ntools/workbench/gsicheck_errors_err-l.sdf (renamed from transex3/workbench/gsicheck_errors_err-l.sdf)0
-rw-r--r--l10ntools/workbench/gsicheck_errors_err-s.sdf (renamed from transex3/workbench/gsicheck_errors_err-s.sdf)0
-rw-r--r--l10ntools/workbench/gsicheck_errors_err-t.sdf (renamed from transex3/workbench/gsicheck_errors_err-t.sdf)0
-rw-r--r--l10ntools/workbench/gsicheck_errors_ok-.sdf (renamed from transex3/workbench/gsicheck_errors_ok-.sdf)0
-rw-r--r--l10ntools/workbench/gsicheck_errors_ok-l.sdf (renamed from transex3/workbench/gsicheck_errors_ok-l.sdf)0
-rw-r--r--l10ntools/workbench/gsicheck_errors_ok-s.sdf (renamed from transex3/workbench/gsicheck_errors_ok-s.sdf)0
-rw-r--r--l10ntools/workbench/gsicheck_errors_ok-t.sdf (renamed from transex3/workbench/gsicheck_errors_ok-t.sdf)0
-rw-r--r--l10ntools/workbench/gsicheckcheck.btm (renamed from transex3/workbench/gsicheckcheck.btm)0
-rw-r--r--padmin/source/padialog.cxx149
-rw-r--r--padmin/source/padialog.hxx2
-rw-r--r--padmin/source/prtsetup.cxx23
-rw-r--r--padmin/source/prtsetup.hxx2
-rw-r--r--rsc/source/parser/rscicpx.cxx1
-rw-r--r--sot/source/sdstor/stgstrms.cxx2
-rw-r--r--sot/source/sdstor/stgstrms.hxx3
-rw-r--r--sot/source/sdstor/ucbstorage.cxx59
-rw-r--r--svl/inc/svl/solar.hrc11
-rw-r--r--svl/source/numbers/numhead.cxx2
-rw-r--r--svtools/inc/svtools/imapobj.hxx2
-rw-r--r--svtools/source/control/ctrlbox.cxx1
-rw-r--r--svtools/source/control/filectrl.cxx3
-rw-r--r--svtools/source/dialogs/prnsetup.cxx2
-rw-r--r--svtools/source/filter.vcl/filter/filter2.cxx3
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.cxx39
-rw-r--r--svtools/source/filter.vcl/jpeg/jpeg.h2
-rw-r--r--svtools/source/filter.vcl/jpeg/jpegc.c14
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.cxx103
-rw-r--r--svtools/source/filter.vcl/wmf/emfwr.hxx1
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.cxx9
-rw-r--r--svtools/source/filter.vcl/wmf/winmtf.hxx15
-rw-r--r--svtools/source/filter.vcl/wmf/winwmf.cxx216
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.cxx81
-rw-r--r--svtools/source/filter.vcl/wmf/wmfwr.hxx9
-rw-r--r--svtools/source/misc/ehdl.cxx26
-rw-r--r--svtools/source/misc/imap.cxx7
-rw-r--r--svtools/source/uno/unoiface.cxx80
-rw-r--r--toolkit/inc/toolkit/awt/vclxprinter.hxx15
-rw-r--r--toolkit/source/awt/vclxprinter.cxx36
-rw-r--r--toolkit/source/awt/vclxwindows.cxx6
-rw-r--r--toolkit/source/controls/formattedcontrol.cxx1
-rw-r--r--toolkit/source/controls/unocontrols.cxx2
-rw-r--r--tools/inc/tools/multisel.hxx104
-rw-r--r--tools/inc/tools/stream.hxx5
-rw-r--r--tools/inc/tools/wintypes.hxx6
-rw-r--r--tools/source/fsys/urlobj.cxx18
-rw-r--r--tools/source/memtools/makefile.mk2
-rw-r--r--tools/source/memtools/multisel.cxx298
-rw-r--r--tools/workben/urltest.cxx14
-rw-r--r--transex3/prj/build.lst10
-rw-r--r--ucbhelper/inc/ucbhelper/content.hxx103
-rw-r--r--ucbhelper/source/client/content.cxx171
-rw-r--r--ucbhelper/workben/ucbexplorer/ucbexplorer.cxx188
-rw-r--r--ucbhelper/workben/ucbexplorer/ucbexplorer.src11
-rw-r--r--unotools/inc/unotools/confignode.hxx3
-rw-r--r--unotools/source/config/confignode.cxx60
-rw-r--r--unotools/source/ucbhelper/ucbhelper.cxx16
-rwxr-xr-xvcl/aqua/inc/aquaprintview.h26
-rw-r--r--vcl/aqua/inc/salgdi.h4
-rw-r--r--vcl/aqua/inc/salprn.h41
-rw-r--r--vcl/aqua/source/gdi/aquaprintaccessoryview.mm1237
-rwxr-xr-xvcl/aqua/source/gdi/aquaprintview.mm11
-rw-r--r--vcl/aqua/source/gdi/makefile.mk1
-rw-r--r--vcl/aqua/source/gdi/salgdi.cxx12
-rwxr-xr-xvcl/aqua/source/gdi/salgdiutils.cxx35
-rw-r--r--vcl/aqua/source/gdi/salnativewidgets.cxx16
-rw-r--r--vcl/aqua/source/gdi/salprn.cxx320
-rw-r--r--vcl/inc/postgraphitestl.h9
-rw-r--r--vcl/inc/pregraphitestl.h30
-rw-r--r--vcl/inc/vcl/arrange.hxx425
-rw-r--r--vcl/inc/vcl/button.hxx16
-rw-r--r--vcl/inc/vcl/combobox.hxx4
-rw-r--r--vcl/inc/vcl/configsettings.hxx3
-rw-r--r--vcl/inc/vcl/edit.hxx1
-rw-r--r--vcl/inc/vcl/fixed.hxx1
-rw-r--r--vcl/inc/vcl/gdimtf.hxx1
-rw-r--r--vcl/inc/vcl/graphite_adaptors.hxx5
-rw-r--r--vcl/inc/vcl/graphite_cache.hxx4
-rw-r--r--vcl/inc/vcl/graphite_features.hxx3
-rw-r--r--vcl/inc/vcl/graphite_layout.hxx2
-rw-r--r--vcl/inc/vcl/ilstbox.hxx10
-rw-r--r--vcl/inc/vcl/impprn.hxx3
-rw-r--r--vcl/inc/vcl/jobdata.hxx2
-rw-r--r--vcl/inc/vcl/jobset.h13
-rw-r--r--vcl/inc/vcl/lstbox.h5
-rw-r--r--vcl/inc/vcl/lstbox.hxx4
-rw-r--r--vcl/inc/vcl/menu.hxx2
-rw-r--r--vcl/inc/vcl/oldprintadaptor.hxx52
-rw-r--r--vcl/inc/vcl/outdev.hxx5
-rw-r--r--vcl/inc/vcl/popupmenuwindow.hxx50
-rw-r--r--vcl/inc/vcl/ppdparser.hxx23
-rw-r--r--vcl/inc/vcl/print.h23
-rw-r--r--vcl/inc/vcl/print.hxx393
-rw-r--r--vcl/inc/vcl/printerinfomanager.hxx2
-rw-r--r--vcl/inc/vcl/printerjob.hxx2
-rw-r--r--vcl/inc/vcl/prndlg.hxx306
-rw-r--r--vcl/inc/vcl/prntypes.hxx3
-rw-r--r--vcl/inc/vcl/salprn.hxx18
-rw-r--r--vcl/inc/vcl/salptype.hxx6
-rw-r--r--vcl/inc/vcl/svdata.hxx8
-rw-r--r--vcl/inc/vcl/svids.hrc100
-rw-r--r--vcl/inc/vcl/tabctrl.hxx17
-rw-r--r--vcl/inc/vcl/tabdlg.hxx3
-rw-r--r--vcl/inc/vcl/toolbox.hxx3
-rw-r--r--vcl/inc/vcl/vclevent.hxx24
-rw-r--r--vcl/inc/vcl/virdev.hxx11
-rw-r--r--vcl/inc/vcl/window.h4
-rw-r--r--vcl/inc/vcl/window.hxx9
-rw-r--r--vcl/os2/inc/salprn.h5
-rw-r--r--vcl/os2/source/gdi/salprn.cxx11
-rw-r--r--vcl/prj/build.lst2
-rw-r--r--vcl/prj/d.lst3
-rw-r--r--vcl/source/app/salvtables.cxx4
-rw-r--r--vcl/source/app/svdata.cxx11
-rw-r--r--vcl/source/app/svmain.cxx20
-rw-r--r--vcl/source/app/vclevent.cxx23
-rw-r--r--vcl/source/control/button.cxx99
-rw-r--r--vcl/source/control/combobox.cxx24
-rw-r--r--vcl/source/control/edit.cxx45
-rw-r--r--vcl/source/control/fixed.cxx8
-rw-r--r--vcl/source/control/ilstbox.cxx29
-rw-r--r--vcl/source/control/lstbox.cxx78
-rw-r--r--vcl/source/control/tabctrl.cxx201
-rw-r--r--vcl/source/fontsubset/gsub.cxx13
-rw-r--r--vcl/source/fontsubset/sft.cxx20
-rw-r--r--vcl/source/gdi/bmpconv.cxx3
-rw-r--r--vcl/source/gdi/gdimtf.cxx34
-rw-r--r--vcl/source/gdi/impprn.cxx2
-rw-r--r--vcl/source/gdi/jobset.cxx26
-rw-r--r--[-rwxr-xr-x]vcl/source/gdi/makefile.mk4
-rw-r--r--vcl/source/gdi/oldprintadaptor.cxx117
-rw-r--r--vcl/source/gdi/outdev3.cxx2
-rw-r--r--vcl/source/gdi/pdfwriter_impl.cxx1272
-rw-r--r--vcl/source/gdi/pdfwriter_impl.hxx55
-rw-r--r--vcl/source/gdi/print.cxx484
-rw-r--r--vcl/source/gdi/print2.cxx35
-rw-r--r--vcl/source/gdi/print3.cxx1765
-rw-r--r--vcl/source/gdi/virdev.cxx29
-rw-r--r--vcl/source/glyphs/gcach_ftyp.cxx13
-rw-r--r--vcl/source/glyphs/graphite_adaptors.cxx2
-rw-r--r--vcl/source/glyphs/graphite_cache.cxx2
-rw-r--r--vcl/source/glyphs/graphite_features.cxx6
-rw-r--r--vcl/source/glyphs/graphite_layout.cxx14
-rw-r--r--vcl/source/glyphs/graphite_textsrc.cxx10
-rw-r--r--vcl/source/glyphs/graphite_textsrc.hxx4
-rw-r--r--vcl/source/helper/xconnection.cxx36
-rw-r--r--vcl/source/src/images.src20
-rw-r--r--vcl/source/src/makefile.mk5
-rw-r--r--vcl/source/src/print.src495
-rw-r--r--vcl/source/src/stdtext.src7
-rw-r--r--vcl/source/window/arrange.cxx906
-rw-r--r--vcl/source/window/dlgctrl.cxx15
-rw-r--r--vcl/source/window/makefile.mk5
-rw-r--r--vcl/source/window/menu.cxx16
-rw-r--r--vcl/source/window/popupmenuwindow.cxx82
-rw-r--r--vcl/source/window/printdlg.cxx2489
-rw-r--r--vcl/source/window/status.cxx1
-rw-r--r--vcl/source/window/tabdlg.cxx18
-rw-r--r--vcl/source/window/toolbox.cxx26
-rw-r--r--vcl/source/window/window.cxx53
-rw-r--r--vcl/source/window/window2.cxx2
-rw-r--r--vcl/unx/gtk/a11y/atkutil.cxx11
-rw-r--r--vcl/unx/gtk/a11y/atkwindow.cxx41
-rw-r--r--vcl/unx/gtk/a11y/atkwrapper.cxx54
-rw-r--r--vcl/unx/gtk/app/gtkinst.cxx5
-rw-r--r--vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx13
-rw-r--r--vcl/unx/gtk/window/gtkframe.cxx2
-rw-r--r--vcl/unx/headless/svpprn.cxx116
-rw-r--r--vcl/unx/headless/svpprn.hxx6
-rw-r--r--vcl/unx/inc/salprn.h6
-rw-r--r--vcl/unx/source/app/randrwrapper.cxx3
-rw-r--r--vcl/unx/source/app/saldisp.cxx6
-rw-r--r--vcl/unx/source/dtrans/X11_dndcontext.cxx12
-rw-r--r--vcl/unx/source/dtrans/X11_dndcontext.hxx20
-rw-r--r--vcl/unx/source/dtrans/X11_selection.cxx192
-rw-r--r--vcl/unx/source/dtrans/X11_selection.hxx100
-rw-r--r--vcl/unx/source/dtrans/bmp.cxx2
-rw-r--r--vcl/unx/source/dtrans/bmp.hxx2
-rw-r--r--vcl/unx/source/gdi/salprnpsp.cxx127
-rw-r--r--vcl/unx/source/plugadapt/salplug.cxx4
-rw-r--r--vcl/unx/source/printer/cupsmgr.cxx4
-rw-r--r--vcl/unx/source/printer/jobdata.cxx22
-rw-r--r--vcl/unx/source/printer/ppdparser.cxx440
-rw-r--r--vcl/unx/source/printer/printerinfomanager.cxx1
-rw-r--r--vcl/unx/source/printergfx/printerjob.cxx48
-rw-r--r--vcl/util/hidother.src34
-rw-r--r--vcl/util/makefile.mk2
-rw-r--r--vcl/util/makefile2.pmk7
-rw-r--r--vcl/win/inc/salprn.h5
-rw-r--r--vcl/win/source/gdi/salnativewidgets-luna.cxx61
-rw-r--r--vcl/win/source/gdi/salprn.cxx72
-rwxr-xr-x[-rw-r--r--]vcl/win/source/window/salframe.cxx5
329 files changed, 13205 insertions, 2414 deletions
diff --git a/basegfx/test/basegfx2d.cxx b/basegfx/test/basegfx2d.cxx
index d8b574769554..24a488ddfbb4 100644
--- a/basegfx/test/basegfx2d.cxx
+++ b/basegfx/test/basegfx2d.cxx
@@ -283,8 +283,11 @@ public:
// depending on float precision and the getContinuity() implemetation using
// fTools::equal, linux and mac produce more 'C' than 'S' statements, while WIN32
// uses more 'S' statements (as it should be for circles)
- CPPUNIT_ASSERT_MESSAGE("exporting to circle does not produce the expected number of coordinates",
- nCount==67 || nCount==50);
+#ifdef S390X
+ CPPUNIT_ASSERT_MESSAGE("exporting to circle does not produce the expected number of coordinates", nCount==61 );
+#else
+ CPPUNIT_ASSERT_MESSAGE("exporting to circle does not produce the expected number of coordinates", nCount==67 || nCount==50 );
+#endif
const B2DPolygon aRect(
tools::createPolygonFromRect( B2DRange(0.0,0.0,4000.0,4000.0) ));
diff --git a/canvas/source/directx/dx_winstuff.hxx b/canvas/source/directx/dx_winstuff.hxx
index 1c64506c0f21..47658991e74b 100755
--- a/canvas/source/directx/dx_winstuff.hxx
+++ b/canvas/source/directx/dx_winstuff.hxx
@@ -89,7 +89,7 @@
#include <d3d9.h>
#include <d3dx9.h>
- #include <dxerr9.h>
+// #include <dxerr9.h> #i107614# removing include, it has been changed in the latest sdk fron August2009 from dxerr9.h into dxerr.h
typedef IDirect3DSurface9 surface_type;
@@ -97,11 +97,11 @@
#undef DrawText
-#ifdef __MINGW32__
-using ::std::max;
-using ::std::min;
-#endif
-
+#ifdef __MINGW32__
+using ::std::max;
+using ::std::min;
+#endif
+
#include <gdiplus.h>
#ifdef min
diff --git a/comphelper/inc/comphelper/weakeventlistener.hxx b/comphelper/inc/comphelper/weakeventlistener.hxx
index c6938e2b8423..045dfb169312 100644
--- a/comphelper/inc/comphelper/weakeventlistener.hxx
+++ b/comphelper/inc/comphelper/weakeventlistener.hxx
@@ -76,7 +76,7 @@ namespace comphelper
inline void resetListener( )
{
- m_aListener = ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >();
+ m_aListener.clear();
}
diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx
index 8b816e8c1ce9..caa895021103 100644
--- a/comphelper/source/property/opropertybag.cxx
+++ b/comphelper/source/property/opropertybag.cxx
@@ -240,7 +240,7 @@ namespace comphelper
if ( !( _element >>= aProperty ) )
throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::ClearableMutexGuard g( m_aMutex );
// check whether the type is allowed, everything else will be checked
// by m_aDynamicProperties
@@ -254,6 +254,7 @@ namespace comphelper
// our property info is dirty
m_pArrayHelper.reset();
+ g.clear();
setModified(sal_True);
}
@@ -346,7 +347,7 @@ namespace comphelper
//--------------------------------------------------------------------
void SAL_CALL OPropertyBag::addProperty( const ::rtl::OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException)
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::ClearableMutexGuard g( m_aMutex );
// check whether the type is allowed, everything else will be checked
// by m_aDynamicProperties
@@ -362,19 +363,21 @@ namespace comphelper
// our property info is dirty
m_pArrayHelper.reset();
+ g.clear();
setModified(sal_True);
}
//--------------------------------------------------------------------
void SAL_CALL OPropertyBag::removeProperty( const ::rtl::OUString& _rName ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException)
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::ClearableMutexGuard g( m_aMutex );
m_aDynamicProperties.removeProperty( _rName );
// our property info is dirty
m_pArrayHelper.reset();
+ g.clear();
setModified(sal_True);
}
diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx
index fe6cbaa9d767..0ccc28d4238b 100644
--- a/comphelper/source/property/property.cxx
+++ b/comphelper/source/property/property.cxx
@@ -38,15 +38,11 @@
#include <osl/diagnose.h>
#if OSL_DEBUG_LEVEL > 0
- #ifndef _RTL_STRBUF_HXX_
#include <rtl/strbuf.hxx>
- #endif
- #ifndef _CPPUHELPER_EXC_HLP_HXX_
#include <cppuhelper/exc_hlp.hxx>
- #endif
- #ifndef _OSL_THREAD_H_
#include <osl/thread.h>
- #endif
+ #include <com/sun/star/lang/XServiceInfo.hpp>
+ #include <typeinfo>
#endif
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -71,6 +67,10 @@ namespace comphelper
using ::com::sun::star::uno::cpp_queryInterface;
using ::com::sun::star::uno::cpp_acquire;
using ::com::sun::star::uno::cpp_release;
+#if OSL_DEBUG_LEVEL > 0
+ using ::com::sun::star::lang::XServiceInfo;
+#endif
+ using ::com::sun::star::uno::UNO_QUERY;
/** === end UNO using === **/
namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
@@ -110,7 +110,18 @@ void copyProperties(const Reference<XPropertySet>& _rxSource,
::rtl::OStringBuffer aBuffer;
aBuffer.append( "::comphelper::copyProperties: could not copy property '" );
aBuffer.append( ::rtl::OString( pSourceProps->Name.getStr(), pSourceProps->Name.getLength(), RTL_TEXTENCODING_ASCII_US ) );
- aBuffer.append( "' to the destination set.\n" );
+ aBuffer.append( "' to the destination set (a '" );
+
+ Reference< XServiceInfo > xSI( _rxDest, UNO_QUERY );
+ if ( xSI.is() )
+ {
+ aBuffer.append( ::rtl::OUStringToOString( xSI->getImplementationName(), osl_getThreadTextEncoding() ) );
+ }
+ else
+ {
+ aBuffer.append( typeid( *_rxDest.get() ).name() );
+ }
+ aBuffer.append( "' implementation).\n" );
Any aException( ::cppu::getCaughtException() );
aBuffer.append( "Caught an exception of type '" );
diff --git a/cppcanvas/inc/cppcanvas/color.hxx b/cppcanvas/inc/cppcanvas/color.hxx
index 7441f6f2937a..ad0430713ead 100644
--- a/cppcanvas/inc/cppcanvas/color.hxx
+++ b/cppcanvas/inc/cppcanvas/color.hxx
@@ -83,6 +83,16 @@ namespace cppcanvas
return (nRed << 24U)|(nGreen << 16U)|(nBlue << 8U)|(nAlpha);
}
+ inline sal_Int32 unMakeColor( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
+ {
+ return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue);
+ }
+
+ inline sal_Int32 makeColorARGB( sal_uInt8 nAlpha, sal_uInt8 nRed, sal_uInt8 nGreen, sal_uInt8 nBlue)
+ {
+ return (nAlpha << 24U)|(nRed << 16U)|(nGreen << 8U)|(nBlue);
+ }
+
}
#endif /* _CPPCANVAS_COLOR_HXX */
diff --git a/goodies/source/filter.vcl/ieps/ieps.cxx b/goodies/source/filter.vcl/ieps/ieps.cxx
index f315ee864310..7f1ecfc65bd0 100644
--- a/goodies/source/filter.vcl/ieps/ieps.cxx
+++ b/goodies/source/filter.vcl/ieps/ieps.cxx
@@ -164,12 +164,54 @@ static void MakeAsMeta(Graphic &rGraphic)
rGraphic = aMtf;
}
+static oslProcessError runProcessWithPathSearch(const rtl::OUString &rProgName,
+ rtl_uString* pArgs[], sal_uInt32 nArgs, oslProcess *pProcess,
+ oslFileHandle *pIn, oslFileHandle *pOut, oslFileHandle *pErr)
+{
+#ifdef WNT
+ /*
+ * ooo#72096
+ * On Window the underlying SearchPath searches in order of...
+ * The directory from which the application loaded.
+ * The current directory.
+ * The Windows system directory.
+ * The Windows directory.
+ * The directories that are listed in the PATH environment variable.
+ *
+ * Because one of our programs is called "convert" and there is a convert
+ * in the windows system directory, we want to explicitly search the PATH
+ * to avoid picking up on that one if ImageMagick's convert preceeds it in
+ * PATH.
+ *
+ */
+ rtl::OUString url;
+ rtl::OUString path(_wgetenv(L"PATH"));
+
+ oslFileError err = osl_searchFileURL(rProgName.pData, path.pData, &url.pData);
+ if (err != osl_File_E_None)
+ return osl_Process_E_NotFound;
+ return osl_executeProcess_WithRedirectedIO(url.pData,
+ pArgs, nArgs, osl_Process_HIDDEN,
+ osl_getCurrentSecurity(), 0, 0, 0, pProcess, pIn, pOut, pErr);
+#else
+ return osl_executeProcess_WithRedirectedIO(rProgName.pData,
+ pArgs, nArgs, osl_Process_SEARCHPATH | osl_Process_HIDDEN,
+ osl_getCurrentSecurity(), 0, 0, 0, pProcess, pIn, pOut, pErr);
+#endif
+}
+
+#if defined(WNT) || defined(OS2)
+# define EXESUFFIX ".exe"
+#else
+# define EXESUFFIX ""
+#endif
+
static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &rGraphic)
{
TempFile aTemp;
aTemp.EnableKillingFile();
rtl::OUString fileName =
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pstoedit"));
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("pstoedit"EXESUFFIX));
rtl::OUString arg1 =
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-f"));
rtl::OUString arg2 =
@@ -186,10 +228,10 @@ static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r
oslFileHandle pIn = NULL;
oslFileHandle pOut = NULL;
oslFileHandle pErr = NULL;
- oslProcessError eErr = osl_executeProcess_WithRedirectedIO(fileName.pData,
- args, sizeof(args)/sizeof(rtl_uString *),
- osl_Process_SEARCHPATH | osl_Process_HIDDEN,
- osl_getCurrentSecurity(), 0, 0, 0, &aProcess, &pIn, &pOut, &pErr);
+ oslProcessError eErr = runProcessWithPathSearch(fileName,
+ args, sizeof(args)/sizeof(rtl_uString *),
+ &aProcess, &pIn, &pOut, &pErr);
+
if (eErr!=osl_Process_E_None)
return false;
@@ -222,15 +264,15 @@ static bool RenderAsEMF(const sal_uInt8* pBuf, sal_uInt32 nBytesRead, Graphic &r
}
static bool RenderAsPNGThroughHelper(const sal_uInt8* pBuf, sal_uInt32 nBytesRead,
- Graphic &rGraphic, rtl::OUString &rProgName, rtl_uString **pArgs, size_t nArgs)
+ Graphic &rGraphic, rtl::OUString &rProgName, rtl_uString *pArgs[], size_t nArgs)
{
oslProcess aProcess;
oslFileHandle pIn = NULL;
oslFileHandle pOut = NULL;
oslFileHandle pErr = NULL;
- oslProcessError eErr = osl_executeProcess_WithRedirectedIO(rProgName.pData,
- pArgs, nArgs, osl_Process_SEARCHPATH | osl_Process_HIDDEN,
- osl_getCurrentSecurity(), 0, 0, 0, &aProcess, &pIn, &pOut, &pErr);
+ oslProcessError eErr = runProcessWithPathSearch(rProgName,
+ pArgs, nArgs,
+ &aProcess, &pIn, &pOut, &pErr);
if (eErr!=osl_Process_E_None)
return false;
@@ -251,7 +293,7 @@ static bool RenderAsPNGThroughHelper(const sal_uInt8* pBuf, sal_uInt32 nBytesRea
aMemStm.Seek(0);
if (
- eFileErr == osl_File_E_None &&
+ aMemStm.GetEndOfData() &&
GraphicConverter::Import(aMemStm, rGraphic, CVT_PNG) == ERRCODE_NONE
)
{
@@ -270,7 +312,7 @@ static bool RenderAsPNGThroughConvert(const sal_uInt8* pBuf, sal_uInt32 nBytesRe
Graphic &rGraphic)
{
rtl::OUString fileName =
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("convert"));
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("convert"EXESUFFIX));
// density in pixel/inch
rtl::OUString arg1 = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-density"));
// since the preview is also used for PDF-Export & printing on non-PS-printers,
@@ -293,10 +335,10 @@ static bool RenderAsPNGThroughGS(const sal_uInt8* pBuf, sal_uInt32 nBytesRead,
{
#ifdef WNT
rtl::OUString fileName =
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("gswin32c"));
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("gswin32c"EXESUFFIX));
#else
rtl::OUString fileName =
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("gs"));
+ rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("gs"EXESUFFIX));
#endif
rtl::OUString arg1 =
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("-q"));
diff --git a/goodies/source/filter.vcl/ipbm/ipbm.cxx b/goodies/source/filter.vcl/ipbm/ipbm.cxx
index 227490fc9d8e..3c30dd0c2ba3 100644
--- a/goodies/source/filter.vcl/ipbm/ipbm.cxx
+++ b/goodies/source/filter.vcl/ipbm/ipbm.cxx
@@ -106,7 +106,7 @@ BOOL PBMReader::ReadPBM( SvStream & rPBM, Graphic & rGraphic )
if ( ( mbStatus = ImplReadHeader() ) == FALSE )
return FALSE;
- if ( mnWidth == 0 || mnHeight == 0 )
+ if ( ( mnMaxVal == 0 ) || ( mnWidth == 0 ) || ( mnHeight == 0 ) )
return FALSE;
// 0->PBM, 1->PGM, 2->PPM
@@ -172,6 +172,7 @@ BOOL PBMReader::ImplReadHeader()
*mpPBM >> nID[ 0 ] >> nID[ 1 ];
if ( nID[ 0 ] != 'P' )
return FALSE;
+ mnMaxVal = mnWidth = mnHeight = 0;
switch ( nID[ 1 ] )
{
case '1' :
@@ -179,6 +180,7 @@ BOOL PBMReader::ImplReadHeader()
case '4' :
mnMode = 0;
nMax = 2; // number of parameters in Header
+ mnMaxVal = 1;
break;
case '2' :
mbRaw = FALSE;
@@ -195,9 +197,6 @@ BOOL PBMReader::ImplReadHeader()
default:
return FALSE;
}
-
- mnMaxVal = mnWidth = mnHeight = 0;
-
while ( bFinished == FALSE )
{
if ( mpPBM->GetError() )
@@ -466,7 +465,9 @@ BOOL PBMReader::ImplReadBody()
if ( nCount == 3 )
{
nCount = 0;
- mpAcc->SetPixel( nHeight, nWidth++, BitmapColor( (BYTE)nRGB[ 0 ], (BYTE)nRGB[ 1 ], (BYTE)nRGB[ 2 ] ) );
+ mpAcc->SetPixel( nHeight, nWidth++, BitmapColor( static_cast< BYTE >( ( nRGB[ 0 ] * 255 ) / mnMaxVal ),
+ static_cast< BYTE >( ( nRGB[ 1 ] * 255 ) / mnMaxVal ),
+ static_cast< BYTE >( ( nRGB[ 2 ] * 255 ) / mnMaxVal ) ) );
nCount = 0;
nRGB[ 0 ] = nRGB[ 1 ] = nRGB[ 2 ] = 0;
if ( nWidth == mnWidth )
diff --git a/transex3/inc/cfgmerge.hxx b/l10ntools/inc/cfgmerge.hxx
index 9f1c97f05af5..9f1c97f05af5 100644
--- a/transex3/inc/cfgmerge.hxx
+++ b/l10ntools/inc/cfgmerge.hxx
diff --git a/transex3/inc/export.hxx b/l10ntools/inc/export.hxx
index ec5195034e91..6d94297c25fb 100644
--- a/transex3/inc/export.hxx
+++ b/l10ntools/inc/export.hxx
@@ -31,9 +31,9 @@
#ifndef _EXPORT_HXX
#define _EXPORT_HXX
-#ifndef TRANSEX_DIRECTORY_HXX
-#define TRANSEX_DIRECTORY_HXX
-#include <transex3/directory.hxx>
+#ifndef L10NTOOLS_DIRECTORY_HXX
+#define L10NTOOLS_DIRECTORY_HXX
+#include <l10ntools/directory.hxx>
#endif
diff --git a/transex3/inc/gsicheck.hxx b/l10ntools/inc/gsicheck.hxx
index 13debcfc7106..13debcfc7106 100644
--- a/transex3/inc/gsicheck.hxx
+++ b/l10ntools/inc/gsicheck.hxx
diff --git a/transex3/inc/helpmerge.hxx b/l10ntools/inc/helpmerge.hxx
index 0ebfa7ed62a9..0ebfa7ed62a9 100644
--- a/transex3/inc/helpmerge.hxx
+++ b/l10ntools/inc/helpmerge.hxx
diff --git a/transex3/inc/inireader.hxx b/l10ntools/inc/inireader.hxx
index 0861290adf9f..0861290adf9f 100644
--- a/transex3/inc/inireader.hxx
+++ b/l10ntools/inc/inireader.hxx
diff --git a/transex3/inc/transex3/directory.hxx b/l10ntools/inc/l10ntools/directory.hxx
index 6e507961d3bb..6b71f59435f7 100644
--- a/transex3/inc/transex3/directory.hxx
+++ b/l10ntools/inc/l10ntools/directory.hxx
@@ -12,9 +12,9 @@
#include <stdio.h>
-#ifndef TRANSEX_FILE_HXX
-#define TRANSEX_FILE_HXX
-#include <transex3/file.hxx>
+#ifndef L10NTOOLS_FILE_HXX
+#define L10NTOOLS_FILE_HXX
+#include <l10ntools/file.hxx>
#endif
namespace transex{
diff --git a/transex3/inc/transex3/file.hxx b/l10ntools/inc/l10ntools/file.hxx
index e3a1a46b4ee8..e3a1a46b4ee8 100644
--- a/transex3/inc/transex3/file.hxx
+++ b/l10ntools/inc/l10ntools/file.hxx
diff --git a/transex3/inc/transex3/vosapp.hxx b/l10ntools/inc/l10ntools/vosapp.hxx
index 49e10e15e3d4..49e10e15e3d4 100644
--- a/transex3/inc/transex3/vosapp.hxx
+++ b/l10ntools/inc/l10ntools/vosapp.hxx
diff --git a/transex3/inc/lngmerge.hxx b/l10ntools/inc/lngmerge.hxx
index 502889b27aa9..502889b27aa9 100644
--- a/transex3/inc/lngmerge.hxx
+++ b/l10ntools/inc/lngmerge.hxx
diff --git a/transex3/inc/makefile.mk b/l10ntools/inc/makefile.mk
index 00caed43733a..6a704d63e48f 100644
--- a/transex3/inc/makefile.mk
+++ b/l10ntools/inc/makefile.mk
@@ -30,7 +30,7 @@
#*************************************************************************
PRJ=..
-PRJNAME=transex3
+PRJNAME=l10ntools
TARGET=inc
# --- Settings -----------------------------------------------------
diff --git a/transex3/inc/pch/precompiled_transex3.cxx b/l10ntools/inc/pch/precompiled_l10ntools.cxx
index 5b69c9f2f204..b6cac813375f 100644
--- a/transex3/inc/pch/precompiled_transex3.cxx
+++ b/l10ntools/inc/pch/precompiled_l10ntools.cxx
@@ -28,5 +28,5 @@
*
************************************************************************/
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
diff --git a/transex3/inc/pch/precompiled_transex3.hxx b/l10ntools/inc/pch/precompiled_l10ntools.hxx
index 2ed3c72ad4ee..2ed3c72ad4ee 100644
--- a/transex3/inc/pch/precompiled_transex3.hxx
+++ b/l10ntools/inc/pch/precompiled_l10ntools.hxx
diff --git a/transex3/inc/srciter.hxx b/l10ntools/inc/srciter.hxx
index bcbdf5eb542b..7f80074cd651 100644
--- a/transex3/inc/srciter.hxx
+++ b/l10ntools/inc/srciter.hxx
@@ -28,9 +28,9 @@
*
************************************************************************/
-#ifndef TRANSEX_DIRECTORY_HXX
-#define TRANSEX_DIRECTORY_HXX
-#include <transex3/directory.hxx>
+#ifndef L10NTOOLS_DIRECTORY_HXX
+#define L10NTOOLS_DIRECTORY_HXX
+#include <l10ntools/directory.hxx>
#endif
// class SourceTreeIterator
diff --git a/transex3/inc/tagtest.hxx b/l10ntools/inc/tagtest.hxx
index 811c4bf0e164..811c4bf0e164 100644
--- a/transex3/inc/tagtest.hxx
+++ b/l10ntools/inc/tagtest.hxx
diff --git a/transex3/inc/tokens.h b/l10ntools/inc/tokens.h
index ef285f4c6361..ef285f4c6361 100644
--- a/transex3/inc/tokens.h
+++ b/l10ntools/inc/tokens.h
diff --git a/transex3/inc/treeconfig.hxx b/l10ntools/inc/treeconfig.hxx
index 96d693b0d376..96d693b0d376 100644
--- a/transex3/inc/treeconfig.hxx
+++ b/l10ntools/inc/treeconfig.hxx
diff --git a/transex3/inc/utf8conv.hxx b/l10ntools/inc/utf8conv.hxx
index 32e506edbda8..32e506edbda8 100644
--- a/transex3/inc/utf8conv.hxx
+++ b/l10ntools/inc/utf8conv.hxx
diff --git a/transex3/inc/wrdtrans.hxx b/l10ntools/inc/wrdtrans.hxx
index efcb663204a6..efcb663204a6 100644
--- a/transex3/inc/wrdtrans.hxx
+++ b/l10ntools/inc/wrdtrans.hxx
diff --git a/transex3/inc/wtranode.hxx b/l10ntools/inc/wtranode.hxx
index 4d71fc160fff..4d71fc160fff 100644
--- a/transex3/inc/wtranode.hxx
+++ b/l10ntools/inc/wtranode.hxx
diff --git a/transex3/inc/wtratree.hxx b/l10ntools/inc/wtratree.hxx
index 67d63280449f..67d63280449f 100644
--- a/transex3/inc/wtratree.hxx
+++ b/l10ntools/inc/wtratree.hxx
diff --git a/transex3/inc/xmlparse.hxx b/l10ntools/inc/xmlparse.hxx
index 18b047ef75c1..18b047ef75c1 100644
--- a/transex3/inc/xmlparse.hxx
+++ b/l10ntools/inc/xmlparse.hxx
diff --git a/transex3/inc/xmlutil.hxx b/l10ntools/inc/xmlutil.hxx
index 812f50b85c45..812f50b85c45 100644
--- a/transex3/inc/xmlutil.hxx
+++ b/l10ntools/inc/xmlutil.hxx
diff --git a/transex3/inc/xrmmerge.hxx b/l10ntools/inc/xrmmerge.hxx
index 47be1ea7a038..47be1ea7a038 100644
--- a/transex3/inc/xrmmerge.hxx
+++ b/l10ntools/inc/xrmmerge.hxx
diff --git a/transex3/java/l10nconv/build.xml b/l10ntools/java/l10nconv/build.xml
index 6902227e5122..6902227e5122 100755
--- a/transex3/java/l10nconv/build.xml
+++ b/l10ntools/java/l10nconv/build.xml
diff --git a/transex3/java/l10nconv/converter.MF b/l10ntools/java/l10nconv/converter.MF
index 843d500b7548..843d500b7548 100755
--- a/transex3/java/l10nconv/converter.MF
+++ b/l10ntools/java/l10nconv/converter.MF
diff --git a/transex3/java/l10nconv/documentation/readmeConverter.sxw b/l10ntools/java/l10nconv/documentation/readmeConverter.sxw
index f779e10acb2c..f779e10acb2c 100755
--- a/transex3/java/l10nconv/documentation/readmeConverter.sxw
+++ b/l10ntools/java/l10nconv/documentation/readmeConverter.sxw
Binary files differ
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java
index d304c2544bff..d304c2544bff 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapCheck.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java
index 49fc08b69d32..49fc08b69d32 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/DirtyTagWrapper.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java
index 7495736ab68c..7495736ab68c 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/Tag.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java
index 7993fc9cf0a4..7993fc9cf0a4 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/DirtyTags/TagPair.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java
index 5b1fb6c62b61..5b1fb6c62b61 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Convert.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java
index 7ec09bcb411a..7ec09bcb411a 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Converter.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java
index 07a3708d4366..07a3708d4366 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ConverterException.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java
index e8b4136f185a..e8b4136f185a 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataHandler.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java
index 59de7ca7e1f4..59de7ca7e1f4 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataReader.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java
index c5d6765e3840..c5d6765e3840 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/DataWriter.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java
index b05767e93ae3..b05767e93ae3 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ExtMap.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java
index a21b8daa7b1d..a21b8daa7b1d 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/FileMaker.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java
index adb6e358a74c..adb6e358a74c 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIReader.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java
index 085e26475e09..085e26475e09 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIWriter.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java
index ff0348f97d3d..ff0348f97d3d 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/GSIandSDFMerger.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java
index 6a11360cc472..6a11360cc472 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/LineErrorException.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java
index 997c05a70b4f..997c05a70b4f 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/OutputHandler.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java
index f53fe0101275..f53fe0101275 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/ResTypeResolver.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java
index 29a9ee2e528a..29a9ee2e528a 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/Resolver.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java
index 4c0c234778ec..4c0c234778ec 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFReader.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java
index 98eb8c856e6a..98eb8c856e6a 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/SDFWriter.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java
index 522dcc18a5bd..522dcc18a5bd 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFReader.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java
index 42eef42884c1..42eef42884c1 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/XLIFFWriter.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd
index 91262ec28204..91262ec28204 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/converter/dtd/xliff.dtd
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java b/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java
index 62ff008156ab..62ff008156ab 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/LanguageResolver.java
diff --git a/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map b/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map
index a43e8f5e0218..a43e8f5e0218 100755
--- a/transex3/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map
+++ b/l10ntools/java/l10nconv/java/com/sun/star/tooling/languageResolver/lang.map
diff --git a/transex3/java/l10nconv/makefile.mk b/l10ntools/java/l10nconv/makefile.mk
index feb869778e80..2be2eb391ced 100755
--- a/transex3/java/l10nconv/makefile.mk
+++ b/l10ntools/java/l10nconv/makefile.mk
@@ -30,7 +30,7 @@
#*************************************************************************
PRJ=../..
-PRJNAME=transex3
+PRJNAME=l10ntools
TARGET=converter
.INCLUDE : ant.mk
diff --git a/transex3/java/receditor/build.xml b/l10ntools/java/receditor/build.xml
index 34f02128f034..34f02128f034 100755
--- a/transex3/java/receditor/build.xml
+++ b/l10ntools/java/receditor/build.xml
diff --git a/transex3/java/receditor/java/transex3/controller/EditorController.java b/l10ntools/java/receditor/java/transex3/controller/EditorController.java
index 38462d665304..38462d665304 100644
--- a/transex3/java/receditor/java/transex3/controller/EditorController.java
+++ b/l10ntools/java/receditor/java/transex3/controller/EditorController.java
diff --git a/transex3/java/receditor/java/transex3/controller/Main.java b/l10ntools/java/receditor/java/transex3/controller/Main.java
index e8dd06ce9f85..e8dd06ce9f85 100644
--- a/transex3/java/receditor/java/transex3/controller/Main.java
+++ b/l10ntools/java/receditor/java/transex3/controller/Main.java
diff --git a/transex3/java/receditor/java/transex3/model/ResourceFile.java b/l10ntools/java/receditor/java/transex3/model/ResourceFile.java
index 51fabb3a4b7a..51fabb3a4b7a 100644
--- a/transex3/java/receditor/java/transex3/model/ResourceFile.java
+++ b/l10ntools/java/receditor/java/transex3/model/ResourceFile.java
diff --git a/transex3/java/receditor/java/transex3/model/SdfEntity.java b/l10ntools/java/receditor/java/transex3/model/SdfEntity.java
index 4b293421fd28..4b293421fd28 100644
--- a/transex3/java/receditor/java/transex3/model/SdfEntity.java
+++ b/l10ntools/java/receditor/java/transex3/model/SdfEntity.java
diff --git a/transex3/java/receditor/java/transex3/model/SdfString.java b/l10ntools/java/receditor/java/transex3/model/SdfString.java
index 7419aeb5578b..7419aeb5578b 100644
--- a/transex3/java/receditor/java/transex3/model/SdfString.java
+++ b/l10ntools/java/receditor/java/transex3/model/SdfString.java
diff --git a/transex3/java/receditor/java/transex3/view/Editor.java b/l10ntools/java/receditor/java/transex3/view/Editor.java
index f46a82a11a2b..f46a82a11a2b 100644
--- a/transex3/java/receditor/java/transex3/view/Editor.java
+++ b/l10ntools/java/receditor/java/transex3/view/Editor.java
diff --git a/transex3/java/receditor/java/transex3/view/SdfTable.java b/l10ntools/java/receditor/java/transex3/view/SdfTable.java
index f0cc7bd84a34..f0cc7bd84a34 100644
--- a/transex3/java/receditor/java/transex3/view/SdfTable.java
+++ b/l10ntools/java/receditor/java/transex3/view/SdfTable.java
diff --git a/transex3/java/receditor/makefile.mk b/l10ntools/java/receditor/makefile.mk
index e5e3921eea6b..dd3f84daccce 100755
--- a/transex3/java/receditor/makefile.mk
+++ b/l10ntools/java/receditor/makefile.mk
@@ -30,7 +30,7 @@
#*************************************************************************
PRJ=../..
-PRJNAME=transex3
+PRJNAME=l10ntools
TARGET=receditor
.INCLUDE : ant.mk
diff --git a/transex3/java/receditor/receditor.MF b/l10ntools/java/receditor/receditor.MF
index dced97882df9..dced97882df9 100755
--- a/transex3/java/receditor/receditor.MF
+++ b/l10ntools/java/receditor/receditor.MF
diff --git a/transex3/layout/README b/l10ntools/layout/README
index 1838e2a94ba0..1838e2a94ba0 100644
--- a/transex3/layout/README
+++ b/l10ntools/layout/README
diff --git a/transex3/layout/layoutparse.cxx b/l10ntools/layout/layoutparse.cxx
index 0f43c9a3053f..0f43c9a3053f 100644
--- a/transex3/layout/layoutparse.cxx
+++ b/l10ntools/layout/layoutparse.cxx
diff --git a/transex3/layout/layoutparse.hxx b/l10ntools/layout/layoutparse.hxx
index b9cd8f6c18b2..b9cd8f6c18b2 100644
--- a/transex3/layout/layoutparse.hxx
+++ b/l10ntools/layout/layoutparse.hxx
diff --git a/transex3/layout/loc.sdf b/l10ntools/layout/loc.sdf
index 023357adc420..023357adc420 100644
--- a/transex3/layout/loc.sdf
+++ b/l10ntools/layout/loc.sdf
diff --git a/transex3/layout/makefile.mk b/l10ntools/layout/makefile.mk
index 9864b46242b2..63dbeae6d9e9 100644
--- a/transex3/layout/makefile.mk
+++ b/l10ntools/layout/makefile.mk
@@ -33,7 +33,7 @@ PRJ=..
INCPRE=$(MISC)
-PRJNAME=transex3
+PRJNAME=l10ntools
TARGET=tralay
#TARGETTYPE=GUI
TARGETTYPE=CUI
diff --git a/transex3/layout/tralay.cxx b/l10ntools/layout/tralay.cxx
index 740981674c50..13a7fdb0c5d9 100644
--- a/transex3/layout/tralay.cxx
+++ b/l10ntools/layout/tralay.cxx
@@ -30,7 +30,7 @@
************************************************************************/
#include <com/sun/star/xml/sax/SAXException.hpp>
-#include <transex3/vosapp.hxx>
+#include <l10ntools/vosapp.hxx>
#include <osl/file.hxx>
diff --git a/transex3/layout/zoom.xml b/l10ntools/layout/zoom.xml
index 0fb3d27343ff..0fb3d27343ff 100644
--- a/transex3/layout/zoom.xml
+++ b/l10ntools/layout/zoom.xml
diff --git a/l10ntools/prj/build.lst b/l10ntools/prj/build.lst
new file mode 100644
index 000000000000..ff961c096cbd
--- /dev/null
+++ b/l10ntools/prj/build.lst
@@ -0,0 +1,10 @@
+tr l10ntools : tools LIBXSLT:libxslt BERKELEYDB:berkeleydb LUCENE:lucene NULL
+tr l10ntools usr1 - all tr_mkout NULL
+tr l10ntools\inc nmake - all tr_inc NULL
+tr l10ntools\source nmake - all tr_src tr_inc NULL
+tr l10ntools\layout nmake - all rt_layout tr_src tr_inc NULL
+#tr l10ntools\java\l10nconv nmake - all tr_conv NULL
+#tr l10ntools\java\receditor nmake - all tr_rece NULL
+tr l10ntools\source\help nmake - all tr_bla_help NULL
+tr l10ntools\source\filter\utils nmake - all tr_bla_utils NULL
+tr l10ntools\source\filter\merge nmake - all tr_bla_merge tr_bla_utils NULL
diff --git a/transex3/prj/d.lst b/l10ntools/prj/d.lst
index a469837275ed..f75c16b43764 100644
--- a/transex3/prj/d.lst
+++ b/l10ntools/prj/d.lst
@@ -1,4 +1,4 @@
-mkdir: %_DEST%\inc%_EXT%\transex3
+mkdir: %_DEST%\inc%_EXT%\l10ntools
mkdir: %_DEST%\bin%_EXT%
mkdir: %_DEST%\bin%_EXT%\help
mkdir: %_DEST%\bin%_EXT%\help\com
@@ -46,16 +46,16 @@ mkdir: %_DEST%\bin%_EXT%\help\com\sun\star\help
..\scripts\fast_merge.pl %_DEST%\bin%_EXT%\fast_merge.pl
..\scripts\keyidGen.pl %_DEST%\bin%_EXT%\keyidGen.pl
-..\inc\export.hxx %_DEST%\inc%_EXT%\transex3\export.hxx
-..\inc\transex3\directory.hxx %_DEST%\inc%_EXT%\transex3\directory.hxx
-..\inc\transex3\file.hxx %_DEST%\inc%_EXT%\transex3\file.hxx
-..\inc\transex3\vosapp.hxx %_DEST%\inc%_EXT%\transex3\vosapp.hxx
+..\inc\export.hxx %_DEST%\inc%_EXT%\l10ntools\export.hxx
+..\inc\l10ntools\directory.hxx %_DEST%\inc%_EXT%\l10ntools\directory.hxx
+..\inc\l10ntools\file.hxx %_DEST%\inc%_EXT%\l10ntools\file.hxx
+..\inc\l10ntools\vosapp.hxx %_DEST%\inc%_EXT%\l10ntools\vosapp.hxx
-..\inc\utf8conv.hxx %_DEST%\inc%_EXT%\transex3\utf8conv.hxx
+..\inc\utf8conv.hxx %_DEST%\inc%_EXT%\l10ntools\utf8conv.hxx
..\%__SRC%\lib\transex.lib %_DEST%\lib%_EXT%\transex.lib
..\%__SRC%\lib\libtransex.a %_DEST%\lib%_EXT%\libtransex.a
-..\source\help\compilehelp.hxx %_DEST%\inc%_EXT%\transex3\compilehelp.hxx
-#..\source\help\helplinkerdllapi.h %_DEST%\inc%_EXT%\transex3\helplinkerdllapi.h
+..\source\help\compilehelp.hxx %_DEST%\inc%_EXT%\l10ntools\compilehelp.hxx
+#..\source\help\helplinkerdllapi.h %_DEST%\inc%_EXT%\l10ntools\helplinkerdllapi.h
..\%__SRC%\lib\* %_DEST%\lib%_EXT%\*
..\%__SRC%\class\com\sun\star\help\* %_DEST%\bin%_EXT%\help\com\sun\star\help\*
diff --git a/transex3/scripts/fast_merge.pl b/l10ntools/scripts/fast_merge.pl
index 7321a9a42911..7321a9a42911 100644
--- a/transex3/scripts/fast_merge.pl
+++ b/l10ntools/scripts/fast_merge.pl
diff --git a/transex3/scripts/keyidGen.pl b/l10ntools/scripts/keyidGen.pl
index acb5137e3f7c..acb5137e3f7c 100644
--- a/transex3/scripts/keyidGen.pl
+++ b/l10ntools/scripts/keyidGen.pl
diff --git a/transex3/scripts/localize.pl b/l10ntools/scripts/localize.pl
index 10e8124027b1..0f6a19effc38 100755
--- a/transex3/scripts/localize.pl
+++ b/l10ntools/scripts/localize.pl
@@ -78,6 +78,7 @@ my $WIN;
my $languages;
#my %sl_modules; # Contains all modules where en-US and de is source language
my $use_default_date = '0';
+my $force_ooo_module = '0';
my %is_ooo_module;
my %is_so_module;
my $DELIMITER;
@@ -275,7 +276,7 @@ sub check_modules_scm
sub is_openoffice_module
{
my $module = shift;
- return "TRUE", if defined $is_ooo_module{ $module };
+ return "TRUE", if ( $force_ooo_module || defined $is_ooo_module{ $module } );
return "";
}
@@ -1114,7 +1115,7 @@ sub parse_options{
my $extract;
my $success = GetOptions('f=s' => \$sdffile , 'l=s' => \$languages , 's=s' => \$srcpath , 'h' => \$help , 'v' => \$bVerbose ,
'm' => \$merge , 'e' => \$extract , 'x' => \$no_sort , 'd' => \$use_default_date , 'c' => \$create_dirs ,
- 'n' => \$no_gsicheck );
+ 'n' => \$no_gsicheck , 'o' => \$force_ooo_module );
$outputfile = $sdffile;
#print STDOUT "DBG: lang = $languages\n";
@@ -1126,7 +1127,11 @@ sub parse_options{
exit(1);
}
}
- if( $help || !$success || $#ARGV > 1 || ( !$sdffile ) ){
+ if( $help ){
+ usage();
+ exit(0);
+ }
+ if( !$success || $#ARGV > 1 || ( !$sdffile ) ){
usage();
exit(1);
}
@@ -1167,6 +1172,8 @@ sub usage{
print STDERR " -h File with localize.sdf's\n!";
print STDERR " -n No gsicheck\n";
print STDERR " -i Module to merge\n";
+ print STDERR " -o force using ooo localization from the l10n module instead of l10n_so; \n";
+ print STDERR " useful if the type can't be detected by the .svn tags; \n";
print STDERR " -v Verbose\n";
print STDERR "\nExample:\n";
print STDERR "\nlocalize -e -l en-US,pt-BR=en-US -f my.sdf\n( Extract en-US and pt-BR with en-US fallback )\n";
diff --git a/transex3/scripts/localize_old.pl b/l10ntools/scripts/localize_old.pl
index 151399d22002..151399d22002 100755
--- a/transex3/scripts/localize_old.pl
+++ b/l10ntools/scripts/localize_old.pl
diff --git a/transex3/source/cfg_yy_wrapper.c b/l10ntools/source/cfg_yy_wrapper.c
index ac678d17f399..ac678d17f399 100644
--- a/transex3/source/cfg_yy_wrapper.c
+++ b/l10ntools/source/cfg_yy_wrapper.c
diff --git a/transex3/source/cfglex.l b/l10ntools/source/cfglex.l
index dd2d9a45ab59..dd2d9a45ab59 100644
--- a/transex3/source/cfglex.l
+++ b/l10ntools/source/cfglex.l
diff --git a/transex3/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index 0607c9e9bb06..5d85a4835843 100644
--- a/transex3/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <stdio.h>
#include <tools/string.hxx>
#include <tools/fsys.hxx>
diff --git a/transex3/source/directory.cxx b/l10ntools/source/directory.cxx
index ed0fe27d22c2..21d0a5878d66 100644
--- a/transex3/source/directory.cxx
+++ b/l10ntools/source/directory.cxx
@@ -30,8 +30,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
-#include <transex3/directory.hxx>
+#include "precompiled_l10ntools.hxx"
+#include <l10ntools/directory.hxx>
#include "tools/string.hxx"
#include <iostream>
#include <vector>
diff --git a/transex3/source/export.cxx b/l10ntools/source/export.cxx
index 5294d902d2ee..72826d7bf1f2 100644
--- a/transex3/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <stdio.h>
#include <stdlib.h>
#include <tools/fsys.hxx>
diff --git a/transex3/source/export2.cxx b/l10ntools/source/export2.cxx
index 7815e80e033f..6132b01db644 100644
--- a/transex3/source/export2.cxx
+++ b/l10ntools/source/export2.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include "export.hxx"
#include "utf8conv.hxx"
#include <tools/datetime.hxx>
@@ -354,17 +354,18 @@ bool Export::CopyFile( const ByteString& source , const ByteString& dest )
const int BUFFERSIZE = 8192;
char buf[ BUFFERSIZE ];
- FILE* IN_FILE = fopen( source.GetBuffer() , "r" );
- FILE* OUT_FILE = fopen( dest.GetBuffer() , "w" );
-
+ FILE* IN_FILE = fopen( source.GetBuffer() , "r" );
if( IN_FILE == NULL )
{
cerr << "Export::CopyFile WARNING: Could not open " << source.GetBuffer() << "\n";
return false;
}
+
+ FILE* OUT_FILE = fopen( dest.GetBuffer() , "w" );
if( OUT_FILE == NULL )
{
cerr << "Export::CopyFile WARNING: Could not open/create " << dest.GetBuffer() << " for writing\n";
+ fclose( IN_FILE );
return false;
}
diff --git a/transex3/source/file.cxx b/l10ntools/source/file.cxx
index 4ea9ca55d574..43ce4c757d54 100644
--- a/transex3/source/file.cxx
+++ b/l10ntools/source/file.cxx
@@ -30,8 +30,8 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
-#include <transex3/file.hxx>
+#include "precompiled_l10ntools.hxx"
+#include <l10ntools/file.hxx>
namespace transex
{
diff --git a/transex3/source/filter/merge/FCFGMerge.cfg b/l10ntools/source/filter/merge/FCFGMerge.cfg
index 46fcccafe7e4..46fcccafe7e4 100644
--- a/transex3/source/filter/merge/FCFGMerge.cfg
+++ b/l10ntools/source/filter/merge/FCFGMerge.cfg
diff --git a/transex3/source/filter/merge/FCFGMerge.java b/l10ntools/source/filter/merge/FCFGMerge.java
index 7fbfa8a0c986..7fbfa8a0c986 100644
--- a/transex3/source/filter/merge/FCFGMerge.java
+++ b/l10ntools/source/filter/merge/FCFGMerge.java
diff --git a/transex3/source/filter/merge/Manifest.mf b/l10ntools/source/filter/merge/Manifest.mf
index 1337eaf4d39a..1337eaf4d39a 100644
--- a/transex3/source/filter/merge/Manifest.mf
+++ b/l10ntools/source/filter/merge/Manifest.mf
diff --git a/transex3/source/filter/merge/Merger.java b/l10ntools/source/filter/merge/Merger.java
index 0bf11fc42fbf..0bf11fc42fbf 100644
--- a/transex3/source/filter/merge/Merger.java
+++ b/l10ntools/source/filter/merge/Merger.java
diff --git a/transex3/source/filter/merge/makefile.mk b/l10ntools/source/filter/merge/makefile.mk
index bf768be851d8..510ec3202bb4 100644
--- a/transex3/source/filter/merge/makefile.mk
+++ b/l10ntools/source/filter/merge/makefile.mk
@@ -31,7 +31,7 @@
PRJ = ..$/..$/..
TARGET = FCFGMerge
-PRJNAME = filter
+PRJNAME = l10ntools
PACKAGE = com$/sun$/star$/filter$/config$/tools$/merge
# --- Settings -----------------------------------------------------
diff --git a/transex3/source/filter/utils/AnalyzeStartupLog.java b/l10ntools/source/filter/utils/AnalyzeStartupLog.java
index 498528850697..498528850697 100644
--- a/transex3/source/filter/utils/AnalyzeStartupLog.java
+++ b/l10ntools/source/filter/utils/AnalyzeStartupLog.java
diff --git a/transex3/source/filter/utils/Cache.java b/l10ntools/source/filter/utils/Cache.java
index 94c26008ed13..94c26008ed13 100644
--- a/transex3/source/filter/utils/Cache.java
+++ b/l10ntools/source/filter/utils/Cache.java
diff --git a/transex3/source/filter/utils/ConfigHelper.java b/l10ntools/source/filter/utils/ConfigHelper.java
index 78cc71cf65b2..78cc71cf65b2 100644
--- a/transex3/source/filter/utils/ConfigHelper.java
+++ b/l10ntools/source/filter/utils/ConfigHelper.java
diff --git a/transex3/source/filter/utils/FileHelper.java b/l10ntools/source/filter/utils/FileHelper.java
index 71f51cf36bf6..71f51cf36bf6 100644
--- a/transex3/source/filter/utils/FileHelper.java
+++ b/l10ntools/source/filter/utils/FileHelper.java
diff --git a/transex3/source/filter/utils/Logger.java b/l10ntools/source/filter/utils/Logger.java
index 7657eba5f426..7657eba5f426 100644
--- a/transex3/source/filter/utils/Logger.java
+++ b/l10ntools/source/filter/utils/Logger.java
diff --git a/transex3/source/filter/utils/MalformedCommandLineException.java b/l10ntools/source/filter/utils/MalformedCommandLineException.java
index e073dcb9adcc..e073dcb9adcc 100644
--- a/transex3/source/filter/utils/MalformedCommandLineException.java
+++ b/l10ntools/source/filter/utils/MalformedCommandLineException.java
diff --git a/transex3/source/filter/utils/XMLHelper.java b/l10ntools/source/filter/utils/XMLHelper.java
index 0f912cac8e25..0f912cac8e25 100644
--- a/transex3/source/filter/utils/XMLHelper.java
+++ b/l10ntools/source/filter/utils/XMLHelper.java
diff --git a/transex3/source/filter/utils/makefile.mk b/l10ntools/source/filter/utils/makefile.mk
index d41d8ba9a825..4025c54b2c38 100644
--- a/transex3/source/filter/utils/makefile.mk
+++ b/l10ntools/source/filter/utils/makefile.mk
@@ -31,7 +31,7 @@
PRJ = ..$/..$/..
TARGET = FCFGUtils
-PRJNAME = filter
+PRJNAME = l10ntools
PACKAGE = com$/sun$/star$/filter$/config$/tools$/utils
# --- Settings -----------------------------------------------------
diff --git a/transex3/source/gsicheck.cxx b/l10ntools/source/gsicheck.cxx
index 99183602f951..aa3b8157952d 100644
--- a/transex3/source/gsicheck.cxx
+++ b/l10ntools/source/gsicheck.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <stdio.h>
#include <tools/fsys.hxx>
#include <tools/stream.hxx>
diff --git a/transex3/source/gsiconv.cxx b/l10ntools/source/gsiconv.cxx
index f6dea76ebb51..e127e55482da 100644
--- a/transex3/source/gsiconv.cxx
+++ b/l10ntools/source/gsiconv.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <stdio.h>
#include <tools/fsys.hxx>
#include <tools/stream.hxx>
diff --git a/transex3/source/help/HelpCompiler.cxx b/l10ntools/source/help/HelpCompiler.cxx
index 5001d0907972..5001d0907972 100644
--- a/transex3/source/help/HelpCompiler.cxx
+++ b/l10ntools/source/help/HelpCompiler.cxx
diff --git a/transex3/source/help/HelpCompiler.hxx b/l10ntools/source/help/HelpCompiler.hxx
index 7ffb096bd635..7ffb096bd635 100644
--- a/transex3/source/help/HelpCompiler.hxx
+++ b/l10ntools/source/help/HelpCompiler.hxx
diff --git a/transex3/source/help/HelpFileDocument.java b/l10ntools/source/help/HelpFileDocument.java
index 2212db27f251..2212db27f251 100644
--- a/transex3/source/help/HelpFileDocument.java
+++ b/l10ntools/source/help/HelpFileDocument.java
diff --git a/transex3/source/help/HelpIndexerTool.java b/l10ntools/source/help/HelpIndexerTool.java
index 6bf22d1ac344..6bf22d1ac344 100644
--- a/transex3/source/help/HelpIndexerTool.java
+++ b/l10ntools/source/help/HelpIndexerTool.java
diff --git a/transex3/source/help/HelpLinker.cxx b/l10ntools/source/help/HelpLinker.cxx
index 7dfe4ee4a2a2..7dfe4ee4a2a2 100644
--- a/transex3/source/help/HelpLinker.cxx
+++ b/l10ntools/source/help/HelpLinker.cxx
diff --git a/transex3/source/help/compilehelp.hxx b/l10ntools/source/help/compilehelp.hxx
index d123d628be27..d123d628be27 100644
--- a/transex3/source/help/compilehelp.hxx
+++ b/l10ntools/source/help/compilehelp.hxx
diff --git a/transex3/source/help/helplinker.pmk b/l10ntools/source/help/helplinker.pmk
index 569c5f4dbdee..569c5f4dbdee 100644
--- a/transex3/source/help/helplinker.pmk
+++ b/l10ntools/source/help/helplinker.pmk
diff --git a/transex3/source/help/makefile.mk b/l10ntools/source/help/makefile.mk
index 6fc823a1b59a..57164004af8b 100644
--- a/transex3/source/help/makefile.mk
+++ b/l10ntools/source/help/makefile.mk
@@ -30,7 +30,7 @@
#*************************************************************************
PRJ = ..$/..
-PRJNAME = xmlhelp
+PRJNAME = l10ntools
TARGET = HelpLinker
LIBBASENAME = helplinker
PACKAGE = com$/sun$/star$/help
diff --git a/transex3/source/helpex.cxx b/l10ntools/source/helpex.cxx
index f4a1589b530e..8f0b6c1d218f 100644
--- a/transex3/source/helpex.cxx
+++ b/l10ntools/source/helpex.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <stdio.h>
#include <stdlib.h>
diff --git a/transex3/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx
index 8aafc692f14c..84d73e94f312 100644
--- a/transex3/source/helpmerge.cxx
+++ b/l10ntools/source/helpmerge.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <tools/fsys.hxx>
#include <osl/file.hxx>
// local includes
diff --git a/transex3/source/inireader.cxx b/l10ntools/source/inireader.cxx
index 0985e788452d..63f902a5a1da 100644
--- a/transex3/source/inireader.cxx
+++ b/l10ntools/source/inireader.cxx
@@ -120,7 +120,7 @@ void INIreader::toStlString( const UnicodeString& str , string& stl_str)
char* buffer = new char[ str.length()*3 ];
str.extract( 0 , str.length() , buffer );
stl_str = string( buffer );
- delete buffer;
+ delete [] buffer;
}
void INIreader::trim( string& str )
diff --git a/transex3/source/lngex.cxx b/l10ntools/source/lngex.cxx
index 53c97de6e045..67ee34cbdaab 100644
--- a/transex3/source/lngex.cxx
+++ b/l10ntools/source/lngex.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <stdio.h>
// local includes
diff --git a/transex3/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index e55fdc83ce37..fcad498128c2 100644
--- a/transex3/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <tools/fsys.hxx>
// local includes
diff --git a/transex3/source/localize.cxx b/l10ntools/source/localize.cxx
index c82d152cac7e..b617fdb4cf1e 100644
--- a/transex3/source/localize.cxx
+++ b/l10ntools/source/localize.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include "srciter.hxx"
#include "export.hxx"
@@ -41,9 +41,9 @@
#include "tools/errcode.hxx"
#include "tools/fsys.hxx"
-#ifndef TRANSEX_FILE_HXX
-#define TRANSEX_FILE_HXX
-#include <transex3/file.hxx>
+#ifndef L10NTOOLS_FILE_HXX
+#define L10NTOOLS_FILE_HXX
+#include <l10ntools/file.hxx>
#endif
namespace transex3
@@ -938,10 +938,25 @@ int _cdecl main( int argc, char *argv[] )
bool hasPwd = treeconfig.getActiveRepositories( repos );
if( hasPwd ) cout << "Found special path!\n";
+ string minor_ext;
+ bool has_minor_ext;
+
+ if( Export::GetEnv("UPDMINOREXT") != NULL )
+ {
+ minor_ext = string( Export::GetEnv("UPDMINOREXT") );
+ has_minor_ext = minor_ext.size();
+ }
+ else
+ has_minor_ext = false;
+
// localize through all repositories
for( vector<string>::iterator iter = repos.begin(); iter != repos.end() ; ++iter )
{
- string curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter;
+ string curRepository;
+ if( has_minor_ext )
+ curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter + minor_ext;
+ else
+ curRepository = string( Export::GetEnv("SOURCE_ROOT_DIR") ) + "/" + *iter;
cout << "Localizing repository " << curRepository << "\n";
SourceTreeLocalizer aIter( ByteString( curRepository.c_str() ) , sVersion , (sOutput.Len() > 0) , bQuiet2 , bSkipLinks );
aIter.SetLanguageRestriction( sLanguages );
diff --git a/transex3/source/makefile.mk b/l10ntools/source/makefile.mk
index a557b210aad0..fe4ecc919179 100644
--- a/transex3/source/makefile.mk
+++ b/l10ntools/source/makefile.mk
@@ -33,7 +33,7 @@ PRJ=..
INCPRE=$(MISC)
-PRJNAME=transex3
+PRJNAME=l10ntools
TARGET=transex
TARGETTYPE=CUI
LIBTARGET=no
diff --git a/transex3/source/merge.cxx b/l10ntools/source/merge.cxx
index ee0f6f459655..42f539065651 100644
--- a/transex3/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <stdio.h>
#include <tools/fsys.hxx>
#include "export.hxx"
diff --git a/transex3/source/src_yy_wrapper.c b/l10ntools/source/src_yy_wrapper.c
index d326b9a94e86..d326b9a94e86 100644
--- a/transex3/source/src_yy_wrapper.c
+++ b/l10ntools/source/src_yy_wrapper.c
diff --git a/transex3/source/srciter.cxx b/l10ntools/source/srciter.cxx
index d2cbb2352570..cf04de4bf3fa 100644
--- a/transex3/source/srciter.cxx
+++ b/l10ntools/source/srciter.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include "srciter.hxx"
#include <stdio.h>
diff --git a/transex3/source/srclex.l b/l10ntools/source/srclex.l
index fef251e47224..fef251e47224 100644
--- a/transex3/source/srclex.l
+++ b/l10ntools/source/srclex.l
diff --git a/transex3/source/tagtest.cxx b/l10ntools/source/tagtest.cxx
index 89c1ecf15488..7896915ede0c 100644
--- a/transex3/source/tagtest.cxx
+++ b/l10ntools/source/tagtest.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <tools/string.hxx>
#include "tagtest.hxx"
diff --git a/transex3/source/treeconfig.cxx b/l10ntools/source/treeconfig.cxx
index 137492c39a50..137492c39a50 100644
--- a/transex3/source/treeconfig.cxx
+++ b/l10ntools/source/treeconfig.cxx
diff --git a/transex3/source/utf8conv.cxx b/l10ntools/source/utf8conv.cxx
index 8fc61f9bb5cc..ee35eb56befd 100644
--- a/transex3/source/utf8conv.cxx
+++ b/l10ntools/source/utf8conv.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include "utf8conv.hxx"
//
diff --git a/transex3/source/wrdtrans.cxx b/l10ntools/source/wrdtrans.cxx
index 71866cd0e618..c4a9d6ea5570 100644
--- a/transex3/source/wrdtrans.cxx
+++ b/l10ntools/source/wrdtrans.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
/*
#include "wrdtrans.hxx"
diff --git a/transex3/source/wtranode.cxx b/l10ntools/source/wtranode.cxx
index 0383ffa7feac..401c0b20fe1a 100644
--- a/transex3/source/wtranode.cxx
+++ b/l10ntools/source/wtranode.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include "wtranode.hxx"
diff --git a/transex3/source/wtratree.cxx b/l10ntools/source/wtratree.cxx
index fea67215ba51..dbf02a6f22be 100644
--- a/transex3/source/wtratree.cxx
+++ b/l10ntools/source/wtratree.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include "wtratree.hxx"
diff --git a/transex3/source/xgfconv.cxx b/l10ntools/source/xgfconv.cxx
index 76ea1a2906a8..54b92fb3c1c2 100644
--- a/transex3/source/xgfconv.cxx
+++ b/l10ntools/source/xgfconv.cxx
@@ -6,7 +6,7 @@
/*****************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#if defined(UNX) || defined(OS2)
int main( int argc, char *argv[] )
#else
diff --git a/transex3/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 921f1d329f67..f75a0afe9792 100644
--- a/transex3/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <iterator> /* std::iterator*/
#include <stdio.h>
diff --git a/transex3/source/xrm_yy_wrapper.c b/l10ntools/source/xrm_yy_wrapper.c
index 6a304d0d09dc..6a304d0d09dc 100644
--- a/transex3/source/xrm_yy_wrapper.c
+++ b/l10ntools/source/xrm_yy_wrapper.c
diff --git a/transex3/source/xrmlex.l b/l10ntools/source/xrmlex.l
index efc8bf1f7d91..efc8bf1f7d91 100644
--- a/transex3/source/xrmlex.l
+++ b/l10ntools/source/xrmlex.l
diff --git a/transex3/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index f1b3d4d6cb5a..3eadd202ef5c 100644
--- a/transex3/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -29,7 +29,7 @@
************************************************************************/
// MARKER(update_precomp.py): autogen include statement, do not remove
-#include "precompiled_transex3.hxx"
+#include "precompiled_l10ntools.hxx"
#include <stdio.h>
#include <tools/string.hxx>
#include <tools/fsys.hxx>
diff --git a/transex3/workbench/gsicheck_errors.sdf b/l10ntools/workbench/gsicheck_errors.sdf
index 04dde12e13ca..04dde12e13ca 100644
--- a/transex3/workbench/gsicheck_errors.sdf
+++ b/l10ntools/workbench/gsicheck_errors.sdf
diff --git a/transex3/workbench/gsicheck_errors_err-.sdf b/l10ntools/workbench/gsicheck_errors_err-.sdf
index f6b267b1c55b..f6b267b1c55b 100644
--- a/transex3/workbench/gsicheck_errors_err-.sdf
+++ b/l10ntools/workbench/gsicheck_errors_err-.sdf
diff --git a/transex3/workbench/gsicheck_errors_err-l.sdf b/l10ntools/workbench/gsicheck_errors_err-l.sdf
index 6ca7f7065cd2..6ca7f7065cd2 100644
--- a/transex3/workbench/gsicheck_errors_err-l.sdf
+++ b/l10ntools/workbench/gsicheck_errors_err-l.sdf
diff --git a/transex3/workbench/gsicheck_errors_err-s.sdf b/l10ntools/workbench/gsicheck_errors_err-s.sdf
index 523017fcfb35..523017fcfb35 100644
--- a/transex3/workbench/gsicheck_errors_err-s.sdf
+++ b/l10ntools/workbench/gsicheck_errors_err-s.sdf
diff --git a/transex3/workbench/gsicheck_errors_err-t.sdf b/l10ntools/workbench/gsicheck_errors_err-t.sdf
index e9594642113c..e9594642113c 100644
--- a/transex3/workbench/gsicheck_errors_err-t.sdf
+++ b/l10ntools/workbench/gsicheck_errors_err-t.sdf
diff --git a/transex3/workbench/gsicheck_errors_ok-.sdf b/l10ntools/workbench/gsicheck_errors_ok-.sdf
index 4bb4b7bece16..4bb4b7bece16 100644
--- a/transex3/workbench/gsicheck_errors_ok-.sdf
+++ b/l10ntools/workbench/gsicheck_errors_ok-.sdf
diff --git a/transex3/workbench/gsicheck_errors_ok-l.sdf b/l10ntools/workbench/gsicheck_errors_ok-l.sdf
index 9a55e7c95dd3..9a55e7c95dd3 100644
--- a/transex3/workbench/gsicheck_errors_ok-l.sdf
+++ b/l10ntools/workbench/gsicheck_errors_ok-l.sdf
diff --git a/transex3/workbench/gsicheck_errors_ok-s.sdf b/l10ntools/workbench/gsicheck_errors_ok-s.sdf
index 97dd4da6a54b..97dd4da6a54b 100644
--- a/transex3/workbench/gsicheck_errors_ok-s.sdf
+++ b/l10ntools/workbench/gsicheck_errors_ok-s.sdf
diff --git a/transex3/workbench/gsicheck_errors_ok-t.sdf b/l10ntools/workbench/gsicheck_errors_ok-t.sdf
index a6c097e6bd2f..a6c097e6bd2f 100644
--- a/transex3/workbench/gsicheck_errors_ok-t.sdf
+++ b/l10ntools/workbench/gsicheck_errors_ok-t.sdf
diff --git a/transex3/workbench/gsicheckcheck.btm b/l10ntools/workbench/gsicheckcheck.btm
index de71b17da332..de71b17da332 100644
--- a/transex3/workbench/gsicheckcheck.btm
+++ b/l10ntools/workbench/gsicheckcheck.btm
diff --git a/padmin/source/padialog.cxx b/padmin/source/padialog.cxx
index f73427526be6..5a6a1d0e319e 100644
--- a/padmin/source/padialog.cxx
+++ b/padmin/source/padialog.cxx
@@ -60,11 +60,16 @@
#include "unotools/localedatawrapper.hxx"
#include "unotools/configitem.hxx"
#include "unotools/configmgr.hxx"
+
+#include "com/sun/star/awt/Size.hpp"
+
using namespace psp;
using namespace rtl;
using namespace padmin;
using namespace osl;
+using namespace com::sun::star;
using namespace com::sun::star::uno;
+using namespace com::sun::star::beans;
PADialog* PADialog::Create( Window* pParent, BOOL bAdmin )
{
@@ -96,7 +101,6 @@ PADialog::PADialog( Window* pParent, BOOL /*bAdmin*/ ) :
m_aCancelButton( this, PaResId( RID_PA_BTN_CANCEL ) ),
m_aDefPrt( PaResId( RID_PA_STR_DEFPRT ) ),
m_aRenameStr( PaResId( RID_PA_STR_RENAME ) ),
- m_pPrinter( 0 ),
m_rPIManager( PrinterInfoManager::get() )
{
FreeResource();
@@ -248,18 +252,6 @@ IMPL_LINK( PADialog, SelectHdl, ListBox*, pListBox )
return 0;
}
-IMPL_LINK( PADialog, EndPrintHdl, void*, EMPTYARG )
-{
- String aInfoString( PaResId( RID_PA_TXT_TESTPAGE_PRINTED ) );
- InfoBox aInfoBox( this, aInfoString );
- aInfoBox.SetText( String( PaResId( RID_BXT_TESTPAGE ) ) );
- aInfoBox.Execute();
-
- delete m_pPrinter;
- m_pPrinter = NULL;
- return 0;
-}
-
void PADialog::UpdateDefPrt()
{
m_rPIManager.setDefaultPrinter( getSelectedDevice() );
@@ -369,66 +361,77 @@ static Color approachColor( const Color& rFrom, const Color& rTo )
return aColor;
}
-#define DELTA 5.0
-void PADialog::PrintTestPage()
+class SpaPrinterController : public vcl::PrinterController
{
- if( m_pPrinter ) // already printing; user pressed button twice
- return;
+public:
+ SpaPrinterController( const boost::shared_ptr<Printer>& i_pPrinter )
+ : vcl::PrinterController( i_pPrinter )
+ {}
+ virtual ~SpaPrinterController()
+ {}
+
+ virtual int getPageCount() const { return 1; }
+ virtual Sequence< PropertyValue > getPageParameters( int i_nPage ) const;
+ virtual void printPage( int i_nPage ) const;
+ virtual void jobFinished( com::sun::star::view::PrintableState );
+};
+
+Sequence< PropertyValue > SpaPrinterController::getPageParameters( int ) const
+{
+ Sequence< PropertyValue > aRet( 1 );
- String sPrinter( getSelectedDevice() );
+ Size aPageSize( getPrinter()->GetPaperSizePixel() );
+ aPageSize = getPrinter()->PixelToLogic( aPageSize, MapMode( MAP_100TH_MM ) );
+
+ awt::Size aSize;
+ aSize.Width = aPageSize.Width();
+ aSize.Height = aPageSize.Height();
+ aRet[0].Value = makeAny(aSize);
- m_pPrinter = new Printer( sPrinter );
+ return aRet;
+}
- PrinterInfo aInfo( m_rPIManager.getPrinterInfo( sPrinter ) );
+void SpaPrinterController::printPage( int ) const
+{
+ const double DELTA = 5.0;
+
+ boost::shared_ptr<Printer> pPrinter( getPrinter() );
+
+ PrinterInfo aInfo( psp::PrinterInfoManager::get().getPrinterInfo( pPrinter->GetName() ) );
const PPDParser* pPrintParser = aInfo.m_pParser;
MapMode aMapMode( MAP_100TH_MM );
Bitmap aButterfly( PaResId( RID_BUTTERFLY ) );
- m_pPrinter->SetMapMode( aMapMode );
- m_pPrinter->SetEndPrintHdl( LINK( this, PADialog, EndPrintHdl ) );
+ pPrinter->SetMapMode( aMapMode );
Any aRet = utl::ConfigManager::GetDirectConfigProperty( utl::ConfigManager::PRODUCTNAME );
OUString aJobName;
aRet >>= aJobName;
aJobName = aJobName + OUString( RTL_CONSTASCII_USTRINGPARAM( " Testpage" ) );
- if( m_pPrinter->GetName() != sPrinter || ! m_pPrinter->StartJob( aJobName ) )
- {
- String aString( PaResId( RID_ERR_NOPRINTER ) );
- aString.SearchAndReplaceAscii( "%s", sPrinter );
- ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aString );
- aErrorBox.SetText( String( PaResId( RID_BXT_ENVIRONMENT ) ) );
- aErrorBox.Execute();
- delete m_pPrinter;
- m_pPrinter = 0;
- return;
- }
- m_pPrinter->StartPage();
-
- Size aPaperSize=m_pPrinter->GetOutputSize();
+ Size aPaperSize=pPrinter->GetOutputSize();
Point aCenter( aPaperSize.Width()/2-300,
aPaperSize.Height() - aPaperSize.Width()/2 );
Point aP1( aPaperSize.Width()/48, 0), aP2( aPaperSize.Width()/40, 0 ), aPoint;
- m_pPrinter->DrawRect( Rectangle( Point( 0,0 ), aPaperSize ) );
- m_pPrinter->DrawRect( Rectangle( Point( 100,100 ),
+ pPrinter->DrawRect( Rectangle( Point( 0,0 ), aPaperSize ) );
+ pPrinter->DrawRect( Rectangle( Point( 100,100 ),
Size( aPaperSize.Width()-200,
aPaperSize.Height()-200 ) ) );
- m_pPrinter->DrawRect( Rectangle( Point( 200,200 ),
+ pPrinter->DrawRect( Rectangle( Point( 200,200 ),
Size( aPaperSize.Width()-400,
aPaperSize.Height()-400 ) ) );
- m_pPrinter->DrawRect( Rectangle( Point( 300,300 ),
+ pPrinter->DrawRect( Rectangle( Point( 300,300 ),
Size( aPaperSize.Width()-600,
aPaperSize.Height()-600 ) ) );
- Font aFont( m_pPrinter->GetFont() );
- aFont.SetName( String( RTL_CONSTASCII_USTRINGPARAM( "Courier" ) ) );
+ Font aFont( String( RTL_CONSTASCII_USTRINGPARAM( "Courier" ) ), Size( 0, 400 ) );
aFont.SetWeight( WEIGHT_NORMAL );
aFont.SetItalic( ITALIC_NONE );
- m_pPrinter->SetFont( aFont );
+ pPrinter->SetFont( aFont );
OUStringBuffer aPrintText(1024);
long nWidth = 0, nMaxWidth = 0;
@@ -455,12 +458,12 @@ void PADialog::PrintTestPage()
aToken = String::CreateFromAscii( aResIds[i].pDirect );
else
aToken = String( PaResId( aResIds[i].nResId ) );
- nMaxWidth = ( nWidth = m_pPrinter->GetTextWidth( aToken ) ) > nMaxWidth ? nWidth : nMaxWidth;
+ nMaxWidth = ( nWidth = pPrinter->GetTextWidth( aToken ) ) > nMaxWidth ? nWidth : nMaxWidth;
aPrintText.append( aToken );
aPrintText.append( (sal_Unicode)'\n' );
};
- m_pPrinter->DrawText( Rectangle( Point( 1000, 2000 ),
+ pPrinter->DrawText( Rectangle( Point( 1000, 1000 ),
Size( aPaperSize.Width() - 2000,
aPaperSize.Height() - 4000 ) ),
aPrintText.makeStringAndClear(),
@@ -470,7 +473,7 @@ void PADialog::PrintTestPage()
const LocaleDataWrapper& rLocaleWrapper( aSettings.GetLocaleDataWrapper() );
aPrintText.appendAscii( ": " );
- aPrintText.append( sPrinter );
+ aPrintText.append( pPrinter->GetName() );
aPrintText.appendAscii( "\n: " );
if( pPrintParser )
aPrintText.append( pPrintParser->getPrinterName() );
@@ -487,17 +490,17 @@ void PADialog::PrintTestPage()
aPrintText.appendAscii( "\n: " );
aPrintText.append( rLocaleWrapper.getTime( Time() ) );
- m_pPrinter->DrawText( Rectangle( Point( 1100 + nMaxWidth, 2000 ),
+ pPrinter->DrawText( Rectangle( Point( 1100 + nMaxWidth, 1000 ),
Size( aPaperSize.Width() - 2100 - nMaxWidth,
aPaperSize.Height() - 4000 ) ),
aPrintText.makeStringAndClear(),
TEXT_DRAW_MULTILINE );
- m_pPrinter->DrawBitmap( Point( aPaperSize.Width() - 4000, 1000 ),
+ pPrinter->DrawBitmap( Point( aPaperSize.Width() - 4000, 1000 ),
Size( 3000,3000 ),
aButterfly );
- m_pPrinter->SetFillColor();
- m_pPrinter->DrawRect( Rectangle( Point( aPaperSize.Width() - 4000, 1000 ),
+ pPrinter->SetFillColor();
+ pPrinter->DrawRect( Rectangle( Point( aPaperSize.Width() - 4000, 1000 ),
Size( 3000,3000 ) ) );
Color aWhite( 0xff, 0xff, 0xff );
@@ -511,22 +514,22 @@ void PADialog::PrintTestPage()
Gradient aGradient( GRADIENT_LINEAR, aBlack, aWhite );
aGradient.SetAngle( 900 );
- m_pPrinter->DrawGradient( Rectangle( Point( 1000, 5500 ),
+ pPrinter->DrawGradient( Rectangle( Point( 1000, 5500 ),
Size( aPaperSize.Width() - 2000,
500 ) ), aGradient );
aGradient.SetStartColor( aDarkRed );
aGradient.SetEndColor( aLightBlue );
- m_pPrinter->DrawGradient( Rectangle( Point( 1000, 6300 ),
+ pPrinter->DrawGradient( Rectangle( Point( 1000, 6300 ),
Size( aPaperSize.Width() - 2000,
500 ) ), aGradient );
aGradient.SetStartColor( aDarkBlue );
aGradient.SetEndColor( aLightGreen );
- m_pPrinter->DrawGradient( Rectangle( Point( 1000, 7100 ),
+ pPrinter->DrawGradient( Rectangle( Point( 1000, 7100 ),
Size( aPaperSize.Width() - 2000,
500 ) ), aGradient );
aGradient.SetStartColor( aDarkGreen );
aGradient.SetEndColor( aLightRed );
- m_pPrinter->DrawGradient( Rectangle( Point( 1000, 7900 ),
+ pPrinter->DrawGradient( Rectangle( Point( 1000, 7900 ),
Size( aPaperSize.Width() - 2000,
500 ) ), aGradient );
@@ -543,7 +546,7 @@ void PADialog::PrintTestPage()
{
aLineInfo.SetWidth( n/3 );
aLineColor = approachColor( aLineColor, aApproachColor );
- m_pPrinter->SetLineColor( aLineColor );
+ pPrinter->SetLineColor( aLineColor );
// switch aproach color
if( aApproachColor.IsRGBEqual( aLineColor ) )
@@ -556,7 +559,7 @@ void PADialog::PrintTestPage()
aApproachColor = Color( 0, 200, 0 );
}
- m_pPrinter->DrawLine( project( aP1 ) + aCenter,
+ pPrinter->DrawLine( project( aP1 ) + aCenter,
project( aP2 ) + aCenter,
aLineInfo );
aPoint.X() = (int)((((double)aP1.X())*cosd - ((double)aP1.Y())*sind)*factor);
@@ -569,8 +572,38 @@ void PADialog::PrintTestPage()
#if (OSL_DEBUG_LEVEL > 1) || defined DBG_UTIL
fprintf( stderr, "%d lines\n",n );
#endif
- m_pPrinter->EndPage();
- m_pPrinter->EndJob();
+}
+
+void SpaPrinterController::jobFinished( com::sun::star::view::PrintableState )
+{
+ String aInfoString( PaResId( RID_PA_TXT_TESTPAGE_PRINTED ) );
+ InfoBox aInfoBox( NULL, aInfoString );
+ aInfoBox.SetText( String( PaResId( RID_BXT_TESTPAGE ) ) );
+ aInfoBox.Execute();
+}
+
+void PADialog::PrintTestPage()
+{
+ String sPrinter( getSelectedDevice() );
+
+ boost::shared_ptr<Printer> pPrinter( new Printer( sPrinter ) );
+
+ if( pPrinter->GetName() != sPrinter )
+ {
+ String aString( PaResId( RID_ERR_NOPRINTER ) );
+ aString.SearchAndReplaceAscii( "%s", sPrinter );
+
+ ErrorBox aErrorBox( this, WB_OK | WB_DEF_OK, aString );
+ aErrorBox.SetText( String( PaResId( RID_BXT_ENVIRONMENT ) ) );
+ aErrorBox.Execute();
+ return;
+ }
+
+ boost::shared_ptr<vcl::PrinterController> pController( new SpaPrinterController( pPrinter ) );
+ JobSetup aJobSetup( pPrinter->GetJobSetup() );
+ aJobSetup.SetValue( String( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ),
+ String( RTL_CONSTASCII_USTRINGPARAM( "true" ) ) );
+ Printer::PrintJob( pController, aJobSetup );
}
void PADialog::AddDevice()
diff --git a/padmin/source/padialog.hxx b/padmin/source/padialog.hxx
index ac6ee8f4279f..0350f66a2905 100644
--- a/padmin/source/padialog.hxx
+++ b/padmin/source/padialog.hxx
@@ -83,7 +83,6 @@ namespace padmin {
String m_aDefPrt;
String m_aRenameStr;
- Printer* m_pPrinter;
::psp::PrinterInfoManager& m_rPIManager;
::std::list< ::rtl::OUString > m_aPrinters;
@@ -94,7 +93,6 @@ namespace padmin {
DECL_LINK( ClickBtnHdl, PushButton* );
DECL_LINK( DoubleClickHdl, ListBox* );
DECL_LINK( SelectHdl, ListBox* );
- DECL_LINK( EndPrintHdl, void* );
DECL_LINK( DelPressedHdl, ListBox* );
PADialog( Window*, BOOL );
diff --git a/padmin/source/prtsetup.cxx b/padmin/source/prtsetup.cxx
index 6cf4f8b257b1..69217e2d0063 100644
--- a/padmin/source/prtsetup.cxx
+++ b/padmin/source/prtsetup.cxx
@@ -44,9 +44,9 @@ using namespace rtl;
using namespace psp;
using namespace padmin;
-void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDKey* pKey )
+void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDParser* pParser, const PPDKey* pKey )
{
- if( ! pKey )
+ if( ! pKey || ! pParser )
return;
const PPDValue* pValue = NULL;
@@ -56,7 +56,7 @@ void RTSDialog::insertAllPPDValues( ListBox& rBox, const PPDKey* pKey )
for( int i = 0; i < pKey->countValues(); i++ )
{
pValue = pKey->getValue( i );
- aOptionText = pValue->m_aOptionTranslation.Len() ? pValue->m_aOptionTranslation : pValue->m_aOption;
+ aOptionText = pParser->translateOption( pKey->getKey(), pValue->m_aOption) ;
if( m_aJobData.m_aContext.checkConstraints( pKey, pValue ) )
{
@@ -282,7 +282,7 @@ void RTSPaperPage::update()
if( m_pParent->m_aJobData.m_pParser &&
(pKey = m_pParent->m_aJobData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "Duplex" ) ) )) )
{
- m_pParent->insertAllPPDValues( m_aDuplexBox, pKey );
+ m_pParent->insertAllPPDValues( m_aDuplexBox, m_pParent->m_aJobData.m_pParser, pKey );
}
else
{
@@ -294,7 +294,7 @@ void RTSPaperPage::update()
if( m_pParent->m_aJobData.m_pParser &&
(pKey = m_pParent->m_aJobData.m_pParser->getKey( String( RTL_CONSTASCII_USTRINGPARAM( "PageSize" ) ) )) )
{
- m_pParent->insertAllPPDValues( m_aPaperBox, pKey );
+ m_pParent->insertAllPPDValues( m_aPaperBox, m_pParent->m_aJobData.m_pParser, pKey );
}
else
{
@@ -306,7 +306,7 @@ void RTSPaperPage::update()
if( m_pParent->m_aJobData.m_pParser &&
(pKey = m_pParent->m_aJobData.m_pParser->getKey( String::CreateFromAscii( "InputSlot" ) )) )
{
- m_pParent->insertAllPPDValues( m_aSlotBox, pKey );
+ m_pParent->insertAllPPDValues( m_aSlotBox, m_pParent->m_aJobData.m_pParser, pKey );
}
else
{
@@ -411,8 +411,8 @@ RTSDevicePage::RTSDevicePage( RTSDialog* pParent ) :
! pKey->getKey().EqualsAscii( "Duplex" )
)
{
- USHORT nPos =
- m_aPPDKeyBox.InsertEntry( pKey->getUITranslation().Len() ? pKey->getUITranslation() : pKey->getKey() );
+ String aEntry( m_pParent->m_aJobData.m_pParser->translateKey( pKey->getKey() ) );
+ USHORT nPos = m_aPPDKeyBox.InsertEntry( aEntry );
m_aPPDKeyBox.SetEntryData( nPos, (void*)pKey );
}
}
@@ -466,10 +466,11 @@ void RTSDevicePage::FillValueBox( const PPDKey* pKey )
for( int i = 0; i < pKey->countValues(); i++ )
{
pValue = pKey->getValue( i );
- if( m_pParent->m_aJobData.m_aContext.checkConstraints( pKey, pValue ) )
+ if( m_pParent->m_aJobData.m_aContext.checkConstraints( pKey, pValue ) &&
+ m_pParent->m_aJobData.m_pParser )
{
- USHORT nPos =
- m_aPPDValueBox.InsertEntry( pValue->m_aOptionTranslation.Len() ? pValue->m_aOptionTranslation : pValue->m_aOption );
+ String aEntry( m_pParent->m_aJobData.m_pParser->translateOption( pKey->getKey(), pValue->m_aOption ) );
+ USHORT nPos = m_aPPDValueBox.InsertEntry( aEntry );
m_aPPDValueBox.SetEntryData( nPos, (void*)pValue );
}
}
diff --git a/padmin/source/prtsetup.hxx b/padmin/source/prtsetup.hxx
index 8487daa158da..1e296fa9ed88 100644
--- a/padmin/source/prtsetup.hxx
+++ b/padmin/source/prtsetup.hxx
@@ -85,7 +85,7 @@ class RTSDialog : public TabDialog
DECL_LINK( ClickButton, Button* );
// helper functions
- void insertAllPPDValues( ListBox&, const ::psp::PPDKey* );
+ void insertAllPPDValues( ListBox&, const psp::PPDParser*, const psp::PPDKey* );
public:
RTSDialog( const ::psp::PrinterInfo& rJobData, const String& rPrinter, bool bAllPages, Window* pParent = NULL );
~RTSDialog();
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 9ae58087a335..e59a1e056f4b 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -2281,6 +2281,7 @@ RscTop * RscTypCont::InitClassTabControl( RscTop * pSuper,
RSC_TABCONTROL_ITEMLIST );
INS_WINBIT( pClassTabControl, SingleLine );
+ INS_WINBIT( pClassTabControl, DropDown );
}
return pClassTabControl;
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx
index 46ae3529439c..0e20af6118af 100644
--- a/sot/source/sdstor/stgstrms.cxx
+++ b/sot/source/sdstor/stgstrms.cxx
@@ -1104,7 +1104,7 @@ StgTmpStrm::~StgTmpStrm()
}
}
-ULONG StgTmpStrm::GetSize()
+ULONG StgTmpStrm::GetSize() const
{
ULONG n;
if( pStrm )
diff --git a/sot/source/sdstor/stgstrms.hxx b/sot/source/sdstor/stgstrms.hxx
index 806d562af6d0..fd7971da3aba 100644
--- a/sot/source/sdstor/stgstrms.hxx
+++ b/sot/source/sdstor/stgstrms.hxx
@@ -167,8 +167,7 @@ public:
~StgTmpStrm();
BOOL Copy( StgTmpStrm& );
void SetSize( ULONG );
- using SvMemoryStream::GetSize;
- ULONG GetSize();
+ ULONG GetSize() const;
};
#endif
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index d7e797c681f3..274f7d4a4c1a 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -43,21 +43,17 @@
#include <com/sun/star/ucb/InsertCommandArgument.hpp>
#include <com/sun/star/ucb/ResultSetException.hpp>
#include <com/sun/star/uno/Sequence.h>
-#ifndef _COM_SUN_STAR_SDBC_XRESULTSET_HDL_
#include <com/sun/star/sdbc/XResultSet.hdl>
-#endif
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
#include <com/sun/star/datatransfer/DataFlavor.hpp>
-#include <com/sun/star/ucb/XContentCreator.hpp>
+#include <com/sun/star/ucb/ContentInfo.hpp>
#include <com/sun/star/ucb/ContentInfoAttribute.hpp>
#include <com/sun/star/beans/Property.hpp>
#include <com/sun/star/packages/manifest/XManifestWriter.hpp>
#include <com/sun/star/packages/manifest/XManifestReader.hpp>
-#ifndef _COM_SUN_STAR_UCB_INTERACTIVEIODEXCEPTION_HPP_
#include <com/sun/star/ucb/InteractiveIOException.hpp>
-#endif
#include <rtl/digest.h>
#include <tools/ref.hxx>
@@ -113,11 +109,11 @@ public:
virtual void SAL_CALL seek( sal_Int64 _nLocation ) throw ( IllegalArgumentException, IOException, RuntimeException);
virtual sal_Int64 SAL_CALL getPosition( ) throw ( IOException, RuntimeException);
virtual sal_Int64 SAL_CALL getLength( ) throw ( IOException, RuntimeException);
- virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) throw( NotConnectedException, BufferSizeExceededException, RuntimeException );
- virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw( NotConnectedException, BufferSizeExceededException, RuntimeException );
- virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) throw( NotConnectedException, BufferSizeExceededException, RuntimeException);
- virtual sal_Int32 SAL_CALL available() throw( NotConnectedException, RuntimeException );
- virtual void SAL_CALL closeInput() throw( NotConnectedException, RuntimeException );
+ virtual sal_Int32 SAL_CALL readBytes( Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead) throw( NotConnectedException, BufferSizeExceededException, RuntimeException );
+ virtual sal_Int32 SAL_CALL readSomeBytes( Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw( NotConnectedException, BufferSizeExceededException, RuntimeException );
+ virtual void SAL_CALL skipBytes(sal_Int32 nBytesToSkip) throw( NotConnectedException, BufferSizeExceededException, RuntimeException);
+ virtual sal_Int32 SAL_CALL available() throw( NotConnectedException, RuntimeException );
+ virtual void SAL_CALL closeInput() throw( NotConnectedException, RuntimeException );
protected:
void checkConnected();
@@ -540,7 +536,7 @@ public:
// this means that the root storage does an autocommit when its external
// reference is destroyed
BOOL m_bIsRoot; // marks this storage as root storages that manages all oommits and reverts
- BOOL m_bDirty; // ???
+ BOOL m_bDirty; // ???
BOOL m_bIsLinked;
BOOL m_bListCreated;
ULONG m_nFormat;
@@ -575,12 +571,12 @@ public:
ReadContent();
if ( m_nMode & STREAM_WRITE )
{
- m_nError = nError;
- if ( m_pAntiImpl )
- {
- m_pAntiImpl->ResetError();
- m_pAntiImpl->SetError( nError );
- }
+ m_nError = nError;
+ if ( m_pAntiImpl )
+ {
+ m_pAntiImpl->ResetError();
+ m_pAntiImpl->SetError( nError );
+ }
}
return m_aChildrenList;
@@ -867,7 +863,7 @@ BOOL UCBStorageStream_Impl::Init()
// usually means that stream could not be opened
}
- if( m_rSource.is() )
+ if( m_rSource.is() )
{
m_pStream->Seek( STREAM_SEEK_TO_END );
@@ -894,7 +890,7 @@ BOOL UCBStorageStream_Impl::Init()
{
// if the new file is edited than no source exist
m_bSourceRead = FALSE;
- //SetError( SVSTREAM_CANNOT_MAKE );
+ //SetError( SVSTREAM_CANNOT_MAKE );
}
}
@@ -1107,7 +1103,7 @@ ULONG UCBStorageStream_Impl::SeekPos( ULONG nPos )
else
{
// the temp stream pointer points to the end now
- aResult = m_pStream->Tell();
+ aResult = m_pStream->Tell();
if( aResult < nPos )
{
@@ -1886,7 +1882,7 @@ void UCBStorage_Impl::Init()
{
if ( !pStream->GetError() )
{
- ::utl::OInputStreamWrapper* pHelper = new ::utl::OInputStreamWrapper( *pStream );
+ ::utl::OInputStreamWrapper* pHelper = new ::utl::OInputStreamWrapper( *pStream );
com::sun::star::uno::Reference < ::com::sun::star::io::XInputStream > xInputStream( pHelper );
// create a manifest reader object that will read in the manifest from the stream
@@ -2042,8 +2038,8 @@ void UCBStorage_Impl::ReadContent()
if ( m_bRepairPackage )
{
xComEnv = new ::ucbhelper::CommandEnvironment( Reference< ::com::sun::star::task::XInteractionHandler >(),
- m_xProgressHandler );
- aName += String( RTL_CONSTASCII_USTRINGPARAM( "?repairpackage" ) );
+ m_xProgressHandler );
+ aName += String( RTL_CONSTASCII_USTRINGPARAM( "?repairpackage" ) );
}
::ucbhelper::Content aContent( aName, xComEnv );
@@ -2281,13 +2277,10 @@ BOOL UCBStorage_Impl::Insert( ::ucbhelper::Content *pContent )
// a new substorage is inserted into a UCBStorage ( given by the parameter pContent )
// it must be inserted with a title and a type
BOOL bRet = FALSE;
- Reference< XContentCreator > xCreator = Reference< XContentCreator >( pContent->get(), UNO_QUERY );
- if ( !xCreator.is() )
- return sal_False;
try
{
- Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo();
+ Sequence< ContentInfo > aInfo = pContent->queryCreatableContentsInfo();
sal_Int32 nCount = aInfo.getLength();
if ( nCount == 0 )
return sal_False;
@@ -2639,7 +2632,7 @@ BOOL UCBStorage_Impl::Revert()
}
else if ( pElement->m_xStorage.Is() )
{
- pElement->m_xStorage->m_bCommited = sal_False;
+ pElement->m_xStorage->m_bCommited = sal_False;
pElement->m_xStorage->Revert();
}
@@ -2655,7 +2648,7 @@ BOOL UCBStorage_Impl::Revert()
const String& UCBStorage::GetName() const
{
- return pImp->m_aName; // pImp->m_aURL ?!
+ return pImp->m_aName; // pImp->m_aURL ?!
}
BOOL UCBStorage::IsRoot() const
@@ -2893,7 +2886,7 @@ BOOL UCBStorage::CopyTo( const String& rElemName, BaseStorage* pDest, const Stri
else
{
// for copying no optimization is usefull, because in every case the stream data must be copied
- UCBStorageElement_Impl* pElement = FindElement_Impl( rElemName );
+ UCBStorageElement_Impl* pElement = FindElement_Impl( rElemName );
if ( pElement )
return CopyStorageElement_Impl( *pElement, pDest, rNew );
else
@@ -3256,10 +3249,10 @@ BOOL UCBStorage::MoveTo( const String& rEleName, BaseStorage* pNewSt, const Stri
{
// because the element is moved, not copied, a special optimization is possible :
// first copy the UCBStorageElement; flag old element as "Removed" and new as "Inserted",
- // clear original name/type of the new element
- // if moved element is open: copy content, but change absolute URL ( and those of all children of the element! ),
+ // clear original name/type of the new element
+ // if moved element is open: copy content, but change absolute URL ( and those of all children of the element! ),
// clear original name/type of new content, keep the old original stream/storage, but forget its working streams,
- // close original UCBContent and original stream, only the TempFile and its stream may remain unchanged, but now
+ // close original UCBContent and original stream, only the TempFile and its stream may remain unchanged, but now
// belong to the new content
// if original and editable stream are identical ( readonly element ), it has to be copied to the editable
// stream of the destination object
diff --git a/svl/inc/svl/solar.hrc b/svl/inc/svl/solar.hrc
index 96149b89131c..26ab8a959c5e 100644
--- a/svl/inc/svl/solar.hrc
+++ b/svl/inc/svl/solar.hrc
@@ -2,13 +2,10 @@
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * Copyright 2008 by Sun Microsystems, Inc.
+ * Copyright 2009 by Sun Microsystems, Inc.
*
* OpenOffice.org - a multi-platform office productivity suite
*
- * $RCSfile: solar.hrc,v $
- * $Revision: 1.6 $
- *
* This file is part of OpenOffice.org.
*
* OpenOffice.org is free software: you can redistribute it and/or modify
@@ -171,6 +168,9 @@
#define HID_START 32768
+#define HID_VCL_START (HID_START+100)
+#define HID_VCL_END (HID_START+150)
+
#define HID_SVTOOLS_START (HID_START+200)
#define HID_SVTOOLS_END (HID_START+299)
@@ -207,8 +207,10 @@
#define HID_GOODIES_START (HID_LIB_START+2100)
#define HID_GOODIES_END (HID_LIB_START+2199)
+#if 0 // currently unused range
#define HID_SCHEDULE_START (HID_LIB_START+2200)
#define HID_SCHEDULE_END (HID_LIB_START+3399)
+#endif
#define HID_CHANNEL_START (HID_LIB_START+3400)
#define HID_CHANNEL_END (HID_LIB_START+3499)
@@ -300,6 +302,5 @@
#define HID_EXTENSIONS_START (HID_OBJ_START+2281)
#define HID_EXTENSIONS_END (HID_OBJ_START+2800)
-
#endif
diff --git a/svl/source/numbers/numhead.cxx b/svl/source/numbers/numhead.cxx
index 99ff33433de3..3bb650b0c9ae 100644
--- a/svl/source/numbers/numhead.cxx
+++ b/svl/source/numbers/numhead.cxx
@@ -139,7 +139,7 @@ ImpSvNumMultipleReadHeader::ImpSvNumMultipleReadHeader(SvStream& rNewStream) :
ImpSvNumMultipleReadHeader::~ImpSvNumMultipleReadHeader()
{
- DBG_ASSERT( pMemStream->Tell() == pMemStream->GetSize(),
+ DBG_ASSERT( pMemStream->Tell() == pMemStream->GetEndOfData(),
"Sizes nicht vollstaendig gelesen" );
delete pMemStream;
delete [] pBuf;
diff --git a/svtools/inc/svtools/imapobj.hxx b/svtools/inc/svtools/imapobj.hxx
index b8da0e5c3ee8..46b73ee95f2c 100644
--- a/svtools/inc/svtools/imapobj.hxx
+++ b/svtools/inc/svtools/imapobj.hxx
@@ -96,7 +96,7 @@ public:
static rtl_TextEncoding nActualTextEncoding;
- IMapObject() {};
+ IMapObject();
IMapObject( const String& rURL,
const String& rAltText,
const String& rDesc,
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index b0d20bf7ce30..1a6465bd5c5d 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1152,6 +1152,7 @@ void FontSizeBox::ImplInit()
SetDecimalDigits( 1 );
SetMin( 20 );
SetMax( 9999 );
+ SetProminentEntryType( PROMINENT_MIDDLE );
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/control/filectrl.cxx b/svtools/source/control/filectrl.cxx
index d820dce097ed..f00cf45be0e6 100644
--- a/svtools/source/control/filectrl.cxx
+++ b/svtools/source/control/filectrl.cxx
@@ -78,6 +78,9 @@ WinBits FileControl::ImplInitStyle( WinBits nStyle )
maButton.SetStyle( (maButton.GetStyle()|WB_NOTABSTOP)&(~WB_TABSTOP) );
}
+ const WinBits nAlignmentStyle = ( WB_TOP | WB_VCENTER | WB_BOTTOM );
+ maEdit.SetStyle( ( maEdit.GetStyle() & ~nAlignmentStyle ) | ( nStyle & nAlignmentStyle ) );
+
if ( !(nStyle & WB_NOGROUP) )
nStyle |= WB_GROUP;
diff --git a/svtools/source/dialogs/prnsetup.cxx b/svtools/source/dialogs/prnsetup.cxx
index dedb5b2d7143..74cfe7b1286a 100644
--- a/svtools/source/dialogs/prnsetup.cxx
+++ b/svtools/source/dialogs/prnsetup.cxx
@@ -59,7 +59,7 @@ void ImplFillPrnDlgListBox( const Printer* pPrinter,
}
pBox->Enable( nCount != 0 );
- pPropBtn->Enable( pPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
+ pPropBtn->Show( pPrinter->HasSupport( SUPPORT_SETUPDIALOG ) );
}
// -----------------------------------------------------------------------
diff --git a/svtools/source/filter.vcl/filter/filter2.cxx b/svtools/source/filter.vcl/filter/filter2.cxx
index d570dd34e50f..9e0e3ba43d54 100644
--- a/svtools/source/filter.vcl/filter/filter2.cxx
+++ b/svtools/source/filter.vcl/filter/filter2.cxx
@@ -471,7 +471,8 @@ BOOL GraphicDescriptor::ImpDetectJPG( SvStream& rStm, BOOL bExtendedInfo )
// Groesse des verbleibenden Puffers ermitteln
if ( bLinked )
- nMax = ( (SvMemoryStream&) rStm ).GetSize() - 16;
+ nMax = static_cast< SvMemoryStream& >(rStm).GetEndOfData()
+ - 16;
else
nMax = DATA_SIZE - 16;
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.cxx b/svtools/source/filter.vcl/jpeg/jpeg.cxx
index 81d07ccd5e79..ee2b2baebee0 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.cxx
+++ b/svtools/source/filter.vcl/jpeg/jpeg.cxx
@@ -656,10 +656,14 @@ void* JPEGWriter::GetScanline( long nY )
aColor = pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) );
#ifndef SYSTEM_JPEG
*pTmp++ = aColor.GetBlue();
+ if ( bGreys )
+ continue;
*pTmp++ = aColor.GetGreen();
*pTmp++ = aColor.GetRed();
#else
*pTmp++ = aColor.GetRed();
+ if ( bGreys )
+ continue;
*pTmp++ = aColor.GetGreen();
*pTmp++ = aColor.GetBlue();
#endif
@@ -672,10 +676,14 @@ void* JPEGWriter::GetScanline( long nY )
aColor = pAcc->GetPixel( nY, nX );
#ifndef SYSTEM_JPEG
*pTmp++ = aColor.GetBlue();
+ if ( bGreys )
+ continue;
*pTmp++ = aColor.GetGreen();
*pTmp++ = aColor.GetRed();
#else
*pTmp++ = aColor.GetRed();
+ if ( bGreys )
+ continue;
*pTmp++ = aColor.GetGreen();
*pTmp++ = aColor.GetBlue();
#endif
@@ -711,20 +719,43 @@ BOOL JPEGWriter::Write( const Graphic& rGraphic )
pAcc = aGraphicBmp.AcquireReadAccess();
+ if ( !bGreys ) // bitmap was not explicitely converted into greyscale,
+ { // check if source is greyscale only
+
+ sal_Bool bIsGrey = sal_True;
+
+ long nWidth = pAcc->Width();
+ for ( long nY = 0; bIsGrey && ( nY < pAcc->Height() ); nY++ )
+ {
+ BitmapColor aColor;
+ for( long nX = 0L; bIsGrey && ( nX < nWidth ); nX++ )
+ {
+ aColor = pAcc->HasPalette() ? pAcc->GetPaletteColor( (BYTE) pAcc->GetPixel( nY, nX ) )
+ : pAcc->GetPixel( nY, nX );
+ bIsGrey = ( aColor.GetRed() == aColor.GetGreen() ) && ( aColor.GetRed() == aColor.GetBlue() );
+ }
+ }
+ if ( bIsGrey )
+ bGreys = sal_True;
+ }
+
if( pAcc )
{
+ if ( bGreys )
+ bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_8BIT_PAL );
+ else
#ifndef SYSTEM_JPEG
- bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR );
+ bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_BGR );
#else
- bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
+ bNative = ( pAcc->GetScanlineFormat() == BMP_FORMAT_24BIT_TC_RGB );
#endif
if( !bNative )
- pBuffer = new BYTE[ AlignedWidth4Bytes( pAcc->Width() * 24L ) ];
+ pBuffer = new BYTE[ AlignedWidth4Bytes( bGreys ? pAcc->Width() * 8L : pAcc->Width() * 24L ) ];
JPEGCallbackStruct aCallbackData;
aCallbackData.xStatusIndicator = xStatusIndicator;
- bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), nQuality, &aCallbackData );
+ bRet = (BOOL) WriteJPEG( this, &rOStm, pAcc->Width(), pAcc->Height(), bGreys, nQuality, &aCallbackData );
delete[] pBuffer;
pBuffer = NULL;
diff --git a/svtools/source/filter.vcl/jpeg/jpeg.h b/svtools/source/filter.vcl/jpeg/jpeg.h
index eaeaa503b5e9..4d5aafe413bb 100644
--- a/svtools/source/filter.vcl/jpeg/jpeg.h
+++ b/svtools/source/filter.vcl/jpeg/jpeg.h
@@ -64,7 +64,7 @@ void* JPEGMalloc( size_t size );
void JPEGFree( void *ptr );
long JPEGCallback( void* pCallbackData, long nPercent );
-long WriteJPEG( void* pJPEGWriter, void* pOStm, long nWidth, long nHeight,
+long WriteJPEG( void* pJPEGWriter, void* pOStm, long nWidth, long nHeight, long bGreyScale,
long nQualityPercent, void* pCallbackData );
void* GetScanline( void* pJPEGWriter, long nY );
diff --git a/svtools/source/filter.vcl/jpeg/jpegc.c b/svtools/source/filter.vcl/jpeg/jpegc.c
index 84394d945f79..0525877f2614 100644
--- a/svtools/source/filter.vcl/jpeg/jpegc.c
+++ b/svtools/source/filter.vcl/jpeg/jpegc.c
@@ -182,7 +182,7 @@ Exit:
}
long WriteJPEG( void* pJPEGWriter, void* pOStm,
- long nWidth, long nHeight,
+ long nWidth, long nHeight, long bGreys,
long nQualityPercent, void* pCallbackData )
{
struct jpeg_compress_struct cinfo;
@@ -208,8 +208,16 @@ long WriteJPEG( void* pJPEGWriter, void* pOStm,
cinfo.image_width = (JDIMENSION) nWidth;
cinfo.image_height = (JDIMENSION) nHeight;
- cinfo.input_components = 3;
- cinfo.in_color_space = JCS_RGB;
+ if ( bGreys )
+ {
+ cinfo.input_components = 1;
+ cinfo.in_color_space = JCS_GRAYSCALE;
+ }
+ else
+ {
+ cinfo.input_components = 3;
+ cinfo.in_color_space = JCS_RGB;
+ }
jpeg_set_defaults( &cinfo );
jpeg_set_quality( &cinfo, (int) nQualityPercent, FALSE );
diff --git a/svtools/source/filter.vcl/wmf/emfwr.cxx b/svtools/source/filter.vcl/wmf/emfwr.cxx
index e011dde1a0e8..1bc5364a191a 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/emfwr.cxx
@@ -165,6 +165,8 @@
#define TA_RTLREADING 256
#define TA_MASK (TA_BASELINE+TA_CENTER+TA_UPDATECP+TA_RTLREADING)
+#define MM_ANISOTROPIC 8
+
// -------------
// - EMFWriter -
// -------------
@@ -184,19 +186,37 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig
maVDev.SetMapMode( rMtf.GetPrefMapMode() );
mpFilterConfigItem = pFilterConfigItem;
+ // don't work with pixel as destination map mode -> higher resolution preferrable
+ maDestMapMode.SetMapUnit( MAP_100TH_MM );
+
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 );
+ // use [MS-EMF 2.2.11] HeaderExtension2 Object, otherwise resulting EMF cannot be converted with GetWinMetaFileBits()
+ rOStm.SeekRel( 108 );
// write initial values
- ImplBeginRecord( WIN_EMR_SETWINDOWORGEX );
- (*mpStm) << (INT32) 0 << (INT32) 0;
+
+ // set 100th mm map mode in EMF
+ ImplBeginRecord( WIN_EMR_SETMAPMODE );
+ (*mpStm) << (INT32) MM_ANISOTROPIC;
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_SETVIEWPORTEXTEX );
+ (*mpStm) << (INT32) maVDev.ImplGetDPIX() << (INT32) maVDev.ImplGetDPIY();
ImplEndRecord();
ImplBeginRecord( WIN_EMR_SETWINDOWEXTEX );
- (*mpStm) << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height();
+ (*mpStm) << (INT32) 2540 << (INT32) 2540;
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_SETVIEWPORTORGEX );
+ (*mpStm) << (INT32) 0 << (INT32) 0;
+ ImplEndRecord();
+
+ ImplBeginRecord( WIN_EMR_SETWINDOWORGEX );
+ (*mpStm) << (INT32) 0 << (INT32) 0;
ImplEndRecord();
ImplWriteRasterOp( ROP_OVERPAINT );
@@ -210,7 +230,7 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig
ImplBeginRecord( WIN_EMR_EOF );
(*mpStm)<< (sal_uInt32)0 // nPalEntries
- << (sal_uInt32)0x16 // offPalEntries
+ << (sal_uInt32)0x10 // offPalEntries
<< (sal_uInt32)0x14; // nSizeLast
ImplEndRecord();
@@ -218,14 +238,15 @@ BOOL EMFWriter::WriteEMF( const GDIMetaFile& rMtf, SvStream& rOStm, FilterConfig
// 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) << (UINT32) 0x00000001 << (UINT32) 108 //use [MS-EMF 2.2.11] HeaderExtension2 Object
+ << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizePix.Width() - 1 ) << (INT32) ( aMtfSizePix.Height() - 1 )
+ << (INT32) 0 << (INT32) 0 << (INT32) ( aMtfSizeLog.Width() - 1 ) << (INT32) ( aMtfSizeLog.Height() - 1 )
+ << (UINT32) 0x464d4520 << (UINT32) 0x10000 << (UINT32) ( nEndPos - nHeaderPos )
+ << (UINT32) mnRecordCount << (UINT16) ( mnHandleCount + 1 ) << (UINT16) 0 << (UINT32) 0 << (UINT32) 0 << (UINT32) 0
+ << (INT32) aMtfSizePix.Width() << (INT32) aMtfSizePix.Height()
+ << (INT32) ( aMtfSizeLog.Width() / 100 ) << (INT32) ( aMtfSizeLog.Height() / 100 )
+ << (UINT32) 0 << (UINT32) 0 << (UINT32) 0
+ << (INT32) ( aMtfSizeLog.Width() * 10 ) << (INT32) ( aMtfSizeLog.Height() * 10 ); //use [MS-EMF 2.2.11] HeaderExtension2 Object
mpStm->Seek( nEndPos );
delete[] mpHandlesUsed;
@@ -523,35 +544,32 @@ void EMFWriter::ImplWriteRasterOp( RasterOp eRop )
void EMFWriter::ImplWriteExtent( long nExtent )
{
- const Size aSize( maVDev.LogicToPixel( Size( nExtent, nExtent ) ) );
- (*mpStm) << (INT32) aSize.Width();
+ nExtent = maVDev.LogicToLogic( Size( nExtent, 0 ), maVDev.GetMapMode(), maDestMapMode ).Width();
+ (*mpStm) << (INT32) nExtent;
}
// -----------------------------------------------------------------------------
void EMFWriter::ImplWritePoint( const Point& rPoint )
{
- const Point aPoint( maVDev.LogicToPixel( rPoint ) );
-
- (*mpStm) << (INT32) aPoint.X() << (INT32) aPoint.Y();
+ const Point aPoint( maVDev.LogicToLogic( rPoint, maVDev.GetMapMode(), maDestMapMode ));
+ (*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();
+ const Size aSize( maVDev.LogicToLogic( rSize, maVDev.GetMapMode(), maDestMapMode ));
+ (*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();
+ const Rectangle aRect( maVDev.LogicToLogic ( rRect, maVDev.GetMapMode(), maDestMapMode ));
+ (*mpStm) << aRect.Left() << aRect.Top() << aRect.Right() << aRect.Bottom();
}
// -----------------------------------------------------------------------------
@@ -650,12 +668,20 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed )
const Polygon& rPoly = rPolyPoly[ i ];
while ( n < rPoly.GetSize() )
{
- sal_uInt16 nBezPoints = 0;
- if ( n )
+ if( n == 0 )
{
- while ( ( ( nBezPoints + n + 2 ) < rPoly.GetSize() ) && ( rPoly.GetFlags( nBezPoints + n ) == POLY_CONTROL ) )
- nBezPoints += 3;
+ ImplBeginRecord( WIN_EMR_MOVETOEX );
+ ImplWritePoint( rPoly[ 0 ] );
+ ImplEndRecord();
+ n++;
+ continue;
}
+
+ sal_uInt16 nBezPoints = 0;
+
+ while ( ( ( nBezPoints + n + 2 ) < rPoly.GetSize() ) && ( rPoly.GetFlags( nBezPoints + n ) == POLY_CONTROL ) )
+ nBezPoints += 3;
+
if ( nBezPoints )
{
ImplBeginRecord( WIN_EMR_POLYBEZIERTO );
@@ -675,22 +701,26 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed )
sal_uInt16 nPoints = 1;
while( ( nPoints + n ) < rPoly.GetSize() && ( rPoly.GetFlags( nPoints + n ) != POLY_CONTROL ) )
nPoints++;
- ImplBeginRecord( WIN_EMR_MOVETOEX );
- ImplWritePoint( rPoly[ n ] );
- ImplEndRecord();
+
if ( nPoints > 1 )
{
ImplBeginRecord( WIN_EMR_POLYLINETO );
- Polygon aNewPoly( nPoints );
- aNewPoly[ 0 ] = rPoly[ n ];
- for ( o = 1; o < nPoints; o++ )
- aNewPoly[ o ] = rPoly[ n + o ];
+ Polygon aNewPoly( nPoints + 1 );
+ aNewPoly[ 0 ] = rPoly[ n - 1];
+ for ( o = 1; o <= nPoints; o++ )
+ aNewPoly[ o ] = rPoly[ n - 1 + o ];
ImplWriteRect( aNewPoly.GetBoundRect() );
- (*mpStm) << (sal_uInt32)( nPoints - 1 );
+ (*mpStm) << (sal_uInt32)( nPoints );
for( o = 1; o < aNewPoly.GetSize(); o++ )
ImplWritePoint( aNewPoly[ o ] );
ImplEndRecord();
}
+ else
+ {
+ ImplBeginRecord( WIN_EMR_LINETO );
+ ImplWritePoint( rPoly[ n ] );
+ ImplEndRecord();
+ }
n = n + nPoints;
}
if ( bClosed && ( n == rPoly.GetSize() ) )
@@ -703,6 +733,7 @@ void EMFWriter::ImplWritePath( const PolyPolygon& rPolyPoly, sal_Bool bClosed )
ImplBeginRecord( WIN_EMR_ENDPATH );
ImplEndRecord();
ImplBeginRecord( bClosed ? WIN_EMR_FILLPATH : WIN_EMR_STROKEPATH );
+ ImplWriteRect( rPolyPoly.GetBoundRect() );
ImplEndRecord();
}
diff --git a/svtools/source/filter.vcl/wmf/emfwr.hxx b/svtools/source/filter.vcl/wmf/emfwr.hxx
index 2d3c8801ba49..29715c59df0f 100644
--- a/svtools/source/filter.vcl/wmf/emfwr.hxx
+++ b/svtools/source/filter.vcl/wmf/emfwr.hxx
@@ -50,6 +50,7 @@ class EMFWriter
private:
VirtualDevice maVDev;
+ MapMode maDestMapMode;
FilterConfigItem* mpFilterConfigItem;
SvStream* mpStm;
BOOL* mpHandlesUsed;
diff --git a/svtools/source/filter.vcl/wmf/winmtf.cxx b/svtools/source/filter.vcl/wmf/winmtf.cxx
index 6f1caae18750..58dfdec45ee1 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.cxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.cxx
@@ -1522,9 +1522,9 @@ void WinMtfOutput::DrawText( Point& rPosition, String& rText, sal_Int32* pDXArry
aTmp.SetFillColor( maBkColor );
if( mnBkMode == TRANSPARENT )
- maFont.SetTransparent( sal_True );
+ aTmp.SetTransparent( sal_True );
else
- maFont.SetTransparent( sal_False );
+ aTmp.SetTransparent( sal_False );
if ( ( mnTextAlign & TA_BASELINE) == TA_BASELINE )
aTmp.SetAlign( ALIGN_BASELINE );
@@ -2195,3 +2195,8 @@ void WinMtfOutput::Pop()
}
}
+void WinMtfOutput::AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile )
+{
+ rGDIMetaFile.Play( *mpGDIMetaFile, 0xFFFFFFFF );
+}
+
diff --git a/svtools/source/filter.vcl/wmf/winmtf.hxx b/svtools/source/filter.vcl/wmf/winmtf.hxx
index ada590a19675..f3b2482f63bc 100644
--- a/svtools/source/filter.vcl/wmf/winmtf.hxx
+++ b/svtools/source/filter.vcl/wmf/winmtf.hxx
@@ -672,6 +672,7 @@ class WinMtfOutput
void MoveClipRegion( const Size& rSize );
void SetClipPath( const PolyPolygon& rPolyPoly, sal_Int32 nClippingMode, sal_Bool bIsMapped );
void UpdateClipRegion();
+ void AddFromGDIMetaFile( GDIMetaFile& rGDIMetaFile );
WinMtfOutput( GDIMetaFile& rGDIMetaFile );
virtual ~WinMtfOutput();
@@ -734,6 +735,18 @@ private:
UINT16 nUnitsPerInch;
sal_uInt32 nRecSize;
+ // embedded EMF data
+ SvMemoryStream* pEMFStream;
+
+ // total number of comment records containing EMF data
+ sal_uInt32 nEMFRecCount;
+
+ // number of EMF records read
+ sal_uInt32 nEMFRec;
+
+ // total size of embedded EMF data
+ sal_uInt32 nEMFSize;
+
sal_uInt32 nSkipActions;
sal_uInt32 nCurrentAction;
sal_uInt32 nUnicodeEscapeAction;
@@ -755,6 +768,8 @@ public:
WMFReader( SvStream& rStreamWMF, GDIMetaFile& rGDIMetaFile, FilterConfigItem* pConfigItem = NULL )
: WinMtf( new WinMtfOutput( rGDIMetaFile ), rStreamWMF, pConfigItem ) {};
+ ~WMFReader();
+
// Liesst aus dem Stream eine WMF-Datei und fuellt das GDIMetaFile
void ReadWMF();
};
diff --git a/svtools/source/filter.vcl/wmf/winwmf.cxx b/svtools/source/filter.vcl/wmf/winwmf.cxx
index 0930b0ece8a8..f9ae46e98e12 100644
--- a/svtools/source/filter.vcl/wmf/winwmf.cxx
+++ b/svtools/source/filter.vcl/wmf/winwmf.cxx
@@ -32,6 +32,7 @@
#include "precompiled_svtools.hxx"
#include "winmtf.hxx"
+#include <vcl/gdimtf.hxx>
#include <rtl/crc.h>
#include <rtl/tencinfo.h>
#include <osl/endian.h>
@@ -831,81 +832,136 @@ void WMFReader::ReadRecordParams( USHORT nFunc )
pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
break;
}
- if ( nRecSize >= 12 ) // minimal escape lenght
+ if ( nRecSize >= 4 ) // minimal escape lenght
{
- sal_uInt16 nMode, nLen, OO;
- sal_uInt32 Magic, nCheck,nEsc;
+ sal_uInt16 nMode, nLen;
*pWMF >> nMode
- >> nLen
- >> OO
- >> Magic
- >> nCheck
- >> nEsc;
- if ( ( nMode == W_MFCOMMENT ) && ( nLen >= 14 ) && ( OO == 0x4f4f ) && ( Magic == 0xa2c2a ) )
+ >> nLen;
+ if ( ( nMode == W_MFCOMMENT ) && ( nLen >= 4 ) )
{
- sal_uInt32 nEscLen = nLen - 14;
- if ( nEscLen <= ( nRecSize * 2 ) )
+ sal_uInt32 nNewMagic; // we have to read int32 for
+ *pWMF >> nNewMagic; // META_ESCAPE_ENHANCED_METAFILE CommentIdentifier
+
+ if( nNewMagic == 0x2c2a4f4f && nLen >= 14 )
{
+ sal_uInt16 nMagic2;
+ *pWMF >> nMagic2;
+ if( nMagic2 == 0x0a ) // 2nd half of magic
+ { // continue with private escape
+ sal_uInt32 nCheck, nEsc;
+ *pWMF >> nCheck
+ >> nEsc;
+
+ sal_uInt32 nEscLen = nLen - 14;
+ if ( nEscLen <= ( nRecSize * 2 ) )
+ {
#ifdef OSL_BIGENDIAN
- sal_uInt32 nTmp = SWAPLONG( nEsc );
- sal_uInt32 nCheckSum = rtl_crc32( 0, &nTmp, 4 );
+ sal_uInt32 nTmp = SWAPLONG( nEsc );
+ sal_uInt32 nCheckSum = rtl_crc32( 0, &nTmp, 4 );
#else
- sal_uInt32 nCheckSum = rtl_crc32( 0, &nEsc, 4 );
+ sal_uInt32 nCheckSum = rtl_crc32( 0, &nEsc, 4 );
#endif
- sal_Int8* pData = NULL;
+ sal_Int8* pData = NULL;
- if ( ( static_cast< sal_uInt64 >( nEscLen ) + pWMF->Tell() ) > nMetaRecEndPos )
- {
- pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
- break;
- }
- if ( nEscLen > 0 )
- {
- pData = new sal_Int8[ nEscLen ];
- pWMF->Read( pData, nEscLen );
- nCheckSum = rtl_crc32( nCheckSum, pData, nEscLen );
- }
- if ( nCheck == nCheckSum )
- {
- switch( nEsc )
- {
- case PRIVATE_ESCAPE_UNICODE :
- { // we will use text instead of polygons only if we have the correct font
- if ( aVDev.IsFontAvailable( pOut->GetFont().GetName() ) )
+ if ( ( static_cast< sal_uInt64 >( nEscLen ) + pWMF->Tell() ) > nMetaRecEndPos )
+ {
+ pWMF->SetError( SVSTREAM_FILEFORMAT_ERROR );
+ break;
+ }
+ if ( nEscLen > 0 )
+ {
+ pData = new sal_Int8[ nEscLen ];
+ pWMF->Read( pData, nEscLen );
+ nCheckSum = rtl_crc32( nCheckSum, pData, nEscLen );
+ }
+ if ( nCheck == nCheckSum )
+ {
+ switch( nEsc )
{
- Point aPt;
- String aString;
- sal_uInt32 i, nStringLen, nDXCount;
- sal_Int32* pDXAry = NULL;
- SvMemoryStream aMemoryStream( nEscLen );
- aMemoryStream.Write( pData, nEscLen );
- aMemoryStream.Seek( STREAM_SEEK_TO_BEGIN );
- aMemoryStream >> aPt.X()
- >> aPt.Y()
- >> nStringLen;
-
- if ( ( static_cast< sal_uInt64 >( nStringLen ) * sizeof( sal_Unicode ) ) < ( nEscLen - aMemoryStream.Tell() ) )
- {
- sal_Unicode* pBuf = aString.AllocBuffer( (xub_StrLen)nStringLen );
- for ( i = 0; i < nStringLen; i++ )
- aMemoryStream >> pBuf[ i ];
- aMemoryStream >> nDXCount;
- if ( ( static_cast< sal_uInt64 >( nDXCount ) * sizeof( sal_Int32 ) ) >= ( nEscLen - aMemoryStream.Tell() ) )
- nDXCount = 0;
- if ( nDXCount )
- pDXAry = new sal_Int32[ nDXCount ];
- for ( i = 0; i < nDXCount; i++ )
- aMemoryStream >> pDXAry[ i ];
- aMemoryStream >> nSkipActions;
- pOut->DrawText( aPt, aString, pDXAry );
- delete[] pDXAry;
+ case PRIVATE_ESCAPE_UNICODE :
+ { // we will use text instead of polygons only if we have the correct font
+ if ( aVDev.IsFontAvailable( pOut->GetFont().GetName() ) )
+ {
+ Point aPt;
+ String aString;
+ sal_uInt32 i, nStringLen, nDXCount;
+ sal_Int32* pDXAry = NULL;
+ SvMemoryStream aMemoryStream( nEscLen );
+ aMemoryStream.Write( pData, nEscLen );
+ aMemoryStream.Seek( STREAM_SEEK_TO_BEGIN );
+ aMemoryStream >> aPt.X()
+ >> aPt.Y()
+ >> nStringLen;
+
+ if ( ( static_cast< sal_uInt64 >( nStringLen ) * sizeof( sal_Unicode ) ) < ( nEscLen - aMemoryStream.Tell() ) )
+ {
+ sal_Unicode* pBuf = aString.AllocBuffer( (xub_StrLen)nStringLen );
+ for ( i = 0; i < nStringLen; i++ )
+ aMemoryStream >> pBuf[ i ];
+ aMemoryStream >> nDXCount;
+ if ( ( static_cast< sal_uInt64 >( nDXCount ) * sizeof( sal_Int32 ) ) >= ( nEscLen - aMemoryStream.Tell() ) )
+ nDXCount = 0;
+ if ( nDXCount )
+ pDXAry = new sal_Int32[ nDXCount ];
+ for ( i = 0; i < nDXCount; i++ )
+ aMemoryStream >> pDXAry[ i ];
+ aMemoryStream >> nSkipActions;
+ pOut->DrawText( aPt, aString, pDXAry );
+ delete[] pDXAry;
+ }
+ }
}
+ break;
}
}
- break;
+ delete[] pData;
+ }
+ }
+ }
+ else if ( (nNewMagic == static_cast< sal_uInt32 >(0x43464D57)) && (nLen >= 34) && ( (sal_Int32)(nLen + 10) <= (sal_Int32)(nRecSize * 2) ))
+ {
+ sal_uInt32 nComType, nVersion, nFlags, nComRecCount,
+ nCurRecSize, nRemainingSize, nEMFTotalSize;
+ sal_uInt16 nCheck;
+
+ *pWMF >> nComType >> nVersion >> nCheck >> nFlags
+ >> nComRecCount >> nCurRecSize
+ >> nRemainingSize >> nEMFTotalSize; // the nRemainingSize is not mentioned in MSDN documentation
+ // but it seems to be required to read in data produced by OLE
+
+ if( nComType == 0x01 && nVersion == 0x10000 && nComRecCount )
+ {
+ if( !nEMFRec )
+ { // first EMF comment
+ nEMFRecCount = nComRecCount;
+ nEMFSize = nEMFTotalSize;
+ pEMFStream = new SvMemoryStream( nEMFSize );
+ }
+ else if( ( nEMFRecCount != nComRecCount ) || ( nEMFSize != nEMFTotalSize ) ) // add additional checks here
+ {
+ // total records should be the same as in previous comments
+ nEMFRecCount = 0xFFFFFFFF;
+ delete pEMFStream;
+ pEMFStream = NULL;
+ }
+ nEMFRec++;
+
+ if( pEMFStream && nCurRecSize + 34 > nLen )
+ {
+ nEMFRecCount = 0xFFFFFFFF;
+ delete pEMFStream;
+ pEMFStream = NULL;
+ }
+
+ if( pEMFStream )
+ {
+ sal_Int8* pBuf = new sal_Int8[ nCurRecSize ];
+ sal_uInt32 nCount = pWMF->Read( pBuf, nCurRecSize );
+ if( nCount == nCurRecSize )
+ pEMFStream->Write( pBuf, nCount );
+ delete[] pBuf;
}
}
- delete[] pData;
}
}
}
@@ -1023,6 +1079,11 @@ void WMFReader::ReadWMF()
nCurrentAction = 0;
nUnicodeEscapeAction = 0;
+ pEMFStream = NULL;
+ nEMFRecCount = 0;
+ nEMFRec = 0;
+ nEMFSize = 0;
+
pOut->SetMapMode( MM_ANISOTROPIC );
pOut->SetWinOrg( Point() );
pOut->SetWinExt( Size( 1, 1 ) );
@@ -1070,6 +1131,33 @@ void WMFReader::ReadWMF()
ReadRecordParams( nFunction );
else
nSkipActions--;
+
+ if( pEMFStream && nEMFRecCount == nEMFRec )
+ {
+ GDIMetaFile aMeta;
+ pEMFStream->Seek( 0 );
+ EnhWMFReader* pEMFReader = new EnhWMFReader ( *pEMFStream, aMeta );
+ BOOL bRead = pEMFReader->ReadEnhWMF();
+ delete pEMFReader; // destroy first!!!
+
+ if( bRead )
+ {
+ pOut->AddFromGDIMetaFile( aMeta );
+ pOut->SetrclFrame( Rectangle(0, 0, aMeta.GetPrefSize().Width(), aMeta.GetPrefSize().Height() ));
+ // we have successfully read the embedded EMF data
+ // no need to process WMF data further
+ break;
+ }
+ else
+ {
+ // something went wrong
+ // continue with WMF, don't try this again
+ delete pEMFStream;
+ pEMFStream = NULL;
+ }
+
+ }
+
nPos += nRecSize * 2;
if ( nPos <= nEndPos )
pWMF->Seek( nPos );
@@ -1333,3 +1421,9 @@ sal_Bool WMFReader::GetPlaceableBound( Rectangle& rPlaceableBound, SvStream* pSt
return bRet;
}
+WMFReader::~WMFReader()
+{
+ if( pEMFStream )
+ delete pEMFStream;
+}
+
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.cxx b/svtools/source/filter.vcl/wmf/wmfwr.cxx
index 30d4ff06c0d2..c4f53046c29a 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.cxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.cxx
@@ -34,6 +34,7 @@
#include <vcl/salbtype.hxx>
#include "wmfwr.hxx"
#include <unotools/fontcvt.hxx>
+#include "emfwr.hxx"
#include <rtl/crc.h>
#include <rtl/tencinfo.h>
#include <tools/tenccvt.hxx>
@@ -1875,6 +1876,7 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
{
WMFWriterAttrStackMember * pAt;
+ bEmbedEMF = TRUE;
bStatus=TRUE;
pConvert = 0;
pVirDev = new VirtualDevice;
@@ -1938,6 +1940,8 @@ BOOL WMFWriter::WriteWMF( const GDIMetaFile& rMTF, SvStream& rTargetStream,
CountActionsAndBitmaps(rMTF);
WriteHeader(rMTF,bPlaceable);
+ if( bEmbedEMF )
+ WriteEmbeddedEMF( rMTF );
WMFRecord_SetWindowOrg(Point(0,0));
WMFRecord_SetWindowExt(rMTF.GetPrefSize());
WMFRecord_SetBkMode( TRUE );
@@ -2016,3 +2020,80 @@ USHORT WMFWriter::CalcSaveTargetMapMode(MapMode& rMapMode,
return nDivisor;
}
+
+// ------------------------------------------------------------------------
+
+void WMFWriter::WriteEmbeddedEMF( const GDIMetaFile& rMTF )
+{
+ EMFWriter aEMFWriter;
+ SvMemoryStream aStream;
+
+ if( aEMFWriter.WriteEMF( rMTF, aStream ) )
+ {
+ sal_Size nTotalSize = aStream.Tell();
+ if( nTotalSize > SAL_MAX_UINT32 )
+ return;
+ aStream.Seek( 0 );
+ sal_uInt32 nRemainingSize = static_cast< sal_uInt32 >( nTotalSize );
+ sal_uInt32 nRecCounts = ( (nTotalSize - 1) / 0x2000 ) + 1;
+ sal_uInt16 nCheckSum = 0, nWord;
+
+ sal_uInt32 nPos = 0;
+
+ while( nPos + 1 < nTotalSize )
+ {
+ aStream >> nWord;
+ nCheckSum ^= nWord;
+ nPos += 2;
+ }
+
+ nCheckSum = static_cast< sal_uInt16 >( nCheckSum * -1 );
+
+ aStream.Seek( 0 );
+ while( nRemainingSize > 0 )
+ {
+ sal_uInt32 nCurSize;
+ if( nRemainingSize > 0x2000 )
+ {
+ nCurSize = 0x2000;
+ nRemainingSize -= 0x2000;
+ }
+ else
+ {
+ nCurSize = nRemainingSize;
+ nRemainingSize = 0;
+ }
+ WriteEMFRecord( aStream,
+ nCurSize,
+ nRemainingSize,
+ nTotalSize,
+ nRecCounts,
+ nCheckSum );
+ nCheckSum = 0;
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
+void WMFWriter::WriteEMFRecord( SvMemoryStream& rStream, sal_uInt32 nCurSize, sal_uInt32 nRemainingSize,
+ sal_uInt32 nTotalSize, sal_uInt32 nRecCounts, sal_uInt16 nCheckSum )
+{
+ // according to http://msdn.microsoft.com/en-us/library/dd366152%28PROT.13%29.aspx
+ WriteRecordHeader( 0, W_META_ESCAPE );
+ *pWMF << (sal_uInt16)W_MFCOMMENT // same as META_ESCAPE_ENHANCED_METAFILE
+ << (sal_uInt16)( nCurSize + 34 ) // we will always have a 34 byte escape header:
+ << (sal_uInt32) 0x43464D57 // WMFC
+ << (sal_uInt32) 0x00000001 // Comment type
+ << (sal_uInt32) 0x00010000 // version
+ << nCheckSum // check sum
+ << (sal_uInt32) 0 // flags = 0
+ << nRecCounts // total number of records
+ << nCurSize // size of this record's data
+ << nRemainingSize // remaining size of data in following records, missing in MSDN documentation
+ << nTotalSize; // total size of EMF stream
+
+ pWMF->Write( static_cast< const sal_Char* >( rStream.GetData() ) + rStream.Tell(), nCurSize );
+ rStream.SeekRel( nCurSize );
+ UpdateRecordHeader();
+}
diff --git a/svtools/source/filter.vcl/wmf/wmfwr.hxx b/svtools/source/filter.vcl/wmf/wmfwr.hxx
index 03ca14e7633f..6b2ff0b04e0a 100644
--- a/svtools/source/filter.vcl/wmf/wmfwr.hxx
+++ b/svtools/source/filter.vcl/wmf/wmfwr.hxx
@@ -131,6 +131,8 @@ private:
ULONG nWrittenBitmaps; // Anzahl der bereits geschriebenen Bitmaps
ULONG nActBitmapPercent; // Wieviel Prozent die naechste Bitmap schon geschrieben ist.
+ BOOL bEmbedEMF; // optionally embedd EMF data into WMF
+
void MayCallback();
// Berechnet anhand der obigen 5 Parameter eine Prozentzahl
// und macht dann ggf. einen Callback. Setzt bStatus auf FALSE wenn User abbrechen
@@ -211,6 +213,13 @@ private:
void WriteHeader(const GDIMetaFile & rMTF, BOOL bPlaceable);
void UpdateHeader();
+ void WriteEmbeddedEMF( const GDIMetaFile& rMTF );
+ void WriteEMFRecord( SvMemoryStream& rStream, sal_uInt32 nCurSize,
+ sal_uInt32 nRemainingSize,
+ sal_uInt32 nTotalSize,
+ sal_uInt32 nRecCounts,
+ sal_uInt16 nCheckSum );
+
USHORT CalcSaveTargetMapMode(MapMode& rMapMode, const Size& rPrefSize);
public:
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 4084aa47bc80..3a31c1b812a6 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -321,16 +321,21 @@ BOOL SfxErrorHandler::GetClassString(ULONG lClassId, String &rStr) const
*/
{
-
- ResId aId(RID_ERRHDL, *pMgr);
- ErrorResource_Impl aEr(aId, (USHORT)lClassId);
- if(aEr)
+ BOOL bRet = FALSE;
+ com::sun::star::lang::Locale aLocale( Application::GetSettings().GetUILocale() );
+ ResMgr* pResMgr = ResMgr::CreateResMgr(CREATEVERSIONRESMGR_NAME(ofa), aLocale );
+ if( pResMgr )
{
- rStr=((ResString)aEr).GetString();
- return TRUE;
+ ResId aId(RID_ERRHDL, *pResMgr );
+ ErrorResource_Impl aEr(aId, (USHORT)lClassId);
+ if(aEr)
+ {
+ rStr=((ResString)aEr).GetString();
+ bRet = TRUE;
+ }
}
- else
- return FALSE;
+ delete pResMgr;
+ return bRet;
}
//-------------------------------------------------------------------------
@@ -379,10 +384,10 @@ BOOL SfxErrorHandler::GetErrorString(
BOOL bRet = FALSE;
rStr=String(SvtResId(RID_ERRHDL_CLASS));
- ResId *pResId = new ResId(nId, *pMgr);
+ ResId aResId(nId, *pMgr);
{
- ErrorResource_Impl aEr(*pResId, (USHORT)lErrId);
+ ErrorResource_Impl aEr(aResId, (USHORT)lErrId);
if(aEr)
{
ResString aErrorString(aEr);
@@ -408,7 +413,6 @@ BOOL SfxErrorHandler::GetErrorString(
rStr.SearchAndReplace(String::CreateFromAscii( "$(CLASS)" ),aErrStr);
}
- delete pResId;
return bRet;
}
diff --git a/svtools/source/misc/imap.cxx b/svtools/source/misc/imap.cxx
index df7760f7931b..b0aaee113c20 100644
--- a/svtools/source/misc/imap.cxx
+++ b/svtools/source/misc/imap.cxx
@@ -64,6 +64,12 @@ UINT16 IMapObject::nActualTextEncoding = (UINT16) RTL_TEXTENCODING_DONTKNOW;
#pragma optimize ( "", off )
#endif
+IMapObject::IMapObject()
+ : bActive( false )
+ , nReadVersion( 0 )
+{
+}
+
IMapObject::IMapObject( const String& rURL, const String& rAltText, const String& rDesc,
const String& rTarget, const String& rName, BOOL bURLActive )
: aURL( rURL )
@@ -72,6 +78,7 @@ IMapObject::IMapObject( const String& rURL, const String& rAltText, const String
, aTarget( rTarget )
, aName( rName )
, bActive( bURLActive )
+, nReadVersion( 0 )
{
}
diff --git a/svtools/source/uno/unoiface.cxx b/svtools/source/uno/unoiface.cxx
index a1ff1ad2ac3e..9c7c3eec33d1 100644
--- a/svtools/source/uno/unoiface.cxx
+++ b/svtools/source/uno/unoiface.cxx
@@ -549,86 +549,6 @@ void VCLXMultiLineEdit::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
}
// ----------------------------------------------------
-// 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 )
diff --git a/toolkit/inc/toolkit/awt/vclxprinter.hxx b/toolkit/inc/toolkit/awt/vclxprinter.hxx
index e94864b51280..4db43a3c5d77 100644
--- a/toolkit/inc/toolkit/awt/vclxprinter.hxx
+++ b/toolkit/inc/toolkit/awt/vclxprinter.hxx
@@ -43,9 +43,7 @@
#include <toolkit/helper/mutexandbroadcasthelper.hxx>
#include <cppuhelper/propshlp.hxx>
-class Printer;
-class String;
-
+#include "vcl/oldprintadaptor.hxx"
// Fuer den Drucker relevante Properties:
/*
@@ -65,20 +63,17 @@ class VCLXPrinterPropertySet : public ::com::sun::star::awt::XPrinterPropertySe
public MutexAndBroadcastHelper,
public ::cppu::OPropertySetHelper
{
-private:
- Printer* mpPrinter;
+protected:
+ boost::shared_ptr<Printer> mpPrinter;
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > mxPrnDevice;
sal_Int16 mnOrientation;
sal_Bool mbHorizontal;
-
-protected:
-
public:
VCLXPrinterPropertySet( const String& rPrinterName );
virtual ~VCLXPrinterPropertySet();
- Printer* GetPrinter() const { return mpPrinter; }
+ Printer* GetPrinter() const { return mpPrinter.get(); }
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > GetDevice();
// ::com::sun::star::uno::XInterface
@@ -120,6 +115,8 @@ class VCLXPrinter: public ::com::sun::star::awt::XPrinter,
public VCLXPrinterPropertySet,
public ::cppu::OWeakObject
{
+ boost::shared_ptr<vcl::OldStylePrintAdaptor> mpListener;
+ JobSetup maInitJobSetup;
public:
VCLXPrinter( const String& rPrinterName );
~VCLXPrinter();
diff --git a/toolkit/source/awt/vclxprinter.cxx b/toolkit/source/awt/vclxprinter.cxx
index 69d8dd827497..a8059463a297 100644
--- a/toolkit/source/awt/vclxprinter.cxx
+++ b/toolkit/source/awt/vclxprinter.cxx
@@ -102,10 +102,10 @@ IMPL_XTYPEPROVIDER_END
VCLXPrinterPropertySet::VCLXPrinterPropertySet( const String& rPrinterName )
: OPropertySetHelper( BrdcstHelper )
+ , mpPrinter( new Printer( rPrinterName ) )
{
osl::Guard< vos::IMutex > aSolarGuard( Application::GetSolarMutex() );
- mpPrinter = new Printer( rPrinterName );
mnOrientation = 0;
mbHorizontal = sal_False;
}
@@ -113,8 +113,7 @@ VCLXPrinterPropertySet::VCLXPrinterPropertySet( const String& rPrinterName )
VCLXPrinterPropertySet::~VCLXPrinterPropertySet()
{
osl::Guard< vos::IMutex > aSolarGuard( Application::GetSolarMutex() );
-
- delete mpPrinter;
+ mpPrinter.reset();
}
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXPrinterPropertySet::GetDevice()
@@ -326,13 +325,16 @@ IMPL_XTYPEPROVIDER_START( VCLXPrinter )
VCLXPrinterPropertySet::getTypes()
IMPL_XTYPEPROVIDER_END
-sal_Bool VCLXPrinter::start( const ::rtl::OUString& rJobName, sal_Int16 /*nCopies*/, sal_Bool /*bCollate*/ ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
+sal_Bool VCLXPrinter::start( const ::rtl::OUString& /*rJobName*/, sal_Int16 /*nCopies*/, sal_Bool /*bCollate*/ ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException)
{
::osl::Guard< ::osl::Mutex > aGuard( Mutex );
sal_Bool bDone = sal_True;
- if ( GetPrinter() )
- bDone = GetPrinter()->StartJob( rJobName );
+ if ( mpListener.get() )
+ {
+ maInitJobSetup = mpPrinter->GetJobSetup();
+ mpListener.reset( new vcl::OldStylePrintAdaptor( mpPrinter ) );
+ }
return bDone;
}
@@ -341,24 +343,28 @@ void VCLXPrinter::end( ) throw(::com::sun::star::awt::PrinterException, ::com::
{
::osl::Guard< ::osl::Mutex > aGuard( Mutex );
- if ( GetPrinter() )
- GetPrinter()->EndJob();
+ if ( mpListener.get() )
+ {
+ Printer::PrintJob( mpListener, maInitJobSetup );
+ mpListener.reset();
+ }
}
void VCLXPrinter::terminate( ) throw(::com::sun::star::uno::RuntimeException)
{
::osl::Guard< ::osl::Mutex > aGuard( Mutex );
- if ( GetPrinter() )
- GetPrinter()->AbortJob();
+ mpListener.reset();
}
::com::sun::star::uno::Reference< ::com::sun::star::awt::XDevice > VCLXPrinter::startPage( ) throw(::com::sun::star::awt::PrinterException, ::com::sun::star::uno::RuntimeException)
{
::osl::Guard< ::osl::Mutex > aGuard( Mutex );
- if ( GetPrinter() )
- GetPrinter()->StartPage();
+ if ( mpListener.get() )
+ {
+ mpListener->StartPage();
+ }
return GetDevice();
}
@@ -366,8 +372,10 @@ void VCLXPrinter::endPage( ) throw(::com::sun::star::awt::PrinterException, ::c
{
::osl::Guard< ::osl::Mutex > aGuard( Mutex );
- if ( GetPrinter() )
- GetPrinter()->EndPage();
+ if ( mpListener.get() )
+ {
+ mpListener->EndPage();
+ }
}
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index 7757d170256a..e41de1e8bd25 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -3390,6 +3390,7 @@ void VCLXEdit::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_PAINTTRANSPARENT,
BASEPROPERTY_AUTOHSCROLL,
BASEPROPERTY_AUTOVSCROLL,
+ BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
0);
@@ -4283,6 +4284,7 @@ void VCLXDateField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_ENFORCE_FORMAT,
BASEPROPERTY_TEXT,
BASEPROPERTY_HIDEINACTIVESELECTION,
+ BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR,
@@ -4624,6 +4626,7 @@ void VCLXTimeField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_ENFORCE_FORMAT,
BASEPROPERTY_TEXT,
BASEPROPERTY_HIDEINACTIVESELECTION,
+ BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR,
@@ -4927,6 +4930,7 @@ void VCLXNumericField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_VALUE_DOUBLE,
BASEPROPERTY_ENFORCE_FORMAT,
BASEPROPERTY_HIDEINACTIVESELECTION,
+ BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR,
@@ -5521,6 +5525,7 @@ void VCLXCurrencyField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_VALUE_DOUBLE,
BASEPROPERTY_ENFORCE_FORMAT,
BASEPROPERTY_HIDEINACTIVESELECTION,
+ BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR,
@@ -5868,6 +5873,7 @@ void VCLXPatternField::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
BASEPROPERTY_TABSTOP,
BASEPROPERTY_TEXT,
BASEPROPERTY_HIDEINACTIVESELECTION,
+ BASEPROPERTY_VERTICALALIGN,
BASEPROPERTY_WRITING_MODE,
BASEPROPERTY_CONTEXT_WRITING_MODE,
BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR,
diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx
index 6171067f1185..5ac7a0237479 100644
--- a/toolkit/source/controls/formattedcontrol.cxx
+++ b/toolkit/source/controls/formattedcontrol.cxx
@@ -160,6 +160,7 @@ namespace toolkit
ImplRegisterProperty( BASEPROPERTY_TEXTCOLOR );
ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
ImplRegisterProperty( BASEPROPERTY_ENFORCE_FORMAT );
+ ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
ImplRegisterProperty( BASEPROPERTY_MOUSE_WHEEL_BEHAVIOUR );
diff --git a/toolkit/source/controls/unocontrols.cxx b/toolkit/source/controls/unocontrols.cxx
index 3abacef7b67f..9e508c884f59 100644
--- a/toolkit/source/controls/unocontrols.cxx
+++ b/toolkit/source/controls/unocontrols.cxx
@@ -476,6 +476,7 @@ void UnoEditControl::getColumnsAndLines( sal_Int16& nCols, sal_Int16& nLines ) t
// ----------------------------------------------------
UnoControlFileControlModel::UnoControlFileControlModel()
{
+ ImplRegisterProperty( BASEPROPERTY_ALIGN );
ImplRegisterProperty( BASEPROPERTY_BACKGROUNDCOLOR );
ImplRegisterProperty( BASEPROPERTY_BORDER );
ImplRegisterProperty( BASEPROPERTY_BORDERCOLOR );
@@ -489,6 +490,7 @@ UnoControlFileControlModel::UnoControlFileControlModel()
ImplRegisterProperty( BASEPROPERTY_READONLY );
ImplRegisterProperty( BASEPROPERTY_TABSTOP );
ImplRegisterProperty( BASEPROPERTY_TEXT );
+ ImplRegisterProperty( BASEPROPERTY_VERTICALALIGN );
ImplRegisterProperty( BASEPROPERTY_WRITING_MODE );
ImplRegisterProperty( BASEPROPERTY_CONTEXT_WRITING_MODE );
ImplRegisterProperty( BASEPROPERTY_HIDEINACTIVESELECTION );
diff --git a/tools/inc/tools/multisel.hxx b/tools/inc/tools/multisel.hxx
index 46fd8947e21b..9de3cc172e70 100644
--- a/tools/inc/tools/multisel.hxx
+++ b/tools/inc/tools/multisel.hxx
@@ -35,6 +35,9 @@
#include <tools/list.hxx>
#include <tools/string.hxx>
+#include <vector>
+#include <set>
+
//------------------------------------------------------------------
#ifdef _SV_MULTISEL_CXX
@@ -112,4 +115,105 @@ public:
const Range& GetRange( ULONG nRange ) const { return *(const Range*)aSels.GetObject(nRange); }
};
+class TOOLS_DLLPUBLIC StringRangeEnumerator
+{
+ struct Range
+ {
+ sal_Int32 nFirst;
+ sal_Int32 nLast;
+
+ Range() : nFirst( -1 ), nLast( -1 ) {}
+ Range( sal_Int32 i_nFirst, sal_Int32 i_nLast ) : nFirst( i_nFirst ), nLast( i_nLast ) {}
+ };
+ std::vector< StringRangeEnumerator::Range > maSequence;
+ sal_Int32 mnCount;
+ sal_Int32 mnMin;
+ sal_Int32 mnMax;
+ sal_Int32 mnOffset;
+
+ bool insertRange( sal_Int32 nFirst, sal_Int32 nLast, bool bSequence, bool bMayAdjust );
+ bool checkValue( sal_Int32, const std::set< sal_Int32 >* i_pPossibleValues = NULL ) const;
+public:
+ class TOOLS_DLLPUBLIC Iterator
+ {
+ const StringRangeEnumerator* pEnumerator;
+ const std::set< sal_Int32 >* pPossibleValues;
+ sal_Int32 nRangeIndex;
+ sal_Int32 nCurrent;
+
+ friend class StringRangeEnumerator;
+ Iterator( const StringRangeEnumerator* i_pEnum,
+ const std::set< sal_Int32 >* i_pPossibleValues,
+ sal_Int32 i_nRange,
+ sal_Int32 i_nCurrent )
+ : pEnumerator( i_pEnum ), pPossibleValues( i_pPossibleValues )
+ , nRangeIndex( i_nRange ), nCurrent( i_nCurrent ) {}
+ public:
+ Iterator() : pEnumerator( NULL ), pPossibleValues( NULL ), nRangeIndex( -1 ), nCurrent( -1 ) {}
+ Iterator& operator++();
+ sal_Int32 operator*() const;
+ bool operator==(const Iterator&) const;
+ bool operator!=(const Iterator& i_rComp) const
+ { return ! (*this == i_rComp); }
+ };
+
+ friend class StringRangeEnumerator::Iterator;
+
+ StringRangeEnumerator() : mnCount( 0 ), mnMin( -1 ), mnMax( -1 ), mnOffset( -1 ) {}
+ StringRangeEnumerator( const rtl::OUString& i_rInput,
+ sal_Int32 i_nMinNumber = -1,
+ sal_Int32 i_nMaxNumber = -1,
+ sal_Int32 i_nLogicalOffset = -1
+ );
+
+ size_t size() const { return size_t(mnCount); }
+ Iterator begin( const std::set< sal_Int32 >* i_pPossibleValues = NULL ) const;
+ Iterator end( const std::set< sal_Int32 >* i_pPossibleValues = NULL ) const;
+
+ sal_Int32 getMin() const { return mnMin; }
+ void setMin( sal_Int32 i_nMinValue ) { mnMin = i_nMinValue; }
+ sal_Int32 getMax() const { return mnMax; }
+ void setMax( sal_Int32 i_nMaxValue ) { mnMax = i_nMaxValue; }
+ sal_Int32 getLogicalOffset() const { return mnOffset; }
+ void setLogicalOffset( sal_Int32 i_nOffset ) { mnOffset = i_nOffset; }
+
+ bool setRange( const rtl::OUString& i_rNewRange, bool i_bStrict = false );
+ bool hasValue( sal_Int32 nValue, const std::set< sal_Int32 >* i_pPossibleValues = NULL ) const;
+
+
+ /**
+ i_rPageRange: the string to be changed into a sequence of numbers
+ valid format example "5-3,9,9,7-8" ; instead of ',' ';' or ' ' are allowed as well
+ o_rPageVector: the output sequence of numbers
+ i_nLogicalOffset: an offset to be applied to each number in the string before inserting it in the resulting sequence
+ example: a user enters page numbers from 1 to n (since that is logical)
+ of course usable page numbers in code would start from 0 and end at n-1
+ so the logical offset would be -1
+ i_nMinNumber: the minimum allowed number, a negative number means no minimum check
+ i_nMaxNumber: the maximum allowed number, a negative number means no maximum check
+
+ @returns: true if the input string was valid, o_rPageVector will contain the resulting sequence
+ false if the input string was invalid, o_rPageVector will be unchanged
+
+ behavior:
+ - only non-negative sequence numbers are allowed
+ - only non-negative values in the input string are allowed
+ - the string "-3" will be either
+ * an error if no minimum is given
+ * or result in the sequence i_nMinNumber to 3
+ - the string "3-" will be either
+ * an error if no maximum is given
+ * or result in the seqeuence 3 to i_nMaxNumber
+ - an empty string as input is valid and will result in the range [min,max] if given
+ or an empty vector, if not
+ */
+ static bool getRangesFromString( const rtl::OUString& i_rPageRange,
+ std::vector< sal_Int32 >& o_rPageVector,
+ sal_Int32 i_nMinNumber = -1,
+ sal_Int32 i_nMaxNumber = -1,
+ sal_Int32 i_nLogicalOffset = -1,
+ std::set< sal_Int32 >* i_pPossibleValues = NULL
+ );
+};
+
#endif // _SV_MULTISEL_HXX
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index bacaac89fe44..23496322fa4c 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -776,6 +776,9 @@ class TOOLS_DLLPUBLIC SvMemoryStream : public SvStream
SvMemoryStream (const SvMemoryStream&);
SvMemoryStream & operator= (const SvMemoryStream&);
+ friend class SvCacheStream;
+ sal_Size GetSize() const { return nSize; }
+
protected:
sal_Size nSize;
sal_Size nResize;
@@ -817,7 +820,7 @@ public:
virtual void ResetError();
- sal_Size GetSize() const { return nSize; }
+ sal_Size GetEndOfData() const { return nEndOfData; }
const void* GetData() { Flush(); return pBuf; }
operator const void*() { Flush(); return pBuf; }
virtual sal_uInt16 IsA() const;
diff --git a/tools/inc/tools/wintypes.hxx b/tools/inc/tools/wintypes.hxx
index a9c23de87ddd..e3d0b55ffdca 100644
--- a/tools/inc/tools/wintypes.hxx
+++ b/tools/inc/tools/wintypes.hxx
@@ -333,5 +333,11 @@ typedef USHORT StandardButtonType;
#define BUTTON_LESS ((StandardButtonType)10)
#define BUTTON_COUNT 11
+// --------------------------------------------
+// - prominent place for ListBox window types -
+// --------------------------------------------
+
+enum ProminentEntry { PROMINENT_TOP, PROMINENT_MIDDLE };
+
#endif // _TOOLS_WINTYPES_HXX
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index f7ffed5e4dd1..e0f711bd2883 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -1022,16 +1022,14 @@ bool INetURLObject::setAbsURIRef(rtl::OUString const & rTheAbsURIRef,
if (pEnd - pPos >= 2 && pPos[0] == '/' && pPos[1] == '/')
{
sal_Unicode const * p1 = pPos + 2;
- if (
- p1 == pEnd || *p1 == nFragmentDelimiter || *p1 == '/' ||
- (
- (
- scanDomain(p1, pEnd) > 0 ||
- scanIPv6reference(p1, pEnd)
- ) &&
- (p1 == pEnd || *p1 == nFragmentDelimiter || *p1 == '/')
- )
- )
+ while (p1 != pEnd && *p1 != '/' &&
+ *p1 != nFragmentDelimiter)
+ {
+ ++p1;
+ }
+ if (parseHostOrNetBiosName(
+ pPos + 2, p1, bOctets, ENCODE_ALL,
+ RTL_TEXTENCODING_DONTKNOW, true, NULL))
{
aSynAbsURIRef.
appendAscii(RTL_CONSTASCII_STRINGPARAM("//"));
diff --git a/tools/source/memtools/makefile.mk b/tools/source/memtools/makefile.mk
index 037dadbf4a46..51d831ec0fed 100644
--- a/tools/source/memtools/makefile.mk
+++ b/tools/source/memtools/makefile.mk
@@ -47,6 +47,8 @@ SLOFILES= $(SLO)$/contnr.obj \
$(SLO)$/mempool.obj \
$(SLO)$/multisel.obj
+EXCEPTIONSFILES= $(SLO)$/multisel.obj $(OBJ)$/multisel.obj
+
OBJFILES= $(OBJ)$/contnr.obj \
$(OBJ)$/table.obj \
$(OBJ)$/unqidx.obj \
diff --git a/tools/source/memtools/multisel.cxx b/tools/source/memtools/multisel.cxx
index 6b32badc283e..5fe920b6998a 100644
--- a/tools/source/memtools/multisel.cxx
+++ b/tools/source/memtools/multisel.cxx
@@ -41,12 +41,16 @@
#include <tools/debug.hxx>
#include <tools/multisel.hxx>
+#include "rtl/ustrbuf.hxx"
+
#ifdef MI_DEBUG
#define DBG(x) x
#else
#define DBG(x)
#endif
+using namespace rtl;
+
//==================================================================
#ifdef MI_DEBUG
@@ -865,3 +869,297 @@ void MultiSelection::SetTotalRange( const Range& rTotRange )
bCurValid = FALSE;
nCurIndex = 0;
}
+
+// -----------------------------------------------------------------------
+//
+// StringRangeEnumerator
+//
+// -----------------------------------------------------------------------
+StringRangeEnumerator::StringRangeEnumerator( const rtl::OUString& i_rInput,
+ sal_Int32 i_nMinNumber,
+ sal_Int32 i_nMaxNumber,
+ sal_Int32 i_nLogicalOffset
+ )
+ : mnCount( 0 )
+ , mnMin( i_nMinNumber )
+ , mnMax( i_nMaxNumber )
+ , mnOffset( i_nLogicalOffset )
+{
+ setRange( i_rInput );
+}
+
+bool StringRangeEnumerator::checkValue( sal_Int32 i_nValue, const std::set< sal_Int32 >* i_pPossibleValues ) const
+{
+ if( mnMin >= 0 && i_nValue < mnMin )
+ return false;
+ if( mnMax >= 0 && i_nValue > mnMax )
+ return false;
+ if( i_nValue < 0 )
+ return false;
+ if( i_pPossibleValues && i_pPossibleValues->find( i_nValue ) == i_pPossibleValues->end() )
+ return false;
+ return true;
+}
+
+bool StringRangeEnumerator::insertRange( sal_Int32 i_nFirst, sal_Int32 i_nLast, bool bSequence, bool bMayAdjust )
+{
+ bool bSuccess = true;
+ if( bSequence )
+ {
+ if( i_nFirst == -1 )
+ i_nFirst = mnMin;
+ if( i_nLast == -1 )
+ i_nLast = mnMax;
+ if( bMayAdjust )
+ {
+ if( i_nFirst < mnMin )
+ i_nFirst = mnMin;
+ if( i_nFirst > mnMax )
+ i_nFirst = mnMax;
+ if( i_nLast < mnMin )
+ i_nLast = mnMin;
+ if( i_nLast > mnMax )
+ i_nLast = mnMax;
+ }
+ if( checkValue( i_nFirst ) && checkValue( i_nLast ) )
+ {
+ maSequence.push_back( Range( i_nFirst, i_nLast ) );
+ sal_Int32 nNumber = i_nLast - i_nFirst;
+ nNumber = nNumber < 0 ? -nNumber : nNumber;
+ mnCount += nNumber + 1;
+ }
+ else
+ bSuccess = false;
+ }
+ else
+ {
+ if( i_nFirst >= 0 )
+ {
+ if( checkValue( i_nFirst ) )
+ {
+ maSequence.push_back( Range( i_nFirst, i_nFirst ) );
+ mnCount++;
+ }
+ else
+ bSuccess = false;
+ }
+ if( i_nLast >= 0 )
+ {
+ if( checkValue( i_nLast ) )
+ {
+ maSequence.push_back( Range( i_nLast, i_nLast ) );
+ mnCount++;
+ }
+ else
+ bSuccess = false;
+ }
+ }
+
+ return bSuccess;
+}
+
+bool StringRangeEnumerator::setRange( const rtl::OUString& i_rNewRange, bool i_bStrict )
+{
+ mnCount = 0;
+ maSequence.clear();
+
+ // we love special cases
+ if( i_rNewRange.getLength() == 0 )
+ {
+ if( mnMin >= 0 && mnMax >= 0 )
+ {
+ insertRange( mnMin, mnMax, mnMin != mnMax, ! i_bStrict );
+ }
+ return true;
+ }
+
+ const sal_Unicode* pInput = i_rNewRange.getStr();
+ rtl::OUStringBuffer aNumberBuf( 16 );
+ sal_Int32 nLastNumber = -1, nNumber = -1;
+ bool bSequence = false;
+ bool bSuccess = true;
+ while( *pInput )
+ {
+ while( *pInput >= sal_Unicode('0') && *pInput <= sal_Unicode('9') )
+ aNumberBuf.append( *pInput++ );
+ if( aNumberBuf.getLength() )
+ {
+ if( nNumber != -1 )
+ {
+ if( bSequence )
+ {
+ if( ! insertRange( nLastNumber, nNumber, true, ! i_bStrict ) && i_bStrict )
+ {
+ bSuccess = false;
+ break;
+ }
+ nLastNumber = -1;
+ }
+ else
+ {
+ if( ! insertRange( nNumber, nNumber, false, ! i_bStrict ) && i_bStrict )
+ {
+ bSuccess = false;
+ break;
+ }
+ }
+ }
+ nNumber = aNumberBuf.makeStringAndClear().toInt32();
+ nNumber += mnOffset;
+ }
+ bool bInsertRange = false;
+ if( *pInput == sal_Unicode('-') )
+ {
+ nLastNumber = nNumber;
+ nNumber = -1;
+ bSequence = true;
+ }
+ else if( *pInput == ' ' )
+ {
+ }
+ else if( *pInput == sal_Unicode(',') || *pInput == sal_Unicode(';') )
+ bInsertRange = true;
+ else if( *pInput )
+ {
+
+ bSuccess = false;
+ break; // parse error
+ }
+
+ if( bInsertRange )
+ {
+ if( ! insertRange( nLastNumber, nNumber, bSequence, ! i_bStrict ) && i_bStrict )
+ {
+ bSuccess = false;
+ break;
+ }
+ nNumber = nLastNumber = -1;
+ bSequence = false;
+ }
+ if( *pInput )
+ pInput++;
+ }
+ // insert last entries
+ insertRange( nLastNumber, nNumber, bSequence, ! i_bStrict );
+
+ return bSuccess;
+}
+
+bool StringRangeEnumerator::hasValue( sal_Int32 i_nValue, const std::set< sal_Int32 >* i_pPossibleValues ) const
+{
+ if( i_pPossibleValues && i_pPossibleValues->find( i_nValue ) == i_pPossibleValues->end() )
+ return false;
+ size_t n = maSequence.size();
+ for( size_t i= 0; i < n; ++i )
+ {
+ const StringRangeEnumerator::Range rRange( maSequence[i] );
+ if( rRange.nFirst < rRange.nLast )
+ {
+ if( i_nValue >= rRange.nFirst && i_nValue <= rRange.nLast )
+ return true;
+ }
+ else
+ {
+ if( i_nValue >= rRange.nLast && i_nValue <= rRange.nFirst )
+ return true;
+ }
+ }
+ return false;
+}
+
+StringRangeEnumerator::Iterator& StringRangeEnumerator::Iterator::operator++()
+{
+ if( nRangeIndex >= 0 && nCurrent >= 0 && pEnumerator )
+ {
+ const StringRangeEnumerator::Range& rRange( pEnumerator->maSequence[nRangeIndex] );
+ bool bRangeChange = false;
+ if( rRange.nLast < rRange.nFirst )
+ {
+ // backward range
+ if( nCurrent > rRange.nLast )
+ nCurrent--;
+ else
+ bRangeChange = true;
+ }
+ else
+ {
+ // forward range
+ if( nCurrent < rRange.nLast )
+ nCurrent++;
+ else
+ bRangeChange = true;
+ }
+ if( bRangeChange )
+ {
+ nRangeIndex++;
+ if( size_t(nRangeIndex) == pEnumerator->maSequence.size() )
+ {
+ // reached the end
+ nRangeIndex = nCurrent = -1;
+ }
+ else
+ nCurrent = pEnumerator->maSequence[nRangeIndex].nFirst;
+ }
+ if( nRangeIndex != -1 && nCurrent != -1 )
+ {
+ if( ! pEnumerator->checkValue( nCurrent, pPossibleValues ) )
+ return ++(*this);
+ }
+ }
+ return *this;
+}
+
+sal_Int32 StringRangeEnumerator::Iterator::operator*() const
+{
+ return nCurrent;
+}
+
+bool StringRangeEnumerator::Iterator::operator==( const Iterator& i_rCompare ) const
+{
+ return i_rCompare.pEnumerator == pEnumerator && i_rCompare.nRangeIndex == nRangeIndex && i_rCompare.nCurrent == nCurrent;
+}
+
+StringRangeEnumerator::Iterator StringRangeEnumerator::begin( const std::set< sal_Int32 >* i_pPossibleValues ) const
+{
+ StringRangeEnumerator::Iterator it( this,
+ i_pPossibleValues,
+ maSequence.empty() ? -1 : 0,
+ maSequence.empty() ? -1 : maSequence[0].nFirst );
+ if( ! checkValue(*it, i_pPossibleValues ) )
+ ++it;
+ return it;
+}
+
+StringRangeEnumerator::Iterator StringRangeEnumerator::end( const std::set< sal_Int32 >* i_pPossibleValues ) const
+{
+ return StringRangeEnumerator::Iterator( this, i_pPossibleValues, -1, -1 );
+}
+
+bool StringRangeEnumerator::getRangesFromString( const OUString& i_rPageRange,
+ std::vector< sal_Int32 >& o_rPageVector,
+ sal_Int32 i_nMinNumber,
+ sal_Int32 i_nMaxNumber,
+ sal_Int32 i_nLogicalOffset,
+ std::set< sal_Int32 >* i_pPossibleValues
+ )
+{
+ StringRangeEnumerator aEnum;
+ aEnum.setMin( i_nMinNumber );
+ aEnum.setMax( i_nMaxNumber );
+ aEnum.setLogicalOffset( i_nLogicalOffset );
+
+ bool bRes = aEnum.setRange( i_rPageRange );
+ if( bRes )
+ {
+ o_rPageVector.clear();
+ o_rPageVector.reserve( aEnum.size() );
+ for( StringRangeEnumerator::Iterator it = aEnum.begin( i_pPossibleValues );
+ it != aEnum.end( i_pPossibleValues ); ++it )
+ {
+ o_rPageVector.push_back( *it );
+ }
+ }
+
+ return bRes;
+}
+
diff --git a/tools/workben/urltest.cxx b/tools/workben/urltest.cxx
index a232f8ebdd93..0e9d22081cb4 100644
--- a/tools/workben/urltest.cxx
+++ b/tools/workben/urltest.cxx
@@ -1629,6 +1629,20 @@ main()
rtl::OUString(urlobj.GetMainURL(INetURLObject::NO_DECODE)));
}
+ if (true) { // #i53184#
+ rtl::OUString url(RTL_CONSTASCII_USTRINGPARAM("file://comp_name/path"));
+ bSuccess &= assertEqual(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("#i53184# smart INET_PROT_FILE")),
+ INetURLObject(url, INET_PROT_FILE).GetMainURL(
+ INetURLObject::NO_DECODE),
+ url);
+ bSuccess &= assertEqual(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM("#i53184# strict")),
+ INetURLObject(url).GetMainURL(INetURLObject::NO_DECODE), url);
+ }
+
if (true) {
rtl::OUString path;
path = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("/a/b/c"));
diff --git a/transex3/prj/build.lst b/transex3/prj/build.lst
deleted file mode 100644
index 0017471af134..000000000000
--- a/transex3/prj/build.lst
+++ /dev/null
@@ -1,10 +0,0 @@
-tr transex3 : tools libxslt berkeleydb LUCENE:lucene NULL
-tr transex3 usr1 - all tr_mkout NULL
-tr transex3\inc nmake - all tr_inc NULL
-tr transex3\source nmake - all tr_src tr_inc NULL
-tr transex3\layout nmake - all rt_layout tr_src tr_inc NULL
-tr transex3\java\l10nconv nmake - all tr_conv NULL
-tr transex3\java\receditor nmake - all tr_rece NULL
-tr transex3\source\help nmake - all tr_bla_help NULL
-tr transex3\source\filter\utils nmake - all tr_bla_utils NULL
-tr transex3\source\filter\merge nmake - all tr_bla_merge tr_bla_utils NULL
diff --git a/ucbhelper/inc/ucbhelper/content.hxx b/ucbhelper/inc/ucbhelper/content.hxx
index 03cfa0bc8290..fde86609e850 100644
--- a/ucbhelper/inc/ucbhelper/content.hxx
+++ b/ucbhelper/inc/ucbhelper/content.hxx
@@ -60,6 +60,7 @@ namespace com { namespace sun { namespace star { namespace ucb {
class XContentIdentifier;
class XDynamicResultSet;
class XAnyCompareFactory;
+ struct ContentInfo;
struct NumberedSortingInfo;
} } } }
@@ -70,7 +71,7 @@ namespace ucbhelper
/**
* These are the possible values for the parameter eMode of method
- * ucb::Content::createCursor.
+ * ucbhelper::Content::createCursor.
*/
enum ResultSetInclude
{
@@ -81,7 +82,7 @@ enum ResultSetInclude
/**
* These are the possible values for the parameter eOperation of method
- * ucb::Content::insertNewContent.
+ * ucbhelper::Content::insertNewContent.
*/
enum InsertOperation
{
@@ -106,14 +107,14 @@ class UCBHELPER_DLLPUBLIC Content
protected:
::com::sun::star::uno::Any createCursorAny( const ::com::sun::star::uno::Sequence<
rtl::OUString >& rPropertyNames,
- ResultSetInclude eMode )
+ ResultSetInclude eMode )
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception );
::com::sun::star::uno::Any createCursorAny( const ::com::sun::star::uno::Sequence<
sal_Int32 >& rPropertyHandles,
- ResultSetInclude eMode )
+ ResultSetInclude eMode )
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception );
@@ -148,7 +149,7 @@ public:
* errors.
*/
Content( const ::com::sun::star::uno::Reference<
- ::com::sun::star::ucb::XContentIdentifier >& rId,
+ ::com::sun::star::ucb::XContentIdentifier >& rId,
const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XCommandEnvironment >& rEnv )
throw ( ::com::sun::star::ucb::ContentCreationException,
@@ -163,7 +164,7 @@ public:
* errors.
*/
Content( const ::com::sun::star::uno::Reference<
- ::com::sun::star::ucb::XContent >& rContent,
+ ::com::sun::star::ucb::XContent >& rContent,
const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XCommandEnvironment >& rEnv )
throw ( ::com::sun::star::ucb::ContentCreationException,
@@ -221,7 +222,7 @@ public:
*/
static sal_Bool
create( const ::com::sun::star::uno::Reference<
- ::com::sun::star::ucb::XContentIdentifier >& rId,
+ ::com::sun::star::ucb::XContentIdentifier >& rId,
const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XCommandEnvironment >& rEnv,
Content& rContent );
@@ -241,7 +242,7 @@ public:
*/
static sal_Bool
create( const ::com::sun::star::uno::Reference<
- ::com::sun::star::ucb::XContent >& xContent,
+ ::com::sun::star::ucb::XContent >& xContent,
const ::com::sun::star::uno::Reference<
::com::sun::star::ucb::XCommandEnvironment >& rEnv,
Content& rContent );
@@ -501,7 +502,7 @@ public:
setPropertyValues( const ::com::sun::star::uno::Sequence<
rtl::OUString >& rPropertyNames,
const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Any >& rValues )
+ ::com::sun::star::uno::Any >& rValues )
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception );
@@ -539,7 +540,7 @@ public:
setPropertyValues( const ::com::sun::star::uno::Sequence<
sal_Int32 >& nPropertyHandles,
const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Any >& rValues )
+ ::com::sun::star::uno::Any >& rValues )
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception );
@@ -655,8 +656,8 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet >
createDynamicCursor( const ::com::sun::star::uno::Sequence<
rtl::OUString >& rPropertyNames,
- ResultSetInclude eMode
- = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ ResultSetInclude eMode
+ = INCLUDE_FOLDERS_AND_DOCUMENTS )
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception );
@@ -678,8 +679,8 @@ public:
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XDynamicResultSet >
createDynamicCursor( const ::com::sun::star::uno::Sequence<
sal_Int32 >& rPropertyHandles,
- ResultSetInclude eMode
- = INCLUDE_FOLDERS_AND_DOCUMENTS )
+ ResultSetInclude eMode
+ = INCLUDE_FOLDERS_AND_DOCUMENTS )
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception );
@@ -821,16 +822,31 @@ public:
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
::com::sun::star::uno::Exception );
+
+ /**
+ * This method returns the different types of contents this content
+ * can create.
+ *
+ * @return the content types or an empty sequence if no contents can be
+ * created by this content.
+ */
+ ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::ContentInfo >
+ queryCreatableContentsInfo()
+ throw( ::com::sun::star::ucb::CommandAbortedException,
+ ::com::sun::star::uno::RuntimeException,
+ ::com::sun::star::uno::Exception );
+
/**
* This method creates, initializes and inserts ( commits ) a new content
* (i.e. it could be used to create a new file system folder).
- * Internally this method does a XContentCreator::createNewContent(...)-
- * XCommandProcessor::execute( "setPropertyValues", ... )-
- * XCommandProcessor::execute( "insert", ... ) calling sequence.
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
*
* @param rContentType is the type for the new UCB content. Each content
- * provider implementation may introduce own types for its contnt
- * objects.
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
* @param rPropertyNames is a sequence of names of properties for that
* values are to set at the new content before it will be inserted
* ( commited ).
@@ -846,9 +862,9 @@ public:
sal_Bool
insertNewContent( const ::rtl::OUString& rContentType,
const ::com::sun::star::uno::Sequence<
- rtl::OUString >& rPropertyNames,
+ rtl::OUString >& rPropertyNames,
const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Any >& rPropertyValues,
+ ::com::sun::star::uno::Any >& rPropertyValues,
Content& rNewContent )
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
@@ -856,13 +872,14 @@ public:
/**
* This method creates, initializes and inserts ( commits ) a new content
* (i.e. it could be used to create a new file system folder).
- * Internally this method does a XContentCreator::createNewContent(...)-
- * XCommandProcessor::execute( "setPropertyValues", ... )-
- * XCommandProcessor::execute( "insert", ... ) calling sequence.
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
*
* @param rContentType is the type for the new UCB content. Each content
- * provider implementation may introduce own types for its contnt
- * objects.
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
* @param nPropertyHandes is a sequence of handles of properties for that
* values are to set at the new content before it will be inserted
* ( commited ).
@@ -880,7 +897,7 @@ public:
const ::com::sun::star::uno::Sequence<
sal_Int32 >& nPropertyHandles,
const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Any >& rPropertyValues,
+ ::com::sun::star::uno::Any >& rPropertyValues,
Content& rNewContent )
throw( ::com::sun::star::ucb::CommandAbortedException,
::com::sun::star::uno::RuntimeException,
@@ -888,14 +905,15 @@ public:
/**
* This method creates, initializes and inserts (commits) a new content
* inside this (the target folder) content. For example, it can be used to
- * create a new file system folder.
- * Internally this method does a XContentCreator::createNewContent(...)-
- * XCommandProcessor::execute( "setPropertyValues", ... )-
- * XCommandProcessor::execute( "insert", ... ) calling sequence.
+ * create a new file system file.
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
*
* @param rContentType is the type for the new UCB content. Each content
- * provider implementation may introduce own types for its contnt
- * objects.
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
* @param rPropertyNames is a sequence of names of properties for that
* values are to set at the new content before it will be inserted
* ( commited ).
@@ -913,9 +931,9 @@ public:
sal_Bool
insertNewContent( const ::rtl::OUString& rContentType,
const ::com::sun::star::uno::Sequence<
- rtl::OUString >& rPropertyNames,
+ rtl::OUString >& rPropertyNames,
const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Any >& rPropertyValues,
+ ::com::sun::star::uno::Any >& rPropertyValues,
const ::com::sun::star::uno::Reference<
::com::sun::star::io::XInputStream >& rStream,
Content& rNewContent )
@@ -925,14 +943,15 @@ public:
/**
* This method creates, initializes and inserts (commits) a new content
* inside this (the target folder) content. For example, it can be used to
- * create a new file system folder.
- * Internally this method does a XContentCreator::createNewContent(...)-
- * XCommandProcessor::execute( "setPropertyValues", ... )-
- * XCommandProcessor::execute( "insert", ... ) calling sequence.
+ * create a new file system file.
+ * Internally this method does a
+ * XCommandProcessor::execute( "createNewContent", ... );
+ * XCommandProcessor::execute( "setPropertyValues", ... );
+ * XCommandProcessor::execute( "insert", ... ); calling sequence.
*
* @param rContentType is the type for the new UCB content. Each content
- * provider implementation may introduce own types for its contnt
- * objects.
+ * provider implementation may introduce own types for its content
+ * objects (See queryCreatableContentsInfo()).
* @param nPropertyHandes is a sequence of handles of properties for that
* values are to set at the new content before it will be inserted
* ( commited ).
@@ -952,7 +971,7 @@ public:
const ::com::sun::star::uno::Sequence<
sal_Int32 >& nPropertyHandles,
const ::com::sun::star::uno::Sequence<
- ::com::sun::star::uno::Any >& rPropertyValues,
+ ::com::sun::star::uno::Any >& rPropertyValues,
const ::com::sun::star::uno::Reference<
::com::sun::star::io::XInputStream >& rStream,
Content& rNewContent )
diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx
index c82a0bc19b77..28eef297e85f 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -73,9 +73,7 @@
#include <ucbhelper/contentbroker.hxx>
#include <ucbhelper/activedatasink.hxx>
#include <ucbhelper/activedatastreamer.hxx>
-#ifndef _UCBHELPER_INTERACTIONREQUEST_HXX
#include <ucbhelper/interactionrequest.hxx>
-#endif
#include <ucbhelper/cancelcommandexecution.hxx>
using namespace com::sun::star::container;
@@ -149,7 +147,7 @@ void EmptyInputStream::closeInput()
//=========================================================================
class ContentEventListener_Impl : public cppu::OWeakObject,
- public XContentEventListener
+ public XContentEventListener
{
Content_Impl& m_rContent;
@@ -157,7 +155,7 @@ public:
ContentEventListener_Impl( Content_Impl& rContent )
: m_rContent( rContent ) {}
- // XInterface
+ // XInterface
XINTERFACE_DECL()
// XContentEventListener
@@ -184,8 +182,8 @@ friend class ContentEventListener_Impl;
mutable rtl::OUString m_aURL;
Reference< XMultiServiceFactory > m_xSMgr;
Reference< XContent > m_xContent;
- Reference< XCommandProcessor > m_xCommandProcessor;
- Reference< XCommandEnvironment > m_xEnv;
+ Reference< XCommandProcessor > m_xCommandProcessor;
+ Reference< XCommandEnvironment > m_xEnv;
Reference< XContentEventListener > m_xContentEventListener;
mutable osl::Mutex m_aMutex;
sal_Int32 m_nCommandId;
@@ -210,6 +208,7 @@ public:
Any executeCommand( const Command& rCommand );
void abortCommand();
+
inline const Reference< XCommandEnvironment >& getEnvironment() const;
inline void setEnvironment(
const Reference< XCommandEnvironment >& xNewEnv );
@@ -587,7 +586,7 @@ Any Content::getPropertyValue( sal_Int32 nPropertyHandle )
//=========================================================================
Any Content::setPropertyValue( const rtl::OUString& rName,
- const Any& rValue )
+ const Any& rValue )
throw( CommandAbortedException, RuntimeException, Exception )
{
Sequence< rtl::OUString > aNames( 1 );
@@ -602,7 +601,7 @@ Any Content::setPropertyValue( const rtl::OUString& rName,
//=========================================================================
Any Content::setPropertyValue( const sal_Int32 nPropertyHandle,
- const Any& rValue )
+ const Any& rValue )
throw( CommandAbortedException, RuntimeException, Exception )
{
Sequence< sal_Int32 > aHandles( 1 );
@@ -674,8 +673,8 @@ Reference< XRow > Content::getPropertyValuesInterface(
rProp.Name = pNames[ n ];
rProp.Handle = -1; // n/a
-// rProp.Type =
-// rProp.Attributes = ;
+// rProp.Type =
+// rProp.Attributes = ;
}
Command aCommand;
@@ -707,8 +706,8 @@ Reference< XRow > Content::getPropertyValuesInterface(
rProp.Name = rtl::OUString(); // n/a
rProp.Handle = pHandles[ n ];
-// rProp.Type =
-// rProp.Attributes = ;
+// rProp.Type =
+// rProp.Attributes = ;
}
Command aCommand;
@@ -726,7 +725,7 @@ Reference< XRow > Content::getPropertyValuesInterface(
//=========================================================================
Sequence< Any > Content::setPropertyValues(
const Sequence< rtl::OUString >& rPropertyNames,
- const Sequence< Any >& rValues )
+ const Sequence< Any >& rValues )
throw( CommandAbortedException, RuntimeException, Exception )
{
if ( rPropertyNames.getLength() != rValues.getLength() )
@@ -756,7 +755,7 @@ Sequence< Any > Content::setPropertyValues(
rProp.Name = pNames[ n ];
rProp.Handle = -1; // n/a
rProp.Value = pValues[ n ];
-// rProp.State = ;
+// rProp.State = ;
}
Command aCommand;
@@ -774,7 +773,7 @@ Sequence< Any > Content::setPropertyValues(
//=========================================================================
Sequence< Any > Content::setPropertyValues(
const Sequence< sal_Int32 >& nPropertyHandles,
- const Sequence< Any >& rValues )
+ const Sequence< Any >& rValues )
throw( CommandAbortedException, RuntimeException, Exception )
{
if ( nPropertyHandles.getLength() != rValues.getLength() )
@@ -804,7 +803,7 @@ Sequence< Any > Content::setPropertyValues(
rProp.Name = rtl::OUString(); // n/a
rProp.Handle = pHandles[ n ];
rProp.Value = pValues[ n ];
-// rProp.State = ;
+// rProp.State = ;
}
Command aCommand;
@@ -934,7 +933,7 @@ Reference< XResultSet > Content::createCursor(
OSL_ENSURE( aResult.is(), "Content::createCursor - no cursor!" );
- if ( !aResult.is() )
+ if ( !aResult.is() )
{
// Former, the open command directly returned a XResultSet.
aCursorAny >>= aResult;
@@ -964,7 +963,7 @@ Reference< XResultSet > Content::createCursor(
OSL_ENSURE( aResult.is(), "Content::createCursor - no cursor!" );
- if ( !aResult.is() )
+ if ( !aResult.is() )
{
// Former, the open command directly returned a XResultSet.
aCursorAny >>= aResult;
@@ -1008,7 +1007,7 @@ Reference< XDynamicResultSet > Content::createDynamicCursor(
//=========================================================================
Reference< XDynamicResultSet > Content::createSortedDynamicCursor(
const Sequence< rtl::OUString >& rPropertyNames,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ const Sequence< NumberedSortingInfo >& rSortInfo,
Reference< XAnyCompareFactory > rAnyCompareFactory,
ResultSetInclude eMode )
throw( CommandAbortedException, RuntimeException, Exception )
@@ -1043,7 +1042,7 @@ Reference< XDynamicResultSet > Content::createSortedDynamicCursor(
//=========================================================================
Reference< XDynamicResultSet > Content::createSortedDynamicCursor(
const Sequence< sal_Int32 >& rPropertyHandles,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ const Sequence< NumberedSortingInfo >& rSortInfo,
Reference< XAnyCompareFactory > rAnyCompareFactory,
ResultSetInclude eMode )
throw( CommandAbortedException, RuntimeException, Exception )
@@ -1078,7 +1077,7 @@ Reference< XDynamicResultSet > Content::createSortedDynamicCursor(
//=========================================================================
Reference< XResultSet > Content::createSortedCursor(
const Sequence< rtl::OUString >& rPropertyNames,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ const Sequence< NumberedSortingInfo >& rSortInfo,
Reference< XAnyCompareFactory > rAnyCompareFactory,
ResultSetInclude eMode )
throw( CommandAbortedException, RuntimeException, Exception )
@@ -1132,7 +1131,7 @@ Reference< XResultSet > Content::createSortedCursor(
//=========================================================================
Reference< XResultSet > Content::createSortedCursor(
const Sequence< sal_Int32 >& rPropertyHandles,
- const ::com::sun::star::uno::Sequence< ::com::sun::star::ucb::NumberedSortingInfo >& rSortInfo,
+ const Sequence< NumberedSortingInfo >& rSortInfo,
Reference< XAnyCompareFactory > rAnyCompareFactory,
ResultSetInclude eMode )
throw( CommandAbortedException, RuntimeException, Exception )
@@ -1331,7 +1330,7 @@ sal_Bool Content::openStream( const Reference< XOutputStream >& rStream )
//=========================================================================
void Content::writeStream( const Reference< XInputStream >& rStream,
- sal_Bool bReplaceExisting )
+ sal_Bool bReplaceExisting )
throw( CommandAbortedException, RuntimeException, Exception )
{
InsertCommandArgument aArg;
@@ -1349,11 +1348,31 @@ void Content::writeStream( const Reference< XInputStream >& rStream,
}
//=========================================================================
+Sequence< ContentInfo > Content::queryCreatableContentsInfo()
+ throw( CommandAbortedException, RuntimeException, Exception )
+{
+ // First, try it using "CreatableContentsInfo" property -> the "new" way.
+ Sequence< ContentInfo > aInfo;
+ if ( getPropertyValue(
+ rtl::OUString::createFromAscii( "CreatableContentsInfo" ) )
+ >>= aInfo )
+ return aInfo;
+
+ // Second, try it using XContentCreator interface -> the "old" way (not
+ // providing the chance to supply an XCommandEnvironment.
+ Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY );
+ if ( xCreator.is() )
+ aInfo = xCreator->queryCreatableContentsInfo();
+
+ return aInfo;
+}
+
+//=========================================================================
sal_Bool Content::insertNewContent( const rtl::OUString& rContentType,
const Sequence< rtl::OUString >&
rPropertyNames,
- const Sequence< Any >& rPropertyValues,
- Content& rNewContent )
+ const Sequence< Any >& rPropertyValues,
+ Content& rNewContent )
throw( CommandAbortedException, RuntimeException, Exception )
{
return insertNewContent( rContentType,
@@ -1367,8 +1386,8 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType,
sal_Bool Content::insertNewContent( const rtl::OUString& rContentType,
const Sequence< sal_Int32 >&
nPropertyHandles,
- const Sequence< Any >& rPropertyValues,
- Content& rNewContent )
+ const Sequence< Any >& rPropertyValues,
+ Content& rNewContent )
throw( CommandAbortedException, RuntimeException, Exception )
{
return insertNewContent( rContentType,
@@ -1382,29 +1401,51 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType,
sal_Bool Content::insertNewContent( const rtl::OUString& rContentType,
const Sequence< rtl::OUString >&
rPropertyNames,
- const Sequence< Any >& rPropertyValues,
+ const Sequence< Any >& rPropertyValues,
const Reference< XInputStream >& rData,
- Content& rNewContent )
+ Content& rNewContent )
throw( CommandAbortedException, RuntimeException, Exception )
{
if ( rContentType.getLength() == 0 )
return sal_False;
- Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY );
-
- OSL_ENSURE( xCreator.is(),
- "Content::insertNewContent - Not a XContentCreator!" );
-
- if ( !xCreator.is() )
- return sal_False;
-
+ // First, try it using "createNewContent" command -> the "new" way.
ContentInfo aInfo;
aInfo.Type = rContentType;
aInfo.Attributes = 0;
- Reference< XContent > xNew = xCreator->createNewContent( aInfo );
+ Command aCommand;
+ aCommand.Name = rtl::OUString::createFromAscii( "createNewContent" );
+ aCommand.Handle = -1; // n/a
+ aCommand.Argument <<= aInfo;
+
+ Reference< XContent > xNew;
+ try
+ {
+ m_xImpl->executeCommand( aCommand ) >>= xNew;
+ }
+ catch ( RuntimeException const & )
+ {
+ throw;
+ }
+ catch ( Exception const & )
+ {
+ }
+
if ( !xNew.is() )
- return sal_False;
+ {
+ // Second, try it using XContentCreator interface -> the "old"
+ // way (not providing the chance to supply an XCommandEnvironment.
+ Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY );
+
+ if ( !xCreator.is() )
+ return sal_False;
+
+ xNew = xCreator->createNewContent( aInfo );
+
+ if ( !xNew.is() )
+ return sal_False;
+ }
Content aNewContent( xNew, m_xImpl->getEnvironment() );
aNewContent.setPropertyValues( rPropertyNames, rPropertyValues );
@@ -1423,29 +1464,51 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType,
sal_Bool Content::insertNewContent( const rtl::OUString& rContentType,
const Sequence< sal_Int32 >&
nPropertyHandles,
- const Sequence< Any >& rPropertyValues,
+ const Sequence< Any >& rPropertyValues,
const Reference< XInputStream >& rData,
- Content& rNewContent )
+ Content& rNewContent )
throw( CommandAbortedException, RuntimeException, Exception )
{
if ( rContentType.getLength() == 0 )
return sal_False;
- Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY );
-
- OSL_ENSURE( xCreator.is(),
- "Content::insertNewContent - Not a XContentCreator!" );
-
- if ( !xCreator.is() )
- return sal_False;
-
+ // First, try it using "createNewContent" command -> the "new" way.
ContentInfo aInfo;
aInfo.Type = rContentType;
aInfo.Attributes = 0;
- Reference< XContent > xNew = xCreator->createNewContent( aInfo );
+ Command aCommand;
+ aCommand.Name = rtl::OUString::createFromAscii( "createNewContent" );
+ aCommand.Handle = -1; // n/a
+ aCommand.Argument <<= aInfo;
+
+ Reference< XContent > xNew;
+ try
+ {
+ m_xImpl->executeCommand( aCommand ) >>= xNew;
+ }
+ catch ( RuntimeException const & )
+ {
+ throw;
+ }
+ catch ( Exception const & )
+ {
+ }
+
if ( !xNew.is() )
- return sal_False;
+ {
+ // Second, try it using XContentCreator interface -> the "old"
+ // way (not providing the chance to supply an XCommandEnvironment.
+ Reference< XContentCreator > xCreator( m_xImpl->getContent(), UNO_QUERY );
+
+ if ( !xCreator.is() )
+ return sal_False;
+
+ xNew = xCreator->createNewContent( aInfo );
+
+ if ( !xNew.is() )
+ return sal_False;
+ }
Content aNewContent( xNew, m_xImpl->getEnvironment() );
aNewContent.setPropertyValues( nPropertyHandles, rPropertyValues );
@@ -1464,7 +1527,7 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType,
sal_Bool Content::transferContent( const Content& rSourceContent,
InsertOperation eOperation,
const rtl::OUString & rTitle,
- const sal_Int32 nNameClashAction )
+ const sal_Int32 nNameClashAction )
throw( CommandAbortedException, RuntimeException, Exception )
{
ContentBroker* pBroker = ContentBroker::get();
@@ -1578,8 +1641,8 @@ sal_Bool Content::isDocument()
//=========================================================================
Content_Impl::Content_Impl( const Reference< XMultiServiceFactory >& rSMgr,
- const Reference< XContent >& rContent,
- const Reference< XCommandEnvironment >& rEnv )
+ const Reference< XContent >& rContent,
+ const Reference< XCommandEnvironment >& rEnv )
: m_xSMgr( rSMgr ),
m_xContent( rContent ),
m_xEnv( rEnv ),
diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx b/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx
index 51490ed40296..9a41c55ccfd8 100644
--- a/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx
+++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.cxx
@@ -38,12 +38,10 @@
#include <com/sun/star/io/XActiveDataSink.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/sdbc/XResultSet.hpp>
-#ifndef _COM_SUN_STAR_UCB_XCOMMMANDINFO_HPP_
#include <com/sun/star/ucb/XCommandInfo.hpp>
-#endif
#include <com/sun/star/ucb/XContentAccess.hpp>
-#include <com/sun/star/ucb/XContentCreator.hpp>
#include <com/sun/star/ucb/CommandAbortedException.hpp>
+#include <com/sun/star/ucb/ContentInfo.hpp>
#include <com/sun/star/ucb/ContentInfoAttribute.hpp>
#include "rtl/ref.hxx"
@@ -57,9 +55,7 @@
#include <vcl/dialog.hxx>
#include <vcl/fixed.hxx>
#include <vcl/group.hxx>
-#ifndef _SV_BUTTON_HXX
#include <vcl/button.hxx>
-#endif
#include <vcl/msgbox.hxx>
#include <ucbhelper/macros.hxx>
#include <ucbhelper/configurationkeys.hxx>
@@ -89,8 +85,8 @@ class TestDataSink : public cppu::OWeakObject, public XActiveDataSink
uno::Reference< XInputStream > m_xStream;
public:
-// TestDataSink() {}
-// virtual ~TestDataSink();
+// TestDataSink() {}
+// virtual ~TestDataSink();
// XInterface methods
virtual Any SAL_CALL queryInterface( const Type & rType )
@@ -128,7 +124,8 @@ private:
DECL_LINK( NameHdl, Edit * );
public:
- StringInputDialog( const String& rTitle,
+ StringInputDialog( ResMgr& rResMgr,
+ const String& rTitle,
const String& rDefaultText,
String* pGroupName = 0 );
String GetValue() const { return m_aNameEdit.GetText(); }
@@ -147,15 +144,15 @@ class UcbExplorerListBoxEntry : public SvLBoxEntry
enum EntryType { FOLDER, DOCUMENT, LINK };
- ::ucb::Content m_aContent;
- EntryType m_eType;
+ ::ucbhelper::Content m_aContent;
+ EntryType m_eType;
public:
UcbExplorerListBoxEntry();
virtual ~UcbExplorerListBoxEntry();
BOOL createNewContent( const ContentInfo& rInfo,
- ::ucb::Content& rNewContent );
+ ::ucbhelper::Content& rNewContent );
};
//=========================================================================
@@ -176,13 +173,13 @@ private:
virtual void RequestingChilds( SvLBoxEntry* pParent );
public:
- UcbExplorerTreeListBox( Window* pParent, WinBits nWinStyle = 0 );
+ UcbExplorerTreeListBox( ResMgr & rResMgr, Window* pParent, WinBits nWinStyle = 0 );
virtual ~UcbExplorerTreeListBox();
virtual void Command( const CommandEvent& rCEvt );
UcbExplorerListBoxEntry*
- InsertEntry( ::ucb::Content& rContent, SvLBoxEntry* pParent );
+ InsertEntry( ::ucbhelper::Content& rContent, SvLBoxEntry* pParent );
UcbExplorerListBoxEntry*
InsertEntry( const String& rURL, SvLBoxEntry* pParent = 0 );
};
@@ -200,7 +197,7 @@ class UcbExplorerWindow : public WorkWindow
UcbExplorerTreeListBox m_aTree;
public:
- UcbExplorerWindow( Window *pParent, WinBits nWinStyle );
+ UcbExplorerWindow( ResMgr & rResMgr, Window *pParent, WinBits nWinStyle );
virtual ~UcbExplorerWindow();
virtual void Resize();
@@ -230,7 +227,7 @@ Any SAL_CALL TestDataSink::queryInterface( const Type & rType )
{
Any aRet = cppu::queryInterface(
rType,
- static_cast< XActiveDataSink * >( this ) );
+ static_cast< XActiveDataSink * >( this ) );
return aRet.hasValue() ? aRet : OWeakObject::queryInterface( rType );
}
@@ -273,16 +270,17 @@ uno::Reference< XInputStream > SAL_CALL TestDataSink::getInputStream()
//
//=========================================================================
-StringInputDialog::StringInputDialog( const String& rTitle,
+StringInputDialog::StringInputDialog( ResMgr& rResMgr,
+ const String& rTitle,
const String& rDefaultText,
String* pGroupName )
-: ModalDialog( 0, ResId( DLG_STRINGINPUT ) ),
- m_aNameText ( this, ResId( FT_STRINGINPUT_DLG_NAME ) ),
- m_aNameEdit ( this, ResId( ED_STRINGINPUT_DLG_NAME ) ),
- m_aNameGroup( this, ResId( GB_STRINGINPUT_DLG_NAME ) ),
- m_aOKBtn ( this, ResId( BT_STRINGINPUT_DLG_OK ) ),
- m_aCancelBtn( this, ResId( BT_STRINGINPUT_DLG_CANCEL ) ),
- m_aHelpBtn ( this, ResId( BT_STRINGINPUT_DLG_HELP ) )
+ : ModalDialog( 0, ResId( DLG_STRINGINPUT, rResMgr ) ),
+ m_aNameText ( this, ResId( FT_STRINGINPUT_DLG_NAME, rResMgr ) ),
+ m_aNameEdit ( this, ResId( ED_STRINGINPUT_DLG_NAME, rResMgr ) ),
+ m_aNameGroup( this, ResId( GB_STRINGINPUT_DLG_NAME, rResMgr ) ),
+ m_aOKBtn ( this, ResId( BT_STRINGINPUT_DLG_OK, rResMgr ) ),
+ m_aCancelBtn( this, ResId( BT_STRINGINPUT_DLG_CANCEL, rResMgr ) ),
+ m_aHelpBtn ( this, ResId( BT_STRINGINPUT_DLG_HELP, rResMgr ) )
{
FreeResource();
SetText( rTitle );
@@ -343,7 +341,7 @@ UcbExplorerListBoxEntry::~UcbExplorerListBoxEntry()
//=========================================================================
BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo,
- ::ucb::Content& rNewContent )
+ ::ucbhelper::Content& rNewContent )
{
sal_Int32 nCount = rInfo.Properties.getLength();
Sequence< Any > aPropValues( nCount );
@@ -358,7 +356,10 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo,
for ( sal_Int32 n = 0; n < nCount; ++n )
{
const OUString& rName = pProps[ n ].Name;
- StringInputDialog* pDlg = new StringInputDialog( rName, rName );
+
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) );
+ StringInputDialog* pDlg = new StringInputDialog( *xManager.get(), rName, rName );
USHORT nRet = pDlg->Execute();
if ( nRet == RET_OK )
{
@@ -444,7 +445,10 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo,
// Let the user specify the URL of a content containing the
// data to supply to the new content.
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) );
StringInputDialog* pDlg = new StringInputDialog(
+ *xManager.get(),
OUString::createFromAscii(
"Document Data Source URL" ),
OUString() );
@@ -457,7 +461,7 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo,
if ( aSourceURL.getLength() == 0 )
{
DBG_ERROR( "UcbExplorerListBoxEntry::createNewContent - "
- "No document data URL!" );
+ "No document data URL!" );
return FALSE;
}
@@ -465,11 +469,11 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo,
{
uno::Reference< XCommandEnvironment > xEnv;
- ::ucb::ContentBroker* pBroker = ::ucb::ContentBroker::get();
+ ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
if ( pBroker )
{
uno::Reference< XInteractionHandler > xInteractionHandler(
- pBroker->getServiceManager()->createInstance(
+ pBroker->getServiceManager()->createInstance(
OUString::createFromAscii(
"com.sun.star.task.InteractionHandler" ) ),
UNO_QUERY );
@@ -477,21 +481,21 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo,
uno::Reference< XProgressHandler > xProgressHandler
/* = new ProgressHandler( *pBroker ) */ ;
- xEnv = new ::ucb::CommandEnvironment( xInteractionHandler,
- xProgressHandler );
+ xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler,
+ xProgressHandler );
}
- ::ucb::Content aSourceContent( aSourceURL, xEnv );
+ ::ucbhelper::Content aSourceContent( aSourceURL, xEnv );
// Get source data.
rtl::Reference< TestDataSink > xSourceData = new TestDataSink;
- aSourceContent.openStream( xSourceData.getBodyPtr() );
+ aSourceContent.openStream( xSourceData.get() );
xData = xSourceData->getInputStream();
}
catch ( ContentCreationException const & )
{
DBG_ERROR( "UcbExplorerListBoxEntry::createNewContent - "
- "No content for document data!" );
+ "No content for document data!" );
return FALSE;
}
catch ( CommandAbortedException const & )
@@ -516,7 +520,7 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo,
// Create new content.
- ULONG n = Application::ReleaseSolarMutex();
+ ULONG n = Application::ReleaseSolarMutex();
BOOL bRet = sal_False;
try
@@ -545,13 +549,14 @@ BOOL UcbExplorerListBoxEntry::createNewContent( const ContentInfo& rInfo,
//
//=========================================================================
-UcbExplorerTreeListBox::UcbExplorerTreeListBox(
- Window* pParent, WinBits nWinStyle )
+UcbExplorerTreeListBox::UcbExplorerTreeListBox( ResMgr & rResMgr,
+ Window* pParent,
+ WinBits nWinStyle )
: SvTreeListBox( pParent, nWinStyle ),
- m_aFolderClosed( ResId( BMP_FOLDER_CLOSED ) ),
- m_aFolderOpened( ResId( BMP_FOLDER_OPENED ) ),
- m_aDocument( ResId( BMP_DOCUMENT ) ),
- m_aLink( ResId( BMP_LINK ) )
+ m_aFolderClosed( ResId( BMP_FOLDER_CLOSED, rResMgr ) ),
+ m_aFolderOpened( ResId( BMP_FOLDER_OPENED, rResMgr ) ),
+ m_aDocument( ResId( BMP_DOCUMENT, rResMgr ) ),
+ m_aLink( ResId( BMP_LINK, rResMgr ) )
{
}
@@ -580,18 +585,18 @@ void UcbExplorerTreeListBox::RequestingChilds( SvLBoxEntry* pParent )
{
case UcbExplorerListBoxEntry::FOLDER:
{
- ULONG n = Application::ReleaseSolarMutex();
+ ULONG n = Application::ReleaseSolarMutex();
try
{
Sequence< OUString > aPropertyNames( 0 );
-// OUString* pNames = aPropertyNames.getArray();
-// pNames[ 0 ] = OUString::createFromAscii( "Title" );
+// OUString* pNames = aPropertyNames.getArray();
+// pNames[ 0 ] = OUString::createFromAscii( "Title" );
uno::Reference< XResultSet > xResultSet
= pEntry->m_aContent.createCursor(
aPropertyNames,
- ::ucb::INCLUDE_FOLDERS_AND_DOCUMENTS );
+ ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS );
uno::Reference< XContentAccess > xContentAccess(
xResultSet, UNO_QUERY );
@@ -648,36 +653,32 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt )
GetEntry( rPos, TRUE ) );
if ( pEntry )
{
- PopupMenu* pMenu = new PopupMenu( ResId( MENU_POPUP ) );
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) );
+ PopupMenu* pMenu = new PopupMenu( ResId( MENU_POPUP, *xManager.get() ) );
PopupMenu* pNewMenu = 0;
-// pMenu->SetSelectHdl( LINK( this,
-// SfxCommonTemplateDialog_Impl,
-// MenuSelectHdl ) );
+// pMenu->SetSelectHdl( LINK( this,
+// SfxCommonTemplateDialog_Impl,
+// MenuSelectHdl ) );
//////////////////////////////////////////////////////////////
// Configure "New"
//////////////////////////////////////////////////////////////
- uno::Reference< XContentCreator > xCreator(
- pEntry->m_aContent.get(), UNO_QUERY );
- Sequence< ContentInfo > aInfo;
- BOOL bCanCreate = xCreator.is();
- if ( bCanCreate )
- {
- aInfo = xCreator->queryCreatableContentsInfo();
- const ContentInfo* pInfo = aInfo.getConstArray();
- sal_Int32 nCount = aInfo.getLength();
- bCanCreate = ( nCount > 0 );
+ Sequence< ContentInfo > aInfo
+ = pEntry->m_aContent.queryCreatableContentsInfo();
+ const ContentInfo* pInfo = aInfo.getConstArray();
+ sal_Int32 nCount = aInfo.getLength();
+ BOOL bCanCreate = ( nCount > 0 );
- pNewMenu = new PopupMenu;
- pMenu->SetPopupMenu( MENU_NEW, pNewMenu );
+ pNewMenu = new PopupMenu;
+ pMenu->SetPopupMenu( MENU_NEW, pNewMenu );
- for ( sal_Int32 n = 0; n < nCount; ++n )
- {
- const ContentInfo& rInfo = pInfo[ n ];
- pNewMenu->InsertItem( 20000 + n + 1, rInfo.Type );
- }
+ for ( sal_Int32 n = 0; n < nCount; ++n )
+ {
+ const ContentInfo& rInfo = pInfo[ n ];
+ pNewMenu->InsertItem( 20000 + n + 1, rInfo.Type );
}
pMenu->EnableItem( MENU_NEW, bCanCreate );
@@ -721,7 +722,7 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt )
{
pMenu->EnableItem( MENU_DELETE,
pEntry->m_aContent
- .getCommands()->hasCommandByName(
+ .getCommands()->hasCommandByName(
OUString::createFromAscii(
"delete" ) ) );
}
@@ -743,8 +744,8 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt )
USHORT nSelected = pMenu->Execute( this, rPos );
switch ( nSelected )
{
-// case MENU_NEW:
-// break;
+// case MENU_NEW:
+// break;
case MENU_RENAME:
{
@@ -767,8 +768,11 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt )
{
}
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) );
StringInputDialog* pDlg
= new StringInputDialog(
+ *xManager.get(),
OUString::createFromAscii( "Title" ),
aNewTitle );
@@ -884,7 +888,7 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt )
{
// New-menu entry selected.
- ::ucb::Content aNewContent;
+ ::ucbhelper::Content aNewContent;
if ( pEntry->createNewContent(
aInfo.getConstArray()[ nSelected - 20001 ],
aNewContent ) )
@@ -910,8 +914,8 @@ void UcbExplorerTreeListBox::Command( const CommandEvent& rCEvt )
//=========================================================================
UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry(
- ::ucb::Content& rContent,
- SvLBoxEntry* pParent )
+ ::ucbhelper::Content& rContent,
+ SvLBoxEntry* pParent )
{
try
{
@@ -921,7 +925,7 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry(
if ( !aTitle.getLength() )
aTitle = OUString::createFromAscii( "/" );
- UcbExplorerListBoxEntry* pEntry = 0;
+ UcbExplorerListBoxEntry* pEntry = 0;
if ( rContent.isFolder() )
{
@@ -995,18 +999,18 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry(
//=========================================================================
UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry(
- const String& rURL,
- SvLBoxEntry* pParent )
+ const String& rURL,
+ SvLBoxEntry* pParent )
{
try
{
uno::Reference< XCommandEnvironment > xEnv;
- ::ucb::ContentBroker* pBroker = ::ucb::ContentBroker::get();
+ ::ucbhelper::ContentBroker* pBroker = ::ucbhelper::ContentBroker::get();
if ( pBroker )
{
uno::Reference< XInteractionHandler > xInteractionHandler(
- pBroker->getServiceManager()->createInstance(
+ pBroker->getServiceManager()->createInstance(
OUString::createFromAscii(
"com.sun.star.task.InteractionHandler" ) ),
UNO_QUERY );
@@ -1014,11 +1018,11 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry(
uno::Reference< XProgressHandler > xProgressHandler
/* = new ProgressHandler( *pBroker ) */ ;
- xEnv = new ::ucb::CommandEnvironment( xInteractionHandler,
- xProgressHandler );
+ xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler,
+ xProgressHandler );
}
- ::ucb::Content aContent( rURL, xEnv );
+ ::ucbhelper::Content aContent( rURL, xEnv );
return InsertEntry( aContent, pParent );
}
catch ( ContentCreationException const & )
@@ -1034,9 +1038,9 @@ UcbExplorerListBoxEntry* UcbExplorerTreeListBox::InsertEntry(
//
//=========================================================================
-UcbExplorerWindow::UcbExplorerWindow( Window *pParent, WinBits nWinStyle )
+UcbExplorerWindow::UcbExplorerWindow( ResMgr & rResMgr, Window *pParent, WinBits nWinStyle )
: WorkWindow( pParent, nWinStyle ),
- m_aTree( this, WB_HSCROLL )
+ m_aTree( rResMgr, this, WB_HSCROLL )
{
Font aTreeFont( m_aTree.GetFont() );
aTreeFont.SetName( String( RTL_CONSTASCII_USTRINGPARAM("Courier") ) );
@@ -1105,7 +1109,7 @@ void MyApp::Main()
comphelper::setProcessServiceFactory( xFac );
- unO::Reference< XComponent > xComponent( xFac, UNO_QUERY );
+ uno::Reference< XComponent > xComponent( xFac, UNO_QUERY );
//////////////////////////////////////////////////////////////////////
// Create UCB.
@@ -1116,16 +1120,16 @@ void MyApp::Main()
Sequence< Any > aArgs( 2 );
aArgs[ 0 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY1_LOCAL );
aArgs[ 1 ] <<= OUString::createFromAscii( UCB_CONFIGURATION_KEY2_OFFICE );
- sal_Bool bSuccess = ::ucb::ContentBroker::initialize( xFac, aArgs );
+ sal_Bool bSuccess = ::ucbhelper::ContentBroker::initialize( xFac, aArgs );
#else
// Init UCB (Use provided configuration data)
- ::ucb::ContentProviderDataList aProviders;
+ ::ucbhelper::ContentProviderDataList aProviders;
aProviders.push_back(
- ::ucb::ContentProviderData(
+ ::ucbhelper::ContentProviderData(
OUString::createFromAscii( "com.sun.star.ucb.FileContentProvider" ),
OUString::createFromAscii( "file" ),
OUString() ) );
- sal_Bool bSuccess = ::ucb::ContentBroker::initialize( xFac, aProviders );
+ sal_Bool bSuccess = ::ucbhelper::ContentBroker::initialize( xFac, aProviders );
#endif
if ( !bSuccess )
@@ -1138,12 +1142,12 @@ void MyApp::Main()
// Create/init/show app window.
//////////////////////////////////////////////////////////////////////
- ResMgr* pMgr = ResMgr::CreateResMgr( CREATEVERSIONRESMGR( ucbexplorer ) );
- Resource::SetResManager( pMgr );
+ std::auto_ptr< ResMgr > xManager(
+ ResMgr::CreateResMgr( CREATEVERSIONRESMGR_NAME( ucbexplorer ) ) );
- UcbExplorerWindow aAppWin( 0, WB_APP | WB_STDWORK );
+ UcbExplorerWindow aAppWin( *xManager.get(), 0, WB_APP | WB_STDWORK );
- MenuBar aMBMain( ResId( MENU_MAIN ) );
+ MenuBar aMBMain( ResId( MENU_MAIN, *xManager.get() ) );
// Check for command line params
#if 0
@@ -1158,7 +1162,7 @@ void MyApp::Main()
aRootURL = UniString::CreateFromAscii(
RTL_CONSTASCII_STRINGPARAM( "vnd.sun.star.hier:/" ) );
- String aTitle( ResId( TEXT_TITLEBAR ) );
+ String aTitle( ResId( TEXT_TITLEBAR, *xManager.get() ) );
aTitle.AppendAscii( RTL_CONSTASCII_STRINGPARAM( " - " ) );
aTitle += aRootURL;
@@ -1183,7 +1187,7 @@ void MyApp::Main()
// m_aTree holds UCB contents!
aAppWin.m_aTree.Clear();
- ::ucb::ContentBroker::deinitialize();
+ ::ucbhelper::ContentBroker::deinitialize();
if ( xComponent.is() )
xComponent->dispose();
diff --git a/ucbhelper/workben/ucbexplorer/ucbexplorer.src b/ucbhelper/workben/ucbexplorer/ucbexplorer.src
index 14d4b8ee8770..1449897341d5 100644
--- a/ucbhelper/workben/ucbexplorer/ucbexplorer.src
+++ b/ucbhelper/workben/ucbexplorer/ucbexplorer.src
@@ -27,15 +27,6 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-//=========================================================================
-//
-// UCB Explorer ( resources )
-//
-// (C) 2000 StarOffice Entwicklungs GmbH, Hamburg, Germany
-//
-// $Author: rt $ $Date: 2008-04-10 16:20:05 $Revision$
-//
-//=========================================================================
#include "ucbexplorer.hrc"
@@ -91,6 +82,7 @@ Menu MENU_POPUP
};
};
+/*
Bitmap BMP_FOLDER_CLOSED
{
File = "bmp/fldclose.bmp" ;
@@ -107,6 +99,7 @@ Bitmap BMP_LINK
{
File = "bmp/link.bmp" ;
};
+*/
ModalDialog DLG_STRINGINPUT
{
diff --git a/unotools/inc/unotools/confignode.hxx b/unotools/inc/unotools/confignode.hxx
index 580274004e1a..2e305030fa2b 100644
--- a/unotools/inc/unotools/confignode.hxx
+++ b/unotools/inc/unotools/confignode.hxx
@@ -88,6 +88,9 @@ namespace utl
/// dtor
~OConfigurationNode() {}
+ /// returns the local name of the node
+ ::rtl::OUString getLocalName() const;
+
/** open a sub node
@param _rPath access path of the to-be-opened sub node. May be a hierarchical path.
*/
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index 4b1b9fe272db..c8134137db0c 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/util/XStringEscape.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/container/XNamed.hpp>
#include <comphelper/extract.hxx>
#include <rtl/string.hxx>
#if OSL_DEBUG_LEVEL > 0
@@ -139,6 +140,22 @@ namespace utl
}
//------------------------------------------------------------------------
+ ::rtl::OUString OConfigurationNode::getLocalName() const
+ {
+ ::rtl::OUString sLocalName;
+ try
+ {
+ Reference< XNamed > xNamed( m_xDirectAccess, UNO_QUERY_THROW );
+ sLocalName = xNamed->getName();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sLocalName;
+ }
+
+ //------------------------------------------------------------------------
::rtl::OUString OConfigurationNode::normalizeName(const ::rtl::OUString& _rName, NAMEORIGIN _eOrigin) const
{
::rtl::OUString sName(_rName);
@@ -155,13 +172,9 @@ namespace utl
else
sName = xEscaper->unescapeString(sName);
}
- catch(IllegalArgumentException&)
- {
- OSL_ENSURE(sal_False, "OConfigurationNode::normalizeName: illegal argument (caught an exception saying so)!");
- }
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::normalizeName: caught an exception!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
}
@@ -455,16 +468,9 @@ namespace utl
aReturn = m_xHierarchyAccess->getByHierarchicalName(_rPath);
}
}
- catch(NoSuchElementException& e)
+ catch(const NoSuchElementException&)
{
- #if OSL_DEBUG_LEVEL > 0
- rtl::OStringBuffer aBuf( 256 );
- aBuf.append("OConfigurationNode::getNodeValue: caught a NoSuchElementException while trying to open ");
- aBuf.append( rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ) );
- OSL_ENSURE(sal_False, aBuf.getStr());
- #else
- (void)e;
- #endif
+ DBG_UNHANDLED_EXCEPTION();
}
return aReturn;
}
@@ -487,7 +493,7 @@ namespace utl
}
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::cloneAsRoot: could not retrieve the node path!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -548,13 +554,9 @@ namespace utl
m_xCommitter->commitChanges();
return sal_True;
}
- catch(WrappedTargetException&)
- {
- OSL_ENSURE(sal_False, "OConfigurationTreeRoot::commit: caught a WrappedTargetException!");
- }
- catch(RuntimeException&)
+ catch(const Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationTreeRoot::commit: caught a RuntimeException!");
+ DBG_UNHANDLED_EXCEPTION();
}
return sal_False;
}
@@ -591,7 +593,7 @@ namespace utl
}
catch(const Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationTreeRoot::createWithProvider: unable to check the service conformance of the provider given!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
#endif
@@ -635,15 +637,9 @@ namespace utl
try { xComp->dispose(); } catch(Exception&) { }
}
}
- catch(Exception& e)
+ catch(const Exception&)
{
- #if OSL_DEBUG_LEVEL > 0
- ::rtl::OString sMessage( "OConfigurationTreeRoot::createWithProvider: caught an exception while creating the access object!\nmessage:\n" );
- sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US );
- OSL_ENSURE( sal_False, sMessage.getStr() );
- #else
- (void)e;
- #endif
+ DBG_UNHANDLED_EXCEPTION();
}
}
bTryAgain = CM_PREFER_UPDATABLE == _eMode;
@@ -670,9 +666,9 @@ namespace utl
if (xProviderAsFac.is())
return createWithProvider(xProviderAsFac, _rPath, _nDepth, _eMode, _bLazyWrite);
}
- catch(Exception&)
+ catch(const Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationTreeRoot::createWithServiceFactory: error while instantiating the provider service!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
return OConfigurationTreeRoot();
diff --git a/unotools/source/ucbhelper/ucbhelper.cxx b/unotools/source/ucbhelper/ucbhelper.cxx
index 2b301efc4e52..a798f485516a 100644
--- a/unotools/source/ucbhelper/ucbhelper.cxx
+++ b/unotools/source/ucbhelper/ucbhelper.cxx
@@ -46,15 +46,13 @@
#include <com/sun/star/ucb/XAnyCompareFactory.hpp>
#include <com/sun/star/ucb/XCommandInfo.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
+#include <com/sun/star/ucb/ContentInfo.hpp>
#include <com/sun/star/ucb/ContentInfoAttribute.hpp>
-#include <com/sun/star/ucb/XContentCreator.hpp>
#include <com/sun/star/ucb/XDynamicResultSet.hpp>
#include <com/sun/star/ucb/XSortedDynamicResultSetFactory.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/container/XChild.hpp>
-#ifndef _COM_SUN_STAR_UCB_INTERACTIVEIODEXCEPTION_HPP_
#include <com/sun/star/ucb/InteractiveIOException.hpp>
-#endif
#include <com/sun/star/task/XInteractionHandler.hpp>
#include <ucbhelper/commandenvironment.hxx>
#include <ucbhelper/content.hxx>
@@ -489,11 +487,7 @@ sal_Bool UCBContentHelper::CanMakeFolder( const String& rFolder )
try
{
Content aCnt( rFolder, uno::Reference< XCommandEnvironment > () );
- uno::Reference< XContentCreator > xCreator = uno::Reference< XContentCreator >( aCnt.get(), UNO_QUERY );
- if ( !xCreator.is() )
- return sal_False;
-
- Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo();
+ Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo();
sal_Int32 nCount = aInfo.getLength();
if ( nCount == 0 )
return sal_False;
@@ -538,11 +532,7 @@ sal_Bool UCBContentHelper::MakeFolder( Content& aCnt, const String& aTitle, Cont
try
{
- uno::Reference< XContentCreator > xCreator( aCnt.get(), UNO_QUERY );
- if ( !xCreator.is() )
- return sal_False;
-
- Sequence< ContentInfo > aInfo = xCreator->queryCreatableContentsInfo();
+ Sequence< ContentInfo > aInfo = aCnt.queryCreatableContentsInfo();
sal_Int32 nCount = aInfo.getLength();
if ( nCount == 0 )
return sal_False;
diff --git a/vcl/aqua/inc/aquaprintview.h b/vcl/aqua/inc/aquaprintview.h
index c5ce20c17425..55a85678cd50 100755
--- a/vcl/aqua/inc/aquaprintview.h
+++ b/vcl/aqua/inc/aquaprintview.h
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: aquaprintview.h,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.114.1 $
*
* This file is part of OpenOffice.org.
*
@@ -35,20 +35,36 @@
#include <Cocoa/Cocoa.h>
#include "postmac.h"
-class ImplQPrinter;
+#include "vcl/print.hxx"
+
class AquaSalInfoPrinter;
+struct PrintAccessoryViewState
+{
+ bool bNeedRestart;
+ sal_Int32 nLastPage;
+
+ PrintAccessoryViewState()
+ : bNeedRestart( false ), nLastPage( 0 ) {}
+};
+
@interface AquaPrintView : NSView
{
- ImplQPrinter* mpQPrinter;
- AquaSalInfoPrinter* mpInfoPrinter;
+ vcl::PrinterController* mpController;
+ AquaSalInfoPrinter* mpInfoPrinter;
}
--(id)initWithQPrinter: (ImplQPrinter*)pPrinter withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter;
+-(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter;
-(MacOSBOOL)knowsPageRange: (NSRangePointer)range;
-(NSRect)rectForPage: (int)page;
-(NSPoint)locationOfPrintRect: (NSRect)aRect;
-(void)drawRect: (NSRect)rect;
@end
+@interface AquaPrintAccessoryView : NSObject
+{
+}
++(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState;
+@end
+
#endif
diff --git a/vcl/aqua/inc/salgdi.h b/vcl/aqua/inc/salgdi.h
index 4933dbc48586..f557c4d2e79b 100644
--- a/vcl/aqua/inc/salgdi.h
+++ b/vcl/aqua/inc/salgdi.h
@@ -175,6 +175,9 @@ public:
void RefreshRect(float lX, float lY, float lWidth, float lHeight);
void SetState();
+ void UnsetState();
+ // InvalidateContext does an UnsetState and sets mrContext to 0
+ void InvalidateContext();
virtual BOOL unionClipRegion( long nX, long nY, long nWidth, long nHeight );
virtual bool unionClipRegion( const ::basegfx::B2DPolyPolygon& );
@@ -359,6 +362,7 @@ private:
void ApplyXorContext();
void Pattern50Fill();
UInt32 getState( ControlState nState );
+ UInt32 getTrackState( ControlState nState );
};
class XorEmulation
diff --git a/vcl/aqua/inc/salprn.h b/vcl/aqua/inc/salprn.h
index ec08261e8321..bf9c3c25bc87 100644
--- a/vcl/aqua/inc/salprn.h
+++ b/vcl/aqua/inc/salprn.h
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: salprn.h,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -73,8 +73,8 @@ class AquaSalInfoPrinter : public SalInfoPrinter
int mnStartPageOffsetX;
int mnStartPageOffsetY;
- ULONG mnCurPageRangeStart;
- ULONG mnCurPageRangeCount;
+ sal_Int32 mnCurPageRangeStart;
+ sal_Int32 mnCurPageRangeCount;
public:
AquaSalInfoPrinter( const SalPrinterQueueInfo& pInfo );
@@ -96,19 +96,17 @@ class AquaSalInfoPrinter : public SalInfoPrinter
virtual String GetPaperBinName( const ImplJobSetup* i_pSetupData, ULONG i_nPaperBin );
virtual void InitPaperFormats( const ImplJobSetup* i_pSetupData );
virtual int GetLandscapeAngle( const ImplJobSetup* i_pSetupData );
- virtual DuplexMode GetDuplexMode( const ImplJobSetup* i_pSetupData );
-
// the artificial separation between InfoPrinter and Printer
// is not really useful for us
// so let's make AquaSalPrinter just a forwarder to AquaSalInfoPrinter
// and concentrate the real work in one class
// implement pull model print system
- BOOL StartJob( const String* pFileName,
- const String& rAppName,
- ImplJobSetup* pSetupData,
- ImplQPrinter* pQPrinter,
- bool bIsQuickJob );
+ BOOL StartJob( const String* i_pFileName,
+ const String& rJobName,
+ const String& i_rAppName,
+ ImplJobSetup* i_pSetupData,
+ vcl::PrinterController& i_rController );
BOOL EndJob();
BOOL AbortJob();
SalGraphics* StartPage( ImplJobSetup* i_pSetupData, BOOL i_bNewJobData );
@@ -117,8 +115,12 @@ class AquaSalInfoPrinter : public SalInfoPrinter
NSPrintInfo* getPrintInfo() const { return mpPrintInfo; }
void setStartPageOffset( int nOffsetX, int nOffsetY ) { mnStartPageOffsetX = nOffsetX; mnStartPageOffsetY = nOffsetY; }
- ULONG getCurPageRangeStart() const { return mnCurPageRangeStart; }
- ULONG getCurPageRangeCount() const { return mnCurPageRangeCount; }
+ sal_Int32 getCurPageRangeStart() const { return mnCurPageRangeStart; }
+ sal_Int32 getCurPageRangeCount() const { return mnCurPageRangeCount; }
+
+ // match width/height against known paper formats, possibly switching orientation
+ const PaperInfo* matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const;
+ void setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation );
private:
AquaSalInfoPrinter( const AquaSalInfoPrinter& );
@@ -139,13 +141,16 @@ class AquaSalPrinter : public SalPrinter
virtual BOOL StartJob( const XubString* i_pFileName,
const XubString& i_rJobName,
const XubString& i_rAppName,
- ULONG i_nCopies, BOOL i_bCollate,
+ ULONG i_nCopies,
+ bool i_bCollate,
+ bool i_bDirect,
ImplJobSetup* i_pSetupData );
// implement pull model print system
- virtual BOOL StartJob( const String* pFileName,
- const String& rAppName,
- ImplJobSetup* pSetupData,
- ImplQPrinter* pQPrinter );
+ virtual BOOL StartJob( const String* i_pFileName,
+ const String& rJobName,
+ const String& i_rAppName,
+ ImplJobSetup* i_pSetupData,
+ vcl::PrinterController& i_rListener );
virtual BOOL EndJob();
virtual BOOL AbortJob();
@@ -162,7 +167,7 @@ const double fPtTo100thMM = 35.27777778;
inline int PtTo10Mu( double nPoints ) { return (int)(((nPoints)*fPtTo100thMM)+0.5); }
-inline double TenMuToPt( double nUnits ) { return (((nUnits)/fPtTo100thMM)+0.5); }
+inline double TenMuToPt( double nUnits ) { return floor(((nUnits)/fPtTo100thMM)+0.5); }
diff --git a/vcl/aqua/source/gdi/aquaprintaccessoryview.mm b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
new file mode 100644
index 000000000000..798fefef1b25
--- /dev/null
+++ b/vcl/aqua/source/gdi/aquaprintaccessoryview.mm
@@ -0,0 +1,1237 @@
+/************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: aquaprintview.mm,v $
+ * $Revision: 1.5.56.1 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_vcl.hxx"
+
+#include "aquaprintview.h"
+#include "salinst.h"
+#include "vcl/print.hxx"
+#include "vcl/image.hxx"
+#include "vcl/virdev.hxx"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/unohelp.hxx"
+
+#include "vcl/svids.hrc"
+
+#include "tools/resary.hxx"
+
+#include "com/sun/star/i18n/XBreakIterator.hpp"
+#include "com/sun/star/i18n/WordType.hpp"
+
+#include <map>
+
+using namespace vcl;
+using namespace com::sun::star;
+using namespace com::sun::star::beans;
+using namespace com::sun::star::uno;
+
+/* Note: the accesory view as implemented here is already deprecated in Leopard. Unfortunately
+ as long as our baseline is Tiger we cannot gain the advantages over multiple accessory views
+ as well havs having accessory views AND a preview (as long as you are linked vs. 10.4 libraries
+ the preview insists on not being present. This is unfortunate.
+*/
+
+class ControllerProperties;
+
+@interface ControlTarget : NSObject
+{
+ ControllerProperties* mpController;
+}
+-(id)initWithControllerMap: (ControllerProperties*)pController;
+-(void)triggered:(id)pSender;
+-(void)triggeredNumeric:(id)pSender;
+-(void)triggeredPreview:(id)pSender;
+-(void)dealloc;
+@end
+
+
+class ControllerProperties
+{
+ vcl::PrinterController* mpController;
+ std::map< int, rtl::OUString > maTagToPropertyName;
+ std::map< int, sal_Int32 > maTagToValueInt;
+ std::map< NSView*, NSView* > maViewPairMap;
+ std::vector< NSObject* > maViews;
+ int mnNextTag;
+ sal_Int32 mnLastPageCount;
+ PrintAccessoryViewState* mpState;
+ NSPrintOperation* mpOp;
+ NSView* mpAccessoryView;
+ NSTabView* mpTabView;
+ NSBox* mpPreviewBox;
+ NSImageView* mpPreview;
+ NSTextField* mpPageEdit;
+ NSStepper* mpStepper;
+ NSTextView* mpPagesLabel;
+ ResStringArray maLocalizedStrings;
+
+ public:
+ ControllerProperties( vcl::PrinterController* i_pController,
+ NSPrintOperation* i_pOp,
+ NSView* i_pAccessoryView,
+ NSTabView* i_pTabView,
+ PrintAccessoryViewState* i_pState )
+ : mpController( i_pController ),
+ mnNextTag( 0 ),
+ mnLastPageCount( i_pController->getFilteredPageCount() ),
+ mpState( i_pState ),
+ mpOp( i_pOp ),
+ mpAccessoryView( i_pAccessoryView ),
+ mpTabView( i_pTabView ),
+ mpPreviewBox( nil ),
+ mpPreview( nil ),
+ mpPageEdit( nil ),
+ mpStepper( nil ),
+ mpPagesLabel( nil ),
+ maLocalizedStrings( VclResId( SV_PRINT_NATIVE_STRINGS ) )
+ {
+ mpState->bNeedRestart = false;
+ DBG_ASSERT( maLocalizedStrings.Count() >= 4, "resources not found !" );
+ }
+
+ rtl::OUString getMoreString()
+ {
+ return maLocalizedStrings.Count() >= 4
+ ? rtl::OUString( maLocalizedStrings.GetString( 3 ) )
+ : rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "More" ) );
+ }
+
+ void updatePrintJob()
+ {
+ // TODO: refresh page count etc from mpController
+
+ // page range may have changed depending on options
+ sal_Int32 nPages = mpController->getFilteredPageCount();
+ #if OSL_DEBUG_LEVEL > 1
+ if( nPages != mnLastPageCount )
+ fprintf( stderr, "trouble: number of pages changed from %ld to %ld !\n", mnLastPageCount, nPages );
+ #endif
+ mpState->bNeedRestart = (nPages != mnLastPageCount);
+ NSTabViewItem* pItem = [mpTabView selectedTabViewItem];
+ if( pItem )
+ mpState->nLastPage = [mpTabView indexOfTabViewItem: pItem];
+ else
+ mpState->nLastPage = 0;
+ mnLastPageCount = nPages;
+ if( mpState->bNeedRestart )
+ {
+ #if 0
+ // Warning: bad hack ahead
+ // Apple does not give us a chance of changing the page count,
+ // and they don't let us cancel the dialog either
+ // hack: send a cancel message to the window displaying our views.
+ // this is ugly.
+ for( std::vector< NSObject* >::iterator it = maViews.begin(); it != maViews.end(); ++it )
+ {
+ if( [*it isKindOfClass: [NSView class]] )
+ {
+ NSView* pView = (NSView*)*it;
+ NSWindow* pWindow = [pView window];
+ if( pWindow )
+ {
+ [pWindow cancelOperation: nil];
+ break;
+ }
+ }
+ }
+ #else
+ NSWindow* pWindow = [NSApp modalWindow];
+ if( pWindow )
+ [pWindow cancelOperation: nil];
+ #endif
+ [[mpOp printInfo] setJobDisposition: NSPrintCancelJob];
+ }
+ else
+ {
+ sal_Int32 nPage = [mpStepper intValue];
+ updatePreviewImage( nPage-1 );
+ }
+ }
+
+ int addNameTag( const rtl::OUString& i_rPropertyName )
+ {
+ int nNewTag = mnNextTag++;
+ maTagToPropertyName[ nNewTag ] = i_rPropertyName;
+ return nNewTag;
+ }
+
+ int addNameAndValueTag( const rtl::OUString& i_rPropertyName, sal_Int32 i_nValue )
+ {
+ int nNewTag = mnNextTag++;
+ maTagToPropertyName[ nNewTag ] = i_rPropertyName;
+ maTagToValueInt[ nNewTag ] = i_nValue;
+ return nNewTag;
+ }
+
+ void addObservedControl( NSObject* i_pView )
+ {
+ maViews.push_back( i_pView );
+ }
+
+ void addViewPair( NSView* i_pLeft, NSView* i_pRight )
+ {
+ maViewPairMap[ i_pLeft ] = i_pRight;
+ maViewPairMap[ i_pRight ] = i_pLeft;
+ }
+
+ NSView* getPair( NSView* i_pLeft ) const
+ {
+ NSView* pRight = nil;
+ std::map< NSView*, NSView* >::const_iterator it = maViewPairMap.find( i_pLeft );
+ if( it != maViewPairMap.end() )
+ pRight = it->second;
+ return pRight;
+ }
+
+ void changePropertyWithIntValue( int i_nTag )
+ {
+ std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
+ std::map< int, sal_Int32 >::const_iterator value_it = maTagToValueInt.find( i_nTag );
+ if( name_it != maTagToPropertyName.end() && value_it != maTagToValueInt.end() )
+ {
+ PropertyValue* pVal = mpController->getValue( name_it->second );
+ if( pVal )
+ {
+ pVal->Value <<= value_it->second;
+ updatePrintJob();
+ }
+ }
+ }
+
+ void changePropertyWithIntValue( int i_nTag, sal_Int64 i_nValue )
+ {
+ std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
+ if( name_it != maTagToPropertyName.end() )
+ {
+ PropertyValue* pVal = mpController->getValue( name_it->second );
+ if( pVal )
+ {
+ pVal->Value <<= i_nValue;
+ updatePrintJob();
+ }
+ }
+ }
+
+ void changePropertyWithBoolValue( int i_nTag, sal_Bool i_bValue )
+ {
+ std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
+ if( name_it != maTagToPropertyName.end() )
+ {
+ PropertyValue* pVal = mpController->getValue( name_it->second );
+ if( pVal )
+ {
+ pVal->Value <<= i_bValue;
+ updatePrintJob();
+ }
+ }
+ }
+
+ void changePropertyWithStringValue( int i_nTag, const rtl::OUString& i_rValue )
+ {
+ std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( i_nTag );
+ if( name_it != maTagToPropertyName.end() )
+ {
+ PropertyValue* pVal = mpController->getValue( name_it->second );
+ if( pVal )
+ {
+ pVal->Value <<= i_rValue;
+ updatePrintJob();
+ }
+ }
+ }
+
+ void updateEnableState()
+ {
+ for( std::vector< NSObject* >::iterator it = maViews.begin(); it != maViews.end(); ++it )
+ {
+ NSObject* pObj = *it;
+ NSControl* pCtrl = nil;
+ NSCell* pCell = nil;
+ if( [pObj isKindOfClass: [NSControl class]] )
+ pCtrl = (NSControl*)pObj;
+ else if( [pObj isKindOfClass: [NSCell class]] )
+ pCell = (NSCell*)pObj;
+
+ int nTag = pCtrl ? [pCtrl tag] :
+ pCell ? [pCell tag] :
+ -1;
+
+ std::map< int, rtl::OUString >::const_iterator name_it = maTagToPropertyName.find( nTag );
+ if( name_it != maTagToPropertyName.end() )
+ {
+ MacOSBOOL bEnabled = mpController->isUIOptionEnabled( name_it->second ) ? YES : NO;
+ if( pCtrl )
+ {
+ [pCtrl setEnabled: bEnabled];
+ NSView* pOther = getPair( pCtrl );
+ if( pOther && [pOther isKindOfClass: [NSControl class]] )
+ [(NSControl*)pOther setEnabled: bEnabled];
+ }
+ else if( pCell )
+ [pCell setEnabled: bEnabled];
+
+ }
+ }
+ }
+
+ void updatePreviewImage( sal_Int32 i_nPage )
+ {
+ sal_Int32 nPages = mpController->getFilteredPageCount();
+ NSRect aViewFrame = [mpPreview frame];
+ Size aPixelSize( static_cast<long>(aViewFrame.size.width),
+ static_cast<long>(aViewFrame.size.height) );
+ if( i_nPage >= 0 && nPages > i_nPage )
+ {
+ GDIMetaFile aMtf;
+ PrinterController::PageSize aPageSize( mpController->getFilteredPageFile( i_nPage, aMtf, false ) );
+ VirtualDevice aDev;
+ // see salprn.cxx, currently we pretend to be a 720dpi device on printers
+ aDev.SetReferenceDevice( 720, 720 );
+ aDev.EnableOutput( TRUE );
+ Size aLogicSize( aDev.PixelToLogic( aPixelSize, MapMode( MAP_100TH_MM ) ) );
+ double fScaleX = double(aLogicSize.Width())/double(aPageSize.aSize.Width());
+ double fScaleY = double(aLogicSize.Height())/double(aPageSize.aSize.Height());
+ double fScale = (fScaleX < fScaleY) ? fScaleX : fScaleY;
+ aMtf.WindStart();
+ aMtf.Scale( fScale, fScale );
+ aMtf.WindStart();
+ aLogicSize.Width() = long(double(aPageSize.aSize.Width()) * fScale);
+ aLogicSize.Height() = long(double(aPageSize.aSize.Height()) * fScale);
+ aPixelSize = aDev.LogicToPixel( aLogicSize, MapMode( MAP_100TH_MM ) );
+ aDev.SetOutputSizePixel( aPixelSize );
+ aMtf.WindStart();
+ aDev.SetMapMode( MapMode( MAP_100TH_MM ) );
+ aMtf.Play( &aDev, Point( 0, 0 ), aLogicSize );
+ aDev.EnableMapMode( FALSE );
+ Image aImage( aDev.GetBitmap( Point( 0, 0 ), aPixelSize ) );
+ NSImage* pImage = CreateNSImage( aImage );
+ [mpPreview setImage: [pImage autorelease]];
+ }
+ else
+ [mpPreview setImage: nil];
+ }
+
+ void setupPreview( ControlTarget* i_pCtrlTarget )
+ {
+ if( maLocalizedStrings.Count() < 3 )
+ return;
+
+ // get the preview control
+ NSRect aPreviewFrame = [mpAccessoryView frame];
+ aPreviewFrame.origin.x = 0;
+ aPreviewFrame.origin.y = 5;
+ aPreviewFrame.size.width = 190;
+ aPreviewFrame.size.height -= 7;
+
+ // create a box to put the preview controls in
+ mpPreviewBox = [[NSBox alloc] initWithFrame: aPreviewFrame];
+ [mpPreviewBox setTitle: [CreateNSString( maLocalizedStrings.GetString( 0 ) ) autorelease]];
+ [mpAccessoryView addSubview: [mpPreviewBox autorelease]];
+
+ // now create the image view of the preview
+ NSSize aMargins = [mpPreviewBox contentViewMargins];
+ aPreviewFrame.origin.x = 0;
+ aPreviewFrame.origin.y = 34;
+ aPreviewFrame.size.height -= 61;
+ mpPreview = [[NSImageView alloc] initWithFrame: aPreviewFrame];
+ [mpPreview setImageScaling: NSScaleNone];
+ [mpPreview setImageAlignment: NSImageAlignCenter];
+ [mpPreview setImageFrameStyle: NSImageFrameNone];
+ [mpPreviewBox addSubview: [mpPreview autorelease]];
+
+ // add a label
+ sal_Int32 nPages = mpController->getFilteredPageCount();
+ rtl::OUStringBuffer aBuf( 16 );
+ aBuf.appendAscii( "/ " );
+ aBuf.append( rtl::OUString::valueOf( nPages ) );
+
+ NSString* pText = CreateNSString( aBuf.makeStringAndClear() );
+ NSRect aTextRect = { { 100, 5 }, { 100, 22 } };
+ mpPagesLabel = [[NSTextView alloc] initWithFrame: aTextRect];
+ [mpPagesLabel setFont: [NSFont controlContentFontOfSize: 0]];
+ [mpPagesLabel setEditable: NO];
+ [mpPagesLabel setSelectable: NO];
+ [mpPagesLabel setDrawsBackground: NO];
+ [mpPagesLabel setString: [pText autorelease]];
+ [mpPagesLabel setToolTip: [CreateNSString( maLocalizedStrings.GetString( 2 ) ) autorelease]];
+ [mpPreviewBox addSubview: [mpPagesLabel autorelease]];
+
+ NSRect aFieldRect = { { 45, 5 }, { 35, 25 } };
+ mpPageEdit = [[NSTextField alloc] initWithFrame: aFieldRect];
+ [mpPageEdit setEditable: YES];
+ [mpPageEdit setSelectable: YES];
+ [mpPageEdit setDrawsBackground: YES];
+ [mpPageEdit setToolTip: [CreateNSString( maLocalizedStrings.GetString( 1 ) ) autorelease]];
+ [mpPreviewBox addSubview: [mpPageEdit autorelease]];
+
+ // add a stepper control
+ NSRect aStepFrame = { { 85, 5 }, { 15, 25 } };
+ mpStepper = [[NSStepper alloc] initWithFrame: aStepFrame];
+ [mpStepper setIncrement: 1];
+ [mpStepper setValueWraps: NO];
+ [mpPreviewBox addSubview: [mpStepper autorelease]];
+
+ // constrain the text field to decimal numbers
+ NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
+ [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
+ [pFormatter setMinimum: [[NSNumber numberWithInt: 1] autorelease]];
+ [pFormatter setMaximum: [[NSNumber numberWithInt: nPages] autorelease]];
+ [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
+ [pFormatter setAllowsFloats: NO];
+ [pFormatter setMaximumFractionDigits: 0];
+ [mpPageEdit setFormatter: pFormatter];
+ [mpStepper setMinValue: 1];
+ [mpStepper setMaxValue: nPages];
+
+ [mpPageEdit setIntValue: 1];
+ [mpStepper setIntValue: 1];
+
+ // connect target and action
+ [mpStepper setTarget: i_pCtrlTarget];
+ [mpStepper setAction: @selector(triggeredPreview:)];
+ [mpPageEdit setTarget: i_pCtrlTarget];
+ [mpPageEdit setAction: @selector(triggeredPreview:)];
+
+ // set first preview image
+ updatePreviewImage( 0 );
+ }
+
+ void changePreview( NSObject* i_pSender )
+ {
+ if( [i_pSender isMemberOfClass: [NSTextField class]] )
+ {
+ NSTextField* pField = (NSTextField*)i_pSender;
+ if( pField == mpPageEdit ) // sanity check
+ {
+ sal_Int32 nPage = [pField intValue];
+ [mpStepper setIntValue: nPage];
+ updatePreviewImage( nPage-1 );
+ }
+ }
+ else if( [i_pSender isMemberOfClass: [NSStepper class]] )
+ {
+ NSStepper* pStepper = (NSStepper*)i_pSender;
+ if( pStepper == mpStepper ) // sanity check
+ {
+ sal_Int32 nPage = [pStepper intValue];
+ [mpPageEdit setIntValue: nPage];
+ updatePreviewImage( nPage-1 );
+ }
+ }
+ }
+};
+
+static void filterAccelerator( rtl::OUString& io_rText )
+{
+ rtl::OUStringBuffer aBuf( io_rText.getLength() );
+ for( sal_Int32 nIndex = 0; nIndex != -1; )
+ aBuf.append( io_rText.getToken( 0, '~', nIndex ) );
+ io_rText = aBuf.makeStringAndClear();
+}
+
+@implementation ControlTarget
+-(id)initWithControllerMap: (ControllerProperties*)pController
+{
+ if( (self = [super init]) )
+ {
+ mpController = pController;
+ }
+ return self;
+}
+-(void)triggered:(id)pSender;
+{
+ if( [pSender isMemberOfClass: [NSPopUpButton class]] )
+ {
+ NSPopUpButton* pBtn = (NSPopUpButton*)pSender;
+ NSMenuItem* pSelected = [pBtn selectedItem];
+ if( pSelected )
+ {
+ int nTag = [pSelected tag];
+ mpController->changePropertyWithIntValue( nTag );
+ }
+ }
+ else if( [pSender isMemberOfClass: [NSButton class]] )
+ {
+ NSButton* pBtn = (NSButton*)pSender;
+ int nTag = [pBtn tag];
+ mpController->changePropertyWithBoolValue( nTag, [pBtn state] == NSOnState );
+ }
+ else if( [pSender isMemberOfClass: [NSMatrix class]] )
+ {
+ NSObject* pObj = [(NSMatrix*)pSender selectedCell];
+ if( [pObj isMemberOfClass: [NSButtonCell class]] )
+ {
+ NSButtonCell* pCell = (NSButtonCell*)pObj;
+ int nTag = [pCell tag];
+ mpController->changePropertyWithIntValue( nTag );
+ }
+ }
+ else if( [pSender isMemberOfClass: [NSTextField class]] )
+ {
+ NSTextField* pField = (NSTextField*)pSender;
+ int nTag = [pField tag];
+ rtl::OUString aValue = GetOUString( [pSender stringValue] );
+ mpController->changePropertyWithStringValue( nTag, aValue );
+ }
+ else
+ {
+ DBG_ERROR( "unsupported class" );
+ }
+ mpController->updateEnableState();
+}
+-(void)triggeredNumeric:(id)pSender;
+{
+ if( [pSender isMemberOfClass: [NSTextField class]] )
+ {
+ NSTextField* pField = (NSTextField*)pSender;
+ int nTag = [pField tag];
+ sal_Int64 nValue = [pField intValue];
+
+ NSView* pOther = mpController->getPair( pField );
+ if( pOther )
+ [(NSControl*)pOther setIntValue: nValue];
+
+ mpController->changePropertyWithIntValue( nTag, nValue );
+ }
+ else if( [pSender isMemberOfClass: [NSStepper class]] )
+ {
+ NSStepper* pStep = (NSStepper*)pSender;
+ int nTag = [pStep tag];
+ sal_Int64 nValue = [pStep intValue];
+
+ NSView* pOther = mpController->getPair( pStep );
+ if( pOther )
+ [(NSControl*)pOther setIntValue: nValue];
+
+ mpController->changePropertyWithIntValue( nTag, nValue );
+ }
+ else
+ {
+ DBG_ERROR( "unsupported class" );
+ }
+ mpController->updateEnableState();
+}
+-(void)triggeredPreview:(id)pSender
+{
+ mpController->changePreview( pSender );
+}
+-(void)dealloc
+{
+ delete mpController;
+ [super dealloc];
+}
+@end
+
+struct ColumnItem
+{
+ NSControl* pControl;
+ long nOffset;
+ NSControl* pSubControl;
+
+ ColumnItem( NSControl* i_pControl = nil, long i_nOffset = 0, NSControl* i_pSub = nil )
+ : pControl( i_pControl )
+ , nOffset( i_nOffset )
+ , pSubControl( i_pSub )
+ {}
+
+ long getWidth() const
+ {
+ long nWidth = 0;
+ if( pControl )
+ {
+ NSRect aCtrlRect = [pControl frame];
+ nWidth = aCtrlRect.size.width;
+ nWidth += nOffset;
+ if( pSubControl )
+ {
+ NSRect aSubRect = [pSubControl frame];
+ nWidth += aSubRect.size.width;
+ nWidth += aSubRect.origin.x - (aCtrlRect.origin.x + aCtrlRect.size.width);
+ }
+ }
+ return nWidth;
+ }
+};
+
+static void adjustViewAndChildren( NSView* pView, NSSize& rMaxSize,
+ std::vector< ColumnItem >& rLeftColumn,
+ std::vector< ColumnItem >& rRightColumn
+ )
+{
+ // balance columns
+
+ // first get overall column widths
+ long nLeftWidth = 0;
+ long nRightWidth = 0;
+ for( size_t i = 0; i < rLeftColumn.size(); i++ )
+ {
+ long nW = rLeftColumn[i].getWidth();
+ if( nW > nLeftWidth )
+ nLeftWidth = nW;
+ }
+ for( size_t i = 0; i < rRightColumn.size(); i++ )
+ {
+ long nW = rRightColumn[i].getWidth();
+ if( nW > nRightWidth )
+ nRightWidth = nW;
+ }
+
+ // right align left column
+ for( size_t i = 0; i < rLeftColumn.size(); i++ )
+ {
+ if( rLeftColumn[i].pControl )
+ {
+ NSRect aCtrlRect = [rLeftColumn[i].pControl frame];
+ long nX = nLeftWidth - aCtrlRect.size.width;
+ if( rLeftColumn[i].pSubControl )
+ {
+ NSRect aSubRect = [rLeftColumn[i].pSubControl frame];
+ nX -= aSubRect.size.width + (aSubRect.origin.x - (aCtrlRect.origin.x + aCtrlRect.size.width));
+ aSubRect.origin.x = nLeftWidth - aSubRect.size.width;
+ [rLeftColumn[i].pSubControl setFrame: aSubRect];
+ }
+ aCtrlRect.origin.x = nX;
+ [rLeftColumn[i].pControl setFrame: aCtrlRect];
+ }
+ }
+
+ // left align right column
+ for( size_t i = 0; i < rRightColumn.size(); i++ )
+ {
+ if( rRightColumn[i].pControl )
+ {
+ NSRect aCtrlRect = [rRightColumn[i].pControl frame];
+ long nX = nLeftWidth + 3;
+ if( rRightColumn[i].pSubControl )
+ {
+ NSRect aSubRect = [rRightColumn[i].pSubControl frame];
+ aSubRect.origin.x = nX + aSubRect.origin.x - aCtrlRect.origin.x;
+ [rRightColumn[i].pSubControl setFrame: aSubRect];
+ }
+ aCtrlRect.origin.x = nX;
+ [rRightColumn[i].pControl setFrame: aCtrlRect];
+ }
+ }
+
+ NSArray* pSubViews = [pView subviews];
+ unsigned int nViews = [pSubViews count];
+ NSRect aUnion = { { 0, 0 }, { 0, 0 } };
+
+ // get the combined frame of all subviews
+ for( unsigned int n = 0; n < nViews; n++ )
+ {
+ aUnion = NSUnionRect( aUnion, [[pSubViews objectAtIndex: n] frame] );
+ }
+
+ // move everything so it will fit
+ for( unsigned int n = 0; n < nViews; n++ )
+ {
+ NSView* pCurSubView = [pSubViews objectAtIndex: n];
+ NSRect aFrame = [pCurSubView frame];
+ aFrame.origin.x -= aUnion.origin.x - 5;
+ aFrame.origin.y -= aUnion.origin.y - 5;
+ [pCurSubView setFrame: aFrame];
+ }
+
+ // resize the view itself
+ aUnion.size.height += 10;
+ aUnion.size.width += 20;
+ [pView setFrameSize: aUnion.size];
+
+ if( aUnion.size.width > rMaxSize.width )
+ rMaxSize.width = aUnion.size.width;
+ if( aUnion.size.height > rMaxSize.height )
+ rMaxSize.height = aUnion.size.height;
+}
+
+static void adjustTabViews( NSTabView* pTabView, NSSize aTabSize )
+{
+ // loop over all contained tab pages
+ NSArray* pTabbedViews = [pTabView tabViewItems];
+ int nViews = [pTabbedViews count];
+ for( int i = 0; i < nViews; i++ )
+ {
+ NSTabViewItem* pItem = (NSTabViewItem*)[pTabbedViews objectAtIndex: i];
+ NSView* pView = [pItem view];
+ if( pView )
+ {
+ NSRect aRect = [pView frame];
+ double nDiff = aTabSize.height - aRect.size.height;
+ aRect.size = aTabSize;
+ [pView setFrame: aRect];
+
+ NSArray* pSubViews = [pView subviews];
+ unsigned int nSubViews = [pSubViews count];
+
+ // move everything up
+ for( unsigned int n = 0; n < nSubViews; n++ )
+ {
+ NSView* pCurSubView = [pSubViews objectAtIndex: n];
+ NSRect aFrame = [pCurSubView frame];
+ aFrame.origin.y += nDiff;
+ // give separators the correct width
+ // separators are currently the only NSBoxes we use
+ if( [pCurSubView isMemberOfClass: [NSBox class]] )
+ {
+ aFrame.size.width = aTabSize.width - aFrame.origin.x - 10;
+ }
+ [pCurSubView setFrame: aFrame];
+ }
+ }
+ }
+}
+
+static NSControl* createLabel( const rtl::OUString& i_rText )
+{
+ NSString* pText = CreateNSString( i_rText );
+ NSRect aTextRect = { { 0, 0 }, {20, 15} };
+ NSTextField* pTextView = [[NSTextField alloc] initWithFrame: aTextRect];
+ [pTextView setFont: [NSFont controlContentFontOfSize: 0]];
+ [pTextView setEditable: NO];
+ [pTextView setSelectable: NO];
+ [pTextView setDrawsBackground: NO];
+ [pTextView setBordered: NO];
+ [pTextView setStringValue: pText];
+ [pTextView sizeToFit];
+ [pText release];
+ return pTextView;
+}
+
+static sal_Int32 findBreak( const rtl::OUString& i_rText, sal_Int32 i_nPos )
+{
+ sal_Int32 nRet = i_rText.getLength();
+ Reference< i18n::XBreakIterator > xBI( vcl::unohelper::CreateBreakIterator() );
+ if( xBI.is() )
+ {
+ i18n::Boundary aBoundary = xBI->getWordBoundary( i_rText, i_nPos,
+ Application::GetSettings().GetLocale(),
+ i18n::WordType::ANYWORD_IGNOREWHITESPACES,
+ sal_True );
+ nRet = aBoundary.endPos;
+ }
+ return nRet;
+}
+
+static void linebreakCell( NSCell* pBtn, const rtl::OUString& i_rText )
+{
+ NSString* pText = CreateNSString( i_rText );
+ [pBtn setTitle: pText];
+ [pText release];
+ NSSize aSize = [pBtn cellSize];
+ if( aSize.width > 280 )
+ {
+ // need two lines
+ sal_Int32 nLen = i_rText.getLength();
+ sal_Int32 nIndex = nLen / 2;
+ nIndex = findBreak( i_rText, nIndex );
+ if( nIndex < nLen )
+ {
+ rtl::OUStringBuffer aBuf( i_rText );
+ aBuf.setCharAt( nIndex, '\n' );
+ pText = CreateNSString( aBuf.makeStringAndClear() );
+ [pBtn setTitle: pText];
+ [pText release];
+ }
+ }
+}
+
+
+@implementation AquaPrintAccessoryView
++(NSObject*)setupPrinterPanel: (NSPrintOperation*)pOp withController: (vcl::PrinterController*)pController withState: (PrintAccessoryViewState*)pState;
+{
+ const Sequence< PropertyValue >& rOptions( pController->getUIOptions() );
+ if( rOptions.getLength() == 0 )
+ return nil;
+
+ NSView* pCurParent = 0;
+ long nCurY = 0;
+ long nCurX = 0;
+ NSRect aViewFrame = { { 0, 0 }, {600, 400 } };
+ NSRect aTabViewFrame = { { 190, 0 }, {410, 400 } };
+ NSSize aMaxTabSize = { 0, 0 };
+ NSView* pAccessoryView = [[NSView alloc] initWithFrame: aViewFrame];
+ NSTabView* pTabView = [[NSTabView alloc] initWithFrame: aTabViewFrame];
+ [pAccessoryView addSubview: [pTabView autorelease]];
+
+ sal_Bool bIgnoreSubgroup = sal_False;
+
+ ControllerProperties* pControllerProperties = new ControllerProperties( pController, pOp, pAccessoryView, pTabView, pState );
+ ControlTarget* pCtrlTarget = [[ControlTarget alloc] initWithControllerMap: pControllerProperties];
+
+ std::vector< ColumnItem > aLeftColumn, aRightColumn;
+
+ for( int i = 0; i < rOptions.getLength(); i++ )
+ {
+ Sequence< beans::PropertyValue > aOptProp;
+ rOptions[i].Value >>= aOptProp;
+
+ // extract ui element
+ bool bEnabled = true;
+ rtl::OUString aCtrlType;
+ rtl::OUString aText;
+ rtl::OUString aPropertyName;
+ Sequence< rtl::OUString > aChoices;
+ sal_Int64 nMinValue = 0, nMaxValue = 0;
+ long nAttachOffset = 0;
+ sal_Bool bIgnore = sal_False;
+
+ for( int n = 0; n < aOptProp.getLength(); n++ )
+ {
+ const beans::PropertyValue& rEntry( aOptProp[ n ] );
+ if( rEntry.Name.equalsAscii( "Text" ) )
+ {
+ rEntry.Value >>= aText;
+ filterAccelerator( aText );
+ }
+ else if( rEntry.Name.equalsAscii( "ControlType" ) )
+ {
+ rEntry.Value >>= aCtrlType;
+ }
+ else if( rEntry.Name.equalsAscii( "Choices" ) )
+ {
+ rEntry.Value >>= aChoices;
+ }
+ else if( rEntry.Name.equalsAscii( "Property" ) )
+ {
+ PropertyValue aVal;
+ rEntry.Value >>= aVal;
+ aPropertyName = aVal.Name;
+ }
+ else if( rEntry.Name.equalsAscii( "Enabled" ) )
+ {
+ sal_Bool bValue = sal_True;
+ rEntry.Value >>= bValue;
+ bEnabled = bValue;
+ }
+ else if( rEntry.Name.equalsAscii( "MinValue" ) )
+ {
+ rEntry.Value >>= nMinValue;
+ }
+ else if( rEntry.Name.equalsAscii( "MaxValue" ) )
+ {
+ rEntry.Value >>= nMaxValue;
+ }
+ else if( rEntry.Name.equalsAscii( "AttachToDependency" ) )
+ {
+ nAttachOffset = 20;
+ }
+ else if( rEntry.Name.equalsAscii( "InternalUIOnly" ) )
+ {
+ rEntry.Value >>= bIgnore;
+ }
+ }
+
+ if( aCtrlType.equalsAscii( "Group" ) ||
+ aCtrlType.equalsAscii( "Subgroup" ) ||
+ aCtrlType.equalsAscii( "Radio" ) ||
+ aCtrlType.equalsAscii( "List" ) ||
+ aCtrlType.equalsAscii( "Edit" ) ||
+ aCtrlType.equalsAscii( "Range" ) ||
+ aCtrlType.equalsAscii( "Bool" ) )
+ {
+ // since our build target is MacOSX 10.4 we can have only one accessory view
+ // so we have a single accessory view that is tabbed for grouping
+ if( aCtrlType.equalsAscii( "Group" )
+ || ! pCurParent
+ || ( aCtrlType.equalsAscii( "Subgroup" ) && nCurY < -250 && ! bIgnore )
+ )
+ {
+ rtl::OUString aGroupTitle( aText );
+ if( aCtrlType.equalsAscii( "Subgroup" ) )
+ aGroupTitle = pControllerProperties->getMoreString();
+ // set size of current parent
+ if( pCurParent )
+ adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn );
+
+ // new tab item
+ if( ! aText.getLength() )
+ aText = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OOo" ) );
+ NSString* pLabel = CreateNSString( aGroupTitle );
+ NSTabViewItem* pItem = [[NSTabViewItem alloc] initWithIdentifier: pLabel ];
+ [pItem setLabel: pLabel];
+ [pTabView addTabViewItem: pItem];
+ pCurParent = [[NSView alloc] initWithFrame: aTabViewFrame];
+ [pItem setView: pCurParent];
+ [pLabel release];
+
+ // reset indent
+ nCurX = 20;
+ // reset Y
+ nCurY = 0;
+ // clear columns
+ aLeftColumn.clear();
+ aRightColumn.clear();
+ }
+
+ if( aCtrlType.equalsAscii( "Subgroup" ) && pCurParent )
+ {
+ bIgnoreSubgroup = bIgnore;
+ if( bIgnore )
+ continue;
+
+ NSControl* pTextView = createLabel( aText );
+ [pCurParent addSubview: [pTextView autorelease]];
+ NSRect aTextRect = [pTextView frame];
+ // move to nCurY
+ aTextRect.origin.y = nCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ NSRect aSepRect = { { aTextRect.size.width + 1, aTextRect.origin.y }, { 100, 6 } };
+ NSBox* pBox = [[NSBox alloc] initWithFrame: aSepRect];
+ [pBox setBoxType: NSBoxSeparator];
+ [pCurParent addSubview: [pBox autorelease]];
+
+ // update nCurY
+ nCurY = aTextRect.origin.y - 5;
+ }
+ else if( bIgnoreSubgroup || bIgnore )
+ continue;
+ else if( aCtrlType.equalsAscii( "Bool" ) && pCurParent )
+ {
+ NSRect aCheckRect = { { nCurX + nAttachOffset, 0 }, { 0, 15 } };
+ NSButton* pBtn = [[NSButton alloc] initWithFrame: aCheckRect];
+ [pBtn setButtonType: NSSwitchButton];
+ sal_Bool bVal = sal_False;
+ PropertyValue* pVal = pController->getValue( aPropertyName );
+ if( pVal )
+ pVal->Value >>= bVal;
+ [pBtn setState: bVal ? NSOnState : NSOffState];
+ linebreakCell( [pBtn cell], aText );
+ [pBtn sizeToFit];
+ [pCurParent addSubview: [pBtn autorelease]];
+
+ aRightColumn.push_back( ColumnItem( pBtn ) );
+
+ // connect target
+ [pBtn setTarget: pCtrlTarget];
+ [pBtn setAction: @selector(triggered:)];
+ int nTag = pControllerProperties->addNameTag( aPropertyName );
+ pControllerProperties->addObservedControl( pBtn );
+ [pBtn setTag: nTag];
+
+ aCheckRect = [pBtn frame];
+
+ // move to nCurY
+ aCheckRect.origin.y = nCurY - aCheckRect.size.height;
+ [pBtn setFrame: aCheckRect];
+
+ // update nCurY
+ nCurY = aCheckRect.origin.y - 5;
+ }
+ else if( aCtrlType.equalsAscii( "Radio" ) && pCurParent )
+ {
+ sal_Int32 nOff = 0;
+ if( aText.getLength() )
+ {
+ // add a label
+ NSControl* pTextView = createLabel( aText );
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = nCurX + nAttachOffset;
+ [pCurParent addSubview: [pTextView autorelease]];
+
+ aLeftColumn.push_back( ColumnItem( pTextView ) );
+
+ // move to nCurY
+ aTextRect.origin.y = nCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ nCurY = aTextRect.origin.y - 5;
+
+ // indent the radio group relative to the text
+ // nOff = 20;
+ }
+
+ // setup radio matrix
+ NSButtonCell* pProto = [[NSButtonCell alloc] init];
+
+ NSRect aRadioRect = { { nCurX + nOff, 0 }, { 280 - nCurX, 5*aChoices.getLength() } };
+ [pProto setTitle: @"RadioButtonGroup"];
+ [pProto setButtonType: NSRadioButton];
+ NSMatrix* pMatrix = [[NSMatrix alloc] initWithFrame: aRadioRect
+ mode: NSRadioModeMatrix
+ prototype: (NSCell*)pProto
+ numberOfRows: aChoices.getLength()
+ numberOfColumns: 1];
+ // get currently selected value
+ sal_Int32 nSelectVal = 0;
+ PropertyValue* pVal = pController->getValue( aPropertyName );
+ if( pVal && pVal->Value.hasValue() )
+ pVal->Value >>= nSelectVal;
+ // set individual titles
+ NSArray* pCells = [pMatrix cells];
+ for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
+ {
+ NSCell* pCell = [pCells objectAtIndex: m];
+ filterAccelerator( aChoices[m] );
+ linebreakCell( pCell, aChoices[m] );
+ //NSString* pTitle = CreateNSString( aChoices[m] );
+ //[pCell setTitle: pTitle];
+ // connect target and action
+ [pCell setTarget: pCtrlTarget];
+ [pCell setAction: @selector(triggered:)];
+ int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m );
+ pControllerProperties->addObservedControl( pCell );
+ [pCell setTag: nTag];
+ //[pTitle release];
+ // set current selection
+ if( nSelectVal == m )
+ [pMatrix selectCellAtRow: m column: 0];
+ }
+ [pMatrix sizeToFit];
+ aRadioRect = [pMatrix frame];
+
+ // move it down, so it comes to the correct position
+ aRadioRect.origin.y = nCurY - aRadioRect.size.height;
+ [pMatrix setFrame: aRadioRect];
+ [pCurParent addSubview: [pMatrix autorelease]];
+
+ aRightColumn.push_back( ColumnItem( pMatrix ) );
+
+ // update nCurY
+ nCurY = aRadioRect.origin.y - 5;
+
+ [pProto release];
+ }
+ else if( aCtrlType.equalsAscii( "List" ) && pCurParent )
+ {
+ // don't indent attached lists, looks bad in the existing cases
+ NSControl* pTextView = createLabel( aText );
+ [pCurParent addSubview: [pTextView autorelease]];
+ aLeftColumn.push_back( ColumnItem( pTextView ) );
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = nCurX /* + nAttachOffset*/;
+
+ // don't indent attached lists, looks bad in the existing cases
+ NSRect aBtnRect = { { nCurX /*+ nAttachOffset*/ + aTextRect.size.width, 0 }, { 0, 15 } };
+ NSPopUpButton* pBtn = [[NSPopUpButton alloc] initWithFrame: aBtnRect pullsDown: NO];
+
+ // iterate options
+ for( sal_Int32 m = 0; m < aChoices.getLength(); m++ )
+ {
+ NSString* pItemText = CreateNSString( aChoices[m] );
+ [pBtn addItemWithTitle: pItemText];
+ NSMenuItem* pItem = [pBtn itemWithTitle: pItemText];
+ int nTag = pControllerProperties->addNameAndValueTag( aPropertyName, m );
+ [pItem setTag: nTag];
+ [pItemText release];
+ }
+
+ PropertyValue* pVal = pController->getValue( aPropertyName );
+ sal_Int32 aSelectVal = 0;
+ if( pVal && pVal->Value.hasValue() )
+ pVal->Value >>= aSelectVal;
+ [pBtn selectItemAtIndex: aSelectVal];
+
+ // add the button to observed controls for enabled state changes
+ // also add a tag just for this purpose
+ pControllerProperties->addObservedControl( pBtn );
+ [pBtn setTag: pControllerProperties->addNameTag( aPropertyName )];
+
+ [pBtn sizeToFit];
+ [pCurParent addSubview: [pBtn autorelease]];
+
+ aRightColumn.push_back( ColumnItem( pBtn ) );
+
+ // connect target and action
+ [pBtn setTarget: pCtrlTarget];
+ [pBtn setAction: @selector(triggered:)];
+
+ // move to nCurY
+ aBtnRect = [pBtn frame];
+ aBtnRect.origin.y = nCurY - aBtnRect.size.height;
+ [pBtn setFrame: aBtnRect];
+
+ // align label
+ aTextRect.origin.y = aBtnRect.origin.y + (aBtnRect.size.height - aTextRect.size.height)/2;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ nCurY = aBtnRect.origin.y - 5;
+ }
+ else if( (aCtrlType.equalsAscii( "Edit" ) || aCtrlType.equalsAscii( "Range" )) && pCurParent )
+ {
+ sal_Int32 nOff = 0;
+ if( aText.getLength() )
+ {
+ // add a label
+ NSControl* pTextView = createLabel( aText );
+ [pCurParent addSubview: [pTextView autorelease]];
+
+ aLeftColumn.push_back( ColumnItem( pTextView ) );
+
+ // move to nCurY
+ NSRect aTextRect = [pTextView frame];
+ aTextRect.origin.x = nCurX + nAttachOffset;
+ aTextRect.origin.y = nCurY - aTextRect.size.height;
+ [pTextView setFrame: aTextRect];
+
+ // update nCurY
+ nCurY = aTextRect.origin.y - 5;
+
+ // and set the offset for the real edit field
+ nOff = aTextRect.size.width + 5;
+ }
+
+ NSRect aFieldRect = { { nCurX + nOff + nAttachOffset, 0 }, { 100, 25 } };
+ NSTextField* pFieldView = [[NSTextField alloc] initWithFrame: aFieldRect];
+ [pFieldView setEditable: YES];
+ [pFieldView setSelectable: YES];
+ [pFieldView setDrawsBackground: YES];
+ [pFieldView sizeToFit]; // FIXME: this does nothing
+ [pCurParent addSubview: [pFieldView autorelease]];
+
+ aRightColumn.push_back( ColumnItem( pFieldView ) );
+
+ // add the field to observed controls for enabled state changes
+ // also add a tag just for this purpose
+ pControllerProperties->addObservedControl( pFieldView );
+ int nTag = pControllerProperties->addNameTag( aPropertyName );
+ [pFieldView setTag: nTag];
+ // pControllerProperties->addNamedView( pFieldView, aPropertyName );
+
+ // move to nCurY
+ aFieldRect.origin.y = nCurY - aFieldRect.size.height;
+ [pFieldView setFrame: aFieldRect];
+
+ // current value
+ PropertyValue* pVal = pController->getValue( aPropertyName );
+ if( aCtrlType.equalsAscii( "Range" ) )
+ {
+ // add a stepper control
+ NSRect aStepFrame = { { aFieldRect.origin.x + aFieldRect.size.width + 5,
+ aFieldRect.origin.y },
+ { 15, aFieldRect.size.height } };
+ NSStepper* pStep = [[NSStepper alloc] initWithFrame: aStepFrame];
+ [pStep setIncrement: 1];
+ [pStep setValueWraps: NO];
+ [pStep setTag: nTag];
+ [pCurParent addSubview: [pStep autorelease]];
+
+ aRightColumn.back().pSubControl = pStep;
+
+ pControllerProperties->addObservedControl( pStep );
+ [pStep setTarget: pCtrlTarget];
+ [pStep setAction: @selector(triggered:)];
+
+ // constrain the text field to decimal numbers
+ NSNumberFormatter* pFormatter = [[NSNumberFormatter alloc] init];
+ [pFormatter setFormatterBehavior: NSNumberFormatterBehavior10_4];
+ [pFormatter setNumberStyle: NSNumberFormatterDecimalStyle];
+ [pFormatter setAllowsFloats: NO];
+ [pFormatter setMaximumFractionDigits: 0];
+ if( nMinValue != nMaxValue )
+ {
+ [pFormatter setMinimum: [[NSNumber numberWithInt: nMinValue] autorelease]];
+ [pStep setMinValue: nMinValue];
+ [pFormatter setMaximum: [[NSNumber numberWithInt: nMaxValue] autorelease]];
+ [pStep setMaxValue: nMaxValue];
+ }
+ [pFieldView setFormatter: pFormatter];
+
+ sal_Int64 nSelectVal = 0;
+ if( pVal && pVal->Value.hasValue() )
+ pVal->Value >>= nSelectVal;
+
+ [pFieldView setIntValue: nSelectVal];
+ [pStep setIntValue: nSelectVal];
+
+ pControllerProperties->addViewPair( pFieldView, pStep );
+ // connect target and action
+ [pFieldView setTarget: pCtrlTarget];
+ [pFieldView setAction: @selector(triggeredNumeric:)];
+ [pStep setTarget: pCtrlTarget];
+ [pStep setAction: @selector(triggeredNumeric:)];
+ }
+ else
+ {
+ // connect target and action
+ [pFieldView setTarget: pCtrlTarget];
+ [pFieldView setAction: @selector(triggered:)];
+
+ if( pVal && pVal->Value.hasValue() )
+ {
+ rtl::OUString aValue;
+ pVal->Value >>= aValue;
+ if( aValue.getLength() )
+ {
+ NSString* pText = CreateNSString( aValue );
+ [pFieldView setStringValue: pText];
+ [pText release];
+ }
+ }
+ }
+
+ // update nCurY
+ nCurY = aFieldRect.origin.y - 5;
+
+ }
+ }
+ else
+ {
+ DBG_ERROR( "Unsupported UI option" );
+ }
+ }
+
+ pControllerProperties->updateEnableState();
+ adjustViewAndChildren( pCurParent, aMaxTabSize, aLeftColumn, aRightColumn );
+
+ // leave some space for the preview
+ if( aMaxTabSize.height < 200 )
+ aMaxTabSize.height = 200;
+
+ // now reposition everything again so it is upper bound
+ adjustTabViews( pTabView, aMaxTabSize );
+
+ // find the minimum needed tab size
+ NSSize aTabCtrlSize = [pTabView minimumSize];
+ aTabCtrlSize.height += aMaxTabSize.height + 10;
+ if( aTabCtrlSize.width < aMaxTabSize.width + 10 )
+ aTabCtrlSize.width = aMaxTabSize.width + 10;
+ [pTabView setFrameSize: aTabCtrlSize];
+ aViewFrame.size.width = aTabCtrlSize.width + aTabViewFrame.origin.x;
+ aViewFrame.size.height = aTabCtrlSize.height + aTabViewFrame.origin.y;
+ [pAccessoryView setFrameSize: aViewFrame.size];
+
+ pControllerProperties->setupPreview( pCtrlTarget );
+
+ // set the accessory view
+ [pOp setAccessoryView: [pAccessoryView autorelease]];
+
+ // set the current selecte tab item
+ if( pState->nLastPage >= 0 && pState->nLastPage < [pTabView numberOfTabViewItems] )
+ [pTabView selectTabViewItemAtIndex: pState->nLastPage];
+
+ return pCtrlTarget;
+}
+
+@end
diff --git a/vcl/aqua/source/gdi/aquaprintview.mm b/vcl/aqua/source/gdi/aquaprintview.mm
index ba139da5f5a4..870b7cbab6f0 100755
--- a/vcl/aqua/source/gdi/aquaprintview.mm
+++ b/vcl/aqua/source/gdi/aquaprintview.mm
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: aquaprintview.mm,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.56.1 $
*
* This file is part of OpenOffice.org.
*
@@ -33,15 +33,15 @@
#include "aquaprintview.h"
#include "salprn.h"
-#include "vcl/impprn.hxx"
+#include "vcl/print.hxx"
@implementation AquaPrintView
--(id)initWithQPrinter: (ImplQPrinter*)pPrinter withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter
+-(id)initWithController: (vcl::PrinterController*)pController withInfoPrinter: (AquaSalInfoPrinter*)pInfoPrinter
{
NSRect aRect = { { 0, 0 }, [pInfoPrinter->getPrintInfo() paperSize] };
if( (self = [super initWithFrame: aRect]) != nil )
{
- mpQPrinter = pPrinter;
+ mpController = pController;
mpInfoPrinter = pInfoPrinter;
}
return self;
@@ -79,6 +79,7 @@
int nPage = (int)(aPaperSize.width * rect.origin.y + rect.origin.x);
// page count is 1 based
- mpQPrinter->PrintPage( nPage-1 + mpInfoPrinter->getCurPageRangeStart() );
+ if( nPage - 1 < (mpInfoPrinter->getCurPageRangeStart() + mpInfoPrinter->getCurPageRangeCount() ) )
+ mpController->printFilteredPage( nPage-1 );
}
@end
diff --git a/vcl/aqua/source/gdi/makefile.mk b/vcl/aqua/source/gdi/makefile.mk
index deb6832a5525..90b5e55b82db 100644
--- a/vcl/aqua/source/gdi/makefile.mk
+++ b/vcl/aqua/source/gdi/makefile.mk
@@ -62,6 +62,7 @@ SLOFILES= $(SLO)$/salmathutils.obj \
$(SLO)$/salvd.obj \
$(SLO)$/salprn.obj \
$(SLO)$/aquaprintview.obj \
+ $(SLO)$/aquaprintaccessoryview.obj \
$(SLO)$/salbmp.obj
.IF "$(ENABLE_CAIRO)" == "TRUE"
diff --git a/vcl/aqua/source/gdi/salgdi.cxx b/vcl/aqua/source/gdi/salgdi.cxx
index 263a5b6e6803..dedae3ac7cfc 100644
--- a/vcl/aqua/source/gdi/salgdi.cxx
+++ b/vcl/aqua/source/gdi/salgdi.cxx
@@ -604,7 +604,8 @@ void AquaSalGraphics::EndSetClipRegion()
void AquaSalGraphics::SetLineColor()
{
maLineColor.SetAlpha( 0.0 ); // transparent
- CGContextSetStrokeColor( mrContext, maLineColor.AsArray() );
+ if( CheckContext() )
+ CGContextSetStrokeColor( mrContext, maLineColor.AsArray() );
}
// -----------------------------------------------------------------------
@@ -612,7 +613,8 @@ void AquaSalGraphics::SetLineColor()
void AquaSalGraphics::SetLineColor( SalColor nSalColor )
{
maLineColor = RGBAColor( nSalColor );
- CGContextSetStrokeColor( mrContext, maLineColor.AsArray() );
+ if( CheckContext() )
+ CGContextSetStrokeColor( mrContext, maLineColor.AsArray() );
}
// -----------------------------------------------------------------------
@@ -620,7 +622,8 @@ void AquaSalGraphics::SetLineColor( SalColor nSalColor )
void AquaSalGraphics::SetFillColor()
{
maFillColor.SetAlpha( 0.0 ); // transparent
- CGContextSetFillColor( mrContext, maFillColor.AsArray() );
+ if( CheckContext() )
+ CGContextSetFillColor( mrContext, maFillColor.AsArray() );
}
// -----------------------------------------------------------------------
@@ -628,7 +631,8 @@ void AquaSalGraphics::SetFillColor()
void AquaSalGraphics::SetFillColor( SalColor nSalColor )
{
maFillColor = RGBAColor( nSalColor );
- CGContextSetFillColor( mrContext, maFillColor.AsArray() );
+ if( CheckContext() )
+ CGContextSetFillColor( mrContext, maFillColor.AsArray() );
}
// -----------------------------------------------------------------------
diff --git a/vcl/aqua/source/gdi/salgdiutils.cxx b/vcl/aqua/source/gdi/salgdiutils.cxx
index 99a1629006d2..6df50f79e9d0 100755
--- a/vcl/aqua/source/gdi/salgdiutils.cxx
+++ b/vcl/aqua/source/gdi/salgdiutils.cxx
@@ -68,6 +68,13 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, lon
mnRealDPIX = nDPIX;
mnRealDPIY = nDPIY;
+ // a previously set clip path is now invalid
+ if( mxClipPath )
+ {
+ CGPathRelease( mxClipPath );
+ mxClipPath = NULL;
+ }
+
if( mrContext )
{
CGContextSetFillColorSpace( mrContext, GetSalData()->mxRGBSpace );
@@ -126,6 +133,28 @@ void AquaSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContex
// ----------------------------------------------------------------------
+void AquaSalGraphics::InvalidateContext()
+{
+ UnsetState();
+ mrContext = 0;
+}
+
+// ----------------------------------------------------------------------
+
+void AquaSalGraphics::UnsetState()
+{
+ if( mrContext )
+ {
+ CGContextRestoreGState( mrContext );
+ mrContext = 0;
+ }
+ if( mxClipPath )
+ {
+ CGPathRelease( mxClipPath );
+ mxClipPath = NULL;
+ }
+}
+
void AquaSalGraphics::SetState()
{
CGContextRestoreGState( mrContext );
@@ -134,9 +163,9 @@ void AquaSalGraphics::SetState()
// setup clipping
if( mxClipPath )
{
- CGContextBeginPath( mrContext ); // discard any existing path
+ CGContextBeginPath( mrContext ); // discard any existing path
CGContextAddPath( mrContext, mxClipPath ); // set the current path to the clipping path
- CGContextClip( mrContext ); // use it for clipping
+ CGContextClip( mrContext ); // use it for clipping
}
// set RGB colorspace and line and fill colors
@@ -205,7 +234,7 @@ bool AquaSalGraphics::CheckContext()
CGContextRelease( rReleaseContext );
}
- DBG_ASSERT( mrContext, "<<<WARNING>>> AquaSalGraphics::CheckContext() FAILED!!!!\n" );
+ DBG_ASSERT( mrContext || mbPrinter, "<<<WARNING>>> AquaSalGraphics::CheckContext() FAILED!!!!\n" );
return (mrContext != NULL);
}
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 754358823a93..1536299331cb 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -450,6 +450,15 @@ UInt32 AquaSalGraphics::getState( ControlState nState )
return kThemeStateActive;
}
+UInt32 AquaSalGraphics::getTrackState( ControlState nState )
+{
+ bool bDrawActive = mpFrame ? ([mpFrame->getWindow() isKeyWindow] ? true : false) : true;
+ if( (nState & CTRL_STATE_ENABLED) == 0 || ! bDrawActive )
+ return kThemeTrackInactive;
+
+ return kThemeTrackActive;
+}
+
/*
* DrawNativeControl()
*
@@ -767,7 +776,10 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
aTrackInfo.attributes = kThemeTrackHorizontal;
if( Application::GetSettings().GetLayoutRTL() )
aTrackInfo.attributes |= kThemeTrackRightToLeft;
- aTrackInfo.enableState = (nState & CTRL_STATE_ENABLED) ? kThemeTrackActive : kThemeTrackInactive;
+ aTrackInfo.enableState = getTrackState( nState );
+ // the intro bitmap never gets key anyway; we want to draw that enabled
+ if( nType == CTRL_INTROPROGRESS )
+ aTrackInfo.enableState = kThemeTrackActive;
aTrackInfo.filler1 = 0;
aTrackInfo.trackInfo.progress.phase = static_cast<UInt8>(CFAbsoluteTimeGetCurrent()*10.0);
@@ -799,7 +811,7 @@ BOOL AquaSalGraphics::drawNativeControl(ControlType nType,
aTrackDraw.attributes = kThemeTrackShowThumb;
if( nPart == PART_DRAW_BACKGROUND_HORZ )
aTrackDraw.attributes |= kThemeTrackHorizontal;
- aTrackDraw.enableState = kThemeTrackActive;
+ aTrackDraw.enableState = getTrackState( nState );
ScrollBarTrackInfo aScrollInfo;
aScrollInfo.viewsize = pScrollbarVal->mnVisibleSize;
diff --git a/vcl/aqua/source/gdi/salprn.cxx b/vcl/aqua/source/gdi/salprn.cxx
index b9a1f4ef7748..47c027a033aa 100644
--- a/vcl/aqua/source/gdi/salprn.cxx
+++ b/vcl/aqua/source/gdi/salprn.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: salprn.cxx,v $
- * $Revision: 1.16 $
+ * $Revision: 1.16.56.2 $
*
* This file is part of OpenOffice.org.
*
@@ -38,7 +38,6 @@
#include "saldata.hxx"
#include "vcl/jobset.h"
#include "vcl/salptype.hxx"
-#include "vcl/impprn.hxx"
#include "vcl/print.hxx"
#include "vcl/unohelp.hxx"
@@ -47,11 +46,13 @@
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/awt/Size.hpp"
#include <algorithm>
using namespace rtl;
using namespace vcl;
+using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::beans;
@@ -67,7 +68,9 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) :
mpPrintInfo( nil ),
mePageOrientation( ORIENTATION_PORTRAIT ),
mnStartPageOffsetX( 0 ),
- mnStartPageOffsetY( 0 )
+ mnStartPageOffsetY( 0 ),
+ mnCurPageRangeStart( 0 ),
+ mnCurPageRangeCount( 0 )
{
NSString* pStr = CreateNSString( i_rQueue.maPrinterName );
mpPrinter = [NSPrinter printerWithName: pStr];
@@ -87,6 +90,7 @@ AquaSalInfoPrinter::AquaSalInfoPrinter( const SalPrinterQueueInfo& i_rQueue ) :
const int nWidth = 100, nHeight = 100;
maContextMemory.reset( reinterpret_cast<sal_uInt8*>( rtl_allocateMemory( nWidth * 4 * nHeight ) ),
boost::bind( rtl_freeMemory, _1 ) );
+
if( maContextMemory )
{
mrContext = CGBitmapContextCreate( maContextMemory.get(), nWidth, nHeight, 8, nWidth * 4, GetSalData()->mxRGBSpace, kCGImageAlphaNoneSkipFirst );
@@ -134,7 +138,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const
dY -= aPaperSize.height - aImageRect.size.height - aImageRect.origin.y;
CGContextTranslateCTM( i_rContext, dX + mnStartPageOffsetX, dY - mnStartPageOffsetY );
// scale to be top/down and reflect our "virtual" DPI
- CGContextScaleCTM( i_rContext, 0.1, -0.1 );
+ CGContextScaleCTM( i_rContext, 72.0/double(nDPIX), -(72.0/double(nDPIY)) );
}
else
{
@@ -148,7 +152,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const
dY = -aPaperSize.width;
CGContextTranslateCTM( i_rContext, dX + mnStartPageOffsetY, dY - mnStartPageOffsetX );
// scale to be top/down and reflect our "virtual" DPI
- CGContextScaleCTM( i_rContext, -0.1, 0.1 );
+ CGContextScaleCTM( i_rContext, -(72.0/double(nDPIY)), (72.0/double(nDPIX)) );
}
mpGraphics->SetPrinterGraphics( i_rContext, nDPIX, nDPIY, 1.0 );
}
@@ -296,6 +300,28 @@ BOOL AquaSalInfoPrinter::SetPrinterData( ImplJobSetup* io_pSetupData )
// -----------------------------------------------------------------------
+void AquaSalInfoPrinter::setPaperSize( long i_nWidth, long i_nHeight, Orientation i_eSetOrientation )
+{
+
+ Orientation ePaperOrientation = ORIENTATION_PORTRAIT;
+ const PaperInfo* pPaper = matchPaper( i_nWidth, i_nHeight, ePaperOrientation );
+
+ if( pPaper )
+ {
+ NSString* pPaperName = [CreateNSString( rtl::OStringToOUString(PaperInfo::toPSName(pPaper->getPaper()), RTL_TEXTENCODING_ASCII_US) ) autorelease];
+ [mpPrintInfo setPaperName: pPaperName];
+ }
+ else if( i_nWidth > 0 && i_nHeight > 0 )
+ {
+ NSSize aPaperSize = { TenMuToPt(i_nWidth), TenMuToPt(i_nHeight) };
+ [mpPrintInfo setPaperSize: aPaperSize];
+ }
+ // this seems counterintuitive
+ mePageOrientation = i_eSetOrientation;
+}
+
+// -----------------------------------------------------------------------
+
BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData )
{
if( ! io_pSetupData || io_pSetupData->mnSystem != JOBSETUP_SYSTEM_MAC )
@@ -304,31 +330,32 @@ BOOL AquaSalInfoPrinter::SetData( ULONG i_nFlags, ImplJobSetup* io_pSetupData )
if( mpPrintInfo )
{
+ if( (i_nFlags & SAL_JOBSET_ORIENTATION) != 0 )
+ mePageOrientation = io_pSetupData->meOrientation;
+
if( (i_nFlags & SAL_JOBSET_PAPERSIZE) != 0)
{
// set paper format
- double width = 0, height = 0;
+ long width = 21000, height = 29700;
if( io_pSetupData->mePaperFormat == PAPER_USER )
{
// #i101108# sanity check
if( io_pSetupData->mnPaperWidth && io_pSetupData->mnPaperHeight )
{
- width = TenMuToPt( io_pSetupData->mnPaperWidth );
- height = TenMuToPt( io_pSetupData->mnPaperHeight );
+ width = io_pSetupData->mnPaperWidth;
+ height = io_pSetupData->mnPaperHeight;
}
}
else
- getPaperSize( width, height, io_pSetupData->mePaperFormat );
-
- if( width > 0 && height > 0 )
{
- NSSize aPaperSize = { width, height };
- [mpPrintInfo setPaperSize: aPaperSize];
+ double w = 595, h = 842;
+ getPaperSize( w, h, io_pSetupData->mePaperFormat );
+ width = static_cast<long>(PtTo10Mu( w ));
+ height = static_cast<long>(PtTo10Mu( h ));
}
- }
- if( (i_nFlags & SAL_JOBSET_ORIENTATION) != 0 )
- mePageOrientation = io_pSetupData->meOrientation;
+ setPaperSize( width, height, mePageOrientation );
+ }
}
return mpPrintInfo != nil;
@@ -424,6 +451,8 @@ ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USH
return 0;
case PRINTER_CAPABILITIES_SETORIENTATION:
return 1;
+ case PRINTER_CAPABILITIES_SETDUPLEX:
+ return 0;
case PRINTER_CAPABILITIES_SETPAPERBIN:
return 0;
case PRINTER_CAPABILITIES_SETPAPERSIZE:
@@ -432,6 +461,8 @@ ULONG AquaSalInfoPrinter::GetCapabilities( const ImplJobSetup* i_pSetupData, USH
return 1;
case PRINTER_CAPABILITIES_EXTERNALDIALOG:
return getUseNativeDialog() ? 1 : 0;
+ case PRINTER_CAPABILITIES_PDF:
+ return 1;
default: break;
};
return 0;
@@ -470,58 +501,129 @@ void AquaSalInfoPrinter::GetPageInfo( const ImplJobSetup*,
}
}
-BOOL AquaSalInfoPrinter::StartJob( const String* pFileName,
- const String& rAppName,
- ImplJobSetup* pSetupData,
- ImplQPrinter* pQPrinter,
- bool bIsQuickJob )
+static Size getPageSize( vcl::PrinterController& i_rController, sal_Int32 i_nPage )
+{
+ Size aPageSize;
+ Sequence< PropertyValue > aPageParms( i_rController.getPageParameters( i_nPage ) );
+ for( sal_Int32 nProperty = 0, nPropertyCount = aPageParms.getLength(); nProperty < nPropertyCount; ++nProperty )
+ {
+ if( aPageParms[ nProperty ].Name.equalsAscii( "PageSize" ) )
+ {
+ awt::Size aSize;
+ aPageParms[ nProperty].Value >>= aSize;
+ aPageSize.Width() = aSize.Width;
+ aPageSize.Height() = aSize.Height;
+ break;
+ }
+ }
+ return aPageSize;
+}
+
+BOOL AquaSalInfoPrinter::StartJob( const String* i_pFileName,
+ const String& i_rJobName,
+ const String& i_rAppName,
+ ImplJobSetup* i_pSetupData,
+ vcl::PrinterController& i_rController
+ )
{
if( mbJob )
return FALSE;
BOOL bSuccess = FALSE;
- std::vector<ULONG> aPaperRanges;
- if( ! pQPrinter->GetPaperRanges( aPaperRanges, true ) )
- return FALSE;
-
- size_t nRanges = aPaperRanges.size();
+ bool bWasAborted = false;
AquaSalInstance* pInst = GetSalData()->mpFirstInstance;
-
- for( ULONG nCurRange = 0; nCurRange < nRanges-1; nCurRange++ )
+ PrintAccessoryViewState aAccViewState;
+ sal_Int32 nAllPages = 0;
+
+ aAccViewState.bNeedRestart = true;
+
+ // reset IsLastPage
+ i_rController.setLastPage( sal_False );
+
+ // update job data
+ if( i_pSetupData )
+ SetData( ~0, i_pSetupData );
+
+ // do we want a progress panel ?
+ sal_Bool bShowProgressPanel = sal_True;
+ beans::PropertyValue* pMonitor = i_rController.getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "MonitorVisible" ) ) );
+ if( pMonitor )
+ pMonitor->Value >>= bShowProgressPanel;
+ if( ! i_rController.isShowDialogs() )
+ bShowProgressPanel = sal_False;
+
+ // FIXME: jobStarted() should be done after the print dialog has ended (if there is one)
+ // how do I know when that might be ?
+ i_rController.jobStarted();
+ do
{
- mnStartPageOffsetX = mnStartPageOffsetY = 0;
+ if( aAccViewState.bNeedRestart )
+ {
+ mnCurPageRangeStart = 0;
+ mnCurPageRangeCount = 0;
+ nAllPages = i_rController.getFilteredPageCount();
+ }
- // update job data
- ImplJobSetup* pSetup = pQPrinter->GetPageSetup( aPaperRanges[ nCurRange ] );
- if( pSetup )
- SetData( ~0, pSetup );
- DBG_ASSERT( pSetup, "no job setup for range" );
+ aAccViewState.bNeedRestart = false;
+
+ Size aCurSize( 21000, 29700 );
+ if( nAllPages > 0 )
+ {
+ mnCurPageRangeCount = 1;
+ aCurSize = getPageSize( i_rController, mnCurPageRangeStart );
+ Size aNextSize( aCurSize );
+
+ // print pages up to a different size
+ while( mnCurPageRangeCount + mnCurPageRangeStart < nAllPages )
+ {
+ aNextSize = getPageSize( i_rController, mnCurPageRangeStart + mnCurPageRangeCount );
+ if( aCurSize == aNextSize // same page size
+ ||
+ (aCurSize.Width() == aNextSize.Height() && aCurSize.Height() == aNextSize.Width()) // same size, but different orientation
+ )
+ {
+ mnCurPageRangeCount++;
+ }
+ else
+ break;
+ }
+ }
+ else
+ mnCurPageRangeCount = 0;
+
+ // now for the current run
+ mnStartPageOffsetX = mnStartPageOffsetY = 0;
+ // setup the paper size and orientation
+ // do this on our associated Printer object, since that is
+ // out interface to the applications which occasionally rely on the paper
+ // information (e.g. brochure printing scales to the found paper size)
+ // also SetPaperSizeUser has the advantage that we can share a
+ // platform independent paper matching algorithm
+ boost::shared_ptr<Printer> pPrinter( i_rController.getPrinter() );
+ pPrinter->SetMapMode( MapMode( MAP_100TH_MM ) );
+ pPrinter->SetPaperSizeUser( aCurSize, true );
- mnCurPageRangeStart = aPaperRanges[nCurRange];
- mnCurPageRangeCount = aPaperRanges[nCurRange+1] - aPaperRanges[nCurRange];
// create view
- NSView* pPrintView = [[AquaPrintView alloc] initWithQPrinter: pQPrinter withInfoPrinter: this];
+ NSView* pPrintView = [[AquaPrintView alloc] initWithController: &i_rController withInfoPrinter: this];
NSMutableDictionary* pPrintDict = [mpPrintInfo dictionary];
// set filename
- if( pFileName )
+ if( i_pFileName )
{
[mpPrintInfo setJobDisposition: NSPrintSaveJob];
- NSString* pPath = CreateNSString( *pFileName );
+ NSString* pPath = CreateNSString( *i_pFileName );
[pPrintDict setObject: pPath forKey: NSPrintSavePath];
[pPath release];
-
- // in this case we can only deliver the print job in one file
- mnCurPageRangeStart = 0;
- mnCurPageRangeCount = aPaperRanges.back();
- nCurRange = nRanges;
}
- [pPrintDict setObject: [[NSNumber numberWithInt: (int)pQPrinter->GetCopyCount()] autorelease] forKey: NSPrintCopies];
+ [pPrintDict setObject: [[NSNumber numberWithInt: (int)i_rController.getPrinter()->GetCopyCount()] autorelease] forKey: NSPrintCopies];
[pPrintDict setObject: [[NSNumber numberWithBool: YES] autorelease] forKey: NSPrintDetailedErrorReporting];
[pPrintDict setObject: [[NSNumber numberWithInt: 1] autorelease] forKey: NSPrintFirstPage];
- [pPrintDict setObject: [[NSNumber numberWithInt: (int)mnCurPageRangeCount] autorelease] forKey: NSPrintLastPage];
+ // #i103253# weird: for some reason, autoreleasing the value below like the others above
+ // leads do a double free malloc error. Why this value should behave differently from all the others
+ // is a mystery.
+ [pPrintDict setObject: [NSNumber numberWithInt: mnCurPageRangeCount] forKey: NSPrintLastPage];
// create print operation
@@ -529,17 +631,47 @@ BOOL AquaSalInfoPrinter::StartJob( const String* pFileName,
if( pPrintOperation )
{
- bool bShowPanel = (! bIsQuickJob && getUseNativeDialog() );
+ NSObject* pReleaseAfterUse = nil;
+ bool bShowPanel = (! i_rController.isDirectPrint() && getUseNativeDialog() && i_rController.isShowDialogs() );
[pPrintOperation setShowsPrintPanel: bShowPanel ? YES : NO ];
- // [pPrintOperation setShowsProgressPanel: NO];
+ [pPrintOperation setShowsProgressPanel: bShowProgressPanel ? YES : NO];
+
+ // set job title (since MacOSX 10.5)
+ if( [pPrintOperation respondsToSelector: @selector(setJobTitle:)] )
+ [pPrintOperation performSelector: @selector(setJobTitle:) withObject: [CreateNSString( i_rJobName ) autorelease]];
+
+ if( bShowPanel && mnCurPageRangeStart == 0 ) // only the first range of pages gets the accesory view
+ pReleaseAfterUse = [AquaPrintAccessoryView setupPrinterPanel: pPrintOperation withController: &i_rController withState: &aAccViewState];
+
bSuccess = TRUE;
mbJob = true;
pInst->startedPrintJob();
[pPrintOperation runOperation];
pInst->endedPrintJob();
+ bWasAborted = [[[pPrintOperation printInfo] jobDisposition] compare: NSPrintCancelJob] == NSOrderedSame;
mbJob = false;
+ if( pReleaseAfterUse )
+ [pReleaseAfterUse release];
}
- }
+
+ mnCurPageRangeStart += mnCurPageRangeCount;
+ mnCurPageRangeCount = 1;
+ } while( aAccViewState.bNeedRestart || mnCurPageRangeStart + mnCurPageRangeCount < nAllPages );
+
+ // inform application that it can release its data
+ // this is awkward, but the XRenderable interface has no method for this,
+ // so we need to call XRenderadble::render one last time with IsLastPage = TRUE
+ i_rController.setLastPage( sal_True );
+ GDIMetaFile aPageFile;
+ if( mrContext )
+ SetupPrinterGraphics( mrContext );
+ i_rController.getFilteredPageFile( 0, aPageFile );
+
+ i_rController.setJobState( bWasAborted
+ ? view::PrintableState_JOB_ABORTED
+ : view::PrintableState_JOB_SPOOLED );
+
+ mnCurPageRangeStart = mnCurPageRangeCount = 0;
return bSuccess;
}
@@ -581,6 +713,7 @@ SalGraphics* AquaSalInfoPrinter::StartPage( ImplJobSetup* i_pSetupData, BOOL i_b
BOOL AquaSalInfoPrinter::EndPage()
{
+ mpGraphics->InvalidateContext();
return TRUE;
}
@@ -606,31 +739,24 @@ AquaSalPrinter::~AquaSalPrinter()
// -----------------------------------------------------------------------
-BOOL AquaSalPrinter::StartJob( const String* pFileName,
- const String& rAppName,
- ImplJobSetup* pSetupData,
- ImplQPrinter* pQPrinter )
+BOOL AquaSalPrinter::StartJob( const String* i_pFileName,
+ const String& i_rJobName,
+ const String& i_rAppName,
+ ImplJobSetup* i_pSetupData,
+ vcl::PrinterController& i_rController )
{
- bool bIsQuickJob = false;
- std::hash_map< rtl::OUString, rtl::OUString, rtl::OUStringHash >::const_iterator quick_it =
- pSetupData->maValueMap.find( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "IsQuickJob" ) ) );
-
- if( quick_it != pSetupData->maValueMap.end() )
- {
- if( quick_it->second.equalsIgnoreAsciiCaseAscii( "true" ) )
- bIsQuickJob = true;
- }
-
- return mpInfoPrinter->StartJob( pFileName, rAppName, pSetupData, pQPrinter, bIsQuickJob );
+ return mpInfoPrinter->StartJob( i_pFileName, i_rJobName, i_rAppName, i_pSetupData, i_rController );
}
// -----------------------------------------------------------------------
BOOL AquaSalPrinter::StartJob( const XubString* i_pFileName,
- const XubString& i_rJobName,
- const XubString& i_rAppName,
- ULONG i_nCopies, BOOL i_bCollate,
- ImplJobSetup* i_pSetupData )
+ const XubString& i_rJobName,
+ const XubString& i_rAppName,
+ ULONG i_nCopies,
+ bool i_bCollate,
+ bool i_bDirect,
+ ImplJobSetup* i_pSetupData )
{
DBG_ERROR( "should never be called" );
return FALSE;
@@ -671,20 +797,62 @@ ULONG AquaSalPrinter::GetErrorCode()
return mpInfoPrinter->GetErrorCode();
}
-////////////////////////////
-////// IMPLEMENT US /////
-////////////////////////////
-
-DuplexMode AquaSalInfoPrinter::GetDuplexMode( const ImplJobSetup* i_pSetupData )
+void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData )
{
- return DUPLEX_UNKNOWN;
+ m_aPaperFormats.clear();
+ m_bPapersInit = true;
+
+ if( mpPrinter )
+ {
+ if( [mpPrinter statusForTable: @"PPD"] == NSPrinterTableOK )
+ {
+ NSArray* pPaperNames = [mpPrinter stringListForKey: @"PageSize" inTable: @"PPD"];
+ if( pPaperNames )
+ {
+ unsigned int nPapers = [pPaperNames count];
+ for( unsigned int i = 0; i < nPapers; i++ )
+ {
+ NSString* pPaper = [pPaperNames objectAtIndex: i];
+ NSSize aPaperSize = [mpPrinter pageSizeForPaper: pPaper];
+ if( aPaperSize.width > 0 && aPaperSize.height > 0 )
+ {
+ PaperInfo aInfo( PtTo10Mu( aPaperSize.width ),
+ PtTo10Mu( aPaperSize.height ) );
+ m_aPaperFormats.push_back( aInfo );
+ }
+ }
+ }
+ }
+ }
}
-void AquaSalInfoPrinter::InitPaperFormats( const ImplJobSetup* i_pSetupData )
+const PaperInfo* AquaSalInfoPrinter::matchPaper( long i_nWidth, long i_nHeight, Orientation& o_rOrientation ) const
{
+ if( ! m_bPapersInit )
+ const_cast<AquaSalInfoPrinter*>(this)->InitPaperFormats( NULL );
+
+ const PaperInfo* pMatch = NULL;
+ o_rOrientation = ORIENTATION_PORTRAIT;
+ for( int n = 0; n < 2 ; n++ )
+ {
+ for( size_t i = 0; i < m_aPaperFormats.size(); i++ )
+ {
+ if( abs( m_aPaperFormats[i].getWidth() - i_nWidth ) < 50 &&
+ abs( m_aPaperFormats[i].getHeight() - i_nHeight ) < 50 )
+ {
+ pMatch = &m_aPaperFormats[i];
+ return pMatch;
+ }
+ }
+ o_rOrientation = ORIENTATION_LANDSCAPE;
+ std::swap( i_nWidth, i_nHeight );
+ }
+ return pMatch;
}
int AquaSalInfoPrinter::GetLandscapeAngle( const ImplJobSetup* i_pSetupData )
{
- return 0;
+ return 900;
}
+
+
diff --git a/vcl/inc/postgraphitestl.h b/vcl/inc/postgraphitestl.h
new file mode 100644
index 000000000000..736aa248b7ff
--- /dev/null
+++ b/vcl/inc/postgraphitestl.h
@@ -0,0 +1,9 @@
+#ifdef std_was_redefined_as_stlport
+// put things back the way they were
+# define std std_was_redefined_as_stlport
+# undef _STLP_OUTERMOST_HEADER_ID
+// force config to be re-read
+# undef _STLP_NOTHROW_INHERENTLY
+# undef _STLP_CONFIG_H
+# include <stddef.h>
+#endif
diff --git a/vcl/inc/pregraphitestl.h b/vcl/inc/pregraphitestl.h
new file mode 100644
index 000000000000..ece0af477113
--- /dev/null
+++ b/vcl/inc/pregraphitestl.h
@@ -0,0 +1,30 @@
+#if defined(GRAPHITEADAPTSTL) && defined(std)
+# include <ostream>
+# include <istream>
+# include <fstream>
+# include <iostream>
+# include <vector>
+# include <algorithm>
+# define std_was_redefined_as_stlport std
+# undef std
+# define _STLP_OUTERMOST_HEADER_ID 0xdeadbeaf
+# pragma GCC visibility push(default)
+# include _STLP_NATIVE_HEADER(exception_defines.h)
+# include _STLP_NATIVE_HEADER(limits)
+# include _STLP_NATIVE_HEADER(memory)
+# include _STLP_NATIVE_HEADER(exception)
+# include _STLP_NATIVE_HEADER(iosfwd)
+# include _STLP_NATIVE_HEADER(algorithm)
+# include _STLP_NATIVE_HEADER(string)
+# include _STLP_NATIVE_HEADER(streambuf)
+# include _STLP_NATIVE_HEADER(ios)
+# include _STLP_NATIVE_HEADER(locale)
+# include _STLP_NATIVE_HEADER(stdexcept)
+# include _STLP_NATIVE_HEADER(ostream)
+# include _STLP_NATIVE_HEADER(istream)
+# include _STLP_NATIVE_HEADER(iostream)
+# include _STLP_NATIVE_HEADER(vector)
+# pragma GCC visibility pop
+#endif
+//sil_std resolves to the std that Graphite was built with
+namespace sil_std = std;
diff --git a/vcl/inc/vcl/arrange.hxx b/vcl/inc/vcl/arrange.hxx
new file mode 100644
index 000000000000..309d0bf930ea
--- /dev/null
+++ b/vcl/inc/vcl/arrange.hxx
@@ -0,0 +1,425 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: accel.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _VCL_ARRANGE_HXX
+#define _VCL_ARRANGE_HXX
+
+#include "vcl/window.hxx"
+
+#include <vector>
+#include <map>
+#include <boost/shared_ptr.hpp>
+
+namespace vcl
+{
+ /* some helper classes for simple window layouting
+ guidelines:
+ - a WindowArranger is not a Window
+ - a WindowArranger hierarchy manages exactly one level of child windows inside a common parent
+ this is to keep the vcl Window hierarchy flat, as some code like accelerators depend on such behavior
+ - a WindowArranger never becomes owner of a Window, windows need to be destroyed separately
+ - a WindowArranger however always is owner of its child WindowArrangers, that is the
+ WindowArranger hierarchy will keep track of its objects and delete them
+ - a managed element of a WindowArranger can either be a Window (a leaf in the hierarchy)
+ or a child WindowArranger (a node in the hierarchy), but never both
+ */
+
+ class WindowArranger
+ {
+ protected:
+ struct Element
+ {
+ Window* m_pElement;
+ boost::shared_ptr<WindowArranger> m_pChild;
+ sal_Int32 m_nExpandPriority;
+ Size m_aMinSize;
+ bool m_bHidden;
+ long m_nLeftBorder;
+ long m_nTopBorder;
+ long m_nRightBorder;
+ long m_nBottomBorder;
+
+ Element()
+ : m_pElement( NULL )
+ , m_pChild()
+ , m_nExpandPriority( 0 )
+ , m_bHidden( false )
+ , m_nLeftBorder( 0 )
+ , m_nTopBorder( 0 )
+ , m_nRightBorder( 0 )
+ , m_nBottomBorder( 0 )
+ {}
+
+ Element( Window* i_pWin,
+ boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
+ sal_Int32 i_nExpandPriority = 0
+ )
+ : m_pElement( i_pWin )
+ , m_pChild( i_pChild )
+ , m_nExpandPriority( i_nExpandPriority )
+ , m_bHidden( false )
+ , m_nLeftBorder( 0 )
+ , m_nTopBorder( 0 )
+ , m_nRightBorder( 0 )
+ , m_nBottomBorder( 0 )
+ {}
+
+ void deleteChild() { m_pChild.reset(); }
+
+ sal_Int32 getExpandPriority() const;
+ Size getOptimalSize( WindowSizeType ) const;
+ bool isVisible() const;
+ void setPosSize( const Point&, const Size& );
+ };
+
+ Window* m_pParentWindow;
+ WindowArranger* m_pParentArranger;
+ Rectangle m_aManagedArea;
+ long m_nOuterBorder;
+
+ virtual Element* getElement( size_t i_nIndex ) = 0;
+ const Element* getConstElement( size_t i_nIndex ) const
+ { return const_cast<WindowArranger*>(this)->getElement( i_nIndex ); }
+
+
+ public:
+ WindowArranger( WindowArranger* i_pParent = NULL )
+ : m_pParentWindow( i_pParent ? i_pParent->m_pParentWindow : NULL )
+ , m_pParentArranger( i_pParent )
+ , m_nOuterBorder( 0 )
+ {}
+ virtual ~WindowArranger();
+
+ // ask what would be the optimal size
+ virtual Size getOptimalSize( WindowSizeType ) const = 0;
+ // call Resize to trigger layouting inside the managed area
+ // without function while parent window is unset
+ virtual void resize() = 0;
+ // avoid this if possible, using the constructor instead
+ // there can be only one parent window and all managed windows MUST
+ // be direct children of that window
+ // violating that condition will result in undefined behavior
+ virtual void setParentWindow( Window* );
+
+ virtual void setParent( WindowArranger* );
+
+ virtual size_t countElements() const = 0;
+ boost::shared_ptr<WindowArranger> getChild( size_t i_nIndex ) const
+ {
+ const Element* pEle = getConstElement( i_nIndex );
+ return pEle ? pEle->m_pChild : boost::shared_ptr<WindowArranger>();
+ }
+ Window* getWindow( size_t i_nIndex ) const
+ {
+ const Element* pEle = getConstElement( i_nIndex );
+ return pEle ? pEle->m_pElement : NULL;
+ }
+
+ virtual bool isVisible() const; // true if any element is visible
+
+ sal_Int32 getExpandPriority( size_t i_nIndex ) const
+ {
+ const Element* pEle = getConstElement( i_nIndex );
+ return pEle ? pEle->getExpandPriority() : 0;
+ }
+
+ Size getMinimumSize( size_t i_nIndex ) const
+ {
+ const Element* pEle = getConstElement( i_nIndex );
+ return pEle ? pEle->m_aMinSize : Size();
+ }
+
+ bool setMinimumSize( size_t i_nIndex, const Size& i_rMinSize )
+ {
+ Element* pEle = getElement( i_nIndex );
+ if( pEle )
+ pEle->m_aMinSize = i_rMinSize;
+ return pEle != NULL;
+ }
+
+ void setBorders( size_t i_nIndex, long i_nLeft, long i_nTop, long i_nRight, long i_nBottom )
+ {
+ Element* pEle = getElement( i_nIndex );
+ if( pEle )
+ {
+ pEle->m_nLeftBorder = i_nLeft;
+ pEle->m_nRightBorder = i_nRight;
+ pEle->m_nTopBorder = i_nTop;
+ pEle->m_nBottomBorder = i_nBottom;
+ }
+ }
+
+ void show( bool i_bShow = true, bool i_bImmediateUpdate = true );
+
+ void setManagedArea( const Rectangle& i_rArea )
+ {
+ m_aManagedArea = i_rArea;
+ resize();
+ }
+ const Rectangle& getManagedArea() const { return m_aManagedArea; }
+
+ void setOuterBorder( long i_nBorder )
+ {
+ m_nOuterBorder = i_nBorder;
+ resize();
+ }
+ };
+
+ class RowOrColumn : public WindowArranger
+ {
+ long m_nBorderWidth;
+ bool m_bColumn;
+
+ std::vector< WindowArranger::Element > m_aElements;
+
+ void distributeRowWidth( std::vector< Size >& io_rSizes, long i_nUsedWidth, long i_nExtraWidth );
+ void distributeColumnHeight( std::vector< Size >& io_rSizes, long i_nUsedHeight, long i_nExtraHeight );
+ protected:
+ virtual Element* getElement( size_t i_nIndex )
+ { return i_nIndex < m_aElements.size() ? &m_aElements[ i_nIndex ] : 0; }
+
+ public:
+ RowOrColumn( WindowArranger* i_pParent = NULL,
+ bool bColumn = true, long i_nBorderWidth = 5 )
+ : WindowArranger( i_pParent )
+ , m_nBorderWidth( i_nBorderWidth )
+ , m_bColumn( bColumn )
+ {}
+
+ virtual ~RowOrColumn();
+
+ virtual Size getOptimalSize( WindowSizeType ) const;
+ virtual void resize();
+ virtual size_t countElements() const { return m_aElements.size(); }
+
+ // add a managed window at the given index
+ // an index smaller than zero means add the window at the end
+ size_t addWindow( Window*, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
+ void remove( Window* );
+
+ size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 );
+ // convenience: use for addChild( new WindowArranger( ... ) ) constructs
+ size_t addChild( WindowArranger* i_pNewChild, sal_Int32 i_nExpandPrio = 0, size_t i_nIndex = ~0 )
+ { return addChild( boost::shared_ptr<WindowArranger>( i_pNewChild ), i_nExpandPrio, i_nIndex ); }
+ void remove( boost::shared_ptr<WindowArranger> const & );
+
+ long getBorderWidth() const { return m_nBorderWidth; }
+ };
+
+ class LabeledElement : public WindowArranger
+ {
+ WindowArranger::Element m_aLabel;
+ WindowArranger::Element m_aElement;
+ long m_nDistance;
+ long m_nLabelColumnWidth;
+ int m_nLabelStyle;
+ protected:
+ virtual Element* getElement( size_t i_nIndex )
+ {
+ if( i_nIndex == 0 )
+ return &m_aLabel;
+ else if( i_nIndex == 1 )
+ return &m_aElement;
+ return 0;
+ }
+
+ public:
+ LabeledElement( WindowArranger* i_pParent = NULL, int i_nLabelStyle = 0, long i_nDistance = 5 )
+ : WindowArranger( i_pParent )
+ , m_nDistance( i_nDistance )
+ , m_nLabelColumnWidth( 0 )
+ , m_nLabelStyle( i_nLabelStyle )
+ {}
+
+ virtual ~LabeledElement();
+
+ virtual Size getOptimalSize( WindowSizeType ) const;
+ virtual void resize();
+ virtual size_t countElements() const { return 2; }
+
+ void setLabel( Window* );
+ void setLabel( boost::shared_ptr<WindowArranger> const & );
+ void setElement( Window* );
+ void setElement( boost::shared_ptr<WindowArranger> const & );
+ void setLabelColumnWidth( long i_nWidth )
+ { m_nLabelColumnWidth = i_nWidth; }
+
+ Size getLabelSize( WindowSizeType i_eType ) const
+ { return m_aLabel.getOptimalSize( i_eType ); }
+ Size getElementSize( WindowSizeType i_eType ) const
+ { return m_aElement.getOptimalSize( i_eType ); }
+ };
+
+ class LabelColumn : public RowOrColumn
+ {
+ long getLabelWidth() const;
+ public:
+ LabelColumn( WindowArranger* i_pParent = NULL, long i_nBorderWidth = 5 )
+ : RowOrColumn( i_pParent, true, i_nBorderWidth )
+ {}
+ virtual ~LabelColumn();
+
+ virtual Size getOptimalSize( WindowSizeType ) const;
+ virtual void resize();
+
+ // returns the index of the added label
+ size_t addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger> const& i_rElement, long i_nIndent = 0 );
+ size_t addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent = 0 );
+ };
+
+ class Indenter : public WindowArranger
+ {
+ long m_nIndent;
+ WindowArranger::Element m_aElement;
+
+ protected:
+ virtual Element* getElement( size_t i_nIndex )
+ { return i_nIndex == 0 ? &m_aElement : NULL; }
+
+ public:
+ Indenter( WindowArranger* i_pParent = NULL, long i_nIndent = 15 )
+ : WindowArranger( i_pParent )
+ , m_nIndent( i_nIndent )
+ {}
+
+ virtual ~Indenter();
+
+ virtual Size getOptimalSize( WindowSizeType ) const;
+ virtual void resize();
+ virtual size_t countElements() const { return (m_aElement.m_pElement != 0 || m_aElement.m_pChild != 0) ? 1 : 0; }
+
+ void setIndent( long i_nIndent )
+ {
+ m_nIndent = i_nIndent;
+ resize();
+ }
+
+ void setWindow( Window*, sal_Int32 i_nExpandPrio = 0 );
+ void setChild( boost::shared_ptr<WindowArranger> const &, sal_Int32 i_nExpandPrio = 0 );
+ // convenience: use for setChild( new WindowArranger( ... ) ) constructs
+ void setChild( WindowArranger* i_pChild, sal_Int32 i_nExpandPrio = 0 )
+ { setChild( boost::shared_ptr<WindowArranger>( i_pChild ), i_nExpandPrio ); }
+ };
+
+ class Spacer : public WindowArranger
+ {
+ WindowArranger::Element m_aElement;
+ Size m_aSize;
+
+ protected:
+ virtual Element* getElement( size_t i_nIndex )
+ { return i_nIndex == 0 ? &m_aElement : NULL; }
+
+ public:
+ Spacer( WindowArranger* i_pParent = NULL, sal_Int32 i_nPrio = 20, const Size& i_rSize = Size( 0, 0 ) )
+ : WindowArranger( i_pParent )
+ , m_aElement( NULL, boost::shared_ptr<WindowArranger>(), i_nPrio )
+ , m_aSize( i_rSize )
+ {}
+
+ virtual ~Spacer() {}
+
+ virtual Size getOptimalSize( WindowSizeType ) const
+ { return m_aSize; }
+ virtual void resize() {}
+ virtual void setParentWindow( Window* ) {}
+ virtual size_t countElements() const { return 1; }
+ virtual bool isVisible() const { return true; }
+ };
+
+ class MatrixArranger : public WindowArranger
+ {
+ long m_nBorderX;
+ long m_nBorderY;
+
+ struct MatrixElement : public WindowArranger::Element
+ {
+ sal_uInt32 m_nX;
+ sal_uInt32 m_nY;
+
+ MatrixElement()
+ : WindowArranger::Element()
+ , m_nX( 0 )
+ , m_nY( 0 )
+ {}
+
+ MatrixElement( Window* i_pWin,
+ sal_uInt32 i_nX, sal_uInt32 i_nY,
+ boost::shared_ptr<WindowArranger> const & i_pChild = boost::shared_ptr<WindowArranger>(),
+ sal_Int32 i_nExpandPriority = 0
+ )
+ : WindowArranger::Element( i_pWin, i_pChild, i_nExpandPriority )
+ , m_nX( i_nX )
+ , m_nY( i_nY )
+ {
+ }
+ };
+
+ std::vector< MatrixElement > m_aElements;
+ std::map< sal_uInt64, size_t > m_aMatrixMap; // maps (x | (y << 32)) to index in m_aElements
+
+ sal_uInt64 getMap( sal_uInt32 i_nX, sal_uInt32 i_nY )
+ { return static_cast< sal_uInt64 >(i_nX) | (static_cast< sal_uInt64>(i_nY) << 32 ); }
+
+ Size getOptimalSize( WindowSizeType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const;
+ protected:
+ virtual Element* getElement( size_t i_nIndex )
+ { return i_nIndex < m_aElements.size() ? &m_aElements[ i_nIndex ] : 0; }
+
+ public:
+ MatrixArranger( WindowArranger* i_pParent = NULL,
+ long i_nBorderX = 5,
+ long i_nBorderY = 5 )
+ : WindowArranger( i_pParent )
+ , m_nBorderX( i_nBorderX )
+ , m_nBorderY( i_nBorderY )
+ {}
+
+ virtual ~MatrixArranger();
+
+ virtual Size getOptimalSize( WindowSizeType ) const;
+ virtual void resize();
+ virtual size_t countElements() const { return m_aElements.size(); }
+
+ // add a managed window at the given matrix position
+ size_t addWindow( Window*, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
+ void remove( Window* );
+
+ size_t addChild( boost::shared_ptr<WindowArranger> const &, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 );
+ // convenience: use for addChild( new WindowArranger( ... ) ) constructs
+ size_t addChild( WindowArranger* i_pNewChild, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio = 0 )
+ { return addChild( boost::shared_ptr<WindowArranger>( i_pNewChild ), i_nX, i_nY, i_nExpandPrio ); }
+ void remove( boost::shared_ptr<WindowArranger> const & );
+ };
+
+}
+
+#endif
+
diff --git a/vcl/inc/vcl/button.hxx b/vcl/inc/vcl/button.hxx
index b80edf6712cd..b5f70217e149 100644
--- a/vcl/inc/vcl/button.hxx
+++ b/vcl/inc/vcl/button.hxx
@@ -425,7 +425,6 @@ private:
SAL_DLLPRIVATE void ImplInitCheckBoxData();
SAL_DLLPRIVATE WinBits ImplInitStyle( const Window* pPrevWindow, WinBits nStyle );
SAL_DLLPRIVATE void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
- SAL_DLLPRIVATE void ImplDrawCheckBoxState();
SAL_DLLPRIVATE void ImplInvalidateOrDrawCheckBoxState();
SAL_DLLPRIVATE void ImplDraw( OutputDevice* pDev, ULONG nDrawFlags,
const Point& rPos, const Size& rSize,
@@ -450,10 +449,12 @@ protected:
SAL_DLLPRIVATE virtual const Color&
GetCanonicalTextColor( const StyleSettings& _rStyle ) const;
+ SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState();
+ SAL_DLLPRIVATE const Rectangle& GetStateRect() const { return maStateRect; }
+ SAL_DLLPRIVATE const Rectangle& GetMouseRect() const { return maMouseRect; }
public:
SAL_DLLPRIVATE void ImplCheck();
SAL_DLLPRIVATE void ImplSetMinimumNWFSize();
-
public:
CheckBox( Window* pParent, WinBits nStyle = 0 );
CheckBox( Window* pParent, const ResId& rResId );
@@ -552,4 +553,15 @@ public:
~TriStateBox();
};
+class VCL_DLLPUBLIC DisclosureButton : public CheckBox
+{
+protected:
+ SAL_DLLPRIVATE virtual void ImplDrawCheckBoxState();
+public:
+ DisclosureButton( Window* pParent, WinBits nStyle = 0 );
+ DisclosureButton( Window* pParent, const ResId& rResId );
+
+ virtual void KeyInput( const KeyEvent& rKEvt );
+};
+
#endif // _SV_BUTTON_HXX
diff --git a/vcl/inc/vcl/combobox.hxx b/vcl/inc/vcl/combobox.hxx
index d57d4b8a7372..cbceffaff6c0 100644
--- a/vcl/inc/vcl/combobox.hxx
+++ b/vcl/inc/vcl/combobox.hxx
@@ -192,8 +192,12 @@ public:
void* GetEntryData( USHORT nPos ) const;
void SetTopEntry( USHORT nPos );
+ void ShowProminentEntry( USHORT nPos );
USHORT GetTopEntry() const;
+ void SetProminentEntryType( ProminentEntry eType );
+ ProminentEntry GetProminentEntryType() const;
+
USHORT GetDisplayLineCount() const;
USHORT GetSelectEntryCount() const;
diff --git a/vcl/inc/vcl/configsettings.hxx b/vcl/inc/vcl/configsettings.hxx
index aee684a84ca4..211ea3f0892b 100644
--- a/vcl/inc/vcl/configsettings.hxx
+++ b/vcl/inc/vcl/configsettings.hxx
@@ -54,7 +54,6 @@ namespace vcl
std::hash_map< rtl::OUString, SmallOUStrMap, rtl::OUStringHash > m_aSettings;
virtual void Notify( const com::sun::star::uno::Sequence< rtl::OUString >& rPropertyNames );
- virtual void Commit();
void getValues();
SettingsConfigItem();
@@ -65,6 +64,8 @@ namespace vcl
const rtl::OUString& getValue( const rtl::OUString& rGroup, const rtl::OUString& rKey ) const;
void setValue( const rtl::OUString& rGroup, const rtl::OUString& rKey, const rtl::OUString& rValue );
+
+ virtual void Commit();
};
//........................................................................
diff --git a/vcl/inc/vcl/edit.hxx b/vcl/inc/vcl/edit.hxx
index fb99bd028631..ad6a4ee017d9 100644
--- a/vcl/inc/vcl/edit.hxx
+++ b/vcl/inc/vcl/edit.hxx
@@ -120,6 +120,7 @@ private:
SAL_DLLPRIVATE void ImplCopy( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
SAL_DLLPRIVATE void ImplPaste( ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboard >& rxClipboard );
SAL_DLLPRIVATE long ImplGetExtraOffset() const;
+ SAL_DLLPRIVATE long ImplGetTextYPosition() const;
SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XExtendedInputSequenceChecker > ImplGetInputSequenceChecker() const;
SAL_DLLPRIVATE ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > ImplGetBreakIterator() const;
diff --git a/vcl/inc/vcl/fixed.hxx b/vcl/inc/vcl/fixed.hxx
index a5c834fce486..d6ffc1625afe 100644
--- a/vcl/inc/vcl/fixed.hxx
+++ b/vcl/inc/vcl/fixed.hxx
@@ -187,6 +187,7 @@ public:
virtual void StateChanged( StateChangedType nType );
virtual void DataChanged( const DataChangedEvent& rDCEvt );
virtual void UserDraw( const UserDrawEvent& rUDEvt );
+ virtual Size GetOptimalSize(WindowSizeType eType) const;
void SetImage( const Image& rImage );
const Image& GetImage() const { return maImage; }
diff --git a/vcl/inc/vcl/gdimtf.hxx b/vcl/inc/vcl/gdimtf.hxx
index c53460d35584..e4acd55439cc 100644
--- a/vcl/inc/vcl/gdimtf.hxx
+++ b/vcl/inc/vcl/gdimtf.hxx
@@ -164,6 +164,7 @@ public:
void Scale( double fScaleX, double fScaleY );
void Scale( const Fraction& rScaleX, const Fraction& rScaleY );
void Rotate( long nAngle10 );
+ void Clip( const Rectangle& );
/* get the bound rect of the contained actions
* caveats:
* - clip actions will limit the contained actions,
diff --git a/vcl/inc/vcl/graphite_adaptors.hxx b/vcl/inc/vcl/graphite_adaptors.hxx
index 41ffa00b0f8f..9a0a42c01ce0 100644
--- a/vcl/inc/vcl/graphite_adaptors.hxx
+++ b/vcl/inc/vcl/graphite_adaptors.hxx
@@ -58,10 +58,11 @@
#include "vcl/dllapi.h"
// Libraries
+#include "pregraphitestl.h"
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/ITextSource.h>
-
+#include "postgraphitestl.h"
// Module type definitions and forward declarations.
//
@@ -121,7 +122,7 @@ public:
const grutils::GrFeatureParser * features() const { return mpFeatures; };
private:
- virtual void UniqueCacheInfo(std::wstring &, bool &, bool &);
+ virtual void UniqueCacheInfo(sil_std::wstring &, bool &, bool &);
FreetypeServerFont& mrFont;
FontProperties maFontProperties;
diff --git a/vcl/inc/vcl/graphite_cache.hxx b/vcl/inc/vcl/graphite_cache.hxx
index 5a537c5f1e48..73e3e2c9f1fe 100644
--- a/vcl/inc/vcl/graphite_cache.hxx
+++ b/vcl/inc/vcl/graphite_cache.hxx
@@ -58,10 +58,11 @@ public:
void clear();
#ifdef GRCACHE_REUSE_VECTORS
void setGlyphVectors(long nWidth, GraphiteLayout::Glyphs & vGlyphs, std::vector<int> vCharDxs,
- std::vector<int> & vChar2Base, std::vector<int> & vGlyph2Char)
+ std::vector<int> & vChar2Base, std::vector<int> & vGlyph2Char, float fScale)
{
clearVectors();
mnWidth = nWidth;
+ m_fontScale = fScale;
mvGlyphs.insert(mvGlyphs.begin(), vGlyphs.begin(), vGlyphs.end());
mvCharDxs.insert(mvCharDxs.begin(),vCharDxs.begin(),vCharDxs.end());
mvChar2BaseGlyph.insert(mvChar2BaseGlyph.begin(),vChar2Base.begin(),vChar2Base.end());
@@ -78,6 +79,7 @@ public:
const std::vector<int> & charDxs() const { return mvCharDxs; }
const std::vector<int> & char2BaseGlyph() const { return mvChar2BaseGlyph; }
const std::vector<int> & glyph2Char() const { return mvGlyph2Char; }
+ float & fontScale() { return m_fontScale; }
#endif
private:
rtl::OUString * m_rope;
diff --git a/vcl/inc/vcl/graphite_features.hxx b/vcl/inc/vcl/graphite_features.hxx
index 6cfe5dfca0fd..d3cfd99e0fe4 100644
--- a/vcl/inc/vcl/graphite_features.hxx
+++ b/vcl/inc/vcl/graphite_features.hxx
@@ -32,10 +32,11 @@
// Parse a string of features specified as ; separated pairs.
// e.g.
// 1001=1&2002=2&fav1=0
-
+#include "pregraphitestl.h"
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/GrFeature.h>
+#include "postgraphitestl.h"
namespace grutils
{
diff --git a/vcl/inc/vcl/graphite_layout.hxx b/vcl/inc/vcl/graphite_layout.hxx
index 2ec3bc4c2391..325f67e852ce 100644
--- a/vcl/inc/vcl/graphite_layout.hxx
+++ b/vcl/inc/vcl/graphite_layout.hxx
@@ -43,11 +43,13 @@
#include <vector>
#include <utility>
// Libraries
+#include "pregraphitestl.h"
#include <graphite/GrClient.h>
#include <graphite/Font.h>
#include <graphite/GrConstants.h>
#include <graphite/GrAppData.h>
#include <graphite/SegmentAux.h>
+#include "postgraphitestl.h"
// Platform
#include <vcl/sallayout.hxx>
#include <vcl/dllapi.h>
diff --git a/vcl/inc/vcl/ilstbox.hxx b/vcl/inc/vcl/ilstbox.hxx
index 81dd32ef2705..f38825028080 100644
--- a/vcl/inc/vcl/ilstbox.hxx
+++ b/vcl/inc/vcl/ilstbox.hxx
@@ -227,6 +227,7 @@ private:
long mnLeft; // Ausgabe ab Spalte
long mnBorder; // Abstand Rahmen - Text
long mnTextHeight; // Texthoehe
+ ProminentEntry meProminentType; // where is the "prominent" entry
USHORT mnSelectModifier; // Modifiers
@@ -309,6 +310,11 @@ public:
void SetTopEntry( USHORT nTop );
USHORT GetTopEntry() const { return mnTop; }
+ // ShowProminentEntry will set the entry correspoding to nEntryPos
+ // either at top or in the middle depending on the chosen style
+ void ShowProminentEntry( USHORT nEntryPos );
+ void SetProminentEntryType( ProminentEntry eType ) { meProminentType = eType; }
+ ProminentEntry GetProminentEntryType() const { return meProminentType; }
using Window::IsVisible;
BOOL IsVisible( USHORT nEntry ) const;
@@ -443,9 +449,13 @@ public:
void SetTopEntry( USHORT nTop ) { maLBWindow.SetTopEntry( nTop ); }
USHORT GetTopEntry() const { return maLBWindow.GetTopEntry(); }
+ void ShowProminentEntry( USHORT nPos ) { maLBWindow.ShowProminentEntry( nPos ); }
using Window::IsVisible;
BOOL IsVisible( USHORT nEntry ) const { return maLBWindow.IsVisible( nEntry ); }
+ void SetProminentEntryType( ProminentEntry eType ) { maLBWindow.SetProminentEntryType( eType ); }
+ ProminentEntry GetProminentEntryType() const { return maLBWindow.GetProminentEntryType(); }
+
long GetLeftIndent() const { return maLBWindow.GetLeftIndent(); }
void SetLeftIndent( USHORT n ) { maLBWindow.SetLeftIndent( n ); }
void ScrollHorz( short nDiff ) { maLBWindow.ScrollHorz( nDiff ); }
diff --git a/vcl/inc/vcl/impprn.hxx b/vcl/inc/vcl/impprn.hxx
index c86090e8b49f..0cd6e9688201 100644
--- a/vcl/inc/vcl/impprn.hxx
+++ b/vcl/inc/vcl/impprn.hxx
@@ -28,7 +28,7 @@
*
************************************************************************/
-#ifndef _SV_IMPPRN_HXX
+#if 0
#define _SV_IMPPRN_HXX
#include <vcl/print.hxx>
@@ -107,7 +107,6 @@ public:
/**
used by pull implementation to emit the next page
*/
- using Printer::PrintPage;
void PrintPage( unsigned int nPage );
/**
used by pull implementation to get the number of physical pages
diff --git a/vcl/inc/vcl/jobdata.hxx b/vcl/inc/vcl/jobdata.hxx
index 4451c566b5bf..d328f41f5b5b 100644
--- a/vcl/inc/vcl/jobdata.hxx
+++ b/vcl/inc/vcl/jobdata.hxx
@@ -74,6 +74,8 @@ struct JobData
JobData( const JobData& rData ) { *this = rData; }
+ void setCollate( bool bCollate );
+
// creates a new buffer using new
// it is up to the user to delete it again
bool getStreamBuffer( void*& pData, int& bytes );
diff --git a/vcl/inc/vcl/jobset.h b/vcl/inc/vcl/jobset.h
index 9f3eefd507d5..fd15d0c076da 100644
--- a/vcl/inc/vcl/jobset.h
+++ b/vcl/inc/vcl/jobset.h
@@ -60,12 +60,13 @@ struct ImplJobSetup
String maPrinterName; // Printer-Name
String maDriver; // Driver-Name
Orientation meOrientation; // Orientation
- USHORT mnPaperBin; // Papierschacht
- Paper mePaperFormat; // Papierformat
- long mnPaperWidth; // Papierbreite in 100tel mm
- long mnPaperHeight; // Papierhoehe in 100tel mm
- ULONG mnDriverDataLen; // Laenge der systemabhaengigen Daten
- BYTE* mpDriverData; // Systemabhaengige Daten die als Byte-Block rausgeschrieben werden
+ DuplexMode meDuplexMode; // Duplex
+ USHORT mnPaperBin; // paper bin / in tray
+ Paper mePaperFormat; // paper format
+ long mnPaperWidth; // paper width (100th mm)
+ long mnPaperHeight; // paper height (100th mm)
+ ULONG mnDriverDataLen; // length of system specific data
+ BYTE* mpDriverData; // system specific data (will be streamed a byte block)
::std::hash_map< ::rtl::OUString, ::rtl::OUString, ::rtl::OUStringHash > maValueMap;
ImplJobSetup();
diff --git a/vcl/inc/vcl/lstbox.h b/vcl/inc/vcl/lstbox.h
index 6097422b556b..9b95b9526d58 100644
--- a/vcl/inc/vcl/lstbox.h
+++ b/vcl/inc/vcl/lstbox.h
@@ -60,4 +60,9 @@
*/
#define LISTBOX_ENTRY_FLAG_MULTILINE 0x0000002
+/** this flags lets the item be drawn disabled (e.g. in grey text)
+ usage only guaranteed with LISTBOX_ENTRY_FLAG_DISABLE_SELECTION
+*/
+#define LISTBOX_ENTRY_FLAG_DRAW_DISABLED 0x0000004
+
#endif // _SV_LSTBOX_H
diff --git a/vcl/inc/vcl/lstbox.hxx b/vcl/inc/vcl/lstbox.hxx
index 0bf281798674..806ff9bb3e0f 100644
--- a/vcl/inc/vcl/lstbox.hxx
+++ b/vcl/inc/vcl/lstbox.hxx
@@ -168,9 +168,13 @@ public:
long GetEntryFlags( USHORT nPos ) const;
void SetTopEntry( USHORT nPos );
+ void ShowProminentEntry( USHORT nPos );
void SetTopEntryStr( const XubString& rStr );
USHORT GetTopEntry() const;
+ void SetProminentEntryType( ProminentEntry eType );
+ ProminentEntry GetProminentEntryType() const;
+
void SaveValue() { mnSaveValue = GetSelectEntryPos(); }
USHORT GetSavedValue() const { return mnSaveValue; }
diff --git a/vcl/inc/vcl/menu.hxx b/vcl/inc/vcl/menu.hxx
index 8d3ac4e8b505..66f35823b06a 100644
--- a/vcl/inc/vcl/menu.hxx
+++ b/vcl/inc/vcl/menu.hxx
@@ -93,6 +93,8 @@ typedef USHORT MenuItemBits;
#define MIB_POPUPSELECT ((MenuItemBits)0x0020)
// not in rsc/vclsrc.hxx because only a prelimitary solution
#define MIB_NOSELECT ((MenuItemBits)0x0040)
+#define MIB_ICON ((MenuItemBits)0x0080)
+#define MIB_TEXT ((MenuItemBits)0x0100)
#define MENU_FLAG_NOAUTOMNEMONICS 0x0001
#define MENU_FLAG_HIDEDISABLEDENTRIES 0x0002
diff --git a/vcl/inc/vcl/oldprintadaptor.hxx b/vcl/inc/vcl/oldprintadaptor.hxx
new file mode 100644
index 000000000000..d8b26433af94
--- /dev/null
+++ b/vcl/inc/vcl/oldprintadaptor.hxx
@@ -0,0 +1,52 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _VCL_OLDPRINTADAPTOR
+#define _VCL_OLDPRINTADAPTOR
+
+#include "vcl/print.hxx"
+
+namespace vcl
+{
+ struct ImplOldStyleAdaptorData;
+ class VCL_DLLPUBLIC OldStylePrintAdaptor : public PrinterController
+ {
+ ImplOldStyleAdaptorData* mpData;
+ public:
+ OldStylePrintAdaptor( const boost::shared_ptr< Printer >& );
+ virtual ~OldStylePrintAdaptor();
+
+ void StartPage();
+ void EndPage();
+
+ virtual int getPageCount() const;
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParameters( int i_nPage ) const;
+ virtual void printPage( int i_nPage ) const;
+ };
+}
+
+#endif
diff --git a/vcl/inc/vcl/outdev.hxx b/vcl/inc/vcl/outdev.hxx
index 4a5b92444c21..0c03652d9300 100644
--- a/vcl/inc/vcl/outdev.hxx
+++ b/vcl/inc/vcl/outdev.hxx
@@ -1131,12 +1131,15 @@ public:
false: output metafile is unchanged input metafile
@attention this is a member method, so current state can influence the result !
+ @attention the output metafile is prepared in pixel mode for the currentOutputDevice
+ state. It can not be moved or rotated reliably anymore.
*/
bool RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, GDIMetaFile& rOutMtf,
long nMaxBmpDPIX, long nMaxBmpDPIY,
bool bReduceTransparency,
bool bTransparencyAutoMode,
- bool bDownsampleBitmaps
+ bool bDownsampleBitmaps,
+ const Color& rBackground = Color( COL_TRANSPARENT )
);
/** Retrieve downsampled and cropped bitmap
diff --git a/vcl/inc/vcl/popupmenuwindow.hxx b/vcl/inc/vcl/popupmenuwindow.hxx
new file mode 100644
index 000000000000..af8d1f804598
--- /dev/null
+++ b/vcl/inc/vcl/popupmenuwindow.hxx
@@ -0,0 +1,50 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: floatwin.hxx,v $
+ * $Revision: 1.3 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef __POPUPMENUWINDOW_HXX__
+#define __POPUPMENUWINDOW_HXX__
+
+#include "vcl/floatwin.hxx"
+
+class VCL_DLLPUBLIC PopupMenuFloatingWindow : public FloatingWindow
+{
+private:
+ struct ImplData;
+ ImplData* mpImplData;
+public:
+ PopupMenuFloatingWindow( Window* pParent, WinBits nStyle = (WB_SYSTEMFLOATWIN|WB_SYSTEMWINDOW|WB_NOBORDER) );
+ ~PopupMenuFloatingWindow();
+
+ sal_uInt16 GetMenuStackLevel() const;
+ void SetMenuStackLevel( sal_uInt16 nLevel );
+ bool IsPopupMenu() const;
+};
+
+#endif
diff --git a/vcl/inc/vcl/ppdparser.hxx b/vcl/inc/vcl/ppdparser.hxx
index ed9f91b97d99..ba5bc5004362 100644
--- a/vcl/inc/vcl/ppdparser.hxx
+++ b/vcl/inc/vcl/ppdparser.hxx
@@ -37,11 +37,14 @@
#include "tools/string.hxx"
#include "tools/stream.hxx"
+#include "com/sun/star/lang/Locale.hpp"
+
#define PRINTER_PPDDIR "driver"
namespace psp {
class PPDParser;
+class PPDTranslator;
enum PPDValueType { eInvocation, eQuoted, eSymbol, eString, eNo };
@@ -49,9 +52,7 @@ struct PPDValue
{
PPDValueType m_eType;
String m_aOption;
- String m_aOptionTranslation;
String m_aValue;
- String m_aValueTranslation;
};
// ----------------------------------------------------------------------
@@ -80,7 +81,6 @@ public:
private:
bool m_bUIOption;
- String m_aUITranslation;
UIType m_eUIType;
int m_nOrderDependency;
SetupType m_eSetupType;
@@ -102,7 +102,6 @@ public:
const String& getKey() const { return m_aKey; }
bool isUIKey() const { return m_bUIOption; }
- const String& getUITranslation() const { return m_aUITranslation; }
UIType getUIType() const { return m_eUIType; }
SetupType getSetupType() const { return m_eSetupType; }
int getOrderDependency() const { return m_nOrderDependency; }
@@ -185,6 +184,9 @@ private:
// fonts
const PPDKey* m_pFontList;
+ // translations
+ PPDTranslator* m_pTranslator;
+
PPDParser( const String& rFile );
~PPDParser();
@@ -193,7 +195,7 @@ private:
void parseConstraint( const ByteString& rLine );
void parse( std::list< ByteString >& rLines );
- String handleTranslation( const ByteString& rString );
+ String handleTranslation( const ByteString& i_rString, bool i_bIsGlobalized );
static void scanPPDDir( const String& rDir );
static void initPPDFiles();
@@ -277,6 +279,17 @@ public:
String& rEncoding,
String& rCharset ) const;
const String& getFont( int ) const;
+
+
+ rtl::OUString translateKey( const rtl::OUString& i_rKey,
+ const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const;
+ rtl::OUString translateOption( const rtl::OUString& i_rKey,
+ const rtl::OUString& i_rOption,
+ const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const;
+ rtl::OUString translateValue( const rtl::OUString& i_rKey,
+ const rtl::OUString& i_rOption,
+ const rtl::OUString& i_rValue,
+ const com::sun::star::lang::Locale& i_rLocale = com::sun::star::lang::Locale() ) const;
};
// ----------------------------------------------------------------------
diff --git a/vcl/inc/vcl/print.h b/vcl/inc/vcl/print.h
index 51cbb5dee0cf..12c7439aa5b3 100644
--- a/vcl/inc/vcl/print.h
+++ b/vcl/inc/vcl/print.h
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: print.h,v $
- * $Revision: 1.4 $
+ * $Revision: 1.4.114.2 $
*
* This file is part of OpenOffice.org.
*
@@ -31,27 +31,18 @@
#ifndef _SV_PRINT_H
#define _SV_PRINT_H
-#include <tools/list.hxx>
-#include <vcl/sv.h>
-#include <vcl/dllapi.h>
+#include "vcl/sv.h"
+#include "vcl/dllapi.h"
#include <vector>
#include <hash_map>
struct SalPrinterQueueInfo;
class QueueInfo;
+class JobSetup;
-// ------------------------
-// - private printer data -
-// ------------------------
-struct ImplPrivatePrinterData
-{
- bool mbNextJobIsQuick;
-
- ImplPrivatePrinterData() :
- mbNextJobIsQuick( false )
- {}
-};
+namespace vcl
+{ class PrinterListener; }
// --------------------
// - ImplPrnQueueData -
@@ -87,5 +78,7 @@ public:
// --------------
void ImplDeletePrnQueueList();
+void SAL_DLLPRIVATE ImplUpdateJobSetupPaper( JobSetup& rJobSetup );
+
#endif // _SV_PRINT_H
diff --git a/vcl/inc/vcl/print.hxx b/vcl/inc/vcl/print.hxx
index b9176f4106dc..daea0c941dd0 100644
--- a/vcl/inc/vcl/print.hxx
+++ b/vcl/inc/vcl/print.hxx
@@ -31,14 +31,22 @@
#ifndef _SV_PRINT_HXX
#define _SV_PRINT_HXX
-#include <tools/errcode.hxx>
-#include <vcl/sv.h>
-#include <vcl/dllapi.h>
-#include <vcl/outdev.hxx>
-#include <vcl/prntypes.hxx>
-#include <vcl/jobset.hxx>
-#include <vcl/gdimtf.hxx>
-#include <tools/stream.hxx>
+#include "tools/errcode.hxx"
+#include "vcl/sv.h"
+#include "vcl/dllapi.h"
+#include "vcl/outdev.hxx"
+#include "vcl/prntypes.hxx"
+#include "vcl/jobset.hxx"
+#include "vcl/gdimtf.hxx"
+#include "tools/stream.hxx"
+#include "tools/multisel.hxx"
+
+#include "com/sun/star/beans/PropertyValue.hpp"
+#include "com/sun/star/view/PrintableState.hpp"
+
+#include <boost/shared_ptr.hpp>
+#include <hash_map>
+#include <set>
struct SalPrinterInfoQueue;
class SalInfoPrinter;
@@ -46,12 +54,11 @@ struct SalPrinterQueueInfo;
class SalPrinter;
class VirtualDevice;
class Window;
-class ImplQPrinter;
-struct ImplPrivatePrinterData;
-namespace com { namespace sun { namespace star { namespace uno {
- class Any;
-} } } }
+namespace vcl {
+ class PrinterController;
+ class PrintDialog;
+}
// -----------------
// - Printer-Types -
@@ -216,16 +223,12 @@ class VCL_DLLPUBLIC Printer : public OutputDevice
friend class ImplQPrinter;
private:
- ImplPrivatePrinterData* mpPrinterData;
SalInfoPrinter* mpInfoPrinter;
SalPrinter* mpPrinter;
- Printer* mpJobPrinter;
SalGraphics* mpJobGraphics;
Printer* mpPrev;
Printer* mpNext;
VirtualDevice* mpDisplayDev;
- ImplQPrinter* mpQPrinter;
- GDIMetaFile* mpQMtf;
PrinterOptions* mpPrinterOptions;
XubString maPrinterName;
XubString maDriver;
@@ -250,9 +253,6 @@ private:
BOOL mbUserSetupCompleted;
BOOL mbUserSetupResult;
Link maErrorHdl;
- Link maStartPrintHdl;
- Link maEndPrintHdl;
- Link maPrintPageHdl;
SAL_DLLPRIVATE void ImplInitData();
SAL_DLLPRIVATE void ImplInit( SalPrinterQueueInfo* pInfo );
@@ -261,22 +261,25 @@ private:
const XubString* pDriver );
SAL_DLLPRIVATE void ImplUpdatePageData();
SAL_DLLPRIVATE void ImplUpdateFontList();
- SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup& );
+ SAL_DLLPRIVATE void ImplFindPaperFormatForUserSize( JobSetup&, bool bMatchNearest );
DECL_DLLPRIVATE_LINK( ImplDestroyPrinterAsync, void* );
-public:
- SAL_DLLPRIVATE void ImplEndPrint();
- SAL_DLLPRIVATE void ImplUpdateQuickStatus();
+
+ SAL_DLLPRIVATE bool StartJob( const rtl::OUString& rJobName, boost::shared_ptr<vcl::PrinterController>& );
+
+ static SAL_DLLPRIVATE ULONG ImplSalPrinterErrorCodeToVCL( ULONG nError );
+
private:
+ SAL_DLLPRIVATE void ImplEndPrint();
+ SAL_DLLPRIVATE BOOL EndJob();
SAL_DLLPRIVATE Printer( const Printer& rPrinter );
SAL_DLLPRIVATE Printer& operator =( const Printer& rPrinter );
-
-#ifdef _SPOOLPRINTER_EXT
+public:
+ SAL_DLLPRIVATE void ImplStartPage();
+ SAL_DLLPRIVATE void ImplEndPage();
public:
void DrawGradientEx( OutputDevice* pOut, const Rectangle& rRect, const Gradient& rGradient );
void DrawGradientEx( OutputDevice* pOut, const PolyPolygon& rPolyPoly, const Gradient& rGradient );
-#endif // _SPOOLPRINTER_EXT
-
protected:
void SetSelfAsQueuePrinter( BOOL bQueuePrinter ) { mbIsQueuePrinter = bQueuePrinter; }
@@ -295,9 +298,6 @@ public:
static XubString GetDefaultPrinterName();
virtual void Error();
- virtual void StartPrint();
- virtual void EndPrint();
- virtual void PrintPage();
const XubString& GetName() const { return maPrinterName; }
const XubString& GetDriverName() const { return maDriver; }
@@ -322,6 +322,7 @@ public:
BOOL SetOrientation( Orientation eOrient );
Orientation GetOrientation() const;
DuplexMode GetDuplexMode() const;
+ BOOL SetDuplexMode( DuplexMode );
// returns the angle that a landscape page will be turned counterclockwise
// wrt to portrait. The return value may be only valid for
// the current paper
@@ -330,6 +331,7 @@ public:
USHORT GetPaperBin() const;
BOOL SetPaper( Paper ePaper );
BOOL SetPaperSizeUser( const Size& rSize );
+ BOOL SetPaperSizeUser( const Size& rSize, bool bMatchNearest );
Paper GetPaper() const;
// returns number of available paper formats
@@ -348,58 +350,333 @@ public:
USHORT GetCopyCount() const { return mnCopyCount; }
BOOL IsCollateCopy() const { return mbCollateCopy; }
- USHORT GetCurPrintPage() const { return mnCurPrintPage; }
BOOL IsPrinting() const { return mbPrinting; }
void SetPrintFile( const XubString& rFileName ) { maPrintFile = rFileName; }
const XubString& GetPrintFile() const { return maPrintFile; }
void EnablePrintFile( BOOL bEnable ) { mbPrintFile = bEnable; }
BOOL IsPrintFileEnabled() const { return mbPrintFile; }
- BOOL StartJob( const XubString& rJobName );
- BOOL EndJob();
BOOL AbortJob();
const XubString& GetCurJobName() const { return maJobName; }
USHORT GetCurPage() const { return mnCurPage; }
BOOL IsJobActive() const { return mbJobActive; }
- BOOL StartPage();
- BOOL EndPage();
-
- void SetPageQueueSize( USHORT nPages ) { mnPageQueueSize = nPages; }
- USHORT GetPageQueueSize() const { return mnPageQueueSize; }
ULONG GetError() const { return ERRCODE_TOERROR(mnError); }
ULONG GetErrorCode() const { return mnError; }
void SetErrorHdl( const Link& rLink ) { maErrorHdl = rLink; }
const Link& GetErrorHdl() const { return maErrorHdl; }
- void SetStartPrintHdl( const Link& rLink ) { maStartPrintHdl = rLink; }
- const Link& GetStartPrintHdl() const { return maStartPrintHdl; }
- void SetEndPrintHdl( const Link& rLink ) { maEndPrintHdl = rLink; }
- const Link& GetEndPrintHdl() const { return maEndPrintHdl; }
- void SetPrintPageHdl( const Link& rLink ) { maPrintPageHdl = rLink; }
- const Link& GetPrintPageHdl() const { return maPrintPageHdl; }
void Compat_OldPrinterMetrics( bool bSet );
- /** Notify that the next StartJob belongs to a UI less "direct print" job
- *
- * deprecated: the canonical way to notify a UI less job is to set the
- * JobSetup value "IsQuickJob" to "true". If set at all, the "IsQuickJob" value
- * on JobSetup will be preferred. However if no "IsQuickJob" value is set,
- * setting SetNextJobIsQuick will cause the following StartJob to set this value
- * to "true" in the current JobSetup.
- *
- * the paramter can be set to "false" again in case a job was not started and the
- * printer is to be reused.
- */
- void SetNextJobIsQuick( bool bQuick = true );
-
/** checks the printer list and updates it necessary
*
* sends a DataChanged event of type DATACHANGED_PRINTER
* if the printer list changed
*/
static void updatePrinters();
+
+ /** execute a print job
+
+ starts a print job asynchronously (that is will return
+
+ */
+ static void PrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController,
+ const JobSetup& i_rInitSetup
+ );
+
+ // implementation detail of PrintJob being asynchronous
+ // not exported, not usable outside vcl
+ static void SAL_DLLPRIVATE ImplPrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController,
+ const JobSetup& i_rInitSetup
+ );
+};
+
+namespace vcl
+{
+class ImplPrinterControllerData;
+
+class VCL_DLLPUBLIC PrinterController
+{
+ ImplPrinterControllerData* mpImplData;
+protected:
+ PrinterController( const boost::shared_ptr<Printer>& );
+public:
+ enum NupOrderType
+ { LRTB, TBLR };
+ struct MultiPageSetup
+ {
+ // all metrics in 100th mm
+ int nRows;
+ int nColumns;
+ int nRepeat;
+ Size aPaperSize;
+ long nLeftMargin;
+ long nTopMargin;
+ long nRightMargin;
+ long nBottomMargin;
+ long nHorizontalSpacing;
+ long nVerticalSpacing;
+ bool bDrawBorder;
+ PrinterController::NupOrderType nOrder;
+
+ MultiPageSetup()
+ : nRows( 1 ), nColumns( 1 ), nRepeat( 1 ), aPaperSize( 21000, 29700 )
+ , nLeftMargin( 0 ), nTopMargin( 0 )
+ , nRightMargin( 0 ), nBottomMargin( 0 )
+ , nHorizontalSpacing( 0 ), nVerticalSpacing( 0 )
+ , bDrawBorder( false )
+ , nOrder( LRTB )
+ {
+ }
+ };
+
+ struct PageSize
+ {
+ Size aSize; // in 100th mm
+ bool bFullPaper; // full paper, not only imageable area is printed
+
+ PageSize( const Size& i_rSize = Size( 21000, 29700 ),
+ bool i_bFullPaper = false
+ ) : aSize( i_rSize ), bFullPaper( i_bFullPaper ) {}
+ };
+
+ PrinterController();
+ virtual ~PrinterController();
+
+ const boost::shared_ptr<Printer>& getPrinter() const;
+ /* for implementations: get current job properties as changed by e.g. print dialog
+ this gets the current set of properties initially told to Printer::PrintJob
+
+ For convenience a second sequence will be merged in to get a combined sequence.
+ In case of duplicate property names, the value of i_MergeList wins.
+ */
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >
+ getJobProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rMergeList ) const;
+
+ /* get the PropertyValue of a Property
+ */
+ com::sun::star::beans::PropertyValue* getValue( const rtl::OUString& i_rPropertyName );
+ const com::sun::star::beans::PropertyValue* getValue( const rtl::OUString& i_rPropertyName ) const;
+ // get a sequence of properties
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getValues( const com::sun::star::uno::Sequence< rtl::OUString >& ) const;
+ /* get a bool property
+ in case the property is unknown or not convertible to bool, i_bFallback is returned
+ */
+ sal_Bool getBoolProperty( const rtl::OUString& i_rPropertyName, sal_Bool i_bFallback ) const;
+
+ /* set a property value - can also be used to add another UI property
+ */
+ void setValue( const rtl::OUString& i_rPropertyName, const com::sun::star::uno::Any& i_rValue );
+ void setValue( const com::sun::star::beans::PropertyValue& i_rValue );
+
+ /* return the currently active UI options. These are the same that were passed to setUIOptions.
+ */
+ const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& getUIOptions() const;
+ /* set possible UI options. should only be done once before passing the PrinterListener
+ to Printer::PrintJob
+ */
+ void setUIOptions( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& );
+ /* enable/disable an option; this can be used to implement dialog logic.
+ */
+ void enableUIOption( const rtl::OUString& rPropName, bool bEnable );
+ bool isUIOptionEnabled( const rtl::OUString& rPropName ) const;
+ /* returns the property name rPropName depends on or an empty string
+ if no dependency exists.
+ */
+ rtl::OUString getDependency( const rtl::OUString& rPropName ) const;
+ /* makeEnabled will chage the property rPropName depends on to the value
+ that makes rPropName enabled. If the dependency itself is also disabled,
+ no action will be performed.
+
+ returns the property name rPropName depends on or an empty string
+ if no change was made.
+ */
+ rtl::OUString makeEnabled( const rtl::OUString& rPropName );
+
+ virtual int getPageCount() const = 0; // must be overloaded by the app
+ /* get the page parameters, namely the jobsetup that should be active for the page
+ (describing among others the physical page size) and the "page size". In writer
+ case this would probably be the same as the JobSetup since writer sets the page size
+ draw/impress for example print their page on the paper set on the printer,
+ possibly adjusting the page size to fit. That means the page size can be different from
+ the paper size.
+ */
+ // must be overloaded by the app, return page size in 1/100th mm
+ virtual com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParameters( int i_nPage ) const = 0;
+ virtual void printPage( int i_nPage ) const = 0; // must be overloaded by the app
+ virtual void jobStarted(); // will be called after a possible dialog has been shown and the real printjob starts
+ virtual void jobFinished( com::sun::star::view::PrintableState );
+
+ com::sun::star::view::PrintableState getJobState() const;
+
+ void abortJob();
+
+ bool isShowDialogs() const;
+ bool isDirectPrint() const;
+
+ // implementation details, not usable outside vcl
+ SAL_DLLPRIVATE int getFilteredPageCount();
+ SAL_DLLPRIVATE PageSize getPageFile( int i_inUnfilteredPage, GDIMetaFile& rMtf, bool i_bMayUseCache = false );
+ SAL_DLLPRIVATE PageSize getFilteredPageFile( int i_nFilteredPage, GDIMetaFile& o_rMtf, bool i_bMayUseCache = false );
+ SAL_DLLPRIVATE void printFilteredPage( int i_nPage );
+ SAL_DLLPRIVATE void setPrinter( const boost::shared_ptr<Printer>& );
+ SAL_DLLPRIVATE void setOptionChangeHdl( const Link& );
+ SAL_DLLPRIVATE void createProgressDialog();
+ SAL_DLLPRIVATE void setMultipage( const MultiPageSetup& );
+ SAL_DLLPRIVATE const MultiPageSetup& getMultipage() const;
+ SAL_DLLPRIVATE void setLastPage( sal_Bool i_bLastPage );
+ SAL_DLLPRIVATE void setReversePrint( sal_Bool i_bReverse );
+ SAL_DLLPRIVATE bool getReversePrint() const;
+ SAL_DLLPRIVATE void pushPropertiesToPrinter();
+ SAL_DLLPRIVATE void setJobState( com::sun::star::view::PrintableState );
+ SAL_DLLPRIVATE bool setupPrinter( Window* i_pDlgParent );
+
+ SAL_DLLPRIVATE int getPageCountProtected() const;
+ SAL_DLLPRIVATE com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > getPageParametersProtected( int i_nPage ) const;
+
+ SAL_DLLPRIVATE ULONG removeTransparencies( GDIMetaFile& i_rIn, GDIMetaFile& o_rOut );
};
+class VCL_DLLPUBLIC PrinterOptionsHelper
+{
+ protected:
+ std::hash_map< rtl::OUString, com::sun::star::uno::Any, rtl::OUStringHash > m_aPropertyMap;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > m_aUIProperties;
+
+ public:
+ PrinterOptionsHelper() {} // create without ui properties
+ PrinterOptionsHelper( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rUIProperties )
+ : m_aUIProperties( i_rUIProperties )
+ {}
+ ~PrinterOptionsHelper()
+ {}
+
+ /* process a new set of properties
+ * merges changed properties and returns "true" if any occured
+ * if the optional output set is not NULL then the names of the changed properties are returned
+ **/
+ bool processProperties( const com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& i_rNewProp,
+ std::set< rtl::OUString >* o_pChangeProp = NULL );
+ /* append to a sequence of property values the ui property sequence passed at creation
+ * as the "ExtraPrintUIOptions" property. if that sequence was empty, no "ExtraPrintUIOptions" property
+ * will be appended.
+ **/
+ void appendPrintUIOptions( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& io_rProps ) const;
+
+ // check if a property exists
+ bool hasProperty( const rtl::OUString& i_rPropertyName ) const;
+ bool hasProperty( const char* i_pPropertyName ) const
+ { return hasProperty( rtl::OUString::createFromAscii( i_pPropertyName ) ); }
+
+ // returns an empty Any for not existing properties
+ com::sun::star::uno::Any getValue( const rtl::OUString& i_rPropertyName ) const;
+ // change a value in the property set; this will not have an effect to an eventual PrinterController
+ // the user of setValue must decide whether it is necessary to set the value there also
+ void setValue( const rtl::OUString& i_rPropertyName, const com::sun::star::uno::Any& i_rValue );
+ void setValue( const char* i_pPropertyName, const com::sun::star::uno::Any& i_rValue )
+ { setValue( rtl::OUString::createFromAscii( i_pPropertyName ), i_rValue ); }
+
+ sal_Bool getBoolValue( const rtl::OUString& i_rPropertyName, sal_Bool i_bDefault = sal_False ) const;
+ // convenience for fixed strings
+ sal_Bool getBoolValue( const char* i_pPropName, sal_Bool i_bDefault = sal_False ) const
+ { return getBoolValue( rtl::OUString::createFromAscii( i_pPropName ), i_bDefault ); }
+
+ sal_Int64 getIntValue( const rtl::OUString& i_rPropertyName, sal_Int64 i_nDefault = 0 ) const;
+ // convenience for fixed strings
+ sal_Int64 getIntValue( const char* i_pPropName, sal_Int64 i_nDefault = 0 ) const
+ { return getIntValue( rtl::OUString::createFromAscii( i_pPropName ), i_nDefault ); }
+
+ rtl::OUString getStringValue( const rtl::OUString& i_rPropertyName, const rtl::OUString& i_rDefault = rtl::OUString() ) const;
+ // convenience for fixed strings
+ rtl::OUString getStringValue( const char* i_pPropName, const rtl::OUString& i_rDefault = rtl::OUString() ) const
+ { return getStringValue( rtl::OUString::createFromAscii( i_pPropName ), i_rDefault ); }
+
+ // helper functions for user to create a single control
+ struct UIControlOptions
+ {
+ rtl::OUString maDependsOnName;
+ sal_Int32 mnDependsOnEntry;
+ sal_Bool mbAttachToDependency;
+ rtl::OUString maGroupHint;
+ sal_Bool mbInternalOnly;
+ sal_Bool mbEnabled;
+ com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > maAddProps;
+
+ UIControlOptions( const rtl::OUString& i_rDependsOnName = rtl::OUString(),
+ sal_Int32 i_nDependsOnEntry = -1,
+ sal_Bool i_bAttachToDependency = sal_False,
+ const rtl::OUString& i_rGroupHint = rtl::OUString(),
+ sal_Bool i_bInternalOnly = sal_False,
+ sal_Bool i_bEnabled = sal_True
+ )
+ : maDependsOnName( i_rDependsOnName )
+ , mnDependsOnEntry( i_nDependsOnEntry )
+ , mbAttachToDependency( i_bAttachToDependency )
+ , maGroupHint( i_rGroupHint )
+ , mbInternalOnly( i_bInternalOnly )
+ , mbEnabled( i_bEnabled ) {}
+ };
+
+ // general control
+ static com::sun::star::uno::Any getUIControlOpt( const rtl::OUString& i_rTitle,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+ const rtl::OUString& i_rType,
+ const com::sun::star::beans::PropertyValue* i_pValue = NULL,
+ const UIControlOptions& i_rControlOptions = UIControlOptions()
+ );
+ // create a group (e.g. a TabPage); following controls will be grouped in it until the next
+ // group begins
+ static com::sun::star::uno::Any getGroupControlOpt( const rtl::OUString& i_rTitle, const rtl::OUString& i_rHelpText );
+
+ // create a subgroup (e.g. a FixedLine); following controls will be grouped in it until the next
+ // subgroup or group begins
+ // setting bJobPage = true will make the subgroup appear on the first page of the print dialog
+ static com::sun::star::uno::Any getSubgroupControlOpt( const rtl::OUString& i_rTitle,
+ const rtl::OUString& i_rHelpText,
+ const UIControlOptions& i_rControlOptions = UIControlOptions()
+ );
+
+ // create a bool option (usually a checkbox)
+ static com::sun::star::uno::Any getBoolControlOpt( const rtl::OUString& i_rTitle,
+ const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rProperty,
+ sal_Bool i_bValue,
+ const UIControlOptions& i_rControlOptions = UIControlOptions()
+ );
+
+ // create a set of choices (either a radio button group or a list box)
+ static com::sun::star::uno::Any getChoiceControlOpt( const rtl::OUString& i_rTitle,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rHelpText,
+ const rtl::OUString& i_rProperty,
+ const com::sun::star::uno::Sequence< rtl::OUString >& i_rChoices,
+ sal_Int32 i_nValue,
+ const rtl::OUString& i_rType = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Radio" ) ),
+ const UIControlOptions& i_rControlOptions = UIControlOptions()
+ );
+
+ // create an integer range (e.g. a spin field)
+ // note: max value < min value means do not apply min/max values
+ static com::sun::star::uno::Any getRangeControlOpt( const rtl::OUString& i_rTitle,
+ const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rProperty,
+ sal_Int32 i_nValue,
+ sal_Int32 i_nMinValue = -1,
+ sal_Int32 i_nMaxValue = -2,
+ const UIControlOptions& i_rControlOptions = UIControlOptions()
+ );
+
+ // create a string field
+ // note: max value < min value means do not apply min/max values
+ static com::sun::star::uno::Any getEditControlOpt( const rtl::OUString& i_rTitle,
+ const rtl::OUString& i_rHelpText,
+ const rtl::OUString& i_rProperty,
+ const rtl::OUString& i_rValue,
+ const UIControlOptions& i_rControlOptions = UIControlOptions()
+ );
+};
+
+}
+
+
#endif // _SV_PRINT_HXX
diff --git a/vcl/inc/vcl/printerinfomanager.hxx b/vcl/inc/vcl/printerinfomanager.hxx
index 810ad428c9db..2fb6ef1c2413 100644
--- a/vcl/inc/vcl/printerinfomanager.hxx
+++ b/vcl/inc/vcl/printerinfomanager.hxx
@@ -136,6 +136,7 @@ protected:
Type m_eType;
bool m_bUseIncludeFeature;
+ bool m_bUseJobPatch;
rtl::OUString m_aSystemDefaultPaper;
bool m_bDisableCUPS;
@@ -226,6 +227,7 @@ public:
virtual bool addOrRemovePossible() const;
bool getUseIncludeFeature() const { return m_bUseIncludeFeature; }
+ bool getUseJobPatch() const { return m_bUseJobPatch; }
// check whether a printer's feature string contains a subfeature
bool checkFeatureToken( const rtl::OUString& rPrinterName, const char* pToken ) const;
diff --git a/vcl/inc/vcl/printerjob.hxx b/vcl/inc/vcl/printerjob.hxx
index 9880700d4008..e445a81d54c8 100644
--- a/vcl/inc/vcl/printerjob.hxx
+++ b/vcl/inc/vcl/printerjob.hxx
@@ -91,7 +91,7 @@ private: // private methods
bool writeFeatureList( osl::File* pFile, const JobData&, bool bDocumentSetup );
bool writeSetup( osl::File* pFile, const JobData& );
- bool writePageSetup( osl::File* pFile, const JobData& );
+ bool writePageSetup( osl::File* pFile, const JobData&, bool bWriteFeatures = true );
void writeJobPatch( osl::File* File, const JobData& );
bool writeProlog (osl::File* pFile, const JobData& );
diff --git a/vcl/inc/vcl/prndlg.hxx b/vcl/inc/vcl/prndlg.hxx
index 4fd6eaa999da..f1b69e1ca3aa 100644
--- a/vcl/inc/vcl/prndlg.hxx
+++ b/vcl/inc/vcl/prndlg.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: prndlg.hxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.114.5 $
*
* This file is part of OpenOffice.org.
*
@@ -33,19 +33,301 @@
#include <vcl/dllapi.h>
-#include <vcl/dialog.hxx>
+#include "vcl/print.hxx"
+#include "vcl/print.h"
-class Printer;
+#include "vcl/dialog.hxx"
+#include "vcl/fixed.hxx"
+#include "vcl/button.hxx"
+#include "vcl/gdimtf.hxx"
+#include "vcl/lstbox.hxx"
+#include "vcl/field.hxx"
+#include "vcl/tabctrl.hxx"
+#include "vcl/tabpage.hxx"
+#include "vcl/arrange.hxx"
+#include "vcl/virdev.hxx"
-class VCL_DLLPUBLIC SystemDialog : public ModalDialog
+#include <boost/shared_ptr.hpp>
+#include <map>
+
+namespace vcl
{
-public:
- SystemDialog( Window* pParent, WinBits nWinStyle ) :
- ModalDialog( pParent, nWinStyle ) {}
- SystemDialog( Window* pParent, const ResId& rResId ) :
- ModalDialog( pParent, rResId ) {}
-
- virtual short Execute() { return 0; }
-};
+ class PrintDialog : public ModalDialog
+ {
+ class PrintPreviewWindow : public Window
+ {
+ GDIMetaFile maMtf;
+ Size maOrigSize;
+ VirtualDevice maPageVDev;
+ rtl::OUString maReplacementString;
+ rtl::OUString maToolTipString;
+ public:
+ PrintPreviewWindow( Window* pParent, const ResId& );
+ virtual ~PrintPreviewWindow();
+
+ virtual void Paint( const Rectangle& rRect );
+ virtual void Command( const CommandEvent& );
+ virtual void Resize();
+ virtual void DataChanged( const DataChangedEvent& );
+
+ void setPreview( const GDIMetaFile&, const Size&, const rtl::OUString&,
+ sal_Int32 i_nDPIX, sal_Int32 i_nDPIY
+ );
+ };
+
+ class ShowNupOrderWindow : public Window
+ {
+ int mnOrderMode;
+ int mnRows;
+ int mnColumns;
+ void ImplInitSettings();
+ public:
+ ShowNupOrderWindow( Window* pParent );
+ virtual ~ShowNupOrderWindow();
+
+ virtual void Paint( const Rectangle& );
+
+ void setValues( int i_nOrderMode, int i_nColumns, int i_nRows )
+ {
+ mnOrderMode = i_nOrderMode;
+ mnRows = i_nRows;
+ mnColumns = i_nColumns;
+ Invalidate();
+ }
+ };
+
+ class NUpTabPage : public TabPage
+ {
+ public:
+ FixedLine maNupLine;
+ RadioButton maPagesBtn;
+ RadioButton maBrochureBtn;
+ FixedText maPagesBoxTitleTxt;
+ ListBox maNupPagesBox;
+
+ // controls for "Custom" page mode
+ FixedText maNupNumPagesTxt;
+ NumericField maNupColEdt;
+ FixedText maNupTimesTxt;
+ NumericField maNupRowsEdt;
+ FixedText maPageMarginTxt1;
+ MetricField maPageMarginEdt;
+ FixedText maPageMarginTxt2;
+ FixedText maSheetMarginTxt1;
+ MetricField maSheetMarginEdt;
+ FixedText maSheetMarginTxt2;
+ FixedText maNupOrientationTxt;
+ ListBox maNupOrientationBox;
+
+ // page order ("left to right, then down")
+ FixedText maNupOrderTxt;
+ ListBox maNupOrderBox;
+ ShowNupOrderWindow maNupOrderWin;
+ // border around each page
+ CheckBox maBorderCB;
+
+ vcl::RowOrColumn maLayout;
+ boost::shared_ptr< vcl::RowOrColumn > mxBrochureDep;
+ boost::shared_ptr< vcl::LabeledElement >mxPagesBtnLabel;
+
+ void setupLayout();
+
+ NUpTabPage( Window*, const ResId& );
+ virtual ~NUpTabPage();
+
+ void readFromSettings();
+ void storeToSettings();
+ void initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& );
+ void enableNupControls( bool bEnable );
+
+ void showAdvancedControls( bool );
+
+ virtual void Resize();
+ };
+
+ class JobTabPage : public TabPage
+ {
+ public:
+ FixedLine maPrinterFL;
+ ListBox maPrinters;
+ DisclosureButton maDetailsBtn;
+ FixedText maStatusLabel;
+ FixedText maStatusTxt;
+ FixedText maLocationLabel;
+ FixedText maLocationTxt;
+ FixedText maCommentLabel;
+ FixedText maCommentTxt;
+
+ PushButton maSetupButton;
+
+ FixedLine maCopies;
+ FixedLine maCopySpacer;
+ FixedText maCopyCount;
+ NumericField maCopyCountField;
+ CheckBox maCollateBox;
+ FixedImage maCollateImage;
+
+ Image maCollateImg;
+ Image maCollateHCImg;
+ Image maNoCollateImg;
+ Image maNoCollateHCImg;
+
+ long mnCollateUIMode;
+
+ vcl::RowOrColumn maLayout;
+ boost::shared_ptr<vcl::RowOrColumn> mxPrintRange;
+ boost::shared_ptr<vcl::WindowArranger> mxDetails;
+
+ JobTabPage( Window*, const ResId& );
+ virtual ~JobTabPage();
+
+ void readFromSettings();
+ void storeToSettings();
+
+ virtual void Resize();
+
+ void setupLayout();
+ };
+
+ class OutputOptPage : public TabPage
+ {
+ public:
+ FixedLine maOptionsLine;
+ CheckBox maToFileBox;
+ CheckBox maCollateSingleJobsBox;
+ CheckBox maReverseOrderBox;
+
+ vcl::RowOrColumn maLayout;
+ boost::shared_ptr<vcl::RowOrColumn> mxOptGroup;
+
+ OutputOptPage( Window*, const ResId& );
+ virtual ~OutputOptPage();
+
+ void readFromSettings();
+ void storeToSettings();
+
+ virtual void Resize();
+
+ void setupLayout();
+ };
+
+ OKButton maOKButton;
+ CancelButton maCancelButton;
+ HelpButton maHelpButton;
+ PrintPreviewWindow maPreviewWindow;
+ NumericField maPageEdit;
+ FixedText maNumPagesText;
+ PushButton maBackwardBtn;
+ PushButton maForwardBtn;
+
+ TabControl maTabCtrl;
+ NUpTabPage maNUpPage;
+ JobTabPage maJobPage;
+ OutputOptPage maOptionsPage;
+
+ FixedLine maButtonLine;
+
+ boost::shared_ptr< PrinterController > maPController;
+
+ rtl::OUString maPageStr;
+ rtl::OUString maNoPageStr;
+ sal_Int32 mnCurPage;
+ sal_Int32 mnCachedPages;
+
+ std::list< Window* > maControls;
+ std::map< Window*, rtl::OUString > maControlToPropertyMap;
+ std::map< rtl::OUString, std::vector< Window* > >
+ maPropertyToWindowMap;
+ std::map< Window*, sal_Int32 > maControlToNumValMap;
+ std::set< rtl::OUString > maReverseDependencySet;
+
+ Size maNupPortraitSize;
+ Size maNupLandscapeSize;
+
+ // internal, used for automatic Nup-Portrait/landscape
+ Size maFirstPageSize;
+
+ rtl::OUString maPrintToFileText;
+ rtl::OUString maPrintText;
+ rtl::OUString maDefPrtText;
+
+ vcl::RowOrColumn maLayout;
+ boost::shared_ptr<vcl::RowOrColumn> mxPreviewCtrls;
+
+ Size maDetailsCollapsedSize;
+ Size maDetailsExpandedSize;
+
+ sal_Bool mbShowLayoutPage;
+
+ Size getJobPageSize();
+ void updateNup();
+ void updateNupFromPages();
+ void preparePreview( bool i_bPrintChanged = true, bool i_bMayUseCache = false );
+ void setPreviewText( sal_Int32 );
+ void updatePrinterText();
+ void checkControlDependencies();
+ void checkOptionalControlDependencies();
+ void makeEnabled( Window* );
+ void updateWindowFromProperty( const rtl::OUString& );
+ void setupOptionalUI();
+ void readFromSettings();
+ void storeToSettings();
+ com::sun::star::beans::PropertyValue* getValueForWindow( Window* ) const;
+
+ virtual void Resize();
+ virtual void Command( const CommandEvent& );
+ virtual void DataChanged( const DataChangedEvent& );
+
+ DECL_LINK( SelectHdl, ListBox* );
+ DECL_LINK( ClickHdl, Button* );
+ DECL_LINK( ModifyHdl, Edit* );
+ DECL_LINK( UIOptionsChanged, void* );
+
+ DECL_LINK( UIOption_CheckHdl, CheckBox* );
+ DECL_LINK( UIOption_RadioHdl, RadioButton* );
+ DECL_LINK( UIOption_SelectHdl, ListBox* );
+ DECL_LINK( UIOption_ModifyHdl, Edit* );
+
+ void setupLayout();
+ public:
+ PrintDialog( Window*, const boost::shared_ptr< PrinterController >& );
+ virtual ~PrintDialog();
+
+ bool isPrintToFile();
+ int getCopyCount();
+ bool isCollate();
+
+ void previewForward();
+ void previewBackward();
+ };
+
+ class PrintProgressDialog : public ModelessDialog
+ {
+ String maStr;
+ FixedText maText;
+ CancelButton maButton;
+
+ bool mbCanceled;
+ sal_Int32 mnCur;
+ sal_Int32 mnMax;
+ long mnProgressHeight;
+ Rectangle maProgressRect;
+ bool mbNativeProgress;
+
+ DECL_LINK( ClickHdl, Button* );
+
+ void implCalcProgressRect();
+ public:
+ PrintProgressDialog( Window* i_pParent, int i_nMax );
+ ~PrintProgressDialog();
+
+ bool isCanceled() const { return mbCanceled; }
+ void setProgress( int i_nCurrent, int i_nMax = -1 );
+ void tick();
+
+ virtual void Paint( const Rectangle& );
+ };
+}
+
#endif // _SV_PRNDLG_HXX
diff --git a/vcl/inc/vcl/prntypes.hxx b/vcl/inc/vcl/prntypes.hxx
index 681f4f972a7c..a61c1a275474 100644
--- a/vcl/inc/vcl/prntypes.hxx
+++ b/vcl/inc/vcl/prntypes.hxx
@@ -39,7 +39,7 @@
// - Duplex Mode -
// ---------------
-enum DuplexMode { DUPLEX_UNKNOWN, DUPLEX_OFF, DUPLEX_ON };
+enum DuplexMode { DUPLEX_UNKNOWN, DUPLEX_OFF, DUPLEX_LONGEDGE, DUPLEX_SHORTEDGE };
// ---------------
// - Orientation -
@@ -93,5 +93,6 @@ enum Orientation { ORIENTATION_PORTRAIT, ORIENTATION_LANDSCAPE };
#define PRINTER_CAPABILITIES_FAX ((USHORT)8)
#define PRINTER_CAPABILITIES_PDF ((USHORT)9)
#define PRINTER_CAPABILITIES_EXTERNALDIALOG ((USHORT)10)
+#define PRINTER_CAPABILITIES_SETDUPLEX ((USHORT)11)
#endif // _SV_PRNTYPES_HXX
diff --git a/vcl/inc/vcl/salprn.hxx b/vcl/inc/vcl/salprn.hxx
index 2927215034b5..73f5454457cf 100644
--- a/vcl/inc/vcl/salprn.hxx
+++ b/vcl/inc/vcl/salprn.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: salprn.hxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.114.1 $
*
* This file is part of OpenOffice.org.
*
@@ -41,7 +41,7 @@
class SalGraphics;
class SalFrame;
struct ImplJobSetup;
-class ImplQPrinter;
+namespace vcl { class PrinterController; }
// -----------------------
// - SalPrinterQueueInfo -
@@ -101,7 +101,6 @@ public:
virtual void InitPaperFormats( const ImplJobSetup* pSetupData ) = 0;
// returns angle that a landscape page will be turned counterclockwise wrt to portrait
virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ) = 0;
- virtual DuplexMode GetDuplexMode( const ImplJobSetup* pSetupData ) = 0;
};
// --------------
@@ -114,18 +113,21 @@ public: // public for Sal Implementation
SalPrinter() {}
virtual ~SalPrinter();
- virtual BOOL StartJob( const XubString* pFileName,
- const XubString& rJobName,
- const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ virtual BOOL StartJob( const String* pFileName,
+ const String& rJobName,
+ const String& rAppName,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData ) = 0;
// implement for pull model print systems only,
// default implementations (see salvtables.cxx) just returns FALSE
virtual BOOL StartJob( const String* pFileName,
+ const String& rJobName,
const String& rAppName,
ImplJobSetup* pSetupData,
- ImplQPrinter* pQPrinter );
+ vcl::PrinterController& rController );
virtual BOOL EndJob() = 0;
virtual BOOL AbortJob() = 0;
diff --git a/vcl/inc/vcl/salptype.hxx b/vcl/inc/vcl/salptype.hxx
index 7f1c82079f38..bc9883757432 100644
--- a/vcl/inc/vcl/salptype.hxx
+++ b/vcl/inc/vcl/salptype.hxx
@@ -40,7 +40,11 @@
#define SAL_JOBSET_ORIENTATION ((ULONG)0x00000001)
#define SAL_JOBSET_PAPERBIN ((ULONG)0x00000002)
#define SAL_JOBSET_PAPERSIZE ((ULONG)0x00000004)
-#define SAL_JOBSET_ALL (SAL_JOBSET_ORIENTATION | SAL_JOBSET_PAPERBIN | SAL_JOBSET_PAPERSIZE)
+#define SAL_JOBSET_DUPLEXMODE ((ULONG)0x00000008)
+#define SAL_JOBSET_ALL (SAL_JOBSET_ORIENTATION |\
+ SAL_JOBSET_PAPERBIN |\
+ SAL_JOBSET_PAPERSIZE |\
+ SAL_JOBSET_DUPLEXMODE)
// -------------------
// - SalPrinterError -
diff --git a/vcl/inc/vcl/svdata.hxx b/vcl/inc/vcl/svdata.hxx
index 17ad1aa28c1a..081b2fffca0b 100644
--- a/vcl/inc/vcl/svdata.hxx
+++ b/vcl/inc/vcl/svdata.hxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svdata.hxx,v $
- * $Revision: 1.13 $
+ * $Revision: 1.13.16.1 $
*
* This file is part of OpenOffice.org.
*
@@ -87,6 +87,7 @@ class Timer;
class AutoTimer;
class Help;
class ImageList;
+class Image;
class PopupMenu;
class Application;
class OutputDevice;
@@ -259,6 +260,10 @@ struct ImplSVCtrlData
ImageList* mpSplitVPinImgList; // ImageList for Vertikale SplitWindows (PIN's)
ImageList* mpSplitHArwImgList; // ImageList for Horizontale SplitWindows (Arrows)
ImageList* mpSplitVArwImgList; // ImageList for Vertikale SplitWindows (Arrows)
+ Image* mpDisclosurePlus;
+ Image* mpDisclosurePlusHC;
+ Image* mpDisclosureMinus;
+ Image* mpDisclosureMinusHC;
ImplTBDragMgr* mpTBDragMgr; // DragMgr for ToolBox
USHORT mnCheckStyle; // CheckBox-Style for ImageList-Update
USHORT mnRadioStyle; // Radio-Style for ImageList-Update
@@ -367,6 +372,7 @@ void ImplDeInitSVData();
void ImplDestroySVData();
Window* ImplGetDefaultWindow();
VCL_DLLPUBLIC ResMgr* ImplGetResMgr();
+VCL_DLLPUBLIC ResId VclResId( sal_Int32 nId ); // throws std::bad_alloc if no res mgr
DockingManager* ImplGetDockingManager();
void ImplWindowAutoMnemonic( Window* pWindow );
diff --git a/vcl/inc/vcl/svids.hrc b/vcl/inc/vcl/svids.hrc
index 48297a04ea0e..e2a8226ac878 100644
--- a/vcl/inc/vcl/svids.hrc
+++ b/vcl/inc/vcl/svids.hrc
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svids.hrc,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.84.3 $
*
* This file is part of OpenOffice.org.
*
@@ -31,6 +31,8 @@
#ifndef _SV_SVIDS_HRC
#define _SV_SVIDS_HRC
+#include "svl/solar.hrc"
+
#define SV_RESID_STDOFFSET 0
#define SV_RESID_WINOFFSET 1
#define SV_RESID_OS2OFFSET 2
@@ -58,6 +60,11 @@
#define SV_RESID_BITMAP_CLOSEDOC 1052
#define SV_RESID_BITMAP_CLOSEDOCHC 1053
+#define SV_DISCLOSURE_PLUS 1060
+#define SV_DISCLOSURE_MINUS 1061
+#define SV_DISCLOSURE_PLUS_HC 1062
+#define SV_DISCLOSURE_MINUS_HC 1063
+
#define SV_RESID_MENU_EDIT 2000
#define SV_MENU_EDIT_UNDO 1
#define SV_MENU_EDIT_CUT 2
@@ -74,6 +81,92 @@
#define SV_MENU_MAC_SHOWALL 2005
#define SV_MENU_MAC_QUITAPP 2006
+#define SV_DLG_PRINT 2048
+#define SV_PRINT_OK 1
+#define SV_PRINT_CANCEL 2
+#define SV_PRINT_HELP 3
+#define SV_PRINT_PAGE_PREVIEW 4
+#define SV_PRINT_PAGE_TXT 5
+#define SV_PRINT_PAGE_FORWARD 6
+#define SV_PRINT_PAGE_BACKWARD 7
+#define SV_PRINT_PAGE_EDIT 8
+#define SV_PRINT_TABCTRL 9
+#define SV_PRINT_PRT_TYPE 10
+#define SV_PRINT_PRT_STATUS 11
+#define SV_PRINT_PRT_LOCATION 12
+#define SV_PRINT_PRT_COMMENT 13
+#define SV_PRINT_TOFILE_TXT 14
+#define SV_PRINT_DEFPRT_TXT 15
+#define SV_PRINT_PRINTPREVIEW_TXT 16
+
+#define SV_PRINT_TAB_NUP 1
+#define SV_PRINT_PRT_NUP_LAYOUT_FL 1
+#define SV_PRINT_PRT_NUP_DEFAULT_BTN 2
+#define SV_PRINT_PRT_NUP_BROCHURE_BTN 3
+#define SV_PRINT_PRT_NUP_PAGES_BTN 4
+#define SV_PRINT_PRT_NUP_PAGES_BOX 5
+#define SV_PRINT_PRT_NUP_NUM_PAGES_TXT 6
+#define SV_PRINT_PRT_NUP_COLS_EDT 7
+#define SV_PRINT_PRT_NUP_TIMES_TXT 8
+#define SV_PRINT_PRT_NUP_ROWS_EDT 9
+#define SV_PRINT_PRT_NUP_MARGINS_PAGES_1_TXT 10
+#define SV_PRINT_PRT_NUP_MARGINS_PAGES_EDT 11
+#define SV_PRINT_PRT_NUP_MARGINS_PAGES_2_TXT 12
+#define SV_PRINT_PRT_NUP_MARGINS_SHEET_1_TXT 13
+#define SV_PRINT_PRT_NUP_MARGINS_SHEET_EDT 14
+#define SV_PRINT_PRT_NUP_MARGINS_SHEET_2_TXT 15
+#define SV_PRINT_PRT_NUP_ORIENTATION_TXT 16
+#define SV_PRINT_PRT_NUP_ORIENTATION_BOX 17
+#define SV_PRINT_PRT_NUP_ORDER_TXT 18
+#define SV_PRINT_PRT_NUP_ORDER_BOX 19
+#define SV_PRINT_PRT_NUP_BORDER_CB 20
+
+#define SV_PRINT_PRT_NUP_ORIENTATION_AUTOMATIC 0
+#define SV_PRINT_PRT_NUP_ORIENTATION_PORTRAIT 1
+#define SV_PRINT_PRT_NUP_ORIENTATION_LANDSCAPE 2
+
+#define SV_PRINT_PRT_NUP_ORDER_LRTD 0
+#define SV_PRINT_PRT_NUP_ORDER_TDLR 1
+
+#define SV_PRINT_TAB_JOB 2
+#define SV_PRINT_PRINTERS_FL 1
+#define SV_PRINT_PRINTERS 2
+#define SV_PRINT_PRT_SETUP 3
+#define SV_PRINT_RANGE 4
+#define SV_PRINT_ALL 5
+#define SV_PRINT_PAGERANGE 6
+#define SV_PRINT_SELECTION 7
+#define SV_PRINT_PAGERANGE_EDIT 8
+#define SV_PRINT_COPIES 9
+#define SV_PRINT_COPYCOUNT 10
+#define SV_PRINT_COPYCOUNT_FIELD 11
+#define SV_PRINT_COLLATE 12
+#define SV_PRINT_COLLATE_IMAGE 13
+#define SV_PRINT_BUTTONLINE 14
+#define SV_PRINT_COLLATE_IMG 15
+#define SV_PRINT_NOCOLLATE_IMG 16
+#define SV_PRINT_COLLATE_HC_IMG 17
+#define SV_PRINT_NOCOLLATE_HC_IMG 18
+#define SV_PRINT_NOPAGES 19
+#define SV_PRINT_STATUS_TXT 20
+#define SV_PRINT_LOCATION_TXT 21
+#define SV_PRINT_COMMENT_TXT 22
+#define SV_PRINT_DETAILS_BTN 23
+
+#define SV_PRINT_TAB_OPT 3
+#define SV_PRINT_OPT_PRINT_FL 1
+#define SV_PRINT_OPT_TOFILE 2
+#define SV_PRINT_OPT_SINGLEJOBS 3
+#define SV_PRINT_OPT_REVERSE 4
+
+#define SV_DLG_PRINT_PROGRESS 2049
+#define SV_PRINT_PROGRESS_CANCEL 1
+#define SV_PRINT_PROGRESS_TEXT 2
+
+#define SV_PRINT_NATIVE_STRINGS 2050
+#define SV_PRINT_NOPRINTERWARNING 2051
+#define SV_PRINT_NOCONTENT 2052
+
#define SV_HELPTEXT_CLOSE 10000
#define SV_HELPTEXT_MINIMIZE 10001
#define SV_HELPTEXT_MAXIMIZE 10002
@@ -108,7 +201,8 @@
#define SV_STDTEXT_ABOUT 10204
#define SV_STDTEXT_PREFERENCES 10205
#define SV_MAC_SCREENNNAME 10206
-#define SV_STDTEXT_LAST SV_MAC_SCREENNNAME
+#define SV_STDTEXT_ALLFILETYPES 10207
+#define SV_STDTEXT_LAST SV_STDTEXT_ALLFILETYPES
#define SV_ACCESSERROR_FIRST SV_ACCESSERROR_WRONG_VERSION
#define SV_ACCESSERROR_WRONG_VERSION 10500
@@ -165,4 +259,6 @@
#define SV_ICON_ID_MACRO 17
#define SV_ICON_ID_PRINTERADMIN 501
+#define HID_PRINTDLG HID_VCL_START
+
#endif // _SV_SVIDS_HRC
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index 30edf6227a60..e91dc47690ff 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -31,15 +31,16 @@
#ifndef _SV_TABCTRL_HXX
#define _SV_TABCTRL_HXX
-#include <vcl/sv.h>
-#include <vcl/dllapi.h>
-#include <vcl/ctrl.hxx>
+#include "vcl/sv.h"
+#include "vcl/dllapi.h"
+#include "vcl/ctrl.hxx"
struct ImplTabItem;
struct ImplTabCtrlData;
class ImplTabItemList;
class TabPage;
class PushButton;
+class ListBox;
// --------------------
// - TabControl-Types -
@@ -72,7 +73,7 @@ private:
BOOL mbRestoreUnqId;
BOOL mbSingleLine;
BOOL mbScroll;
- BOOL mbColored;
+ BOOL mbRestoreSmartId;
BOOL mbSmallInvalidate;
BOOL mbExtraSpace;
Link maActivateHdl;
@@ -95,6 +96,11 @@ private:
SAL_DLLPRIVATE void ImplPaint( const Rectangle& rRect, bool bLayout = false );
SAL_DLLPRIVATE void ImplFreeLayoutData();
DECL_DLLPRIVATE_LINK( ImplScrollBtnHdl, PushButton* pBtn );
+ DECL_DLLPRIVATE_LINK( ImplListBoxSelectHdl, ListBox* );
+
+public:
+ // just for dialog control
+ SAL_DLLPRIVATE bool ImplHandleNotifyEvent( NotifyEvent& rEvt );
protected:
using Window::ImplInit;
@@ -128,6 +134,9 @@ public:
virtual void ActivatePage();
virtual long DeactivatePage();
+ virtual Size GetOptimalSize(WindowSizeType eType) const;
+ void SetMinimumSizePixel( const Size& );
+
void SetTabPageSizePixel( const Size& rSize );
Size GetTabPageSizePixel() const;
diff --git a/vcl/inc/vcl/tabdlg.hxx b/vcl/inc/vcl/tabdlg.hxx
index 5ec2bcad5225..ad79ebec4549 100644
--- a/vcl/inc/vcl/tabdlg.hxx
+++ b/vcl/inc/vcl/tabdlg.hxx
@@ -36,6 +36,7 @@
#include <vcl/dialog.hxx>
class FixedLine;
+class TabControl;
// ----------------------
// - TabDialog -
@@ -61,6 +62,8 @@ public:
virtual void Resize();
virtual void StateChanged( StateChangedType nStateChange );
+ SAL_DLLPRIVATE TabControl* ImplGetFirstTabControl() const;
+
void AdjustLayout();
void SetViewWindow( Window* pWindow ) { mpViewWindow = pWindow; }
diff --git a/vcl/inc/vcl/toolbox.hxx b/vcl/inc/vcl/toolbox.hxx
index 6e4c300ccc40..c2547e4b01ba 100644
--- a/vcl/inc/vcl/toolbox.hxx
+++ b/vcl/inc/vcl/toolbox.hxx
@@ -124,6 +124,9 @@ typedef USHORT ToolBoxItemBits;
#define TIB_DROPDOWN ((ToolBoxItemBits)0x0020)
#define TIB_REPEAT ((ToolBoxItemBits)0x0040)
#define TIB_DROPDOWNONLY ((ToolBoxItemBits)0x0080 | TIB_DROPDOWN) // this button has only drop down functionality
+#define TIB_TEXT_ONLY ((ToolBoxItemBits)0x0100)
+#define TIB_ICON_ONLY ((ToolBoxItemBits)0x0200)
+#define TIB_TEXTICON ((ToolBoxItemBits) TIB_TEXT_ONLY | TIB_ICON_ONLY )
// -----------------
// - ToolBox-Types -
diff --git a/vcl/inc/vcl/vclevent.hxx b/vcl/inc/vcl/vclevent.hxx
index 74971f62c5a6..570c8ad0a342 100644
--- a/vcl/inc/vcl/vclevent.hxx
+++ b/vcl/inc/vcl/vclevent.hxx
@@ -36,12 +36,20 @@
#include "vcl/dllapi.h"
#include "vcl/impdel.hxx"
+#include <com/sun/star/uno/Reference.hxx>
+
#include <list>
#include <vector>
class Window;
class Menu;
+namespace com { namespace sun { namespace star {
+ namespace accessibility {
+ class XAccessible;
+ }
+}}}
+
#define VCLEVENT_OBJECT_DYING 1
// VclWindowEvent:
@@ -242,6 +250,17 @@ public:
USHORT GetItemPos() const { return mnPos; }
};
+class VCL_DLLPUBLIC VclAccessibleEvent: public VclSimpleEvent
+{
+public:
+ VclAccessibleEvent( ULONG n, const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& rxAccessible );
+ virtual ~VclAccessibleEvent();
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetAccessible() const;
+
+private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxAccessible;
+};
+
class VCL_DLLPUBLIC VclEventListeners : public std::list<Link>
{
public:
@@ -262,7 +281,10 @@ class VCL_DLLPUBLIC VclEventListeners2 : public vcl::DeletionNotifier
std::list< Link >::iterator m_aIt;
bool m_bWasInvalidated;
- ListenerIt() : m_bWasInvalidated( false ) {}
+ ListenerIt(const std::list<Link>::iterator& rIt)
+ : m_aIt(rIt)
+ , m_bWasInvalidated( false )
+ {}
};
std::vector< ListenerIt > m_aIterators;
diff --git a/vcl/inc/vcl/virdev.hxx b/vcl/inc/vcl/virdev.hxx
index bc21dde6f4ac..ea2b49eb8290 100644
--- a/vcl/inc/vcl/virdev.hxx
+++ b/vcl/inc/vcl/virdev.hxx
@@ -74,7 +74,6 @@ private:
#define REFDEV_FORCE_ZERO_EXTLEAD 0x80
SAL_DLLPRIVATE bool ForceZeroExtleadBug() const
{ return ((meRefDevMode & REFDEV_FORCE_ZERO_EXTLEAD) != 0); }
-
public:
VirtualDevice( USHORT nBitCount = 0 );
VirtualDevice( const OutputDevice& rCompDev,
@@ -115,11 +114,19 @@ public:
REFDEV_MODE06 = 1, // 600 dpi
REFDEV_MODE48 = 2, // 4800 dpi
REFDEV_MODE_MSO1 = 3,
- REFDEV_MODE_PDF1 = 4 };
+ REFDEV_MODE_PDF1 = 4,
+ REFDEV_CUSTOM = 5
+ };
void SetReferenceDevice( RefDevMode );
void Compat_ZeroExtleadBug(); // enable workaround for #i60495#
+
+ void SetReferenceDevice( sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
+
+private:
+ SAL_DLLPRIVATE void ImplSetReferenceDevice( RefDevMode, sal_Int32 i_nDPIX, sal_Int32 i_nDPIY );
+
};
#endif // _SV_VIRDEV_HXX
diff --git a/vcl/inc/vcl/window.h b/vcl/inc/vcl/window.h
index d745f3dcf081..0fec51e2e702 100644
--- a/vcl/inc/vcl/window.h
+++ b/vcl/inc/vcl/window.h
@@ -358,7 +358,9 @@ public:
mbToolbarFloatingWindow:1,
mbCallHandlersDuringInputDisabled:1,
mbDisableAccessibleLabelForRelation:1,
- mbDisableAccessibleLabeledByRelation:1;
+ mbDisableAccessibleLabeledByRelation:1,
+ mbHelpTextDynamic:1,
+ mbFakeFocusSet:1;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxDNDListenerContainer;
};
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 56fdb22ddc57..c14ee7add4fb 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -582,7 +582,7 @@ protected:
void ImplCallEventListeners( ULONG nEvent, void* pData = NULL );
void CallEventListeners( ULONG nEvent, void* pData = NULL );
-
+ void FireVclEvent( VclSimpleEvent* pEvent );
// FIXME: this is a hack to workaround missing layout functionality
SAL_DLLPRIVATE void ImplAdjustNWFSizes();
@@ -899,6 +899,13 @@ public:
USHORT GetGetFocusFlags() const;
void GrabFocusToDocument();
+ /**
+ * Set this when you need to act as if the window has focus even if it
+ * doesn't. This is necessary for implementing tab stops inside floating
+ * windows, but floating windows don't get focus from the system.
+ */
+ void SetFakeFocus( bool bFocus );
+
BOOL IsCompoundControl() const;
BOOL HasCompoundControlFocus() const;
diff --git a/vcl/os2/inc/salprn.h b/vcl/os2/inc/salprn.h
index 25ecfe87ed89..2c95965bc609 100644
--- a/vcl/os2/inc/salprn.h
+++ b/vcl/os2/inc/salprn.h
@@ -83,7 +83,6 @@ public:
virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin );
virtual void InitPaperFormats( const ImplJobSetup* pSetupData );
virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
- virtual DuplexMode GetDuplexMode( const ImplJobSetup* pSetupData );
};
// ------------------
@@ -136,7 +135,9 @@ public:
virtual BOOL StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData );
virtual BOOL EndJob();
virtual BOOL AbortJob();
diff --git a/vcl/os2/source/gdi/salprn.cxx b/vcl/os2/source/gdi/salprn.cxx
index 0c254e2f6e62..a31a4bb779f8 100644
--- a/vcl/os2/source/gdi/salprn.cxx
+++ b/vcl/os2/source/gdi/salprn.cxx
@@ -1559,7 +1559,9 @@ Os2SalPrinter::~Os2SalPrinter()
BOOL Os2SalPrinter::StartJob( const XubString* pFileName,
const XubString& rJobName,
const XubString& rAppName,
- ULONG nCopies, BOOL bCollate,
+ ULONG nCopies,
+ bool bCollate,
+ bool bDirect,
ImplJobSetup* pSetupData )
{
DEVOPENSTRUC aDevOpenStruc;
@@ -1831,9 +1833,4 @@ int Os2SalInfoPrinter::GetLandscapeAngle( const ImplJobSetup* pSetupData )
printf("Os2SalInfoPrinter::GetLandscapeAngle\n");
return 0;
}
-DuplexMode Os2SalInfoPrinter::GetDuplexMode( const ImplJobSetup* pSetupData )
-{
- DuplexMode nRet = DUPLEX_UNKNOWN;
- printf("Os2SalInfoPrinter::GetDuplexMode\n");
- return nRet;
-}
+
diff --git a/vcl/prj/build.lst b/vcl/prj/build.lst
index 5d2aaf90c6f7..e6f636522acb 100644
--- a/vcl/prj/build.lst
+++ b/vcl/prj/build.lst
@@ -1,4 +1,4 @@
-vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools transex3 icc SO:print_header cpputools shell NULL
+vc vcl : l10n apple_remote BOOST:boost rsc sot ucbhelper unotools ICU:icu GRAPHITE:graphite i18npool i18nutil unoil ridljar X11_EXTENSIONS:x11_extensions offuh basegfx basebmp tools l10ntools icc SO:print_header cpputools shell svl NULL
vc vcl usr1 - all vc_mkout NULL
vc vcl\inc nmake - all vc_inc NULL
vc vcl\source\glyphs nmake - all vc_glyphs vc_inc NULL
diff --git a/vcl/prj/d.lst b/vcl/prj/d.lst
index 54af0d2e289d..8345b155ce58 100644
--- a/vcl/prj/d.lst
+++ b/vcl/prj/d.lst
@@ -81,10 +81,11 @@ mkdir: %_DEST%\inc%_EXT%\vcl
..\inc\vcl\morebtn.hxx %_DEST%\inc%_EXT%\vcl\morebtn.hxx
..\inc\vcl\msgbox.hxx %_DEST%\inc%_EXT%\vcl\msgbox.hxx
..\inc\vcl\octree.hxx %_DEST%\inc%_EXT%\vcl\octree.hxx
+..\inc\vcl\oldprintadaptor.hxx %_DEST%\inc%_EXT%\vcl\oldprintadaptor.hxx
..\inc\vcl\outdev.hxx %_DEST%\inc%_EXT%\vcl\outdev.hxx
..\inc\vcl\pointr.hxx %_DEST%\inc%_EXT%\vcl\pointr.hxx
+..\inc\vcl\popupmenuwindow.hxx %_DEST%\inc%_EXT%\vcl\popupmenuwindow.hxx
..\inc\vcl\print.hxx %_DEST%\inc%_EXT%\vcl\print.hxx
-..\inc\vcl\prndlg.hxx %_DEST%\inc%_EXT%\vcl\prndlg.hxx
..\inc\vcl\prntypes.hxx %_DEST%\inc%_EXT%\vcl\prntypes.hxx
..\inc\vcl\ptrstyle.hxx %_DEST%\inc%_EXT%\vcl\ptrstyle.hxx
..\inc\vcl\regband.hxx %_DEST%\inc%_EXT%\vcl\regband.hxx
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 516b23dd76be..31971468d9c6 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -97,8 +97,8 @@ SalPrinter::~SalPrinter()
{
}
-BOOL SalPrinter::StartJob( const String*, const String&,
- ImplJobSetup*, ImplQPrinter* )
+BOOL SalPrinter::StartJob( const String*, const String&, const String&,
+ ImplJobSetup*, vcl::PrinterController& )
{
return FALSE;
}
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 6a61d15db4c0..e8e56c6ee5a8 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: svdata.cxx,v $
- * $Revision: 1.56 $
+ * $Revision: 1.56.114.1 $
*
* This file is part of OpenOffice.org.
*
@@ -234,6 +234,15 @@ ResMgr* ImplGetResMgr()
return pSVData->mpResMgr;
}
+ResId VclResId( sal_Int32 nId )
+{
+ ResMgr* pMgr = ImplGetResMgr();
+ if( ! pMgr )
+ throw std::bad_alloc();
+
+ return ResId( nId, *pMgr );
+}
+
DockingManager* ImplGetDockingManager()
{
ImplSVData* pSVData = ImplGetSVData();
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 310c01a40673..f1af78662813 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -444,6 +444,26 @@ void DeInitVCL()
delete pSVData->maCtrlData.mpSplitVArwImgList;
pSVData->maCtrlData.mpSplitVArwImgList = NULL;
}
+ if ( pSVData->maCtrlData.mpDisclosurePlus )
+ {
+ delete pSVData->maCtrlData.mpDisclosurePlus;
+ pSVData->maCtrlData.mpDisclosurePlus = NULL;
+ }
+ if ( pSVData->maCtrlData.mpDisclosurePlusHC )
+ {
+ delete pSVData->maCtrlData.mpDisclosurePlusHC;
+ pSVData->maCtrlData.mpDisclosurePlusHC = NULL;
+ }
+ if ( pSVData->maCtrlData.mpDisclosureMinus )
+ {
+ delete pSVData->maCtrlData.mpDisclosureMinus;
+ pSVData->maCtrlData.mpDisclosureMinus = NULL;
+ }
+ if ( pSVData->maCtrlData.mpDisclosureMinusHC )
+ {
+ delete pSVData->maCtrlData.mpDisclosureMinusHC;
+ pSVData->maCtrlData.mpDisclosureMinusHC = NULL;
+ }
if ( pSVData->mpDefaultWin )
{
delete pSVData->mpDefaultWin;
diff --git a/vcl/source/app/vclevent.cxx b/vcl/source/app/vclevent.cxx
index 704d68c5bc7f..ffab843ff7bd 100644
--- a/vcl/source/app/vclevent.cxx
+++ b/vcl/source/app/vclevent.cxx
@@ -34,10 +34,30 @@
#include "vcl/vclevent.hxx"
#include "vcl/svdata.hxx"
+#include <com/sun/star/accessibility/XAccessible.hpp>
+
+using ::com::sun::star::uno::Reference;
+using ::com::sun::star::accessibility::XAccessible;
+
TYPEINIT0(VclSimpleEvent);
TYPEINIT1(VclWindowEvent, VclSimpleEvent);
TYPEINIT1(VclMenuEvent, VclSimpleEvent);
+VclAccessibleEvent::VclAccessibleEvent( ULONG n, const Reference<XAccessible>& rxAccessible ) :
+ VclSimpleEvent(n),
+ mxAccessible(rxAccessible)
+{
+}
+
+VclAccessibleEvent::~VclAccessibleEvent()
+{
+}
+
+Reference<XAccessible> VclAccessibleEvent::GetAccessible() const
+{
+ return mxAccessible;
+}
+
void VclEventListeners::Call( VclSimpleEvent* pEvent ) const
{
// Copy the list, because this can be destroyed when calling a Link...
@@ -118,9 +138,8 @@ void VclEventListeners2::callListeners( VclSimpleEvent* i_pEvent )
{
vcl::DeletionListener aDel( this );
- m_aIterators.push_back( ListenerIt() );
+ m_aIterators.push_back(ListenerIt(m_aListeners.begin()));
size_t nIndex = m_aIterators.size() - 1;
- m_aIterators[ nIndex ].m_aIt = m_aListeners.begin();
while( ! aDel.isDeleted() && m_aIterators[ nIndex ].m_aIt != m_aListeners.end() )
{
m_aIterators[ nIndex ].m_aIt->Call( i_pEvent );
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 53a060af6bd6..b5915cc35daf 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1983,8 +1983,11 @@ Size PushButton::CalcMinimumSize( long nMaxWidth ) const
}
// cf. ImplDrawPushButton ...
- aSize.Width() += 8;
- aSize.Height() += 8;
+ if( (GetStyle() & WB_SMALLSTYLE) == 0 )
+ {
+ aSize.Width() += 8;
+ aSize.Height() += 8;
+ }
return CalcWindowSize( aSize );
}
@@ -4376,3 +4379,95 @@ TriStateBox::TriStateBox( Window* pParent, const ResId& rResId ) :
TriStateBox::~TriStateBox()
{
}
+
+// =======================================================================
+
+DisclosureButton::DisclosureButton( Window* pParent, WinBits ) :
+ CheckBox( pParent, WB_NOBORDER )
+{
+}
+
+// -----------------------------------------------------------------------
+
+DisclosureButton::DisclosureButton( Window* pParent, const ResId& rResId ) :
+ CheckBox( pParent, rResId.SetRT( RSC_CHECKBOX ) )
+{
+}
+
+// -----------------------------------------------------------------------
+
+void DisclosureButton::ImplDrawCheckBoxState()
+{
+ /* HACK: DisclosureButton is currently assuming, that the disclosure sign
+ will fit into the rectangle occupied by a normal checkbox on all themes.
+ If this does not hold true for some theme, ImplGetCheckImageSize
+ would have to be overloaded for DisclosureButton; also GetNativeControlRegion
+ for CTRL_LISTNODE would have to be implemented and taken into account
+ */
+
+ Rectangle aStateRect( GetStateRect() );
+
+ ImplControlValue aControlValue( GetState() == STATE_CHECK ? BUTTONVALUE_ON : BUTTONVALUE_OFF, rtl::OUString(), 0 );
+ Region aCtrlRegion( aStateRect );
+ ControlState nState = 0;
+
+ if ( HasFocus() ) nState |= CTRL_STATE_FOCUSED;
+ if ( ImplGetButtonState() & BUTTON_DRAW_DEFAULT ) nState |= CTRL_STATE_DEFAULT;
+ if ( Window::IsEnabled() ) nState |= CTRL_STATE_ENABLED;
+ if ( IsMouseOver() && GetMouseRect().IsInside( GetPointerPosPixel() ) )
+ nState |= CTRL_STATE_ROLLOVER;
+
+ if( ! DrawNativeControl( CTRL_LISTNODE, PART_ENTIRE_CONTROL, aCtrlRegion, nState,
+ aControlValue, rtl::OUString() ) )
+ {
+ ImplSVCtrlData& rCtrlData( ImplGetSVData()->maCtrlData );
+ if( ! rCtrlData.mpDisclosurePlus )
+ rCtrlData.mpDisclosurePlus = new Image( BitmapEx( VclResId( SV_DISCLOSURE_PLUS ) ) );
+ if( ! rCtrlData.mpDisclosurePlusHC )
+ rCtrlData.mpDisclosurePlusHC = new Image( BitmapEx( VclResId( SV_DISCLOSURE_PLUS_HC ) ) );
+ if( ! rCtrlData.mpDisclosureMinus )
+ rCtrlData.mpDisclosureMinus = new Image( BitmapEx( VclResId( SV_DISCLOSURE_MINUS ) ) );
+ if( ! rCtrlData.mpDisclosureMinusHC )
+ rCtrlData.mpDisclosureMinusHC = new Image( BitmapEx( VclResId( SV_DISCLOSURE_MINUS_HC ) ) );
+
+ Image* pImg = NULL;
+ if( GetSettings().GetStyleSettings().GetHighContrastMode() )
+ pImg = IsChecked() ? rCtrlData.mpDisclosureMinusHC : rCtrlData.mpDisclosurePlusHC;
+ else
+ pImg = IsChecked() ? rCtrlData.mpDisclosureMinus : rCtrlData.mpDisclosurePlus;
+
+ DBG_ASSERT( pImg, "no disclosure image" );
+ if( ! pImg )
+ return;
+
+ USHORT nStyle = 0;
+ if( ! IsEnabled() )
+ nStyle |= IMAGE_DRAW_DISABLE;
+
+ Size aSize( aStateRect.GetSize() );
+ Size aImgSize( pImg->GetSizePixel() );
+ Point aOff( (aSize.Width() - aImgSize.Width())/2,
+ (aSize.Height() - aImgSize.Height())/2 );
+ aOff += aStateRect.TopLeft();
+ DrawImage( aOff, *pImg, nStyle );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void DisclosureButton::KeyInput( const KeyEvent& rKEvt )
+{
+ KeyCode aKeyCode = rKEvt.GetKeyCode();
+
+ if( !aKeyCode.GetModifier() &&
+ ( ( aKeyCode.GetCode() == KEY_ADD ) ||
+ ( aKeyCode.GetCode() == KEY_SUBTRACT ) )
+ )
+ {
+ Check( aKeyCode.GetCode() == KEY_ADD );
+ }
+ else
+ Button::KeyInput( rKEvt );
+}
+
+
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index 21707d0182f5..1eea72131b86 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -951,7 +951,7 @@ void ComboBox::ImplUpdateFloatSelection()
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
{
if ( !mpImplLB->IsVisible( nSelect ) )
- mpImplLB->SetTopEntry( nSelect );
+ mpImplLB->ShowProminentEntry( nSelect );
mpImplLB->SelectEntry( nSelect, bSelect );
}
else
@@ -959,7 +959,6 @@ void ComboBox::ImplUpdateFloatSelection()
nSelect = mpImplLB->GetEntryList()->GetSelectEntryPos( 0 );
if( nSelect != LISTBOX_ENTRY_NOTFOUND )
mpImplLB->SelectEntry( nSelect, FALSE );
- // mpImplLB->SetTopEntry( 0 ); #92555# Ugly....
mpImplLB->ResetCurrentPos();
}
}
@@ -1440,6 +1439,13 @@ void ComboBox::SetTopEntry( USHORT nPos )
// -----------------------------------------------------------------------
+void ComboBox::ShowProminentEntry( USHORT nPos )
+{
+ mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
+}
+
+// -----------------------------------------------------------------------
+
USHORT ComboBox::GetTopEntry() const
{
USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
@@ -1450,6 +1456,20 @@ USHORT ComboBox::GetTopEntry() const
// -----------------------------------------------------------------------
+void ComboBox::SetProminentEntryType( ProminentEntry eType )
+{
+ mpImplLB->SetProminentEntryType( eType );
+}
+
+// -----------------------------------------------------------------------
+
+ProminentEntry ComboBox::GetProminentEntryType() const
+{
+ return mpImplLB->GetProminentEntryType();
+}
+
+// -----------------------------------------------------------------------
+
Rectangle ComboBox::GetDropDownPosSizePixel() const
{
return mpFloatWin ? mpFloatWin->GetWindowExtentsRelative( const_cast<ComboBox*>(this) ) : Rectangle();
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index b654e034470f..320f235a8c30 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -492,6 +492,17 @@ void Edit::ImplInvalidateOrRepaint( xub_StrLen nStart, xub_StrLen nEnd )
// -----------------------------------------------------------------------
+long Edit::ImplGetTextYPosition() const
+{
+ if ( GetStyle() & WB_TOP )
+ return ImplGetExtraOffset();
+ else if ( GetStyle() & WB_BOTTOM )
+ return GetOutputSizePixel().Height() - GetTextHeight() - ImplGetExtraOffset();
+ return ( GetOutputSizePixel().Height() - GetTextHeight() ) / 2;
+}
+
+// -----------------------------------------------------------------------
+
void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
{
if ( !IsReallyVisible() )
@@ -516,10 +527,8 @@ void Edit::ImplRepaint( xub_StrLen nStart, xub_StrLen nEnd, bool bLayout )
GetCaretPositions( aText, pDX, nStart, nEnd );
}
- // center vertically
- long nH = GetOutputSize().Height();
long nTH = GetTextHeight();
- Point aPos( mnXOffset, (nH-nTH)/2 );
+ Point aPos( mnXOffset, ImplGetTextYPosition() );
if( bLayout )
{
@@ -1193,7 +1202,7 @@ void Edit::ImplShowCursor( BOOL bOnlyIfVisible )
long nCursorPosX = nTextPos + mnXOffset + ImplGetExtraOffset();
// Cursor muss im sichtbaren Bereich landen:
- Size aOutSize = GetOutputSizePixel();
+ const Size aOutSize = GetOutputSizePixel();
if ( (nCursorPosX < 0) || (nCursorPosX >= aOutSize.Width()) )
{
long nOldXOffset = mnXOffset;
@@ -1227,8 +1236,8 @@ void Edit::ImplShowCursor( BOOL bOnlyIfVisible )
ImplInvalidateOrRepaint();
}
- long nTextHeight = GetTextHeight();
- long nCursorPosY = (aOutSize.Height()-nTextHeight) / 2;
+ const long nTextHeight = GetTextHeight();
+ const long nCursorPosY = ImplGetTextYPosition();
pCursor->SetPos( Point( nCursorPosX, nCursorPosY ) );
pCursor->SetSize( Size( nCursorWidth, nTextHeight ) );
pCursor->Show();
@@ -2831,7 +2840,29 @@ void Edit::SetSubEdit( Edit* pEdit )
Size Edit::CalcMinimumSize() const
{
Size aSize ( GetTextWidth( GetText() ), GetTextHeight() );
- return CalcWindowSize( aSize );
+ // do not create edit fields in which one cannot enter anything
+ // a default minimum width should exist for at least 3 characters
+ Size aMinSize ( CalcSize( 3 ) );
+ if( aSize.Width() < aMinSize.Width() )
+ aSize.Width() = aMinSize.Width();
+ // add some space between text entry an border
+ aSize.Height() += 4;
+
+ aSize = CalcWindowSize( aSize );
+
+ // ask NWF what if it has an opinion, too
+ ImplControlValue aControlValue;
+ Rectangle aRect( Point( 0, 0 ), aSize );
+ Region aContent, aBound;
+ if( const_cast<Edit*>(this)->GetNativeControlRegion(
+ CTRL_EDITBOX, PART_ENTIRE_CONTROL,
+ aRect, 0, aControlValue, rtl::OUString(), aBound, aContent) )
+ {
+ Rectangle aBoundRect( aContent.GetBoundRect() );
+ if( aBoundRect.GetHeight() > aSize.Height() )
+ aSize.Height() = aBoundRect.GetHeight();
+ }
+ return aSize;
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx
index 3d19e288a1ce..df2673ede10c 100644
--- a/vcl/source/control/fixed.cxx
+++ b/vcl/source/control/fixed.cxx
@@ -1062,6 +1062,14 @@ void FixedImage::Paint( const Rectangle& )
// -----------------------------------------------------------------------
+Size FixedImage::GetOptimalSize( WindowSizeType ) const
+{
+ const Image* pImage = GetSettings().GetStyleSettings().GetHighContrastMode() ? &maImageHC : &maImage;
+ return pImage->GetSizePixel();
+}
+
+// -----------------------------------------------------------------------
+
void FixedImage::UserDraw( const UserDrawEvent& )
{
}
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index a915d8e6b9e8..ab353a4d4798 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -565,6 +565,7 @@ ImplListBoxWindow::ImplListBoxWindow( Window* pParent, WinBits nWinStyle ) :
mnCurrentPos = LISTBOX_ENTRY_NOTFOUND;
mnTrackingSaveSelection = LISTBOX_ENTRY_NOTFOUND;
mnSeparatorPos = LISTBOX_ENTRY_NOTFOUND;
+ meProminentType = PROMINENT_TOP;
SetLineColor();
SetTextFillColor();
@@ -1067,11 +1068,11 @@ void ImplListBoxWindow::SelectEntry( USHORT nPos, BOOL bSelect )
if ( !nVisibleEntries || !IsReallyVisible() || ( nPos < GetTopEntry() ) )
{
Resize();
- SetTopEntry( nPos );
+ ShowProminentEntry( nPos );
}
else
{
- SetTopEntry( nPos-nVisibleEntries+1 );
+ ShowProminentEntry( nPos );
}
}
}
@@ -1702,11 +1703,7 @@ BOOL ImplListBoxWindow::ProcessKeyInput( const KeyEvent& rKEvt )
if ( nSelect != LISTBOX_ENTRY_NOTFOUND )
{
- USHORT nCurVis = GetLastVisibleEntry() - mnTop + 1;
- if( nSelect < mnTop )
- SetTopEntry( nSelect );
- else if( nSelect >= (mnTop + nCurVis) )
- SetTopEntry( nSelect - nCurVis + 1 );
+ ShowProminentEntry( nSelect );
if ( mpEntryList->IsEntryPosSelected( nSelect ) )
nSelect = LISTBOX_ENTRY_NOTFOUND;
@@ -1873,6 +1870,8 @@ void ImplListBoxWindow::DrawEntry( USHORT nPos, BOOL bDrawImage, BOOL bDrawText,
USHORT nDrawStyle = ImplGetTextStyle();
if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_MULTILINE) )
nDrawStyle |= MULTILINE_ENTRY_DRAW_FLAGS;
+ if( (pEntry->mnFlags & LISTBOX_ENTRY_FLAG_DRAW_DISABLED) )
+ nDrawStyle |= TEXT_DRAW_DISABLE;
DrawText( aTextRect, aStr, nDrawStyle, pVector, pDisplayText );
}
@@ -2051,6 +2050,20 @@ void ImplListBoxWindow::SetTopEntry( USHORT nTop )
// -----------------------------------------------------------------------
+void ImplListBoxWindow::ShowProminentEntry( USHORT nEntryPos )
+{
+ if( meProminentType == PROMINENT_MIDDLE )
+ {
+ USHORT nPos = nEntryPos;
+ long nWHeight = PixelToLogic( GetSizePixel() ).Height();
+ while( nEntryPos > 0 && mpEntryList->GetAddedHeight( nPos+1, nEntryPos ) < nWHeight/2 )
+ nEntryPos--;
+ }
+ SetTopEntry( nEntryPos );
+}
+
+// -----------------------------------------------------------------------
+
void ImplListBoxWindow::SetLeftIndent( long n )
{
ScrollHorz( n - mnLeft );
@@ -3204,7 +3217,7 @@ void ImplListBoxFloatingWindow::StartFloat( BOOL bStartTracking )
StartPopupMode( aRect, FLOATWIN_POPUPMODE_DOWN );
if( nPos != LISTBOX_ENTRY_NOTFOUND )
- mpImplLB->SetTopEntry( nPos );
+ mpImplLB->ShowProminentEntry( nPos );
if( bStartTracking )
mpImplLB->GetMainWindow()->EnableMouseMoveSelect( TRUE );
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index ceabbe4ab166..ac51d7593c93 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -108,6 +108,7 @@ void ListBox::ImplInitListBoxData()
mnDDHeight = 0;
mbDDAutoSize = TRUE;
mnSaveValue = LISTBOX_ENTRY_NOTFOUND;
+ mnLineCount = 0;
}
// -----------------------------------------------------------------------
@@ -1209,6 +1210,13 @@ void ListBox::SetTopEntry( USHORT nPos )
// -----------------------------------------------------------------------
+void ListBox::ShowProminentEntry( USHORT nPos )
+{
+ mpImplLB->ShowProminentEntry( nPos + mpImplLB->GetEntryList()->GetMRUCount() );
+}
+
+// -----------------------------------------------------------------------
+
USHORT ListBox::GetTopEntry() const
{
USHORT nPos = GetEntryCount() ? mpImplLB->GetTopEntry() : LISTBOX_ENTRY_NOTFOUND;
@@ -1219,6 +1227,20 @@ USHORT ListBox::GetTopEntry() const
// -----------------------------------------------------------------------
+void ListBox::SetProminentEntryType( ProminentEntry eType )
+{
+ mpImplLB->SetProminentEntryType( eType );
+}
+
+// -----------------------------------------------------------------------
+
+ProminentEntry ListBox::GetProminentEntryType() const
+{
+ return mpImplLB->GetProminentEntryType();
+}
+
+// -----------------------------------------------------------------------
+
BOOL ListBox::IsTravelSelect() const
{
return mpImplLB->IsTravelSelect();
@@ -1286,31 +1308,47 @@ Size ListBox::CalcMinimumSize() const
else
{
aSz.Height() = mpImplLB->CalcSize( 1 ).Height();
- if( aSz.Height() < mnDDHeight )
+ aSz.Height() += 4; // add a space between entry and border
+ // size to maxmimum entry width and add a little breathing space
+ aSz.Width() = mpImplLB->GetMaxEntryWidth() + 4;
+ // do not create ultrathin ListBoxes, it doesn't look good
+ if( aSz.Width() < GetSettings().GetStyleSettings().GetScrollBarSize() )
+ aSz.Width() = GetSettings().GetStyleSettings().GetScrollBarSize();
+
+ // try native borders; scrollbar size may not be a good indicator
+ // see how large the edit area inside is to estimate what is needed for the dropdown
+ ImplControlValue aControlValue;
+ Point aPoint;
+ Region aContent, aBound;
+ Size aTestSize( 100, 20 );
+ Region aArea( Rectangle( aPoint, aTestSize ) );
+ if( const_cast<ListBox*>(this)->GetNativeControlRegion(
+ CTRL_LISTBOX, PART_SUB_EDIT, aArea, 0, aControlValue, rtl::OUString(), aBound, aContent) )
{
- aSz.Height() = mnDDHeight;
- // FIXME: this is currently only on mac/aqua
- if( ImplGetSVData()->maNWFData.mbNoFocusRects &&
- IsNativeWidgetEnabled() &&
- const_cast<ListBox*>(this)->IsNativeControlSupported( CTRL_LISTBOX, PART_ENTIRE_CONTROL ) )
- {
- ImplControlValue aControlValue;
- Region aCtrlRegion( Rectangle( (const Point&)Point(), Size( 20, mnDDHeight ) ) );
- Region aBoundingRgn( aCtrlRegion );
- Region aContentRgn( aCtrlRegion );
- // adjust the size of the edit field
- if( const_cast<ListBox*>(this)->GetNativeControlRegion( CTRL_LISTBOX, PART_ENTIRE_CONTROL,
- aCtrlRegion, 0, aControlValue, rtl::OUString(), aBoundingRgn, aContentRgn) )
- {
- aSz.Height() = aContentRgn.GetBoundRect().GetHeight();
- }
- }
+ // use the themes drop down size
+ Rectangle aContentRect = aContent.GetBoundRect();
+ aSz.Width() += aTestSize.Width() - aContentRect.GetWidth();
}
- aSz.Width() = mpImplLB->GetMaxEntryWidth();
- aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize();
+ else
+ aSz.Width() += GetSettings().GetStyleSettings().GetScrollBarSize();
}
aSz = CalcWindowSize( aSz );
+
+ if ( IsDropDownBox() ) // check minimum height of dropdown box
+ {
+ ImplControlValue aControlValue;
+ Rectangle aRect( Point( 0, 0 ), aSz );
+ Region aContent, aBound;
+ if( const_cast<ListBox*>(this)->GetNativeControlRegion(
+ CTRL_LISTBOX, PART_ENTIRE_CONTROL, aRect, 0, aControlValue, rtl::OUString(), aBound, aContent) )
+ {
+ Rectangle aBoundRect( aBound.GetBoundRect() );
+ if( aBoundRect.GetHeight() > aSz.Height() )
+ aSz.Height() = aBoundRect.GetHeight();
+ }
+ }
+
return aSz;
}
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 9a34629ddf8e..43c459b6c52e 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -30,25 +30,24 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_vcl.hxx"
-#include <tools/debug.hxx>
-
-#ifndef _SV_RC_H
-#include <tools/rc.h>
-#endif
-#include <vcl/svdata.hxx>
-#ifndef _SV_APP_HXX
-#include <vcl/svapp.hxx>
-#endif
-#include <vcl/help.hxx>
-#include <vcl/event.hxx>
-#include <vcl/menu.hxx>
-#include <vcl/button.hxx>
-#include <vcl/tabpage.hxx>
-#include <vcl/tabctrl.hxx>
-#include <vcl/controldata.hxx>
-#include <vcl/sound.hxx>
-
-#include <vcl/window.h>
+#include "tools/debug.hxx"
+
+#include "tools/rc.h"
+#include "vcl/svdata.hxx"
+#include "vcl/svapp.hxx"
+#include "vcl/help.hxx"
+#include "vcl/event.hxx"
+#include "vcl/menu.hxx"
+#include "vcl/button.hxx"
+#include "vcl/tabpage.hxx"
+#include "vcl/tabctrl.hxx"
+#include "vcl/controllayout.hxx"
+#include "vcl/controldata.hxx"
+#include "vcl/sound.hxx"
+#include "vcl/lstbox.hxx"
+#include "vcl/smartid.hxx"
+
+#include "vcl/window.h"
#include <hash_map>
#include <vector>
@@ -87,6 +86,8 @@ struct ImplTabCtrlData
std::vector< Rectangle > maTabRectangles;
Point maItemsOffset; // offset of the tabitems
std::vector< ImplTabItem > maItemList;
+ ListBox* mpListBox;
+ Size maMinSize;
};
// -----------------------------------------------------------------------
@@ -153,16 +154,25 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
mbRestoreUnqId = FALSE;
mbSingleLine = FALSE;
mbScroll = FALSE;
- mbColored = FALSE;
+ mbRestoreSmartId = FALSE;
mbSmallInvalidate = FALSE;
mbExtraSpace = FALSE;
mpTabCtrlData = new ImplTabCtrlData;
mpTabCtrlData->mpLeftBtn = NULL;
mpTabCtrlData->mpRightBtn = NULL;
+ mpTabCtrlData->mpListBox = NULL;
ImplInitSettings( TRUE, TRUE, TRUE );
+ if( (nStyle & WB_DROPDOWN) )
+ {
+ mpTabCtrlData->mpListBox = new ListBox( this, WB_DROPDOWN );
+ mpTabCtrlData->mpListBox->SetPosSizePixel( Point( 0, 0 ), Size( 200, 20 ) );
+ mpTabCtrlData->mpListBox->SetSelectHdl( LINK( this, TabControl, ImplListBoxSelectHdl ) );
+ mpTabCtrlData->mpListBox->Show();
+ }
+
// if the tabcontrol is drawn (ie filled) by a native widget, make sure all contols will have transparent background
// otherwise they will paint with a wrong background
if( IsNativeControlSupported(CTRL_TAB_PANE, PART_ENTIRE_CONTROL) )
@@ -286,6 +296,8 @@ TabControl::~TabControl()
// TabCtrl-Daten loeschen
if ( mpTabCtrlData )
{
+ if( mpTabCtrlData->mpListBox )
+ delete mpTabCtrlData->mpListBox;
if ( mpTabCtrlData->mpLeftBtn )
delete mpTabCtrlData->mpLeftBtn;
if ( mpTabCtrlData->mpRightBtn )
@@ -693,6 +705,8 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
pCtrlParent->SetHelpId( 0 );
if ( mbRestoreUnqId )
pCtrlParent->SetUniqueId( 0 );
+ if( mbRestoreSmartId )
+ pCtrlParent->SetSmartHelpId( SmartId() );
pOldPage->DeactivatePage();
}
@@ -700,8 +714,8 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
{
pPage->SetPosSizePixel( aRect.TopLeft(), aRect.GetSize() );
- // Hier Page aktivieren, damit die Controls entsprechend umgeschaltet
- // werden koennen und HilfeId gegebenenfalls beim Parent umsetzen
+ // activate page here so the conbtrols can be switched
+ // also set the help id of the parent window to that of the tab page
if ( !GetHelpId() )
{
mbRestoreHelpId = TRUE;
@@ -712,6 +726,11 @@ void TabControl::ImplChangeTabPage( USHORT nId, USHORT nOldId )
mbRestoreUnqId = TRUE;
pCtrlParent->SetUniqueId( pPage->GetUniqueId() );
}
+ if( ! GetSmartHelpId().HasAny() )
+ {
+ mbRestoreSmartId = TRUE;
+ pCtrlParent->SetSmartHelpId( pPage->GetSmartHelpId() );
+ }
pPage->ActivatePage();
@@ -791,7 +810,7 @@ void TabControl::ImplSetFirstPagePos( USHORT )
void TabControl::ImplShowFocus()
{
- if ( !GetPageCount() )
+ if ( !GetPageCount() || mpTabCtrlData->mpListBox )
return;
// make sure the focussed item rect is computed using a bold font
@@ -1062,16 +1081,27 @@ IMPL_LINK( TabControl, ImplScrollBtnHdl, PushButton*, EMPTYARG )
// -----------------------------------------------------------------------
+IMPL_LINK( TabControl, ImplListBoxSelectHdl, ListBox*, EMPTYARG )
+{
+ SelectTabPage( GetPageId( mpTabCtrlData->mpListBox->GetSelectEntryPos() ) );
+ return 0;
+}
+
+// -----------------------------------------------------------------------
+
void TabControl::MouseButtonDown( const MouseEvent& rMEvt )
{
- if ( rMEvt.IsLeft() )
+ if( mpTabCtrlData->mpListBox == NULL )
{
- USHORT nPageId = GetPageId( rMEvt.GetPosPixel() );
- ImplTabItem* pItem = ImplGetItem( nPageId );
- if( pItem && pItem->mbEnabled )
- SelectTabPage( nPageId );
- else
- Sound::Beep( SOUND_ERROR, this );
+ if( rMEvt.IsLeft() )
+ {
+ USHORT nPageId = GetPageId( rMEvt.GetPosPixel() );
+ ImplTabItem* pItem = ImplGetItem( nPageId );
+ if( pItem && pItem->mbEnabled )
+ SelectTabPage( nPageId );
+ else
+ Sound::Beep( SOUND_ERROR, this );
+ }
}
}
@@ -1079,7 +1109,9 @@ void TabControl::MouseButtonDown( const MouseEvent& rMEvt )
void TabControl::KeyInput( const KeyEvent& rKEvt )
{
- if ( GetPageCount() > 1 )
+ if( mpTabCtrlData->mpListBox )
+ mpTabCtrlData->mpListBox->KeyInput( rKEvt );
+ else if ( GetPageCount() > 1 )
{
KeyCode aKeyCode = rKEvt.GetKeyCode();
USHORT nKeyCode = aKeyCode.GetCode();
@@ -1224,7 +1256,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout )
}
}
- if ( !mpTabCtrlData->maItemList.empty() )
+ if ( !mpTabCtrlData->maItemList.empty() && mpTabCtrlData->mpListBox == NULL )
{
// Some native toolkits (GTK+) draw tabs right-to-left, with an
// overlap between adjacent tabs
@@ -1294,6 +1326,18 @@ void TabControl::Resize()
if ( !IsReallyShown() )
return;
+ if( mpTabCtrlData->mpListBox )
+ {
+ // get the listbox' preferred size
+ Size aTabCtrlSize( GetSizePixel() );
+ long nPrefWidth = mpTabCtrlData->mpListBox->GetOptimalSize( WINDOWSIZE_PREFERRED ).Width();
+ if( nPrefWidth > aTabCtrlSize.Width() )
+ nPrefWidth = aTabCtrlSize.Width();
+ Size aNewSize( nPrefWidth, LogicToPixel( Size( 12, 12 ), MapMode( MAP_APPFONT ) ).Height() );
+ Point aNewPos( (aTabCtrlSize.Width() - nPrefWidth) / 2, 0 );
+ mpTabCtrlData->mpListBox->SetPosSizePixel( aNewPos, aNewSize );
+ }
+
mbFormat = TRUE;
// Aktuelle TabPage resizen/positionieren
@@ -1343,8 +1387,16 @@ void TabControl::Resize()
void TabControl::GetFocus()
{
- ImplShowFocus();
- SetInputContext( InputContext( GetFont() ) );
+ if( ! mpTabCtrlData->mpListBox )
+ {
+ ImplShowFocus();
+ SetInputContext( InputContext( GetFont() ) );
+ }
+ else
+ {
+ if( mpTabCtrlData->mpListBox->IsReallyVisible() )
+ mpTabCtrlData->mpListBox->GrabFocus();
+ }
Control::GetFocus();
}
@@ -1352,7 +1404,8 @@ void TabControl::GetFocus()
void TabControl::LoseFocus()
{
- HideFocus();
+ if( ! mpTabCtrlData->mpListBox )
+ HideFocus();
Control::LoseFocus();
}
@@ -1446,7 +1499,7 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt )
void TabControl::Command( const CommandEvent& rCEvt )
{
- if ( (rCEvt.GetCommand() == COMMAND_CONTEXTMENU) && (GetPageCount() > 1) )
+ if( (mpTabCtrlData->mpListBox == NULL) && (rCEvt.GetCommand() == COMMAND_CONTEXTMENU) && (GetPageCount() > 1) )
{
Point aMenuPos;
BOOL bMenu;
@@ -1490,7 +1543,11 @@ void TabControl::StateChanged( StateChangedType nType )
Control::StateChanged( nType );
if ( nType == STATE_CHANGE_INITSHOW )
+ {
ImplPosCurTabPage();
+ if( mpTabCtrlData->mpListBox )
+ Resize();
+ }
else if ( nType == STATE_CHANGE_UPDATEMODE )
{
if ( IsUpdateMode() )
@@ -1601,7 +1658,7 @@ long TabControl::PreNotify( NotifyEvent& rNEvt )
// -----------------------------------------------------------------------
-long TabControl::Notify( NotifyEvent& rNEvt )
+bool TabControl::ImplHandleNotifyEvent( NotifyEvent& rNEvt )
{
if ( (rNEvt.GetType() == EVENT_KEYINPUT) && (GetPageCount() > 1) )
{
@@ -1629,8 +1686,16 @@ long TabControl::Notify( NotifyEvent& rNEvt )
}
}
}
+ return false;
+}
+
- return Control::Notify( rNEvt );
+// -----------------------------------------------------------------------
+
+long TabControl::Notify( NotifyEvent& rNEvt )
+{
+
+ return ImplHandleNotifyEvent( rNEvt ) ? TRUE : Control::Notify( rNEvt );
}
// -----------------------------------------------------------------------
@@ -1708,23 +1773,33 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
DBG_ASSERT( GetPagePos( nPageId ) == TAB_PAGE_NOTFOUND,
"TabControl::InsertPage(): PageId already exists" );
- // set current page id
- if ( !mnCurPageId )
- mnCurPageId = nPageId;
-
// insert new page item
ImplTabItem* pItem = NULL;
if( nPos == TAB_APPEND || size_t(nPos) >= mpTabCtrlData->maItemList.size() )
{
mpTabCtrlData->maItemList.push_back( ImplTabItem() );
pItem = &mpTabCtrlData->maItemList.back();
+ if( mpTabCtrlData->mpListBox )
+ mpTabCtrlData->mpListBox->InsertEntry( rText );
}
else
{
std::vector< ImplTabItem >::iterator new_it =
mpTabCtrlData->maItemList.insert( mpTabCtrlData->maItemList.begin() + nPos, ImplTabItem() );
pItem = &(*new_it);
+ if( mpTabCtrlData->mpListBox )
+ mpTabCtrlData->mpListBox->InsertEntry( rText, nPos);
}
+ if( mpTabCtrlData->mpListBox )
+ {
+ if( ! mnCurPageId )
+ mpTabCtrlData->mpListBox->SelectEntryPos( 0 );
+ mpTabCtrlData->mpListBox->SetDropDownLineCount( mpTabCtrlData->mpListBox->GetEntryCount() );
+ }
+
+ // set current page id
+ if ( !mnCurPageId )
+ mnCurPageId = nPageId;
// init new page item
pItem->mnId = nPageId;
@@ -1739,6 +1814,8 @@ void TabControl::InsertPage( USHORT nPageId, const XubString& rText,
Invalidate();
ImplFreeLayoutData();
+ if( mpTabCtrlData->mpListBox ) // reposition/resize listbox
+ Resize();
ImplCallEventListeners( VCLEVENT_TABPAGE_INSERTED, (void*) (ULONG)nPageId );
}
@@ -1756,6 +1833,11 @@ void TabControl::RemovePage( USHORT nPageId )
std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin() + nPos;
bool bIsCurrentPage = (it->mnId == mnCurPageId);
mpTabCtrlData->maItemList.erase( it );
+ if( mpTabCtrlData->mpListBox )
+ {
+ mpTabCtrlData->mpListBox->RemoveEntry( nPos );
+ mpTabCtrlData->mpListBox->SetDropDownLineCount( mpTabCtrlData->mpListBox->GetEntryCount() );
+ }
// If current page is removed, than first page gets the current page
if ( bIsCurrentPage )
@@ -1793,6 +1875,8 @@ void TabControl::Clear()
// clear item list
mpTabCtrlData->maItemList.clear();
mnCurPageId = 0;
+ if( mpTabCtrlData->mpListBox )
+ mpTabCtrlData->mpListBox->Clear();
ImplFreeLayoutData();
@@ -1813,6 +1897,9 @@ void TabControl::EnablePage( USHORT i_nPageId, bool i_bEnable )
{
pItem->mbEnabled = i_bEnable;
mbFormat = TRUE;
+ if( mpTabCtrlData->mpListBox )
+ mpTabCtrlData->mpListBox->SetEntryFlags( GetPagePos( i_nPageId ),
+ i_bEnable ? 0 : (LISTBOX_ENTRY_FLAG_DISABLE_SELECTION | LISTBOX_ENTRY_FLAG_DRAW_DISABLED) );
if( pItem->mnId == mnCurPageId )
{
// SetCurPageId will change to an enabled page
@@ -1937,6 +2024,8 @@ void TabControl::SelectTabPage( USHORT nPageId )
nPageId = mnActPageId;
mnActPageId = 0;
SetCurPageId( nPageId );
+ if( mpTabCtrlData->mpListBox )
+ mpTabCtrlData->mpListBox->SelectEntryPos( GetPagePos( nPageId ) );
ImplCallEventListeners( VCLEVENT_TABPAGE_ACTIVATE, (void*) (ULONG) nPageId );
}
}
@@ -2001,6 +2090,12 @@ void TabControl::SetPageText( USHORT nPageId, const XubString& rText )
{
pItem->maText = rText;
mbFormat = TRUE;
+ if( mpTabCtrlData->mpListBox )
+ {
+ USHORT nPos = GetPagePos( nPageId );
+ mpTabCtrlData->mpListBox->RemoveEntry( nPos );
+ mpTabCtrlData->mpListBox->InsertEntry( rText, nPos );
+ }
if ( IsUpdateMode() )
Invalidate();
ImplFreeLayoutData();
@@ -2216,3 +2311,25 @@ Point TabControl::GetItemsOffset() const
}
// -----------------------------------------------------------------------
+
+Size TabControl::GetOptimalSize(WindowSizeType eType) const
+{
+ switch (eType) {
+ case WINDOWSIZE_MINIMUM:
+ return mpTabCtrlData ? mpTabCtrlData->maMinSize : Size();
+ default:
+ return Control::GetOptimalSize( eType );
+ }
+}
+
+// -----------------------------------------------------------------------
+
+void TabControl::SetMinimumSizePixel( const Size& i_rSize )
+{
+ if( mpTabCtrlData )
+ mpTabCtrlData->maMinSize = i_rSize;
+}
+
+// -----------------------------------------------------------------------
+
+
diff --git a/vcl/source/fontsubset/gsub.cxx b/vcl/source/fontsubset/gsub.cxx
index 600c03194210..a1c3344f3e5a 100644
--- a/vcl/source/fontsubset/gsub.cxx
+++ b/vcl/source/fontsubset/gsub.cxx
@@ -42,6 +42,7 @@ namespace vcl
{
typedef sal_uInt32 ULONG;
+typedef sal_uInt32 UINT32;
typedef sal_uInt16 USHORT;
typedef sal_uInt8 FT_Byte;
@@ -280,13 +281,11 @@ int ReadGSUB( struct _TrueTypeFont* pTTFile,
return false;
for( int i = nCntRange; --i >= 0; )
{
- const USHORT nGlyph0 = NEXT_UShort( pCoverage );
- const USHORT nGlyph1 = NEXT_UShort( pCoverage );
- const USHORT nStartCoverageIndex = NEXT_UShort( pCoverage );
- OSL_ENSURE( aSubstVector.size() == nStartCoverageIndex, "coverage index mismatch");
- (void)nStartCoverageIndex;
- for( USHORT j = nGlyph0; j <= nGlyph1; ++j )
- aSubstVector.push_back( GlyphSubst( j, 0 ) );
+ const UINT32 nGlyph0 = NEXT_UShort( pCoverage );
+ const UINT32 nGlyph1 = NEXT_UShort( pCoverage );
+ const USHORT nCovIdx = NEXT_UShort( pCoverage );
+ for( UINT32 j = nGlyph0; j <= nGlyph1; ++j )
+ aSubstVector.push_back( GlyphSubst( static_cast<USHORT>(j + nCovIdx), 0 ) );
}
}
break;
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index 0accc42af968..964d6a93ac3c 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -1094,6 +1094,14 @@ static void GetNames(TrueTypeFont *t)
const sal_uInt8* table = getTable( t, O_name );
int nTableSize = getTableSize(t, O_name);
+ if (nTableSize < 4)
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf(stderr, "O_name table too small\n");
+#endif
+ return;
+ }
+
sal_uInt16 n = GetUInt16(table, 2, 1);
int i, r;
sal_Bool bPSNameOK = sal_True;
@@ -1681,7 +1689,6 @@ int OpenTTFontFile( const char* fname, sal_uInt32 facenum, TrueTypeFont** ttf )
goto cleanup;
}
-
if (((*ttf)->ptr = (sal_uInt8 *) mmap(0, (*ttf)->fsize, PROT_READ, MAP_SHARED, fd, 0)) == MAP_FAILED) {
ret = SF_MEMORY;
goto cleanup;
@@ -2702,7 +2709,7 @@ void GetTTGlobalFontInfo(TrueTypeFont *ttf, TTGlobalFontInfo *info)
}
table = getTable(ttf, O_post);
- if (table) {
+ if (table && getTableSize(ttf, O_post) >= 12+sizeof(sal_uInt32)) {
info->pitch = GetUInt32(table, 12, 1);
info->italicAngle = GetInt32(table, 4, 1);
}
@@ -2808,6 +2815,15 @@ int GetTTNameRecords(TrueTypeFont *ttf, NameRecord **nr)
{
const sal_uInt8* table = getTable(ttf, O_name);
int nTableSize = getTableSize(ttf, O_name );
+
+ if (nTableSize < 6)
+ {
+#if OSL_DEBUG_LEVEL > 1
+ fprintf(stderr, "O_name table too small\n");
+#endif
+ return 0;
+ }
+
sal_uInt16 n = GetUInt16(table, 2, 1);
int nStrBase = GetUInt16(table, 4, 1);
int i;
diff --git a/vcl/source/gdi/bmpconv.cxx b/vcl/source/gdi/bmpconv.cxx
index 9d9b81ba50d4..03d85acb0159 100644
--- a/vcl/source/gdi/bmpconv.cxx
+++ b/vcl/source/gdi/bmpconv.cxx
@@ -192,7 +192,8 @@ BmpTransporter::BmpTransporter( const Bitmap& rBM )
m_aSize.Height = rBM.GetSizePixel().Height();
SvMemoryStream aStream;
rBM.Write( aStream, FALSE, TRUE );
- m_aBM = Sequence<sal_Int8>((const sal_Int8*)aStream.GetData(), aStream.GetSize() );
+ m_aBM = Sequence<sal_Int8>(static_cast<const sal_Int8*>(aStream.GetData()),
+ aStream.GetEndOfData());
}
BmpTransporter::~BmpTransporter()
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx
index 6483c8292df7..951d80f9af9d 100644
--- a/vcl/source/gdi/gdimtf.cxx
+++ b/vcl/source/gdi/gdimtf.cxx
@@ -876,6 +876,40 @@ void GDIMetaFile::Scale( const Fraction& rScaleX, const Fraction& rScaleY )
// ------------------------------------------------------------------------
+void GDIMetaFile::Clip( const Rectangle& i_rClipRect )
+{
+ Rectangle aCurRect( i_rClipRect );
+ VirtualDevice aMapVDev;
+
+ aMapVDev.EnableOutput( FALSE );
+ aMapVDev.SetMapMode( GetPrefMapMode() );
+
+ for( MetaAction* pAct = (MetaAction*) First(); pAct; pAct = (MetaAction*) Next() )
+ {
+ const long nType = pAct->GetType();
+
+ if( ( META_MAPMODE_ACTION == nType ) ||
+ ( META_PUSH_ACTION == nType ) ||
+ ( META_POP_ACTION == nType ) )
+ {
+ pAct->Execute( &aMapVDev );
+ aCurRect = aMapVDev.LogicToLogic( i_rClipRect, GetPrefMapMode(), aMapVDev.GetMapMode() );
+ }
+ else if( nType == META_CLIPREGION_ACTION )
+ {
+ MetaClipRegionAction* pOldAct = (MetaClipRegionAction*)pAct;
+ Region aNewReg( aCurRect );
+ if( pOldAct->IsClipping() )
+ aNewReg.Intersect( pOldAct->GetRegion() );
+ MetaClipRegionAction* pNewAct = new MetaClipRegionAction( aNewReg, TRUE );
+ Replace( pNewAct, GetCurPos() );
+ pOldAct->Delete();
+ }
+ }
+}
+
+// ------------------------------------------------------------------------
+
Point GDIMetaFile::ImplGetRotatedPoint( const Point& rPt, const Point& rRotatePt,
const Size& rOffset, double fSin, double fCos )
{
diff --git a/vcl/source/gdi/impprn.cxx b/vcl/source/gdi/impprn.cxx
index 539c879c89ea..28d92a0b3832 100644
--- a/vcl/source/gdi/impprn.cxx
+++ b/vcl/source/gdi/impprn.cxx
@@ -478,10 +478,12 @@ void ImplQPrinter::EndQueuePrint()
DBG_ASSERT( mpPrinter, "no SalPrinter in ImplQPrinter" );
if( mpPrinter )
{
+ #if 0
mpPrinter->StartJob( mbPrintFile ? &maPrintFile : NULL,
Application::GetDisplayName(),
maJobSetup.ImplGetConstData(),
this );
+ #endif
EndJob();
mpParent->ImplEndPrint();
}
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index 686d33593466..4823a5492ded 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -73,6 +73,7 @@ ImplJobSetup::ImplJobSetup()
mnRefCount = 1;
mnSystem = 0;
meOrientation = ORIENTATION_PORTRAIT;
+ meDuplexMode = DUPLEX_UNKNOWN;
mnPaperBin = 0;
mePaperFormat = PAPER_USER;
mnPaperWidth = 0;
@@ -90,6 +91,7 @@ ImplJobSetup::ImplJobSetup( const ImplJobSetup& rJobSetup ) :
mnRefCount = 1;
mnSystem = rJobSetup.mnSystem;
meOrientation = rJobSetup.meOrientation;
+ meDuplexMode = rJobSetup.meDuplexMode;
mnPaperBin = rJobSetup.mnPaperBin;
mePaperFormat = rJobSetup.mePaperFormat;
mnPaperWidth = rJobSetup.mnPaperWidth;
@@ -277,6 +279,7 @@ BOOL JobSetup::operator==( const JobSetup& rJobSetup ) const
(pData1->maPrinterName == pData2->maPrinterName) &&
(pData1->maDriver == pData2->maDriver) &&
(pData1->meOrientation == pData2->meOrientation) &&
+ (pData1->meDuplexMode == pData2->meDuplexMode) &&
(pData1->mnPaperBin == pData2->mnPaperBin) &&
(pData1->mePaperFormat == pData2->mePaperFormat) &&
(pData1->mnPaperWidth == pData2->mnPaperWidth) &&
@@ -337,6 +340,7 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
pJobData->mnSystem = SVBT16ToShort( pOldJobData->nSystem );
pJobData->mnDriverDataLen = SVBT32ToUInt32( pOldJobData->nDriverDataLen );
pJobData->meOrientation = (Orientation)SVBT16ToShort( pOldJobData->nOrientation );
+ pJobData->meDuplexMode = DUPLEX_UNKNOWN;
pJobData->mnPaperBin = SVBT16ToShort( pOldJobData->nPaperBin );
pJobData->mePaperFormat = (Paper)SVBT16ToShort( pOldJobData->nPaperFormat );
pJobData->mnPaperWidth = (long)SVBT32ToUInt32( pOldJobData->nPaperWidth );
@@ -355,7 +359,19 @@ SvStream& operator>>( SvStream& rIStream, JobSetup& rJobSetup )
String aKey, aValue;
rIStream.ReadByteString( aKey, RTL_TEXTENCODING_UTF8 );
rIStream.ReadByteString( aValue, RTL_TEXTENCODING_UTF8 );
- pJobData->maValueMap[ aKey ] = aValue;
+ if( aKey.EqualsAscii( "COMPAT_DUPLEX_MODE" ) )
+ {
+ if( aValue.EqualsAscii( "DUPLEX_UNKNOWN" ) )
+ pJobData->meDuplexMode = DUPLEX_UNKNOWN;
+ else if( aValue.EqualsAscii( "DUPLEX_OFF" ) )
+ pJobData->meDuplexMode = DUPLEX_OFF;
+ else if( aValue.EqualsAscii( "DUPLEX_SHORTEDGE" ) )
+ pJobData->meDuplexMode = DUPLEX_SHORTEDGE;
+ else if( aValue.EqualsAscii( "DUPLEX_LONGEDGE" ) )
+ pJobData->meDuplexMode = DUPLEX_LONGEDGE;
+ }
+ else
+ pJobData->maValueMap[ aKey ] = aValue;
}
DBG_ASSERT( rIStream.Tell() == nFirstPos+nLen, "corrupted job setup" );
// ensure correct stream position
@@ -421,6 +437,14 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
rOStream.WriteByteString( it->first, RTL_TEXTENCODING_UTF8 );
rOStream.WriteByteString( it->second, RTL_TEXTENCODING_UTF8 );
}
+ rOStream.WriteByteString( "COMPAT_DUPLEX_MODE" ) ;
+ switch( pJobData->meDuplexMode )
+ {
+ case DUPLEX_UNKNOWN: rOStream.WriteByteString( "DUPLEX_UNKNOWN" );break;
+ case DUPLEX_OFF: rOStream.WriteByteString( "DUPLEX_OFF" );break;
+ case DUPLEX_SHORTEDGE: rOStream.WriteByteString( "DUPLEX_SHORTEDGE" );break;
+ case DUPLEX_LONGEDGE: rOStream.WriteByteString( "DUPLEX_LONGEDGE" );break;
+ }
nLen = sal::static_int_cast<USHORT>(rOStream.Tell() - nPos);
rOStream.Seek( nPos );
rOStream << nLen;
diff --git a/vcl/source/gdi/makefile.mk b/vcl/source/gdi/makefile.mk
index eda537bf629a..ed2a9b2ba1e1 100755..100644
--- a/vcl/source/gdi/makefile.mk
+++ b/vcl/source/gdi/makefile.mk
@@ -57,6 +57,8 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/gfxlink.obj \
$(SLO)$/print.obj \
$(SLO)$/print2.obj \
+ $(SLO)$/print3.obj \
+ $(SLO)$/oldprintadaptor.obj \
$(SLO)$/configsettings.obj \
$(SLO)$/sallayout.obj \
$(SLO)$/image.obj \
@@ -72,7 +74,6 @@ EXCEPTIONSFILES= $(SLO)$/salmisc.obj \
$(SLO)$/pngread.obj \
$(SLO)$/pngwrite.obj \
$(SLO)$/virdev.obj \
- $(SLO)$/impprn.obj \
$(SLO)$/gdimtf.obj \
$(SLO)$/graphictools.obj \
$(SLO)$/textlayout.obj \
@@ -118,6 +119,7 @@ SLOFILES= $(EXCEPTIONSFILES) \
$(SLO)$/extoutdevdata.obj \
$(SLO)$/salnativewidgets-none.obj
+
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk
diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx
new file mode 100644
index 000000000000..cffd11daaad6
--- /dev/null
+++ b/vcl/source/gdi/oldprintadaptor.cxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#include "precompiled_vcl.hxx"
+
+#include "vcl/oldprintadaptor.hxx"
+#include "vcl/gdimtf.hxx"
+
+#include "com/sun/star/awt/Size.hpp"
+
+#include <vector>
+
+namespace vcl
+{
+ struct AdaptorPage
+ {
+ GDIMetaFile maPage;
+ com::sun::star::awt::Size maPageSize;
+ };
+
+ struct ImplOldStyleAdaptorData
+ {
+ std::vector< AdaptorPage > maPages;
+ };
+}
+
+using namespace vcl;
+using namespace cppu;
+using namespace com::sun::star;
+using namespace com::sun::star::uno;
+using namespace com::sun::star::beans;
+
+OldStylePrintAdaptor::OldStylePrintAdaptor( const boost::shared_ptr< Printer >& i_pPrinter )
+ : PrinterController( i_pPrinter )
+ , mpData( new ImplOldStyleAdaptorData() )
+{
+}
+
+OldStylePrintAdaptor::~OldStylePrintAdaptor()
+{
+}
+
+void OldStylePrintAdaptor::StartPage()
+{
+ Size aPaperSize( getPrinter()->PixelToLogic( getPrinter()->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
+ mpData->maPages.push_back( AdaptorPage() );
+ mpData->maPages.back().maPageSize.Width = aPaperSize.getWidth();
+ mpData->maPages.back().maPageSize.Height = aPaperSize.getHeight();
+ getPrinter()->SetConnectMetaFile( &mpData->maPages.back().maPage );
+
+ // copy state into metafile
+ boost::shared_ptr<Printer> pPrinter( getPrinter() );
+ pPrinter->SetMapMode( pPrinter->GetMapMode() );
+ pPrinter->SetFont( pPrinter->GetFont() );
+ pPrinter->SetDrawMode( pPrinter->GetDrawMode() );
+ pPrinter->SetLineColor( pPrinter->GetLineColor() );
+ pPrinter->SetFillColor( pPrinter->GetFillColor() );
+}
+
+void OldStylePrintAdaptor::EndPage()
+{
+ getPrinter()->SetConnectMetaFile( NULL );
+ mpData->maPages.back().maPage.WindStart();
+}
+
+int OldStylePrintAdaptor::getPageCount() const
+{
+ return int(mpData->maPages.size());
+}
+
+Sequence< PropertyValue > OldStylePrintAdaptor::getPageParameters( int i_nPage ) const
+{
+ Sequence< PropertyValue > aRet( 1 );
+ aRet[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("PageSize") );
+ if( i_nPage < int(mpData->maPages.size() ) )
+ aRet[0].Value = makeAny( mpData->maPages[i_nPage].maPageSize );
+ else
+ {
+ awt::Size aEmpty( 0, 0 );
+ aRet[0].Value = makeAny( aEmpty );
+ }
+ return aRet;
+}
+
+void OldStylePrintAdaptor::printPage( int i_nPage ) const
+{
+ if( i_nPage < int(mpData->maPages.size()) )
+ {
+ mpData->maPages[ i_nPage ].maPage.WindStart();
+ mpData->maPages[ i_nPage ].maPage.Play( getPrinter().get() );
+ }
+}
+
diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx
index 51aad0790a26..28fa4f8f5461 100644
--- a/vcl/source/gdi/outdev3.cxx
+++ b/vcl/source/gdi/outdev3.cxx
@@ -5601,6 +5601,8 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const String& rStr,
if ( !IsDeviceOutputNecessary() )
return;
+ if( !mpGraphics && !ImplGetGraphics() )
+ return;
if( mbInitClipRegion )
ImplInitClipRegion();
if( mbOutputClipped )
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index c0205f1f325d..d42e736960d2 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -2814,37 +2814,6 @@ sal_Int32 PDFWriterImpl::emitBuiltinFont( const ImplFontData* pFont, sal_Int32 n
return nFontObject;
}
-typedef int ThreeInts[3];
-static bool getPfbSegmentLengths( const unsigned char* pFontBytes, int nByteLen,
- ThreeInts& rSegmentLengths )
-{
- if( !pFontBytes || (nByteLen < 0) )
- return false;
- const unsigned char* pPtr = pFontBytes;
- const unsigned char* pEnd = pFontBytes + nByteLen;
-
- for( int i = 0; i < 3; ++i) {
- // read segment1 header
- if( pPtr+6 >= pEnd )
- return false;
- if( (pPtr[0] != 0x80) || (pPtr[1] >= 0x03) )
- return false;
- const int nLen = (pPtr[5]<<24) + (pPtr[4]<<16) + (pPtr[3]<<8) + pPtr[2];
- if( nLen <= 0)
- return false;
- rSegmentLengths[i] = nLen;
- pPtr += nLen + 6;
- }
-
- // read segment-end header
- if( pPtr+2 >= pEnd )
- return false;
- if( (pPtr[0] != 0x80) || (pPtr[1] != 0x03) )
- return false;
-
- return true;
-}
-
std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontData* pFont, EmbedFont& rEmbed )
{
std::map< sal_Int32, sal_Int32 > aRet;
@@ -2960,6 +2929,41 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const ImplFontDa
return aRet;
}
+typedef int ThreeInts[3];
+static bool getPfbSegmentLengths( const unsigned char* pFontBytes, int nByteLen,
+ ThreeInts& rSegmentLengths )
+{
+ if( !pFontBytes || (nByteLen < 0) )
+ return false;
+ const unsigned char* pPtr = pFontBytes;
+ const unsigned char* pEnd = pFontBytes + nByteLen;
+
+ for( int i = 0; i < 3; ++i) {
+ // read segment1 header
+ if( pPtr+6 >= pEnd )
+ return false;
+ if( (pPtr[0] != 0x80) || (pPtr[1] >= 0x03) )
+ return false;
+ const int nLen = (pPtr[5]<<24) + (pPtr[4]<<16) + (pPtr[3]<<8) + pPtr[2];
+ if( nLen <= 0)
+ return false;
+ rSegmentLengths[i] = nLen;
+ pPtr += nLen + 6;
+ }
+
+ // read segment-end header
+ if( pPtr+2 >= pEnd )
+ return false;
+ if( (pPtr[0] != 0x80) || (pPtr[1] != 0x03) )
+ return false;
+
+ return true;
+}
+
+struct FontException : public std::exception
+{
+};
+
// TODO: always subset instead of embedding the full font => this method becomes obsolete then
std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFontData* pFont, EmbedFont& rEmbed )
{
@@ -2979,10 +2983,16 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
sal_Int32 nToUnicodeStream = 0;
sal_uInt8 nEncoding[256];
sal_Ucs nEncodedCodes[256];
+ std::vector<sal_Ucs> aUnicodes;
+ aUnicodes.reserve( 256 );
+ sal_Int32 pUnicodesPerGlyph[256];
+ sal_Int32 pEncToUnicodeIndex[256];
if( pEncoding )
{
- memset( nEncodedCodes, 0, sizeof(nEncodedCodes) );
- memset( nEncoding, 0, sizeof(nEncoding) );
+ rtl_zeroMemory( nEncoding, sizeof(nEncoding) );
+ rtl_zeroMemory( nEncodedCodes, sizeof(nEncodedCodes) );
+ rtl_zeroMemory( pUnicodesPerGlyph, sizeof(pUnicodesPerGlyph) );
+ rtl_zeroMemory( pEncToUnicodeIndex, sizeof(pEncToUnicodeIndex) );
for( Ucs2SIntMap::const_iterator it = pEncoding->begin(); it != pEncoding->end(); ++it )
{
if( it->second != -1 )
@@ -2990,6 +3000,9 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
sal_Int32 nCode = (sal_Int32)(it->second & 0x000000ff);
nEncoding[ nCode ] = static_cast<sal_uInt8>( nCode );
nEncodedCodes[ nCode ] = it->first;
+ pEncToUnicodeIndex[ nCode ] = static_cast<sal_Int32>(aUnicodes.size());
+ aUnicodes.push_back( it->first );
+ pUnicodesPerGlyph[ nCode ] = 1;
}
}
}
@@ -2999,553 +3012,525 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitEmbeddedFont( const ImplFont
const unsigned char* pFontData = NULL;
long nFontLen = 0;
sal_Int32 nLength1, nLength2;
- if( (pFontData = (const unsigned char*)m_pReferenceDevice->mpGraphics->GetEmbedFontData( pFont, nEncodedCodes, pWidths, aInfo, &nFontLen )) != NULL )
- {
- if( (aInfo.m_nFontType & FontSubsetInfo::ANY_TYPE1) == 0 )
- goto streamend;
- // see whether it is pfb or pfa; if it is a pfb, fill ranges
- // of 6 bytes that are not part of the font program
- std::list< int > aSections;
- std::list< int >::const_iterator it;
- int nIndex = 0;
- while( pFontData[nIndex] == 0x80 && nIndex < nFontLen-1 )
- {
- aSections.push_back( nIndex );
- if( pFontData[nIndex+1] == 0x03 )
- break;
- sal_Int32 nBytes =
+ try
+ {
+ if( (pFontData = (const unsigned char*)m_pReferenceDevice->mpGraphics->GetEmbedFontData( pFont, nEncodedCodes, pWidths, aInfo, &nFontLen )) != NULL )
+ {
+ if( (aInfo.m_nFontType & FontSubsetInfo::ANY_TYPE1) == 0 )
+ throw FontException();
+ // see whether it is pfb or pfa; if it is a pfb, fill ranges
+ // of 6 bytes that are not part of the font program
+ std::list< int > aSections;
+ std::list< int >::const_iterator it;
+ int nIndex = 0;
+ while( pFontData[nIndex] == 0x80 && nIndex < nFontLen-1 )
+ {
+ aSections.push_back( nIndex );
+ if( pFontData[nIndex+1] == 0x03 )
+ break;
+ sal_Int32 nBytes =
((sal_Int32)pFontData[nIndex+2]) |
((sal_Int32)pFontData[nIndex+3]) << 8 |
((sal_Int32)pFontData[nIndex+4]) << 16 |
((sal_Int32)pFontData[nIndex+5]) << 24;
- nIndex += nBytes+6;
- }
-
- // search for eexec
- // TODO: use getPfbSegmentLengths() if possible to skip the search thingies below
- nIndex = 0;
- int nEndAsciiIndex;
- int nBeginBinaryIndex;
- int nEndBinaryIndex;
- do
- {
- while( nIndex < nFontLen-4 &&
- ( pFontData[nIndex] != 'e' ||
- pFontData[nIndex+1] != 'e' ||
- pFontData[nIndex+2] != 'x' ||
- pFontData[nIndex+3] != 'e' ||
- pFontData[nIndex+4] != 'c'
- )
- )
- nIndex++;
- // check whether we are in a excluded section
- for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it )
- ;
- } while( it != aSections.end() && nIndex < nFontLen-4 );
- // this should end the ascii part
- if( nIndex > nFontLen-5 )
- goto streamend;
-
- nEndAsciiIndex = nIndex+4;
- // now count backwards until we can account for 512 '0'
- // which is the endmarker of the (hopefully) binary data
- // do not count the pfb header sections
- int nFound = 0;
- nIndex = nFontLen-1;
- while( nIndex > 0 && nFound < 512 )
- {
- for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it )
- ;
- if( it == aSections.end() )
- {
- // inside the 512 '0' block there may only be whitespace
- // according to T1 spec; probably it would be to simple
- // if all fonts complied
- if( pFontData[nIndex] == '0' )
- nFound++;
- else if( nFound > 0 &&
- pFontData[nIndex] != '\r' &&
- pFontData[nIndex] != '\t' &&
- pFontData[nIndex] != '\n' &&
- pFontData[nIndex] != ' ' )
- break;
+ nIndex += nBytes+6;
}
- nIndex--;
- }
-
- if( nIndex < 1 || nIndex <= nEndAsciiIndex )
- goto streamend;
- // there may be whitespace to ignore before the 512 '0'
- while( pFontData[nIndex] == '\r' || pFontData[nIndex] == '\n' )
- {
- nIndex--;
- for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it )
- ;
- if( it != aSections.end() )
- {
- nIndex = (*it)-1;
- break; // this is surely a binary boundary, in ascii case it wouldn't matter
- }
- }
- nEndBinaryIndex = nIndex;
- // and count forward again to the point where we have nFound '0'
- // to get the corect value for nLength3
- sal_Int32 nLength3 = 0;
- sal_Int32 nL3Index = nIndex;
- while( nFound && nL3Index < nFontLen )
- {
- for( it = aSections.begin(); it != aSections.end() && (nL3Index < *it || nL3Index > ((*it) + 5) ); ++it )
- ;
- if( it == aSections.end() )
+ // search for eexec
+ // TODO: use getPfbSegmentLengths() if possible to skip the search thingies below
+ nIndex = 0;
+ int nEndAsciiIndex;
+ int nBeginBinaryIndex;
+ int nEndBinaryIndex;
+ do
{
- // inside the 512 '0' block there may only be whitespace
- // according to T1 spec; probably it would be to simple
- // if all fonts complied
- if( pFontData[nL3Index] == '0' )
- nFound--;
- nLength3++;
- }
- nL3Index++;
- }
-
- // search for beginning of binary section
- nBeginBinaryIndex = nEndAsciiIndex;
- do
- {
- nBeginBinaryIndex++;
- for( it = aSections.begin(); it != aSections.end() && (nBeginBinaryIndex < *it || nBeginBinaryIndex > ((*it) + 5) ); ++it )
- ;
- } while( nBeginBinaryIndex < nEndBinaryIndex &&
- ( pFontData[nBeginBinaryIndex] == '\r' ||
- pFontData[nBeginBinaryIndex] == '\n' ||
- it != aSections.end() ) );
-
- // it seems to be vital to copy the exact whitespace between binary data
- // and eexec, else a invalid font results. so make nEndAsciiIndex
- // always immediate in front of nBeginBinaryIndex
- nEndAsciiIndex = nBeginBinaryIndex-1;
- for( it = aSections.begin(); it != aSections.end() && (nEndAsciiIndex < *it || nEndAsciiIndex > ((*it)+5)); ++it )
- ;
- if( it != aSections.end() )
- nEndAsciiIndex = (*it)-1;
-
- nLength1 = nEndAsciiIndex+1; // including the last character
- for( it = aSections.begin(); it != aSections.end() && *it < nEndAsciiIndex; ++it )
- nLength1 -= 6; // decrease by pfb section size
-
- // if the first four bytes are all ascii hex characters, then binary data
- // has to be converted to real binary data
- for( nIndex = 0; nIndex < 4 &&
- ( ( pFontData[ nBeginBinaryIndex+nIndex ] >= '0' && pFontData[ nBeginBinaryIndex+nIndex ] <= '9' ) ||
- ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'a' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'f' ) ||
- ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'A' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'F' )
- ); ++nIndex )
- ;
- bool bConvertHexData = true;
- if( nIndex < 4 )
- {
- bConvertHexData = false;
- nLength2 = nEndBinaryIndex - nBeginBinaryIndex + 1; // include the last byte
- for( it = aSections.begin(); it != aSections.end(); ++it )
- if( *it > nBeginBinaryIndex && *it < nEndBinaryIndex )
- nLength2 -= 6;
- }
- else
- {
- // count the hex ascii characters to get nLength2
- nLength2 = 0;
- int nNextSectionIndex = 0;
- for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it )
- ;
- if( it != aSections.end() )
- nNextSectionIndex = *it;
- for( nIndex = nBeginBinaryIndex; nIndex <= nEndBinaryIndex; nIndex++ )
+ while( nIndex < nFontLen-4 &&
+ ( pFontData[nIndex] != 'e' ||
+ pFontData[nIndex+1] != 'e' ||
+ pFontData[nIndex+2] != 'x' ||
+ pFontData[nIndex+3] != 'e' ||
+ pFontData[nIndex+4] != 'c'
+ )
+ )
+ nIndex++;
+ // check whether we are in a excluded section
+ for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it )
+ ;
+ } while( it != aSections.end() && nIndex < nFontLen-4 );
+ // this should end the ascii part
+ if( nIndex > nFontLen-5 )
+ throw FontException();
+
+ nEndAsciiIndex = nIndex+4;
+ // now count backwards until we can account for 512 '0'
+ // which is the endmarker of the (hopefully) binary data
+ // do not count the pfb header sections
+ int nFound = 0;
+ nIndex = nFontLen-1;
+ while( nIndex > 0 && nFound < 512 )
{
- if( nIndex == nNextSectionIndex )
+ for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it )
+ ;
+ if( it == aSections.end() )
{
- nIndex += 6;
- ++it;
- nNextSectionIndex = (it == aSections.end() ? 0 : *it );
+ // inside the 512 '0' block there may only be whitespace
+ // according to T1 spec; probably it would be to simple
+ // if all fonts complied
+ if( pFontData[nIndex] == '0' )
+ nFound++;
+ else if( nFound > 0 &&
+ pFontData[nIndex] != '\r' &&
+ pFontData[nIndex] != '\t' &&
+ pFontData[nIndex] != '\n' &&
+ pFontData[nIndex] != ' ' )
+ break;
}
- if( ( pFontData[ nIndex ] >= '0' && pFontData[ nIndex ] <= '9' ) ||
- ( pFontData[ nIndex ] >= 'a' && pFontData[ nIndex ] <= 'f' ) ||
- ( pFontData[ nIndex ] >= 'A' && pFontData[ nIndex ] <= 'F' ) )
- nLength2++;
+ nIndex--;
}
- DBG_ASSERT( !(nLength2 & 1), "uneven number of hex chars in binary pfa section" );
- nLength2 /= 2;
- }
-
- // now we can actually write the font stream !
-#if OSL_DEBUG_LEVEL > 1
- {
- OStringBuffer aLine( " PDFWriterImpl::emitEmbeddedFont" );
- emitComment( aLine.getStr() );
- }
-#endif
- OStringBuffer aLine( 512 );
- nStreamObject = createObject();
- if( !updateObject(nStreamObject))
- goto streamend;
- sal_Int32 nStreamLengthObject = createObject();
- aLine.append( nStreamObject );
- aLine.append( " 0 obj\n"
- "<</Length " );
- aLine.append( nStreamLengthObject );
- aLine.append( " 0 R"
-#ifndef DEBUG_DISABLE_PDFCOMPRESSION
- "/Filter/FlateDecode"
-#endif
- "/Length1 " );
- aLine.append( nLength1 );
- aLine.append( " /Length2 " );
- aLine.append( nLength2 );
- aLine.append( " /Length3 ");
- aLine.append( nLength3 );
- aLine.append( ">>\n"
- "stream\n" );
- if( !writeBuffer( aLine.getStr(), aLine.getLength() ) )
- goto streamend;
- sal_uInt64 nBeginStreamPos = 0;
- osl_getFilePos( m_aFile, &nBeginStreamPos );
+ if( nIndex < 1 || nIndex <= nEndAsciiIndex )
+ throw FontException();
- beginCompression();
- checkAndEnableStreamEncryption( nStreamObject );
-
- // write ascii section
- if( aSections.begin() == aSections.end() )
- {
- if( ! writeBuffer( pFontData, nEndAsciiIndex+1 ) )
- {
- endCompression();
- disableStreamEncryption();
- goto streamend;
- }
- }
- else
- {
- // first section always starts at 0
- it = aSections.begin();
- nIndex = (*it)+6;
- ++it;
- while( *it < nEndAsciiIndex )
+ // nLength3 is the rest of the file - excluding any section headers
+ // nIndex now points to the first of the 512 '0' characters marking the
+ // fixed content portion
+ sal_Int32 nLength3 = nFontLen - nIndex;
+ for( it = aSections.begin(); it != aSections.end(); ++it )
{
- if( ! writeBuffer( pFontData+nIndex, (*it)-nIndex ) )
+ if( *it >= nIndex )
{
- endCompression();
- disableStreamEncryption();
- goto streamend;
+ // special case: nIndex inside a section marker
+ if( nIndex >= (*it) && (*it)+5 > nIndex )
+ nLength3 -= (*it)+5 - nIndex;
+ else
+ {
+ if( *it < nFontLen - 6 )
+ nLength3 -= 6;
+ else // the last section 0x8003 is only 2 bytes after all
+ nLength3 -= (nFontLen - *it);
+ }
}
- nIndex = (*it)+6;
- ++it;
}
- // write partial last section
- if( ! writeBuffer( pFontData+nIndex, nEndAsciiIndex-nIndex+1 ) )
- {
- endCompression();
- disableStreamEncryption();
- goto streamend;
- }
- }
- // write binary section
- if( ! bConvertHexData )
- {
- if( aSections.begin() == aSections.end() )
+ // there may be whitespace to ignore before the 512 '0'
+ while( pFontData[nIndex] == '\r' || pFontData[nIndex] == '\n' )
{
- if( ! writeBuffer( pFontData+nBeginBinaryIndex, nFontLen-nBeginBinaryIndex ) )
+ nIndex--;
+ for( it = aSections.begin(); it != aSections.end() && (nIndex < *it || nIndex > ((*it) + 5) ); ++it )
+ ;
+ if( it != aSections.end() )
{
- endCompression();
- disableStreamEncryption();
- goto streamend;
+ nIndex = (*it)-1;
+ break; // this is surely a binary boundary, in ascii case it wouldn't matter
}
}
- else
+ nEndBinaryIndex = nIndex;
+
+ // search for beginning of binary section
+ nBeginBinaryIndex = nEndAsciiIndex;
+ do
{
- for( it = aSections.begin(); *it < nBeginBinaryIndex; ++it )
+ nBeginBinaryIndex++;
+ for( it = aSections.begin(); it != aSections.end() && (nBeginBinaryIndex < *it || nBeginBinaryIndex > ((*it) + 5) ); ++it )
;
- // write first partial section
- if( ! writeBuffer( pFontData+nBeginBinaryIndex, (*it) - nBeginBinaryIndex ) )
- {
- endCompression();
- disableStreamEncryption();
- goto streamend;
- }
- // write following sections
- while( it != aSections.end() )
- {
- nIndex = (*it)+6;
- ++it;
- if( nIndex < nFontLen ) // last section marker is usually the EOF which has only 2 bytes
+ } while( nBeginBinaryIndex < nEndBinaryIndex &&
+ ( pFontData[nBeginBinaryIndex] == '\r' ||
+ pFontData[nBeginBinaryIndex] == '\n' ||
+ it != aSections.end() ) );
+
+ // it seems to be vital to copy the exact whitespace between binary data
+ // and eexec, else a invalid font results. so make nEndAsciiIndex
+ // always immediate in front of nBeginBinaryIndex
+ nEndAsciiIndex = nBeginBinaryIndex-1;
+ for( it = aSections.begin(); it != aSections.end() && (nEndAsciiIndex < *it || nEndAsciiIndex > ((*it)+5)); ++it )
+ ;
+ if( it != aSections.end() )
+ nEndAsciiIndex = (*it)-1;
+
+ nLength1 = nEndAsciiIndex+1; // including the last character
+ for( it = aSections.begin(); it != aSections.end() && *it < nEndAsciiIndex; ++it )
+ nLength1 -= 6; // decrease by pfb section size
+
+ // if the first four bytes are all ascii hex characters, then binary data
+ // has to be converted to real binary data
+ for( nIndex = 0; nIndex < 4 &&
+ ( ( pFontData[ nBeginBinaryIndex+nIndex ] >= '0' && pFontData[ nBeginBinaryIndex+nIndex ] <= '9' ) ||
+ ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'a' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'f' ) ||
+ ( pFontData[ nBeginBinaryIndex+nIndex ] >= 'A' && pFontData[ nBeginBinaryIndex+nIndex ] <= 'F' )
+ ); ++nIndex )
+ ;
+ bool bConvertHexData = true;
+ if( nIndex < 4 )
+ {
+ bConvertHexData = false;
+ nLength2 = nEndBinaryIndex - nBeginBinaryIndex + 1; // include the last byte
+ for( it = aSections.begin(); it != aSections.end(); ++it )
+ if( *it > nBeginBinaryIndex && *it < nEndBinaryIndex )
+ nLength2 -= 6;
+ }
+ else
{
- sal_Int32 nSectionLen = (it == aSections.end()) ? nFontLen - nIndex : (*it) - nIndex;
- if( ! writeBuffer( pFontData+nIndex, nSectionLen ) )
+ // count the hex ascii characters to get nLength2
+ nLength2 = 0;
+ int nNextSectionIndex = 0;
+ for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it )
+ ;
+ if( it != aSections.end() )
+ nNextSectionIndex = *it;
+ for( nIndex = nBeginBinaryIndex; nIndex <= nEndBinaryIndex; nIndex++ )
{
- endCompression();
- disableStreamEncryption();
- goto streamend;
+ if( nIndex == nNextSectionIndex )
+ {
+ nIndex += 6;
+ ++it;
+ nNextSectionIndex = (it == aSections.end() ? 0 : *it );
+ }
+ if( ( pFontData[ nIndex ] >= '0' && pFontData[ nIndex ] <= '9' ) ||
+ ( pFontData[ nIndex ] >= 'a' && pFontData[ nIndex ] <= 'f' ) ||
+ ( pFontData[ nIndex ] >= 'A' && pFontData[ nIndex ] <= 'F' ) )
+ nLength2++;
}
+ DBG_ASSERT( !(nLength2 & 1), "uneven number of hex chars in binary pfa section" );
+ nLength2 /= 2;
}
- }
- }
- }
- else
- {
- unsigned char* pWriteBuffer = (unsigned char*)rtl_allocateMemory( nLength2 );
- memset( pWriteBuffer, 0, nLength2 );
- int nWriteIndex = 0;
-
- int nNextSectionIndex = 0;
- for( it = aSections.begin(); it != aSections.end() && *it < nBeginBinaryIndex; ++it )
- ;
- if( it != aSections.end() )
- nNextSectionIndex = *it;
- for( nIndex = nBeginBinaryIndex; nIndex <= nEndBinaryIndex; nIndex++ )
- {
- if( nIndex == nNextSectionIndex )
- {
- nIndex += 6;
- ++it;
- nNextSectionIndex = (it == aSections.end() ? nFontLen : *it );
- }
- unsigned char cNibble = 0x80;
- if( pFontData[ nIndex ] >= '0' && pFontData[ nIndex ] <= '9' )
- cNibble = pFontData[nIndex] - '0';
- else if( pFontData[ nIndex ] >= 'a' && pFontData[ nIndex ] <= 'f' )
- cNibble = pFontData[nIndex] - 'a' + 10;
- else if( pFontData[ nIndex ] >= 'A' && pFontData[ nIndex ] <= 'F' )
- cNibble = pFontData[nIndex] - 'A' + 10;
- if( cNibble != 0x80 )
- {
- if( !(nWriteIndex & 1 ) )
- cNibble <<= 4;
- pWriteBuffer[ nWriteIndex/2 ] |= cNibble;
- nWriteIndex++;
- }
- }
- if( ! writeBuffer( pWriteBuffer, nLength2 ) )
- {
- endCompression();
- disableStreamEncryption();
- goto streamend;
- }
- rtl_freeMemory( pWriteBuffer );
- if( aSections.empty() )
- {
- if( ! writeBuffer( pFontData+nIndex, nFontLen-nIndex ) )
- {
- endCompression();
- disableStreamEncryption();
- goto streamend;
- }
- }
- else
- {
- // write rest of this section
- if( nIndex < nNextSectionIndex )
- {
- if( ! writeBuffer( pFontData+nIndex, nNextSectionIndex - nIndex ) )
+ // now we can actually write the font stream !
+ #if OSL_DEBUG_LEVEL > 1
{
- endCompression();
- disableStreamEncryption();
- goto streamend;
+ OStringBuffer aLine( " PDFWriterImpl::emitEmbeddedFont" );
+ emitComment( aLine.getStr() );
}
- }
- // write following sections
- while( it != aSections.end() )
- {
- nIndex = (*it)+6;
- ++it;
- if( nIndex < nFontLen ) // last section marker is usually the EOF which has only 2 bytes
+ #endif
+ OStringBuffer aLine( 512 );
+ nStreamObject = createObject();
+ if( !updateObject(nStreamObject))
+ throw FontException();
+ sal_Int32 nStreamLengthObject = createObject();
+ aLine.append( nStreamObject );
+ aLine.append( " 0 obj\n"
+ "<</Length " );
+ aLine.append( nStreamLengthObject );
+ aLine.append( " 0 R"
+ #ifndef DEBUG_DISABLE_PDFCOMPRESSION
+ "/Filter/FlateDecode"
+ #endif
+ "/Length1 " );
+ aLine.append( nLength1 );
+ aLine.append( " /Length2 " );
+ aLine.append( nLength2 );
+ aLine.append( " /Length3 ");
+ aLine.append( nLength3 );
+ aLine.append( ">>\n"
+ "stream\n" );
+ if( !writeBuffer( aLine.getStr(), aLine.getLength() ) )
+ throw FontException();
+
+ sal_uInt64 nBeginStreamPos = 0;
+ osl_getFilePos( m_aFile, &nBeginStreamPos );
+
+ beginCompression();
+ checkAndEnableStreamEncryption( nStreamObject );
+
+ // write ascii section
+ if( aSections.begin() == aSections.end() )
+ {
+ if( ! writeBuffer( pFontData, nEndAsciiIndex+1 ) )
+ throw FontException();
+ }
+ else
{
- sal_Int32 nSectionLen = (it == aSections.end()) ? nFontLen - nIndex : (*it) - nIndex;
- if( ! writeBuffer( pFontData+nIndex, nSectionLen ) )
+ // first section always starts at 0
+ it = aSections.begin();
+ nIndex = (*it)+6;
+ ++it;
+ while( *it < nEndAsciiIndex )
{
- endCompression();
- disableStreamEncryption();
- goto streamend;
+ if( ! writeBuffer( pFontData+nIndex, (*it)-nIndex ) )
+ throw FontException();
+ nIndex = (*it)+6;
+ ++it;
}
+ // write partial last section
+ if( ! writeBuffer( pFontData+nIndex, nEndAsciiIndex-nIndex+1 ) )
+ throw FontException();
}
- }
- }
- }
- endCompression();
- disableStreamEncryption();
-
-
- sal_uInt64 nEndStreamPos = 0;
- osl_getFilePos( m_aFile, &nEndStreamPos );
- // and finally close th